From ef0057909fcf7eaee6bdff4a58492fd17ffdd9a4 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 11 May 2011 12:19:36 -0400
Subject: [PATCH 001/933] SH-1522 FIX removed old debugging code that generated
 avatar_lad_log.txt

Old debugging code, should be very low risk to remove.
---
 indra/newview/llvoavatar.cpp | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 4767ba2bedf..68637a7ed9f 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5414,18 +5414,6 @@ BOOL LLVOAvatar::loadAvatar()
 		}
 	}
 
-	// Uncomment to enable avatar_lad.xml debugging. 
-	std::ofstream file;
-	file.open("avatar_lad.log");
-	for( LLViewerVisualParam* param = (LLViewerVisualParam*) getFirstVisualParam(); 
-	param;
-	param = (LLViewerVisualParam*) getNextVisualParam() )
-	{
-		param->getInfo()->toStream(file);
-		file << std::endl;
-	}
-
-	file.close();
 	
 	return TRUE;
 }
-- 
GitLab


From 14f6bbadef2c39e58a3b54c0c6212949acf50e45 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 8 Aug 2011 15:29:23 -0500
Subject: [PATCH 002/933] SH-2242 Work in progress migrating to glVertexAttrib
 everywhere

---
 indra/llrender/llgl.cpp                       |  79 +---
 indra/llrender/llgl.h                         |  12 +-
 indra/llrender/llglslshader.cpp               |   4 +
 indra/llrender/llrender.cpp                   |  99 +++++
 indra/llrender/llrender.h                     |   6 +
 indra/llrender/llvertexbuffer.cpp             | 352 ++++++++++++++----
 indra/llrender/llvertexbuffer.h               |  10 +
 indra/newview/app_settings/logcontrol.xml     |   2 +-
 indra/newview/app_settings/settings.xml       |   2 +-
 .../shaders/class1/avatar/avatarSkinV.glsl    |   3 +-
 .../shaders/class1/avatar/avatarV.glsl        |  24 +-
 .../shaders/class1/avatar/eyeballV.glsl       |  15 +-
 .../shaders/class1/avatar/pickAvatarV.glsl    |  16 +-
 .../class1/deferred/alphaSkinnedV.glsl        |  20 +-
 .../shaders/class1/deferred/alphaV.glsl       |  29 +-
 .../class1/deferred/attachmentShadowV.glsl    |  10 +-
 .../shaders/class1/deferred/avatarAlphaV.glsl |  32 +-
 .../shaders/class1/deferred/avatarEyesV.glsl  |  12 +-
 .../class1/deferred/avatarShadowV.glsl        |  23 +-
 .../shaders/class1/deferred/avatarV.glsl      |  25 +-
 .../shaders/class1/deferred/blurLightV.glsl   |   6 +-
 .../shaders/class1/deferred/bumpSkinnedV.glsl |  16 +-
 .../shaders/class1/deferred/bumpV.glsl        |  16 +-
 .../shaders/class1/deferred/cloudsV.glsl      |  11 +-
 .../class1/deferred/diffuseSkinnedV.glsl      |  15 +-
 .../shaders/class1/deferred/diffuseV.glsl     |  14 +-
 .../shaders/class1/deferred/fullbrightV.glsl  |  16 +-
 .../shaders/class1/deferred/giV.glsl          |  12 +-
 .../shaders/class1/deferred/impostorV.glsl    |  10 +-
 .../shaders/class1/deferred/luminanceV.glsl   |  12 +-
 .../class1/deferred/multiPointLightV.glsl     |   6 +-
 .../shaders/class1/deferred/pointLightV.glsl  |  12 +-
 .../class1/deferred/postDeferredV.glsl        |   6 +-
 .../shaders/class1/deferred/postgiV.glsl      |   5 +-
 .../class1/deferred/shadowAlphaMaskV.glsl     |  10 +-
 .../shaders/class1/deferred/shadowV.glsl      |   4 +-
 .../shaders/class1/deferred/skyV.glsl         |  11 +-
 .../shaders/class1/deferred/softenLightF.glsl |   6 +-
 .../shaders/class1/deferred/softenLightV.glsl |  13 +-
 .../shaders/class1/deferred/starsV.glsl       |  10 +-
 .../shaders/class1/deferred/sunLightV.glsl    |  16 +-
 .../shaders/class1/deferred/terrainV.glsl     |  14 +-
 .../shaders/class1/deferred/treeV.glsl        |  12 +-
 .../shaders/class1/deferred/waterV.glsl       |  23 +-
 .../shaders/class1/effects/glowExtractF.glsl  |   2 +-
 .../shaders/class1/effects/glowExtractV.glsl  |   6 +-
 .../shaders/class1/effects/glowV.glsl         |  21 +-
 .../shaders/class1/environment/terrainV.glsl  |  23 +-
 .../shaders/class1/environment/waterV.glsl    |  13 +-
 .../class1/interface/customalphaV.glsl        |   9 +-
 .../class1/interface/glowcombineV.glsl        |   9 +-
 .../shaders/class1/interface/highlightF.glsl  |   4 +-
 .../shaders/class1/interface/highlightV.glsl  |  18 +-
 .../shaders/class1/interface/occlusionV.glsl  |   4 +-
 .../shaders/class1/interface/solidcolorV.glsl |  10 +-
 .../class1/interface/twotextureaddV.glsl      |   9 +-
 .../shaders/class1/interface/uiV.glsl         |  10 +-
 .../shaders/class1/objects/bumpV.glsl         |  13 +-
 .../objects/fullbrightShinySkinnedV.glsl      |  14 +-
 .../class1/objects/fullbrightShinyV.glsl      |  14 +-
 .../class1/objects/fullbrightSkinnedV.glsl    |  14 +-
 .../shaders/class1/objects/fullbrightV.glsl   |  13 +-
 .../class1/objects/shinySimpleSkinnedV.glsl   |  15 +-
 .../shaders/class1/objects/shinyV.glsl        |  13 +-
 .../class1/objects/simpleSkinnedV.glsl        |  15 +-
 .../shaders/class1/objects/simpleV.glsl       |  18 +-
 .../shaders/class2/avatar/eyeballV.glsl       |  16 +-
 .../class2/deferred/alphaSkinnedV.glsl        |  27 +-
 .../shaders/class2/deferred/alphaV.glsl       |  31 +-
 .../shaders/class2/deferred/avatarAlphaV.glsl |  31 +-
 .../shaders/class2/deferred/edgeV.glsl        |   5 +-
 .../shaders/class2/deferred/softenLightV.glsl |  12 +-
 .../shaders/class2/deferred/sunLightV.glsl    |  15 +-
 .../shaders/class2/effects/blurV.glsl         |   6 +-
 .../shaders/class2/effects/drawQuadV.glsl     |  10 +-
 .../shaders/class2/environment/terrainV.glsl  |  22 +-
 .../shaders/class2/lighting/sumLightsV.glsl   |   2 -
 .../class2/objects/fullbrightShinyV.glsl      |  19 +-
 .../shaders/class2/objects/fullbrightV.glsl   |  18 +-
 .../shaders/class2/objects/shinyV.glsl        |  18 +-
 .../shaders/class2/objects/simpleV.glsl       |  20 +-
 .../shaders/class2/windlight/cloudsV.glsl     |  11 +-
 .../shaders/class2/windlight/skyV.glsl        |  10 +-
 .../shaders/class3/avatar/avatarV.glsl        |  27 +-
 .../class3/deferred/giDownsampleV.glsl        |   6 +-
 .../shaders/class3/deferred/giFinalV.glsl     |   5 +-
 .../shaders/class3/deferred/giV.glsl          |  12 +-
 .../shaders/class3/deferred/luminanceV.glsl   |  12 +-
 .../class3/deferred/postDeferredV.glsl        |   6 +-
 .../shaders/class3/deferred/postgiV.glsl      |   6 +-
 .../shaders/class3/deferred/softenLightV.glsl |  11 +-
 .../shaders/class3/lighting/sumLightsV.glsl   |   1 -
 indra/newview/llagent.cpp                     |   2 +-
 indra/newview/lldrawpool.cpp                  |   4 +-
 indra/newview/lldrawpoolalpha.cpp             |  23 +-
 indra/newview/lldrawpoolalpha.h               |   1 +
 indra/newview/lldrawpoolavatar.cpp            |  68 +---
 indra/newview/lldrawpoolbump.cpp              |   2 +-
 indra/newview/lldrawpoolsimple.cpp            |  38 +-
 indra/newview/lldrawpoolsimple.h              |   5 +-
 indra/newview/lldrawpoolsky.cpp               |   6 +-
 indra/newview/lldrawpoolterrain.cpp           |   4 +
 indra/newview/lldrawpooltree.cpp              |   5 +-
 indra/newview/lldrawpoolwater.cpp             |   6 +-
 indra/newview/lldrawpoolwlsky.cpp             |   4 +-
 indra/newview/lldynamictexture.cpp            |   8 +
 indra/newview/llface.cpp                      |  48 ++-
 indra/newview/llface.h                        |   6 +-
 indra/newview/llfloaterimagepreview.cpp       |   4 +-
 indra/newview/llfloatermodelpreview.cpp       |  16 +-
 indra/newview/llmanip.cpp                     |   4 +-
 indra/newview/llmaniptranslate.cpp            |   4 +-
 indra/newview/llpreviewtexture.cpp            |   2 +-
 indra/newview/llselectmgr.cpp                 |   4 +-
 indra/newview/llspatialpartition.cpp          |  74 ++--
 indra/newview/llspatialpartition.h            |   1 -
 indra/newview/lltexlayer.cpp                  |   3 +
 indra/newview/lltextureview.cpp               |   4 +-
 indra/newview/llviewerjointmesh.cpp           |  24 +-
 indra/newview/llviewershadermgr.cpp           | 280 +++++++++++---
 indra/newview/llviewershadermgr.h             |  25 +-
 indra/newview/llviewerwindow.cpp              |   2 +-
 indra/newview/llvosurfacepatch.cpp            |   6 +
 indra/newview/llvovolume.cpp                  |  24 +-
 indra/newview/pipeline.cpp                    |  56 +--
 indra/newview/pipeline.h                      |   4 +
 126 files changed, 1570 insertions(+), 874 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 2f6ef2b6638..f58d4937d45 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1329,8 +1329,6 @@ void LLGLState::initClass()
 
 	sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE;
 	glDisable(GL_MULTISAMPLE_ARB);
-
-	glEnableClientState(GL_VERTEX_ARRAY);
 }
 
 //static
@@ -1604,7 +1602,7 @@ void LLGLState::checkTextureChannels(const std::string& msg)
 
 void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
 {
-	if (!gDebugGL)
+	if (!gDebugGL || LLGLSLShader::sNoFixedFunction)
 	{
 		return;
 	}
@@ -1661,7 +1659,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
 	};
 
 
-	for (S32 j = 0; j < 4; j++)
+	for (S32 j = 1; j < 4; j++)
 	{
 		if (glIsEnabled(value[j]))
 		{
@@ -1875,79 +1873,6 @@ void LLGLManager::initGLStates()
 
 ////////////////////////////////////////////////////////////////////////////////
 
-void enable_vertex_weighting(const S32 index)
-{
-#if GL_ARB_vertex_program
-	if (index > 0) glEnableVertexAttribArrayARB(index);	// vertex weights
-#endif
-}
-
-void disable_vertex_weighting(const S32 index)
-{
-#if GL_ARB_vertex_program
-	if (index > 0) glDisableVertexAttribArrayARB(index);	// vertex weights
-#endif
-}
-
-void enable_binormals(const S32 index)
-{
-#if GL_ARB_vertex_program
-	if (index > 0)
-	{
-		glEnableVertexAttribArrayARB(index);	// binormals
-	}
-#endif
-}
-
-void disable_binormals(const S32 index)
-{
-#if GL_ARB_vertex_program
-	if (index > 0)
-	{
-		glDisableVertexAttribArrayARB(index);	// binormals
-	}
-#endif
-}
-
-
-void enable_cloth_weights(const S32 index)
-{
-#if GL_ARB_vertex_program
-	if (index > 0)	glEnableVertexAttribArrayARB(index);
-#endif
-}
-
-void disable_cloth_weights(const S32 index)
-{
-#if GL_ARB_vertex_program
-	if (index > 0) glDisableVertexAttribArrayARB(index);
-#endif
-}
-
-void set_vertex_weights(const S32 index, const U32 stride, const F32 *weights)
-{
-#if GL_ARB_vertex_program
-	if (index > 0) glVertexAttribPointerARB(index, 1, GL_FLOAT, FALSE, stride, weights);
-	stop_glerror();
-#endif
-}
-
-void set_vertex_clothing_weights(const S32 index, const U32 stride, const LLVector4 *weights)
-{
-#if GL_ARB_vertex_program
-	if (index > 0) glVertexAttribPointerARB(index, 4, GL_FLOAT, TRUE, stride, weights);
-	stop_glerror();
-#endif
-}
-
-void set_binormals(const S32 index, const U32 stride,const LLVector3 *binormals)
-{
-#if GL_ARB_vertex_program
-	if (index > 0) glVertexAttribPointerARB(index, 3, GL_FLOAT, FALSE, stride, binormals);
-	stop_glerror();
-#endif
-}
-
 void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor_specific )
 {
 	// GL_VERSION returns a null-terminated string with the format: 
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index d736133f3ff..495e523c311 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -252,7 +252,7 @@ class LLGLState
 	static void dumpStates();
 	static void checkStates(const std::string& msg = "");
 	static void checkTextureChannels(const std::string& msg = "");
-	static void checkClientArrays(const std::string& msg = "", U32 data_mask = 0x0001);
+	static void checkClientArrays(const std::string& msg = "", U32 data_mask = 0);
 	
 protected:
 	static boost::unordered_map<LLGLenum, LLGLboolean> sStateMap;
@@ -419,15 +419,7 @@ extern LLMatrix4 gGLObliqueProjectionInverse;
 #include "llglstates.h"
 
 void init_glstates();
-void enable_vertex_weighting(const S32 index);
-void disable_vertex_weighting(const S32 index);
-void enable_binormals(const S32 index);
-void disable_binormals(const S32 index);
-void enable_cloth_weights(const S32 index);
-void disable_cloth_weights(const S32 index);
-void set_vertex_weights(const S32 index, const U32 stride, const F32 *weights);
-void set_vertex_clothing_weights(const S32 index, const U32 stride, const LLVector4 *weights);
-void set_binormals(const S32 index, const U32 stride, const LLVector3 *binormals);
+
 void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor_specific );
 
 extern BOOL gClothRipple;
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index f51d83abe48..b6cb84d10c3 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -31,6 +31,7 @@
 #include "llshadermgr.h"
 #include "llfile.h"
 #include "llrender.h"
+#include "llvertexbuffer.h"
 
 #if LL_DARWIN
 #include "OpenGL/OpenGL.h"
@@ -386,6 +387,7 @@ void LLGLSLShader::bind()
 	gGL.flush();
 	if (gGLManager.mHasShaderObjects)
 	{
+		LLVertexBuffer::unbind();
 		glUseProgramObjectARB(mProgramObject);
 		sCurBoundShader = mProgramObject;
 		sCurBoundShaderPtr = this;
@@ -411,6 +413,7 @@ void LLGLSLShader::unbind()
 				stop_glerror();
 			}
 		}
+		LLVertexBuffer::unbind();
 		glUseProgramObjectARB(0);
 		sCurBoundShader = 0;
 		sCurBoundShaderPtr = NULL;
@@ -420,6 +423,7 @@ void LLGLSLShader::unbind()
 
 void LLGLSLShader::bindNoShader(void)
 {
+	LLVertexBuffer::unbind();
 	glUseProgramObjectARB(0);
 	sCurBoundShader = 0;
 	sCurBoundShaderPtr = NULL;
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index d72918b15d0..da85bc202cd 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1580,6 +1580,105 @@ void LLRender::color3fv(const GLfloat* c)
 	color4f(c[0],c[1],c[2],1);
 }
 
+void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	S32 loc = -1;
+	if (shader)
+	{
+		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+	}
+
+	if (loc >= 0)
+	{
+		glVertexAttrib3fARB(loc, r,g,b);
+	}
+	else
+	{
+		glColor3f(r,g,b);
+	}
+}
+
+void LLRender::diffuseColor3fv(const F32* c)
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	S32 loc = -1;
+	if (shader)
+	{
+		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+	}
+
+	if (loc >= 0)
+	{
+		glVertexAttrib3fvARB(loc, c);
+	}
+	else
+	{
+		glColor3fv(c);
+	}
+}
+
+void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	S32 loc = -1;
+	if (shader)
+	{
+		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+	}
+
+	if (loc >= 0)
+	{
+		glVertexAttrib4fARB(loc, r,g,b,a);
+	}
+	else
+	{
+		glColor4f(r,g,b,a);
+	}
+
+}
+
+void LLRender::diffuseColor4fv(const F32* c)
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	S32 loc = -1;
+	if (shader)
+	{
+		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+	}
+
+	if (loc >= 0)
+	{
+		glVertexAttrib4fvARB(loc, c);
+	}
+	else
+	{
+		glColor4fv(c);
+	}
+}
+
+void LLRender::diffuseColor4ubv(const U8* c)
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	S32 loc = -1;
+	if (shader)
+	{
+		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+	}
+
+	if (loc >= 0)
+	{
+		glVertexAttrib4ubvARB(loc, c);
+	}
+	else
+	{
+		glColor4ubv(c);
+	}
+}
+
+
+
+
 void LLRender::debugTexUnits(void)
 {
 	LL_INFOS("TextureUnit") << "Active TexUnit: " << mCurrTextureUnitIndex << LL_ENDL;
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 9eedebe2ce0..5f97bff1c49 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -350,6 +350,12 @@ class LLRender
 	void color3fv(const GLfloat* c);
 	void color4ubv(const GLubyte* c);
 
+	void diffuseColor3f(F32 r, F32 g, F32 b);
+	void diffuseColor3fv(const F32* c);
+	void diffuseColor4f(F32 r, F32 g, F32 b, F32 a);
+	void diffuseColor4fv(const F32* c);
+	void diffuseColor4ubv(const U8* c);
+
 	void vertexBatchPreTransformed(LLVector3* verts, S32 vert_count);
 	void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count);
 	void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLColor4U*, S32 vert_count);
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 1180afa6313..30f73bf2c61 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -130,6 +130,7 @@ S32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] =
 	sizeof(LLVector2), // TYPE_TEXCOORD2,
 	sizeof(LLVector2), // TYPE_TEXCOORD3,
 	sizeof(LLColor4U), // TYPE_COLOR,
+	sizeof(U8),		   // TYPE_EMISSIVE
 	sizeof(LLVector4), // TYPE_BINORMAL,
 	sizeof(F32),	   // TYPE_WEIGHT,
 	sizeof(LLVector4), // TYPE_WEIGHT4,
@@ -156,36 +157,79 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 		llerrs << "Cannot use LLGLImmediate and LLVertexBuffer simultaneously!" << llendl;
 	}*/
 
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
 	if (sLastMask != data_mask)
 	{
+		llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
+		static LLGLSLShader* last_shader = LLGLSLShader::sCurBoundShaderPtr;
+		llassert(sLastMask == 0 || last_shader == shader);
+		last_shader = shader;
+
 		U32 mask[] =
 		{
 			MAP_VERTEX,
 			MAP_NORMAL,
 			MAP_TEXCOORD0,
 			MAP_COLOR,
+			MAP_EMISSIVE,
+			MAP_WEIGHT,
+			MAP_WEIGHT4,
+			MAP_BINORMAL,
+			MAP_CLOTHWEIGHT,
 		};
 		
+		U32 type[] =
+		{
+			TYPE_VERTEX,
+			TYPE_NORMAL,
+			TYPE_TEXCOORD0,
+			TYPE_COLOR,
+			TYPE_EMISSIVE,
+			TYPE_WEIGHT,
+			TYPE_WEIGHT4,
+			TYPE_BINORMAL,
+			TYPE_CLOTHWEIGHT,
+		};
+
 		GLenum array[] =
 		{
 			GL_VERTEX_ARRAY,
 			GL_NORMAL_ARRAY,
 			GL_TEXTURE_COORD_ARRAY,
 			GL_COLOR_ARRAY,
+			0,
+			0,
+			0,
+			0,
+			0,
 		};
 
 		BOOL error = FALSE;
-		for (U32 i = 0; i < 4; ++i)
+		for (U32 i = 0; i < 9; ++i)
 		{
+			S32 loc = -1;
+			if (shader)
+			{
+				loc = shader->getAttribLocation(type[i]);
+			}
+
 			if (sLastMask & mask[i])
 			{ //was enabled
-				if (!(data_mask & mask[i]) && i > 0)
+				if (!(data_mask & mask[i]))
 				{ //needs to be disabled
-					glDisableClientState(array[i]);
+					if (loc >= 0)
+					{
+						glDisableVertexAttribArrayARB(loc);
+					}
+					else if (!shader)
+					{
+						glDisableClientState(array[i]);
+					}
 				}
-				else if (gDebugGL)
-				{ //needs to be enabled, make sure it was (DEBUG TEMPORARY)
-					if (i > 0 && !glIsEnabled(array[i]))
+				else if (gDebugGL && !shader && array[i])
+				{ //needs to be enabled, make sure it was (DEBUG)
+					if (loc < 0 && !glIsEnabled(array[i]))
 					{
 						if (gDebugSession)
 						{
@@ -201,11 +245,18 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 			}
 			else 
 			{	//was disabled
-				if (data_mask & mask[i] && i > 0)
+				if (data_mask & mask[i])
 				{ //needs to be enabled
-					glEnableClientState(array[i]);
+					if (loc >= 0)
+					{
+						glEnableVertexAttribArrayARB(loc);
+					}
+					else if (!shader)
+					{
+						glEnableClientState(array[i]);
+					}
 				}
-				else if (gDebugGL && i > 0 && glIsEnabled(array[i]))
+				else if (!shader && array[i] && gDebugGL && glIsEnabled(array[i]))
 				{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
 					if (gDebugSession)
 					{
@@ -232,62 +283,71 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 			MAP_TEXCOORD3
 		};
 
+		U32 type_tc[] = 
+		{
+			TYPE_TEXCOORD1,
+			TYPE_TEXCOORD2,
+			TYPE_TEXCOORD3
+		};
+
 		for (U32 i = 0; i < 3; i++)
 		{
+			S32 loc = -1;
+			if (shader)
+			{
+				loc = shader->getAttribLocation(type_tc[i]);
+			}
+
 			if (sLastMask & map_tc[i])
 			{
 				if (!(data_mask & map_tc[i]))
-				{
-					glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
-					glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-					glClientActiveTextureARB(GL_TEXTURE0_ARB);
+				{ //disable
+					if (loc >= 0)
+					{
+						glDisableVertexAttribArrayARB(loc);
+					}
+					else if (!shader)
+					{
+						glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
+						glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+						glClientActiveTextureARB(GL_TEXTURE0_ARB);
+					}
 				}
 			}
 			else if (data_mask & map_tc[i])
 			{
-				glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
-				glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-				glClientActiveTextureARB(GL_TEXTURE0_ARB);
+				if (loc >= 0)
+				{
+					glEnableVertexAttribArrayARB(loc);
+				}
+				else if (!shader)
+				{
+					glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
+					glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+					glClientActiveTextureARB(GL_TEXTURE0_ARB);
+				}
 			}
 		}
 
-		if (sLastMask & MAP_BINORMAL)
+		if (!shader)
 		{
-			if (!(data_mask & MAP_BINORMAL))
+			if (sLastMask & MAP_BINORMAL)
 			{
-				glClientActiveTextureARB(GL_TEXTURE2_ARB);
-				glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-				glClientActiveTextureARB(GL_TEXTURE0_ARB);
+				if (!(data_mask & MAP_BINORMAL))
+				{
+					glClientActiveTextureARB(GL_TEXTURE2_ARB);
+					glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+					glClientActiveTextureARB(GL_TEXTURE0_ARB);
+				}
 			}
-		}
-		else if (data_mask & MAP_BINORMAL)
-		{
-			glClientActiveTextureARB(GL_TEXTURE2_ARB);
-			glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-			glClientActiveTextureARB(GL_TEXTURE0_ARB);
-		}
-	
-		if (sLastMask & MAP_WEIGHT4)
-		{
-			if (sWeight4Loc < 0)
+			else if (data_mask & MAP_BINORMAL)
 			{
-				llerrs << "Weighting disabled but vertex buffer still bound!" << llendl;
-			}
-
-			if (!(data_mask & MAP_WEIGHT4))
-			{ //disable 4-component skin weight			
-				glDisableVertexAttribArrayARB(sWeight4Loc);
-			}
-		}
-		else if (data_mask & MAP_WEIGHT4)
-		{
-			if (sWeight4Loc >= 0)
-			{ //enable 4-component skin weight
-				glEnableVertexAttribArrayARB(sWeight4Loc);
+				glClientActiveTextureARB(GL_TEXTURE2_ARB);
+				glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+				glClientActiveTextureARB(GL_TEXTURE0_ARB);
 			}
 		}
-				
-
+		
 		sLastMask = data_mask;
 	}
 }
@@ -1592,6 +1652,10 @@ bool LLVertexBuffer::getColorStrider(LLStrider<LLColor4U>& strider, S32 index, S
 {
 	return VertexBufferStrider<LLColor4U,TYPE_COLOR>::get(*this, strider, index, count, map_range);
 }
+bool LLVertexBuffer::getEmissiveStrider(LLStrider<U8>& strider, S32 index, S32 count, bool map_range)
+{
+	return VertexBufferStrider<U8,TYPE_EMISSIVE>::get(*this, strider, index, count, map_range);
+}
 bool LLVertexBuffer::getWeightStrider(LLStrider<F32>& strider, S32 index, S32 count, bool map_range)
 {
 	return VertexBufferStrider<F32,TYPE_WEIGHT>::get(*this, strider, index, count, map_range);
@@ -1810,46 +1874,166 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 		llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
 	}
 
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	//assert that fixed function is allowed OR a shader is currently bound
+	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
+
 	if (data_mask & MAP_NORMAL)
 	{
-		glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_NORMAL);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
+		}
+		else if (!shader)
+		{
+			glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
+		}
 	}
 	if (data_mask & MAP_TEXCOORD3)
 	{
-		glClientActiveTextureARB(GL_TEXTURE3_ARB);
-		glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
-		glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_TEXCOORD3);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
+		}
+		else if (!shader)
+		{
+			glClientActiveTextureARB(GL_TEXTURE3_ARB);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		}
 	}
 	if (data_mask & MAP_TEXCOORD2)
 	{
-		glClientActiveTextureARB(GL_TEXTURE2_ARB);
-		glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
-		glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_TEXCOORD2);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
+		}
+		else if (!shader)
+		{
+			glClientActiveTextureARB(GL_TEXTURE2_ARB);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		}
 	}
 	if (data_mask & MAP_TEXCOORD1)
 	{
-		glClientActiveTextureARB(GL_TEXTURE1_ARB);
-		glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
-		glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_TEXCOORD1);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
+		}
+		else if (!shader)
+		{
+			glClientActiveTextureARB(GL_TEXTURE1_ARB);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		}
 	}
 	if (data_mask & MAP_BINORMAL)
 	{
-		glClientActiveTextureARB(GL_TEXTURE2_ARB);
-		glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
-		glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_BINORMAL);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
+		}
+		else if (!shader)
+		{
+			glClientActiveTextureARB(GL_TEXTURE2_ARB);
+			glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+		}
 	}
 	if (data_mask & MAP_TEXCOORD0)
 	{
-		glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_TEXCOORD0);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
+		}
+		else if (!shader)
+		{
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
+		}
 	}
 	if (data_mask & MAP_COLOR)
 	{
-		glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_COLOR);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
+		}
+		else if (!shader)
+		{
+			glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
+		}
+	}
+	if (data_mask & MAP_EMISSIVE)
+	{
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_EMISSIVE);
+		}
+
+		if (loc >= 0)
+		{
+			glVertexAttribPointerARB(loc, 1, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], (void*)(base + mOffsets[TYPE_EMISSIVE]));
+		}
 	}
-	
 	if (data_mask & MAP_WEIGHT)
 	{
-		glVertexAttribPointerARB(1, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], (void*)(base + mOffsets[TYPE_WEIGHT]));
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_WEIGHT);
+		}
+
+		if (loc < 0)
+		{ //legacy behavior, some shaders have weight hardcoded to location 1
+			loc = 1;
+		}
+		
+		glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], (void*)(base + mOffsets[TYPE_WEIGHT]));
+		
 	}
 
 	if (data_mask & MAP_WEIGHT4 && sWeight4Loc != -1)
@@ -1859,17 +2043,47 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 	if (data_mask & MAP_CLOTHWEIGHT)
 	{
-		glVertexAttribPointerARB(4, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
+		S32 loc = -1;
+		if (shader)
+		{
+			loc = shader->getAttribLocation(TYPE_CLOTHWEIGHT);
+		}
+
+		if (loc < 0)
+		{ //legacy behavior, some shaders have weight hardcoded to location 4
+			loc = 4;
+		}
+		glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
 	}
 	if (data_mask & MAP_VERTEX)
 	{
-		if (data_mask & MAP_TEXTURE_INDEX)
+		S32 loc = -1;
+		if (shader)
 		{
-			glVertexPointer(4,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			loc = shader->getAttribLocation(TYPE_VERTEX);
 		}
-		else
+
+		if (loc >= 0)
 		{
-			glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			if (data_mask & MAP_TEXTURE_INDEX)
+			{
+				glVertexAttribPointerARB(loc, 4,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			}
+			else
+			{
+				glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			}
+		}
+		else if (!shader)
+		{
+			if (data_mask & MAP_TEXTURE_INDEX)
+			{
+				glVertexPointer(4,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			}
+			else
+			{
+				glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			}
 		}
 	}
 
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index cc5d11e1c29..3cccdf62ec1 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -133,6 +133,12 @@ class LLVertexBuffer : public LLRefCount
 	static S32 calcOffsets(const U32& typemask, S32* offsets, S32 num_vertices);		
 
 	
+	//WARNING -- when updating these enums you MUST 
+	// 1 - update LLVertexBuffer::sTypeSize
+	// 2 - add a strider accessor
+	// 3 - modify LLVertexBuffer::setupVertexBuffer
+	// 4 - modify LLVertexBuffer::setupClientArray
+	// 5 - modify LLViewerShaderMgr::mReservedAttribs
 	enum {
 		TYPE_VERTEX,
 		TYPE_NORMAL,
@@ -141,6 +147,7 @@ class LLVertexBuffer : public LLRefCount
 		TYPE_TEXCOORD2,
 		TYPE_TEXCOORD3,
 		TYPE_COLOR,
+		TYPE_EMISSIVE,
 		// These use VertexAttribPointer and should possibly be made generic
 		TYPE_BINORMAL,
 		TYPE_WEIGHT,
@@ -160,6 +167,7 @@ class LLVertexBuffer : public LLRefCount
 		MAP_TEXCOORD2 = (1<<TYPE_TEXCOORD2),
 		MAP_TEXCOORD3 = (1<<TYPE_TEXCOORD3),
 		MAP_COLOR = (1<<TYPE_COLOR),
+		MAP_EMISSIVE = (1<<TYPE_EMISSIVE),
 		// These use VertexAttribPointer and should possibly be made generic
 		MAP_BINORMAL = (1<<TYPE_BINORMAL),
 		MAP_WEIGHT = (1<<TYPE_WEIGHT),
@@ -218,10 +226,12 @@ class LLVertexBuffer : public LLRefCount
 	bool getNormalStrider(LLStrider<LLVector3>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getBinormalStrider(LLStrider<LLVector3>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getColorStrider(LLStrider<LLColor4U>& strider, S32 index=0, S32 count = -1, bool map_range = false);
+	bool getEmissiveStrider(LLStrider<U8>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getWeightStrider(LLStrider<F32>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getWeight4Strider(LLStrider<LLVector4>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	
+
 	BOOL isEmpty() const					{ return mEmpty; }
 	BOOL isLocked() const					{ return mVertexLocked || mIndexLocked; }
 	S32 getNumVerts() const					{ return mNumVerts; }
diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml
index ae72dee9002..a76eb3cd372 100644
--- a/indra/newview/app_settings/logcontrol.xml
+++ b/indra/newview/app_settings/logcontrol.xml
@@ -43,7 +43,7 @@
 					<key>tags</key>
 						<array>
 							<!-- sample entry for debugging a specific item	-->
-<!--						<string>Voice</string>							-->
+<!--						<string>Voice</string>		-->
 						</array>
 				</map>
 			</array>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9bb320d8826..ed1e3c2057c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7565,7 +7565,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
   <key>RenderDebugNormalScale</key>
   <map>
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index d9f29ced4fd..81b632e7fae 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
@@ -6,8 +6,7 @@
  */
  
 
-
-attribute vec4 weight;  //1
+attribute vec4 weight;
 
 uniform vec4 matrixPalette[45];
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index 2796222c68d..ec7359d565c 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -5,7 +5,9 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -13,31 +15,33 @@ void calcAtmospherics(vec3 inPositionEye);
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 				
 	vec4 pos;
 	vec3 norm;
 	
+	vec4 pos_in = vec4(position.xyz, 1.0);
+
 	mat4 trans = getSkinnedTransform();
-	pos.x = dot(trans[0], gl_Vertex);
-	pos.y = dot(trans[1], gl_Vertex);
-	pos.z = dot(trans[2], gl_Vertex);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 	
-	norm.x = dot(trans[0].xyz, gl_Normal);
-	norm.y = dot(trans[1].xyz, gl_Normal);
-	norm.z = dot(trans[2].xyz, gl_Normal);
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
 	gl_Position = gl_ProjectionMatrix * pos;
 	
-	//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	//gl_Position = gl_ModelViewProjectionMatrix * position;
 	
 	gl_FogFragCoord = length(pos.xyz);
 
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0,0,0,0));
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
 	gl_FrontColor = color; 
 
 }
diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
index 2eb814bd91e..0b075feef52 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
 
 vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -13,16 +17,17 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	vec3 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)).xyz;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 		
 	calcAtmospherics(pos.xyz);
 
 	vec4 specular = vec4(1.0);
-	vec4 color = calcLightingSpecular(pos, norm, gl_Color, specular, vec4(0.0));	
+	vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));	
 	gl_FrontColor = color;
 
 }
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
index 86b189b282c..dcc891b16f6 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
@@ -5,21 +5,23 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 mat4 getSkinnedTransform();
 
 void main()
 {
 	vec4 pos;
-		
+	vec4 pos_in = vec4(position, 1.0);
 	mat4 trans = getSkinnedTransform();
-	pos.x = dot(trans[0], gl_Vertex);
-	pos.y = dot(trans[1], gl_Vertex);
-	pos.z = dot(trans[2], gl_Vertex);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 			
-	gl_FrontColor = gl_Color;
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_FrontColor = diffuse_color;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_Position = gl_ProjectionMatrix * pos;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index ac3f7189c2f..eeebae4464e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getObjectSkinnedTransform();
@@ -59,7 +63,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 				
 	vec4 pos;
 	vec3 norm;
@@ -67,9 +71,9 @@ void main()
 	mat4 trans = getObjectSkinnedTransform();
 	trans = gl_ModelViewMatrix * trans;
 	
-	pos = trans * gl_Vertex;
+	pos = trans * vec4(position.xyz, 1.0);
 	
-	norm = gl_Vertex.xyz + gl_Normal.xyz;
+	norm = position.xyz + normal.xyz;
 	norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
 	
 	vec4 frag_pos = gl_ProjectionMatrix * pos;
@@ -80,7 +84,7 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -90,17 +94,17 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*gl_Color.rgb;
+	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb*gl_Color.rgb;
-	vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+	vary_ambient = col.rgb*diffuse_color.rgb;
+	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
-	col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 44cb78e9147..3a17f6a7090 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
 
-
+attribute vec4 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -62,22 +65,22 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz, 1.0);
-	vary_texture_index = gl_Vertex.w;
-	gl_Position = gl_ModelViewProjectionMatrix * vert; 
+	vec4 vert = vec4(position.xyz, 1.0);
+	vary_texture_index = position.w;
+	vec4 pos = (gl_ModelViewMatrix * vert);
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 	
 	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
 	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
 		
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
-	vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -87,7 +90,7 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*gl_Color.rgb;
+	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
@@ -96,10 +99,10 @@ void main()
 	
 	vary_light = gl_LightSource[0].position.xyz;
 	
-	vary_ambient = col.rgb*gl_Color.rgb;
-	vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+	vary_ambient = col.rgb*diffuse_color.rgb;
+	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
-	col.rgb = col.rgb*gl_Color.rgb;
+	col.rgb = col.rgb*diffuse_color.rgb;
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index c7a4f867271..df61785aa1d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -5,21 +5,23 @@
  * $License$
  */
 
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 mat4 getObjectSkinnedTransform();
 
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 	
 	vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0);
 	p.z = max(p.z, -p.w+0.01);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 68e4055cf22..842931ec172 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -59,20 +62,21 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 				
 	vec4 pos;
 	vec3 norm;
 	
 	mat4 trans = getSkinnedTransform();
-	pos.x = dot(trans[0], gl_Vertex);
-	pos.y = dot(trans[1], gl_Vertex);
-	pos.z = dot(trans[2], gl_Vertex);
+	vec4 pos_in = vec4(position.xyz, 1.0);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 	
-	norm.x = dot(trans[0].xyz, gl_Normal);
-	norm.y = dot(trans[1].xyz, gl_Normal);
-	norm.z = dot(trans[2].xyz, gl_Normal);
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
 	vec4 frag_pos = gl_ProjectionMatrix * pos;
@@ -82,9 +86,9 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 
-	vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -94,17 +98,17 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*gl_Color.rgb;
+	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb*gl_Color.rgb;
-	vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+	vary_ambient = col.rgb*diffuse_color.rgb;
+	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
-	col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index 7bc78fe4074..bdea3d2b579 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -6,16 +6,20 @@
  */
  
 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 varying vec3 vary_normal;
 
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+	vary_normal = normalize(gl_NormalMatrix * normal);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index f177fcd8f11..cf6fc1c0ed4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -9,26 +9,31 @@
 
 mat4 getSkinnedTransform();
 
-attribute vec4 weight;
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+
 
 varying vec4 post_pos;
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 				
 	vec4 pos;
 	vec3 norm;
 	
+	vec4 pos_in = vec4(position.xyz, 1.0);
 	mat4 trans = getSkinnedTransform();
-	pos.x = dot(trans[0], gl_Vertex);
-	pos.y = dot(trans[1], gl_Vertex);
-	pos.z = dot(trans[2], gl_Vertex);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 	
-	norm.x = dot(trans[0].xyz, gl_Normal);
-	norm.y = dot(trans[1].xyz, gl_Normal);
-	norm.z = dot(trans[2].xyz, gl_Normal);
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 	
 	pos = gl_ProjectionMatrix * pos;
@@ -36,7 +41,7 @@ void main()
 
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
 
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 7eac11287a2..e66f8c84836 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
 
 mat4 getSkinnedTransform();
 
@@ -15,28 +18,28 @@ varying vec3 vary_normal;
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 				
 	vec4 pos;
 	vec3 norm;
 	
+	vec4 pos_in = vec4(position.xyz, 1.0);
 	mat4 trans = getSkinnedTransform();
-	pos.x = dot(trans[0], gl_Vertex);
-	pos.y = dot(trans[1], gl_Vertex);
-	pos.z = dot(trans[2], gl_Vertex);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 	
-	norm.x = dot(trans[0].xyz, gl_Normal);
-	norm.y = dot(trans[1].xyz, gl_Normal);
-	norm.z = dot(trans[2].xyz, gl_Normal);
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 	
 	vary_normal = norm;
 	
 	gl_Position = gl_ProjectionMatrix * pos;
-	//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;	
-	
-	gl_FrontColor = gl_Color;
+		
+	gl_FrontColor = diffuse_color;
 }
 
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 862f809de53..016b5e10087 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -5,7 +5,7 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
 
 varying vec2 vary_fragcoord;
 uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
index dc69519a859..93e00fe523f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -5,7 +5,11 @@
  * $License$
  */
 
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+attribute vec2 texcoord2;
 
 varying vec3 vary_mat0;
 varying vec3 vary_mat1;
@@ -15,17 +19,17 @@ mat4 getObjectSkinnedTransform();
 
 void main()
 {
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
 	
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	
-	vec3 n = normalize((mat * vec4(gl_Normal.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz);
-	vec3 b = normalize((mat * vec4(gl_MultiTexCoord2.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz);
+	vec3 n = normalize((mat * vec4(normal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
+	vec3 b = normalize((mat * vec4(vec4(texcoord2,0,1).xyz+position.xyz, 1.0)).xyz-pos.xyz);
 	vec3 t = cross(b, n);
 	
 	vary_mat0 = vec3(t.x, b.x, n.x);
@@ -33,5 +37,5 @@ void main()
 	vary_mat2 = vec3(t.z, b.z, n.z);
 	
 	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index 5b6726488bd..3c287760459 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -5,7 +5,11 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+attribute vec2 texcoord2;
 
 varying vec3 vary_mat0;
 varying vec3 vary_mat1;
@@ -14,16 +18,16 @@ varying vec3 vary_mat2;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vec3 n = normalize(gl_NormalMatrix * gl_Normal);
-	vec3 b = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz);
+	vec3 n = normalize(gl_NormalMatrix * normal);
+	vec3 b = normalize(gl_NormalMatrix * vec4(texcoord2,0,1).xyz);
 	vec3 t = cross(b, n);
 	
 	vary_mat0 = vec3(t.x, b.x, n.x);
 	vary_mat1 = vec3(t.y, b.y, n.y);
 	vary_mat2 = vec3(t.z, b.z, n.z);
 	
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 3eac63076c1..9ba5e97a953 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -5,7 +5,8 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 //////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
@@ -41,12 +42,12 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = ftransform();
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
 	// Get relative position
-	vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
+	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
 
 	// Set altitude
 	if (P.y > 0.)
@@ -142,7 +143,7 @@ void main()
 
 
 	// Texture coords
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_TexCoord[0].xy -= 0.5;
 	gl_TexCoord[0].xy /= cloud_scale.x;
 	gl_TexCoord[0].xy += 0.5;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index 2c4caea1090..fadbe5b9ef3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -7,27 +7,32 @@
 
 
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
 varying vec3 vary_normal;
 
 mat4 getObjectSkinnedTransform();
 
 void main()
 {
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	vec4 norm = gl_Vertex;
-	norm.xyz += gl_Normal.xyz;
+	vec4 norm = vec4(position.xyz, 1.0);
+	norm.xyz += normal.xyz;
 	norm.xyz = (mat*norm).xyz;
 	norm.xyz = normalize(norm.xyz-pos.xyz);
 
 	vary_normal = norm.xyz;
 			
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 	
 	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index b56d1493c3a..e4247377020 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec4 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
 
 varying vec3 vary_normal;
 varying float vary_texture_index;
@@ -13,11 +17,11 @@ varying float vary_texture_index;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vary_texture_index = gl_Vertex.w;
-	vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+	vary_texture_index = position.w;
+	vary_normal = normalize(gl_NormalMatrix * normal);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 2eed044b7cc..3e5fc7a36b5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -6,6 +6,9 @@
  */
  
 
+attribute vec4 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -19,18 +22,17 @@ varying float vary_texture_index;
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz, 1.0);
-	vary_texture_index = gl_Vertex.w;
+	vec4 vert = vec4(position.xyz, 1.0);
+	vec4 pos = (gl_ModelViewMatrix * vert);
+	vary_texture_index = position.w;
 
-	gl_Position = gl_ModelViewProjectionMatrix*vert; 
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vec4 pos = (gl_ModelViewMatrix * vert);
-				
 	calcAtmospherics(pos.xyz);
 	
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
index e86f2896da5..d97d7ea82d8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
@@ -5,6 +5,9 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 
 varying vec2 vary_fragcoord;
@@ -14,11 +17,12 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = gl_MultiTexCoord0;
+	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 723777bd3a3..cb47f62bbf8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -5,13 +5,15 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
index 4baf1fc65aa..6a536447233 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
@@ -5,8 +5,9 @@
  * $/LicenseInfo$
  */
 
-
-
+ 
+attribute vec3 position;
+attribute vec4 diffuse_color;
 
 varying vec2 vary_fragcoord;
 
@@ -15,9 +16,10 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos;
+	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 434fb6f5346..7db577c07ab 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -6,15 +6,17 @@
  */
 
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
 
 varying vec4 vary_fragcoord;
 
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	vary_fragcoord = pos;
 
 	gl_Position = pos;
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index c510d8ad779..ac3170d16d5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -5,7 +5,9 @@
  * $/LicenseInfo$
  */
 
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 varying vec4 vary_light;
 varying vec4 vary_fragcoord;
@@ -13,15 +15,15 @@ varying vec4 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	vary_fragcoord = pos;
 		
-	vec4 tex = gl_MultiTexCoord0;
+	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 	
-	vary_light = gl_MultiTexCoord0;
+	vary_light = vec4(texcoord0,0,1);
 	
 	gl_Position = pos;
 		
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index 876f65ee3ad..30dbe3f75e8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -5,7 +5,7 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
 
 varying vec2 vary_fragcoord;
 uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos;	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
index eebe930666a..38525044ba0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
@@ -5,6 +5,7 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
 
 
 varying vec2 vary_fragcoord;
@@ -13,7 +14,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index 58e9bcec584..6bbbfdd8ee9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -5,19 +5,21 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 varying vec4 post_pos;
 
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
 	
 	post_pos = pos;
 	
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	gl_FrontColor = gl_Color;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
index d40c2d9f78f..7a8ac14f5e4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
@@ -5,14 +5,14 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
 
 varying vec4 post_pos;
 
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
 	
 	post_pos = pos;
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 1ea00f723af..8dfb466e88b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -5,7 +5,8 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 // SKY ////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
@@ -39,12 +40,12 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = ftransform();
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
 	// Get relative position
-	vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
-	//vec3 P = gl_Vertex.xyz + vec3(0,50,0);
+	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
+	//vec3 P = position.xyz + vec3(0,50,0);
 
 	// Set altitude
 	if (P.y > 0.)
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index d327216a0cb..3ba5ee5bd22 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -45,7 +45,7 @@ uniform vec3 env_mat[3];
 //uniform vec4 shadow_clip;
 uniform mat3 ssao_effect_mat;
 
-varying vec4 vary_light;
+uniform vec3 sun_dir;
 varying vec2 vary_fragcoord;
 
 vec3 vary_PositionEye;
@@ -265,7 +265,7 @@ void main()
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
 	//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
 	
-	float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
+	float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
 	
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
 	vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
@@ -286,7 +286,7 @@ void main()
 			// the old infinite-sky shiny reflection
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-			float sa = dot(refnormpersp, vary_light.xyz);
+			float sa = dot(refnormpersp, sun_dir.xyz);
 			vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
 			
 			// add the two types of shiny together
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
index 745cc019923..5b3f655edf2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
@@ -6,21 +6,16 @@
  */
  
 
+attribute vec3 position;
 
 uniform vec2 screen_res;
 
-varying vec4 vary_light;
 varying vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
 		
-	vec4 tex = gl_MultiTexCoord0;
-	tex.w = 1.0;
-	
-	vary_light = gl_MultiTexCoord0;
+	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index c43125dad9c..7cdfe445dfd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -6,12 +6,14 @@
  */
  
 
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	gl_FrontColor = gl_Color;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
index 814deb3677a..65fa288e88e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 varying vec4 vary_light;
 varying vec2 vary_fragcoord;
@@ -15,13 +18,14 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = gl_MultiTexCoord0;
+	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 	
-	vary_light = gl_MultiTexCoord0;
+	vary_light = vec4(texcoord0,0,1);
 		
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index 3038fd29668..33b379d70cd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -5,7 +5,11 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
 
 varying vec3 vary_normal;
 
@@ -26,14 +30,14 @@ vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 			
-	vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+	vary_normal = normalize(gl_NormalMatrix * normal);
 	
 	// Transform and pass tex coords
- 	gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ 	gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
 	
-	vec4 t = gl_MultiTexCoord1;
+	vec4 t = vec4(texcoord1,0,1);
 	
 	gl_TexCoord[0].zw = t.xy;
 	gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index a9bef4292de..07e56e84db3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -6,16 +6,20 @@
  */
  
 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
 
 varying vec3 vary_normal;
 
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+	vary_normal = normalize(gl_NormalMatrix * normal);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = vec4(1,1,1,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
index 5397290b116..b5869e6cb23 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
@@ -6,6 +6,8 @@
  */
  
 
+attribute vec3 position;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -29,25 +31,25 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
 void main()
 {
 	//transform vertex
-	vec4 position = gl_Vertex;
+	vec4 pos = vec4(position.xyz, 1.0);
 	mat4 modelViewProj = gl_ModelViewProjectionMatrix;
 	
 	vec4 oPosition;
 		    
 	//get view vector
 	vec3 oEyeVec;
-	oEyeVec.xyz = position.xyz-eyeVec;
+	oEyeVec.xyz = pos.xyz-eyeVec;
 		
 	float d = length(oEyeVec.xy);
 	float ld = min(d, 2560.0);
 	
-	position.xy = eyeVec.xy + oEyeVec.xy/d*ld;
+	pos.xy = eyeVec.xy + oEyeVec.xy/d*ld;
 	view.xyz = oEyeVec;
 		
 	d = clamp(ld/1536.0-0.5, 0.0, 1.0);	
 	d *= d;
 		
-	oPosition = position;
+	oPosition = vec4(position, 1.0);
 	oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
 	vary_position = gl_ModelViewMatrix * oPosition;
 	oPosition = modelViewProj * oPosition;
@@ -55,17 +57,16 @@ void main()
 	refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
 	
 	//get wave position parameter (create sweeping horizontal waves)
-	vec3 v = position.xyz;
+	vec3 v = pos.xyz;
 	v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0;
 	    
 	//push position for further horizon effect.
-	position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
-	position.w = 1.0;
-	position = position*gl_ModelViewMatrix;
-	
-	calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz);
-	
+	pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
+	pos.w = 1.0;
+	pos = gl_ModelViewMatrix*pos;
 	
+	calcAtmospherics(pos.xyz);
+		
 	//pass wave parameters to pixel shader
 	vec2 bigWave =  (v.xy) * vec2(0.04,0.04)  + d1 * time * 0.055;
 	//get two normal map (detail map) texture coordinates
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index 32f5f5f2360..1ec0836dcc4 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -19,7 +19,6 @@ uniform float warmthAmount;
 void main()
 {
 	vec4 col = texture2DRect(diffuseMap, gl_TexCoord[0].xy);	
-
 	/// CALCULATING LUMINANCE (Using NTSC lum weights)
 	/// http://en.wikipedia.org/wiki/Luma_%28video%29
 	float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
@@ -27,4 +26,5 @@ void main()
 	
 	gl_FragColor.rgb = col.rgb; 
 	gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index 76736fed53b..b8881e0b191 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -5,11 +5,13 @@
  * $/LicenseInfo$
  */
 
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 
 void main() 
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
 	
-	gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
+	gl_TexCoord[0].xy = texcoord0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index 9bb41626ae6..a05449a77cb 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -5,20 +5,21 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 uniform vec2 glowDelta;
 
 void main() 
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
 	
-	gl_TexCoord[0].xy = gl_MultiTexCoord0.xy + glowDelta*(-3.5);
-	gl_TexCoord[1].xy = gl_MultiTexCoord0.xy + glowDelta*(-2.5);
-	gl_TexCoord[2].xy = gl_MultiTexCoord0.xy + glowDelta*(-1.5);
-	gl_TexCoord[3].xy = gl_MultiTexCoord0.xy + glowDelta*(-0.5);
-	gl_TexCoord[0].zw = gl_MultiTexCoord0.xy + glowDelta*(0.5);
-	gl_TexCoord[1].zw = gl_MultiTexCoord0.xy + glowDelta*(1.5);
-	gl_TexCoord[2].zw = gl_MultiTexCoord0.xy + glowDelta*(2.5);
-	gl_TexCoord[3].zw = gl_MultiTexCoord0.xy + glowDelta*(3.5);
+	gl_TexCoord[0].xy = texcoord0 + glowDelta*(-3.5);
+	gl_TexCoord[1].xy = texcoord0 + glowDelta*(-2.5);
+	gl_TexCoord[2].xy = texcoord0 + glowDelta*(-1.5);
+	gl_TexCoord[3].xy = texcoord0 + glowDelta*(-0.5);
+	gl_TexCoord[0].zw = texcoord0 + glowDelta*(0.5);
+	gl_TexCoord[1].zw = texcoord0 + glowDelta*(1.5);
+	gl_TexCoord[2].zw = texcoord0 + glowDelta*(2.5);
+	gl_TexCoord[3].zw = texcoord0 + glowDelta*(3.5);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index 8af981915bc..d0d8aed67e3 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -5,6 +5,13 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+attribute vec2 texcoord2;
+attribute vec2 texcoord3;
 
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
@@ -26,17 +33,17 @@ vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 			
-	vec4 pos = gl_ModelViewMatrix * gl_Vertex;
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec4 pos = gl_ModelViewMatrix * position;
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 	
-	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), gl_Color);
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color);
 	
 	gl_FrontColor = color;
 	
-	gl_TexCoord[0] = texgen_object(gl_Vertex,gl_MultiTexCoord0,gl_TextureMatrix[0],gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*gl_MultiTexCoord1;
-	gl_TexCoord[2] = texgen_object(gl_Vertex,gl_MultiTexCoord2,gl_TextureMatrix[2],gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
-	gl_TexCoord[3] = gl_TextureMatrix[3]*gl_MultiTexCoord3;
+	gl_TexCoord[0] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),gl_TextureMatrix[0],gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
+	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(texcoord1,0,1);
+	gl_TexCoord[2] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),gl_TextureMatrix[2],gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
+	gl_TexCoord[3] = gl_TextureMatrix[3]*vec4(texcoord3,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index 831d6a761c7..92d4759fe8c 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -6,6 +6,7 @@
  */
  
 
+attribute vec3 position;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -27,7 +28,6 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
 void main()
 {
 	//transform vertex
-	vec4 position = gl_Vertex;
 	mat4 modelViewProj = gl_ModelViewProjectionMatrix;
 	
 	vec4 oPosition;
@@ -45,7 +45,7 @@ void main()
 	d = clamp(ld/1536.0-0.5, 0.0, 1.0);	
 	d *= d;
 		
-	oPosition = position;
+	oPosition = vec4(position, 1.0);
 	oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
 	oPosition = modelViewProj * oPosition;
 	refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
@@ -55,11 +55,12 @@ void main()
 	v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0;
 	    
 	//push position for further horizon effect.
-	position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
-	position.w = 1.0;
-	position = position*gl_ModelViewMatrix;
+	vec4 pos;
+	pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
+	pos.w = 1.0;
+	pos = gl_ModelViewMatrix*pos;
 	
-	calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz);
+	calcAtmospherics(pos.xyz);
 	
 	
 	//pass wave parameters to pixel shader
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
index 04bfff22c12..22095bc611b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
@@ -5,12 +5,15 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_TexCoord[0] = gl_MultiTexCoord0;
-	gl_FrontColor = gl_Color;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_FrontColor = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
index ce183ec1542..46be1c45d37 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
@@ -5,11 +5,14 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_TexCoord[0] = gl_MultiTexCoord0;
-	gl_TexCoord[1] = gl_MultiTexCoord1;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_TexCoord[1] = vec4(texcoord1,0,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index f6c6d945de3..a0cbdaafb89 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -6,10 +6,10 @@
  */
  
 
-
+uniform vec4 highlight_color;
 uniform sampler2D diffuseMap;
 
 void main() 
 {
-	gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = highlight_color*texture2D(diffuseMap, gl_TexCoord[0].xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
index f114f766bf6..0547c44093f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
@@ -5,23 +5,13 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
-	vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
-	pos = normalize(pos);
-	float d = dot(pos, normalize(gl_NormalMatrix * gl_Normal));
-	d *= d;
-	d = 1.0 - d;
-	d *= d;
-		
-	d = min(d, gl_Color.a*2.0);
-			
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	gl_FrontColor.rgb = gl_Color.rgb;
-	gl_FrontColor.a = max(d, gl_Color.a);
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
index 5a5d0ec506b..9c528750eb2 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
@@ -5,8 +5,10 @@
  * $/LicenseInfo$
  */
 
+attribute vec3 position;
+
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
index 8401208e282..18c8e394c60 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
@@ -5,12 +5,14 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_FrontColor = gl_Color;
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_FrontColor = diffuse_color;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
index f685b112b45..dde4e87c63d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
@@ -6,11 +6,14 @@
  */
  
 
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_TexCoord[0] = gl_MultiTexCoord0;
-	gl_TexCoord[1] = gl_MultiTexCoord1;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_TexCoord[1] = vec4(texcoord1,0,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
index 9ca6cae5c5f..ebf2361da46 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -6,11 +6,15 @@
  */
  
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_TexCoord[0] = gl_MultiTexCoord0;
-	gl_FrontColor = gl_Color;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_FrontColor = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index 056d1a9582e..438a9bec859 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -6,11 +6,16 @@
  */
  
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
-	gl_FrontColor = gl_Color;
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = gl_TextureMatrix[1] * vec4(texcoord1,0,1);
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index 5283e80407f..5ed2b38f422 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -6,6 +6,10 @@
  */
 
 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
@@ -15,21 +19,21 @@ void main()
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	vec4 norm = gl_Vertex;
-	norm.xyz += gl_Normal.xyz;
+	vec4 norm = vec4(position.xyz, 1.0);
+	norm.xyz += normal.xyz;
 	norm.xyz = (mat*norm).xyz;
 	norm.xyz = normalize(norm.xyz-pos.xyz);
 		
 	vec3 ref = reflect(pos.xyz, -norm.xyz);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 	
 	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index 31e0f0a429a..4063294c517 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -14,18 +18,18 @@ uniform vec4 origin;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	
-	vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
 
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index 1db79791de3..316c93c36ad 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -6,6 +6,9 @@
  */
 
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
@@ -13,21 +16,16 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	vec4 norm = gl_Vertex;
-	norm.xyz += gl_Normal.xyz;
-	norm.xyz = (mat*norm).xyz;
-	norm.xyz = normalize(norm.xyz-pos.xyz);
-		
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 	
 	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
 		
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index 3382384c995..d88612765cf 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -5,21 +5,24 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
-	vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
+
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
index eea41bb4f0d..41a9cd2fe6e 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
@@ -5,7 +5,10 @@
  * $License$
  */
 
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -16,21 +19,21 @@ void main()
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	vec4 norm = gl_Vertex;
-	norm.xyz += gl_Normal.xyz;
+	vec4 norm = vec4(position.xyz, 1.0);
+	norm.xyz += normal.xyz;
 	norm.xyz = (mat*norm).xyz;
 	norm.xyz = normalize(norm.xyz-pos.xyz);
 		
 	vec3 ref = reflect(pos.xyz, -norm.xyz);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.));
+	vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
 	gl_FrontColor = color;
 	
 	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index 68a086dbc1a..47572954708 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -14,14 +17,14 @@ uniform vec4 origin;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	
-	vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 
 	calcAtmospherics(pos.xyz);
 	
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 	
 	vec3 ref = reflect(pos.xyz, -norm);
 	
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index af92e5e0026..fbda2e70d25 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -5,7 +5,10 @@
  * $License$
  */
 
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -14,21 +17,21 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	vec4 norm = gl_Vertex;
-	norm.xyz += gl_Normal.xyz;
+	vec4 norm = vec4(position.xyz, 1.0);
+	norm.xyz += normal.xyz;
 	norm.xyz = (mat*norm).xyz;
 	norm.xyz = normalize(norm.xyz-pos.xyz);
 		
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.));
+	vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
 	gl_FrontColor = color;
 	
 	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index b493f76fcc6..39fad42acb4 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -13,16 +16,15 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	
-	vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
-	
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+		
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	gl_FrontColor = color;
 
 	gl_FogFragCoord = pos.z;
diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
index 3e8b719f939..e6d5c00c4d9 100644
--- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
 
 vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -13,17 +17,17 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	
-	vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec3 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)).xyz;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+		
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 
 	calcAtmospherics(pos.xyz);
 	
 	// vec4 specular = specularColor;
 	vec4 specular = vec4(1.0);
-	vec4 color = calcLightingSpecular(pos, norm, gl_Color, specular, vec4(0.0));
+	vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));
 			
 	gl_FrontColor = color;
 	gl_FogFragCoord = pos.z;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index 948a52da5b8..97fe7029e1e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -5,7 +5,10 @@
  * $License$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -59,18 +62,18 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = gl_ModelViewMatrix * mat;
 	
-	vec3 pos = (mat*gl_Vertex).xyz;
+	vec3 pos = (mat*position).xyz;
 	
 	gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0);
 	
-	vec4 n = gl_Vertex;
-	n.xyz += gl_Normal.xyz;
+	vec4 n = position;
+	n.xyz += normal.xyz;
 	n.xyz = (mat*n).xyz;
 	n.xyz = normalize(n.xyz-pos.xyz);
 	
@@ -81,8 +84,8 @@ void main()
 			
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
-	vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -92,23 +95,23 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*gl_Color.rgb;
+	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 		
-	vary_ambient = col.rgb*gl_Color.rgb;
-	vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+	vary_ambient = col.rgb*diffuse_color.rgb;
+	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
-	col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
 	gl_FrontColor = col;
 
 	gl_FogFragCoord = pos.z;
 	
-	pos.xyz = (gl_ModelViewProjectionMatrix * gl_Vertex).xyz;
+	pos.xyz = (gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0)).xyz;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
 	
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index f616ecc8723..91dcca46072 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -5,7 +5,10 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec4 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -61,22 +64,22 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz, 1.0);
-	vary_texture_index = gl_Vertex.w;
-	gl_Position = gl_ModelViewProjectionMatrix * vert; 
-	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	
+	vec4 vert = vec4(position.xyz, 1.0);
+	vary_texture_index = position.w;
 	vec4 pos = (gl_ModelViewMatrix * vert);
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+		
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 	
 	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
 	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
 		
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
-	vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -86,17 +89,17 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*gl_Color.rgb;
+	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb*gl_Color.rgb;
-	vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+	vary_ambient = col.rgb*diffuse_color.rgb;
+	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
-	col.rgb = col.rgb*gl_Color.rgb;
+	col.rgb = col.rgb*diffuse_color.rgb;
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 01e40afc4f2..65c3e5da104 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -61,20 +65,21 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 				
 	vec4 pos;
 	vec3 norm;
 	
 	mat4 trans = getSkinnedTransform();
-	pos.x = dot(trans[0], gl_Vertex);
-	pos.y = dot(trans[1], gl_Vertex);
-	pos.z = dot(trans[2], gl_Vertex);
+	vec4 pos_in = vec4(position.xyz, 1.0);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 	
-	norm.x = dot(trans[0].xyz, gl_Normal);
-	norm.y = dot(trans[1].xyz, gl_Normal);
-	norm.z = dot(trans[2].xyz, gl_Normal);
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
 	gl_Position = gl_ProjectionMatrix * pos;
@@ -84,9 +89,9 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 
-	vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -96,17 +101,17 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*gl_Color.rgb;
+	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb*gl_Color.rgb;
-	vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+	vary_ambient = col.rgb*diffuse_color.rgb;
+	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
-	col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
index 393084a3db7..5e19a3b0435 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
@@ -6,6 +6,7 @@
  */
  
 
+attribute vec3 position;
 
 varying vec2 vary_fragcoord;
 uniform vec2 screen_res;
@@ -13,7 +14,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index 745cc019923..d2e3415d914 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
@@ -6,6 +6,8 @@
  */
  
 
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 uniform vec2 screen_res;
 
@@ -14,13 +16,11 @@ varying vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+	
 	
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 		
-	vec4 tex = gl_MultiTexCoord0;
-	tex.w = 1.0;
-	
-	vary_light = gl_MultiTexCoord0;
+	vary_light = vec4(texcoord0,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 814deb3677a..6795b55dc69 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -5,6 +5,10 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 
 varying vec4 vary_light;
@@ -15,13 +19,14 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = gl_MultiTexCoord0;
+	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 	
-	vary_light = gl_MultiTexCoord0;
+	vary_light = vec4(texcoord0,0,1);
 		
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
index de469542f98..68f79fba82f 100644
--- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
@@ -6,6 +6,8 @@
  */
  
 
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 uniform vec2 texelSize;
 uniform vec2 blurDirection;
@@ -14,10 +16,10 @@ uniform float blurWidth;
 void main(void)
 {
 	// Transform vertex
-	gl_Position = ftransform();
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	
 	vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth);
-	vec2 s = gl_MultiTexCoord0.st - (blurDelta * 3.0);
+	vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0);
 	
 	// for (int i = 0; i < 7; i++) {
 		// gl_TexCoord[i].st = s + (i * blurDelta);
diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
index 9c52b8dd5d4..7dd2ead2001 100644
--- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
@@ -6,11 +6,15 @@
  */
  
 
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+
 
 void main(void)
 {
 	//transform vertex
-	gl_Position = ftransform();
-	gl_TexCoord[0] = gl_MultiTexCoord0;
-	gl_TexCoord[1] = gl_MultiTexCoord1;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_TexCoord[1] = vec4(texcoord1,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
index 2658bee88da..b5367b5dae1 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
@@ -6,6 +6,12 @@
  */
  
 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -28,24 +34,24 @@ vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+
+	vec4 pos = gl_ModelViewMatrix * vec4(position.xyz, 1.0);
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 
-	vec4 pos = gl_ModelViewMatrix * gl_Vertex;
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	calcAtmospherics(pos.xyz);
 
 	/// Potentially better without it for water.
 	pos /= pos.w;
 
-	calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz);
-
-	vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0));
+	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
 	
 	gl_FrontColor = color;
 
 	// Transform and pass tex coords
- 	gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ 	gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
 	
-	vec4 t = gl_MultiTexCoord1;
+	vec4 t = vec4(texcoord1,0,1);
 	
 	gl_TexCoord[0].zw = t.xy;
 	gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
index 3d43a1813a5..bc927cfdb66 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
@@ -5,8 +5,6 @@
  * $/LicenseInfo$
  */
  
-
-
 float calcDirectionalLight(vec3 n, vec3 l);
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
index f49e74406fd..72a18c6858b 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
@@ -13,23 +13,28 @@ uniform vec4 origin;
 
 varying float vary_texture_index;
 
+attribute vec4 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz,1.0);
-	vary_texture_index = gl_Vertex.w;
-	gl_Position = gl_ModelViewProjectionMatrix*vert;
-	
+	vec4 vert = vec4(position.xyz,1.0);
+	vary_texture_index = position.w;
 	vec4 pos = (gl_ModelViewMatrix * vert);
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
index 3076fa32600..cf8ea23c36a 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
@@ -5,6 +5,11 @@
  * $/LicenseInfo$
  */
  
+ 
+attribute vec4 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
 
 
 void calcAtmospherics(vec3 inPositionEye);
@@ -14,16 +19,15 @@ varying float vary_texture_index;
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz,1.0);
-	vary_texture_index = gl_Vertex.w;
-	gl_Position = gl_ModelViewProjectionMatrix*vert;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	
+	vec4 vert = vec4(position.xyz,1.0);
+	vary_texture_index = position.w;
 	vec4 pos = (gl_ModelViewMatrix * vert);
-
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
index 49992d35355..5d633f53d57 100644
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
@@ -6,6 +6,10 @@
  */
  
 
+attribute vec4 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 
@@ -18,20 +22,20 @@ uniform vec4 origin;
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz,1.0);
-	vary_texture_index = gl_Vertex.w;
-	gl_Position = gl_ModelViewProjectionMatrix*vert;
-	
+	vec4 vert = vec4(position.xyz,1.0);
+	vary_texture_index = position.w;
 	vec4 pos = (gl_ModelViewMatrix * vert);
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+		
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = calcLighting(pos.xyz, norm, gl_Color, vec4(0.0));
+	gl_FrontColor = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));
 
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
index 5e02391767f..4f53cde40c0 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
@@ -7,6 +7,11 @@
  
 
 
+attribute vec4 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -15,18 +20,19 @@ varying float vary_texture_index;
 void main()
 {
 	//transform vertex
-	vec4 vert = vec4(gl_Vertex.xyz,1.0);
-	vary_texture_index = gl_Vertex.w;
-	gl_Position = gl_ModelViewProjectionMatrix*vert;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	
+	vec4 vert = vec4(position.xyz,1.0);
+	vary_texture_index = position.w;
 	vec4 pos = (gl_ModelViewMatrix * vert);
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	
+	
 	
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	vec3 norm = normalize(gl_NormalMatrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	gl_FrontColor = color;
 
 	gl_FogFragCoord = pos.z;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 3eac63076c1..9ba5e97a953 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -5,7 +5,8 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 //////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
@@ -41,12 +42,12 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = ftransform();
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
 	// Get relative position
-	vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
+	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
 
 	// Set altitude
 	if (P.y > 0.)
@@ -142,7 +143,7 @@ void main()
 
 
 	// Texture coords
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_TexCoord[0].xy -= 0.5;
 	gl_TexCoord[0].xy /= cloud_scale.x;
 	gl_TexCoord[0].xy += 0.5;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 1ea00f723af..31c995a542f 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -6,6 +6,8 @@
  */
  
 
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 // SKY ////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
@@ -39,12 +41,12 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = ftransform();
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
 	// Get relative position
-	vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
-	//vec3 P = gl_Vertex.xyz + vec3(0,50,0);
+	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
+	//vec3 P = position.xyz + vec3(0,50,0);
 
 	// Set altitude
 	if (P.y > 0.)
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index 3d970d252c6..f65dfff42fb 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -5,38 +5,39 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+attribute vec4 clothing; 
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
 void calcAtmospherics(vec3 inPositionEye);
 
-attribute vec4 clothing; //4
-
-attribute vec4 gWindDir;		//7
-attribute vec4 gSinWaveParams; //3
-attribute vec4 gGravity;		//5
+uniform vec4 gWindDir;		
+uniform vec4 gSinWaveParams; 
+uniform vec4 gGravity;		
 
 const vec4 gMinMaxConstants = vec4(1.0, 0.166666, 0.0083143, .00018542);	 // #minimax-generated coefficients
 const vec4 gPiConstants	= vec4(0.159154943, 6.28318530, 3.141592653, 1.5707963); //	# {1/2PI, 2PI, PI, PI/2}
 
 void main()
 {
-	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
 		
 	vec4 pos;
 	mat4 trans = getSkinnedTransform();
 		
 	vec3 norm;
-	norm.x = dot(trans[0].xyz, gl_Normal);
-	norm.y = dot(trans[1].xyz, gl_Normal);
-	norm.z = dot(trans[2].xyz, gl_Normal);
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
 	//wind
 	vec4 windEffect;
 	windEffect = vec4(dot(norm, gWindDir.xyz));	
-	pos.x = dot(trans[2].xyz, gl_Vertex.xyz);
+	pos.x = dot(trans[2].xyz, position.xyz);
 	windEffect.xyz = pos.x * vec3(0.015, 0.015, 0.015)
 						+ windEffect.xyz;
 	windEffect.w = windEffect.w * 2.0 + 1.0;				// move wind offset value to [-1, 3]
@@ -83,7 +84,7 @@ void main()
 	sinWave.xyz = max(sinWave.xyz, vec3(-1.0, -1.0, -1.0));	// clamp to underlying body shape
 	offsetPos = clothing * sinWave.x;						// multiply wind effect times clothing displacement
 	temp2 = gWindDir*sinWave.z + vec4(norm,0);				// calculate normal offset due to wind oscillation
-	offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+gl_Vertex;	// add to offset vertex position, and zero out effect from w
+	offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+vec4(position.xyz, 1.0);	// add to offset vertex position, and zero out effect from w
 	norm += temp2.xyz*2.0;									// add sin wave effect on normals (exaggerated)
 	
 	//add "backlighting" effect
@@ -101,7 +102,7 @@ void main()
 
 	calcAtmospherics(pos.xyz);
 	
-	vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.0));			
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.0));			
 	gl_FrontColor = color; 
 					
 	gl_Position = gl_ProjectionMatrix * pos;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
index eebe930666a..b769e1ee1d9 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
@@ -5,7 +5,7 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
 
 varying vec2 vary_fragcoord;
 uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
index 7e20d71529e..057d36ed224 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
@@ -5,6 +5,7 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
 
 
 varying vec2 vary_fragcoord;
@@ -13,7 +14,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos;
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
index e86f2896da5..d97d7ea82d8 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
@@ -5,6 +5,9 @@
  * $/LicenseInfo$
  */
  
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
 
 
 varying vec2 vary_fragcoord;
@@ -14,11 +17,12 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = gl_MultiTexCoord0;
+	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
index 9afeac6ddfa..5bdb69fb6fc 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
@@ -5,18 +5,20 @@
  * $/LicenseInfo$
  */
  
-
-
 varying vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
 
+attribute vec3 position;
+attribute vec4 diffuse_color;
+
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
 
-	gl_FrontColor = gl_Color;
+	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
index 876f65ee3ad..25810986095 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
@@ -5,7 +5,7 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
 
 varying vec2 vary_fragcoord;
 uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
index eebe930666a..ed6fd1ee805 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
@@ -5,7 +5,7 @@
  * $/LicenseInfo$
  */
  
-
+attribute vec3 position;
 
 varying vec2 vary_fragcoord;
 uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
index 745cc019923..9872c9f366c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
@@ -6,6 +6,8 @@
  */
  
 
+attribute vec3 position;
+attribute vec2 texcoord0;
 
 uniform vec2 screen_res;
 
@@ -14,13 +16,10 @@ varying vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform(); 
+	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 	
 	
-	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 		
-	vec4 tex = gl_MultiTexCoord0;
-	tex.w = 1.0;
-	
-	vary_light = gl_MultiTexCoord0;
+	vary_light = vec4(texcoord0,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
index 24bbc0a1a11..9144b8361f5 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
@@ -6,7 +6,6 @@
  */
  
 
-
 float calcDirectionalLight(vec3 n, vec3 l);
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
 
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 492cfe7c1ba..e3be6b0402d 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3925,7 +3925,7 @@ void LLAgent::renderAutoPilotTarget()
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
 		// lovely green
-		glColor4f(0.f, 1.f, 1.f, 1.f);
+		gGL.diffuseColor4f(0.f, 1.f, 1.f, 1.f);
 
 		target_global = mAutoPilotTargetGlobal;
 
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 286284f828e..0c572def72c 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -384,7 +384,7 @@ BOOL LLFacePool::LLOverrideFaceColor::sOverrideFaceColor = FALSE;
 
 void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color)
 {
-	glColor4fv(color.mV);
+	gGL.diffuseColor4fv(color.mV);
 }
 
 void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color)
@@ -394,7 +394,7 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color)
 
 void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a)
 {
-	glColor4f(r,g,b,a);
+	gGL.diffuseColor4f(r,g,b,a);
 }
 
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 9719140a37a..ef8819d9b54 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -54,7 +54,7 @@ static BOOL deferred_render = FALSE;
 
 LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) :
 		LLRenderPass(type), current_shader(NULL), target_shader(NULL),
-		simple_shader(NULL), fullbright_shader(NULL),
+		simple_shader(NULL), fullbright_shader(NULL), emissive_shader(NULL),
 		mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF),
 		mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF)
 {
@@ -175,11 +175,13 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass)
 	{
 		simple_shader = &gObjectSimpleWaterAlphaMaskProgram;
 		fullbright_shader = &gObjectFullbrightWaterAlphaMaskProgram;
+		emissive_shader = &gObjectEmissiveWaterProgram;
 	}
 	else
 	{
 		simple_shader = &gObjectSimpleAlphaMaskProgram;
 		fullbright_shader = &gObjectFullbrightAlphaMaskProgram;
+		emissive_shader = &gObjectEmissiveProgram;
 	}
 
 	if (mVertexShaderLevel > 0)
@@ -319,20 +321,22 @@ void LLDrawPoolAlpha::render(S32 pass)
 		BOOL shaders = gPipeline.canUseVertexShaders();
 		if(shaders) 
 		{
-			gObjectFullbrightNonIndexedProgram.bind();
+			gHighlightProgram.bind();
+			gHighlightProgram.uniform4f("highlight_color", 1,0,0,1);
 		}
 		else
 		{
 			gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
+			gGL.diffuseColor4f(1,0,0,1);
 		}
-		glColor4f(1,0,0,1);
+		
 		LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f);
 		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ;
 		renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX |
 							LLVertexBuffer::MAP_TEXCOORD0);
 		if(shaders) 
 		{
-			gObjectFullbrightNonIndexedProgram.unbind();
+			gHighlightProgram.unbind();
 		}
 	}
 }
@@ -489,22 +493,25 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
 				
 				// If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow).  Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha.
 				if (draw_glow_for_this_partition &&
-				    params.mGlowColor.mV[3] > 0)
+					params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE))
 				{
 					// install glow-accumulating blend mode
 					gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color
 						      LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow)
 
+					emissive_shader->bind();
+					
 					// glow doesn't use vertex colors from the mesh data
-					params.mVertexBuffer->setBuffer(mask & ~LLVertexBuffer::MAP_COLOR);
-					glColor4ubv(params.mGlowColor.mV);
-
+					params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE);
+					
 					// do the actual drawing, again
 					params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset);
 					gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode);
 
 					// restore our alpha blend mode
 					gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor);
+
+					current_shader->bind();
 				}
 			
 				if (tex_setup)
diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h
index 12a7ae92b12..a4245e561d8 100644
--- a/indra/newview/lldrawpoolalpha.h
+++ b/indra/newview/lldrawpoolalpha.h
@@ -78,6 +78,7 @@ class LLDrawPoolAlpha: public LLRenderPass
 	LLGLSLShader* target_shader;
 	LLGLSLShader* simple_shader;
 	LLGLSLShader* fullbright_shader;	
+	LLGLSLShader* emissive_shader;
 
 	// our 'normal' alpha blend function for this pass
 	LLRender::eBlendFactor mColorSFactor;
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 694b7dcedd1..dae995e1f5a 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -263,7 +263,6 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha()
 	gPipeline.bindDeferredShader(*sVertexProgram);
 	
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-	enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
 }
 
 void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
@@ -314,8 +313,7 @@ void LLDrawPoolAvatar::endPostDeferredAlpha()
 	// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
 	sRenderingSkinned = FALSE;
 	sSkipOpaque = FALSE;
-	disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
-	
+		
 	gPipeline.unbindDeferredShader(*sVertexProgram);
 	sDiffuseChannel = 0;
 	sShaderLevel = mVertexShaderLevel;
@@ -362,13 +360,12 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
 		}
 		//gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f);
 		
-		glColor4f(1,1,1,1);
+		gGL.diffuseColor4f(1,1,1,1);
 
 		if ((sShaderLevel > 0))  // for hardware blending
 		{
 			sRenderingSkinned = TRUE;
 			sVertexProgram->bind();
-			enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
 		}
 	}
 	else
@@ -389,7 +386,6 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass)
 		{
 			sRenderingSkinned = FALSE;
 			sVertexProgram->unbind();
-			disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
 		}
 	}
 	else
@@ -492,11 +488,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
 	//reset vertex buffer mappings
 	LLVertexBuffer::unbind();
 
-	if (pass == 0)
-	{ //make sure no stale colors are left over from a previous render
-		glColor4f(1,1,1,1);
-	}
-
 	if (LLPipeline::sImpostorRender)
 	{ //impostor render does not have impostors or rigid rendering
 		pass += 2;
@@ -535,6 +526,11 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
 		beginRiggedGlow();
 		break;
 	}
+
+	if (pass == 0)
+	{ //make sure no stale colors are left over from a previous render
+		gGL.diffuseColor4f(1,1,1,1);
+	}
 }
 
 void LLDrawPoolAvatar::endRenderPass(S32 pass)
@@ -604,11 +600,11 @@ void LLDrawPoolAvatar::beginRigid()
 	{
 		if (LLPipeline::sUnderWaterRender)
 		{
-			sVertexProgram = &gObjectAlphaMaskNonIndexedWaterProgram;
+			sVertexProgram = &gObjectAlphaMaskNoColorWaterProgram;
 		}
 		else
 		{
-			sVertexProgram = &gObjectAlphaMaskNonIndexedProgram;
+			sVertexProgram = &gObjectAlphaMaskNoColorProgram;
 		}
 		
 		if (sVertexProgram != NULL)
@@ -692,11 +688,11 @@ void LLDrawPoolAvatar::beginSkinned()
 	{
 		if (LLPipeline::sUnderWaterRender)
 		{
-			sVertexProgram = &gObjectAlphaMaskNonIndexedWaterProgram;
+			sVertexProgram = &gObjectAlphaMaskNoColorWaterProgram;
 		}
 		else
 		{
-			sVertexProgram = &gObjectAlphaMaskNonIndexedProgram;
+			sVertexProgram = &gObjectAlphaMaskNoColorProgram;
 		}
 	}
 	
@@ -705,17 +701,6 @@ void LLDrawPoolAvatar::beginSkinned()
 		sRenderingSkinned = TRUE;
 
 		sVertexProgram->bind();
-		if (sShaderLevel >= SHADER_LEVEL_CLOTH)
-		{
-			enable_cloth_weights(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING]);
-		}
-		enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
-
-		if (sShaderLevel >= SHADER_LEVEL_BUMP)
-		{
-			enable_binormals(sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL]);
-		}
-		
 		sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP);
 		gGL.getTexUnit(0)->activate();
 	}
@@ -743,16 +728,6 @@ void LLDrawPoolAvatar::endSkinned()
 		sRenderingSkinned = FALSE;
 		sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP);
 		gGL.getTexUnit(0)->activate();
-		disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
-		if (sShaderLevel >= SHADER_LEVEL_BUMP)
-		{
-			disable_binormals(sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL]);
-		}
-		if ((sShaderLevel >= SHADER_LEVEL_CLOTH))
-		{
-			disable_cloth_weights(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING]);
-		}
-
 		sVertexProgram->unbind();
 		sShaderLevel = mVertexShaderLevel;
 	}
@@ -1027,8 +1002,6 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
 	sVertexProgram->bind();
 	
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-	enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
-
 	gGL.getTexUnit(0)->activate();
 }
 
@@ -1036,7 +1009,6 @@ void LLDrawPoolAvatar::endDeferredSkinned()
 {
 	// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
 	sRenderingSkinned = FALSE;
-	disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
 	sVertexProgram->unbind();
 
 	sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -1150,10 +1122,10 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 		return;
 	}
 
-	if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview,  3=morph view
+	/*if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview,  3=morph view
 	{
 		gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f));
-	}
+	}*/
 	
 	if (pass == 1)
 	{
@@ -1262,16 +1234,16 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 		wind = wind * rot_mat;
 		wind.mV[VW] = avatarp->mWindVec.mV[VW];
 
-		sVertexProgram->vertexAttrib4fv(LLViewerShaderMgr::AVATAR_WIND, wind.mV);
+		sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV);
 		F32 phase = -1.f * (avatarp->mRipplePhase);
 
 		F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f);
 		LLVector4 sin_params(freq, freq, freq, phase);
-		sVertexProgram->vertexAttrib4fv(LLViewerShaderMgr::AVATAR_SINWAVE, sin_params.mV);
+		sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV);
 
 		LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f);
 		gravity = gravity * rot_mat;
-		sVertexProgram->vertexAttrib4fv(LLViewerShaderMgr::AVATAR_GRAVITY, gravity.mV);
+		sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV);
 	}
 
 	if( !single_avatar || (avatarp == single_avatar) )
@@ -1509,7 +1481,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 
 			if (glow)
 			{
-				glColor4f(0,0,0,face->getTextureEntry()->getGlow());
+				gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow());
 			}
 
 			gGL.getTexUnit(sDiffuseChannel)->bind(face->getTexture());
@@ -1662,7 +1634,7 @@ LLVertexBufferAvatar::LLVertexBufferAvatar()
 
 void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const
 {
-	if (sRenderingSkinned)
+	/*if (sRenderingSkinned)
 	{
 		U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
 
@@ -1686,8 +1658,8 @@ void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const
 		}
 	}
 	else
-	{
+	{*/
 		LLVertexBuffer::setupVertexBuffer(data_mask);
-	}
+	//}
 }
 
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index d801f6df18a..a0990ca6452 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -762,7 +762,7 @@ void LLDrawPoolBump::renderBump(U32 pass)
 	LLGLDisable fog(GL_FOG);
 	LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
 	LLGLEnable blend(GL_BLEND);
-	glColor4f(1,1,1,1);
+	gGL.diffuseColor4f(1,1,1,1);
 	/// Get rid of z-fighting with non-bump pass.
 	LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
 	glPolygonOffset(-1.0f, -1.0f);
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index eec4ee6bac9..582e4628711 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -80,6 +80,18 @@ void LLDrawPoolGlow::endPostDeferredPass(S32 pass)
 	LLRenderPass::endRenderPass(pass);
 }
 
+S32 LLDrawPoolGlow::getNumPasses()
+{
+	if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0)
+	{
+		return 1;
+	}
+	else
+	{
+		return 0;
+	}
+}
+
 void LLDrawPoolGlow::render(S32 pass)
 {
 	LLFastTimer t(FTM_RENDER_GLOW);
@@ -93,39 +105,29 @@ void LLDrawPoolGlow::render(S32 pass)
 	
 	U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT);
 
-	if (shader_level > 0 && fullbright_shader)
-	{
-		fullbright_shader->bind();
-	}
-	else
-	{
-		gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
-	}
+	//should never get here without basic shaders enabled
+	llassert(shader_level > 0);
+	
+	LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram;
+	shader->bind();
 
 	LLGLDepthTest depth(GL_TRUE, GL_FALSE);
 	gGL.setColorMask(false, true);
 
-	if (shader_level > 1)
-	{
-		pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
-	}
-	else
-	{
-		renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask());
-	}
+	pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
 	
 	gGL.setColorMask(true, false);
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
 	
 	if (shader_level > 0 && fullbright_shader)
 	{
-		fullbright_shader->unbind();
+		shader->unbind();
 	}
 }
 
 void LLDrawPoolGlow::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures)
 {
-	glColor4ubv(params.mGlowColor.mV);
+	//gGL.diffuseColor4ubv(params.mGlowColor.mV);
 	LLRenderPass::pushBatch(params, mask, texture, batch_textures);
 }
 
diff --git a/indra/newview/lldrawpoolsimple.h b/indra/newview/lldrawpoolsimple.h
index 3811b3d398f..bd62bc75025 100644
--- a/indra/newview/lldrawpoolsimple.h
+++ b/indra/newview/lldrawpoolsimple.h
@@ -118,7 +118,8 @@ class LLDrawPoolGlow : public LLRenderPass
 	enum
 	{
 		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
-							LLVertexBuffer::MAP_TEXCOORD0
+							LLVertexBuffer::MAP_TEXCOORD0 |
+							LLVertexBuffer::MAP_EMISSIVE
 	};
 
 	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
@@ -130,6 +131,8 @@ class LLDrawPoolGlow : public LLRenderPass
 	/*virtual*/ void endPostDeferredPass(S32 pass);
 	/*virtual*/ void renderPostDeferred(S32 pass);
 
+	/*virtual*/ S32 getNumPasses();
+
 	void render(S32 pass = 0);
 	void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE);
 
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp
index efffb2df9e7..d1c8fa5fc95 100644
--- a/indra/newview/lldrawpoolsky.cpp
+++ b/indra/newview/lldrawpoolsky.cpp
@@ -84,7 +84,7 @@ void LLDrawPoolSky::render(S32 pass)
 	}
 	else if (LLGLSLShader::sNoFixedFunction)
 	{ //just use the UI shader (generic single texture no lighting)
-		gUIProgram.bind();
+		gOneTextureNoColorProgram.bind();
 	}
 	else
 	{
@@ -118,7 +118,7 @@ void LLDrawPoolSky::render(S32 pass)
 	S32 face_count = (S32)mDrawFace.size();
 
 	LLVertexBuffer::unbind();
-	glColor4f(1,1,1,1);
+	gGL.diffuseColor4f(1,1,1,1);
 
 	for (S32 i = 0; i < llmin(6, face_count); ++i)
 	{
@@ -146,7 +146,7 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side)
 		
 		LLGLEnable blend(GL_BLEND);
 		mSkyTex[side].bindTexture(FALSE);
-		glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled
+		gGL.diffuseColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled
 		face.renderIndexed();
 	}
 }
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 3daa0f8261f..8d6b31912a0 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -106,6 +106,10 @@ U32 LLDrawPoolTerrain::getVertexDataMask()
 	{
 		return LLVertexBuffer::MAP_VERTEX;
 	}
+	else if (LLGLSLShader::sCurBoundShaderPtr)
+	{
+		return VERTEX_DATA_MASK & ~(LLVertexBuffer::MAP_TEXCOORD2 | LLVertexBuffer::MAP_TEXCOORD3);
+	}
 	else
 	{
 		return VERTEX_DATA_MASK; 
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index a6e01511147..50a52ac4cfa 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -65,17 +65,18 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
 		
 	if (LLPipeline::sUnderWaterRender)
 	{
-		shader = &gObjectAlphaMaskNonIndexedWaterProgram;
+		shader = &gTreeWaterProgram;
 	}
 	else
 	{
-		shader = &gObjectAlphaMaskNonIndexedProgram;
+		shader = &gTreeProgram;
 	}
 
 	if (gPipeline.canUseVertexShaders())
 	{
 		shader->bind();
 		shader->setAlphaRange(0.5f, 1.f);
+		gGL.diffuseColor4f(1,1,1,1);
 	}
 	else
 	{
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 31c14361b5f..ae1598907bd 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -219,7 +219,7 @@ void LLDrawPoolWater::render(S32 pass)
 		water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot));
 	}
 
-	glColor4fv(water_color.mV);
+	gGL.diffuseColor4fv(water_color.mV);
 
 	// Automatically generate texture coords for detail map
 	glEnable(GL_TEXTURE_GEN_S); //texture unit 1
@@ -383,7 +383,7 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
 	glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0);
 	glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1);
 
-	glColor3f(1.f, 1.f, 1.f);
+	gGL.diffuseColor3f(1.f, 1.f, 1.f);
 
 	for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
 		 iter != mDrawFace.end(); iter++)
@@ -623,8 +623,6 @@ void LLDrawPoolWater::shade()
 		water_color.mV[3] = 0.9f;
 	}
 
-	glColor4fv(water_color.mV);
-
 	{
 		LLGLEnable depth_clamp(gGLManager.mHasDepthClamp ? GL_DEPTH_CLAMP : 0);
 		LLGLDisable cullface(GL_CULL_FACE);
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 79a835fd14e..e4de92490e9 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -100,12 +100,12 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass )
 {
 	sky_shader =
 		LLPipeline::sUnderWaterRender ?
-			&gObjectSimpleWaterProgram :
+			&gObjectFullbrightNoColorWaterProgram :
 			&gWLSkyProgram;
 
 	cloud_shader =
 			LLPipeline::sUnderWaterRender ?
-				&gObjectSimpleWaterProgram :
+				&gObjectFullbrightNoColorWaterProgram :
 				&gWLCloudProgram;
 }
 
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index f781d5f3ff9..799866091b9 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -40,6 +40,7 @@
 #include "llvertexbuffer.h"
 #include "llviewerdisplay.h"
 #include "llrender.h"
+#include "llglslshader.h"
 
 // static
 LLViewerDynamicTexture::instance_list_t LLViewerDynamicTexture::sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
@@ -206,6 +207,12 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		return TRUE;
 	}
 
+	LLGLSLShader::bindNoShader();
+	LLVertexBuffer::unbind();
+	//allow fixed function when rendering dynamic textures
+	bool no_fixed = LLGLSLShader::sNoFixedFunction;
+	LLGLSLShader::sNoFixedFunction = false;
+
 	BOOL result = FALSE;
 	BOOL ret = FALSE ;
 	for( S32 order = 0; order < ORDER_COUNT; order++ )
@@ -236,6 +243,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		}
 	}
 
+	LLGLSLShader::sNoFixedFunction = no_fixed;
 	return ret;
 }
 
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 432e61f6d84..f5a8013f4df 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -362,8 +362,8 @@ void LLFace::setSize(S32 num_vertices, S32 num_indices, bool align)
 {
 	if (align)
 	{
-		//allocate vertices in blocks of 4 for alignment
-		num_vertices = (num_vertices + 0x3) & ~0x3;
+		//allocate vertices in blocks of 16 for alignment
+		num_vertices = (num_vertices + 0xF) & ~0xF;
 	}
 	
 	if (mGeomCount != num_vertices ||
@@ -503,7 +503,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
 			glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix);
 		}
 
-		glColor4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 	
 		if (mDrawablep->isState(LLDrawable::RIGGED))
 		{
@@ -1055,6 +1055,7 @@ static LLFastTimer::DeclareTimer FTM_FACE_GEOM_POSITION("Position");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_NORMAL("Normal");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TEXTURE("Texture");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_COLOR("Color");
+static LLFastTimer::DeclareTimer FTM_FACE_GEOM_EMISSIVE("Emissive");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_BINORMAL("Binormal");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index");
@@ -1124,6 +1125,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	
 	bool rebuild_pos = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_POSITION);
 	bool rebuild_color = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_COLOR);
+	bool rebuild_emissive = rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE);
 	bool rebuild_tcoord = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_TCOORD);
 	bool rebuild_normal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL);
 	bool rebuild_binormal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_BINORMAL);
@@ -1758,6 +1760,44 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		}
 	}
 
+	if (rebuild_emissive)
+	{
+		LLFastTimer t(FTM_FACE_GEOM_EMISSIVE);
+		LLStrider<U8> emissive;
+		mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount, map_range);
+
+		U8 glow = (U8) llclamp((S32) (getTextureEntry()->getGlow()*255), 0, 255);
+
+		LLVector4a src;
+
+		
+		U32 glow32 = glow |
+					 (glow << 8) |
+					 (glow << 16) |
+					 (glow << 24);
+
+		U32 vec[4];
+		vec[0] = vec[1] = vec[2] = vec[3] = glow32;
+		
+		src.loadua((F32*) vec);
+
+		LLVector4a* dst = (LLVector4a*) emissive.get();
+		S32 num_vecs = num_vertices/16;
+		if (num_vertices%16 > 0)
+		{
+			++num_vecs;
+		}
+
+		for (S32 i = 0; i < num_vecs; i++)
+		{	
+			dst[i] = src;
+		}
+
+		if (map_range)
+		{
+			mVertexBuffer->setBuffer(0);
+		}
+	}
 	if (rebuild_tcoord)
 	{
 		mTexExtents[0].setVec(0,0);
@@ -2095,7 +2135,7 @@ void LLFace::renderSetColor() const
 	{
 		const LLColor4* color = &(getRenderColor());
 		
-		glColor4fv(color->mV);
+		gGL.diffuseColor4fv(color->mV);
 	}
 }
 
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index b5eaeecd60e..82e4ab61b7d 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -329,13 +329,9 @@ class LLFace
 			{
 				return lhs->getTexture() < rhs->getTexture();
 			}
-			else if (lte->getBumpShinyFullbright() != rte->getBumpShinyFullbright())
-			{
-				return lte->getBumpShinyFullbright() < rte->getBumpShinyFullbright();
-			}
 			else 
 			{
-				return lte->getGlow() < rte->getGlow();
+				return lte->getBumpShinyFullbright() < rte->getBumpShinyFullbright();
 			}
 		}
 	};
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index e4d8e3513d7..dc4c15316a3 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -691,7 +691,7 @@ BOOL LLImagePreviewAvatar::render()
 	LLVertexBuffer::unbind();
 	avatarp->updateLOD();
 	
-
+	
 	if (avatarp->mDrawable.notNull())
 	{
 		LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
@@ -699,7 +699,7 @@ BOOL LLImagePreviewAvatar::render()
 		LLGLDisable no_blend(GL_BLEND);
 
 		LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
-		
+		gPipeline.enableLightsPreview();
 		avatarPoolp->renderAvatars(avatarp);  // renders only one avatar
 	}
 
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ab6753b4be3..9f9bbee4b59 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4826,7 +4826,7 @@ BOOL LLModelPreview::render()
 
 					if (textures)
 					{
-						glColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
+						gGL.diffuseColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
 						if (i < instance.mMaterial.size() && instance.mMaterial[i].mDiffuseMap.notNull())
 						{
 							if (instance.mMaterial[i].mDiffuseMap->getDiscardLevel() > -1)
@@ -4838,12 +4838,12 @@ BOOL LLModelPreview::render()
 					}
 					else
 					{
-						glColor4f(1,1,1,1);
+						gGL.diffuseColor4f(1,1,1,1);
 					}
 
 					buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 					gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-					glColor3f(0.4f, 0.4f, 0.4f);
+					gGL.diffuseColor3f(0.4f, 0.4f, 0.4f);
 
 					if (edges)
 					{
@@ -4945,11 +4945,11 @@ BOOL LLModelPreview::render()
 
 							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-							glColor4f(0.4f, 0.4f, 0.0f, 0.4f);
+							gGL.diffuseColor4f(0.4f, 0.4f, 0.0f, 0.4f);
 
 							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 
-							glColor3f(1.f, 1.f, 0.f);
+							gGL.diffuseColor3f(1.f, 1.f, 0.f);
 
 							glLineWidth(2.f);
 							glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
@@ -4969,7 +4969,7 @@ BOOL LLModelPreview::render()
 				//show degenerate triangles
 				LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
 				LLGLDisable cull(GL_CULL_FACE);
-				glColor4f(1.f,0.f,0.f,1.f);
+				gGL.diffuseColor4f(1.f,0.f,0.f,1.f);
 				const LLVector4a scale(0.5f);
 
 				for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
@@ -5133,10 +5133,10 @@ BOOL LLModelPreview::render()
 							}
 
 							buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
-							glColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
+							gGL.diffuseColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 							buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
-							glColor3f(0.4f, 0.4f, 0.4f);
+							gGL.diffuseColor3f(0.4f, 0.4f, 0.4f);
 
 							if (edges)
 							{
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index 85e00436510..d10f6562f79 100644
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -466,11 +466,11 @@ void LLManip::renderXYZ(const LLVector3 &vec)
 		feedback_string = llformat("X: %.3f", vec.mV[VX]);
 		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE);
 
-		glColor3f(0.5f, 1.f, 0.5f);
+		gGL.diffuseColor3f(0.5f, 1.f, 0.5f);
 		feedback_string = llformat("Y: %.3f", vec.mV[VY]);
 		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE);
 		
-		glColor3f(0.5f, 0.5f, 1.f);
+		gGL.diffuseColor3f(0.5f, 0.5f, 1.f);
 		feedback_string = llformat("Z: %.3f", vec.mV[VZ]);
 		hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE);
 	}
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index f871df0c36c..c4f8369cd0e 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1665,7 +1665,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
 		glStencilFunc(GL_ALWAYS, 0, stencil_mask);
 		gGL.setColorMask(false, false);
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-		glColor4f(1,1,1,1);
+		gGL.diffuseColor4f(1,1,1,1);
 
 		//setup clip plane
 		normal = normal * grid_rotation;
@@ -2239,7 +2239,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
 			break;
 		}
 
-		glColor4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 		glRotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]);
 		glScalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f);
 
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 18d6731fcb2..3ff5a05d81e 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -169,7 +169,7 @@ void LLPreviewTexture::draw()
 				saveAs();
 			}
 			// Draw the texture
-			glColor3f( 1.f, 1.f, 1.f );
+			gGL.diffuseColor3f( 1.f, 1.f, 1.f );
 			gl_draw_scaled_image(interior.mLeft,
 								interior.mBottom,
 								interior.getWidth(),
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 26b2b0f5c3c..8aa24e92619 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5638,7 +5638,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 		LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL);
 		gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
 		{
-			glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
+			gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
 			pushWireframe(drawable);
 		}
 	}
@@ -5646,7 +5646,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 	gGL.flush();
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
 
-	glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
+	gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
 	LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
 	glPolygonOffset(3.f, 3.f);
 	glLineWidth(3.f);
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index e23b4314574..064eaa49dd0 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2503,7 +2503,7 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
 		{
 			params = *j;
 			LLRenderPass::applyModelMatrix(*params);
-			glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f);
+			gGL.diffuseColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f);
 			params->mVertexBuffer->setBuffer(mask);
 			params->mVertexBuffer->drawRange(params->mParticle ? LLRender::POINTS : LLRender::TRIANGLES,
 				params->mStart, params->mEnd, params->mCount, params->mOffset);
@@ -2560,11 +2560,11 @@ void renderOctree(LLSpatialGroup* group)
 					{
 						if (gFrameTimeSeconds - face->mLastUpdateTime < 0.5f)
 						{
-							glColor4f(0, 1, 0, group->mBuilt);
+							gGL.diffuseColor4f(0, 1, 0, group->mBuilt);
 						}
 						else if (gFrameTimeSeconds - face->mLastMoveTime < 0.5f)
 						{
-							glColor4f(1, 0, 0, group->mBuilt);
+							gGL.diffuseColor4f(1, 0, 0, group->mBuilt);
 						}
 						else
 						{
@@ -2661,7 +2661,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 	if (render_objects)
 	{
 		LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER);
-		glColor4f(0, 0.5f, 0, 0.5f);
+		gGL.diffuseColor4f(0, 0.5f, 0, 0.5f);
 		gGL.color4f(0, 0.5f, 0, 0.5f);
 		pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
 	}
@@ -2671,7 +2671,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 
 		if (render_objects)
 		{
-			glColor4f(0.f, 0.5f, 0.f,1.f);
+			gGL.diffuseColor4f(0.f, 0.5f, 0.f,1.f);
 			gGL.color4f(0.f, 0.5f, 0.f, 1.f);
 			pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
 		}
@@ -2680,7 +2680,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 
 		if (render_objects)
 		{
-			glColor4f(0.f, 0.75f, 0.f,0.5f);
+			gGL.diffuseColor4f(0.f, 0.75f, 0.f,0.5f);
 			gGL.color4f(0.f, 0.75f, 0.f, 0.5f);
 			pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
 		}
@@ -2689,11 +2689,11 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 			LLVertexBuffer::unbind();
 			group->mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
 			
-			glColor4f(1.0f, 0.f, 0.f, 0.5f);
+			gGL.diffuseColor4f(1.0f, 0.f, 0.f, 0.5f);
 			group->mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, group->mBounds[0]));
 			glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 			
-			glColor4f(1.0f, 1.f, 1.f, 1.0f);
+			gGL.diffuseColor4f(1.0f, 1.f, 1.f, 1.0f);
 			group->mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, group->mBounds[0]));
 			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 		}*/
@@ -2726,23 +2726,23 @@ void renderUpdateType(LLDrawable* drawablep)
 	switch (vobj->getLastUpdateType())
 	{
 	case OUT_FULL:
-		glColor4f(0,1,0,0.5f);
+		gGL.diffuseColor4f(0,1,0,0.5f);
 		break;
 	case OUT_TERSE_IMPROVED:
-		glColor4f(0,1,1,0.5f);
+		gGL.diffuseColor4f(0,1,1,0.5f);
 		break;
 	case OUT_FULL_COMPRESSED:
 		if (vobj->getLastUpdateCached())
 		{
-			glColor4f(1,0,0,0.5f);
+			gGL.diffuseColor4f(1,0,0,0.5f);
 		}
 		else
 		{
-			glColor4f(1,1,0,0.5f);
+			gGL.diffuseColor4f(1,1,0,0.5f);
 		}
 		break;
 	case OUT_FULL_CACHED:
-		glColor4f(0,0,1,0.5f);
+		gGL.diffuseColor4f(0,0,1,0.5f);
 		break;
 	default:
 		llwarns << "Unknown update_type " << vobj->getLastUpdateType() << llendl;
@@ -2936,7 +2936,7 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLCo
 	{		
 		if (!decomp->mBaseHullMesh.empty())
 		{
-			glColor4fv(color.mV);
+			gGL.diffuseColor4fv(color.mV);
 			LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions, decomp->mBaseHullMesh.mNormals);
 		}
 		else
@@ -2956,13 +2956,13 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLCo
 
 void render_hull(LLModel::PhysicsMesh& mesh, const LLColor4& color, const LLColor4& line_color)
 {
-	glColor4fv(color.mV);
+	gGL.diffuseColor4fv(color.mV);
 	LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals);
 	LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
 	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 	glPolygonOffset(3.f, 3.f);
 	glLineWidth(3.f);
-	glColor4fv(line_color.mV);
+	gGL.diffuseColor4fv(line_color.mV);
 	LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals);
 	glLineWidth(1.f);
 	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@@ -3044,11 +3044,11 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 			else if (!decomp->mPhysicsShapeMesh.empty())
 			{ 
 				//decomp has physics mesh, render that mesh
-				glColor4fv(color.mV);
+				gGL.diffuseColor4fv(color.mV);
 				LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals);
 								
 				glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-				glColor4fv(line_color.mV);
+				gGL.diffuseColor4fv(line_color.mV);
 				LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals);
 				glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 			}
@@ -3174,7 +3174,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 			
 				glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 				
-				glColor4fv(line_color.mV);
+				gGL.diffuseColor4fv(line_color.mV);
 				LLVertexBuffer::unbind();
 
 				llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
@@ -3182,7 +3182,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 				glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
 				glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
 				
-				glColor4fv(color.mV);
+				gGL.diffuseColor4fv(color.mV);
 				glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 				glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
 			}
@@ -3216,7 +3216,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		volume_params.setShear	( 0, 0 );
 		LLVolume* sphere = LLPrimitive::sVolumeManager->refVolume(volume_params, 3);
 		
-		glColor4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 		pushVerts(sphere);
 		LLPrimitive::sVolumeManager->unrefVolume(sphere);
 	}
@@ -3230,7 +3230,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		volume_params.setShear	( 0, 0 );
 		LLVolume* cylinder = LLPrimitive::sVolumeManager->refVolume(volume_params, 3);
 		
-		glColor4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 		pushVerts(cylinder);
 		LLPrimitive::sVolumeManager->unrefVolume(cylinder);
 	}
@@ -3242,10 +3242,10 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
 		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 		
-		glColor4fv(line_color.mV);
+		gGL.diffuseColor4fv(line_color.mV);
 		pushVerts(phys_volume);
 		
-		glColor4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 		pushVerts(phys_volume);
 		LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
@@ -3263,10 +3263,10 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 			llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
 			LLVertexBuffer::unbind();
 			glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
-			glColor4fv(line_color.mV);
+			gGL.diffuseColor4fv(line_color.mV);
 			glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
 			
-			glColor4fv(color.mV);
+			gGL.diffuseColor4fv(color.mV);
 			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 			glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);			
 		}
@@ -3290,10 +3290,10 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 	gGL.popMatrix();
 
 	/*{ //analytical shape, just push visual rep.
-		glColor3fv(color.mV);
+		gGL.diffuseColor3fv(color.mV);
 		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 		pushVerts(drawable, data_mask);
-		glColor4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 		pushVerts(drawable, data_mask);
 	}*/
@@ -3335,10 +3335,10 @@ void renderPhysicsShapes(LLSpatialGroup* group)
 						glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 
 						buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
-						glColor3f(0.2f, 0.5f, 0.3f);
+						gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
 						buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0);
 									
-						glColor3f(0.2f, 1.f, 0.3f);
+						gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
 						glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 						buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0);
 					}
@@ -3430,7 +3430,7 @@ void renderTextureAnim(LLDrawInfo* params)
 	}
 	
 	LLGLEnable blend(GL_BLEND);
-	glColor4f(1,1,0,0.5f);
+	gGL.diffuseColor4f(1,1,0,0.5f);
 	pushVerts(params, LLVertexBuffer::MAP_VERTEX);
 }
 
@@ -3456,22 +3456,22 @@ void renderShadowFrusta(LLDrawInfo* params)
 
 	if (gPipeline.mShadowCamera[4].AABBInFrustum(center, size))
 	{
-		glColor3f(1,0,0);
+		gGL.diffuseColor3f(1,0,0);
 		pushVerts(params, LLVertexBuffer::MAP_VERTEX);
 	}
 	if (gPipeline.mShadowCamera[5].AABBInFrustum(center, size))
 	{
-		glColor3f(0,1,0);
+		gGL.diffuseColor3f(0,1,0);
 		pushVerts(params, LLVertexBuffer::MAP_VERTEX);
 	}
 	if (gPipeline.mShadowCamera[6].AABBInFrustum(center, size))
 	{
-		glColor3f(0,0,1);
+		gGL.diffuseColor3f(0,0,1);
 		pushVerts(params, LLVertexBuffer::MAP_VERTEX);
 	}
 	if (gPipeline.mShadowCamera[7].AABBInFrustum(center, size))
 	{
-		glColor3f(1,0,1);
+		gGL.diffuseColor3f(1,0,1);
 		pushVerts(params, LLVertexBuffer::MAP_VERTEX);
 	}
 
@@ -3489,7 +3489,7 @@ void renderLights(LLDrawable* drawablep)
 	if (drawablep->getNumFaces())
 	{
 		LLGLEnable blend(GL_BLEND);
-		glColor4f(0,1,1,0.5f);
+		gGL.diffuseColor4f(0,1,1,0.5f);
 
 		for (S32 i = 0; i < drawablep->getNumFaces(); i++)
 		{
@@ -3657,7 +3657,7 @@ void renderRaycast(LLDrawable* drawablep)
 					{
 						//render face positions
 						LLVertexBuffer::unbind();
-						glColor4f(0,1,1,0.5f);
+						gGL.diffuseColor4f(0,1,1,0.5f);
 						glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
 						glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
 					}
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 54d5d36f6ea..077d0fed65f 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -93,7 +93,6 @@ class LLDrawInfo : public LLRefCount
 	LLPointer<LLViewerTexture>     mTexture;
 	std::vector<LLPointer<LLViewerTexture> > mTextureList;
 
-	LLColor4U mGlowColor;
 	S32 mDebugColor;
 	const LLMatrix4* mTextureMatrix;
 	const LLMatrix4* mModelMatrix;
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index e8abee2fb76..87e7a57ae81 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -295,6 +295,8 @@ BOOL LLTexLayerSetBuffer::render()
 	
 	BOOL success = TRUE;
 
+	LLVertexBuffer::unbind();
+
 	//hack to use fixed function when updating tex layer sets
 	bool no_ff = LLGLSLShader::sNoFixedFunction;
 	LLGLSLShader::sNoFixedFunction = false;
@@ -304,6 +306,7 @@ BOOL LLTexLayerSetBuffer::render()
 	success &= mTexLayerSet->render( mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight );
 	gGL.flush();
 
+	LLVertexBuffer::unbind();
 	LLGLSLShader::sNoFixedFunction = no_ff;
 	
 	if(upload_now)
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 0115115a230..f4b01a6babe 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -571,7 +571,7 @@ void LLGLTexMemBar::draw()
 	color = (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale)) ? LLColor4::green :
 		  	(total_mem < max_total_mem) ? LLColor4::yellow : LLColor4::red;
 	color[VALPHA] = .75f;
-	glColor4fv(color.mV);
+	gGL.diffuseColor4fv(color.mV);
 	
 	gl_rect_2d(left, top, right, bottom); // red/yellow/green
 
@@ -594,7 +594,7 @@ void LLGLTexMemBar::draw()
 	color = (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale)) ? LLColor4::green :
 		  	(bound_mem < max_bound_mem) ? LLColor4::yellow : LLColor4::red;
 	color[VALPHA] = .75f;
-	glColor4fv(color.mV);
+	gGL.diffuseColor4fv(color.mV);
 
 	gl_rect_2d(left, top, right, bottom);
 #else
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 77c8bb03294..5e4c124c45a 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -527,9 +527,9 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 	// setup current color
 	//----------------------------------------------------------------
 	if (is_dummy)
-		glColor4fv(LLVOAvatar::getDummyColor().mV);
+		gGL.diffuseColor4fv(LLVOAvatar::getDummyColor().mV);
 	else
-		glColor4fv(mColor.mV);
+		gGL.diffuseColor4fv(mColor.mV);
 
 	stop_glerror();
 	
@@ -547,11 +547,11 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 
 		if (mIsTransparent)
 		{
-			glColor4f(1.f, 1.f, 1.f, 1.f);
+			gGL.diffuseColor4f(1.f, 1.f, 1.f, 1.f);
 		}
 		else
 		{
-			glColor4f(0.7f, 0.6f, 0.3f, 1.f);
+			gGL.diffuseColor4f(0.7f, 0.6f, 0.3f, 1.f);
 			gGL.getTexUnit(diffuse_channel)->setTextureColorBlend(LLTexUnit::TBO_LERP_TEX_ALPHA, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR);
 		}
 	}
@@ -582,13 +582,16 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 		gGL.getTexUnit(diffuse_channel)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT));
 	}
 	
-	mFace->getVertexBuffer()->setBuffer(sRenderMask);
+	
+	U32 mask = sRenderMask;
 
 	U32 start = mMesh->mFaceVertexOffset;
 	U32 end = start + mMesh->mFaceVertexCount - 1;
 	U32 count = mMesh->mFaceIndexCount;
 	U32 offset = mMesh->mFaceIndexOffset;
 
+	LLVertexBuffer* buff = mFace->getVertexBuffer();
+
 	if (mMesh->hasWeights())
 	{
 		if ((mFace->getPool()->getVertexShaderLevel() > 0))
@@ -597,16 +600,23 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 			{
 				uploadJointMatrices();
 			}
+			mask = mask | LLVertexBuffer::MAP_WEIGHT;
+			if (mFace->getPool()->getVertexShaderLevel() > 1)
+			{
+				mask = mask | LLVertexBuffer::MAP_CLOTHWEIGHT;
+			}
 		}
 		
-		mFace->getVertexBuffer()->drawRange(LLRender::TRIANGLES, start, end, count, offset);
+		buff->setBuffer(mask);
+		buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);
 	}
 	else
 	{
 		glPushMatrix();
 		LLMatrix4 jointToWorld = getWorldMatrix();
 		glMultMatrixf((GLfloat*)jointToWorld.mMatrix);
-		mFace->getVertexBuffer()->drawRange(LLRender::TRIANGLES, start, end, count, offset);
+		buff->setBuffer(mask);
+		buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);
 		glPopMatrix();
 	}
 	gPipeline.addTrianglesDrawn(count);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index fa8d43e0b23..8684322eef4 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -66,6 +66,7 @@ LLGLSLShader	gOcclusionProgram;
 LLGLSLShader	gCustomAlphaProgram;
 LLGLSLShader	gGlowCombineProgram;
 LLGLSLShader	gTwoTextureAddProgram;
+LLGLSLShader	gOneTextureNoColorProgram;
 
 //object shaders
 LLGLSLShader		gObjectSimpleProgram;
@@ -74,6 +75,8 @@ LLGLSLShader		gObjectSimpleAlphaMaskProgram;
 LLGLSLShader		gObjectSimpleWaterAlphaMaskProgram;
 LLGLSLShader		gObjectFullbrightProgram;
 LLGLSLShader		gObjectFullbrightWaterProgram;
+LLGLSLShader		gObjectEmissiveProgram;
+LLGLSLShader		gObjectEmissiveWaterProgram;
 LLGLSLShader		gObjectFullbrightAlphaMaskProgram;
 LLGLSLShader		gObjectFullbrightWaterAlphaMaskProgram;
 LLGLSLShader		gObjectFullbrightShinyProgram;
@@ -81,11 +84,17 @@ LLGLSLShader		gObjectFullbrightShinyWaterProgram;
 LLGLSLShader		gObjectShinyProgram;
 LLGLSLShader		gObjectShinyWaterProgram;
 LLGLSLShader		gObjectBumpProgram;
+LLGLSLShader		gTreeProgram;
+LLGLSLShader		gTreeWaterProgram;
+LLGLSLShader		gObjectFullbrightNoColorProgram;
+LLGLSLShader		gObjectFullbrightNoColorWaterProgram;
 
 LLGLSLShader		gObjectSimpleNonIndexedProgram;
 LLGLSLShader		gObjectSimpleNonIndexedWaterProgram;
 LLGLSLShader		gObjectAlphaMaskNonIndexedProgram;
 LLGLSLShader		gObjectAlphaMaskNonIndexedWaterProgram;
+LLGLSLShader		gObjectAlphaMaskNoColorProgram;
+LLGLSLShader		gObjectAlphaMaskNoColorWaterProgram;
 LLGLSLShader		gObjectFullbrightNonIndexedProgram;
 LLGLSLShader		gObjectFullbrightNonIndexedWaterProgram;
 LLGLSLShader		gObjectFullbrightShinyNonIndexedProgram;
@@ -123,6 +132,7 @@ LLGLSLShader		gAvatarPickProgram;
 LLGLSLShader			gWLSkyProgram;
 LLGLSLShader			gWLCloudProgram;
 
+
 // Effects Shaders
 LLGLSLShader			gGlowProgram;
 LLGLSLShader			gGlowExtractProgram;
@@ -186,14 +196,19 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gWaterProgram);
 	mShaderList.push_back(&gAvatarEyeballProgram); 
 	mShaderList.push_back(&gObjectSimpleProgram);
+	mShaderList.push_back(&gObjectFullbrightNoColorProgram);
+	mShaderList.push_back(&gObjectFullbrightNoColorWaterProgram);
 	mShaderList.push_back(&gObjectSimpleAlphaMaskProgram);
 	mShaderList.push_back(&gObjectBumpProgram);
 	mShaderList.push_back(&gUIProgram);
 	mShaderList.push_back(&gCustomAlphaProgram);
 	mShaderList.push_back(&gGlowCombineProgram);
 	mShaderList.push_back(&gTwoTextureAddProgram);
+	mShaderList.push_back(&gOneTextureNoColorProgram);
 	mShaderList.push_back(&gSolidColorProgram);
 	mShaderList.push_back(&gOcclusionProgram);
+	mShaderList.push_back(&gObjectEmissiveProgram);
+	mShaderList.push_back(&gObjectEmissiveWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightProgram);
 	mShaderList.push_back(&gObjectFullbrightAlphaMaskProgram);
 	mShaderList.push_back(&gObjectFullbrightShinyProgram);
@@ -202,6 +217,10 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gObjectSimpleNonIndexedWaterProgram);
 	mShaderList.push_back(&gObjectAlphaMaskNonIndexedProgram);
 	mShaderList.push_back(&gObjectAlphaMaskNonIndexedWaterProgram);
+	mShaderList.push_back(&gObjectAlphaMaskNoColorProgram);
+	mShaderList.push_back(&gObjectAlphaMaskNoColorWaterProgram);
+	mShaderList.push_back(&gTreeProgram);
+	mShaderList.push_back(&gTreeWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightNonIndexedProgram);
 	mShaderList.push_back(&gObjectFullbrightNonIndexedWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightShinyNonIndexedProgram);
@@ -266,19 +285,24 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void)
 {
 	if (mReservedAttribs.empty())
 	{
-		mReservedAttribs.push_back("materialColor");
-		mReservedAttribs.push_back("specularColor");
+		//MUST match order of enum in LLVertexBuffer.h
+		mReservedAttribs.push_back("position");
+		mReservedAttribs.push_back("normal");
+		mReservedAttribs.push_back("texcoord0");
+		mReservedAttribs.push_back("texcoord1");
+		mReservedAttribs.push_back("texcoord2");
+		mReservedAttribs.push_back("texcoord3");
+		mReservedAttribs.push_back("diffuse_color");
+		mReservedAttribs.push_back("emissive");
 		mReservedAttribs.push_back("binormal");
-		mReservedAttribs.push_back("object_weight");
-
-		mAvatarAttribs.reserve(5);
-		mAvatarAttribs.push_back("weight");
-		mAvatarAttribs.push_back("clothing");
-		mAvatarAttribs.push_back("gWindDir");
-		mAvatarAttribs.push_back("gSinWaveParams");
-		mAvatarAttribs.push_back("gGravity");
+		mReservedAttribs.push_back("weight");
+		mReservedAttribs.push_back("weight4");
+		mReservedAttribs.push_back("clothing");
 
 		mAvatarUniforms.push_back("matrixPalette");
+		mAvatarUniforms.push_back("gWindDir");
+		mAvatarUniforms.push_back("gSinWaveParams");
+		mAvatarUniforms.push_back("gGravity");
 
 		mReservedUniforms.reserve(24);
 		mReservedUniforms.push_back("diffuseMap");
@@ -444,6 +468,7 @@ void LLViewerShaderMgr::setShaders()
 	mMaxAvatarShaderLevel = 0;
 
 	LLGLSLShader::sNoFixedFunction = false;
+	LLVertexBuffer::unbind();
 	if (LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") 
 		&& gSavedSettings.getBOOL("VertexShaderEnable"))
 	{
@@ -635,8 +660,11 @@ void LLViewerShaderMgr::unloadShaders()
 	gCustomAlphaProgram.unload();
 	gGlowCombineProgram.unload();
 	gTwoTextureAddProgram.unload();
+	gOneTextureNoColorProgram.unload();
 	gSolidColorProgram.unload();
 
+	gObjectFullbrightNoColorProgram.unload();
+	gObjectFullbrightNoColorWaterProgram.unload();
 	gObjectSimpleProgram.unload();
 	gObjectSimpleAlphaMaskProgram.unload();
 	gObjectBumpProgram.unload();
@@ -644,6 +672,8 @@ void LLViewerShaderMgr::unloadShaders()
 	gObjectSimpleWaterAlphaMaskProgram.unload();
 	gObjectFullbrightProgram.unload();
 	gObjectFullbrightWaterProgram.unload();
+	gObjectEmissiveProgram.unload();
+	gObjectEmissiveWaterProgram.unload();
 	gObjectFullbrightAlphaMaskProgram.unload();
 	gObjectFullbrightWaterAlphaMaskProgram.unload();
 
@@ -656,8 +686,12 @@ void LLViewerShaderMgr::unloadShaders()
 	gObjectSimpleNonIndexedWaterProgram.unload();
 	gObjectAlphaMaskNonIndexedProgram.unload();
 	gObjectAlphaMaskNonIndexedWaterProgram.unload();
+	gObjectAlphaMaskNoColorProgram.unload();
+	gObjectAlphaMaskNoColorWaterProgram.unload();
 	gObjectFullbrightNonIndexedProgram.unload();
 	gObjectFullbrightNonIndexedWaterProgram.unload();
+	gTreeProgram.unload();
+	gTreeWaterProgram.unload();
 
 	gObjectShinyNonIndexedProgram.unload();
 	gObjectFullbrightShinyNonIndexedProgram.unload();
@@ -1472,7 +1506,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAvatarShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-		success = gDeferredAvatarShadowProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
+		success = gDeferredAvatarShadowProgram.createShader(NULL, &mAvatarUniforms);
 	}
 
 	if (success)
@@ -1504,7 +1538,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-		success = gDeferredAvatarProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
+		success = gDeferredAvatarProgram.createShader(NULL, &mAvatarUniforms);
 	}
 
 	if (success)
@@ -1521,7 +1555,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-		success = gDeferredAvatarAlphaProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
+		success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms);
 	}
 
 	if (success)
@@ -1677,11 +1711,15 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectFullbrightShinyProgram.unload();
 		gObjectFullbrightShinyWaterProgram.unload();
 		gObjectShinyWaterProgram.unload();
+		gObjectFullbrightNoColorProgram.unload();
+		gObjectFullbrightNoColorWaterProgram.unload();
 		gObjectSimpleProgram.unload();
 		gObjectSimpleAlphaMaskProgram.unload();
 		gObjectBumpProgram.unload();
 		gObjectSimpleWaterProgram.unload();
 		gObjectSimpleWaterAlphaMaskProgram.unload();
+		gObjectEmissiveProgram.unload();
+		gObjectEmissiveWaterProgram.unload();
 		gObjectFullbrightProgram.unload();
 		gObjectFullbrightAlphaMaskProgram.unload();
 		gObjectFullbrightWaterProgram.unload();
@@ -1694,6 +1732,8 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectSimpleNonIndexedWaterProgram.unload();
 		gObjectAlphaMaskNonIndexedProgram.unload();
 		gObjectAlphaMaskNonIndexedWaterProgram.unload();
+		gObjectAlphaMaskNoColorProgram.unload();
+		gObjectAlphaMaskNoColorWaterProgram.unload();
 		gObjectFullbrightNonIndexedProgram.unload();
 		gObjectFullbrightNonIndexedWaterProgram.unload();
 		gSkinnedObjectSimpleProgram.unload();
@@ -1704,6 +1744,8 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gSkinnedObjectFullbrightWaterProgram.unload();
 		gSkinnedObjectFullbrightShinyWaterProgram.unload();
 		gSkinnedObjectShinySimpleWaterProgram.unload();
+		gTreeProgram.unload();
+		gTreeWaterProgram.unload();
 	
 		return TRUE;
 	}
@@ -1752,7 +1794,7 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectAlphaMaskNonIndexedProgram.mFeatures.disableTextureIndex = true;
 		gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAlphaMask = true;
 		gObjectAlphaMaskNonIndexedProgram.mShaderFiles.clear();
-		gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER_ARB));
 		gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gObjectAlphaMaskNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
 		success = gObjectAlphaMaskNonIndexedProgram.createShader(NULL, NULL);
@@ -1769,13 +1811,83 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.disableTextureIndex = true;
 		gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAlphaMask = true;
 		gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.clear();
-		gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER_ARB));
 		gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gObjectAlphaMaskNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
 		gObjectAlphaMaskNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
 		success = gObjectAlphaMaskNonIndexedWaterProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gObjectAlphaMaskNoColorProgram.mName = "No color alpha mask Shader";
+		gObjectAlphaMaskNoColorProgram.mFeatures.calculatesLighting = true;
+		gObjectAlphaMaskNoColorProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectAlphaMaskNoColorProgram.mFeatures.hasGamma = true;
+		gObjectAlphaMaskNoColorProgram.mFeatures.hasAtmospherics = true;
+		gObjectAlphaMaskNoColorProgram.mFeatures.hasLighting = true;
+		gObjectAlphaMaskNoColorProgram.mFeatures.disableTextureIndex = true;
+		gObjectAlphaMaskNoColorProgram.mFeatures.hasAlphaMask = true;
+		gObjectAlphaMaskNoColorProgram.mShaderFiles.clear();
+		gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectAlphaMaskNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectAlphaMaskNoColorProgram.createShader(NULL, NULL);
+	}
+	
+	if (success)
+	{
+		gObjectAlphaMaskNoColorWaterProgram.mName = "No color alpha mask Water Shader";
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.calculatesLighting = true;
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasWaterFog = true;
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasAtmospherics = true;
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasLighting = true;
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.disableTextureIndex = true;
+		gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasAlphaMask = true;
+		gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.clear();
+		gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectAlphaMaskNoColorWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gObjectAlphaMaskNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gObjectAlphaMaskNoColorWaterProgram.createShader(NULL, NULL);
+	}
+
+	if (success)
+	{
+		gTreeProgram.mName = "Tree Shader";
+		gTreeProgram.mFeatures.calculatesLighting = true;
+		gTreeProgram.mFeatures.calculatesAtmospherics = true;
+		gTreeProgram.mFeatures.hasGamma = true;
+		gTreeProgram.mFeatures.hasAtmospherics = true;
+		gTreeProgram.mFeatures.hasLighting = true;
+		gTreeProgram.mFeatures.disableTextureIndex = true;
+		gTreeProgram.mFeatures.hasAlphaMask = true;
+		gTreeProgram.mShaderFiles.clear();
+		gTreeProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER_ARB));
+		gTreeProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gTreeProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gTreeProgram.createShader(NULL, NULL);
+	}
+	
+	if (success)
+	{
+		gTreeWaterProgram.mName = "Tree Water Shader";
+		gTreeWaterProgram.mFeatures.calculatesLighting = true;
+		gTreeWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gTreeWaterProgram.mFeatures.hasWaterFog = true;
+		gTreeWaterProgram.mFeatures.hasAtmospherics = true;
+		gTreeWaterProgram.mFeatures.hasLighting = true;
+		gTreeWaterProgram.mFeatures.disableTextureIndex = true;
+		gTreeWaterProgram.mFeatures.hasAlphaMask = true;
+		gTreeWaterProgram.mShaderFiles.clear();
+		gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER_ARB));
+		gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gTreeWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gTreeWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gTreeWaterProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gObjectFullbrightNonIndexedProgram.mName = "Non Indexed Fullbright Shader";
@@ -1807,6 +1919,37 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gObjectFullbrightNonIndexedWaterProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gObjectFullbrightNoColorProgram.mName = "Non Indexed no color Fullbright Shader";
+		gObjectFullbrightNoColorProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectFullbrightNoColorProgram.mFeatures.hasGamma = true;
+		gObjectFullbrightNoColorProgram.mFeatures.hasTransport = true;
+		gObjectFullbrightNoColorProgram.mFeatures.isFullbright = true;
+		gObjectFullbrightNoColorProgram.mFeatures.disableTextureIndex = true;
+		gObjectFullbrightNoColorProgram.mShaderFiles.clear();
+		gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectFullbrightNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectFullbrightNoColorProgram.createShader(NULL, NULL);
+	}
+
+	if (success)
+	{
+		gObjectFullbrightNoColorWaterProgram.mName = "Non Indexed no color Fullbright Water Shader";
+		gObjectFullbrightNoColorWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectFullbrightNoColorWaterProgram.mFeatures.isFullbright = true;
+		gObjectFullbrightNoColorWaterProgram.mFeatures.hasWaterFog = true;		
+		gObjectFullbrightNoColorWaterProgram.mFeatures.hasTransport = true;
+		gObjectFullbrightNoColorWaterProgram.mFeatures.disableTextureIndex = true;
+		gObjectFullbrightNoColorWaterProgram.mShaderFiles.clear();
+		gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectFullbrightNoColorWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gObjectFullbrightNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gObjectFullbrightNoColorWaterProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gObjectShinyNonIndexedProgram.mName = "Non Indexed Shiny Shader";
@@ -1892,19 +2035,19 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 
 	if (success)
 	{
-		gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader";
-		gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true;
-		gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true;
-		gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true;
-		gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true;
-		gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true;
-		gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true;
-		gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0;
-		gObjectSimpleAlphaMaskProgram.mShaderFiles.clear();
-		gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
-		gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
-		gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
-		success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL);
+		gObjectSimpleWaterProgram.mName = "Simple Water Shader";
+		gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true;
+		gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true;
+		gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true;
+		gObjectSimpleWaterProgram.mFeatures.hasLighting = true;
+		gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0;
+		gObjectSimpleWaterProgram.mShaderFiles.clear();
+		gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gObjectSimpleWaterProgram.createShader(NULL, NULL);
 	}
 	
 	if (success)
@@ -1923,23 +2066,24 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gObjectBumpProgram.createShader(NULL, NULL);
 	}
 	
+	
 	if (success)
 	{
-		gObjectSimpleWaterProgram.mName = "Simple Water Shader";
-		gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true;
-		gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true;
-		gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true;
-		gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true;
-		gObjectSimpleWaterProgram.mFeatures.hasLighting = true;
-		gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0;
-		gObjectSimpleWaterProgram.mShaderFiles.clear();
-		gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
-		gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
-		gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
-		gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
-		success = gObjectSimpleWaterProgram.createShader(NULL, NULL);
+		gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader";
+		gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true;
+		gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true;
+		gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true;
+		gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true;
+		gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true;
+		gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0;
+		gObjectSimpleAlphaMaskProgram.mShaderFiles.clear();
+		gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL);
 	}
-	
+
 	if (success)
 	{
 		gObjectSimpleWaterAlphaMaskProgram.mName = "Simple Water Alpha Mask Shader";
@@ -1989,6 +2133,37 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gObjectFullbrightWaterProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gObjectEmissiveProgram.mName = "Emissive Shader";
+		gObjectEmissiveProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectEmissiveProgram.mFeatures.hasGamma = true;
+		gObjectEmissiveProgram.mFeatures.hasTransport = true;
+		gObjectEmissiveProgram.mFeatures.isFullbright = true;
+		gObjectEmissiveProgram.mFeatures.mIndexedTextureChannels = 0;
+		gObjectEmissiveProgram.mShaderFiles.clear();
+		gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectEmissiveProgram.createShader(NULL, NULL);
+	}
+
+	if (success)
+	{
+		gObjectEmissiveWaterProgram.mName = "Emissive Water Shader";
+		gObjectEmissiveWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectEmissiveWaterProgram.mFeatures.isFullbright = true;
+		gObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true;		
+		gObjectEmissiveWaterProgram.mFeatures.hasTransport = true;
+		gObjectEmissiveWaterProgram.mFeatures.mIndexedTextureChannels = 0;
+		gObjectEmissiveWaterProgram.mShaderFiles.clear();
+		gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectEmissiveWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gObjectEmissiveWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gObjectEmissiveWaterProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gObjectFullbrightAlphaMaskProgram.mName = "Fullbright Alpha Mask Shader";
@@ -2272,7 +2447,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar()
 		gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB));
 		gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR];
-		success = gAvatarProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
+		success = gAvatarProgram.createShader(NULL, &mAvatarUniforms);
 			
 		if (success)
 		{
@@ -2291,7 +2466,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar()
 			// Note: no cloth under water:
 			gAvatarWaterProgram.mShaderLevel = llmin(mVertexShaderLevel[SHADER_AVATAR], 1);	
 			gAvatarWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;				
-			success = gAvatarWaterProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
+			success = gAvatarWaterProgram.createShader(NULL, &mAvatarUniforms);
 		}
 
 		/// Keep track of avatar levels
@@ -2310,7 +2485,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar()
 		gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER_ARB));
 		gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gAvatarPickProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR];
-		success = gAvatarPickProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
+		success = gAvatarPickProgram.createShader(NULL, &mAvatarUniforms);
 	}
 
 	if (success)
@@ -2414,6 +2589,21 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
 		}
 	}
 
+	if (success)
+	{
+		gOneTextureNoColorProgram.mName = "One Texture No Color Shader";
+		gOneTextureNoColorProgram.mShaderFiles.clear();
+		gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorV.glsl", GL_VERTEX_SHADER_ARB));
+		gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gOneTextureNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gOneTextureNoColorProgram.createShader(NULL, NULL);
+		if (success)
+		{
+			gOneTextureNoColorProgram.bind();
+			gOneTextureNoColorProgram.uniform1i("tex0", 0);
+		}
+	}
+
 	if (success)
 	{
 		gSolidColorProgram.mName = "Solid Color Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 629ef32adb4..ced7ed06d92 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -186,16 +186,10 @@ class LLViewerShaderMgr: public LLShaderMgr
 
 	typedef enum
 	{
-		AVATAR_WEIGHT = END_RESERVED_ATTRIBS,
-		AVATAR_CLOTHING,
+		AVATAR_MATRIX = END_RESERVED_UNIFORMS,
 		AVATAR_WIND,
 		AVATAR_SINWAVE,
-		AVATAR_GRAVITY
-	} eAvatarAttribs;
-
-	typedef enum
-	{
-		AVATAR_MATRIX = END_RESERVED_UNIFORMS
+		AVATAR_GRAVITY,
 	} eAvatarUniforms;
 
 	// simple model of forward iterator
@@ -265,9 +259,6 @@ class LLViewerShaderMgr: public LLShaderMgr
 
 	std::vector<std::string> mGlowExtractUniforms;
 
-	//avatar shader parameter tables
-	std::vector<std::string> mAvatarAttribs;
-
 	std::vector<std::string> mAvatarUniforms;
 
 	// the list of shaders we need to propagate parameters to.
@@ -294,7 +285,9 @@ extern LLGLSLShader			gGlowCombineProgram;
 
 //output tex0[tc0] + tex1[tc1]
 extern LLGLSLShader			gTwoTextureAddProgram;
-								
+						
+extern LLGLSLShader			gOneTextureNoColorProgram;
+
 //object shaders
 extern LLGLSLShader			gObjectSimpleProgram;
 extern LLGLSLShader			gObjectSimpleAlphaMaskProgram;
@@ -304,13 +297,21 @@ extern LLGLSLShader			gObjectSimpleNonIndexedProgram;
 extern LLGLSLShader			gObjectSimpleNonIndexedWaterProgram;
 extern LLGLSLShader			gObjectAlphaMaskNonIndexedProgram;
 extern LLGLSLShader			gObjectAlphaMaskNonIndexedWaterProgram;
+extern LLGLSLShader			gObjectAlphaMaskNoColorProgram;
+extern LLGLSLShader			gObjectAlphaMaskNoColorWaterProgram;
 extern LLGLSLShader			gObjectFullbrightProgram;
 extern LLGLSLShader			gObjectFullbrightWaterProgram;
+extern LLGLSLShader			gObjectFullbrightNoColorProgram;
+extern LLGLSLShader			gObjectFullbrightNoColorWaterProgram;
+extern LLGLSLShader			gObjectEmissiveProgram;
+extern LLGLSLShader			gObjectEmissiveWaterProgram;
 extern LLGLSLShader			gObjectFullbrightAlphaMaskProgram;
 extern LLGLSLShader			gObjectFullbrightWaterAlphaMaskProgram;
 extern LLGLSLShader			gObjectFullbrightNonIndexedProgram;
 extern LLGLSLShader			gObjectFullbrightNonIndexedWaterProgram;
 extern LLGLSLShader			gObjectBumpProgram;
+extern LLGLSLShader			gTreeProgram;
+extern LLGLSLShader			gTreeWaterProgram;
 
 extern LLGLSLShader			gObjectSimpleLODProgram;
 extern LLGLSLShader			gObjectFullbrightLODProgram;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 988c4ed1a23..6af268f2348 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3458,7 +3458,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 						glScalef(scale, scale, scale);
 
 						LLColor4 color(vovolume->getLightColor(), .5f);
-						glColor4fv(color.mV);
+						gGL.diffuseColor4fv(color.mV);
 					
 						F32 pixel_area = 100000.f;
 						// Render Outside
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 510525259f4..0b746c841cd 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -59,6 +59,12 @@ class LLVertexBufferTerrain : public LLVertexBuffer
 	// virtual
 	void setupVertexBuffer(U32 data_mask) const
 	{	
+		if (LLGLSLShader::sNoFixedFunction)
+		{ //just use default if shaders are in play
+			LLVertexBuffer::setupVertexBuffer(data_mask & ~(MAP_TEXCOORD2 | MAP_TEXCOORD3));
+			return;
+		}
+
 		U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
 
 		//assume tex coords 2 and 3 are present
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 4c137d33947..4c4ff26df88 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3830,8 +3830,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 		}
 	}
 	
-	U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255);
-
 	if (idx >= 0 && 
 		draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() &&
 		draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
@@ -3840,7 +3838,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 		draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
 		draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
 #endif
-		draw_vec[idx]->mGlowColor.mV[3] == glow &&
 		draw_vec[idx]->mFullbright == fullbright &&
 		draw_vec[idx]->mBump == bump &&
 		draw_vec[idx]->mTextureMatrix == tex_mat &&
@@ -3872,7 +3869,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 		draw_vec.push_back(draw_info);
 		draw_info->mTextureMatrix = tex_mat;
 		draw_info->mModelMatrix = model_mat;
-		draw_info->mGlowColor.setVec(0,0,0,glow);
 		if (type == LLRenderPass::PASS_ALPHA)
 		{ //for alpha sorting
 			facep->setDrawInfo(draw_info);
@@ -3972,6 +3968,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 
 	U32 cur_total = 0;
 
+	bool emissive = false;
+
 	//get all the faces into a list
 	for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
 	{
@@ -4183,6 +4181,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 				}
 			}
 
+
 			if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0)
 			{
 				facep->clearVertexBuffer();
@@ -4196,6 +4195,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 				const LLTextureEntry* te = facep->getTextureEntry();
 				LLViewerTexture* tex = facep->getTexture();
 
+				if (te->getGlow() >= 1.f/255.f)
+				{
+					emissive = true;
+				}
+
 				if (facep->isState(LLFace::TEXTURE_ANIM))
 				{
 					if (!vobj->mTexAnimMode)
@@ -4312,6 +4316,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 	U32 bump_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
 	U32 fullbright_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
 
+	if (emissive)
+	{ //emissive faces are present, include emissive byte to preserve batching
+		simple_mask = simple_mask | LLVertexBuffer::MAP_EMISSIVE;
+		alpha_mask = alpha_mask | LLVertexBuffer::MAP_EMISSIVE;
+		bump_mask = bump_mask | LLVertexBuffer::MAP_EMISSIVE;
+		fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_EMISSIVE;
+	}
+
 	bool batch_textures = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1;
 
 	if (batch_textures)
@@ -4455,10 +4467,6 @@ struct CompareBatchBreakerModified
 		{
 			return lte->getFullbright() < rte->getFullbright();
 		}
-		else  if (lte->getGlow() != rte->getGlow())
-		{
-			return lte->getGlow() < rte->getGlow();
-		}
 		else
 		{
 			return lhs->getTexture() < rhs->getTexture();
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 7c2eaecf8b1..86208942299 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -138,7 +138,7 @@ const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f;
 const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f;
 const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10;
 const U32 REFLECTION_MAP_RES = 128;
-
+const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1;
 // Max number of occluders to search for. JC
 const S32 MAX_OCCLUDER_COUNT = 2;
 
@@ -457,6 +457,8 @@ void LLPipeline::init()
 		mSpotLightFade[i] = 1.f;
 	}
 
+	mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0);
+	mDeferredVB->allocateBuffer(3, 0, true);
 	setLightingDetail(-1);
 }
 
@@ -535,6 +537,8 @@ void LLPipeline::cleanup()
 	mMovedBridge.clear();
 
 	mInitialized = FALSE;
+
+	mDeferredVB = NULL;
 }
 
 //============================================================================
@@ -6983,6 +6987,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen
 	shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale"));
 	shader.uniform1f("sun_lum_scale", gSavedSettings.getF32("RenderSunLuminanceScale"));
 	shader.uniform1f("sun_lum_offset", gSavedSettings.getF32("RenderSunLuminanceOffset"));
+	shader.uniform3fv("sun_dir", 1, mTransformedSunDir.mV);
 	shader.uniform1f("lum_lod", gSavedSettings.getF32("RenderLuminanceDetail"));
 	shader.uniform1f("gi_range", gSavedSettings.getF32("RenderGIRange"));
 	shader.uniform1f("gi_brightness", gSavedSettings.getF32("RenderGIBrightness"));
@@ -7057,21 +7062,23 @@ void LLPipeline::renderDeferredLighting()
 
 		glh::matrix4f mat = glh_copy_matrix(gGLModelView);
 
-		F32 vert[] = 
-		{
-			-1,1,
-			-1,-3,
-			3,1,
-		};
-		glVertexPointer(2, GL_FLOAT, 0, vert);
-		glColor3f(1,1,1);
+		LLStrider<LLVector3> vert; 
+		mDeferredVB->getVertexStrider(vert);
+		LLStrider<LLVector2> tc0;
+		LLStrider<LLVector2> tc1;
+		mDeferredVB->getTexCoord0Strider(tc0);
+		mDeferredVB->getTexCoord1Strider(tc1);
 
+		vert[0].set(-1,1,0);
+		vert[1].set(-1,-3,0);
+		vert[2].set(3,1,0);
+		
 		{
 			setupHWLights(NULL); //to set mSunDir;
 			LLVector4 dir(mSunDir, 0.f);
 			glh::vec4f tc(dir.mV);
 			mat.mult_matrix_vec(tc);
-			glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], 0);
+			mTransformedSunDir.set(dir.mV);
 		}
 
 		glPushMatrix();
@@ -7335,10 +7342,10 @@ void LLPipeline::renderDeferredLighting()
 				glPushMatrix();
 				glLoadIdentity();
 
-				glVertexPointer(2, GL_FLOAT, 0, vert);
-				
-				glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 				
+				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
+
 				glPopMatrix();
 				glMatrixMode(GL_MODELVIEW);
 				glPopMatrix();
@@ -7347,7 +7354,7 @@ void LLPipeline::renderDeferredLighting()
 			unbindDeferredShader(gDeferredSoftenProgram);
 		}
 
-		{ //render sky
+		{ //render non-deferred geometry (fullbright, alpha, etc)
 			LLGLDisable blend(GL_BLEND);
 			LLGLDisable stencil(GL_STENCIL_TEST);
 			gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -7476,7 +7483,7 @@ void LLPipeline::renderDeferredLighting()
 							
 							LLFastTimer ftm(FTM_LOCAL_LIGHTS);
 							glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-							glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
+							gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
 							glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 								GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 							stop_glerror();
@@ -7542,7 +7549,7 @@ void LLPipeline::renderDeferredLighting()
 					v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111
 
 					glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-					glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
+					gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
 					glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 							GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 				}
@@ -7553,6 +7560,8 @@ void LLPipeline::renderDeferredLighting()
 			{
 				bindDeferredShader(gDeferredMultiLightProgram);
 			
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+
 				LLGLDepthTest depth(GL_FALSE);
 
 				//full screen blit
@@ -7568,7 +7577,7 @@ void LLPipeline::renderDeferredLighting()
 				LLVector4 light[max_count];
 				LLVector4 col[max_count];
 
-				glVertexPointer(2, GL_FLOAT, 0, vert);
+//				glVertexPointer(2, GL_FLOAT, 0, vert);
 
 				F32 far_z = 0.f;
 
@@ -7591,7 +7600,8 @@ void LLPipeline::renderDeferredLighting()
 						gDeferredMultiLightProgram.uniform1f("far_z", far_z);
 						far_z = 0.f;
 						count = 0;
-						glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+						
+						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 					}
 				}
 				
@@ -7623,7 +7633,7 @@ void LLPipeline::renderDeferredLighting()
 					col *= volume->getLightIntensity();
 
 					glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-					glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
+					gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
 					glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
 				}
 
@@ -7660,8 +7670,8 @@ void LLPipeline::renderDeferredLighting()
 
 				LLVertexBuffer::unbind();
 
-				glVertexPointer(2, GL_FLOAT, 0, vert);
-				glColor3f(1,1,1);
+//				glVertexPointer(2, GL_FLOAT, 0, vert);
+				gGL.diffuseColor3f(1,1,1);
 
 				glPushMatrix();
 				glLoadIdentity();
@@ -8297,7 +8307,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 			
-	glColor4f(1,1,1,1);
+	gGL.diffuseColor4f(1,1,1,1);
 	
 	stop_glerror();
 
@@ -8341,7 +8351,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 		gDeferredShadowAlphaMaskProgram.bind();
 		gDeferredShadowAlphaMaskProgram.setAlphaRange(0.6f, 1.f);
 		renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE);
-		glColor4f(1,1,1,1);
+		gGL.diffuseColor4f(1,1,1,1);
 		renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE);
 	}
 
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 28e6526acd9..61ab84588d9 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -536,6 +536,9 @@ class LLPipeline
 	LLRenderTarget			mHighlight;
 	LLRenderTarget			mPhysicsDisplay;
 
+	//utility buffer for rendering post effects, gets abused by renderDeferredLighting
+	LLPointer<LLVertexBuffer> mDeferredVB;
+
 	//sun shadow map
 	LLRenderTarget			mShadow[6];
 	std::vector<LLVector3>	mShadowFrustPoints[4];
@@ -581,6 +584,7 @@ class LLPipeline
 
 	LLColor4				mSunDiffuse;
 	LLVector3				mSunDir;
+	LLVector3				mTransformedSunDir;
 
 	BOOL					mInitialized;
 	BOOL					mVertexShadersEnabled;
-- 
GitLab


From 2ee815478043c4d5845f094f744a055707dba0e0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 10 Aug 2011 13:01:14 -0500
Subject: [PATCH 003/933] SH-2238, SH-2223, SH-SH-2242 glVertexAttrib
 throughout main render pipeline complete, preview renders and debug displays
 still pending.  Also fixed a render glitch and a crash (JIRAs listed).

---
 indra/llrender/llglslshader.cpp               |   2 +
 indra/llrender/llrendersphere.cpp             |  97 +------
 indra/llrender/llrendersphere.h               |   5 -
 indra/llrender/llvertexbuffer.cpp             |  62 ++++-
 indra/llrender/llvertexbuffer.h               |   3 +-
 .../shaders/class1/avatar/objectSkinV.glsl    |   6 +-
 .../deferred/alphaNonIndexedNoColorF.glsl     |  63 +++++
 .../shaders/class1/deferred/avatarAlphaV.glsl |  13 +-
 .../shaders/class1/deferred/avatarF.glsl      |   2 +-
 .../class1/deferred/avatarShadowF.glsl        |   1 -
 .../class1/deferred/avatarShadowV.glsl        |   4 -
 .../shaders/class1/deferred/avatarV.glsl      |   3 -
 .../class1/deferred/diffuseAlphaMaskF.glsl    |   4 +-
 .../deferred/diffuseAlphaMaskNoColorF.glsl    |  30 ++
 .../class1/deferred/diffuseNoColorV.glsl      |  23 ++
 .../shaders/class1/deferred/emissiveF.glsl    |  28 ++
 .../shaders/class1/deferred/emissiveV.glsl    |  38 +++
 .../class1/deferred/multiPointLightV.glsl     |   2 -
 .../class1/deferred/multiSpotLightF.glsl      |  23 +-
 .../shaders/class1/deferred/pointLightF.glsl  |  15 +-
 .../shaders/class1/deferred/pointLightV.glsl  |  10 -
 .../shaders/class1/deferred/softenLightF.glsl |   1 +
 .../shaders/class1/deferred/spotLightF.glsl   |  18 +-
 .../class1/deferred/sunLightSSAOF.glsl        |   1 -
 .../shaders/class1/deferred/sunLightV.glsl    |  10 -
 .../shaders/class1/deferred/treeF.glsl        |  10 +-
 .../shaders/class1/deferred/treeShadowF.glsl  |  27 ++
 .../shaders/class1/deferred/treeShadowV.glsl  |  23 ++
 .../shaders/class1/deferred/treeV.glsl        |   1 -
 .../class1/interface/onetexturenocolorF.glsl  |  13 +
 .../class1/interface/onetexturenocolorV.glsl  |  18 ++
 .../shaders/class1/interface/uiV.glsl         |   2 +-
 .../app_settings/shaders/class1/objects.zip   | Bin 0 -> 6772 bytes
 .../class1/objects/emissiveSkinnedV.glsl      |  33 +++
 .../shaders/class1/objects/emissiveV.glsl     |  29 ++
 .../class1/objects/fullbrightNoColorV.glsl    |  27 ++
 .../class1/objects/simpleNoColorV.glsl        |  30 ++
 .../shaders/class1/objects/treeV.glsl         |  35 +++
 .../deferred/alphaNonIndexedNoColorF.glsl     | 121 ++++++++
 .../class2/deferred/alphaSkinnedV.glsl        |   4 +-
 .../shaders/class2/deferred/avatarAlphaV.glsl |  13 +-
 .../class2/deferred/multiSpotLightF.glsl      |  17 +-
 .../shaders/class2/deferred/softenLightF.glsl |   7 +-
 .../shaders/class2/deferred/softenLightV.glsl |   5 +-
 .../class2/deferred/sunLightSSAOF.glsl        |   6 +-
 .../shaders/class2/deferred/sunLightV.glsl    |   9 -
 .../class2/objects/simpleNonIndexedV.glsl     |  36 +++
 indra/newview/llagent.cpp                     |   4 +-
 indra/newview/llcylinder.cpp                  | 260 ++----------------
 indra/newview/llcylinder.h                    |  33 +--
 indra/newview/lldrawpoolalpha.cpp             |   3 +-
 indra/newview/lldrawpoolavatar.cpp            | 105 +++----
 indra/newview/lldrawpoolavatar.h              |   2 +-
 indra/newview/lldrawpoolsimple.cpp            |   5 +-
 indra/newview/lldrawpooltree.cpp              |   7 +-
 indra/newview/llfloatermodelpreview.cpp       |  20 +-
 indra/newview/llhudeffectbeam.cpp             |   4 +-
 indra/newview/llmaniptranslate.cpp            |   3 +-
 indra/newview/llselectmgr.cpp                 |  55 +++-
 indra/newview/llspatialpartition.cpp          |   2 +-
 indra/newview/lltracker.cpp                   |   8 +-
 indra/newview/llviewerjointmesh.cpp           |   8 +-
 indra/newview/llviewershadermgr.cpp           | 128 ++++++++-
 indra/newview/llviewershadermgr.h             |  19 +-
 indra/newview/llviewerwindow.cpp              |  28 +-
 indra/newview/llvosurfacepatch.cpp            |  14 -
 indra/newview/llwlparamset.cpp                |   8 +-
 indra/newview/pipeline.cpp                    | 126 +++++----
 68 files changed, 1095 insertions(+), 677 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects.zip
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/treeV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index b6cb84d10c3..02bcc9e338b 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -934,7 +934,9 @@ void LLGLSLShader::uniform4fv(const string& uniform, U32 count, const GLfloat* v
 		std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
 		if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
 		{
+			stop_glerror();
 			glUniform4fvARB(location, count, v);
+			stop_glerror();
 			mValue[location] = vec;
 		}
 	}
diff --git a/indra/llrender/llrendersphere.cpp b/indra/llrender/llrendersphere.cpp
index a5cd70445f6..e7e07a1ab22 100644
--- a/indra/llrender/llrendersphere.cpp
+++ b/indra/llrender/llrendersphere.cpp
@@ -35,106 +35,11 @@
 
 #include "llglheaders.h"
 
-GLUquadricObj *gQuadObj2 = NULL;
 LLRenderSphere gSphere;
 
-void drawSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-
-void drawSolidSphere(GLdouble radius, GLint slices, GLint stacks)
-{
-	if (!gQuadObj2)
-	{
-		gQuadObj2 = gluNewQuadric();
-		if (!gQuadObj2)
-		{
-			llwarns << "drawSolidSphere couldn't allocate quadric" << llendl;
-			return;
-		}
-	}
-
-	gluQuadricDrawStyle(gQuadObj2, GLU_FILL);
-	gluQuadricNormals(gQuadObj2, GLU_SMOOTH);
-	// If we ever changed/used the texture or orientation state
-	// of quadObj, we'd need to change it to the defaults here
-	// with gluQuadricTexture and/or gluQuadricOrientation.
-	gluQuadricTexture(gQuadObj2, GL_TRUE);
-	gluSphere(gQuadObj2, radius, slices, stacks);
-}
-
-
-// A couple thoughts on sphere drawing:
-// 1) You need more slices than stacks, but little less than 2:1
-// 2) At low LOD, setting stacks to an odd number avoids a "band" around the equator, making things look smoother
-void LLRenderSphere::prerender()
-{
-	//  Create a series of display lists for different LODs
-	mDList[0] = glGenLists(1);
-	glNewList(mDList[0], GL_COMPILE);
-	drawSolidSphere(1.0, 30, 20);
-	glEndList();
-
-	mDList[1] = glGenLists(1);
-	glNewList(mDList[1], GL_COMPILE);
-	drawSolidSphere(1.0, 20, 15);
-	glEndList();
-
-	mDList[2] = glGenLists(1);
-	glNewList(mDList[2], GL_COMPILE);
-	drawSolidSphere(1.0, 12, 8);
-	glEndList();
-
-	mDList[3] = glGenLists(1);
-	glNewList(mDList[3], GL_COMPILE);
-	drawSolidSphere(1.0, 8, 5);
-	glEndList();
-}
-
-void LLRenderSphere::cleanupGL()
-{
-	for (S32 detail = 0; detail < 4; detail++)
-	{
-		glDeleteLists(mDList[detail], 1);
-		mDList[detail] = 0;
-	}
-	
-	if (gQuadObj2)
-	{
-		gluDeleteQuadric(gQuadObj2);
-		gQuadObj2 = NULL;
-	}
-}
-
-// Constants here are empirically derived from my eyeballs, JNC
-//
-// The toughest adjustment is the cutoff for the lowest LOD
-// Maybe we should have more LODs at the low end?
-void LLRenderSphere::render(F32 pixel_area)
-{
-	S32 level_of_detail;
-
-	if (pixel_area > 10000.f)
-	{
-		level_of_detail = 0;
-	}
-	else if (pixel_area > 800.f)
-	{
-		level_of_detail = 1;
-	}
-	else if (pixel_area > 100.f)
-	{
-		level_of_detail = 2;
-	}
-	else
-	{
-		level_of_detail = 3;
-	}
-	glCallList(mDList[level_of_detail]);
-}
-
-
 void LLRenderSphere::render()
 {
-	glCallList(mDList[0]);
+	renderGGL();
 }
 
 inline LLVector3 polar_to_cart(F32 latitude, F32 longitude)
diff --git a/indra/llrender/llrendersphere.h b/indra/llrender/llrendersphere.h
index 96a6bec80c7..f8e9e86e7f7 100644
--- a/indra/llrender/llrendersphere.h
+++ b/indra/llrender/llrendersphere.h
@@ -40,11 +40,6 @@ void lat2xyz(LLVector3 * result, F32 lat, F32 lon);			// utility routine
 class LLRenderSphere  
 {
 public:
-	LLGLuint	mDList[5];
-
-	void prerender();
-	void cleanupGL();
-	void render(F32 pixel_area);		// of a box of size 1.0 at that position
 	void render();						// render at highest LOD
 	void renderGGL();                   // render using LLRender
 
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index a5977d658d5..5d191688420 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -62,7 +62,6 @@ U32 LLVertexBuffer::sAllocatedBytes = 0;
 BOOL LLVertexBuffer::sMapped = FALSE;
 BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
 BOOL LLVertexBuffer::sPreferStreamDraw = FALSE;
-S32	LLVertexBuffer::sWeight4Loc = -1;
 
 std::vector<U32> LLVertexBuffer::sDeleteList;
 
@@ -355,6 +354,8 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 //static
 void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm)
 {
+	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+
 	U32 count = pos.size();
 	llassert_always(norm.size() >= pos.size());
 	llassert_always(count > 0) ;
@@ -369,6 +370,49 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
 	glDrawArrays(sGLMode[mode], 0, count);
 }
 
+//static
+void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp)
+{
+	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+
+	U32 mask = LLVertexBuffer::MAP_VERTEX;
+	if (tc)
+	{
+		mask = mask | LLVertexBuffer::MAP_TEXCOORD0;
+	}
+
+	unbind();
+	
+	setupClientArrays(mask);
+
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (shader)
+	{
+		S32 loc = shader->getAttribLocation(LLVertexBuffer::TYPE_VERTEX);
+		if (loc > -1)
+		{
+			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 16, pos);
+
+			if (tc)
+			{
+				loc = shader->getAttribLocation(LLVertexBuffer::TYPE_TEXCOORD0);
+				if (loc > -1)
+				{
+					glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, 0, tc);
+				}
+			}
+		}
+	}
+	else
+	{
+		glTexCoordPointer(2, GL_FLOAT, 0, tc);
+		glVertexPointer(3, GL_FLOAT, 16, pos);
+	}
+
+	glDrawElements(sGLMode[mode], num_indices, GL_UNSIGNED_SHORT, indicesp);
+}
+
 void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const
 {
 	if (start >= (U32) mRequestedNumVerts ||
@@ -403,6 +447,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 	validateRange(start, end, count, indices_offset);
 
 	llassert(mRequestedNumVerts >= 0);
+	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
 
 	if (mGLIndices != sGLRenderIndices)
 	{
@@ -431,6 +476,8 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 
 void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 {
+	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+
 	llassert(mRequestedNumIndices >= 0);
 	if (indices_offset >= (U32) mRequestedNumIndices ||
 	    indices_offset + count > (U32) mRequestedNumIndices)
@@ -463,6 +510,8 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 
 void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 {
+	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+
 	llassert(mRequestedNumVerts >= 0);
 	if (first >= (U32) mRequestedNumVerts ||
 	    first + count > (U32) mRequestedNumVerts)
@@ -2037,9 +2086,16 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 		
 	}
 
-	if (data_mask & MAP_WEIGHT4 && sWeight4Loc != -1)
+	if (data_mask & MAP_WEIGHT4)
 	{
-		glVertexAttribPointerARB(sWeight4Loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], (void*)(base+mOffsets[TYPE_WEIGHT4]));
+		if (shader)
+		{
+			S32 loc = shader->getAttribLocation(TYPE_WEIGHT4);
+			if (loc > -1)
+			{
+				glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], (void*)(base+mOffsets[TYPE_WEIGHT4]));
+			}
+		}
 	}
 
 	if (data_mask & MAP_CLOTHWEIGHT)
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 3cccdf62ec1..9497bc93573 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -111,8 +111,6 @@ class LLVertexBuffer : public LLRefCount
 	static LLVBOPool sStreamIBOPool;
 	static LLVBOPool sDynamicIBOPool;
 
-	static S32	sWeight4Loc;
-
 	static BOOL	sUseStreamDraw;
 	static BOOL	sPreferStreamDraw;
 
@@ -120,6 +118,7 @@ class LLVertexBuffer : public LLRefCount
 	static void cleanupClass();
 	static void setupClientArrays(U32 data_mask);
 	static void drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm);
+	static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp);
 
  	static void clientCopy(F64 max_time = 0.005); //copy data from client to GL
 	static void unbind(); //unbind any bound vertex buffer
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 7613e50dca9..35c5a380815 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -7,7 +7,7 @@
 
 
 
-attribute vec4 object_weight;  
+attribute vec4 weight4;  
 
 uniform mat4 matrixPalette[32];
 
@@ -15,8 +15,8 @@ mat4 getObjectSkinnedTransform()
 {
 	int i; 
 	
-	vec4 w = fract(object_weight);
-	vec4 index = floor(object_weight);
+	vec4 w = fract(weight4);
+	vec4 index = floor(weight4);
 	
 	float scale = 1.0/(w.x+w.y+w.z+w.w);
 	w *= scale;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
new file mode 100644
index 00000000000..5d1306bfc92
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -0,0 +1,63 @@
+/** 
+ * @file alphaNonIndexedNoColorF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+
+#extension GL_ARB_texture_rectangle : enable
+
+uniform sampler2DRect depthMap;
+uniform sampler2D diffuseMap;
+
+uniform mat4 shadow_matrix[6];
+uniform vec4 shadow_clip;
+uniform vec2 screen_res;
+
+vec3 atmosLighting(vec3 light);
+vec3 scaleSoftClip(vec3 light);
+
+varying vec3 vary_ambient;
+varying vec3 vary_directional;
+varying vec3 vary_fragcoord;
+varying vec3 vary_position;
+varying vec3 vary_pointlight_col;
+
+uniform mat4 inv_proj;
+
+vec4 getPosition(vec2 pos_screen)
+{
+	float depth = texture2DRect(depthMap, pos_screen.xy).a;
+	vec2 sc = pos_screen.xy*2.0;
+	sc /= screen_res;
+	sc -= vec2(1.0,1.0);
+	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
+	vec4 pos = inv_proj * ndc;
+	pos /= pos.w;
+	pos.w = 1.0;
+	return pos;
+}
+
+void main() 
+{
+	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
+	frag *= screen_res;
+	
+	vec4 pos = vec4(vary_position, 1.0);
+	
+	vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy);
+
+	vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0);
+	vec4 color = diff * col;
+	
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+
+	color.rgb += diff.rgb * vary_pointlight_col.rgb;
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 842931ec172..468d7332a61 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -7,7 +7,6 @@
  
 attribute vec3 position;
 attribute vec3 normal;
-attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
@@ -86,9 +85,7 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-
-	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
+	vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -98,17 +95,17 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*diffuse_color.rgb;
+	vary_pointlight_col = col.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb*diffuse_color.rgb;
-	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
+	vary_ambient = col.rgb;
+	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), 0.0));
 	
-	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
+	col.rgb = min(col.rgb, 1.0);
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index 32686180931..d8e8f6088df 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -13,7 +13,7 @@ varying vec3 vary_normal;
 
 void main() 
 {
-	vec4 diff = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 diff = texture2D(diffuseMap, gl_TexCoord[0].xy);
 	
 	if (diff.a < 0.2)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index 78986ab12ef..c6937250741 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -13,7 +13,6 @@ varying vec4 post_pos;
 
 void main() 
 {
-	//gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a);
 	gl_FragColor = vec4(1,1,1,1);
 
 	gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index cf6fc1c0ed4..35d0bb56033 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -11,10 +11,8 @@ mat4 getSkinnedTransform();
 
 attribute vec3 position;
 attribute vec3 normal;
-attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
 
-
 varying vec4 post_pos;
 
 void main()
@@ -40,8 +38,6 @@ void main()
 	post_pos = pos;
 
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
-	
-	gl_FrontColor = diffuse_color;
 }
 
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index e66f8c84836..9ef11109edf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -6,7 +6,6 @@
  */
  
 attribute vec3 position;
-attribute vec4 diffuse_color;
 attribute vec3 normal;
 attribute vec2 texcoord0;
 
@@ -38,8 +37,6 @@ void main()
 	vary_normal = norm;
 	
 	gl_Position = gl_ProjectionMatrix * pos;
-		
-	gl_FrontColor = diffuse_color;
 }
 
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index 338d0ebb2b6..26355731ae0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -1,5 +1,5 @@
 /** 
- * @file diffuseF.glsl
+ * @file diffuseAlphaMaskF.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  * $/LicenseInfo$
@@ -15,7 +15,7 @@ varying vec3 vary_normal;
 
 void main() 
 {
-	vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
+	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
 	
 	if (col.a < minimum_alpha || col.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
new file mode 100644
index 00000000000..dfc1b52c2e7
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -0,0 +1,30 @@
+/** 
+ * @file diffuseAlphaMaskNoColorF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+uniform sampler2D diffuseMap;
+
+varying vec3 vary_normal;
+
+void main() 
+{
+	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	
+	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	gl_FragData[0] = vec4(col.rgb, 0.0);
+	gl_FragData[1] = vec4(0,0,0,0); // spec
+	vec3 nvn = normalize(vary_normal);
+	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
new file mode 100644
index 00000000000..ff9578e2533
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -0,0 +1,23 @@
+/** 
+ * @file diffuseNoColorV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
+varying vec3 vary_normal;
+varying float vary_texture_index;
+
+void main()
+{
+	//transform vertex
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	
+	vary_normal = normalize(gl_NormalMatrix * normal);
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
new file mode 100644
index 00000000000..5a9a6196f38
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -0,0 +1,28 @@
+/** 
+ * @file emissiveF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+
+#extension GL_ARB_texture_rectangle : enable
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
+
+void main() 
+{
+	float shadow = 1.0;
+
+	vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
+	
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
new file mode 100644
index 00000000000..9841943fe69
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -0,0 +1,38 @@
+/** 
+ * @file emissiveV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+attribute vec4 position;
+attribute float emissive;
+attribute vec2 texcoord0;
+
+void calcAtmospherics(vec3 inPositionEye);
+
+vec3 atmosAmbient(vec3 light);
+vec3 atmosAffectDirectionalLight(float lightIntensity);
+vec3 scaleDownLight(vec3 light);
+vec3 scaleUpLight(vec3 light);
+
+varying float vary_texture_index;
+
+void main()
+{
+	//transform vertex
+	vec4 vert = vec4(position.xyz, 1.0);
+	vec4 pos = (gl_ModelViewMatrix * vert);
+	vary_texture_index = position.w;
+
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	
+	calcAtmospherics(pos.xyz);
+	
+	gl_FrontColor = vec4(0,0,0,emissive);
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 7db577c07ab..bb0497b3098 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -7,7 +7,6 @@
 
 
 attribute vec3 position;
-attribute vec4 diffuse_color;
 
 varying vec4 vary_fragcoord;
 
@@ -18,5 +17,4 @@ void main()
 	vary_fragcoord = pos;
 
 	gl_Position = pos;
-	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 0d25d7792da..6c08f7b51f6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -37,7 +37,10 @@ uniform float sun_wash;
 uniform int proj_shadow_idx;
 uniform float shadow_fade;
 
-varying vec4 vary_light;
+uniform vec3 center;
+uniform vec3 color;
+uniform float falloff;
+uniform float size;
 
 varying vec4 vary_fragcoord;
 uniform vec2 screen_res;
@@ -92,7 +95,7 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
 
 vec4 getPosition(vec2 pos_screen)
 {
-	float depth = texture2DRect(depthMap, pos_screen.xy).a;
+	float depth = texture2DRect(depthMap, pos_screen.xy).r;
 	vec2 sc = pos_screen.xy*2.0;
 	sc /= screen_res;
 	sc -= vec2(1.0,1.0);
@@ -111,9 +114,9 @@ void main()
 	frag.xy *= screen_res;
 	
 	vec3 pos = getPosition(frag.xy).xyz;
-	vec3 lv = vary_light.xyz-pos.xyz;
+	vec3 lv = center.xyz-pos.xyz;
 	float dist2 = dot(lv,lv);
-	dist2 /= vary_light.w;
+	dist2 /= size;
 	if (dist2 > 1.0)
 	{
 		discard;
@@ -127,16 +130,16 @@ void main()
 	vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0));
 	if (proj_tc.z < 0.0)
 	{
-		discard;
+		//discard;
 	}
 	
 	proj_tc.xyz /= proj_tc.w;
 	
-	float fa = gl_Color.a+1.0;
+	float fa = falloff+1.0;
 	float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
 	if (dist_atten <= 0.0)
 	{
-		discard;
+		//discard;
 	}
 	
 	lv = proj_origin-pos.xyz;
@@ -164,7 +167,7 @@ void main()
 			
 			vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
 		
-			vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+			vec3 lcol = color.rgb * plcol.rgb * plcol.a;
 			
 			lit = da * dist_atten * noise;
 			
@@ -181,7 +184,7 @@ void main()
 			
 		amb_da = min(amb_da, 1.0-lit);
 			
-		col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+		col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
 	}
 	
 	
@@ -214,7 +217,7 @@ void main()
 					stc.y > 0.0)
 				{
 					vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-					col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb;
+					col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb;
 				}
 			}
 		}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 5efa3200d4a..601bb17bc73 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -20,7 +20,10 @@ uniform sampler2DRect depthMap;
 uniform vec3 env_mat[3];
 uniform float sun_wash;
 
-varying vec4 vary_light;
+uniform vec3 center;
+uniform vec3 color;
+uniform float falloff;
+uniform float size;
 
 varying vec4 vary_fragcoord;
 uniform vec2 screen_res;
@@ -49,9 +52,9 @@ void main()
 	frag.xy *= screen_res;
 	
 	vec3 pos = getPosition(frag.xy).xyz;
-	vec3 lv = vary_light.xyz-pos;
+	vec3 lv = center.xyz-pos;
 	float dist2 = dot(lv,lv);
-	dist2 /= vary_light.w;
+	dist2 /= size;
 	if (dist2 > 1.0)
 	{
 		discard;
@@ -72,11 +75,11 @@ void main()
 	float noise = texture2D(noiseMap, frag.xy/128.0).b;
 	
 	vec3 col = texture2DRect(diffuseRect, frag.xy).rgb;
-	float fa = gl_Color.a+1.0;
+	float fa = falloff+1.0;
 	float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 	float lit = da * dist_atten * noise;
 	
-	col = gl_Color.rgb*lit*col;
+	col = color.rgb*lit*col;
 
 	vec4 spec = texture2DRect(specularRect, frag.xy);
 	if (spec.a > 0.0)
@@ -86,7 +89,7 @@ void main()
 		{
 			sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
 			sa *= noise;
-			col += da*sa*gl_Color.rgb*spec.rgb;
+			col += da*sa*color.rgb*spec.rgb;
 		}
 	}
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index ac3170d16d5..a09cfa26619 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -6,10 +6,7 @@
  */
 
 attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
 
-varying vec4 vary_light;
 varying vec4 vary_fragcoord;
 
 void main()
@@ -18,12 +15,5 @@ void main()
 	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	vary_fragcoord = pos;
 		
-	vec4 tex = vec4(texcoord0,0,1);
-	tex.w = 1.0;
-	
-	vary_light = vec4(texcoord0,0,1);
-	
 	gl_Position = pos;
-		
-	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 3ba5ee5bd22..35ab77d3cc7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -306,5 +306,6 @@ void main()
 	}
 
 	gl_FragColor.rgb = col;
+
 	gl_FragColor.a = bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 9aaffc15bf3..ed67dc32d52 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -13,7 +13,6 @@ uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
-uniform samplerCube environmentMap;
 uniform sampler2D noiseMap;
 uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
@@ -32,7 +31,10 @@ uniform float far_clip;
 uniform vec3 proj_origin; //origin of projection to be used for angular attenuation
 uniform float sun_wash;
 
-varying vec4 vary_light;
+uniform vec3 center;
+uniform vec3 color;
+uniform float falloff;
+uniform float size;
 
 varying vec4 vary_fragcoord;
 uniform vec2 screen_res;
@@ -60,9 +62,9 @@ void main()
 	frag.xy *= screen_res;
 	
 	vec3 pos = getPosition(frag.xy).xyz;
-	vec3 lv = vary_light.xyz-pos.xyz;
+	vec3 lv = center.xyz-pos.xyz;
 	float dist2 = dot(lv,lv);
-	dist2 /= vary_light.w;
+	dist2 /= size;
 	if (dist2 > 1.0)
 	{
 		discard;
@@ -82,7 +84,7 @@ void main()
 	
 	proj_tc.xyz /= proj_tc.w;
 	
-	float fa = gl_Color.a+1.0;
+	float fa = falloff+1.0;
 	float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 	
 	lv = proj_origin-pos.xyz;
@@ -108,7 +110,7 @@ void main()
 			
 			vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod);
 		
-			vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+			vec3 lcol = color.rgb * plcol.rgb * plcol.a;
 			
 			lit = da * dist_atten * noise;
 			
@@ -127,7 +129,7 @@ void main()
 		
 		amb_da = min(amb_da, 1.0-lit);
 		
-		col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+		col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
 	}
 	
 	
@@ -156,7 +158,7 @@ void main()
 					stc.y > 0.0)
 				{
 					vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-					col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb;
+					col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb;
 				}
 			}
 		}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 665d8126a07..6bbf86177ae 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -25,7 +25,6 @@ uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
 varying vec2 vary_fragcoord;
-varying vec4 vary_light;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
index 65fa288e88e..d39bfef4aed 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -6,11 +6,7 @@
  */
  
 attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
 
-varying vec4 vary_light;
 varying vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
@@ -22,10 +18,4 @@ void main()
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = vec4(texcoord0,0,1);
-	tex.w = 1.0;
-	
-	vary_light = vec4(texcoord0,0,1);
-		
-	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index de7e0384022..08a3bc251a3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -11,10 +11,18 @@ uniform sampler2D diffuseMap;
 
 varying vec3 vary_normal;
 
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
 void main() 
 {
 	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
-	gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005);
+	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, 0.0);
 	gl_FragData[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
new file mode 100644
index 00000000000..9f0b902c96f
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -0,0 +1,27 @@
+/** 
+ * @file treeShadowF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+uniform sampler2D diffuseMap;
+
+varying vec4 post_pos;
+
+void main() 
+{
+	float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a;
+
+	if (alpha < minimum_alpha || alpha > maximum_alpha)
+	{
+		discard;
+	}
+
+	gl_FragColor = vec4(1,1,1,1);
+	
+	gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
new file mode 100644
index 00000000000..42ce2f52267
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
@@ -0,0 +1,23 @@
+/** 
+ * @file treeShadowV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+attribute vec3 position;
+attribute vec2 texcoord0;
+
+varying vec4 post_pos;
+
+void main()
+{
+	//transform vertex
+	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	
+	post_pos = pos;
+	
+	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
+	
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index 07e56e84db3..f56f3893480 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -10,7 +10,6 @@ attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
 
-
 varying vec3 vary_normal;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
new file mode 100644
index 00000000000..a5442c9bf42
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -0,0 +1,13 @@
+/** 
+ * @file onetexturenocolorF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+uniform sampler2D tex0;
+
+void main() 
+{
+	gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy);
+}
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
new file mode 100644
index 00000000000..7df45e90e60
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
@@ -0,0 +1,18 @@
+/** 
+ * @file onetexturenocolorV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+attribute vec3 position;
+attribute vec2 texcoord0;
+
+
+void main()
+{
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
index ebf2361da46..9d129caf21a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -14,7 +14,7 @@ attribute vec2 texcoord0;
 void main()
 {
 	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_TexCoord[0] =  gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_FrontColor = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects.zip b/indra/newview/app_settings/shaders/class1/objects.zip
new file mode 100644
index 0000000000000000000000000000000000000000..7e436607317a21f68029c4afd49079c1d9580c71
GIT binary patch
literal 6772
zcmaJ`2RzjO|Cc?Y%U)UGkR6dN7iZ5BIjfB0PWH$QXD2QrWRL8uD3wjwBQlPxtgJ7x
z()fSW_xnFdzq`lV=RS|e`~7^p=JWk}z38ap;gjMVepI~n<bMA6_YX1fyklu+b<5R7
zNC((O4ZIWo+~vUd!+HRC(>#TPLwRJEr5n;wS<nXIf^h5VR%=$ECYW+t*B`$c%Q@Dr
zp@XlaV9QG^I1&DK<O2zwM3V5n$W<SYiwOy|W2=`Jq~T~b^T6IV(P=|7aeH0oPJP;$
z{h|q-i2-%w_`~wLRreg<Sk-;c=7U0de&2@+71R6js@fV*J%vSk`^QhqhORY#tfX-l
zbAJs^GFvyG5SDz|s)mt@IO}I_J+dTtnv*sZRvkfc$K%H40@Ho<g|9m>zc42{vea}*
zxAp>;C(#tv`gJ?CCQ|NxS$N2`AaqSErSn;eSrqjdCyM%ih<>-grGh;CcYx*wCs^S6
zPYWQs8UYJ{2&Y_jd3SUmyHnhz`05Hg#DORlPP((<-JDSx?j0-K$}Juqm62?@HAz3x
z?-Yv|!?V|=Is4XU9gClOZ&FusnaWR}dK{`Uya5ZHX{Hm?o1ku8C73Hr2FWSr%MVDM
zJ?P~Rzh+zzUOuE0w6>|{TNM9Hk#RvfK~bCSl=ZVuOUPapyoz`6(U|C)8B%_eWd02n
zyzZKy$C~`hIhVp^n_pQa?Bsgh7bUWwemksgH&7po`+b5ITqUF4=~C78S#bm<K&74l
zAJ1pqCc~OQ*<etP<pMf95HP_rV9_550&6z}!qORTW9#~FDBLe6ZBhV1>~}9z6QfP0
z378Z~Zjc22VAI|0L2Yw*h;X3&wFOmUxx1;i=0%Ko@eMr1_=D%qJ8vP<x8b+ApxPW7
zf<9on#TAWb5-UpIvIpoeGLt1%kgLs~xrBBE+A|iDsF=u!aWq>WjCNkLtf+*$Kbk7K
zooG$$e?wr!coFA!xdYlWzJ~+ywgKzhiE``P!X3PR3GaKd@TshztTh<z`^fQDDCh^Q
zHwPN;@W`wAof>;a(`yTMG40q$o0~NY$uR#LMkJdl=VKr5sR{P=Ct2H%gjPT4pj(!i
z<hObh5xsQPbVUjM<Epk?d4B*-pSVv-eg_Da+tSsOH|hXcqj@Q&<k@VQ@V$W!tHX=9
zZ*l?P>zuJb=*{Ee;Bfw32Yq|EgM-!WUjgZh#vBG@$kUW3k0MPuMM^esOv5s$$pXO!
zq#PVh7d2HRURrtF#6+yGt>kSew3;A9FHXvDtvgh|qvn84dumWNYC#3=6r`!W^5x1c
zW8S_1=b~a^TwEH^5qAPb;=6Bs%@{t{6{R@0RxUhox<@rWe~M7xjU~D<iPBeSHSM8-
zRe5KldrPm0K1o*0Ov})i7T6X#;u&pu1`4xRkFJt}Svu1Xp)jGO6GK~Mq&1h^ZAh)&
zj17uVY1Y)T(SZBC2T4dxrxyKTq5UCfZMs^>We%U0JdZO8yyq#;Hx3xw%(LvtiHh!%
zG~xW#>fEZJu%qatZC%%4vcY?%@%mdc=Nr)UJzaau7s=7$f{aX>He|&c)2|rJdhsd)
z^Tp1hkN4Z`*@8@qHdF>Jh&-Ot+afzczsBx!Pg@hF2pk|7qb<45Jwy2I-K^b8jH@h=
zM?I3gE&WaA^!W3MI}4d}eYSIi#&+*qPp8WWP-Dz8cwtQ49*eWqru6d%R#Q)&Wo4Fz
z<mCtI(th#sNn`B?V_kZfPDB010qTHDuL3UpA7S|~x#&!&H49VMIizvWDb<P&YY{Z+
z>4e}lhG(oOL+m`p&b>v)=2WKct)=DI>uzw%PfqTmB_rq`?74;GdK!^!l$MW;JR$FJ
z7cU7u3z2SJWFd<oT)SORsy5hG9kaZ`uPUewQL*w4KGT;q79LyEA}>P`&R`R@N>l0;
z8#&YF5I>4kxMk5KOTEB6mn~|m+m4}a<GuB)MQ=#}yc2k#Fho?A8{rZ+{m8e1ExM#9
z_cG}-R0u)5=W@1ZTc;vO&#nPCy+%Lec}$M_Gs5z$oz8JPM85RB3#@aW>rz}dk|v$+
z5joZo`7>zXi9QmG`<Qu6!9s~q5;@i!oL);!xu4eC*A+joocJ-m>YTYfIgCFOwpl?-
z>y1QzukQI?Ny+#kG(^l_G=<x5YVyIl`Zki*SXJ8a%93C|tGCuQvQ$Gq&hj2F=qTL*
z;qP7u!Bm(f0|_+-ERMe?mZ62KmGdu#xPM=SEKr9UwXpW|c{7uNMs98<7bviyAjFo^
z+jP5WnQ<M?-tXT_M}8l<;8@q3sC*Vz`8jd~bSYbet`jN2ES<1qKz`dp)&6l3!-KhR
z$S*7Oiy%XzYSTiWs)XB;`c~JX2-GzLiJV=AVNu@w;q`@q;^F7T6RANsYqG=g9RprA
za35=UXJ`%4^gNmAg#<Q;XVc7sUa}8Z&8h&(Fw;<e<N?IjV<5g*PuA==w$Rm72iQW^
z!@rgJF4R&!i&lnOk%Tt*dSpUi7_>GiuP9}rVsx--#^1wT$$;mP654CMJEf+wnFp8f
ztVsz9a>G!sH0rIy&IXJJHR>GGsfTWWQ@)<?ro?4wGGaFS{8H8GG~YpR!P1U7pFs#I
zOIc3xox6@jdkxRrp9E&}m8-YL^jE&)z)Mr}Lz2N9By918g3fKafb2@uEl}4byidO=
zhOQDjSM3%_d_<O^RIj~wpGOSse@;`Nqxe?N$VReCfLvOP*8Y9_+%oPm#Qve|8zDy$
za`Ov8m4l4B(qhhw#pvr*W1d}7#k1%8BFDay45%?}CH3eC68MSjeAJ{?{mM{N%Xv)!
z3K_`lrKkAx?H<0VDDKs?oc+vjrx>cn@HgxE8o7Ai9ZO1znr~_Cvp6+m5FEs{`oesY
zeO<xzRc13SwpLUE&)`k_W_H`Ry`9L#C6a09K3NmQN+)hDH!iX5Y%!{*YHK7P`077l
zf)><|NML<-$O)-nt^*>#XUV`i`HKBT2UZUh51obT9W^Tt<$zOY>L`{`$5|?tO)1_z
z8~aFW;NFtfqluOrz*!O^9G|OSt^2N|h^fYDeTIeO*CN8?@QZ>l0(=!8RRb!){0%oe
z#keLDc;0Wvbbb=;bP%+K6wyvo1s5h;2cf^aTtV}d#Mv?I*1j!x?x9k>eF~q9sYb^H
zF4l|aXHN-bneUuj6H%e+9ZHNC7*usYv^x(9gav6`rFpH5HeK3$3i6h3pj&+3RpH<L
zL53A?m>A&#9zltbELF3I>Pu`DMtse&hgEJHGc&#-8r!E*aT#=Pjt~}?l5Q`GER`qk
zGn8m*D@nT1cCOjQ(gex*G^AISd>&p<H+1HA<N3=M;D!N#{`Y(SNEZ77S==NHLfNbv
zj_c%fn@2=uP(Q|RoG6F9ZV9>=&siO|H!1$9uYHbu-S>g^1ylg(a006D1BBw<#N}1Z
ztg@ub;hSj}byxPFas%%%4)Dt@u3)NUFPKo?W@>U8JcDhGuXQ0yC4Jmh0cTNK?!H0E
z$J^^;?CPC%+e(5VzDDda=9`IrO~*>C@&Nt;UqFRCU{M{(Sr=@9V%7cnu)4yZ8uN`1
z2;?;MY*g04y&gCv4efi~*;E_*5=1idGNqm)W+#QAjWH;Ius0ede7$(WYJp4bK@eEN
zFGjhxu;@Xw5<-eksl0cq`FdWyZIT>yOFb6@*u9*g1s7N0=9Y`pbFza%i*2}j^0#Xh
zc??Z-mzF!ue8(F6kYUWp`njrrNY%i@!C^Zttv(#-h_L#-Akov*o)rekO4K)nvOGpG
zHVF=}^r^j!aL<kJ2*tT}g*bCc19R$4DT2-z^dq$#re6o4s9xw!S&-;ip(g0O(dehG
zi(Bbpu&lpAN2zs3mv@nSNW)n5w6@)6OQho^kEqDUzE79avn?vc2;-zf-=9{$q&#%b
z5^T;(yM_K{n6;VPEJCV78$!Ku`}4%Tky}~umMa9h-IDC`BUdnJ)Wd<iC$}=-1>N&L
z6UMexUAvXi_hCAFvv-knF2Xzr14XxD0ja@H>x^MzH4YED8_vNd0~}M{_h=NY#5qj2
zgxUE<Ml6ipx<pJ<Rc2;3OdiH)wE0QFgAGi)OH^|4c~&X!)wn_Wa!GaqU9dTG@uuA~
zKVrtZXMG}0rUP*sG2rq$r{r_W;#oZ7)hpzB<mV0Y8;Pb!m}BYcy$^!!%i`(J4Dc1`
z*0IMS;_SXsk-u$ZC}u3t^w2e<l*e^|vsJJ3bI7#nNokDV{efIsv&jvn{Z1q4#p6*V
zWwQ5uo%<I1i*w{?Z&}rw2kpK~PwlJqTbB8Hvy1$dFAQ_i)KjsD!h^F$Z)L*?eVD%~
zS6Y~4W1g%qU_E}wPso|ODpG*QiGVxhkNEtLn#|OJN~JYDMLRZ>9hPMO4KFY|<1|qq
z73*yw4!v5;+LeT;6ht*u{YweBA%WT0$8i_GT~19(-rF4Od<JZ*gl;dB-*@oQzLvY&
zL|KJWfhA!`+iPh_JA^7%<~7{1zXtq6lJhB*5e5AMo{cwvvbQu&87H9l)+gSNOb`;Q
zGqGm8Lg$-BT@6*1uM$opDIdPUFs7Dfs;+b+J8e4{c~6QZQs``MLG~5Q2Pg&O*`ZIf
z!RQyogi2k5P{_TSiwQO&HxsSN?OIn8QRflQr6Y?1Hoy02di${Wp_<O`jk`QQovFAn
zl<lwm(f3`RtULM0OSbHZaUP|vId93$GBc=7d5;-Et~3g~IW9p@|Fo~`e&+Vgot}9u
zNAJK=s-kdzyRNwQR<Q#Z@)H4#TbOfC^Mi{U0xiebOiDt%Cm2Yo8ekp03Vu?-5h8Q@
zMP$l<5E=gK93mS&Ra@Q}|KS@%bi)9TJ&C`ffb#CVLNC4ZZj_TWH2xva9khkh4B0+Z
z<<3FL9OxZ{TWq=Z1HYAWcY~N7$Rlwkdyy3^#0bI(Nqg#&OXCi+TpttJ?XcU;m1wRj
z2C<awdH5VBF}Yeag&!bw0k9572>*=~Tz)dbuObQ=39y(jD8Oc&*MVoiTDbM94yo25
ziIpXKI%=v@Uf`&E`OQem^_yRn9&!FZ2qWV25~+Pw3!EJaDzOuLigE)(m>t{8EuYz`
z3Vn@Oszr+mZSLxWhE*>K+}((R;9Z$?zAtXHg?6QL?``=o*Ggjjj(*4M-an{r<Ih3z
z*r2`#(AZWhc%%>rY6gJDnEsIW7=r=bgfPgj+7HFDY3^Mxi$uxBHHH{j#2~CL+!JZj
znJaQh;U`dCLPvk!{m_0*pJ(t)_1Zz*!J6yBRhT-v{r)r~`P+cm_YJ%CwgR7*t%Vyw
z?LG_DL=T#|JM;`UH8FM4Np8~Xjcu$MUlD?dw%%o%O!yJo)`IdkCmcT^!Wj_(3<P9~
zz2uAf1@Zmrmmtz{!LQ<P(#?ye7H^$D_ppm$fwjkwPhmmBjoX2Fr+xYsGi=16A)DeM
z*%%p}a8_kHg~EVttNvw$uXneJTz#I8<r-cx(T_({Kg8tsCB*LuMYM8QCx7}v?5%rx
zewS-Sdco&M<u|U$PLeR`GZ$!N*BD9|V5=G}#mHU=d&D5_Yo1k<a)qm?*$b8~#_7r1
z+8-dXoZ1lvT<qei!v${&M_C;n67}-kj}dzyCUUwQTBo*0M;dQ2MUsfTT$<)`X>Lj&
zjzK2Vbgy$&f7M3%@<5iPU|ez9ntaiGfr6A%=!Da*6~@3Mu+L>3u~I?iPok}1`qg!v
zY~8kxS^IqPL+vl^rV;`vn(hvgyLQm!EXZ20pf7ms6xPLuyj9Crl&A){SOeg#KST0g
z;`+D6GCgdu#zfy|1y0fPwB9QVr>kH(8$JQ|VAE7XcRS3y^hTFXG!#Ad@o(QB;GB*E
zf6auDj9X4XZ)gJza%LL6P&tm(v{C$*I>@bwQ^84QHlq{qEBX5@(@astjF%}AJ~z$A
z#yPc(uteN6B{t$OACoe;26;<<rz-UyVP2#iV~~bAQfn)*EXJOpcf@p-n^UIN7-LOF
zNQTMHxI099&TiWk2kky)oDpHU)2s~t6s1$01Lhf$v>nYyr@s#G^}0;VvFW`@K4xNH
z>D4P2wvJPCv5d0Ee7V0RyC~Il#QtJMMeL6nvnWKY;Uf84@%X{Z(io|)928$Hd`0(^
zpfZ6Tb-|tHOrZMdMKh|;GgY$8cwVKkqCz*<uRScilb)20iLQYA82ejPIeVo~X?KtZ
zm(nU5SeRw`d~j;>8)g07_IDW^%MZsduYkqyM|vG)vhJTH8Nt-(0gVJTT>8-r2M+;Q
z(b0py(R8L!TtF3ZcB9^YurYV};KOV|1*Cy;Hv}c@C_$X+#`$yXl9w|YF7y%iT<TIy
zh;Nw3K%J@KkTtJap-Nu(s}aSDUdT73UKY+N^OYB^2~l;bh~QQ6ipuUdmMzQOEv?E<
zvS1?q`66vkAa+jSQsex6MhYkad_cb*|4(nfPW^pm`fEEI@Zbj4f24?=pdLSeeBy{b
z&jUpA(euCJ_vrb<m_I(Q!=AqYWWj&uj}PyTqZ}WeVNqsJL^(1_I|_Bu3=0eO1Yq7j
z1^Nl~8~q+dJXG=c2nCCHm*B66CtK_I8~_W2L-bduBf)!Aw3E7TEZ*43ct?BjqhN=6
z9&Zb=V9_Ke33sxJ$NM8JN+%HOf7<^q+8qjXyidVGMU!Enj&v<YH9DzvzyipeJ_c|?
zBXJb%P@LmsDHctT;uzY=ra4}0VF8lP90T|tRykhyU{Uk|viQ%yN6Vn2ikwu6U=i@n
z9!L0}nQ{EW!vf6%|G)WNl#@+zoVKwDmH@~7j_{jJ2nY|iQUPBXAPG5W4&VL{k;J(S

literal 0
HcmV?d00001

diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
new file mode 100644
index 00000000000..78668711ac2
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -0,0 +1,33 @@
+/** 
+ * @file emissiveSkinnedV.glsl
+ *
+ * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
+ * $License$
+ */
+
+
+attribute vec3 position;
+attribute float emissive;
+attribute vec2 texcoord0;
+
+void calcAtmospherics(vec3 inPositionEye);
+mat4 getObjectSkinnedTransform();
+
+void main()
+{
+	//transform vertex
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	
+	mat4 mat = getObjectSkinnedTransform();
+	
+	mat = gl_ModelViewMatrix * mat;
+	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
+	
+	calcAtmospherics(pos.xyz);
+
+	gl_FrontColor = vec4(0,0,0,emissive);
+	
+	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+		
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
new file mode 100644
index 00000000000..05d7cc397fd
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -0,0 +1,29 @@
+/**
+ * @file emissiveV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+attribute vec4 position;
+attribute float emissive;
+attribute vec2 texcoord0;
+
+void calcAtmospherics(vec3 inPositionEye);
+
+varying float vary_texture_index;
+
+void main()
+{
+	//transform vertex
+	vary_texture_index = position.w;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	calcAtmospherics(pos.xyz);
+
+	gl_FrontColor = vec4(0,0,0,emissive);
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
new file mode 100644
index 00000000000..57d98038e09
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
@@ -0,0 +1,27 @@
+/**
+ * @file fullbrightNoColorV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+  
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+
+void calcAtmospherics(vec3 inPositionEye);
+
+void main()
+{
+	//transform vertex
+	vec4 vert = vec4(position.xyz,1.0);
+	vec4 pos = (gl_ModelViewMatrix * vert);
+	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+
+	calcAtmospherics(pos.xyz);
+
+	gl_FrontColor = vec4(1,1,1,1);
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
new file mode 100644
index 00000000000..54c262885e5
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -0,0 +1,30 @@
+/** 
+ * @file simpleNoColorV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
+void main()
+{
+	//transform vertex
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+		
+	vec3 norm = normalize(gl_NormalMatrix * normal);
+
+	calcAtmospherics(pos.xyz);
+
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
+	gl_FrontColor = color;
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
new file mode 100644
index 00000000000..1e9e7f4b0b3
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
@@ -0,0 +1,35 @@
+/** 
+ * @file treeV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
+void main()
+{
+	//transform vertex
+	vec4 vert = vec4(position.xyz,1.0);
+	
+	gl_Position = gl_ModelViewProjectionMatrix*vert;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	
+	vec4 pos = (gl_ModelViewMatrix * vert);
+	
+	vec3 norm = normalize(gl_NormalMatrix * normal);
+
+	calcAtmospherics(pos.xyz);
+
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
+	gl_FrontColor = color;
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
new file mode 100644
index 00000000000..294a000ab5d
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -0,0 +1,121 @@
+/** 
+ * @file alphaNonIndexedNoColorF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+
+#extension GL_ARB_texture_rectangle : enable
+
+uniform sampler2DRectShadow shadowMap0;
+uniform sampler2DRectShadow shadowMap1;
+uniform sampler2DRectShadow shadowMap2;
+uniform sampler2DRectShadow shadowMap3;
+uniform sampler2DRect depthMap;
+uniform sampler2D diffuseMap;
+
+uniform mat4 shadow_matrix[6];
+uniform vec4 shadow_clip;
+uniform vec2 screen_res;
+uniform vec2 shadow_res;
+
+vec3 atmosLighting(vec3 light);
+vec3 scaleSoftClip(vec3 light);
+
+varying vec3 vary_ambient;
+varying vec3 vary_directional;
+varying vec3 vary_fragcoord;
+varying vec3 vary_position;
+varying vec3 vary_pointlight_col;
+
+uniform float shadow_bias;
+
+uniform mat4 inv_proj;
+
+vec4 getPosition(vec2 pos_screen)
+{
+	float depth = texture2DRect(depthMap, pos_screen.xy).a;
+	vec2 sc = pos_screen.xy*2.0;
+	sc /= screen_res;
+	sc -= vec2(1.0,1.0);
+	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
+	vec4 pos = inv_proj * ndc;
+	pos.xyz /= pos.w;
+	pos.w = 1.0;
+	return pos;
+}
+
+float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl)
+{
+	stc.xyz /= stc.w;
+	stc.z += shadow_bias;
+	
+	float cs = shadow2DRect(shadowMap, stc.xyz).x;
+	float shadow = cs;
+
+	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, scl, 0.0)).x, cs);
+	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, -scl, 0.0)).x, cs);
+	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, scl, 0.0)).x, cs);
+	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, -scl, 0.0)).x, cs);
+			
+	return shadow/5.0;
+}
+
+
+void main() 
+{
+	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
+	frag *= screen_res;
+	
+	float shadow = 1.0;
+	vec4 pos = vec4(vary_position, 1.0);
+	
+	vec4 spos = pos;
+		
+	if (spos.z > -shadow_clip.w)
+	{	
+		vec4 lpos;
+		
+		if (spos.z < -shadow_clip.z)
+		{
+			lpos = shadow_matrix[3]*spos;
+			lpos.xy *= shadow_res;
+			shadow = pcfShadow(shadowMap3, lpos, 1.5);
+			shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
+		}
+		else if (spos.z < -shadow_clip.y)
+		{
+			lpos = shadow_matrix[2]*spos;
+			lpos.xy *= shadow_res;
+			shadow = pcfShadow(shadowMap2, lpos, 1.5);
+		}
+		else if (spos.z < -shadow_clip.x)
+		{
+			lpos = shadow_matrix[1]*spos;
+			lpos.xy *= shadow_res;
+			shadow = pcfShadow(shadowMap1, lpos, 1.5);
+		}
+		else
+		{
+			lpos = shadow_matrix[0]*spos;
+			lpos.xy *= shadow_res;
+			shadow = pcfShadow(shadowMap0, lpos, 1.5);
+		}
+	}
+	
+	vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy);
+
+	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0);
+	vec4 color = diff * col;
+	
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+
+	color.rgb += diff.rgb * vary_pointlight_col.rgb;
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index 97fe7029e1e..a446239a225 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -68,11 +68,11 @@ void main()
 	
 	mat = gl_ModelViewMatrix * mat;
 	
-	vec3 pos = (mat*position).xyz;
+	vec3 pos = (mat*vec4(position, 1.0)).xyz;
 	
 	gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0);
 	
-	vec4 n = position;
+	vec4 n = vec4(position, 1.0);
 	n.xyz += normal.xyz;
 	n.xyz = (mat*n).xyz;
 	n.xyz = normalize(n.xyz-pos.xyz);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 65c3e5da104..8102578bb22 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -8,7 +8,6 @@
 
 attribute vec3 position;
 attribute vec3 normal;
-attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
@@ -89,9 +88,7 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-
-	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
+	vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
 
 	// Collect normal lights
 	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -101,17 +98,17 @@ void main()
 	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
 	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
-	vary_pointlight_col = col.rgb*diffuse_color.rgb;
+	vary_pointlight_col = col.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb*diffuse_color.rgb;
-	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
+	vary_ambient = col.rgb;
+	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), 0.0));
 	
-	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
+	col.rgb = min(col.rgb, 1.0);
 	
 	gl_FrontColor = col;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index f54186ffca3..a16be0c8b4f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -36,7 +36,10 @@ uniform float sun_wash;
 uniform int proj_shadow_idx;
 uniform float shadow_fade;
 
-varying vec4 vary_light;
+uniform vec3 center;
+uniform float size;
+uniform vec3 color;
+uniform float falloff;
 
 varying vec4 vary_fragcoord;
 uniform vec2 screen_res;
@@ -110,9 +113,9 @@ void main()
 	frag.xy *= screen_res;
 	
 	vec3 pos = getPosition(frag.xy).xyz;
-	vec3 lv = vary_light.xyz-pos.xyz;
+	vec3 lv = center.xyz-pos.xyz;
 	float dist2 = dot(lv,lv);
-	dist2 /= vary_light.w;
+	dist2 /= size;
 	if (dist2 > 1.0)
 	{
 		discard;
@@ -143,7 +146,7 @@ void main()
 	
 	proj_tc.xyz /= proj_tc.w;
 	
-	float fa = gl_Color.a+1.0;
+	float fa = falloff+1.0;
 	float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
 	if (dist_atten <= 0.0)
 	{
@@ -175,7 +178,7 @@ void main()
 			
 			vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
 		
-			vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+			vec3 lcol = color.rgb * plcol.rgb * plcol.a;
 			
 			lit = da * dist_atten * noise;
 			
@@ -192,7 +195,7 @@ void main()
 			
 		amb_da = min(amb_da, 1.0-lit);
 			
-		col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+		col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
 	}
 	
 	
@@ -225,7 +228,7 @@ void main()
 					stc.y > 0.0)
 				{
 					vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-					col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+					col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb*shadow;
 				}
 			}
 		}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index f0c9b01671f..cbac299e44a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -47,7 +47,8 @@ uniform mat3 ssao_effect_mat;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
-varying vec4 vary_light;
+uniform vec3 sun_dir;
+
 varying vec2 vary_fragcoord;
 
 vec3 vary_PositionEye;
@@ -264,7 +265,7 @@ void main()
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
 	//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
 	
-	float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
+	float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
 	
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
 
@@ -291,7 +292,7 @@ void main()
 			// the old infinite-sky shiny reflection
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-			float sa = dot(refnormpersp, vary_light.xyz);
+			float sa = dot(refnormpersp, sun_dir.xyz);
 			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
 
 			// add the two types of shiny together
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index d2e3415d914..9534f1d79c5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
@@ -7,12 +7,11 @@
  
 
 attribute vec3 position;
-attribute vec2 texcoord0;
 
 uniform vec2 screen_res;
 
-varying vec4 vary_light;
 varying vec2 vary_fragcoord;
+
 void main()
 {
 	//transform vertex
@@ -21,6 +20,4 @@ void main()
 	
 	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-		
-	vary_light = vec4(texcoord0,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index d53850b489c..699fcdb0f39 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -30,7 +30,7 @@ uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
 varying vec2 vary_fragcoord;
-varying vec4 vary_light;
+uniform vec3 sun_dir;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
@@ -167,10 +167,10 @@ void main()
 	}*/
 	
 	float shadow = 1.0;
-	float dp_directional_light = max(0.0, dot(norm, vary_light.xyz));
+	float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
 
 	vec3 shadow_pos = pos.xyz + displace*norm;
-	vec3 offset = vary_light.xyz * (1.0-dp_directional_light);
+	vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
 	
 	vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 6795b55dc69..39cca9589e5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -6,9 +6,6 @@
  */
  
 attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
 
 
 varying vec4 vary_light;
@@ -23,10 +20,4 @@ void main()
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = vec4(texcoord0,0,1);
-	tex.w = 1.0;
-	
-	vary_light = vec4(texcoord0,0,1);
-		
-	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
new file mode 100644
index 00000000000..d2a83c97249
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
@@ -0,0 +1,36 @@
+/** 
+ * @file simpleNonIndexedV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+
+
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
+void main()
+{
+	//transform vertex
+	vec4 vert = vec4(position.xyz,1.0);
+	
+	gl_Position = gl_ModelViewProjectionMatrix*vert;
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	
+	vec4 pos = (gl_ModelViewMatrix * vert);
+	
+	vec3 norm = normalize(gl_NormalMatrix * normal);
+
+	calcAtmospherics(pos.xyz);
+
+	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+	gl_FrontColor = color;
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 406417a36b7..64a5884e14c 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3925,7 +3925,7 @@ void LLAgent::renderAutoPilotTarget()
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
 		// lovely green
-		gGL.diffuseColor4f(0.f, 1.f, 1.f, 1.f);
+		gGL.color4f(0.f, 1.f, 1.f, 1.f);
 
 		target_global = mAutoPilotTargetGlobal;
 
@@ -3935,7 +3935,7 @@ void LLAgent::renderAutoPilotTarget()
 
 		glScalef(height_meters, height_meters, height_meters);
 
-		gSphere.render(1500.f);
+		gSphere.render();
 
 		gGL.popMatrix();
 	}
diff --git a/indra/newview/llcylinder.cpp b/indra/newview/llcylinder.cpp
index 4901e296916..2adc071d7ab 100644
--- a/indra/newview/llcylinder.cpp
+++ b/indra/newview/llcylinder.cpp
@@ -37,261 +37,39 @@
 #include "llgl.h"
 #include "llglheaders.h"
 
-LLCylinder	gCylinder;
 LLCone		gCone;
 
-GLUquadricObj* gQuadObj = NULL;
-
-static const GLint SLICES[] = { 30, 20, 12, 6 };		// same as sphere slices
-static const GLint STACKS = 2;
-static const GLfloat RADIUS = 0.5f;
-	
-// draws a cylinder or cone
-// returns approximate number of triangles required
-U32 draw_cylinder_side(GLint slices, GLint stacks, GLfloat base_radius, GLfloat top_radius)
-{
-	U32 triangles = 0;
-	GLfloat height = 1.0f;
-
-	if (!gQuadObj)
-	{
-		gQuadObj = gluNewQuadric();
-		if (!gQuadObj) llerror("draw_cylindrical_body couldn't allocated quadric", 0);
-	}
-
-	gluQuadricDrawStyle(gQuadObj, GLU_FILL);
-	gluQuadricNormals(gQuadObj, GLU_SMOOTH);
-	gluQuadricOrientation(gQuadObj, GLU_OUTSIDE);
-	gluQuadricTexture(gQuadObj, GL_TRUE);
-	gluCylinder(gQuadObj, base_radius, top_radius, height, slices, stacks);
-	triangles += stacks * (slices * 2);
-	
-
-	return triangles;
-}
-
-
-// Returns number of triangles required to draw
-// Need to know if top or not to set lighting normals
-const BOOL TOP = TRUE;
-const BOOL BOTTOM = FALSE;
-U32 draw_cylinder_cap(GLint slices, GLfloat base_radius, BOOL is_top)
-{
-	U32 triangles = 0;
-
-	if (!gQuadObj)
-	{
-		gQuadObj = gluNewQuadric();
-		if (!gQuadObj) llerror("draw_cylinder_base couldn't allocated quadric", 0);
-	}
-
-	gluQuadricDrawStyle(gQuadObj, GLU_FILL);
-	gluQuadricNormals(gQuadObj, GLU_SMOOTH);
-	gluQuadricOrientation(gQuadObj, GLU_OUTSIDE);
-	gluQuadricTexture(gQuadObj, GL_TRUE);
-
-	// no hole in the middle of the disk, and just one ring
-	GLdouble inner_radius = 0.0;
-	GLint rings = 1;
-
-	// normals point in +z for top, -z for base
-	if (is_top)
-	{
-		gluQuadricOrientation(gQuadObj, GLU_OUTSIDE);
-	}
-	else
-	{
-		gluQuadricOrientation(gQuadObj, GLU_INSIDE);
-	}
-	gluDisk(gQuadObj, inner_radius, base_radius, slices, rings);
-	triangles += slices;
-
-	return triangles;
-}
-
-void LLCylinder::drawSide(S32 detail)
-{
-	draw_cylinder_side(SLICES[detail], STACKS, RADIUS, RADIUS);
-}
-
-void LLCylinder::drawTop(S32 detail)
-{
-	draw_cylinder_cap(SLICES[detail], RADIUS, TOP);
-}
-
-void LLCylinder::drawBottom(S32 detail)
-{
-	draw_cylinder_cap(SLICES[detail], RADIUS, BOTTOM);
-}
-
-void LLCylinder::prerender()
-{
-}
-
-void LLCylinder::cleanupGL()
-{
-	if (gQuadObj)
-	{
-		gluDeleteQuadric(gQuadObj);
-		gQuadObj = NULL;
-	}
-}
-
-void LLCylinder::render(F32 pixel_area)
-{
-	renderface(pixel_area, 0);
-	renderface(pixel_area, 1);
-	renderface(pixel_area, 2);
-}
-
-
-void LLCylinder::renderface(F32 pixel_area, S32 face)
-{
-	if (face < 0 || face > 2)
-	{
-		llerror("LLCylinder::renderface() invalid face number", face);
-		return;
-	}
-
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-
-	S32 level_of_detail;
-
-	if (pixel_area > 20000.f)
-	{
-		level_of_detail = 0;
-	}
-	else if (pixel_area > 1600.f)
-	{
-		level_of_detail = 1;
-	}
-	else if (pixel_area > 200.f)
-	{
-		level_of_detail = 2;
-	}
-	else
-	{
-		level_of_detail = 3;
-	}
-
-	if (level_of_detail < 0 || CYLINDER_LEVELS_OF_DETAIL <= level_of_detail)
-	{
-		llerror("LLCylinder::renderface() invalid level of detail", level_of_detail);
-		return;
-	}
-
-	LLVertexBuffer::unbind();
-	
-	switch(face)
-	{
-	case 0:
-		glTranslatef(0.f, 0.f, -0.5f);
-		drawSide(level_of_detail);
-		break;
-	case 1:
-		glTranslatef(0.0f, 0.f, 0.5f);
-		drawTop(level_of_detail);
-		break;
-	case 2:
-		glTranslatef(0.0f, 0.f, -0.5f);
-		drawBottom(level_of_detail);
-		break;
-	default:
-		llerror("LLCylinder::renderface() fell out of switch", 0);
-		break;
-	}
-
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
-}
-
-
 //
 // Cones
 //
 
-void LLCone::prerender()
+void LLCone::render(S32 sides)
 {
-}
+	gGL.begin(LLRender::TRIANGLE_FAN);
+	gGL.vertex3f(0,0,0);
 
-void LLCone::cleanupGL()
-{
-	if (gQuadObj)
+	for (U32 i = 0; i < sides; i++)
 	{
-		gluDeleteQuadric(gQuadObj);
-		gQuadObj = NULL;
+		F32 a = (F32) i/sides * F_PI*2.f;
+		F32 x = cosf(a)*0.5f;
+		F32 y = sinf(a)*0.5f;
+		gGL.vertex3f(x,y,0.f);
 	}
-}
+	gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, 0.f);
 
-void LLCone::drawSide(S32 detail)
-{
-	draw_cylinder_side( SLICES[detail], STACKS, RADIUS, 0.f );	
-}
-
-void LLCone::drawBottom(S32 detail)
-{
-	draw_cylinder_cap( SLICES[detail], RADIUS, BOTTOM );
-}
-
-void LLCone::render(S32 level_of_detail)
-{
-	GLfloat height = 1.0f;
+	gGL.end();
 
-	if (level_of_detail < 0 || CONE_LEVELS_OF_DETAIL <= level_of_detail)
+	gGL.begin(LLRender::TRIANGLE_FAN);
+	gGL.vertex3f(0.f, 0.f, 1.f);
+	for (U32 i = 0; i < sides; i++)
 	{
-		llerror("LLCone::render() invalid level of detail", level_of_detail);
-		return;
+		F32 a = (F32) i/sides * F_PI*2.f;
+		F32 x = cosf(a)*0.5f;
+		F32 y = sinf(a)*0.5f;
+		gGL.vertex3f(x,y,0.f);
 	}
+	gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, 0.f);
 
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-
-	// center object at 0
-	glTranslatef(0.f, 0.f, - height / 2.0f);
-
-	drawSide(level_of_detail);
-	drawBottom(level_of_detail);
-
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.end();
 }
 
-
-void LLCone::renderface(S32 level_of_detail, S32 face)
-{
-	if (face < 0 || face > 1)
-	{
-		llerror("LLCone::renderface() invalid face number", face);
-		return;
-	}
-
-	if (level_of_detail < 0 || CONE_LEVELS_OF_DETAIL <= level_of_detail)
-	{
-		llerror("LLCone::renderface() invalid level of detail", level_of_detail);
-		return;
-	}
-
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-
-	LLVertexBuffer::unbind();
-	
-	switch(face)
-	{
-	case 0:
-		glTranslatef(0.f, 0.f, -0.5f);
-		drawSide(level_of_detail);
-		break;
-	case 1:
-		glTranslatef(0.f, 0.f, -0.5f);
-		drawBottom(level_of_detail);
-		break;
-	default:
-		llerror("LLCylinder::renderface() fell out of switch", 0);
-		break;
-	}
-
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
-}
diff --git a/indra/newview/llcylinder.h b/indra/newview/llcylinder.h
index 40a669ceb6d..4369f06659d 100644
--- a/indra/newview/llcylinder.h
+++ b/indra/newview/llcylinder.h
@@ -30,45 +30,18 @@
 //#include "stdtypes.h"
 //#include "llgl.h"
 
-//
-// Cylinders
-//
-const S32 CYLINDER_LEVELS_OF_DETAIL = 4;
-const S32 CYLINDER_FACES = 3;
-
-class LLCylinder
-{
-public:
-	void prerender();
-	void drawTop(S32 detail);
-	void drawSide(S32 detail);
-	void drawBottom(S32 detail);
-	void cleanupGL();
-
-	void render(F32 pixel_area);
-	void renderface(F32 pixel_area, S32 face);
-};
-
+#include "llvertexbuffer.h"
 
 //
 // Cones
 //
 
-const S32 CONE_LOD_HIGHEST = 0;
-const S32 CONE_LEVELS_OF_DETAIL = 4;
-const S32 CONE_FACES = 2;
-
 class LLCone
 {	
 public:
-	void prerender();
-	void cleanupGL();
-	void drawSide(S32 detail);
-	void drawBottom(S32 detail);
-	void render(S32 level_of_detail);
-	void renderface(S32 level_of_detail, S32 face);
+	void render(S32 sides = 12);
 };
 
-extern LLCylinder gCylinder;
+
 extern LLCone gCone;
 #endif
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index ef8819d9b54..a3f8eb377ae 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -492,7 +492,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
 				gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode);
 				
 				// If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow).  Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha.
-				if (draw_glow_for_this_partition &&
+				if (current_shader && 
+					draw_glow_for_this_partition &&
 					params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE))
 				{
 					// install glow-accumulating blend mode
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index dae995e1f5a..a99f0200cef 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -270,7 +270,6 @@ void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
 	sVertexProgram = &gDeferredSkinnedAlphaProgram;
 	gPipeline.bindDeferredShader(*sVertexProgram);
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-	LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 	gPipeline.enableLightsDynamic();
 }
 
@@ -279,7 +278,6 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha()
 	LLVertexBuffer::unbind();
 	gPipeline.unbindDeferredShader(*sVertexProgram);
 	sDiffuseChannel = 0;
-	LLVertexBuffer::sWeight4Loc = -1;
 	sVertexProgram = NULL;
 }
 
@@ -354,10 +352,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
 	if (pass == 0)
 	{
 		sVertexProgram = &gDeferredAvatarShadowProgram;
-		if (sShaderLevel > 0)
-		{
-			gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX];
-		}
+		
 		//gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f);
 		
 		gGL.diffuseColor4f(1,1,1,1);
@@ -373,7 +368,6 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
 		sVertexProgram = &gDeferredAttachmentShadowProgram;
 		sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 		sVertexProgram->bind();
-		LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 	}
 }
 
@@ -392,7 +386,6 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass)
 	{
 		LLVertexBuffer::unbind();
 		sVertexProgram->unbind();
-		LLVertexBuffer::sWeight4Loc = -1;
 		sVertexProgram = NULL;
 	}
 }
@@ -426,11 +419,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
 	
 	if (pass == 0)
 	{
-		if (sShaderLevel > 0)
-		{
-			gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX];
-		}
-
 		avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
 	}
 	else
@@ -587,11 +575,20 @@ void LLDrawPoolAvatar::beginImpostor()
 
 	gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
 	sDiffuseChannel = 0;
+
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
 }
 
 void LLDrawPoolAvatar::endImpostor()
 {
 	gPipeline.enableLightsDynamic();
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.unbind();
+	}
 }
 
 void LLDrawPoolAvatar::beginRigid()
@@ -657,9 +654,10 @@ void LLDrawPoolAvatar::endDeferredImpostor()
 
 void LLDrawPoolAvatar::beginDeferredRigid()
 {
-	sVertexProgram = &gDeferredNonIndexedDiffuseProgram;
+	sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
 				
 	sVertexProgram->bind();
+	sVertexProgram->setAlphaRange(0.2f, 1.f);
 }
 
 void LLDrawPoolAvatar::endDeferredRigid()
@@ -773,7 +771,6 @@ void LLDrawPoolAvatar::beginRiggedSimple()
 	{
 		sDiffuseChannel = 0;
 		sVertexProgram->bind();
-		LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 	}
 }
 
@@ -784,7 +781,6 @@ void LLDrawPoolAvatar::endRiggedSimple()
 	{
 		sVertexProgram->unbind();
 		sVertexProgram = NULL;
-		LLVertexBuffer::sWeight4Loc = -1;
 	}
 }
 
@@ -811,7 +807,34 @@ void LLDrawPoolAvatar::endRiggedFullbrightAlpha()
 
 void LLDrawPoolAvatar::beginRiggedGlow()
 {
-	beginRiggedFullbright();
+	if (sShaderLevel > 0)
+	{
+		if (LLPipeline::sUnderWaterRender)
+		{
+			sVertexProgram = &gSkinnedObjectEmissiveWaterProgram;
+		}
+		else
+		{
+			sVertexProgram = &gSkinnedObjectEmissiveProgram;
+		}
+	}
+	else
+	{
+		if (LLPipeline::sUnderWaterRender)
+		{
+			sVertexProgram = &gObjectEmissiveNonIndexedWaterProgram;
+		}
+		else
+		{
+			sVertexProgram = &gObjectEmissiveNonIndexedProgram;
+		}
+	}
+
+	if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
+	{
+		sDiffuseChannel = 0;
+		sVertexProgram->bind();
+	}
 }
 
 void LLDrawPoolAvatar::endRiggedGlow()
@@ -848,7 +871,6 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
 	{
 		sDiffuseChannel = 0;
 		sVertexProgram->bind();
-		LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 	}
 }
 
@@ -859,7 +881,6 @@ void LLDrawPoolAvatar::endRiggedFullbright()
 	{
 		sVertexProgram->unbind();
 		sVertexProgram = NULL;
-		LLVertexBuffer::sWeight4Loc = -1;
 	}
 }
 
@@ -892,7 +913,6 @@ void LLDrawPoolAvatar::beginRiggedShinySimple()
 	{
 		sVertexProgram->bind();
 		LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
-		LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 	}
 }
 
@@ -904,7 +924,6 @@ void LLDrawPoolAvatar::endRiggedShinySimple()
 		LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
 		sVertexProgram->unbind();
 		sVertexProgram = NULL;
-		LLVertexBuffer::sWeight4Loc = -1;
 	}
 }
 
@@ -938,7 +957,6 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
 	{
 		sVertexProgram->bind();
 		LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
-		LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 	}
 }
 
@@ -950,7 +968,6 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny()
 		LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
 		sVertexProgram->unbind();
 		sVertexProgram = NULL;
-		LLVertexBuffer::sWeight4Loc = -1;
 	}
 }
 
@@ -960,14 +977,12 @@ void LLDrawPoolAvatar::beginDeferredRiggedSimple()
 	sVertexProgram = &gDeferredSkinnedDiffuseProgram;
 	sDiffuseChannel = 0;
 	sVertexProgram->bind();
-	LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 }
 
 void LLDrawPoolAvatar::endDeferredRiggedSimple()
 {
 	LLVertexBuffer::unbind();
 	sVertexProgram->unbind();
-	LLVertexBuffer::sWeight4Loc = -1;
 	sVertexProgram = NULL;
 }
 
@@ -977,7 +992,6 @@ void LLDrawPoolAvatar::beginDeferredRiggedBump()
 	sVertexProgram->bind();
 	normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP);
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-	LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT);
 }
 
 void LLDrawPoolAvatar::endDeferredRiggedBump()
@@ -986,7 +1000,6 @@ void LLDrawPoolAvatar::endDeferredRiggedBump()
 	sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP);
 	sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 	sVertexProgram->unbind();
-	LLVertexBuffer::sWeight4Loc = -1;
 	normal_channel = -1;
 	sDiffuseChannel = 0;
 	sVertexProgram = NULL;
@@ -996,10 +1009,10 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
 {
 	sShaderLevel = mVertexShaderLevel;
 	sVertexProgram = &gDeferredAvatarProgram;
-
 	sRenderingSkinned = TRUE;
 
 	sVertexProgram->bind();
+	sVertexProgram->setAlphaRange(0.2f, 1.f);
 	
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 	gGL.getTexUnit(0)->activate();
@@ -1216,11 +1229,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 		return;
 	}
 	
-	if (sShaderLevel > 0)
-	{
-		gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX];
-	}
-    
 	if ((sShaderLevel >= SHADER_LEVEL_CLOTH))
 	{
 		LLMatrix4 rot_mat;
@@ -1632,34 +1640,3 @@ LLVertexBufferAvatar::LLVertexBufferAvatar()
 }
 
 
-void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const
-{
-	/*if (sRenderingSkinned)
-	{
-		U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
-
-		glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_VERTEX], (void*)(base + 0));
-		glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
-		glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
-		
-		set_vertex_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT], 
-						LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_WEIGHT], (F32*)(base + mOffsets[TYPE_WEIGHT]));
-
-		if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_BUMP)
-		{
-			set_binormals(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL],
-				LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_BINORMAL], (LLVector3*)(base + mOffsets[TYPE_BINORMAL]));
-		}
-	
-		if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_CLOTH)
-		{
-			set_vertex_clothing_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING], 
-				LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_CLOTHWEIGHT], (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
-		}
-	}
-	else
-	{*/
-		LLVertexBuffer::setupVertexBuffer(data_mask);
-	//}
-}
-
diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h
index fcd8294af54..e0326bcfaff 100644
--- a/indra/newview/lldrawpoolavatar.h
+++ b/indra/newview/lldrawpoolavatar.h
@@ -176,6 +176,7 @@ class LLDrawPoolAvatar : public LLFacePool
 		RIGGED_FULLBRIGHT_SHINY_MASK = RIGGED_SIMPLE_MASK,							 
 		RIGGED_GLOW_MASK = LLVertexBuffer::MAP_VERTEX | 
 							 LLVertexBuffer::MAP_TEXCOORD0 |
+							 LLVertexBuffer::MAP_EMISSIVE |
 							 LLVertexBuffer::MAP_WEIGHT4,
 		RIGGED_ALPHA_MASK = RIGGED_SIMPLE_MASK,
 		RIGGED_FULLBRIGHT_ALPHA_MASK = RIGGED_FULLBRIGHT_MASK,
@@ -214,7 +215,6 @@ class LLVertexBufferAvatar : public LLVertexBuffer
 {
 public:
 	LLVertexBufferAvatar();
-	virtual void setupVertexBuffer(U32 data_mask) const;
 };
 
 extern S32 AVATAR_OFFSET_POS;
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 582e4628711..80c202d4e2f 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -46,7 +46,7 @@ static LLFastTimer::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass");
 
 void LLDrawPoolGlow::beginPostDeferredPass(S32 pass)
 {
-	gDeferredFullbrightProgram.bind();
+	gDeferredEmissiveProgram.bind();
 }
 
 static LLFastTimer::DeclareTimer FTM_RENDER_GLOW_PUSH("Glow Push");
@@ -76,7 +76,7 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass)
 
 void LLDrawPoolGlow::endPostDeferredPass(S32 pass)
 {
-	gDeferredFullbrightProgram.unbind();
+	gDeferredEmissiveProgram.unbind();
 	LLRenderPass::endRenderPass(pass);
 }
 
@@ -255,6 +255,7 @@ void LLDrawPoolGrass::prerender()
 void LLDrawPoolGrass::beginRenderPass(S32 pass)
 {
 	LLFastTimer t(FTM_RENDER_GRASS);
+	stop_glerror();
 
 	if (LLPipeline::sUnderWaterRender)
 	{
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 50a52ac4cfa..da8e3e8b3a6 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -142,7 +142,7 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass)
 {
 	LLFastTimer t(FTM_RENDER_TREES);
 		
-	shader = &gDeferredNonIndexedDiffuseAlphaMaskProgram;
+	shader = &gDeferredTreeProgram;
 	shader->bind();
 	shader->setAlphaRange(0.5f, 1.f);
 }
@@ -169,8 +169,8 @@ void LLDrawPoolTree::beginShadowPass(S32 pass)
 	glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"),
 					gSavedSettings.getF32("RenderDeferredTreeShadowBias"));
 
-	gDeferredShadowAlphaMaskProgram.bind();
-	gDeferredShadowAlphaMaskProgram.setAlphaRange(0.5f, 1.f);
+	gDeferredTreeShadowProgram.bind();
+	gDeferredTreeShadowProgram.setAlphaRange(0.5f, 1.f);
 }
 
 void LLDrawPoolTree::renderShadow(S32 pass)
@@ -184,6 +184,7 @@ void LLDrawPoolTree::endShadowPass(S32 pass)
 	
 	glPolygonOffset(gSavedSettings.getF32("RenderDeferredSpotShadowOffset"),
 						gSavedSettings.getF32("RenderDeferredSpotShadowBias"));
+	gDeferredTreeShadowProgram.unbind();
 }
 
 
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 3286408f21c..b9838f7da24 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3623,6 +3623,15 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 
 	LLVertexBuffer::unbind();
 
+	bool no_ff = LLGLSLShader::sNoFixedFunction;
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	LLGLSLShader::sNoFixedFunction = false;
+
+	if (shader)
+	{
+		shader->unbind();
+	}
+	
 	stop_gloderror();
 	static U32 cur_name = 1;
 
@@ -4003,6 +4012,13 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 
 	mResourceCost = calcResourceCost();
 
+	LLVertexBuffer::unbind();
+	LLGLSLShader::sNoFixedFunction = no_ff;
+	if (shader)
+	{
+		shader->bind();
+	}
+
 	/*if (which_lod == -1 && mScene[LLModel::LOD_PHYSICS].empty())
 	 { //build physics scene
 	 mScene[LLModel::LOD_PHYSICS] = mScene[LLModel::LOD_LOW];
@@ -4950,7 +4966,7 @@ BOOL LLModelPreview::render()
 
 						llassert(binding == model->mMaterialList[i]);
 						
-						gGL.diffuseColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
+						gGL.diffuseColor4fv(material.mDiffuseColor.mV);
 
 						if (material.mDiffuseMap.notNull())
 						{
@@ -5261,7 +5277,7 @@ BOOL LLModelPreview::render()
 							const LLImportMaterial& material = instance.mMaterial[binding];
 
 							buffer->setBuffer(type_mask & buffer->getTypeMask());
-							gGL.diffuseColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
+							gGL.diffuseColor4fv(material.mDiffuseColor.mV);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 							buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
 							gGL.diffuseColor3f(0.4f, 0.4f, 0.4f);
diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp
index 37b7b2e75dc..ec5a0926c4c 100644
--- a/indra/newview/llhudeffectbeam.cpp
+++ b/indra/newview/llhudeffectbeam.cpp
@@ -295,12 +295,12 @@ void LLHUDEffectBeam::render()
 		F32 alpha = mFadeInterp.getCurVal()*mColor.mV[3];
 		alpha *= mInterpFade[i].getCurVal();
 		coloru.mV[3] = (U8)alpha;
-		glColor4ubv(coloru.mV);
+		gGL.color4ubv(coloru.mV);
 
 		glPushMatrix();
 		glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
 		glScalef(scale, scale, scale);
-		gSphere.render(0);
+		gSphere.render();
 		glPopMatrix();
 	}
 }
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index c4f8369cd0e..a9b14829b2d 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1519,6 +1519,7 @@ void LLManipTranslate::renderSnapGuides()
 		
 		F32 sz = mGridSizeMeters;
 		F32 tiles = sz;
+
 		glMatrixMode(GL_TEXTURE);
 		gGL.pushMatrix();
 		usc = 1.0f/usc;
@@ -2243,7 +2244,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
 		glRotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]);
 		glScalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f);
 
-		gCone.render(CONE_LOD_HIGHEST);
+		gCone.render();
 
 		gGL.popMatrix();
 	}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 8aa24e92619..568c967a9a5 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -89,6 +89,7 @@
 #include "llvoavatarself.h"
 #include "llvovolume.h"
 #include "pipeline.h"
+#include "llviewershadermgr.h"
 
 #include "llglheaders.h"
 
@@ -5570,8 +5571,7 @@ void pushWireframe(LLDrawable* drawable)
 				for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i)
 				{
 					const LLVolumeFace& face = rigged_volume->getVolumeFace(i);
-					glVertexPointer(3, GL_FLOAT, 16, face.mPositions);
-					glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
+					LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, face.mTexCoords, face.mNumIndices, face.mIndices);
 				}
 				gGL.popMatrix();
 			}
@@ -5584,7 +5584,7 @@ void pushWireframe(LLDrawable* drawable)
 			LLFace* face = drawable->getFace(i);
 			if (face->verify())
 			{
-				pushVerts(face, LLVertexBuffer::MAP_VERTEX);
+				pushVerts(face, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0);
 			}
 		}
 	}
@@ -5604,6 +5604,13 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 		return;
 	}
 
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (shader)
+	{
+		gHighlightProgram.bind();
+	}
+
 	glMatrixMode(GL_MODELVIEW);
 	gGL.pushMatrix();
 	
@@ -5627,26 +5634,41 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 	if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible())
 	{
 		gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
-		LLGLEnable fog(GL_FOG);
-		glFogi(GL_FOG_MODE, GL_LINEAR);
-		float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec();
-		LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0);
-		glFogf(GL_FOG_START, d);
-		glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
-		glFogfv(GL_FOG_COLOR, fogCol.mV);
-
 		LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL);
-		gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
+		if (shader)
 		{
-			gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
+			gHighlightProgram.uniform4f("highlight_color", color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
 			pushWireframe(drawable);
 		}
+		else
+		{
+			LLGLEnable fog(GL_FOG);
+			glFogi(GL_FOG_MODE, GL_LINEAR);
+			float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec();
+			LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0);
+			glFogf(GL_FOG_START, d);
+			glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
+			glFogfv(GL_FOG_COLOR, fogCol.mV);
+
+			gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
+			{
+				gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
+				pushWireframe(drawable);
+			}
+		}
 	}
 
 	gGL.flush();
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
 
-	gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
+	if (shader)
+	{
+		gHighlightProgram.uniform4f("highlight_color", color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
+	}
+	else
+	{
+		gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
+	}
 	LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
 	glPolygonOffset(3.f, 3.f);
 	glLineWidth(3.f);
@@ -5654,6 +5676,11 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 	glLineWidth(1.f);
 	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 	gGL.popMatrix();
+
+	if (shader)
+	{
+		shader->bind();
+	}
 }
 
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 064eaa49dd0..3d371f7a443 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -4248,7 +4248,7 @@ class LLOctreeIntersect : public LLSpatialGroup::OctreeTraveler
 		LLVector3 local_start = mStart;
 		LLVector3 local_end = mEnd;
 
-		if (!gPipeline.hasRenderType(drawable->getRenderType()) || !drawable->isVisible())
+		if (!drawable || !gPipeline.hasRenderType(drawable->getRenderType()) || !drawable->isVisible())
 		{
 			return false;
 		}
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 983108391f8..2ec7534025b 100644
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -506,7 +506,8 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
 	
 	
 	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.pushMatrix();
+	{
 		glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
 		
 		draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color);
@@ -559,9 +560,8 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
 			
 			gGL.end();
 		}
-							
-		//gCylinder.render(1000);
-	glPopMatrix();
+	}
+	gGL.popMatrix();
 
 	std::string text;
 	text = llformat( "%.0f m", to_vec.magVec());
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 5e4c124c45a..2d08a279237 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -459,7 +459,10 @@ void LLViewerJointMesh::uploadJointMatrices()
 			}
 		}
 		stop_glerror();
-		glUniform4fvARB(gAvatarMatrixParam, 45, mat);
+		if (LLGLSLShader::sCurBoundShaderPtr)
+		{
+			LLGLSLShader::sCurBoundShaderPtr->uniform4fv(LLViewerShaderMgr::AVATAR_MATRIX, 45, mat);
+		}
 		stop_glerror();
 	}
 	else
@@ -512,7 +515,8 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 {
 	if (!mValid || !mMesh || !mFace || !mVisible || 
 		!mFace->getVertexBuffer() ||
-		mMesh->getNumFaces() == 0) 
+		mMesh->getNumFaces() == 0 ||
+		(LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShaderPtr == NULL))
 	{
 		return 0;
 	}
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 8684322eef4..f07b21e3c3b 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -97,6 +97,8 @@ LLGLSLShader		gObjectAlphaMaskNoColorProgram;
 LLGLSLShader		gObjectAlphaMaskNoColorWaterProgram;
 LLGLSLShader		gObjectFullbrightNonIndexedProgram;
 LLGLSLShader		gObjectFullbrightNonIndexedWaterProgram;
+LLGLSLShader		gObjectEmissiveNonIndexedProgram;
+LLGLSLShader		gObjectEmissiveNonIndexedWaterProgram;
 LLGLSLShader		gObjectFullbrightShinyNonIndexedProgram;
 LLGLSLShader		gObjectFullbrightShinyNonIndexedWaterProgram;
 LLGLSLShader		gObjectShinyNonIndexedProgram;
@@ -105,11 +107,13 @@ LLGLSLShader		gObjectShinyNonIndexedWaterProgram;
 //object hardware skinning shaders
 LLGLSLShader		gSkinnedObjectSimpleProgram;
 LLGLSLShader		gSkinnedObjectFullbrightProgram;
+LLGLSLShader		gSkinnedObjectEmissiveProgram;
 LLGLSLShader		gSkinnedObjectFullbrightShinyProgram;
 LLGLSLShader		gSkinnedObjectShinySimpleProgram;
 
 LLGLSLShader		gSkinnedObjectSimpleWaterProgram;
 LLGLSLShader		gSkinnedObjectFullbrightWaterProgram;
+LLGLSLShader		gSkinnedObjectEmissiveWaterProgram;
 LLGLSLShader		gSkinnedObjectFullbrightShinyWaterProgram;
 LLGLSLShader		gSkinnedObjectShinySimpleWaterProgram;
 
@@ -147,12 +151,14 @@ LLGLSLShader			gDeferredDiffuseProgram;
 LLGLSLShader			gDeferredDiffuseAlphaMaskProgram;
 LLGLSLShader			gDeferredNonIndexedDiffuseProgram;
 LLGLSLShader			gDeferredNonIndexedDiffuseAlphaMaskProgram;
+LLGLSLShader			gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
 LLGLSLShader			gDeferredSkinnedDiffuseProgram;
 LLGLSLShader			gDeferredSkinnedBumpProgram;
 LLGLSLShader			gDeferredSkinnedAlphaProgram;
 LLGLSLShader			gDeferredBumpProgram;
 LLGLSLShader			gDeferredTerrainProgram;
 LLGLSLShader			gDeferredTreeProgram;
+LLGLSLShader			gDeferredTreeShadowProgram;
 LLGLSLShader			gDeferredAvatarProgram;
 LLGLSLShader			gDeferredAvatarAlphaProgram;
 LLGLSLShader			gDeferredLightProgram;
@@ -169,6 +175,7 @@ LLGLSLShader			gDeferredAttachmentShadowProgram;
 LLGLSLShader			gDeferredAlphaProgram;
 LLGLSLShader			gDeferredAvatarEyesProgram;
 LLGLSLShader			gDeferredFullbrightProgram;
+LLGLSLShader			gDeferredEmissiveProgram;
 LLGLSLShader			gDeferredGIProgram;
 LLGLSLShader			gDeferredGIFinalProgram;
 LLGLSLShader			gDeferredPostGIProgram;
@@ -179,10 +186,6 @@ LLGLSLShader			gDeferredWLCloudProgram;
 LLGLSLShader			gDeferredStarProgram;
 LLGLSLShader			gLuminanceGatherProgram;
 
-
-//current avatar shader parameter pointer
-GLint				gAvatarMatrixParam;
-
 LLViewerShaderMgr::LLViewerShaderMgr() :
 	mVertexShaderLevel(SHADER_COUNT, 0),
 	mMaxAvatarShaderLevel(0)
@@ -223,14 +226,18 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gTreeWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightNonIndexedProgram);
 	mShaderList.push_back(&gObjectFullbrightNonIndexedWaterProgram);
+	mShaderList.push_back(&gObjectEmissiveNonIndexedProgram);
+	mShaderList.push_back(&gObjectEmissiveNonIndexedWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightShinyNonIndexedProgram);
 	mShaderList.push_back(&gObjectFullbrightShinyNonIndexedWaterProgram);
 	mShaderList.push_back(&gSkinnedObjectSimpleProgram);
 	mShaderList.push_back(&gSkinnedObjectFullbrightProgram);
+	mShaderList.push_back(&gSkinnedObjectEmissiveProgram);
 	mShaderList.push_back(&gSkinnedObjectFullbrightShinyProgram);
 	mShaderList.push_back(&gSkinnedObjectShinySimpleProgram);
 	mShaderList.push_back(&gSkinnedObjectSimpleWaterProgram);
 	mShaderList.push_back(&gSkinnedObjectFullbrightWaterProgram);
+	mShaderList.push_back(&gSkinnedObjectEmissiveWaterProgram);
 	mShaderList.push_back(&gSkinnedObjectFullbrightShinyWaterProgram);
 	mShaderList.push_back(&gSkinnedObjectShinySimpleWaterProgram);
 	mShaderList.push_back(&gTerrainProgram);
@@ -251,6 +258,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gDeferredAlphaProgram);
 	mShaderList.push_back(&gDeferredSkinnedAlphaProgram);
 	mShaderList.push_back(&gDeferredFullbrightProgram);
+	mShaderList.push_back(&gDeferredEmissiveProgram);
 	mShaderList.push_back(&gDeferredAvatarEyesProgram);
 	mShaderList.push_back(&gDeferredPostGIProgram);
 	mShaderList.push_back(&gDeferredEdgeProgram);
@@ -690,6 +698,8 @@ void LLViewerShaderMgr::unloadShaders()
 	gObjectAlphaMaskNoColorWaterProgram.unload();
 	gObjectFullbrightNonIndexedProgram.unload();
 	gObjectFullbrightNonIndexedWaterProgram.unload();
+	gObjectEmissiveNonIndexedProgram.unload();
+	gObjectEmissiveNonIndexedWaterProgram.unload();
 	gTreeProgram.unload();
 	gTreeWaterProgram.unload();
 
@@ -700,11 +710,13 @@ void LLViewerShaderMgr::unloadShaders()
 
 	gSkinnedObjectSimpleProgram.unload();
 	gSkinnedObjectFullbrightProgram.unload();
+	gSkinnedObjectEmissiveProgram.unload();
 	gSkinnedObjectFullbrightShinyProgram.unload();
 	gSkinnedObjectShinySimpleProgram.unload();
 	
 	gSkinnedObjectSimpleWaterProgram.unload();
 	gSkinnedObjectFullbrightWaterProgram.unload();
+	gSkinnedObjectEmissiveWaterProgram.unload();
 	gSkinnedObjectFullbrightShinyWaterProgram.unload();
 	gSkinnedObjectShinySimpleWaterProgram.unload();
 	
@@ -730,6 +742,7 @@ void LLViewerShaderMgr::unloadShaders()
 	gDeferredDiffuseProgram.unload();
 	gDeferredDiffuseAlphaMaskProgram.unload();
 	gDeferredNonIndexedDiffuseAlphaMaskProgram.unload();
+	gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.unload();
 	gDeferredNonIndexedDiffuseProgram.unload();
 	gDeferredSkinnedDiffuseProgram.unload();
 	gDeferredSkinnedBumpProgram.unload();
@@ -1086,9 +1099,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	if (mVertexShaderLevel[SHADER_DEFERRED] == 0)
 	{
 		gDeferredTreeProgram.unload();
+		gDeferredTreeShadowProgram.unload();
 		gDeferredDiffuseProgram.unload();
 		gDeferredDiffuseAlphaMaskProgram.unload();
 		gDeferredNonIndexedDiffuseAlphaMaskProgram.unload();
+		gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.unload();
 		gDeferredNonIndexedDiffuseProgram.unload();
 		gDeferredSkinnedDiffuseProgram.unload();
 		gDeferredSkinnedBumpProgram.unload();
@@ -1111,6 +1126,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarAlphaProgram.unload();
 		gDeferredAlphaProgram.unload();
 		gDeferredFullbrightProgram.unload();
+		gDeferredEmissiveProgram.unload();
 		gDeferredAvatarEyesProgram.unload();
 		gDeferredPostGIProgram.unload();		
 		gDeferredEdgeProgram.unload();		
@@ -1163,6 +1179,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(NULL, NULL);
 	}
+	
+	if (success)
+	{
+		gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mName = "Deferred Diffuse Non-Indexed Alpha Mask Shader";
+		gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.clear();
+		gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseNoColorV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskNoColorF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader(NULL, NULL);
+	}
 
 	if (success)
 	{
@@ -1234,6 +1260,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		success = gDeferredTreeProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gDeferredTreeShadowProgram.mName = "Deferred Tree Shadow Shader";
+		gDeferredTreeShadowProgram.mShaderFiles.clear();
+		gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredTreeShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		success = gDeferredTreeShadowProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gDeferredImpostorProgram.mName = "Deferred Impostor Shader";
@@ -1436,6 +1472,20 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		success = gDeferredFullbrightProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gDeferredEmissiveProgram.mName = "Deferred Emissive Shader";
+		gDeferredEmissiveProgram.mFeatures.calculatesAtmospherics = true;
+		gDeferredEmissiveProgram.mFeatures.hasGamma = true;
+		gDeferredEmissiveProgram.mFeatures.hasTransport = true;
+		gDeferredEmissiveProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
+		gDeferredEmissiveProgram.mShaderFiles.clear();
+		gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		success = gDeferredEmissiveProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		// load water shader
@@ -1553,7 +1603,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true;
 		gDeferredAvatarAlphaProgram.mShaderFiles.clear();
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms);
 	}
@@ -1736,12 +1786,16 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectAlphaMaskNoColorWaterProgram.unload();
 		gObjectFullbrightNonIndexedProgram.unload();
 		gObjectFullbrightNonIndexedWaterProgram.unload();
+		gObjectEmissiveNonIndexedProgram.unload();
+		gObjectEmissiveNonIndexedWaterProgram.unload();
 		gSkinnedObjectSimpleProgram.unload();
 		gSkinnedObjectFullbrightProgram.unload();
+		gSkinnedObjectEmissiveProgram.unload();
 		gSkinnedObjectFullbrightShinyProgram.unload();
 		gSkinnedObjectShinySimpleProgram.unload();
 		gSkinnedObjectSimpleWaterProgram.unload();
 		gSkinnedObjectFullbrightWaterProgram.unload();
+		gSkinnedObjectEmissiveWaterProgram.unload();
 		gSkinnedObjectFullbrightShinyWaterProgram.unload();
 		gSkinnedObjectShinySimpleWaterProgram.unload();
 		gTreeProgram.unload();
@@ -1919,6 +1973,37 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gObjectFullbrightNonIndexedWaterProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gObjectEmissiveNonIndexedProgram.mName = "Non Indexed Emissive Shader";
+		gObjectEmissiveNonIndexedProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectEmissiveNonIndexedProgram.mFeatures.hasGamma = true;
+		gObjectEmissiveNonIndexedProgram.mFeatures.hasTransport = true;
+		gObjectEmissiveNonIndexedProgram.mFeatures.isFullbright = true;
+		gObjectEmissiveNonIndexedProgram.mFeatures.disableTextureIndex = true;
+		gObjectEmissiveNonIndexedProgram.mShaderFiles.clear();
+		gObjectEmissiveNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectEmissiveNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectEmissiveNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectEmissiveNonIndexedProgram.createShader(NULL, NULL);
+	}
+
+	if (success)
+	{
+		gObjectEmissiveNonIndexedWaterProgram.mName = "Non Indexed Emissive Water Shader";
+		gObjectEmissiveNonIndexedWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectEmissiveNonIndexedWaterProgram.mFeatures.isFullbright = true;
+		gObjectEmissiveNonIndexedWaterProgram.mFeatures.hasWaterFog = true;		
+		gObjectEmissiveNonIndexedWaterProgram.mFeatures.hasTransport = true;
+		gObjectEmissiveNonIndexedWaterProgram.mFeatures.disableTextureIndex = true;
+		gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.clear();
+		gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectEmissiveNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gObjectEmissiveNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gObjectEmissiveNonIndexedWaterProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gObjectFullbrightNoColorProgram.mName = "Non Indexed no color Fullbright Shader";
@@ -2299,6 +2384,39 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 			success = gSkinnedObjectFullbrightProgram.createShader(NULL, NULL);
 		}
 
+		if (success)
+		{
+			gSkinnedObjectEmissiveProgram.mName = "Skinned Emissive Shader";
+			gSkinnedObjectEmissiveProgram.mFeatures.calculatesAtmospherics = true;
+			gSkinnedObjectEmissiveProgram.mFeatures.hasGamma = true;
+			gSkinnedObjectEmissiveProgram.mFeatures.hasTransport = true;
+			gSkinnedObjectEmissiveProgram.mFeatures.isFullbright = true;
+			gSkinnedObjectEmissiveProgram.mFeatures.hasObjectSkinning = true;
+			gSkinnedObjectEmissiveProgram.mFeatures.disableTextureIndex = true;
+			gSkinnedObjectEmissiveProgram.mShaderFiles.clear();
+			gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
+			gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));
+			gSkinnedObjectEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+			success = gSkinnedObjectEmissiveProgram.createShader(NULL, NULL);
+		}
+
+		if (success)
+		{
+			gSkinnedObjectEmissiveWaterProgram.mName = "Skinned Emissive Water Shader";
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.calculatesAtmospherics = true;
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.hasGamma = true;
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.hasTransport = true;
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.isFullbright = true;
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.hasObjectSkinning = true;
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.disableTextureIndex = true;
+			gSkinnedObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true;
+			gSkinnedObjectEmissiveWaterProgram.mShaderFiles.clear();
+			gSkinnedObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
+			gSkinnedObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+			gSkinnedObjectEmissiveWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+			success = gSkinnedObjectEmissiveWaterProgram.createShader(NULL, NULL);
+		}
+
 		if (success)
 		{
 			gSkinnedObjectFullbrightShinyProgram.mName = "Skinned Fullbright Shiny Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index ced7ed06d92..1b658c45ba7 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -71,15 +71,6 @@ class LLViewerShaderMgr: public LLShaderMgr
 		SHADER_COUNT
 	};
 
-	typedef enum 
-	{
-		MATERIAL_COLOR = 0,
-		SPECULAR_COLOR,
-		BINORMAL,
-		OBJECT_WEIGHT,
-		END_RESERVED_ATTRIBS
-	} eGLSLReservedAttribs;
-	
 	typedef enum
 	{
 		DIFFUSE_MAP = 0,
@@ -309,6 +300,8 @@ extern LLGLSLShader			gObjectFullbrightAlphaMaskProgram;
 extern LLGLSLShader			gObjectFullbrightWaterAlphaMaskProgram;
 extern LLGLSLShader			gObjectFullbrightNonIndexedProgram;
 extern LLGLSLShader			gObjectFullbrightNonIndexedWaterProgram;
+extern LLGLSLShader			gObjectEmissiveNonIndexedProgram;
+extern LLGLSLShader			gObjectEmissiveNonIndexedWaterProgram;
 extern LLGLSLShader			gObjectBumpProgram;
 extern LLGLSLShader			gTreeProgram;
 extern LLGLSLShader			gTreeWaterProgram;
@@ -328,11 +321,13 @@ extern LLGLSLShader			gObjectShinyNonIndexedWaterProgram;
 
 extern LLGLSLShader			gSkinnedObjectSimpleProgram;
 extern LLGLSLShader			gSkinnedObjectFullbrightProgram;
+extern LLGLSLShader			gSkinnedObjectEmissiveProgram;
 extern LLGLSLShader			gSkinnedObjectFullbrightShinyProgram;
 extern LLGLSLShader			gSkinnedObjectShinySimpleProgram;
 
 extern LLGLSLShader			gSkinnedObjectSimpleWaterProgram;
 extern LLGLSLShader			gSkinnedObjectFullbrightWaterProgram;
+extern LLGLSLShader			gSkinnedObjectEmissiveWaterProgram;
 extern LLGLSLShader			gSkinnedObjectFullbrightShinyWaterProgram;
 extern LLGLSLShader			gSkinnedObjectShinySimpleWaterProgram;
 
@@ -368,6 +363,7 @@ extern LLGLSLShader			gDeferredWaterProgram;
 extern LLGLSLShader			gDeferredDiffuseProgram;
 extern LLGLSLShader			gDeferredDiffuseAlphaMaskProgram;
 extern LLGLSLShader			gDeferredNonIndexedDiffuseAlphaMaskProgram;
+extern LLGLSLShader			gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
 extern LLGLSLShader			gDeferredNonIndexedDiffuseProgram;
 extern LLGLSLShader			gDeferredSkinnedDiffuseProgram;
 extern LLGLSLShader			gDeferredSkinnedBumpProgram;
@@ -375,6 +371,7 @@ extern LLGLSLShader			gDeferredSkinnedAlphaProgram;
 extern LLGLSLShader			gDeferredBumpProgram;
 extern LLGLSLShader			gDeferredTerrainProgram;
 extern LLGLSLShader			gDeferredTreeProgram;
+extern LLGLSLShader			gDeferredTreeShadowProgram;
 extern LLGLSLShader			gDeferredLightProgram;
 extern LLGLSLShader			gDeferredMultiLightProgram;
 extern LLGLSLShader			gDeferredSpotLightProgram;
@@ -394,6 +391,7 @@ extern LLGLSLShader			gDeferredAvatarShadowProgram;
 extern LLGLSLShader			gDeferredAttachmentShadowProgram;
 extern LLGLSLShader			gDeferredAlphaProgram;
 extern LLGLSLShader			gDeferredFullbrightProgram;
+extern LLGLSLShader			gDeferredEmissiveProgram;
 extern LLGLSLShader			gDeferredAvatarEyesProgram;
 extern LLGLSLShader			gDeferredAvatarAlphaProgram;
 extern LLGLSLShader			gDeferredWLSkyProgram;
@@ -401,8 +399,5 @@ extern LLGLSLShader			gDeferredWLCloudProgram;
 extern LLGLSLShader			gDeferredStarProgram;
 extern LLGLSLShader			gLuminanceGatherProgram;
 
-//current avatar shader parameter pointer
-extern GLint				gAvatarMatrixParam;
-
 
 #endif
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 36d8d6a39bd..9f66c074fd2 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1720,10 +1720,7 @@ void LLViewerWindow::initGLDefaults()
 	glCullFace(GL_BACK);
 
 	// RN: Need this for translation and stretch manip.
-	gCone.prerender();
 	gBox.prerender();
-	gSphere.prerender();
-	gCylinder.prerender();
 }
 
 struct MainPanel : public LLPanel
@@ -2233,6 +2230,10 @@ void LLViewerWindow::drawDebugText()
 	gGL.color4f(1,1,1,1);
 	gGL.pushMatrix();
 	gGL.pushUIMatrix();
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
 	{
 		// scale view by UI global scale factor and aspect ratio correction factor
 		gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f);
@@ -2242,6 +2243,10 @@ void LLViewerWindow::drawDebugText()
 	gGL.popMatrix();
 
 	gGL.flush();
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.unbind();
+	}
 }
 
 void LLViewerWindow::draw()
@@ -3441,26 +3446,26 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 					if (drawable && drawable->isLight())
 					{
 						LLVOVolume* vovolume = drawable->getVOVolume();
-						glPushMatrix();
+						gGL.pushMatrix();
 
 						LLVector3 center = drawable->getPositionAgent();
-						glTranslatef(center[0], center[1], center[2]);
+						gGL.translatef(center[0], center[1], center[2]);
 						F32 scale = vovolume->getLightRadius();
-						glScalef(scale, scale, scale);
+						gGL.scalef(scale, scale, scale);
 
 						LLColor4 color(vovolume->getLightColor(), .5f);
-						gGL.diffuseColor4fv(color.mV);
+						gGL.color4fv(color.mV);
 					
 						F32 pixel_area = 100000.f;
 						// Render Outside
-						gSphere.render(pixel_area);
+						gSphere.render();
 
 						// Render Inside
 						glCullFace(GL_FRONT);
-						gSphere.render(pixel_area);
+						gSphere.render();
 						glCullFace(GL_BACK);
 					
-						glPopMatrix();
+						gGL.popMatrix();
 					}
 					return true;
 				}
@@ -4635,10 +4640,7 @@ void LLViewerWindow::stopGL(BOOL save_state)
 			gPipeline.destroyGL();
 		}
 		
-		gCone.cleanupGL();
 		gBox.cleanupGL();
-		gSphere.cleanupGL();
-		gCylinder.cleanupGL();
 		
 		if(gPostProcess)
 		{
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 0b746c841cd..7e00350926b 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -112,20 +112,6 @@ class LLVertexBufferTerrain : public LLVertexBuffer
 			glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
 		}
 		
-		if (data_mask & MAP_WEIGHT)
-		{
-			glVertexAttribPointerARB(1, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], (void*)(base + mOffsets[TYPE_WEIGHT]));
-		}
-
-		if (data_mask & MAP_WEIGHT4 && sWeight4Loc != -1)
-		{
-			glVertexAttribPointerARB(sWeight4Loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], (void*)(base+mOffsets[TYPE_WEIGHT4]));
-		}
-
-		if (data_mask & MAP_CLOTHWEIGHT)
-		{
-			glVertexAttribPointerARB(4, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
-		}
 		if (data_mask & MAP_VERTEX)
 		{
 			glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 02d914a8124..22fba90f65b 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -91,8 +91,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const
 			val.mV[1] = F32(i->second[1].asReal()) + mCloudScrollYOffset;
 			val.mV[2] = (F32) i->second[2].asReal();
 			val.mV[3] = (F32) i->second[3].asReal();
-			
-			shader->uniform4fv(param, 1, val.mV);	
+			stop_glerror();
+			shader->uniform4fv(param, 1, val.mV);
+			stop_glerror();
 		} 
 		else // param is the uniform name
 		{
@@ -118,8 +119,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const
 			{
 				val.mV[0] = i->second.asBoolean();
 			}
-			
+			stop_glerror();
 			shader->uniform4fv(param, 1, val.mV);
+			stop_glerror();
 		}
 	}
 }
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d2960816125..f6d021fda8a 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -458,7 +458,7 @@ void LLPipeline::init()
 	}
 
 	mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0);
-	mDeferredVB->allocateBuffer(3, 0, true);
+	mDeferredVB->allocateBuffer(8, 0, true);
 	setLightingDetail(-1);
 }
 
@@ -3494,7 +3494,7 @@ void LLPipeline::renderHighlights()
 	if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
 	{
 		gHighlightProgram.bind();
-		gHighlightProgram.vertexAttrib4f(LLViewerShaderMgr::MATERIAL_COLOR,1,1,1,0.5f);
+		gHighlightProgram.uniform4f("highlight_color",1,1,1,0.5f);
 	}
 	
 	if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
@@ -3526,7 +3526,7 @@ void LLPipeline::renderHighlights()
 		color.setVec(1.f, 0.f, 0.f, 0.5f);
 		if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
 		{
-			gHighlightProgram.vertexAttrib4f(LLViewerShaderMgr::MATERIAL_COLOR,1,0,0,0.5f);
+			gHighlightProgram.uniform4f("highlight_color",1,0,0,0.5f);
 		}
 		int count = mHighlightFaces.size();
 		for (S32 i = 0; i < count; i++)
@@ -7021,7 +7021,7 @@ void LLPipeline::renderDeferredLighting()
 			LLVector4 dir(mSunDir, 0.f);
 			glh::vec4f tc(dir.mV);
 			mat.mult_matrix_vec(tc);
-			mTransformedSunDir.set(dir.mV);
+			mTransformedSunDir.set(tc.v);
 		}
 
 		glPushMatrix();
@@ -7036,7 +7036,7 @@ void LLPipeline::renderDeferredLighting()
 			{ //paint shadow/SSAO light map (direct lighting lightmap)
 				LLFastTimer ftm(FTM_SUN_SHADOW);
 				bindDeferredShader(gDeferredSunProgram, 0);
-
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 				glClearColor(1,1,1,1);
 				mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT);
 				glClearColor(0,0,0,0);
@@ -7067,7 +7067,7 @@ void LLPipeline::renderDeferredLighting()
 					LLGLDisable blend(GL_BLEND);
 					LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
 					stop_glerror();
-					glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 					stop_glerror();
 				}
 				
@@ -7091,7 +7091,8 @@ void LLPipeline::renderDeferredLighting()
 					gDeferredEdgeProgram.bind();
 					mEdgeMap.bindTarget();
 					bindDeferredShader(gDeferredEdgeProgram);
-					glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 					unbindDeferredShader(gDeferredEdgeProgram);
 					mEdgeMap.flush();
 				}
@@ -7113,7 +7114,8 @@ void LLPipeline::renderDeferredLighting()
 						gLuminanceGatherProgram.uniform2f("screen_res", mDeferredLight[0].getWidth(), mDeferredLight[0].getHeight());
 						mLuminanceMap.bindTarget();
 						bindDeferredShader(gLuminanceGatherProgram);
-						glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+						mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 						unbindDeferredShader(gLuminanceGatherProgram);
 						mLuminanceMap.flush();
 						gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLuminanceMap.getTexture(), true);
@@ -7131,7 +7133,8 @@ void LLPipeline::renderDeferredLighting()
 					mGIMapPost[0].bindTarget();
 
 					bindDeferredShader(gDeferredGIProgram, 0, &mGIMap, 0, mTrueNoiseMap);
-					glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 					unbindDeferredShader(gDeferredGIProgram);
 					mGIMapPost[0].flush();
 				}
@@ -7156,7 +7159,8 @@ void LLPipeline::renderDeferredLighting()
 						LLGLDisable blend(GL_BLEND);
 						LLGLDepthTest depth(GL_FALSE);
 						stop_glerror();
-						glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+						mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 						stop_glerror();
 					}
 					
@@ -7171,7 +7175,8 @@ void LLPipeline::renderDeferredLighting()
 						LLGLDisable blend(GL_BLEND);
 						LLGLDepthTest depth(GL_FALSE);
 						stop_glerror();
-						glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+						mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 						stop_glerror();
 					}
 					mGIMapPost[0].flush();
@@ -7185,13 +7190,12 @@ void LLPipeline::renderDeferredLighting()
 			LLFastTimer ftm(FTM_SOFTEN_SHADOW);
 			//blur lightmap
 			mDeferredLight[1].bindTarget();
-
 			glClearColor(1,1,1,1);
 			mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT);
 			glClearColor(0,0,0,0);
 			
 			bindDeferredShader(gDeferredBlurLightProgram);
-
+			mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 			LLVector3 go = gSavedSettings.getVector3("RenderShadowGaussian");
 			const U32 kern_length = 4;
 			F32 blur_size = gSavedSettings.getF32("RenderShadowBlurSize");
@@ -7219,7 +7223,7 @@ void LLPipeline::renderDeferredLighting()
 				LLGLDisable blend(GL_BLEND);
 				LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
 				stop_glerror();
-				glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 				stop_glerror();
 			}
 			
@@ -7227,6 +7231,7 @@ void LLPipeline::renderDeferredLighting()
 			unbindDeferredShader(gDeferredBlurLightProgram);
 
 			bindDeferredShader(gDeferredBlurLightProgram, 1);
+			mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 			mDeferredLight[0].bindTarget();
 
 			gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f);
@@ -7235,7 +7240,7 @@ void LLPipeline::renderDeferredLighting()
 				LLGLDisable blend(GL_BLEND);
 				LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
 				stop_glerror();
-				glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 				stop_glerror();
 			}
 			mDeferredLight[0].flush();
@@ -7338,12 +7343,12 @@ void LLPipeline::renderDeferredLighting()
 			std::list<LLVector4> light_colors;
 
 			LLVertexBuffer::unbind();
+			LLVector4a* v = (LLVector4a*) vert.get();
 
-			F32 v[24];
-			glVertexPointer(3, GL_FLOAT, 0, v);
-			
 			{
 				bindDeferredShader(gDeferredLightProgram);
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+
 				LLGLDepthTest depth(GL_TRUE, GL_FALSE);
 				for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter)
 				{
@@ -7398,15 +7403,15 @@ void LLPipeline::renderDeferredLighting()
 					//correspond to their axis facing, with bit position 3,2,1 matching
 					//axis facing x,y,z, bit set meaning positive facing, bit clear 
 					//meaning negative facing
-					v[0] = c[0]-s; v[1]  = c[1]-s; v[2]  = c[2]-s;  // 0 - 0000 
-					v[3] = c[0]-s; v[4]  = c[1]-s; v[5]  = c[2]+s;  // 1 - 0001
-					v[6] = c[0]-s; v[7]  = c[1]+s; v[8]  = c[2]-s;  // 2 - 0010
-					v[9] = c[0]-s; v[10] = c[1]+s; v[11] = c[2]+s;  // 3 - 0011
+					v[0].set(c[0]-s,c[1]-s,c[2]-s);  // 0 - 0000 
+					v[1].set(c[0]-s,c[1]-s,c[2]+s);  // 1 - 0001
+					v[2].set(c[0]-s,c[1]+s,c[2]-s);  // 2 - 0010
+					v[3].set(c[0]-s,c[1]+s,c[2]+s);  // 3 - 0011
 																									   
-					v[12] = c[0]+s; v[13] = c[1]-s; v[14] = c[2]-s; // 4 - 0100
-					v[15] = c[0]+s; v[16] = c[1]-s; v[17] = c[2]+s; // 5 - 0101
-					v[18] = c[0]+s; v[19] = c[1]+s; v[20] = c[2]-s; // 6 - 0110
-					v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111
+					v[4].set(c[0]+s,c[1]-s,c[2]-s); // 4 - 0100
+					v[5].set(c[0]+s,c[1]-s,c[2]+s); // 5 - 0101
+					v[6].set(c[0]+s,c[1]+s,c[2]-s); // 6 - 0110
+					v[7].set(c[0]+s,c[1]+s,c[2]+s); // 7 - 0111
 
 					if (camera->getOrigin().mV[0] > c[0] + s + 0.2f ||
 						camera->getOrigin().mV[0] < c[0] - s - 0.2f ||
@@ -7425,8 +7430,12 @@ void LLPipeline::renderDeferredLighting()
 							}
 							
 							LLFastTimer ftm(FTM_LOCAL_LIGHTS);
-							glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-							gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
+							//glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
+							gDeferredLightProgram.uniform3fv("center", 1, tc.v);
+							gDeferredLightProgram.uniform1f("size", s*s);
+							gDeferredLightProgram.uniform3fv("color", 1, col.mV);
+							gDeferredLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
+							//gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
 							glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 								GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 							stop_glerror();
@@ -7453,6 +7462,8 @@ void LLPipeline::renderDeferredLighting()
 				LLGLDepthTest depth(GL_TRUE, GL_FALSE);
 				bindDeferredShader(gDeferredSpotLightProgram);
 
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+
 				gDeferredSpotLightProgram.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
 
 				for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter)
@@ -7481,18 +7492,20 @@ void LLPipeline::renderDeferredLighting()
 					//correspond to their axis facing, with bit position 3,2,1 matching
 					//axis facing x,y,z, bit set meaning positive facing, bit clear 
 					//meaning negative facing
-					v[0] = c[0]-s; v[1]  = c[1]-s; v[2]  = c[2]-s;  // 0 - 0000 
-					v[3] = c[0]-s; v[4]  = c[1]-s; v[5]  = c[2]+s;  // 1 - 0001
-					v[6] = c[0]-s; v[7]  = c[1]+s; v[8]  = c[2]-s;  // 2 - 0010
-					v[9] = c[0]-s; v[10] = c[1]+s; v[11] = c[2]+s;  // 3 - 0011
+					v[0].set(c[0]-s,c[1]-s,c[2]-s);  // 0 - 0000 
+					v[1].set(c[0]-s,c[1]-s,c[2]+s);  // 1 - 0001
+					v[2].set(c[0]-s,c[1]+s,c[2]-s);  // 2 - 0010
+					v[3].set(c[0]-s,c[1]+s,c[2]+s);  // 3 - 0011
 																									   
-					v[12] = c[0]+s; v[13] = c[1]-s; v[14] = c[2]-s; // 4 - 0100
-					v[15] = c[0]+s; v[16] = c[1]-s; v[17] = c[2]+s; // 5 - 0101
-					v[18] = c[0]+s; v[19] = c[1]+s; v[20] = c[2]-s; // 6 - 0110
-					v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111
-
-					glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-					gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
+					v[4].set(c[0]+s,c[1]-s,c[2]-s); // 4 - 0100
+					v[5].set(c[0]+s,c[1]-s,c[2]+s); // 5 - 0101
+					v[6].set(c[0]+s,c[1]+s,c[2]-s); // 6 - 0110
+					v[7].set(c[0]+s,c[1]+s,c[2]+s); // 7 - 0111
+					
+					gDeferredSpotLightProgram.uniform3fv("center", 1, tc.v);
+					gDeferredSpotLightProgram.uniform1f("size", s*s);
+					gDeferredSpotLightProgram.uniform3fv("color", 1, col.mV);
+					gDeferredSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
 					glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 							GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 				}
@@ -7500,6 +7513,11 @@ void LLPipeline::renderDeferredLighting()
 				unbindDeferredShader(gDeferredSpotLightProgram);
 			}
 
+			//reset mDeferredVB to fullscreen triangle
+			vert[0].set(-1,1,0);
+			vert[1].set(-1,-3,0);
+			vert[2].set(3,1,0);
+
 			{
 				bindDeferredShader(gDeferredMultiLightProgram);
 			
@@ -7554,6 +7572,8 @@ void LLPipeline::renderDeferredLighting()
 
 				gDeferredMultiSpotLightProgram.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
 
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
+
 				for (LLDrawable::drawable_list_t::iterator iter = fullscreen_spot_lights.begin(); iter != fullscreen_spot_lights.end(); ++iter)
 				{
 					LLFastTimer ftm(FTM_PROJECTORS);
@@ -7575,9 +7595,11 @@ void LLPipeline::renderDeferredLighting()
 					LLColor3 col = volume->getLightColor();
 					col *= volume->getLightIntensity();
 
-					glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-					gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
-					glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
+					gDeferredMultiSpotLightProgram.uniform3fv("center", 1, tc.v);
+					gDeferredMultiSpotLightProgram.uniform1f("size", s*s);
+					gDeferredMultiSpotLightProgram.uniform3fv("color", 1, col.mV);
+					gDeferredMultiSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
+					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 				}
 
 				gDeferredMultiSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
@@ -7610,7 +7632,7 @@ void LLPipeline::renderDeferredLighting()
 				bindDeferredShader(gDeferredPostProgram, 0, &mGIMapPost[0]);
 
 				gDeferredPostProgram.bind();
-
+				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 				LLVertexBuffer::unbind();
 
 //				glVertexPointer(2, GL_FLOAT, 0, vert);
@@ -7622,8 +7644,8 @@ void LLPipeline::renderDeferredLighting()
 				glPushMatrix();
 				glLoadIdentity();
 
-				glDrawArrays(GL_TRIANGLES, 0, 3);
-
+				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
+				
 				glPopMatrix();
 				glMatrixMode(GL_MODELVIEW);
 				glPopMatrix();
@@ -8294,12 +8316,14 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 		gDeferredShadowAlphaMaskProgram.bind();
 		gDeferredShadowAlphaMaskProgram.setAlphaRange(0.6f, 1.f);
 		renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE);
-		gGL.diffuseColor4f(1,1,1,1);
+		gDeferredTreeShadowProgram.bind();
+		gDeferredTreeShadowProgram.setAlphaRange(0.6f, 1.f);
 		renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE);
 	}
 
 	//glCullFace(GL_BACK);
 
+	gDeferredShadowProgram.bind();
 	gGLLastMatrix = NULL;
 	glLoadMatrixd(gGLModelView);
 	doOcclusion(shadow_cam);
@@ -9676,6 +9700,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 
 		static const F32 clip_plane = 0.99999f;
 
+		if (LLGLSLShader::sNoFixedFunction)
+		{
+			gUIProgram.bind();
+		}
+
 		gGL.color4ub(64,64,64,255);
 		gGL.begin(LLRender::QUADS);
 		gGL.vertex3f(-1, -1, clip_plane);
@@ -9685,6 +9714,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 		gGL.end();
 		gGL.flush();
 
+		if (LLGLSLShader::sNoFixedFunction)
+		{
+			gUIProgram.unbind();
+		}
+
 		glPopMatrix();
 		glMatrixMode(GL_MODELVIEW);
 		glPopMatrix();
-- 
GitLab


From 5e87957e053268031d1bd880b7f8e6f713394c5e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 10 Aug 2011 13:02:14 -0500
Subject: [PATCH 004/933] Remove zip file that was accidentally added

---
 .../app_settings/shaders/class1/objects.zip      | Bin 6772 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 indra/newview/app_settings/shaders/class1/objects.zip

diff --git a/indra/newview/app_settings/shaders/class1/objects.zip b/indra/newview/app_settings/shaders/class1/objects.zip
deleted file mode 100644
index 7e436607317a21f68029c4afd49079c1d9580c71..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 6772
zcmaJ`2RzjO|Cc?Y%U)UGkR6dN7iZ5BIjfB0PWH$QXD2QrWRL8uD3wjwBQlPxtgJ7x
z()fSW_xnFdzq`lV=RS|e`~7^p=JWk}z38ap;gjMVepI~n<bMA6_YX1fyklu+b<5R7
zNC((O4ZIWo+~vUd!+HRC(>#TPLwRJEr5n;wS<nXIf^h5VR%=$ECYW+t*B`$c%Q@Dr
zp@XlaV9QG^I1&DK<O2zwM3V5n$W<SYiwOy|W2=`Jq~T~b^T6IV(P=|7aeH0oPJP;$
z{h|q-i2-%w_`~wLRreg<Sk-;c=7U0de&2@+71R6js@fV*J%vSk`^QhqhORY#tfX-l
zbAJs^GFvyG5SDz|s)mt@IO}I_J+dTtnv*sZRvkfc$K%H40@Ho<g|9m>zc42{vea}*
zxAp>;C(#tv`gJ?CCQ|NxS$N2`AaqSErSn;eSrqjdCyM%ih<>-grGh;CcYx*wCs^S6
zPYWQs8UYJ{2&Y_jd3SUmyHnhz`05Hg#DORlPP((<-JDSx?j0-K$}Juqm62?@HAz3x
z?-Yv|!?V|=Is4XU9gClOZ&FusnaWR}dK{`Uya5ZHX{Hm?o1ku8C73Hr2FWSr%MVDM
zJ?P~Rzh+zzUOuE0w6>|{TNM9Hk#RvfK~bCSl=ZVuOUPapyoz`6(U|C)8B%_eWd02n
zyzZKy$C~`hIhVp^n_pQa?Bsgh7bUWwemksgH&7po`+b5ITqUF4=~C78S#bm<K&74l
zAJ1pqCc~OQ*<etP<pMf95HP_rV9_550&6z}!qORTW9#~FDBLe6ZBhV1>~}9z6QfP0
z378Z~Zjc22VAI|0L2Yw*h;X3&wFOmUxx1;i=0%Ko@eMr1_=D%qJ8vP<x8b+ApxPW7
zf<9on#TAWb5-UpIvIpoeGLt1%kgLs~xrBBE+A|iDsF=u!aWq>WjCNkLtf+*$Kbk7K
zooG$$e?wr!coFA!xdYlWzJ~+ywgKzhiE``P!X3PR3GaKd@TshztTh<z`^fQDDCh^Q
zHwPN;@W`wAof>;a(`yTMG40q$o0~NY$uR#LMkJdl=VKr5sR{P=Ct2H%gjPT4pj(!i
z<hObh5xsQPbVUjM<Epk?d4B*-pSVv-eg_Da+tSsOH|hXcqj@Q&<k@VQ@V$W!tHX=9
zZ*l?P>zuJb=*{Ee;Bfw32Yq|EgM-!WUjgZh#vBG@$kUW3k0MPuMM^esOv5s$$pXO!
zq#PVh7d2HRURrtF#6+yGt>kSew3;A9FHXvDtvgh|qvn84dumWNYC#3=6r`!W^5x1c
zW8S_1=b~a^TwEH^5qAPb;=6Bs%@{t{6{R@0RxUhox<@rWe~M7xjU~D<iPBeSHSM8-
zRe5KldrPm0K1o*0Ov})i7T6X#;u&pu1`4xRkFJt}Svu1Xp)jGO6GK~Mq&1h^ZAh)&
zj17uVY1Y)T(SZBC2T4dxrxyKTq5UCfZMs^>We%U0JdZO8yyq#;Hx3xw%(LvtiHh!%
zG~xW#>fEZJu%qatZC%%4vcY?%@%mdc=Nr)UJzaau7s=7$f{aX>He|&c)2|rJdhsd)
z^Tp1hkN4Z`*@8@qHdF>Jh&-Ot+afzczsBx!Pg@hF2pk|7qb<45Jwy2I-K^b8jH@h=
zM?I3gE&WaA^!W3MI}4d}eYSIi#&+*qPp8WWP-Dz8cwtQ49*eWqru6d%R#Q)&Wo4Fz
z<mCtI(th#sNn`B?V_kZfPDB010qTHDuL3UpA7S|~x#&!&H49VMIizvWDb<P&YY{Z+
z>4e}lhG(oOL+m`p&b>v)=2WKct)=DI>uzw%PfqTmB_rq`?74;GdK!^!l$MW;JR$FJ
z7cU7u3z2SJWFd<oT)SORsy5hG9kaZ`uPUewQL*w4KGT;q79LyEA}>P`&R`R@N>l0;
z8#&YF5I>4kxMk5KOTEB6mn~|m+m4}a<GuB)MQ=#}yc2k#Fho?A8{rZ+{m8e1ExM#9
z_cG}-R0u)5=W@1ZTc;vO&#nPCy+%Lec}$M_Gs5z$oz8JPM85RB3#@aW>rz}dk|v$+
z5joZo`7>zXi9QmG`<Qu6!9s~q5;@i!oL);!xu4eC*A+joocJ-m>YTYfIgCFOwpl?-
z>y1QzukQI?Ny+#kG(^l_G=<x5YVyIl`Zki*SXJ8a%93C|tGCuQvQ$Gq&hj2F=qTL*
z;qP7u!Bm(f0|_+-ERMe?mZ62KmGdu#xPM=SEKr9UwXpW|c{7uNMs98<7bviyAjFo^
z+jP5WnQ<M?-tXT_M}8l<;8@q3sC*Vz`8jd~bSYbet`jN2ES<1qKz`dp)&6l3!-KhR
z$S*7Oiy%XzYSTiWs)XB;`c~JX2-GzLiJV=AVNu@w;q`@q;^F7T6RANsYqG=g9RprA
za35=UXJ`%4^gNmAg#<Q;XVc7sUa}8Z&8h&(Fw;<e<N?IjV<5g*PuA==w$Rm72iQW^
z!@rgJF4R&!i&lnOk%Tt*dSpUi7_>GiuP9}rVsx--#^1wT$$;mP654CMJEf+wnFp8f
ztVsz9a>G!sH0rIy&IXJJHR>GGsfTWWQ@)<?ro?4wGGaFS{8H8GG~YpR!P1U7pFs#I
zOIc3xox6@jdkxRrp9E&}m8-YL^jE&)z)Mr}Lz2N9By918g3fKafb2@uEl}4byidO=
zhOQDjSM3%_d_<O^RIj~wpGOSse@;`Nqxe?N$VReCfLvOP*8Y9_+%oPm#Qve|8zDy$
za`Ov8m4l4B(qhhw#pvr*W1d}7#k1%8BFDay45%?}CH3eC68MSjeAJ{?{mM{N%Xv)!
z3K_`lrKkAx?H<0VDDKs?oc+vjrx>cn@HgxE8o7Ai9ZO1znr~_Cvp6+m5FEs{`oesY
zeO<xzRc13SwpLUE&)`k_W_H`Ry`9L#C6a09K3NmQN+)hDH!iX5Y%!{*YHK7P`077l
zf)><|NML<-$O)-nt^*>#XUV`i`HKBT2UZUh51obT9W^Tt<$zOY>L`{`$5|?tO)1_z
z8~aFW;NFtfqluOrz*!O^9G|OSt^2N|h^fYDeTIeO*CN8?@QZ>l0(=!8RRb!){0%oe
z#keLDc;0Wvbbb=;bP%+K6wyvo1s5h;2cf^aTtV}d#Mv?I*1j!x?x9k>eF~q9sYb^H
zF4l|aXHN-bneUuj6H%e+9ZHNC7*usYv^x(9gav6`rFpH5HeK3$3i6h3pj&+3RpH<L
zL53A?m>A&#9zltbELF3I>Pu`DMtse&hgEJHGc&#-8r!E*aT#=Pjt~}?l5Q`GER`qk
zGn8m*D@nT1cCOjQ(gex*G^AISd>&p<H+1HA<N3=M;D!N#{`Y(SNEZ77S==NHLfNbv
zj_c%fn@2=uP(Q|RoG6F9ZV9>=&siO|H!1$9uYHbu-S>g^1ylg(a006D1BBw<#N}1Z
ztg@ub;hSj}byxPFas%%%4)Dt@u3)NUFPKo?W@>U8JcDhGuXQ0yC4Jmh0cTNK?!H0E
z$J^^;?CPC%+e(5VzDDda=9`IrO~*>C@&Nt;UqFRCU{M{(Sr=@9V%7cnu)4yZ8uN`1
z2;?;MY*g04y&gCv4efi~*;E_*5=1idGNqm)W+#QAjWH;Ius0ede7$(WYJp4bK@eEN
zFGjhxu;@Xw5<-eksl0cq`FdWyZIT>yOFb6@*u9*g1s7N0=9Y`pbFza%i*2}j^0#Xh
zc??Z-mzF!ue8(F6kYUWp`njrrNY%i@!C^Zttv(#-h_L#-Akov*o)rekO4K)nvOGpG
zHVF=}^r^j!aL<kJ2*tT}g*bCc19R$4DT2-z^dq$#re6o4s9xw!S&-;ip(g0O(dehG
zi(Bbpu&lpAN2zs3mv@nSNW)n5w6@)6OQho^kEqDUzE79avn?vc2;-zf-=9{$q&#%b
z5^T;(yM_K{n6;VPEJCV78$!Ku`}4%Tky}~umMa9h-IDC`BUdnJ)Wd<iC$}=-1>N&L
z6UMexUAvXi_hCAFvv-knF2Xzr14XxD0ja@H>x^MzH4YED8_vNd0~}M{_h=NY#5qj2
zgxUE<Ml6ipx<pJ<Rc2;3OdiH)wE0QFgAGi)OH^|4c~&X!)wn_Wa!GaqU9dTG@uuA~
zKVrtZXMG}0rUP*sG2rq$r{r_W;#oZ7)hpzB<mV0Y8;Pb!m}BYcy$^!!%i`(J4Dc1`
z*0IMS;_SXsk-u$ZC}u3t^w2e<l*e^|vsJJ3bI7#nNokDV{efIsv&jvn{Z1q4#p6*V
zWwQ5uo%<I1i*w{?Z&}rw2kpK~PwlJqTbB8Hvy1$dFAQ_i)KjsD!h^F$Z)L*?eVD%~
zS6Y~4W1g%qU_E}wPso|ODpG*QiGVxhkNEtLn#|OJN~JYDMLRZ>9hPMO4KFY|<1|qq
z73*yw4!v5;+LeT;6ht*u{YweBA%WT0$8i_GT~19(-rF4Od<JZ*gl;dB-*@oQzLvY&
zL|KJWfhA!`+iPh_JA^7%<~7{1zXtq6lJhB*5e5AMo{cwvvbQu&87H9l)+gSNOb`;Q
zGqGm8Lg$-BT@6*1uM$opDIdPUFs7Dfs;+b+J8e4{c~6QZQs``MLG~5Q2Pg&O*`ZIf
z!RQyogi2k5P{_TSiwQO&HxsSN?OIn8QRflQr6Y?1Hoy02di${Wp_<O`jk`QQovFAn
zl<lwm(f3`RtULM0OSbHZaUP|vId93$GBc=7d5;-Et~3g~IW9p@|Fo~`e&+Vgot}9u
zNAJK=s-kdzyRNwQR<Q#Z@)H4#TbOfC^Mi{U0xiebOiDt%Cm2Yo8ekp03Vu?-5h8Q@
zMP$l<5E=gK93mS&Ra@Q}|KS@%bi)9TJ&C`ffb#CVLNC4ZZj_TWH2xva9khkh4B0+Z
z<<3FL9OxZ{TWq=Z1HYAWcY~N7$Rlwkdyy3^#0bI(Nqg#&OXCi+TpttJ?XcU;m1wRj
z2C<awdH5VBF}Yeag&!bw0k9572>*=~Tz)dbuObQ=39y(jD8Oc&*MVoiTDbM94yo25
ziIpXKI%=v@Uf`&E`OQem^_yRn9&!FZ2qWV25~+Pw3!EJaDzOuLigE)(m>t{8EuYz`
z3Vn@Oszr+mZSLxWhE*>K+}((R;9Z$?zAtXHg?6QL?``=o*Ggjjj(*4M-an{r<Ih3z
z*r2`#(AZWhc%%>rY6gJDnEsIW7=r=bgfPgj+7HFDY3^Mxi$uxBHHH{j#2~CL+!JZj
znJaQh;U`dCLPvk!{m_0*pJ(t)_1Zz*!J6yBRhT-v{r)r~`P+cm_YJ%CwgR7*t%Vyw
z?LG_DL=T#|JM;`UH8FM4Np8~Xjcu$MUlD?dw%%o%O!yJo)`IdkCmcT^!Wj_(3<P9~
zz2uAf1@Zmrmmtz{!LQ<P(#?ye7H^$D_ppm$fwjkwPhmmBjoX2Fr+xYsGi=16A)DeM
z*%%p}a8_kHg~EVttNvw$uXneJTz#I8<r-cx(T_({Kg8tsCB*LuMYM8QCx7}v?5%rx
zewS-Sdco&M<u|U$PLeR`GZ$!N*BD9|V5=G}#mHU=d&D5_Yo1k<a)qm?*$b8~#_7r1
z+8-dXoZ1lvT<qei!v${&M_C;n67}-kj}dzyCUUwQTBo*0M;dQ2MUsfTT$<)`X>Lj&
zjzK2Vbgy$&f7M3%@<5iPU|ez9ntaiGfr6A%=!Da*6~@3Mu+L>3u~I?iPok}1`qg!v
zY~8kxS^IqPL+vl^rV;`vn(hvgyLQm!EXZ20pf7ms6xPLuyj9Crl&A){SOeg#KST0g
z;`+D6GCgdu#zfy|1y0fPwB9QVr>kH(8$JQ|VAE7XcRS3y^hTFXG!#Ad@o(QB;GB*E
zf6auDj9X4XZ)gJza%LL6P&tm(v{C$*I>@bwQ^84QHlq{qEBX5@(@astjF%}AJ~z$A
z#yPc(uteN6B{t$OACoe;26;<<rz-UyVP2#iV~~bAQfn)*EXJOpcf@p-n^UIN7-LOF
zNQTMHxI099&TiWk2kky)oDpHU)2s~t6s1$01Lhf$v>nYyr@s#G^}0;VvFW`@K4xNH
z>D4P2wvJPCv5d0Ee7V0RyC~Il#QtJMMeL6nvnWKY;Uf84@%X{Z(io|)928$Hd`0(^
zpfZ6Tb-|tHOrZMdMKh|;GgY$8cwVKkqCz*<uRScilb)20iLQYA82ejPIeVo~X?KtZ
zm(nU5SeRw`d~j;>8)g07_IDW^%MZsduYkqyM|vG)vhJTH8Nt-(0gVJTT>8-r2M+;Q
z(b0py(R8L!TtF3ZcB9^YurYV};KOV|1*Cy;Hv}c@C_$X+#`$yXl9w|YF7y%iT<TIy
zh;Nw3K%J@KkTtJap-Nu(s}aSDUdT73UKY+N^OYB^2~l;bh~QQ6ipuUdmMzQOEv?E<
zvS1?q`66vkAa+jSQsex6MhYkad_cb*|4(nfPW^pm`fEEI@Zbj4f24?=pdLSeeBy{b
z&jUpA(euCJ_vrb<m_I(Q!=AqYWWj&uj}PyTqZ}WeVNqsJL^(1_I|_Bu3=0eO1Yq7j
z1^Nl~8~q+dJXG=c2nCCHm*B66CtK_I8~_W2L-bduBf)!Aw3E7TEZ*43ct?BjqhN=6
z9&Zb=V9_Ke33sxJ$NM8JN+%HOf7<^q+8qjXyidVGMU!Enj&v<YH9DzvzyipeJ_c|?
zBXJb%P@LmsDHctT;uzY=ra4}0VF8lP90T|tRykhyU{Uk|viQ%yN6Vn2ikwu6U=i@n
z9!L0}nQ{EW!vf6%|G)WNl#@+zoVKwDmH@~7j_{jJ2nY|iQUPBXAPG5W4&VL{k;J(S

-- 
GitLab


From db92b0369194f1a81b92fd3fa72458eb0c1d2f20 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 10 Aug 2011 14:49:11 -0500
Subject: [PATCH 005/933] SH-2242 Start using "no fixed function" when
 rendering dynamic textures.

---
 indra/newview/lldynamictexture.cpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 799866091b9..4955b6224ee 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -209,10 +209,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 
 	LLGLSLShader::bindNoShader();
 	LLVertexBuffer::unbind();
-	//allow fixed function when rendering dynamic textures
-	bool no_fixed = LLGLSLShader::sNoFixedFunction;
-	LLGLSLShader::sNoFixedFunction = false;
-
+	
 	BOOL result = FALSE;
 	BOOL ret = FALSE ;
 	for( S32 order = 0; order < ORDER_COUNT; order++ )
@@ -243,7 +240,6 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		}
 	}
 
-	LLGLSLShader::sNoFixedFunction = no_fixed;
 	return ret;
 }
 
-- 
GitLab


From 364f8771ed6b7a4fabaf2ec1e547aafb8227c876 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 10 Aug 2011 15:34:48 -0500
Subject: [PATCH 006/933] Merge cleanup.

---
 .../shaders/class1/objects/impostorF.glsl     | 35 +++++++++----------
 .../shaders/class1/objects/impostorV.glsl     | 12 ++++---
 indra/newview/lldrawpoolavatar.cpp            |  9 -----
 3 files changed, 23 insertions(+), 33 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index 7257132f066..d6946d0de68 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -5,22 +5,19 @@
  * $/LicenseInfo$
  */
  
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-uniform sampler2D diffuseMap;
-
-void main()
-{
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
-	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	gl_FragColor = color;
-}
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+uniform sampler2D diffuseMap;
+
+void main()
+{
+	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy);
+	
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	gl_FragColor = color;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
index 724b86a1b72..f1c307c4591 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
@@ -5,12 +5,14 @@
  * $/LicenseInfo$
  */
  
- 
+
+
+attribute vec3 position;
+attribute vec2 texcoord0;
+
 void main()
 {
 	//transform vertex
-	gl_Position = ftransform();
-	gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-	
-	gl_FrontColor = gl_Color;
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
 }
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 082448d95c4..f0eb52909dc 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -581,11 +581,6 @@ void LLDrawPoolAvatar::beginImpostor()
 
 	gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
 	sDiffuseChannel = 0;
-
-	if (LLGLSLShader::sNoFixedFunction)
-	{
-		gUIProgram.bind();
-	}
 }
 
 void LLDrawPoolAvatar::endImpostor()
@@ -595,10 +590,6 @@ void LLDrawPoolAvatar::endImpostor()
 		gImpostorProgram.unbind();
 	}
 	gPipeline.enableLightsDynamic();
-	if (LLGLSLShader::sNoFixedFunction)
-	{
-		gUIProgram.unbind();
-	}
 }
 
 void LLDrawPoolAvatar::beginRigid()
-- 
GitLab


From 2dd8ce53e4e0d14f2bc20796eb6bdf1ef12a65df Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 11 Aug 2011 14:19:58 -0500
Subject: [PATCH 007/933] SH-2242 FXAA support instead of unreliable
 multisample textures (done here because it's a smaller change than
 integrating glVertexAttrib with FSAA pipe).  Shader integration with
 LLDynamicTexture subclasses.

---
 indra/llrender/llgl.cpp                       |    2 +
 indra/llrender/llshadermgr.cpp                |   13 +-
 .../class1/deferred/postDeferredNoDoFF.glsl   | 2086 ++++++++++++++++-
 .../class1/deferred/postDeferredV.glsl        |    5 +
 .../class1/interface/glowcombineFXAAF.glsl    |   23 +
 .../class1/interface/glowcombineFXAAV.glsl    |   19 +
 .../shaders/class1/objects/previewV.glsl      |   30 +
 indra/newview/llfloateranimpreview.cpp        |    5 +
 indra/newview/llfloaterimagepreview.cpp       |   39 +-
 indra/newview/llspatialpartition.cpp          |   21 +-
 indra/newview/lltoolmorph.cpp                 |    5 +
 indra/newview/llviewershadermgr.cpp           |   42 +
 indra/newview/llviewershadermgr.h             |    2 +
 indra/newview/pipeline.cpp                    |   58 +-
 indra/newview/pipeline.h                      |    1 +
 .../skins/default/xui/en/floater_about.xml    |   52 +-
 16 files changed, 2347 insertions(+), 56 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/previewV.glsl

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 87a6b9b8853..1a2fe0ea0e9 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -582,6 +582,8 @@ bool LLGLManager::initGL()
 		glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
 	}
 
+	//HACK always disable texture multisample, use FXAA instead
+	mHasTextureMultisample = FALSE;
 #if LL_WINDOWS
 	if (mIsATI)
 	{ //using multisample textures on ATI results in black screen for some reason
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 986c1f2774d..23344356442 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -531,9 +531,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	}
 
 	//we can't have any lines longer than 1024 characters 
-	//or any shaders longer than 1024 lines... deal - DaveP
+	//or any shaders longer than 4096 lines... deal - DaveP
 	GLcharARB buff[1024];
-	GLcharARB* text[1024];
+	GLcharARB* text[4096];
 	GLuint count = 0;
 
 	if (gGLManager.mGLVersion < 2.1f)
@@ -649,7 +649,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	}
 
 	//copy file into memory
-	while( fgets((char *)buff, 1024, file) != NULL && count < LL_ARRAY_SIZE(buff) ) 
+	while( fgets((char *)buff, 1024, file) != NULL && count < LL_ARRAY_SIZE(text) ) 
 	{
 		text[count++] = (GLcharARB *)strdup((char *)buff); 
 	}
@@ -709,6 +709,13 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 				for (GLuint i = 0; i < count; i++)
 				{
 					ostr << i << ": " << text[i];
+
+					if (i % 128 == 0)
+					{ //dump every 128 lines
+						LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
+						ostr = std::stringstream();
+					}
+
 				}
 
 				LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index bf829bfc560..4c531ed20b5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -1,24 +1,2096 @@
 /** 
- * @file postDeferredF.glsl
+ * @file postDeferredNoDoFF.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  * $/LicenseInfo$
  */
  
+#extension GL_ARB_texture_rectangle : enable
 
+#define FXAA_PC 1
+#define FXAA_GLSL_130 1
+#define FXAA_QUALITY__PRESET 12
 
-#extension GL_ARB_texture_rectangle : enable
+/*============================================================================
+
+
+                    NVIDIA FXAA 3.11 by TIMOTHY LOTTES
+
+
+------------------------------------------------------------------------------
+COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
+------------------------------------------------------------------------------
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
+OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
+CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
+LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
+OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
+THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+------------------------------------------------------------------------------
+                           INTEGRATION CHECKLIST
+------------------------------------------------------------------------------
+(1.)
+In the shader source, setup defines for the desired configuration.
+When providing multiple shaders (for different presets),
+simply setup the defines differently in multiple files.
+Example,
+
+  #define FXAA_PC 1
+  #define FXAA_HLSL_5 1
+  #define FXAA_QUALITY__PRESET 12
+
+Or,
+
+  #define FXAA_360 1
+  
+Or,
+
+  #define FXAA_PS3 1
+  
+Etc.
+
+(2.)
+Then include this file,
+
+  #include "Fxaa3_11.h"
+
+(3.)
+Then call the FXAA pixel shader from within your desired shader.
+Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
+As for FXAA 3.11 all inputs for all shaders are the same 
+to enable easy porting between platforms.
+
+  return FxaaPixelShader(...);
+
+(4.)
+Insure pass prior to FXAA outputs RGBL (see next section).
+Or use,
+
+  #define FXAA_GREEN_AS_LUMA 1
+
+(5.)
+Setup engine to provide the following constants
+which are used in the FxaaPixelShader() inputs,
+
+  FxaaFloat2 fxaaQualityRcpFrame,
+  FxaaFloat4 fxaaConsoleRcpFrameOpt,
+  FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+  FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+  FxaaFloat fxaaQualitySubpix,
+  FxaaFloat fxaaQualityEdgeThreshold,
+  FxaaFloat fxaaQualityEdgeThresholdMin,
+  FxaaFloat fxaaConsoleEdgeSharpness,
+  FxaaFloat fxaaConsoleEdgeThreshold,
+  FxaaFloat fxaaConsoleEdgeThresholdMin,
+  FxaaFloat4 fxaaConsole360ConstDir
+
+Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
+
+(6.)
+Have FXAA vertex shader run as a full screen triangle,
+and output "pos" and "fxaaConsolePosPos" 
+such that inputs in the pixel shader provide,
+
+  // {xy} = center of pixel
+  FxaaFloat2 pos,
+
+  // {xy__} = upper left of pixel
+  // {__zw} = lower right of pixel
+  FxaaFloat4 fxaaConsolePosPos,
+
+(7.)
+Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
+
+
+------------------------------------------------------------------------------
+                    INTEGRATION - RGBL AND COLORSPACE
+------------------------------------------------------------------------------
+FXAA3 requires RGBL as input unless the following is set, 
+
+  #define FXAA_GREEN_AS_LUMA 1
+
+In which case the engine uses green in place of luma,
+and requires RGB input is in a non-linear colorspace.
+
+RGB should be LDR (low dynamic range).
+Specifically do FXAA after tonemapping.
+
+RGB data as returned by a texture fetch can be non-linear,
+or linear when FXAA_GREEN_AS_LUMA is not set.
+Note an "sRGB format" texture counts as linear,
+because the result of a texture fetch is linear data.
+Regular "RGBA8" textures in the sRGB colorspace are non-linear.
+
+If FXAA_GREEN_AS_LUMA is not set,
+luma must be stored in the alpha channel prior to running FXAA.
+This luma should be in a perceptual space (could be gamma 2.0).
+Example pass before FXAA where output is gamma 2.0 encoded,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  color.rgb = sqrt(color.rgb);    // gamma 2.0 color output
+  return color;
+
+To use FXAA,
+
+  color.rgb = ToneMap(color.rgb);  // linear color output
+  color.rgb = sqrt(color.rgb);     // gamma 2.0 color output
+  color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
+  return color;
+
+Another example where output is linear encoded,
+say for instance writing to an sRGB formated render target,
+where the render target does the conversion back to sRGB after blending,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  return color;
+
+To use FXAA,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
+  return color;
+
+Getting luma correct is required for the algorithm to work correctly.
+
+
+------------------------------------------------------------------------------
+                          BEING LINEARLY CORRECT?
+------------------------------------------------------------------------------
+Applying FXAA to a framebuffer with linear RGB color will look worse.
+This is very counter intuitive, but happends to be true in this case.
+The reason is because dithering artifacts will be more visiable 
+in a linear colorspace.
+
+
+------------------------------------------------------------------------------
+                             COMPLEX INTEGRATION
+------------------------------------------------------------------------------
+Q. What if the engine is blending into RGB before wanting to run FXAA?
+
+A. In the last opaque pass prior to FXAA,
+   have the pass write out luma into alpha.
+   Then blend into RGB only.
+   FXAA should be able to run ok
+   assuming the blending pass did not any add aliasing.
+   This should be the common case for particles and common blending passes.
+
+A. Or use FXAA_GREEN_AS_LUMA.
+
+============================================================================*/
+
+/*============================================================================
+
+                             INTEGRATION KNOBS
+
+============================================================================*/
+//
+// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
+// FXAA_360_OPT is a prototype for the new optimized 360 version.
+//
+// 1 = Use API.
+// 0 = Don't use API.
+//
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_PS3
+    #define FXAA_PS3 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_360
+    #define FXAA_360 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_360_OPT
+    #define FXAA_360_OPT 0
+#endif
+/*==========================================================================*/
+#ifndef FXAA_PC
+    //
+    // FXAA Quality
+    // The high quality PC algorithm.
+    //
+    #define FXAA_PC 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_PC_CONSOLE
+    //
+    // The console algorithm for PC is included
+    // for developers targeting really low spec machines.
+    // Likely better to just run FXAA_PC, and use a really low preset.
+    //
+    #define FXAA_PC_CONSOLE 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GLSL_120
+    #define FXAA_GLSL_120 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GLSL_130
+    #define FXAA_GLSL_130 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_3
+    #define FXAA_HLSL_3 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_4
+    #define FXAA_HLSL_4 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_5
+    #define FXAA_HLSL_5 0
+#endif
+/*==========================================================================*/
+#ifndef FXAA_GREEN_AS_LUMA
+    //
+    // For those using non-linear color,
+    // and either not able to get luma in alpha, or not wanting to,
+    // this enables FXAA to run using green as a proxy for luma.
+    // So with this enabled, no need to pack luma in alpha.
+    //
+    // This will turn off AA on anything which lacks some amount of green.
+    // Pure red and blue or combination of only R and B, will get no AA.
+    //
+    // Might want to lower the settings for both,
+    //    fxaaConsoleEdgeThresholdMin
+    //    fxaaQualityEdgeThresholdMin
+    // In order to insure AA does not get turned off on colors 
+    // which contain a minor amount of green.
+    //
+    // 1 = On.
+    // 0 = Off.
+    //
+    #define FXAA_GREEN_AS_LUMA 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_EARLY_EXIT
+    //
+    // Controls algorithm's early exit path.
+    // On PS3 turning this ON adds 2 cycles to the shader.
+    // On 360 turning this OFF adds 10ths of a millisecond to the shader.
+    // Turning this off on console will result in a more blurry image.
+    // So this defaults to on.
+    //
+    // 1 = On.
+    // 0 = Off.
+    //
+    #define FXAA_EARLY_EXIT 1
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_DISCARD
+    //
+    // Only valid for PC OpenGL currently.
+    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
+    //
+    // 1 = Use discard on pixels which don't need AA.
+    //     For APIs which enable concurrent TEX+ROP from same surface.
+    // 0 = Return unchanged color on pixels which don't need AA.
+    //
+    #define FXAA_DISCARD 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_FAST_PIXEL_OFFSET
+    //
+    // Used for GLSL 120 only.
+    //
+    // 1 = GL API supports fast pixel offsets
+    // 0 = do not use fast pixel offsets
+    //
+    #ifdef GL_EXT_gpu_shader4
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifdef GL_NV_gpu_shader5
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifdef GL_ARB_gpu_shader5
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifndef FXAA_FAST_PIXEL_OFFSET
+        #define FXAA_FAST_PIXEL_OFFSET 0
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GATHER4_ALPHA
+    //
+    // 1 = API supports gather4 on alpha channel.
+    // 0 = API does not support gather4 on alpha channel.
+    //
+    #if (FXAA_HLSL_5 == 1)
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifdef GL_ARB_gpu_shader5
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifdef GL_NV_gpu_shader5
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifndef FXAA_GATHER4_ALPHA
+        #define FXAA_GATHER4_ALPHA 0
+    #endif
+#endif
+
+/*============================================================================
+                      FXAA CONSOLE PS3 - TUNING KNOBS
+============================================================================*/
+#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
+    //
+    // Consoles the sharpness of edges on PS3 only.
+    // Non-PS3 tuning is done with shader input.
+    //
+    // Due to the PS3 being ALU bound,
+    // there are only two safe values here: 4 and 8.
+    // These options use the shaders ability to a free *|/ by 2|4|8.
+    //
+    // 8.0 is sharper
+    // 4.0 is softer
+    // 2.0 is really soft (good for vector graphics inputs)
+    //
+    #if 1
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
+    #endif
+    #if 0
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
+    #endif
+    #if 0
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
+    //
+    // Only effects PS3.
+    // Non-PS3 tuning is done with shader input.
+    //
+    // The minimum amount of local contrast required to apply algorithm.
+    // The console setting has a different mapping than the quality setting.
+    //
+    // This only applies when FXAA_EARLY_EXIT is 1.
+    //
+    // Due to the PS3 being ALU bound,
+    // there are only two safe values here: 0.25 and 0.125.
+    // These options use the shaders ability to a free *|/ by 2|4|8.
+    //
+    // 0.125 leaves less aliasing, but is softer
+    // 0.25 leaves more aliasing, and is sharper
+    //
+    #if 1
+        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
+    #else
+        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
+    #endif
+#endif
+
+/*============================================================================
+                        FXAA QUALITY - TUNING KNOBS
+------------------------------------------------------------------------------
+NOTE the other tuning knobs are now in the shader function inputs!
+============================================================================*/
+#ifndef FXAA_QUALITY__PRESET
+    //
+    // Choose the quality preset.
+    // This needs to be compiled into the shader as it effects code.
+    // Best option to include multiple presets is to 
+    // in each shader define the preset, then include this file.
+    // 
+    // OPTIONS
+    // -----------------------------------------------------------------------
+    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
+    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
+    // 39       - no dither, very expensive 
+    //
+    // NOTES
+    // -----------------------------------------------------------------------
+    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
+    // 13 = about same speed as FXAA 3.9 and better than 12
+    // 23 = closest to FXAA 3.9 visually and performance wise
+    //  _ = the lowest digit is directly related to performance
+    // _  = the highest digit is directly related to style
+    // 
+    #define FXAA_QUALITY__PRESET 12
+#endif
+
+
+/*============================================================================
+
+                           FXAA QUALITY - PRESETS
+
+============================================================================*/
+
+/*============================================================================
+                     FXAA QUALITY - MEDIUM DITHER PRESETS
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 10)
+    #define FXAA_QUALITY__PS 3
+    #define FXAA_QUALITY__P0 1.5
+    #define FXAA_QUALITY__P1 3.0
+    #define FXAA_QUALITY__P2 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 11)
+    #define FXAA_QUALITY__PS 4
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 3.0
+    #define FXAA_QUALITY__P3 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 12)
+    #define FXAA_QUALITY__PS 5
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 4.0
+    #define FXAA_QUALITY__P4 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 13)
+    #define FXAA_QUALITY__PS 6
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 4.0
+    #define FXAA_QUALITY__P5 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 14)
+    #define FXAA_QUALITY__PS 7
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 4.0
+    #define FXAA_QUALITY__P6 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 15)
+    #define FXAA_QUALITY__PS 8
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 4.0
+    #define FXAA_QUALITY__P7 12.0
+#endif
+
+/*============================================================================
+                     FXAA QUALITY - LOW DITHER PRESETS
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 20)
+    #define FXAA_QUALITY__PS 3
+    #define FXAA_QUALITY__P0 1.5
+    #define FXAA_QUALITY__P1 2.0
+    #define FXAA_QUALITY__P2 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 21)
+    #define FXAA_QUALITY__PS 4
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 22)
+    #define FXAA_QUALITY__PS 5
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 23)
+    #define FXAA_QUALITY__PS 6
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 24)
+    #define FXAA_QUALITY__PS 7
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 3.0
+    #define FXAA_QUALITY__P6 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 25)
+    #define FXAA_QUALITY__PS 8
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 4.0
+    #define FXAA_QUALITY__P7 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 26)
+    #define FXAA_QUALITY__PS 9
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 4.0
+    #define FXAA_QUALITY__P8 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 27)
+    #define FXAA_QUALITY__PS 10
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 4.0
+    #define FXAA_QUALITY__P9 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 28)
+    #define FXAA_QUALITY__PS 11
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 4.0
+    #define FXAA_QUALITY__P10 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 29)
+    #define FXAA_QUALITY__PS 12
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 2.0
+    #define FXAA_QUALITY__P10 4.0
+    #define FXAA_QUALITY__P11 8.0
+#endif
 
-uniform sampler2DRect diffuseRect;
-uniform sampler2D bloomMap;
+/*============================================================================
+                     FXAA QUALITY - EXTREME QUALITY
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 39)
+    #define FXAA_QUALITY__PS 12
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.0
+    #define FXAA_QUALITY__P2 1.0
+    #define FXAA_QUALITY__P3 1.0
+    #define FXAA_QUALITY__P4 1.0
+    #define FXAA_QUALITY__P5 1.5
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 2.0
+    #define FXAA_QUALITY__P10 4.0
+    #define FXAA_QUALITY__P11 8.0
+#endif
 
+
+
+/*============================================================================
+
+                                API PORTING
+
+============================================================================*/
+#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
+    #define FxaaBool bool
+    #define FxaaDiscard discard
+    #define FxaaFloat float
+    #define FxaaFloat2 vec2
+    #define FxaaFloat3 vec3
+    #define FxaaFloat4 vec4
+    #define FxaaHalf float
+    #define FxaaHalf2 vec2
+    #define FxaaHalf3 vec3
+    #define FxaaHalf4 vec4
+    #define FxaaInt2 ivec2
+    #define FxaaSat(x) clamp(x, 0.0, 1.0)
+    #define FxaaTex sampler2D
+#else
+    #define FxaaBool bool
+    #define FxaaDiscard clip(-1)
+    #define FxaaFloat float
+    #define FxaaFloat2 float2
+    #define FxaaFloat3 float3
+    #define FxaaFloat4 float4
+    #define FxaaHalf half
+    #define FxaaHalf2 half2
+    #define FxaaHalf3 half3
+    #define FxaaHalf4 half4
+    #define FxaaSat(x) saturate(x)
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_GLSL_120 == 1)
+    // Requires,
+    //  #version 120
+    // And at least,
+    //  #extension GL_EXT_gpu_shader4 : enable
+    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
+    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
+    #if (FXAA_FAST_PIXEL_OFFSET == 1)
+        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
+    #else
+        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
+    #endif
+    #if (FXAA_GATHER4_ALPHA == 1)
+        // use #extension GL_ARB_gpu_shader5 : enable
+        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
+        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
+        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
+        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_GLSL_130 == 1)
+    // Requires "#version 130" or better
+    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
+    #if (FXAA_GATHER4_ALPHA == 1)
+        // use #extension GL_ARB_gpu_shader5 : enable
+        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
+        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
+        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
+        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
+    #define FxaaInt2 float2
+    #define FxaaTex sampler2D
+    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
+    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_4 == 1)
+    #define FxaaInt2 int2
+    struct FxaaTex { SamplerState smpl; Texture2D tex; };
+    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_5 == 1)
+    #define FxaaInt2 int2
+    struct FxaaTex { SamplerState smpl; Texture2D tex; };
+    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
+    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
+    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
+    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
+    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
+#endif
+
+
+/*============================================================================
+                   GREEN AS LUMA OPTION SUPPORT FUNCTION
+============================================================================*/
+#if (FXAA_GREEN_AS_LUMA == 0)
+    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
+#else
+    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
+#endif    
+
+
+
+
+/*============================================================================
+
+                             FXAA3 QUALITY - PC
+
+============================================================================*/
+#if (FXAA_PC == 1)
+/*--------------------------------------------------------------------------*/
+FxaaFloat4 FxaaPixelShader(
+    //
+    // Use noperspective interpolation here (turn off perspective interpolation).
+    // {xy} = center of pixel
+    FxaaFloat2 pos,
+    //
+    // Used only for FXAA Console, and not used on the 360 version.
+    // Use noperspective interpolation here (turn off perspective interpolation).
+    // {xy__} = upper left of pixel
+    // {__zw} = lower right of pixel
+    FxaaFloat4 fxaaConsolePosPos,
+    //
+    // Input color texture.
+    // {rgb_} = color in linear or perceptual color space
+    // if (FXAA_GREEN_AS_LUMA == 0)
+    //     {___a} = luma in perceptual color space (not linear)
+    FxaaTex tex,
+    //
+    // Only used on the optimized 360 version of FXAA Console.
+    // For everything but 360, just use the same input here as for "tex".
+    // For 360, same texture, just alias with a 2nd sampler.
+    // This sampler needs to have an exponent bias of -1.
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    //
+    // Only used on the optimized 360 version of FXAA Console.
+    // For everything but 360, just use the same input here as for "tex".
+    // For 360, same texture, just alias with a 3nd sampler.
+    // This sampler needs to have an exponent bias of -2.
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    //
+    // Only used on FXAA Quality.
+    // This must be from a constant/uniform.
+    // {x_} = 1.0/screenWidthInPixels
+    // {_y} = 1.0/screenHeightInPixels
+    FxaaFloat2 fxaaQualityRcpFrame,
+    //
+    // Only used on FXAA Console.
+    // This must be from a constant/uniform.
+    // This effects sub-pixel AA quality and inversely sharpness.
+    //   Where N ranges between,
+    //     N = 0.50 (default)
+    //     N = 0.33 (sharper)
+    // {x___} = -N/screenWidthInPixels  
+    // {_y__} = -N/screenHeightInPixels
+    // {__z_} =  N/screenWidthInPixels  
+    // {___w} =  N/screenHeightInPixels 
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    //
+    // Only used on FXAA Console.
+    // Not used on 360, but used on PS3 and PC.
+    // This must be from a constant/uniform.
+    // {x___} = -2.0/screenWidthInPixels  
+    // {_y__} = -2.0/screenHeightInPixels
+    // {__z_} =  2.0/screenWidthInPixels  
+    // {___w} =  2.0/screenHeightInPixels 
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    //
+    // Only used on FXAA Console.
+    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
+    // This must be from a constant/uniform.
+    // {x___} =  8.0/screenWidthInPixels  
+    // {_y__} =  8.0/screenHeightInPixels
+    // {__z_} = -4.0/screenWidthInPixels  
+    // {___w} = -4.0/screenHeightInPixels 
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__SUBPIX define.
+    // It is here now to allow easier tuning.
+    // Choose the amount of sub-pixel aliasing removal.
+    // This can effect sharpness.
+    //   1.00 - upper limit (softer)
+    //   0.75 - default amount of filtering
+    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
+    //   0.25 - almost off
+    //   0.00 - completely off
+    FxaaFloat fxaaQualitySubpix,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
+    // It is here now to allow easier tuning.
+    // The minimum amount of local contrast required to apply algorithm.
+    //   0.333 - too little (faster)
+    //   0.250 - low quality
+    //   0.166 - default
+    //   0.125 - high quality 
+    //   0.063 - overkill (slower)
+    FxaaFloat fxaaQualityEdgeThreshold,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
+    // It is here now to allow easier tuning.
+    // Trims the algorithm from processing darks.
+    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
+    //   0.0625 - high quality (faster)
+    //   0.0312 - visible limit (slower)
+    // Special notes when using FXAA_GREEN_AS_LUMA,
+    //   Likely want to set this to zero.
+    //   As colors that are mostly not-green
+    //   will appear very dark in the green channel!
+    //   Tune by looking at mostly non-green content,
+    //   then start at zero and increase until aliasing is a problem.
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    // 
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
+    // It is here now to allow easier tuning.
+    // This does not effect PS3, as this needs to be compiled in.
+    //   Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
+    //   Due to the PS3 being ALU bound,
+    //   there are only three safe values here: 2 and 4 and 8.
+    //   These options use the shaders ability to a free *|/ by 2|4|8.
+    // For all other platforms can be a non-power of two.
+    //   8.0 is sharper (default!!!)
+    //   4.0 is softer
+    //   2.0 is really soft (good only for vector graphics inputs)
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    //
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
+    // It is here now to allow easier tuning.
+    // This does not effect PS3, as this needs to be compiled in.
+    //   Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
+    //   Due to the PS3 being ALU bound,
+    //   there are only two safe values here: 1/4 and 1/8.
+    //   These options use the shaders ability to a free *|/ by 2|4|8.
+    // The console setting has a different mapping than the quality setting.
+    // Other platforms can use other values.
+    //   0.125 leaves less aliasing, but is softer (default!!!)
+    //   0.25 leaves more aliasing, and is sharper
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    //
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
+    // It is here now to allow easier tuning.
+    // Trims the algorithm from processing darks.
+    // The console setting has a different mapping than the quality setting.
+    // This only applies when FXAA_EARLY_EXIT is 1.
+    // This does not apply to PS3, 
+    // PS3 was simplified to avoid more shader instructions.
+    //   0.06 - faster but more aliasing in darks
+    //   0.05 - default
+    //   0.04 - slower and less aliasing in darks
+    // Special notes when using FXAA_GREEN_AS_LUMA,
+    //   Likely want to set this to zero.
+    //   As colors that are mostly not-green
+    //   will appear very dark in the green channel!
+    //   Tune by looking at mostly non-green content,
+    //   then start at zero and increase until aliasing is a problem.
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    //    
+    // Extra constants for 360 FXAA Console only.
+    // Use zeros or anything else for other platforms.
+    // These must be in physical constant registers and NOT immedates.
+    // Immedates will result in compiler un-optimizing.
+    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posM;
+    posM.x = pos.x;
+    posM.y = pos.y;
+    #if (FXAA_GATHER4_ALPHA == 1)
+        #if (FXAA_DISCARD == 0)
+            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
+            #if (FXAA_GREEN_AS_LUMA == 0)
+                #define lumaM rgbyM.w
+            #else
+                #define lumaM rgbyM.y
+            #endif
+        #endif
+        #if (FXAA_GREEN_AS_LUMA == 0)
+            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
+            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
+        #else
+            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
+            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
+        #endif
+        #if (FXAA_DISCARD == 1)
+            #define lumaM luma4A.w
+        #endif
+        #define lumaE luma4A.z
+        #define lumaS luma4A.x
+        #define lumaSE luma4A.y
+        #define lumaNW luma4B.w
+        #define lumaN luma4B.z
+        #define lumaW luma4B.x
+    #else
+        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
+        #if (FXAA_GREEN_AS_LUMA == 0)
+            #define lumaM rgbyM.w
+        #else
+            #define lumaM rgbyM.y
+        #endif
+        FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat maxSM = max(lumaS, lumaM);
+    FxaaFloat minSM = min(lumaS, lumaM);
+    FxaaFloat maxESM = max(lumaE, maxSM);
+    FxaaFloat minESM = min(lumaE, minSM);
+    FxaaFloat maxWN = max(lumaN, lumaW);
+    FxaaFloat minWN = min(lumaN, lumaW);
+    FxaaFloat rangeMax = max(maxWN, maxESM);
+    FxaaFloat rangeMin = min(minWN, minESM);
+    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
+    FxaaFloat range = rangeMax - rangeMin;
+    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
+    FxaaBool earlyExit = range < rangeMaxClamped;
+/*--------------------------------------------------------------------------*/
+    if(earlyExit)
+        #if (FXAA_DISCARD == 1)
+            FxaaDiscard;
+        #else
+            return rgbyM;
+        #endif
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_GATHER4_ALPHA == 0)
+        FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
+    #else
+        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNS = lumaN + lumaS;
+    FxaaFloat lumaWE = lumaW + lumaE;
+    FxaaFloat subpixRcpRange = 1.0/range;
+    FxaaFloat subpixNSWE = lumaNS + lumaWE;
+    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
+    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNESE = lumaNE + lumaSE;
+    FxaaFloat lumaNWNE = lumaNW + lumaNE;
+    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
+    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNWSW = lumaNW + lumaSW;
+    FxaaFloat lumaSWSE = lumaSW + lumaSE;
+    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
+    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
+    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
+    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
+    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
+    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
+    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
+    FxaaBool horzSpan = edgeHorz >= edgeVert;
+    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
+/*--------------------------------------------------------------------------*/
+    if(!horzSpan) lumaN = lumaW;
+    if(!horzSpan) lumaS = lumaE;
+    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
+    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat gradientN = lumaN - lumaM;
+    FxaaFloat gradientS = lumaS - lumaM;
+    FxaaFloat lumaNN = lumaN + lumaM;
+    FxaaFloat lumaSS = lumaS + lumaM;
+    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
+    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
+    if(pairN) lengthSign = -lengthSign;
+    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posB;
+    posB.x = posM.x;
+    posB.y = posM.y;
+    FxaaFloat2 offNP;
+    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
+    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
+    if(!horzSpan) posB.x += lengthSign * 0.5;
+    if( horzSpan) posB.y += lengthSign * 0.5;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posN;
+    posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
+    posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
+    FxaaFloat2 posP;
+    posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
+    posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
+    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
+    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
+    FxaaFloat subpixE = subpixC * subpixC;
+    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
+/*--------------------------------------------------------------------------*/
+    if(!pairN) lumaNN = lumaSS;
+    FxaaFloat gradientScaled = gradient * 1.0/4.0;
+    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
+    FxaaFloat subpixF = subpixD * subpixE;
+    FxaaBool lumaMLTZero = lumaMM < 0.0;
+/*--------------------------------------------------------------------------*/
+    lumaEndN -= lumaNN * 0.5;
+    lumaEndP -= lumaNN * 0.5;
+    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
+    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
+    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
+    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
+    FxaaBool doneNP = (!doneN) || (!doneP);
+    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
+    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
+/*--------------------------------------------------------------------------*/
+    if(doneNP) {
+        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+        doneN = abs(lumaEndN) >= gradientScaled;
+        doneP = abs(lumaEndP) >= gradientScaled;
+        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
+        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
+        doneNP = (!doneN) || (!doneP);
+        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
+        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
+/*--------------------------------------------------------------------------*/
+        #if (FXAA_QUALITY__PS > 3)
+        if(doneNP) {
+            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+            doneN = abs(lumaEndN) >= gradientScaled;
+            doneP = abs(lumaEndP) >= gradientScaled;
+            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
+            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
+            doneNP = (!doneN) || (!doneP);
+            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
+            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
+/*--------------------------------------------------------------------------*/
+            #if (FXAA_QUALITY__PS > 4)
+            if(doneNP) {
+                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                doneN = abs(lumaEndN) >= gradientScaled;
+                doneP = abs(lumaEndP) >= gradientScaled;
+                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
+                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
+                doneNP = (!doneN) || (!doneP);
+                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
+                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
+/*--------------------------------------------------------------------------*/
+                #if (FXAA_QUALITY__PS > 5)
+                if(doneNP) {
+                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                    doneN = abs(lumaEndN) >= gradientScaled;
+                    doneP = abs(lumaEndP) >= gradientScaled;
+                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
+                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
+                    doneNP = (!doneN) || (!doneP);
+                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
+                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
+/*--------------------------------------------------------------------------*/
+                    #if (FXAA_QUALITY__PS > 6)
+                    if(doneNP) {
+                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                        doneN = abs(lumaEndN) >= gradientScaled;
+                        doneP = abs(lumaEndP) >= gradientScaled;
+                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
+                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
+                        doneNP = (!doneN) || (!doneP);
+                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
+                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
+/*--------------------------------------------------------------------------*/
+                        #if (FXAA_QUALITY__PS > 7)
+                        if(doneNP) {
+                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                            doneN = abs(lumaEndN) >= gradientScaled;
+                            doneP = abs(lumaEndP) >= gradientScaled;
+                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
+                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
+                            doneNP = (!doneN) || (!doneP);
+                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
+                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_QUALITY__PS > 8)
+    if(doneNP) {
+        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+        doneN = abs(lumaEndN) >= gradientScaled;
+        doneP = abs(lumaEndP) >= gradientScaled;
+        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
+        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
+        doneNP = (!doneN) || (!doneP);
+        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
+        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
+/*--------------------------------------------------------------------------*/
+        #if (FXAA_QUALITY__PS > 9)
+        if(doneNP) {
+            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+            doneN = abs(lumaEndN) >= gradientScaled;
+            doneP = abs(lumaEndP) >= gradientScaled;
+            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
+            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
+            doneNP = (!doneN) || (!doneP);
+            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
+            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
+/*--------------------------------------------------------------------------*/
+            #if (FXAA_QUALITY__PS > 10)
+            if(doneNP) {
+                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                doneN = abs(lumaEndN) >= gradientScaled;
+                doneP = abs(lumaEndP) >= gradientScaled;
+                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
+                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
+                doneNP = (!doneN) || (!doneP);
+                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
+                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
+/*--------------------------------------------------------------------------*/
+                #if (FXAA_QUALITY__PS > 11)
+                if(doneNP) {
+                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                    doneN = abs(lumaEndN) >= gradientScaled;
+                    doneP = abs(lumaEndP) >= gradientScaled;
+                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
+                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
+                    doneNP = (!doneN) || (!doneP);
+                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
+                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
+/*--------------------------------------------------------------------------*/
+                    #if (FXAA_QUALITY__PS > 12)
+                    if(doneNP) {
+                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                        doneN = abs(lumaEndN) >= gradientScaled;
+                        doneP = abs(lumaEndP) >= gradientScaled;
+                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
+                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
+                        doneNP = (!doneN) || (!doneP);
+                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
+                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
+/*--------------------------------------------------------------------------*/
+                    }
+                    #endif
+/*--------------------------------------------------------------------------*/
+                }
+                #endif
+/*--------------------------------------------------------------------------*/
+            }
+            #endif
+/*--------------------------------------------------------------------------*/
+        }
+        #endif
+/*--------------------------------------------------------------------------*/
+    }
+    #endif
+/*--------------------------------------------------------------------------*/
+                        }
+                        #endif
+/*--------------------------------------------------------------------------*/
+                    }
+                    #endif
+/*--------------------------------------------------------------------------*/
+                }
+                #endif
+/*--------------------------------------------------------------------------*/
+            }
+            #endif
+/*--------------------------------------------------------------------------*/
+        }
+        #endif
+/*--------------------------------------------------------------------------*/
+    }
+/*--------------------------------------------------------------------------*/
+    FxaaFloat dstN = posM.x - posN.x;
+    FxaaFloat dstP = posP.x - posM.x;
+    if(!horzSpan) dstN = posM.y - posN.y;
+    if(!horzSpan) dstP = posP.y - posM.y;
+/*--------------------------------------------------------------------------*/
+    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
+    FxaaFloat spanLength = (dstP + dstN);
+    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
+    FxaaFloat spanLengthRcp = 1.0/spanLength;
+/*--------------------------------------------------------------------------*/
+    FxaaBool directionN = dstN < dstP;
+    FxaaFloat dst = min(dstN, dstP);
+    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
+    FxaaFloat subpixG = subpixF * subpixF;
+    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
+    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
+    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
+    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
+    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
+    #if (FXAA_DISCARD == 1)
+        return FxaaTexTop(tex, posM);
+    #else
+        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
+    #endif
+}
+/*==========================================================================*/
+#endif
+
+
+
+
+/*============================================================================
+
+                         FXAA3 CONSOLE - PC VERSION
+                         
+------------------------------------------------------------------------------
+Instead of using this on PC, I'd suggest just using FXAA Quality with
+    #define FXAA_QUALITY__PRESET 10
+Or 
+    #define FXAA_QUALITY__PRESET 20
+Either are higher qualilty and almost as fast as this on modern PC GPUs.
+============================================================================*/
+#if (FXAA_PC_CONSOLE == 1)
+/*--------------------------------------------------------------------------*/
+FxaaFloat4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
+    FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
+    FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
+    FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        FxaaFloat lumaM = rgbyM.w;
+    #else
+        FxaaFloat lumaM = rgbyM.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
+    lumaNe += 1.0/384.0;
+    FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
+    FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
+    FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMinM = min(lumaMin, lumaM);
+    FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
+    FxaaFloat lumaMaxM = max(lumaMax, lumaM);
+    FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
+    FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
+    FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
+    if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 dir;
+    dir.x = dirSwMinusNe + dirSeMinusNw;
+    dir.y = dirSwMinusNe - dirSeMinusNw;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 dir1 = normalize(dir.xy);
+    FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
+    FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
+    FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
+    FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
+    FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
+    #else
+        FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
+    #endif
+    if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
+    return rgbyB; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+                      FXAA3 CONSOLE - 360 PIXEL SHADER 
+
+------------------------------------------------------------------------------
+This optimized version thanks to suggestions from Andy Luedke.
+Should be fully tex bound in all cases.
+As of the FXAA 3.11 release, I have still not tested this code,
+however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
+And note this is replacing the old unoptimized version.
+If it does not work, please let me know so I can fix it.
+============================================================================*/
+#if (FXAA_360 == 1)
+/*--------------------------------------------------------------------------*/
+[reduceTempRegUsage(4)]
+float4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    float4 lumaNwNeSwSe;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        asm { 
+            tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
+        };
+    #else
+        asm { 
+            tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
+        };
+    #endif
+/*--------------------------------------------------------------------------*/
+    lumaNwNeSwSe.y += 1.0/384.0;
+    float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
+    float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
+    float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
+    float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
+/*--------------------------------------------------------------------------*/
+    float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        float lumaMinM = min(lumaMin, rgbyM.w);
+        float lumaMaxM = max(lumaMax, rgbyM.w);
+    #else
+        float lumaMinM = min(lumaMin, rgbyM.y);
+        float lumaMaxM = max(lumaMax, rgbyM.y);
+    #endif        
+    if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
+/*--------------------------------------------------------------------------*/
+    float2 dir;
+    dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
+    dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
+    dir = normalize(dir);
+/*--------------------------------------------------------------------------*/
+    float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
+/*--------------------------------------------------------------------------*/
+    float4 dir2;
+    float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
+    dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
+    dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
+/*--------------------------------------------------------------------------*/
+    float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
+    float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
+    float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
+    float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
+/*--------------------------------------------------------------------------*/
+    float4 rgbyA = rgbyN1 + rgbyP1;
+    float4 rgbyB = rgbyN2 + rgbyP2 * 0.5 + rgbyA;
+/*--------------------------------------------------------------------------*/
+    float4 rgbyR = ((rgbyB.w - lumaMax) > 0.0) ? rgbyA : rgbyB;
+    rgbyR = ((rgbyB.w - lumaMin) > 0.0) ? rgbyR : rgbyA;
+    return rgbyR; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+         FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
+
+==============================================================================
+The code below does not exactly match the assembly.
+I have a feeling that 12 cycles is possible, but was not able to get there.
+Might have to increase register count to get full performance.
+Note this shader does not use perspective interpolation.
+
+Use the following cgc options,
+
+  --fenable-bx2 --fastmath --fastprecision --nofloatbindings
+
+------------------------------------------------------------------------------
+                             NVSHADERPERF OUTPUT
+------------------------------------------------------------------------------
+For reference and to aid in debug, output of NVShaderPerf should match this,
+
+Shader to schedule:
+  0: texpkb h0.w(TRUE), v5.zyxx, #0
+  2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
+  4: texpkb h0.w(TRUE), v5.xwxx, #0
+  6: addh h0.z(TRUE), -h2, h0.w
+  7: texpkb h1.w(TRUE), v5, #0
+  9: addh h0.x(TRUE), h0.z, -h1.w
+ 10: addh h3.w(TRUE), h0.z, h1
+ 11: texpkb h2.w(TRUE), v5.zwzz, #0
+ 13: addh h0.z(TRUE), h3.w, -h2.w
+ 14: addh h0.x(TRUE), h2.w, h0
+ 15: nrmh h1.xz(TRUE), h0_n
+ 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
+ 17: maxh h4.w(TRUE), h0, h1
+ 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
+ 19: movr r1.zw(TRUE), v4.xxxy
+ 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
+ 22: minh h5.w(TRUE), h0, h1
+ 23: texpkb h0(TRUE), r2.xzxx, #0
+ 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
+ 27: maxh h4.x(TRUE), h2.z, h2.w
+ 28: texpkb h1(TRUE), r0.zwzz, #0
+ 30: addh_d2 h1(TRUE), h0, h1
+ 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 33: texpkb h0(TRUE), r0, #0
+ 35: minh h4.z(TRUE), h2, h2.w
+ 36: fenct TRUE
+ 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 39: texpkb h2(TRUE), r1, #0
+ 41: addh_d2 h0(TRUE), h0, h2
+ 42: maxh h2.w(TRUE), h4, h4.x
+ 43: minh h2.x(TRUE), h5.w, h4.z
+ 44: addh_d2 h0(TRUE), h0, h1
+ 45: slth h2.x(TRUE), h0.w, h2
+ 46: sgth h2.w(TRUE), h0, h2
+ 47: movh h0(TRUE), h0
+ 48: addx.c0 rc(TRUE), h2, h2.w
+ 49: movh h0(c0.NE.x), h1
+
+IPU0 ------ Simplified schedule: --------
+Pass |  Unit  |  uOp |  PC:  Op
+-----+--------+------+-------------------------
+   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |   SCB1 |  add |   2:  ADDh h2.z, h0.--w-, const.--x-;
+     |        |      |
+   2 | SCT0/1 |  mov |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |    TEX |  txl |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |   SCB1 |  add |   6:  ADDh h0.z,-h2, h0.--w-;
+     |        |      |
+   3 | SCT0/1 |  mov |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
+     |    TEX |  txl |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
+     |   SCB0 |  add |   9:  ADDh h0.x, h0.z---,-h1.w---;
+     |   SCB1 |  add |  10:  ADDh h3.w, h0.---z, h1;
+     |        |      |
+   4 | SCT0/1 |  mov |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |   SCB0 |  add |  14:  ADDh h0.x, h2.w---, h0;
+     |   SCB1 |  add |  13:  ADDh h0.z, h3.--w-,-h2.--w-;
+     |        |      |
+   5 |   SCT1 |  mov |  15:  NRMh h1.xz, h0;
+     |    SRB |  nrm |  15:  NRMh h1.xz, h0;
+     |   SCB0 |  min |  16:  MINh*8 h0.x, |h1|, |h1.z---|;
+     |   SCB1 |  max |  17:  MAXh h4.w, h0, h1;
+     |        |      |
+   6 |   SCT0 |  div |  18:  DIVx h2.xy, h1.xz--, h0;
+     |   SCT1 |  mov |  19:  MOVr r1.zw, g[TEX0].--xy;
+     |   SCB0 |  mad |  20:  MADr r2.xz,-h1, const.z-w-, r1.z-w-;
+     |   SCB1 |  min |  22:  MINh h5.w, h0, h1;
+     |        |      |
+   7 | SCT0/1 |  mov |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
+     |    TEX |  txl |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
+     |   SCB0 |  max |  27:  MAXh h4.x, h2.z---, h2.w---;
+     |   SCB1 |  mad |  25:  MADr r0.zw, h1.--xz, const, r1;
+     |        |      |
+   8 | SCT0/1 |  mov |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
+     | SCB0/1 |  add |  30:  ADDh/2 h1, h0, h1;
+     |        |      |
+   9 |   SCT0 |  mad |  31:  MADr r0.xy,-h2, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  33:  TXLr h0, r0, const.zzzz, TEX0;
+     |    TEX |  txl |  33:  TXLr h0, r0, const.zzzz, TEX0;
+     |   SCB1 |  min |  35:  MINh h4.z, h2, h2.--w-;
+     |        |      |
+  10 |   SCT0 |  mad |  37:  MADr r1.xy, h2, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  39:  TXLr h2, r1, const.zzzz, TEX0;
+     |    TEX |  txl |  39:  TXLr h2, r1, const.zzzz, TEX0;
+     | SCB0/1 |  add |  41:  ADDh/2 h0, h0, h2;
+     |        |      |
+  11 |   SCT0 |  min |  43:  MINh h2.x, h5.w---, h4.z---;
+     |   SCT1 |  max |  42:  MAXh h2.w, h4, h4.---x;
+     | SCB0/1 |  add |  44:  ADDh/2 h0, h0, h1;
+     |        |      |
+  12 |   SCT0 |  set |  45:  SLTh h2.x, h0.w---, h2;
+     |   SCT1 |  set |  46:  SGTh h2.w, h0, h2;
+     | SCB0/1 |  mul |  47:  MOVh h0, h0;
+     |        |      |
+  13 |   SCT0 |  mad |  48:  ADDxc0_s rc, h2, h2.w---;
+     | SCB0/1 |  mul |  49:  MOVh h0(NE0.xxxx), h1;
+ 
+Pass   SCT  TEX  SCB
+  1:   0% 100%  25%
+  2:   0% 100%  25%
+  3:   0% 100%  50%
+  4:   0% 100%  50%
+  5:   0%   0%  50%
+  6: 100%   0%  75%
+  7:   0% 100%  75%
+  8:   0% 100% 100%
+  9:   0% 100%  25%
+ 10:   0% 100% 100%
+ 11:  50%   0% 100%
+ 12:  50%   0% 100%
+ 13:  25%   0% 100%
+
+MEAN:  17%  61%  67%
+
+Pass   SCT0  SCT1   TEX  SCB0  SCB1
+  1:    0%    0%  100%    0%  100%
+  2:    0%    0%  100%    0%  100%
+  3:    0%    0%  100%  100%  100%
+  4:    0%    0%  100%  100%  100%
+  5:    0%    0%    0%  100%  100%
+  6:  100%  100%    0%  100%  100%
+  7:    0%    0%  100%  100%  100%
+  8:    0%    0%  100%  100%  100%
+  9:    0%    0%  100%    0%  100%
+ 10:    0%    0%  100%  100%  100%
+ 11:  100%  100%    0%  100%  100%
+ 12:  100%  100%    0%  100%  100%
+ 13:  100%    0%    0%  100%  100%
+
+MEAN:   30%   23%   61%   76%  100%
+Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
+Results 13 cycles, 3 r regs, 923,076,923 pixels/s
+============================================================================*/
+#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
+/*--------------------------------------------------------------------------*/
+#pragma regcount 7
+#pragma disablepc all
+#pragma option O3
+#pragma option OutColorPrec=fp16
+#pragma texformat default RGBA8
+/*==========================================================================*/
+half4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+// (1)
+    half4 dir;
+    half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        lumaNe.w += half(1.0/512.0);
+        dir.x = -lumaNe.w;
+        dir.z = -lumaNe.w;
+    #else
+        lumaNe.y += half(1.0/512.0);
+        dir.x = -lumaNe.y;
+        dir.z = -lumaNe.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (2)
+    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x += lumaSw.w;
+        dir.z += lumaSw.w;
+    #else
+        dir.x += lumaSw.y;
+        dir.z += lumaSw.y;
+    #endif        
+/*--------------------------------------------------------------------------*/
+// (3)
+    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x -= lumaNw.w;
+        dir.z += lumaNw.w;
+    #else
+        dir.x -= lumaNw.y;
+        dir.z += lumaNw.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (4)
+    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x += lumaSe.w;
+        dir.z -= lumaSe.w;
+    #else
+        dir.x += lumaSe.y;
+        dir.z -= lumaSe.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (5)
+    half4 dir1_pos;
+    dir1_pos.xy = normalize(dir.xyz).xz;
+    half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
+/*--------------------------------------------------------------------------*/
+// (6)
+    half4 dir2_pos;
+    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
+    dir1_pos.zw = pos.xy;
+    dir2_pos.zw = pos.xy;
+    half4 temp1N;
+    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+/*--------------------------------------------------------------------------*/
+// (7)
+    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
+    half4 rgby1;
+    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+/*--------------------------------------------------------------------------*/
+// (8)
+    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
+    rgby1 = (temp1N + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (9)
+    half4 temp2N;
+    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
+/*--------------------------------------------------------------------------*/
+// (10)
+    half4 rgby2;
+    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
+    rgby2 = (temp2N + rgby2) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (11)
+    // compilier moves these scalar ops up to other cycles
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
+        half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
+    #else
+        half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
+        half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
+    #endif        
+    rgby2 = (rgby2 + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (12)
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        bool twoTapLt = rgby2.w < lumaMin;
+        bool twoTapGt = rgby2.w > lumaMax;
+    #else
+        bool twoTapLt = rgby2.y < lumaMin;
+        bool twoTapGt = rgby2.y > lumaMax;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (13)
+    if(twoTapLt || twoTapGt) rgby2 = rgby1;
+/*--------------------------------------------------------------------------*/
+    return rgby2; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+       FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
+
+==============================================================================
+The code mostly matches the assembly.
+I have a feeling that 14 cycles is possible, but was not able to get there.
+Might have to increase register count to get full performance.
+Note this shader does not use perspective interpolation.
+
+Use the following cgc options,
+
+ --fenable-bx2 --fastmath --fastprecision --nofloatbindings
+
+Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
+Will look at fixing this for FXAA 3.12.
+------------------------------------------------------------------------------
+                             NVSHADERPERF OUTPUT
+------------------------------------------------------------------------------
+For reference and to aid in debug, output of NVShaderPerf should match this,
+
+Shader to schedule:
+  0: texpkb h0.w(TRUE), v5.zyxx, #0
+  2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
+  4: texpkb h1.w(TRUE), v5.xwxx, #0
+  6: addh h0.x(TRUE), h1.w, -h2.y
+  7: texpkb h2.w(TRUE), v5.zwzz, #0
+  9: minh h4.w(TRUE), h2.y, h2
+ 10: maxh h5.x(TRUE), h2.y, h2.w
+ 11: texpkb h0.w(TRUE), v5, #0
+ 13: addh h3.w(TRUE), -h0, h0.x
+ 14: addh h0.x(TRUE), h0.w, h0
+ 15: addh h0.z(TRUE), -h2.w, h0.x
+ 16: addh h0.x(TRUE), h2.w, h3.w
+ 17: minh h5.y(TRUE), h0.w, h1.w
+ 18: nrmh h2.xz(TRUE), h0_n
+ 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
+ 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
+ 21: movr r1.zw(TRUE), v4.xxxy
+ 22: maxh h2.w(TRUE), h0, h1
+ 23: fenct TRUE
+ 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
+ 26: texpkb h0(TRUE), r0, #0
+ 28: maxh h5.x(TRUE), h2.w, h5
+ 29: minh h5.w(TRUE), h5.y, h4
+ 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
+ 32: texpkb h2(TRUE), r1, #0
+ 34: addh_d2 h2(TRUE), h0, h2
+ 35: texpkb h1(TRUE), v4, #0
+ 37: maxh h5.y(TRUE), h5.x, h1.w
+ 38: minh h4.w(TRUE), h1, h5
+ 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 41: texpkb h0(TRUE), r0, #0
+ 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
+ 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 46: texpkb h3(TRUE), r2, #0
+ 48: addh_d2 h0(TRUE), h0, h3
+ 49: addh_d2 h3(TRUE), h0, h2
+ 50: movh h0(TRUE), h3
+ 51: slth h3.x(TRUE), h3.w, h5.w
+ 52: sgth h3.w(TRUE), h3, h5.x
+ 53: addx.c0 rc(TRUE), h3.x, h3
+ 54: slth.c0 rc(TRUE), h5.z, h5
+ 55: movh h0(c0.NE.w), h2
+ 56: movh h0(c0.NE.x), h1
+
+IPU0 ------ Simplified schedule: --------
+Pass |  Unit  |  uOp |  PC:  Op
+-----+--------+------+-------------------------
+   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |   SCB0 |  add |   2:  ADDh h2.y, h0.-w--, const.-x--;
+     |        |      |
+   2 | SCT0/1 |  mov |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |    TEX |  txl |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |   SCB0 |  add |   6:  ADDh h0.x, h1.w---,-h2.y---;
+     |        |      |
+   3 | SCT0/1 |  mov |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |   SCB0 |  max |  10:  MAXh h5.x, h2.y---, h2.w---;
+     |   SCB1 |  min |   9:  MINh h4.w, h2.---y, h2;
+     |        |      |
+   4 | SCT0/1 |  mov |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
+     |    TEX |  txl |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
+     |   SCB0 |  add |  14:  ADDh h0.x, h0.w---, h0;
+     |   SCB1 |  add |  13:  ADDh h3.w,-h0, h0.---x;
+     |        |      |
+   5 |   SCT0 |  mad |  16:  ADDh h0.x, h2.w---, h3.w---;
+     |   SCT1 |  mad |  15:  ADDh h0.z,-h2.--w-, h0.--x-;
+     |   SCB0 |  min |  17:  MINh h5.y, h0.-w--, h1.-w--;
+     |        |      |
+   6 |   SCT1 |  mov |  18:  NRMh h2.xz, h0;
+     |    SRB |  nrm |  18:  NRMh h2.xz, h0;
+     |   SCB1 |  min |  19:  MINh*8 h2.w, |h2.---x|, |h2.---z|;
+     |        |      |
+   7 |   SCT0 |  div |  20:  DIVx h4.xy, h2.xz--, h2.ww--;
+     |   SCT1 |  mov |  21:  MOVr r1.zw, g[TEX0].--xy;
+     |   SCB1 |  max |  22:  MAXh h2.w, h0, h1;
+     |        |      |
+   8 |   SCT0 |  mad |  24:  MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
+     |   SCT1 |  mov |  26:  TXLr h0, r0, const.xxxx, TEX0;
+     |    TEX |  txl |  26:  TXLr h0, r0, const.xxxx, TEX0;
+     |   SCB0 |  max |  28:  MAXh h5.x, h2.w---, h5;
+     |   SCB1 |  min |  29:  MINh h5.w, h5.---y, h4;
+     |        |      |
+   9 |   SCT0 |  mad |  30:  MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
+     |   SCT1 |  mov |  32:  TXLr h2, r1, const.xxxx, TEX0;
+     |    TEX |  txl |  32:  TXLr h2, r1, const.xxxx, TEX0;
+     | SCB0/1 |  add |  34:  ADDh/2 h2, h0, h2;
+     |        |      |
+  10 | SCT0/1 |  mov |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
+     |    TEX |  txl |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
+     |   SCB0 |  max |  37:  MAXh h5.y, h5.-x--, h1.-w--;
+     |   SCB1 |  min |  38:  MINh h4.w, h1, h5;
+     |        |      |
+  11 |   SCT0 |  mad |  39:  MADr r0.xy,-h4, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  41:  TXLr h0, r0, const.zzzz, TEX0;
+     |    TEX |  txl |  41:  TXLr h0, r0, const.zzzz, TEX0;
+     |   SCB0 |  mad |  44:  MADr r2.xy, h4, const.xy--, r1.zw--;
+     |   SCB1 |  add |  43:  ADDh*8 h5.z, h5.--y-,-h4.--w-;
+     |        |      |
+  12 | SCT0/1 |  mov |  46:  TXLr h3, r2, const.xxxx, TEX0;
+     |    TEX |  txl |  46:  TXLr h3, r2, const.xxxx, TEX0;
+     | SCB0/1 |  add |  48:  ADDh/2 h0, h0, h3;
+     |        |      |
+  13 | SCT0/1 |  mad |  49:  ADDh/2 h3, h0, h2;
+     | SCB0/1 |  mul |  50:  MOVh h0, h3;
+     |        |      |
+  14 |   SCT0 |  set |  51:  SLTh h3.x, h3.w---, h5.w---;
+     |   SCT1 |  set |  52:  SGTh h3.w, h3, h5.---x;
+     |   SCB0 |  set |  54:  SLThc0 rc, h5.z---, h5;
+     |   SCB1 |  add |  53:  ADDxc0_s rc, h3.---x, h3;
+     |        |      |
+  15 | SCT0/1 |  mul |  55:  MOVh h0(NE0.wwww), h2;
+     | SCB0/1 |  mul |  56:  MOVh h0(NE0.xxxx), h1;
+ 
+Pass   SCT  TEX  SCB
+  1:   0% 100%  25%
+  2:   0% 100%  25%
+  3:   0% 100%  50%
+  4:   0% 100%  50%
+  5:  50%   0%  25%
+  6:   0%   0%  25%
+  7: 100%   0%  25%
+  8:   0% 100%  50%
+  9:   0% 100% 100%
+ 10:   0% 100%  50%
+ 11:   0% 100%  75%
+ 12:   0% 100% 100%
+ 13: 100%   0% 100%
+ 14:  50%   0%  50%
+ 15: 100%   0% 100%
+
+MEAN:  26%  60%  56%
+
+Pass   SCT0  SCT1   TEX  SCB0  SCB1
+  1:    0%    0%  100%  100%    0%
+  2:    0%    0%  100%  100%    0%
+  3:    0%    0%  100%  100%  100%
+  4:    0%    0%  100%  100%  100%
+  5:  100%  100%    0%  100%    0%
+  6:    0%    0%    0%    0%  100%
+  7:  100%  100%    0%    0%  100%
+  8:    0%    0%  100%  100%  100%
+  9:    0%    0%  100%  100%  100%
+ 10:    0%    0%  100%  100%  100%
+ 11:    0%    0%  100%  100%  100%
+ 12:    0%    0%  100%  100%  100%
+ 13:  100%  100%    0%  100%  100%
+ 14:  100%  100%    0%  100%  100%
+ 15:  100%  100%    0%  100%  100%
+
+MEAN:   33%   33%   60%   86%   80%
+Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
+Results 15 cycles, 3 r regs, 800,000,000 pixels/s
+============================================================================*/
+#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
+/*--------------------------------------------------------------------------*/
+#pragma regcount 7
+#pragma disablepc all
+#pragma option O2
+#pragma option OutColorPrec=fp16
+#pragma texformat default RGBA8
+/*==========================================================================*/
+half4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+// (1)
+    half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaNe = rgbyNe.w + half(1.0/512.0);
+    #else
+        half lumaNe = rgbyNe.y + half(1.0/512.0);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (2)
+    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaSwNegNe = lumaSw.w - lumaNe;
+    #else
+        half lumaSwNegNe = lumaSw.y - lumaNe;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (3)
+    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
+        half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
+    #else
+        half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
+        half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (4)
+    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half dirZ =  lumaNw.w + lumaSwNegNe;
+        half dirX = -lumaNw.w + lumaSwNegNe;
+    #else
+        half dirZ =  lumaNw.y + lumaSwNegNe;
+        half dirX = -lumaNw.y + lumaSwNegNe;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (5)
+    half3 dir;
+    dir.y = 0.0;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x =  lumaSe.w + dirX;
+        dir.z = -lumaSe.w + dirZ;
+        half lumaMinNeSe = min(lumaNe, lumaSe.w);
+    #else
+        dir.x =  lumaSe.y + dirX;
+        dir.z = -lumaSe.y + dirZ;
+        half lumaMinNeSe = min(lumaNe, lumaSe.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (6)
+    half4 dir1_pos;
+    dir1_pos.xy = normalize(dir).xz;
+    half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
+/*--------------------------------------------------------------------------*/
+// (7)
+    half4 dir2_pos;
+    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
+    dir1_pos.zw = pos.xy;
+    dir2_pos.zw = pos.xy;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxNeSe = max(lumaNe, lumaSe.w);
+    #else
+        half lumaMaxNeSe = max(lumaNe, lumaSe.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (8)
+    half4 temp1N;
+    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
+    half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
+    half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
+/*--------------------------------------------------------------------------*/
+// (9)
+    half4 rgby1;
+    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
+    rgby1 = (temp1N + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (10)
+    half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxM = max(lumaMax, rgbyM.w);
+        half lumaMinM = min(lumaMin, rgbyM.w);
+    #else
+        half lumaMaxM = max(lumaMax, rgbyM.y);
+        half lumaMinM = min(lumaMin, rgbyM.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (11)
+    half4 temp2N;
+    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
+    half4 rgby2;
+    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
+/*--------------------------------------------------------------------------*/
+// (12)
+    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
+    rgby2 = (temp2N + rgby2) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (13)
+    rgby2 = (rgby2 + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (14)
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        bool twoTapLt = rgby2.w < lumaMin;
+        bool twoTapGt = rgby2.w > lumaMax;
+    #else
+        bool twoTapLt = rgby2.y < lumaMin;
+        bool twoTapGt = rgby2.y > lumaMax;
+    #endif
+    bool earlyExit = lumaRangeM < lumaMax;
+    bool twoTap = twoTapLt || twoTapGt;
+/*--------------------------------------------------------------------------*/
+// (15)
+    if(twoTap) rgby2 = rgby1;
+    if(earlyExit) rgby2 = rgbyM;
+/*--------------------------------------------------------------------------*/
+    return rgby2; }
+/*==========================================================================*/
+#endif
+
+uniform sampler2D diffuseMap;
+
+uniform vec2 rcp_screen_res;
+uniform vec4 rcp_frame_opt;
+uniform vec4 rcp_frame_opt2;
 uniform vec2 screen_res;
 varying vec2 vary_fragcoord;
+varying vec2 vary_tc;
 
 void main() 
 {
-	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
+	vec4 diff =			FxaaPixelShader(vary_tc,			//pos
+										vec4(vary_fragcoord.xy, 0, 0), //fxaaConsolePosPos
+										diffuseMap,					//tex
+										diffuseMap,					
+										diffuseMap,
+										rcp_screen_res,				//fxaaQualityRcpFrame
+										vec4(0,0,0,0),				//fxaaConsoleRcpFrameOpt
+										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
+										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
+										0.75,						//fxaaQualitySubpix
+										0.166,						//fxaaQualityEdgeThreshold
+										0.0833,						//fxaaQualityEdgeThresholdMin
+										8.0,						//fxaaConsoleEdgeSharpness
+										0.125,						//fxaaConsoleEdgeThreshold
+										0.05,						//fxaaConsoleEdgeThresholdMin
+										vec4(0,0,0,0));				//fxaaConsole360ConstDir
+
+
+
+	//diff = texture2D(diffuseMap, vary_tc);
+	
+	gl_FragColor = diff;
 	
-	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor = diff + bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index 30dbe3f75e8..c3270111848 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -8,6 +8,10 @@
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
+varying vec2 vary_tc;
+
+uniform vec2 tc_scale;
+
 uniform vec2 screen_res;
 
 void main()
@@ -15,5 +19,6 @@ void main()
 	//transform vertex
 	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
 	gl_Position = pos;	
+	vary_tc = (pos.xy*0.5+0.5)*tc_scale;
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
new file mode 100644
index 00000000000..6639f88047d
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -0,0 +1,23 @@
+/** 
+ * @file glowcombineFXAAF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+#extension GL_ARB_texture_rectangle : enable
+
+uniform sampler2D glowMap;
+uniform sampler2DRect screenMap;
+
+uniform vec2 screen_res;
+varying vec2 vary_tc;
+
+void main() 
+{
+	vec3 col = texture2D(glowMap, vary_tc).rgb +
+					texture2DRect(screenMap, vary_tc*screen_res).rgb;
+
+	
+	gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
+}
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
new file mode 100644
index 00000000000..f54876135e9
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
@@ -0,0 +1,19 @@
+/** 
+ * @file glowcombineFXAAV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+attribute vec3 position;
+
+varying vec2 vary_tc;
+
+void main()
+{
+	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_Position = pos;
+
+	vary_tc = pos.xy*0.5+0.5;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
new file mode 100644
index 00000000000..555c59c37ec
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -0,0 +1,30 @@
+/** 
+ * @file previewV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+ 
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
+void main()
+{
+	//transform vertex
+	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+		
+	vec3 norm = normalize(gl_NormalMatrix * normal);
+
+	calcAtmospherics(pos.xyz);
+
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
+	gl_FrontColor = color;
+
+	gl_FogFragCoord = pos.z;
+}
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp
index 1f334815d6a..ef92dfd9562 100644
--- a/indra/newview/llfloateranimpreview.cpp
+++ b/indra/newview/llfloateranimpreview.cpp
@@ -1072,6 +1072,11 @@ BOOL	LLPreviewAnimation::render()
 	gGL.pushMatrix();
 	glLoadIdentity();
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	LLGLSUIDefault def;
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index dc4c15316a3..b9c298ff9d9 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -50,6 +50,7 @@
 #include "llvoavatar.h"
 #include "pipeline.h"
 #include "lluictrlfactory.h"
+#include "llviewershadermgr.h"
 #include "llviewertexturelist.h"
 #include "llstring.h"
 
@@ -662,6 +663,11 @@ BOOL LLImagePreviewAvatar::render()
 	LLGLSUIDefault def;
 	gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	gl_rect_2d_simple( mFullWidth, mFullHeight );
 
 	glMatrixMode(GL_PROJECTION);
@@ -690,8 +696,7 @@ BOOL LLImagePreviewAvatar::render()
 
 	LLVertexBuffer::unbind();
 	avatarp->updateLOD();
-	
-	
+		
 	if (avatarp->mDrawable.notNull())
 	{
 		LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
@@ -790,15 +795,17 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
 	U32 num_indices = vf.mNumIndices;
 	U32 num_vertices = vf.mNumVertices;
 
-	mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL, 0);
+	mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0, 0);
 	mVertexBuffer->allocateBuffer(num_vertices, num_indices, TRUE);
 
 	LLStrider<LLVector3> vertex_strider;
 	LLStrider<LLVector3> normal_strider;
+	LLStrider<LLVector2> tc_strider;
 	LLStrider<U16> index_strider;
 
 	mVertexBuffer->getVertexStrider(vertex_strider);
 	mVertexBuffer->getNormalStrider(normal_strider);
+	mVertexBuffer->getTexCoord0Strider(tc_strider);
 	mVertexBuffer->getIndexStrider(index_strider);
 
 	// build vertices and normals
@@ -806,7 +813,8 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
 	pos = (LLVector3*) vf.mPositions; pos.setStride(16);
 	LLStrider<LLVector3> norm;
 	norm = (LLVector3*) vf.mNormals; norm.setStride(16);
-		
+	LLStrider<LLVector2> tc;
+	tc = (LLVector2*) vf.mTexCoords; tc.setStride(8);
 
 	for (U32 i = 0; i < num_vertices; i++)
 	{
@@ -814,6 +822,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
 		LLVector3 normal = *norm++;
 		normal.normalize();
 		*(normal_strider++) = normal;
+		*(tc_strider++) = *tc++;
 	}
 
 	// build indices
@@ -846,8 +855,13 @@ BOOL LLImagePreviewSculpted::render()
 		
 	gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
 
-	gl_rect_2d_simple( mFullWidth, mFullHeight );
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
 
+	gl_rect_2d_simple( mFullWidth, mFullHeight );
+	
 	glMatrixMode(GL_PROJECTION);
 	gGL.popMatrix();
 
@@ -876,17 +890,28 @@ BOOL LLImagePreviewSculpted::render()
 	const LLVolumeFace &vf = mVolume->getVolumeFace(0);
 	U32 num_indices = vf.mNumIndices;
 	
-	mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL);
-
 	gPipeline.enableLightsAvatar();
+
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gObjectPreviewProgram.bind();
+	}
 	gGL.pushMatrix();
 	const F32 SCALE = 1.25f;
 	gGL.scalef(SCALE, SCALE, SCALE);
 	const F32 BRIGHTNESS = 0.9f;
 	gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
+
+	mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
 	mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0);
 
 	gGL.popMatrix();
+
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gObjectPreviewProgram.unbind();
+	}
+
 	return TRUE;
 }
 
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 3d371f7a443..ed124cfecf3 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2436,8 +2436,7 @@ void pushVerts(LLVolume* volume)
 	for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
 	{
 		const LLVolumeFace& face = volume->getVolumeFace(i);
-		glVertexPointer(3, GL_FLOAT, 16, face.mPositions);
-		glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
+		LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices);
 	}
 }
 
@@ -3178,13 +3177,13 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 				LLVertexBuffer::unbind();
 
 				llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
-
-				glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
-				glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+							
+				LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
 				
 				gGL.diffuseColor4fv(color.mV);
 				glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-				glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+				LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+				
 			}
 			else
 			{
@@ -4115,6 +4114,11 @@ void LLSpatialPartition::renderDebug()
 		return;
 	}
 	
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
 	{
 		//sLastMaxTexPriority = lerp(sLastMaxTexPriority, sCurMaxTexPriority, gFrameIntervalSeconds);
@@ -4143,6 +4147,11 @@ void LLSpatialPartition::renderDebug()
 
 	LLOctreeRenderNonOccluded render_debug(camera);
 	render_debug.traverse(mOctree);
+
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.unbind();
+	}
 }
 
 void LLSpatialGroup::drawObjectBox(LLColor4 col)
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index 964b17d3a66..eeb90a2b19d 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -178,6 +178,11 @@ BOOL LLVisualParamHint::render()
 	gGL.pushMatrix();
 	glLoadIdentity();
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	LLGLSUIDefault gls_ui;
 	//LLGLState::verify(TRUE);
 	mBackgroundp->draw(0, 0, mFullWidth, mFullHeight);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index ab193c7d851..de9d853c7c3 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -65,11 +65,13 @@ LLVector4			gShinyOrigin;
 LLGLSLShader	gOcclusionProgram;
 LLGLSLShader	gCustomAlphaProgram;
 LLGLSLShader	gGlowCombineProgram;
+LLGLSLShader	gGlowCombineFXAAProgram;
 LLGLSLShader	gTwoTextureAddProgram;
 LLGLSLShader	gOneTextureNoColorProgram;
 
 //object shaders
 LLGLSLShader		gObjectSimpleProgram;
+LLGLSLShader		gObjectPreviewProgram;
 LLGLSLShader		gObjectSimpleWaterProgram;
 LLGLSLShader		gObjectSimpleAlphaMaskProgram;
 LLGLSLShader		gObjectSimpleWaterAlphaMaskProgram;
@@ -200,6 +202,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gWaterProgram);
 	mShaderList.push_back(&gAvatarEyeballProgram); 
 	mShaderList.push_back(&gObjectSimpleProgram);
+	mShaderList.push_back(&gObjectPreviewProgram);
 	mShaderList.push_back(&gImpostorProgram);
 	mShaderList.push_back(&gObjectFullbrightNoColorProgram);
 	mShaderList.push_back(&gObjectFullbrightNoColorWaterProgram);
@@ -208,6 +211,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gUIProgram);
 	mShaderList.push_back(&gCustomAlphaProgram);
 	mShaderList.push_back(&gGlowCombineProgram);
+	mShaderList.push_back(&gGlowCombineFXAAProgram);
 	mShaderList.push_back(&gTwoTextureAddProgram);
 	mShaderList.push_back(&gOneTextureNoColorProgram);
 	mShaderList.push_back(&gSolidColorProgram);
@@ -669,6 +673,7 @@ void LLViewerShaderMgr::unloadShaders()
 	gUIProgram.unload();
 	gCustomAlphaProgram.unload();
 	gGlowCombineProgram.unload();
+	gGlowCombineFXAAProgram.unload();
 	gTwoTextureAddProgram.unload();
 	gOneTextureNoColorProgram.unload();
 	gSolidColorProgram.unload();
@@ -676,6 +681,7 @@ void LLViewerShaderMgr::unloadShaders()
 	gObjectFullbrightNoColorProgram.unload();
 	gObjectFullbrightNoColorWaterProgram.unload();
 	gObjectSimpleProgram.unload();
+	gObjectPreviewProgram.unload();
 	gImpostorProgram.unload();
 	gObjectSimpleAlphaMaskProgram.unload();
 	gObjectBumpProgram.unload();
@@ -1767,6 +1773,7 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectFullbrightNoColorProgram.unload();
 		gObjectFullbrightNoColorWaterProgram.unload();
 		gObjectSimpleProgram.unload();
+		gObjectPreviewProgram.unload();
 		gImpostorProgram.unload();
 		gObjectSimpleAlphaMaskProgram.unload();
 		gObjectBumpProgram.unload();
@@ -2117,6 +2124,23 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gImpostorProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gObjectPreviewProgram.mName = "Simple Shader";
+		gObjectPreviewProgram.mFeatures.calculatesLighting = true;
+		gObjectPreviewProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectPreviewProgram.mFeatures.hasGamma = true;
+		gObjectPreviewProgram.mFeatures.hasAtmospherics = true;
+		gObjectPreviewProgram.mFeatures.hasLighting = true;
+		gObjectPreviewProgram.mFeatures.mIndexedTextureChannels = 0;
+		gObjectPreviewProgram.mFeatures.disableTextureIndex = true;
+		gObjectPreviewProgram.mShaderFiles.clear();
+		gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectPreviewProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectPreviewProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gObjectSimpleProgram.mName = "Simple Shader";
@@ -2706,6 +2730,24 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
 		}
 	}
 
+	if (success)
+	{
+		gGlowCombineFXAAProgram.mName = "Glow CombineFXAA Shader";
+		gGlowCombineFXAAProgram.mShaderFiles.clear();
+		gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAV.glsl", GL_VERTEX_SHADER_ARB));
+		gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gGlowCombineFXAAProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gGlowCombineFXAAProgram.createShader(NULL, NULL);
+		if (success)
+		{
+			gGlowCombineFXAAProgram.bind();
+			gGlowCombineFXAAProgram.uniform1i("glowMap", 0);
+			gGlowCombineFXAAProgram.uniform1i("screenMap", 1);
+			gGlowCombineFXAAProgram.unbind();
+		}
+	}
+
+
 	if (success)
 	{
 		gTwoTextureAddProgram.mName = "Two Texture Add Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 270c05b6696..c63260fb2ec 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -273,6 +273,7 @@ extern LLVector4			gShinyOrigin;
 extern LLGLSLShader			gOcclusionProgram;
 extern LLGLSLShader			gCustomAlphaProgram;
 extern LLGLSLShader			gGlowCombineProgram;
+extern LLGLSLShader			gGlowCombineFXAAProgram;
 
 //output tex0[tc0] + tex1[tc1]
 extern LLGLSLShader			gTwoTextureAddProgram;
@@ -281,6 +282,7 @@ extern LLGLSLShader			gOneTextureNoColorProgram;
 
 //object shaders
 extern LLGLSLShader			gObjectSimpleProgram;
+extern LLGLSLShader			gObjectPreviewProgram;
 extern LLGLSLShader			gObjectSimpleAlphaMaskProgram;
 extern LLGLSLShader			gObjectSimpleWaterProgram;
 extern LLGLSLShader			gObjectSimpleWaterAlphaMaskProgram;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f6d021fda8a..7feb4299118 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -673,6 +673,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		if (!addDeferredAttachments(mDeferredScreen)) return false;
 	
 		if (!mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
+		if (!mFXAABuffer.allocate(nhpo2(resX), nhpo2(resY), GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
 		
 #if LL_DARWIN
 		// As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
@@ -782,6 +783,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		{
 			mShadow[i].release();
 		}
+		mFXAABuffer.release();
 		mScreen.release();
 		mDeferredScreen.release(); //make sure to release any render targets that share a depth buffer with mDeferredScreen first
 		mDeferredDepth.release();
@@ -867,6 +869,7 @@ void LLPipeline::releaseScreenBuffers()
 {
 	mUIScreen.release();
 	mScreen.release();
+	mFXAABuffer.release();
 	mPhysicsDisplay.release();
 	mDeferredScreen.release();
 	mDeferredDepth.release();
@@ -4231,6 +4234,11 @@ void LLPipeline::renderDebug()
 		}
 	}
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
 	{
 		LLVertexBuffer::unbind();
@@ -4455,6 +4463,10 @@ void LLPipeline::renderDebug()
 	}
 
 	gGL.flush();
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.unbind();
+	}
 
 	gPipeline.renderPhysicsDisplay();
 }
@@ -6300,7 +6312,31 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	if (LLPipeline::sRenderDeferred)
 	{
 		bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater();
+		{
+			//bake out texture2D with RGBL for FXAA shader
+			mFXAABuffer.bindTarget();
+			
+			S32 width = mScreen.getWidth();
+			S32 height = mScreen.getHeight();
+			glViewport(0, 0, width, height);
+
+			gGlowCombineFXAAProgram.bind();
+			gGlowCombineFXAAProgram.uniform2f("screen_res", width, height);
+
+			gGL.getTexUnit(0)->bind(&mGlow[1]);
+			gGL.getTexUnit(1)->bind(&mScreen);
 
+			gGL.begin(LLRender::TRIANGLE_STRIP);
+			gGL.vertex2f(-1,-1);
+			gGL.vertex2f(-1,3);
+			gGL.vertex2f(3,-1);
+			gGL.end();
+
+			gGlowCombineFXAAProgram.unbind();
+			mFXAABuffer.flush();
+			gViewerWindow->setup3DViewport();
+		}
+				
 		LLGLSLShader* shader = &gDeferredPostProgram;
 		if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
 		{
@@ -6317,6 +6353,16 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		LLGLDisable blend(GL_BLEND);
 		bindDeferredShader(*shader);
 
+		S32 width = mScreen.getWidth();
+		S32 height = mScreen.getHeight();
+		
+		F32 scale_x = (F32) width/mFXAABuffer.getWidth();
+		F32 scale_y = (F32) height/mFXAABuffer.getHeight();
+		shader->uniform2f("tc_scale", scale_x, scale_y);
+		shader->uniform2f("rcp_screen_res", 1.f/width*scale_x, 1.f/height*scale_y);
+		shader->uniform4f("rcp_frame_opt", -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
+		shader->uniform4f("rcp_frame_opt2", -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
+
 		if (dof_enabled)
 		{
 			//depth of field focal plane calculations
@@ -6429,17 +6475,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			shader->uniform1f("magnification", magnification);
 		}
 
-		S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+		S32 channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
 		if (channel > -1)
 		{
-			mScreen.bindTexture(0, channel);
+			mFXAABuffer.bindTexture(0, channel);
+			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
 		}
-		//channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, LLTexUnit::TT_RECT_TEXTURE);
-		//if (channel > -1)
-		//{
-			//gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		//}
-
+	
 		gGL.begin(LLRender::TRIANGLE_STRIP);
 		gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
 		gGL.vertex2f(-1,-1);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 61ab84588d9..159ec612d37 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -527,6 +527,7 @@ class LLPipeline
 	LLRenderTarget			mScreen;
 	LLRenderTarget			mUIScreen;
 	LLRenderTarget			mDeferredScreen;
+	LLRenderTarget			mFXAABuffer;
 	LLRenderTarget			mEdgeMap;
 	LLRenderTarget			mDeferredDepth;
 	LLRenderTarget			mDeferredLight[3];
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index a8b3ce9c28f..b93e70c8c50 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -137,34 +137,36 @@ Thank you to the following Residents for helping to ensure that this is the best
        top="5"
        width="435"
        word_wrap="true">
-3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
-APR Copyright (C) 2000-2004 The Apache Software Foundation
-Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
-cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
-DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
-expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Copyright (C) 1999-2004 Brian Paul.
-GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Copyright (c) 2005, Google Inc.
-Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
-jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Copyright (C) 2001, Xiphophorus
-OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
-PCRE Copyright (c) 1997-2008 University of Cambridge
-SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
-zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
-google-perftools Copyright (c) 2005, Google Inc.
+        3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
+        APR Copyright (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
+        Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
 
-All rights reserved.  See licenses.txt for details.
+        This software contains source code provided by NVIDIA Corporation.
 
-Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
-        </text_editor>
+        All rights reserved.  See licenses.txt for details.
+
+        Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+      </text_editor>
       </panel>
     </tab_container>
 </floater>
-- 
GitLab


From ee4fdd2c18c722164d78a7305777fad6e49cba8b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sun, 21 Aug 2011 16:23:04 -0500
Subject: [PATCH 008/933] SH-2242 Work in progress on FXAA/glVertexAttrib --
 DoF works, physics shape display still doesn't.

---
 indra/llrender/llrender.cpp                   |   20 +-
 .../class1/deferred/postDeferredF.glsl        | 2099 ++++++++++++++++-
 .../shaders/class1/interface/debugF.glsl      |   31 +
 .../shaders/class1/interface/debugV.glsl      |   32 +
 .../class1/interface/splattexturerectF.glsl   |   33 +
 .../class1/interface/splattexturerectV.glsl   |   36 +
 indra/newview/llspatialpartition.cpp          |    6 +-
 indra/newview/llviewershadermgr.cpp           |   31 +
 indra/newview/llviewershadermgr.h             |    2 +
 indra/newview/pipeline.cpp                    |   34 +-
 10 files changed, 2286 insertions(+), 38 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/debugF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/debugV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index da85bc202cd..03a45c35dc4 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1586,12 +1586,12 @@ void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
 	S32 loc = -1;
 	if (shader)
 	{
-		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+		loc = shader->getUniformLocation("color");
 	}
 
 	if (loc >= 0)
 	{
-		glVertexAttrib3fARB(loc, r,g,b);
+		shader->uniform4f(loc, r,g,b,1.f);
 	}
 	else
 	{
@@ -1605,12 +1605,12 @@ void LLRender::diffuseColor3fv(const F32* c)
 	S32 loc = -1;
 	if (shader)
 	{
-		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+		loc = shader->getUniformLocation("color");
 	}
 
 	if (loc >= 0)
 	{
-		glVertexAttrib3fvARB(loc, c);
+		shader->uniform4f(loc, c[0], c[1], c[2], 1.f);
 	}
 	else
 	{
@@ -1624,12 +1624,12 @@ void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
 	S32 loc = -1;
 	if (shader)
 	{
-		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+		loc = shader->getUniformLocation("color");
 	}
 
 	if (loc >= 0)
 	{
-		glVertexAttrib4fARB(loc, r,g,b,a);
+		shader->uniform4f(loc, r,g,b,a);
 	}
 	else
 	{
@@ -1644,12 +1644,12 @@ void LLRender::diffuseColor4fv(const F32* c)
 	S32 loc = -1;
 	if (shader)
 	{
-		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+		loc = shader->getUniformLocation("color");
 	}
 
 	if (loc >= 0)
 	{
-		glVertexAttrib4fvARB(loc, c);
+		shader->uniform4fv(loc, 1, c);
 	}
 	else
 	{
@@ -1663,12 +1663,12 @@ void LLRender::diffuseColor4ubv(const U8* c)
 	S32 loc = -1;
 	if (shader)
 	{
-		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR);
+		loc = shader->getUniformLocation("color");
 	}
 
 	if (loc >= 0)
 	{
-		glVertexAttrib4ubvARB(loc, c);
+		shader->uniform4f(loc, c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f);
 	}
 	else
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 29f5f899ba2..cfcd8585f19 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -22,16 +22,2070 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+#extension GL_ARB_texture_rectangle : enable
+
+#define FXAA_PC 1
+#define FXAA_GLSL_130 1
+#define FXAA_QUALITY__PRESET 12
+
+/*============================================================================
+
+
+                    NVIDIA FXAA 3.11 by TIMOTHY LOTTES
+
+
+------------------------------------------------------------------------------
+COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
+------------------------------------------------------------------------------
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
+OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
+CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
+LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
+OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
+THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+------------------------------------------------------------------------------
+                           INTEGRATION CHECKLIST
+------------------------------------------------------------------------------
+(1.)
+In the shader source, setup defines for the desired configuration.
+When providing multiple shaders (for different presets),
+simply setup the defines differently in multiple files.
+Example,
+
+  #define FXAA_PC 1
+  #define FXAA_HLSL_5 1
+  #define FXAA_QUALITY__PRESET 12
+
+Or,
+
+  #define FXAA_360 1
+  
+Or,
+
+  #define FXAA_PS3 1
+  
+Etc.
+
+(2.)
+Then include this file,
+
+  #include "Fxaa3_11.h"
+
+(3.)
+Then call the FXAA pixel shader from within your desired shader.
+Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
+As for FXAA 3.11 all inputs for all shaders are the same 
+to enable easy porting between platforms.
+
+  return FxaaPixelShader(...);
+
+(4.)
+Insure pass prior to FXAA outputs RGBL (see next section).
+Or use,
+
+  #define FXAA_GREEN_AS_LUMA 1
+
+(5.)
+Setup engine to provide the following constants
+which are used in the FxaaPixelShader() inputs,
+
+  FxaaFloat2 fxaaQualityRcpFrame,
+  FxaaFloat4 fxaaConsoleRcpFrameOpt,
+  FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+  FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+  FxaaFloat fxaaQualitySubpix,
+  FxaaFloat fxaaQualityEdgeThreshold,
+  FxaaFloat fxaaQualityEdgeThresholdMin,
+  FxaaFloat fxaaConsoleEdgeSharpness,
+  FxaaFloat fxaaConsoleEdgeThreshold,
+  FxaaFloat fxaaConsoleEdgeThresholdMin,
+  FxaaFloat4 fxaaConsole360ConstDir
+
+Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
+
+(6.)
+Have FXAA vertex shader run as a full screen triangle,
+and output "pos" and "fxaaConsolePosPos" 
+such that inputs in the pixel shader provide,
+
+  // {xy} = center of pixel
+  FxaaFloat2 pos,
+
+  // {xy__} = upper left of pixel
+  // {__zw} = lower right of pixel
+  FxaaFloat4 fxaaConsolePosPos,
+
+(7.)
+Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
+
+
+------------------------------------------------------------------------------
+                    INTEGRATION - RGBL AND COLORSPACE
+------------------------------------------------------------------------------
+FXAA3 requires RGBL as input unless the following is set, 
+
+  #define FXAA_GREEN_AS_LUMA 1
+
+In which case the engine uses green in place of luma,
+and requires RGB input is in a non-linear colorspace.
+
+RGB should be LDR (low dynamic range).
+Specifically do FXAA after tonemapping.
+
+RGB data as returned by a texture fetch can be non-linear,
+or linear when FXAA_GREEN_AS_LUMA is not set.
+Note an "sRGB format" texture counts as linear,
+because the result of a texture fetch is linear data.
+Regular "RGBA8" textures in the sRGB colorspace are non-linear.
+
+If FXAA_GREEN_AS_LUMA is not set,
+luma must be stored in the alpha channel prior to running FXAA.
+This luma should be in a perceptual space (could be gamma 2.0).
+Example pass before FXAA where output is gamma 2.0 encoded,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  color.rgb = sqrt(color.rgb);    // gamma 2.0 color output
+  return color;
+
+To use FXAA,
+
+  color.rgb = ToneMap(color.rgb);  // linear color output
+  color.rgb = sqrt(color.rgb);     // gamma 2.0 color output
+  color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
+  return color;
+
+Another example where output is linear encoded,
+say for instance writing to an sRGB formated render target,
+where the render target does the conversion back to sRGB after blending,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  return color;
+
+To use FXAA,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
+  return color;
+
+Getting luma correct is required for the algorithm to work correctly.
+
+
+------------------------------------------------------------------------------
+                          BEING LINEARLY CORRECT?
+------------------------------------------------------------------------------
+Applying FXAA to a framebuffer with linear RGB color will look worse.
+This is very counter intuitive, but happends to be true in this case.
+The reason is because dithering artifacts will be more visiable 
+in a linear colorspace.
+
+
+------------------------------------------------------------------------------
+                             COMPLEX INTEGRATION
+------------------------------------------------------------------------------
+Q. What if the engine is blending into RGB before wanting to run FXAA?
+
+A. In the last opaque pass prior to FXAA,
+   have the pass write out luma into alpha.
+   Then blend into RGB only.
+   FXAA should be able to run ok
+   assuming the blending pass did not any add aliasing.
+   This should be the common case for particles and common blending passes.
+
+A. Or use FXAA_GREEN_AS_LUMA.
+
+============================================================================*/
+
+/*============================================================================
+
+                             INTEGRATION KNOBS
+
+============================================================================*/
+//
+// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
+// FXAA_360_OPT is a prototype for the new optimized 360 version.
+//
+// 1 = Use API.
+// 0 = Don't use API.
+//
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_PS3
+    #define FXAA_PS3 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_360
+    #define FXAA_360 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_360_OPT
+    #define FXAA_360_OPT 0
+#endif
+/*==========================================================================*/
+#ifndef FXAA_PC
+    //
+    // FXAA Quality
+    // The high quality PC algorithm.
+    //
+    #define FXAA_PC 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_PC_CONSOLE
+    //
+    // The console algorithm for PC is included
+    // for developers targeting really low spec machines.
+    // Likely better to just run FXAA_PC, and use a really low preset.
+    //
+    #define FXAA_PC_CONSOLE 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GLSL_120
+    #define FXAA_GLSL_120 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GLSL_130
+    #define FXAA_GLSL_130 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_3
+    #define FXAA_HLSL_3 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_4
+    #define FXAA_HLSL_4 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_5
+    #define FXAA_HLSL_5 0
+#endif
+/*==========================================================================*/
+#ifndef FXAA_GREEN_AS_LUMA
+    //
+    // For those using non-linear color,
+    // and either not able to get luma in alpha, or not wanting to,
+    // this enables FXAA to run using green as a proxy for luma.
+    // So with this enabled, no need to pack luma in alpha.
+    //
+    // This will turn off AA on anything which lacks some amount of green.
+    // Pure red and blue or combination of only R and B, will get no AA.
+    //
+    // Might want to lower the settings for both,
+    //    fxaaConsoleEdgeThresholdMin
+    //    fxaaQualityEdgeThresholdMin
+    // In order to insure AA does not get turned off on colors 
+    // which contain a minor amount of green.
+    //
+    // 1 = On.
+    // 0 = Off.
+    //
+    #define FXAA_GREEN_AS_LUMA 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_EARLY_EXIT
+    //
+    // Controls algorithm's early exit path.
+    // On PS3 turning this ON adds 2 cycles to the shader.
+    // On 360 turning this OFF adds 10ths of a millisecond to the shader.
+    // Turning this off on console will result in a more blurry image.
+    // So this defaults to on.
+    //
+    // 1 = On.
+    // 0 = Off.
+    //
+    #define FXAA_EARLY_EXIT 1
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_DISCARD
+    //
+    // Only valid for PC OpenGL currently.
+    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
+    //
+    // 1 = Use discard on pixels which don't need AA.
+    //     For APIs which enable concurrent TEX+ROP from same surface.
+    // 0 = Return unchanged color on pixels which don't need AA.
+    //
+    #define FXAA_DISCARD 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_FAST_PIXEL_OFFSET
+    //
+    // Used for GLSL 120 only.
+    //
+    // 1 = GL API supports fast pixel offsets
+    // 0 = do not use fast pixel offsets
+    //
+    #ifdef GL_EXT_gpu_shader4
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifdef GL_NV_gpu_shader5
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifdef GL_ARB_gpu_shader5
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifndef FXAA_FAST_PIXEL_OFFSET
+        #define FXAA_FAST_PIXEL_OFFSET 0
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GATHER4_ALPHA
+    //
+    // 1 = API supports gather4 on alpha channel.
+    // 0 = API does not support gather4 on alpha channel.
+    //
+    #if (FXAA_HLSL_5 == 1)
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifdef GL_ARB_gpu_shader5
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifdef GL_NV_gpu_shader5
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifndef FXAA_GATHER4_ALPHA
+        #define FXAA_GATHER4_ALPHA 0
+    #endif
+#endif
+
+/*============================================================================
+                      FXAA CONSOLE PS3 - TUNING KNOBS
+============================================================================*/
+#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
+    //
+    // Consoles the sharpness of edges on PS3 only.
+    // Non-PS3 tuning is done with shader input.
+    //
+    // Due to the PS3 being ALU bound,
+    // there are only two safe values here: 4 and 8.
+    // These options use the shaders ability to a free *|/ by 2|4|8.
+    //
+    // 8.0 is sharper
+    // 4.0 is softer
+    // 2.0 is really soft (good for vector graphics inputs)
+    //
+    #if 1
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
+    #endif
+    #if 0
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
+    #endif
+    #if 0
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
+    //
+    // Only effects PS3.
+    // Non-PS3 tuning is done with shader input.
+    //
+    // The minimum amount of local contrast required to apply algorithm.
+    // The console setting has a different mapping than the quality setting.
+    //
+    // This only applies when FXAA_EARLY_EXIT is 1.
+    //
+    // Due to the PS3 being ALU bound,
+    // there are only two safe values here: 0.25 and 0.125.
+    // These options use the shaders ability to a free *|/ by 2|4|8.
+    //
+    // 0.125 leaves less aliasing, but is softer
+    // 0.25 leaves more aliasing, and is sharper
+    //
+    #if 1
+        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
+    #else
+        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
+    #endif
+#endif
+
+/*============================================================================
+                        FXAA QUALITY - TUNING KNOBS
+------------------------------------------------------------------------------
+NOTE the other tuning knobs are now in the shader function inputs!
+============================================================================*/
+#ifndef FXAA_QUALITY__PRESET
+    //
+    // Choose the quality preset.
+    // This needs to be compiled into the shader as it effects code.
+    // Best option to include multiple presets is to 
+    // in each shader define the preset, then include this file.
+    // 
+    // OPTIONS
+    // -----------------------------------------------------------------------
+    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
+    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
+    // 39       - no dither, very expensive 
+    //
+    // NOTES
+    // -----------------------------------------------------------------------
+    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
+    // 13 = about same speed as FXAA 3.9 and better than 12
+    // 23 = closest to FXAA 3.9 visually and performance wise
+    //  _ = the lowest digit is directly related to performance
+    // _  = the highest digit is directly related to style
+    // 
+    #define FXAA_QUALITY__PRESET 12
+#endif
+
+
+/*============================================================================
+
+                           FXAA QUALITY - PRESETS
+
+============================================================================*/
+
+/*============================================================================
+                     FXAA QUALITY - MEDIUM DITHER PRESETS
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 10)
+    #define FXAA_QUALITY__PS 3
+    #define FXAA_QUALITY__P0 1.5
+    #define FXAA_QUALITY__P1 3.0
+    #define FXAA_QUALITY__P2 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 11)
+    #define FXAA_QUALITY__PS 4
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 3.0
+    #define FXAA_QUALITY__P3 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 12)
+    #define FXAA_QUALITY__PS 5
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 4.0
+    #define FXAA_QUALITY__P4 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 13)
+    #define FXAA_QUALITY__PS 6
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 4.0
+    #define FXAA_QUALITY__P5 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 14)
+    #define FXAA_QUALITY__PS 7
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 4.0
+    #define FXAA_QUALITY__P6 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 15)
+    #define FXAA_QUALITY__PS 8
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 4.0
+    #define FXAA_QUALITY__P7 12.0
+#endif
+
+/*============================================================================
+                     FXAA QUALITY - LOW DITHER PRESETS
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 20)
+    #define FXAA_QUALITY__PS 3
+    #define FXAA_QUALITY__P0 1.5
+    #define FXAA_QUALITY__P1 2.0
+    #define FXAA_QUALITY__P2 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 21)
+    #define FXAA_QUALITY__PS 4
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 22)
+    #define FXAA_QUALITY__PS 5
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 23)
+    #define FXAA_QUALITY__PS 6
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 24)
+    #define FXAA_QUALITY__PS 7
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 3.0
+    #define FXAA_QUALITY__P6 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 25)
+    #define FXAA_QUALITY__PS 8
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 4.0
+    #define FXAA_QUALITY__P7 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 26)
+    #define FXAA_QUALITY__PS 9
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 4.0
+    #define FXAA_QUALITY__P8 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 27)
+    #define FXAA_QUALITY__PS 10
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 4.0
+    #define FXAA_QUALITY__P9 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 28)
+    #define FXAA_QUALITY__PS 11
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 4.0
+    #define FXAA_QUALITY__P10 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 29)
+    #define FXAA_QUALITY__PS 12
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 2.0
+    #define FXAA_QUALITY__P10 4.0
+    #define FXAA_QUALITY__P11 8.0
+#endif
+
+/*============================================================================
+                     FXAA QUALITY - EXTREME QUALITY
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 39)
+    #define FXAA_QUALITY__PS 12
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.0
+    #define FXAA_QUALITY__P2 1.0
+    #define FXAA_QUALITY__P3 1.0
+    #define FXAA_QUALITY__P4 1.0
+    #define FXAA_QUALITY__P5 1.5
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 2.0
+    #define FXAA_QUALITY__P10 4.0
+    #define FXAA_QUALITY__P11 8.0
+#endif
+
+
+
+/*============================================================================
+
+                                API PORTING
+
+============================================================================*/
+#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
+    #define FxaaBool bool
+    #define FxaaDiscard discard
+    #define FxaaFloat float
+    #define FxaaFloat2 vec2
+    #define FxaaFloat3 vec3
+    #define FxaaFloat4 vec4
+    #define FxaaHalf float
+    #define FxaaHalf2 vec2
+    #define FxaaHalf3 vec3
+    #define FxaaHalf4 vec4
+    #define FxaaInt2 ivec2
+    #define FxaaSat(x) clamp(x, 0.0, 1.0)
+    #define FxaaTex sampler2D
+#else
+    #define FxaaBool bool
+    #define FxaaDiscard clip(-1)
+    #define FxaaFloat float
+    #define FxaaFloat2 float2
+    #define FxaaFloat3 float3
+    #define FxaaFloat4 float4
+    #define FxaaHalf half
+    #define FxaaHalf2 half2
+    #define FxaaHalf3 half3
+    #define FxaaHalf4 half4
+    #define FxaaSat(x) saturate(x)
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_GLSL_120 == 1)
+    // Requires,
+    //  #version 120
+    // And at least,
+    //  #extension GL_EXT_gpu_shader4 : enable
+    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
+    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
+    #if (FXAA_FAST_PIXEL_OFFSET == 1)
+        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
+    #else
+        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
+    #endif
+    #if (FXAA_GATHER4_ALPHA == 1)
+        // use #extension GL_ARB_gpu_shader5 : enable
+        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
+        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
+        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
+        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_GLSL_130 == 1)
+    // Requires "#version 130" or better
+    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
+    #if (FXAA_GATHER4_ALPHA == 1)
+        // use #extension GL_ARB_gpu_shader5 : enable
+        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
+        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
+        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
+        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
+    #define FxaaInt2 float2
+    #define FxaaTex sampler2D
+    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
+    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_4 == 1)
+    #define FxaaInt2 int2
+    struct FxaaTex { SamplerState smpl; Texture2D tex; };
+    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_5 == 1)
+    #define FxaaInt2 int2
+    struct FxaaTex { SamplerState smpl; Texture2D tex; };
+    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
+    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
+    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
+    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
+    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
+#endif
+
+
+/*============================================================================
+                   GREEN AS LUMA OPTION SUPPORT FUNCTION
+============================================================================*/
+#if (FXAA_GREEN_AS_LUMA == 0)
+    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
+#else
+    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
+#endif    
+
+
+
+
+/*============================================================================
+
+                             FXAA3 QUALITY - PC
+
+============================================================================*/
+#if (FXAA_PC == 1)
+/*--------------------------------------------------------------------------*/
+FxaaFloat4 FxaaPixelShader(
+    //
+    // Use noperspective interpolation here (turn off perspective interpolation).
+    // {xy} = center of pixel
+    FxaaFloat2 pos,
+    //
+    // Used only for FXAA Console, and not used on the 360 version.
+    // Use noperspective interpolation here (turn off perspective interpolation).
+    // {xy__} = upper left of pixel
+    // {__zw} = lower right of pixel
+    FxaaFloat4 fxaaConsolePosPos,
+    //
+    // Input color texture.
+    // {rgb_} = color in linear or perceptual color space
+    // if (FXAA_GREEN_AS_LUMA == 0)
+    //     {___a} = luma in perceptual color space (not linear)
+    FxaaTex tex,
+    //
+    // Only used on the optimized 360 version of FXAA Console.
+    // For everything but 360, just use the same input here as for "tex".
+    // For 360, same texture, just alias with a 2nd sampler.
+    // This sampler needs to have an exponent bias of -1.
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    //
+    // Only used on the optimized 360 version of FXAA Console.
+    // For everything but 360, just use the same input here as for "tex".
+    // For 360, same texture, just alias with a 3nd sampler.
+    // This sampler needs to have an exponent bias of -2.
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    //
+    // Only used on FXAA Quality.
+    // This must be from a constant/uniform.
+    // {x_} = 1.0/screenWidthInPixels
+    // {_y} = 1.0/screenHeightInPixels
+    FxaaFloat2 fxaaQualityRcpFrame,
+    //
+    // Only used on FXAA Console.
+    // This must be from a constant/uniform.
+    // This effects sub-pixel AA quality and inversely sharpness.
+    //   Where N ranges between,
+    //     N = 0.50 (default)
+    //     N = 0.33 (sharper)
+    // {x___} = -N/screenWidthInPixels  
+    // {_y__} = -N/screenHeightInPixels
+    // {__z_} =  N/screenWidthInPixels  
+    // {___w} =  N/screenHeightInPixels 
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    //
+    // Only used on FXAA Console.
+    // Not used on 360, but used on PS3 and PC.
+    // This must be from a constant/uniform.
+    // {x___} = -2.0/screenWidthInPixels  
+    // {_y__} = -2.0/screenHeightInPixels
+    // {__z_} =  2.0/screenWidthInPixels  
+    // {___w} =  2.0/screenHeightInPixels 
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    //
+    // Only used on FXAA Console.
+    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
+    // This must be from a constant/uniform.
+    // {x___} =  8.0/screenWidthInPixels  
+    // {_y__} =  8.0/screenHeightInPixels
+    // {__z_} = -4.0/screenWidthInPixels  
+    // {___w} = -4.0/screenHeightInPixels 
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__SUBPIX define.
+    // It is here now to allow easier tuning.
+    // Choose the amount of sub-pixel aliasing removal.
+    // This can effect sharpness.
+    //   1.00 - upper limit (softer)
+    //   0.75 - default amount of filtering
+    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
+    //   0.25 - almost off
+    //   0.00 - completely off
+    FxaaFloat fxaaQualitySubpix,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
+    // It is here now to allow easier tuning.
+    // The minimum amount of local contrast required to apply algorithm.
+    //   0.333 - too little (faster)
+    //   0.250 - low quality
+    //   0.166 - default
+    //   0.125 - high quality 
+    //   0.063 - overkill (slower)
+    FxaaFloat fxaaQualityEdgeThreshold,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
+    // It is here now to allow easier tuning.
+    // Trims the algorithm from processing darks.
+    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
+    //   0.0625 - high quality (faster)
+    //   0.0312 - visible limit (slower)
+    // Special notes when using FXAA_GREEN_AS_LUMA,
+    //   Likely want to set this to zero.
+    //   As colors that are mostly not-green
+    //   will appear very dark in the green channel!
+    //   Tune by looking at mostly non-green content,
+    //   then start at zero and increase until aliasing is a problem.
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    // 
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
+    // It is here now to allow easier tuning.
+    // This does not effect PS3, as this needs to be compiled in.
+    //   Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
+    //   Due to the PS3 being ALU bound,
+    //   there are only three safe values here: 2 and 4 and 8.
+    //   These options use the shaders ability to a free *|/ by 2|4|8.
+    // For all other platforms can be a non-power of two.
+    //   8.0 is sharper (default!!!)
+    //   4.0 is softer
+    //   2.0 is really soft (good only for vector graphics inputs)
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    //
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
+    // It is here now to allow easier tuning.
+    // This does not effect PS3, as this needs to be compiled in.
+    //   Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
+    //   Due to the PS3 being ALU bound,
+    //   there are only two safe values here: 1/4 and 1/8.
+    //   These options use the shaders ability to a free *|/ by 2|4|8.
+    // The console setting has a different mapping than the quality setting.
+    // Other platforms can use other values.
+    //   0.125 leaves less aliasing, but is softer (default!!!)
+    //   0.25 leaves more aliasing, and is sharper
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    //
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
+    // It is here now to allow easier tuning.
+    // Trims the algorithm from processing darks.
+    // The console setting has a different mapping than the quality setting.
+    // This only applies when FXAA_EARLY_EXIT is 1.
+    // This does not apply to PS3, 
+    // PS3 was simplified to avoid more shader instructions.
+    //   0.06 - faster but more aliasing in darks
+    //   0.05 - default
+    //   0.04 - slower and less aliasing in darks
+    // Special notes when using FXAA_GREEN_AS_LUMA,
+    //   Likely want to set this to zero.
+    //   As colors that are mostly not-green
+    //   will appear very dark in the green channel!
+    //   Tune by looking at mostly non-green content,
+    //   then start at zero and increase until aliasing is a problem.
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    //    
+    // Extra constants for 360 FXAA Console only.
+    // Use zeros or anything else for other platforms.
+    // These must be in physical constant registers and NOT immedates.
+    // Immedates will result in compiler un-optimizing.
+    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posM;
+    posM.x = pos.x;
+    posM.y = pos.y;
+    #if (FXAA_GATHER4_ALPHA == 1)
+        #if (FXAA_DISCARD == 0)
+            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
+            #if (FXAA_GREEN_AS_LUMA == 0)
+                #define lumaM rgbyM.w
+            #else
+                #define lumaM rgbyM.y
+            #endif
+        #endif
+        #if (FXAA_GREEN_AS_LUMA == 0)
+            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
+            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
+        #else
+            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
+            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
+        #endif
+        #if (FXAA_DISCARD == 1)
+            #define lumaM luma4A.w
+        #endif
+        #define lumaE luma4A.z
+        #define lumaS luma4A.x
+        #define lumaSE luma4A.y
+        #define lumaNW luma4B.w
+        #define lumaN luma4B.z
+        #define lumaW luma4B.x
+    #else
+        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
+        #if (FXAA_GREEN_AS_LUMA == 0)
+            #define lumaM rgbyM.w
+        #else
+            #define lumaM rgbyM.y
+        #endif
+        FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat maxSM = max(lumaS, lumaM);
+    FxaaFloat minSM = min(lumaS, lumaM);
+    FxaaFloat maxESM = max(lumaE, maxSM);
+    FxaaFloat minESM = min(lumaE, minSM);
+    FxaaFloat maxWN = max(lumaN, lumaW);
+    FxaaFloat minWN = min(lumaN, lumaW);
+    FxaaFloat rangeMax = max(maxWN, maxESM);
+    FxaaFloat rangeMin = min(minWN, minESM);
+    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
+    FxaaFloat range = rangeMax - rangeMin;
+    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
+    FxaaBool earlyExit = range < rangeMaxClamped;
+/*--------------------------------------------------------------------------*/
+    if(earlyExit)
+        #if (FXAA_DISCARD == 1)
+            FxaaDiscard;
+        #else
+            return rgbyM;
+        #endif
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_GATHER4_ALPHA == 0)
+        FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
+    #else
+        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNS = lumaN + lumaS;
+    FxaaFloat lumaWE = lumaW + lumaE;
+    FxaaFloat subpixRcpRange = 1.0/range;
+    FxaaFloat subpixNSWE = lumaNS + lumaWE;
+    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
+    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNESE = lumaNE + lumaSE;
+    FxaaFloat lumaNWNE = lumaNW + lumaNE;
+    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
+    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNWSW = lumaNW + lumaSW;
+    FxaaFloat lumaSWSE = lumaSW + lumaSE;
+    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
+    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
+    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
+    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
+    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
+    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
+    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
+    FxaaBool horzSpan = edgeHorz >= edgeVert;
+    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
+/*--------------------------------------------------------------------------*/
+    if(!horzSpan) lumaN = lumaW;
+    if(!horzSpan) lumaS = lumaE;
+    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
+    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat gradientN = lumaN - lumaM;
+    FxaaFloat gradientS = lumaS - lumaM;
+    FxaaFloat lumaNN = lumaN + lumaM;
+    FxaaFloat lumaSS = lumaS + lumaM;
+    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
+    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
+    if(pairN) lengthSign = -lengthSign;
+    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posB;
+    posB.x = posM.x;
+    posB.y = posM.y;
+    FxaaFloat2 offNP;
+    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
+    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
+    if(!horzSpan) posB.x += lengthSign * 0.5;
+    if( horzSpan) posB.y += lengthSign * 0.5;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posN;
+    posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
+    posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
+    FxaaFloat2 posP;
+    posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
+    posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
+    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
+    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
+    FxaaFloat subpixE = subpixC * subpixC;
+    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
+/*--------------------------------------------------------------------------*/
+    if(!pairN) lumaNN = lumaSS;
+    FxaaFloat gradientScaled = gradient * 1.0/4.0;
+    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
+    FxaaFloat subpixF = subpixD * subpixE;
+    FxaaBool lumaMLTZero = lumaMM < 0.0;
+/*--------------------------------------------------------------------------*/
+    lumaEndN -= lumaNN * 0.5;
+    lumaEndP -= lumaNN * 0.5;
+    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
+    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
+    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
+    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
+    FxaaBool doneNP = (!doneN) || (!doneP);
+    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
+    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
+/*--------------------------------------------------------------------------*/
+    if(doneNP) {
+        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+        doneN = abs(lumaEndN) >= gradientScaled;
+        doneP = abs(lumaEndP) >= gradientScaled;
+        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
+        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
+        doneNP = (!doneN) || (!doneP);
+        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
+        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
+/*--------------------------------------------------------------------------*/
+        #if (FXAA_QUALITY__PS > 3)
+        if(doneNP) {
+            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+            doneN = abs(lumaEndN) >= gradientScaled;
+            doneP = abs(lumaEndP) >= gradientScaled;
+            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
+            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
+            doneNP = (!doneN) || (!doneP);
+            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
+            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
+/*--------------------------------------------------------------------------*/
+            #if (FXAA_QUALITY__PS > 4)
+            if(doneNP) {
+                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                doneN = abs(lumaEndN) >= gradientScaled;
+                doneP = abs(lumaEndP) >= gradientScaled;
+                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
+                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
+                doneNP = (!doneN) || (!doneP);
+                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
+                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
+/*--------------------------------------------------------------------------*/
+                #if (FXAA_QUALITY__PS > 5)
+                if(doneNP) {
+                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                    doneN = abs(lumaEndN) >= gradientScaled;
+                    doneP = abs(lumaEndP) >= gradientScaled;
+                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
+                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
+                    doneNP = (!doneN) || (!doneP);
+                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
+                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
+/*--------------------------------------------------------------------------*/
+                    #if (FXAA_QUALITY__PS > 6)
+                    if(doneNP) {
+                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                        doneN = abs(lumaEndN) >= gradientScaled;
+                        doneP = abs(lumaEndP) >= gradientScaled;
+                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
+                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
+                        doneNP = (!doneN) || (!doneP);
+                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
+                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
+/*--------------------------------------------------------------------------*/
+                        #if (FXAA_QUALITY__PS > 7)
+                        if(doneNP) {
+                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                            doneN = abs(lumaEndN) >= gradientScaled;
+                            doneP = abs(lumaEndP) >= gradientScaled;
+                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
+                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
+                            doneNP = (!doneN) || (!doneP);
+                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
+                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_QUALITY__PS > 8)
+    if(doneNP) {
+        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+        doneN = abs(lumaEndN) >= gradientScaled;
+        doneP = abs(lumaEndP) >= gradientScaled;
+        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
+        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
+        doneNP = (!doneN) || (!doneP);
+        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
+        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
+/*--------------------------------------------------------------------------*/
+        #if (FXAA_QUALITY__PS > 9)
+        if(doneNP) {
+            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+            doneN = abs(lumaEndN) >= gradientScaled;
+            doneP = abs(lumaEndP) >= gradientScaled;
+            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
+            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
+            doneNP = (!doneN) || (!doneP);
+            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
+            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
+/*--------------------------------------------------------------------------*/
+            #if (FXAA_QUALITY__PS > 10)
+            if(doneNP) {
+                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                doneN = abs(lumaEndN) >= gradientScaled;
+                doneP = abs(lumaEndP) >= gradientScaled;
+                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
+                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
+                doneNP = (!doneN) || (!doneP);
+                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
+                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
+/*--------------------------------------------------------------------------*/
+                #if (FXAA_QUALITY__PS > 11)
+                if(doneNP) {
+                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                    doneN = abs(lumaEndN) >= gradientScaled;
+                    doneP = abs(lumaEndP) >= gradientScaled;
+                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
+                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
+                    doneNP = (!doneN) || (!doneP);
+                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
+                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
+/*--------------------------------------------------------------------------*/
+                    #if (FXAA_QUALITY__PS > 12)
+                    if(doneNP) {
+                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                        doneN = abs(lumaEndN) >= gradientScaled;
+                        doneP = abs(lumaEndP) >= gradientScaled;
+                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
+                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
+                        doneNP = (!doneN) || (!doneP);
+                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
+                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
+/*--------------------------------------------------------------------------*/
+                    }
+                    #endif
+/*--------------------------------------------------------------------------*/
+                }
+                #endif
+/*--------------------------------------------------------------------------*/
+            }
+            #endif
+/*--------------------------------------------------------------------------*/
+        }
+        #endif
+/*--------------------------------------------------------------------------*/
+    }
+    #endif
+/*--------------------------------------------------------------------------*/
+                        }
+                        #endif
+/*--------------------------------------------------------------------------*/
+                    }
+                    #endif
+/*--------------------------------------------------------------------------*/
+                }
+                #endif
+/*--------------------------------------------------------------------------*/
+            }
+            #endif
+/*--------------------------------------------------------------------------*/
+        }
+        #endif
+/*--------------------------------------------------------------------------*/
+    }
+/*--------------------------------------------------------------------------*/
+    FxaaFloat dstN = posM.x - posN.x;
+    FxaaFloat dstP = posP.x - posM.x;
+    if(!horzSpan) dstN = posM.y - posN.y;
+    if(!horzSpan) dstP = posP.y - posM.y;
+/*--------------------------------------------------------------------------*/
+    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
+    FxaaFloat spanLength = (dstP + dstN);
+    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
+    FxaaFloat spanLengthRcp = 1.0/spanLength;
+/*--------------------------------------------------------------------------*/
+    FxaaBool directionN = dstN < dstP;
+    FxaaFloat dst = min(dstN, dstP);
+    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
+    FxaaFloat subpixG = subpixF * subpixF;
+    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
+    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
+    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
+    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
+    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
+    #if (FXAA_DISCARD == 1)
+        return FxaaTexTop(tex, posM);
+    #else
+        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
+    #endif
+}
+/*==========================================================================*/
+#endif
+
+
+
+
+/*============================================================================
+
+                         FXAA3 CONSOLE - PC VERSION
+                         
+------------------------------------------------------------------------------
+Instead of using this on PC, I'd suggest just using FXAA Quality with
+    #define FXAA_QUALITY__PRESET 10
+Or 
+    #define FXAA_QUALITY__PRESET 20
+Either are higher qualilty and almost as fast as this on modern PC GPUs.
+============================================================================*/
+#if (FXAA_PC_CONSOLE == 1)
+/*--------------------------------------------------------------------------*/
+FxaaFloat4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
+    FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
+    FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
+    FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        FxaaFloat lumaM = rgbyM.w;
+    #else
+        FxaaFloat lumaM = rgbyM.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
+    lumaNe += 1.0/384.0;
+    FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
+    FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
+    FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMinM = min(lumaMin, lumaM);
+    FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
+    FxaaFloat lumaMaxM = max(lumaMax, lumaM);
+    FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
+    FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
+    FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
+    if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 dir;
+    dir.x = dirSwMinusNe + dirSeMinusNw;
+    dir.y = dirSwMinusNe - dirSeMinusNw;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 dir1 = normalize(dir.xy);
+    FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
+    FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
+    FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
+    FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
+    FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
+    #else
+        FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
+    #endif
+    if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
+    return rgbyB; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+                      FXAA3 CONSOLE - 360 PIXEL SHADER 
+
+------------------------------------------------------------------------------
+This optimized version thanks to suggestions from Andy Luedke.
+Should be fully tex bound in all cases.
+As of the FXAA 3.11 release, I have still not tested this code,
+however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
+And note this is replacing the old unoptimized version.
+If it does not work, please let me know so I can fix it.
+============================================================================*/
+#if (FXAA_360 == 1)
+/*--------------------------------------------------------------------------*/
+[reduceTempRegUsage(4)]
+float4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    float4 lumaNwNeSwSe;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        asm { 
+            tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
+        };
+    #else
+        asm { 
+            tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
+        };
+    #endif
+/*--------------------------------------------------------------------------*/
+    lumaNwNeSwSe.y += 1.0/384.0;
+    float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
+    float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
+    float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
+    float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
+/*--------------------------------------------------------------------------*/
+    float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        float lumaMinM = min(lumaMin, rgbyM.w);
+        float lumaMaxM = max(lumaMax, rgbyM.w);
+    #else
+        float lumaMinM = min(lumaMin, rgbyM.y);
+        float lumaMaxM = max(lumaMax, rgbyM.y);
+    #endif        
+    if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
+/*--------------------------------------------------------------------------*/
+    float2 dir;
+    dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
+    dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
+    dir = normalize(dir);
+/*--------------------------------------------------------------------------*/
+    float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
+/*--------------------------------------------------------------------------*/
+    float4 dir2;
+    float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
+    dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
+    dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
+/*--------------------------------------------------------------------------*/
+    float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
+    float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
+    float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
+    float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
+/*--------------------------------------------------------------------------*/
+    float4 rgbyA = rgbyN1 + rgbyP1;
+    float4 rgbyB = rgbyN2 + rgbyP2 * 0.5 + rgbyA;
+/*--------------------------------------------------------------------------*/
+    float4 rgbyR = ((rgbyB.w - lumaMax) > 0.0) ? rgbyA : rgbyB;
+    rgbyR = ((rgbyB.w - lumaMin) > 0.0) ? rgbyR : rgbyA;
+    return rgbyR; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+         FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
+
+==============================================================================
+The code below does not exactly match the assembly.
+I have a feeling that 12 cycles is possible, but was not able to get there.
+Might have to increase register count to get full performance.
+Note this shader does not use perspective interpolation.
+
+Use the following cgc options,
+
+  --fenable-bx2 --fastmath --fastprecision --nofloatbindings
+
+------------------------------------------------------------------------------
+                             NVSHADERPERF OUTPUT
+------------------------------------------------------------------------------
+For reference and to aid in debug, output of NVShaderPerf should match this,
+
+Shader to schedule:
+  0: texpkb h0.w(TRUE), v5.zyxx, #0
+  2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
+  4: texpkb h0.w(TRUE), v5.xwxx, #0
+  6: addh h0.z(TRUE), -h2, h0.w
+  7: texpkb h1.w(TRUE), v5, #0
+  9: addh h0.x(TRUE), h0.z, -h1.w
+ 10: addh h3.w(TRUE), h0.z, h1
+ 11: texpkb h2.w(TRUE), v5.zwzz, #0
+ 13: addh h0.z(TRUE), h3.w, -h2.w
+ 14: addh h0.x(TRUE), h2.w, h0
+ 15: nrmh h1.xz(TRUE), h0_n
+ 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
+ 17: maxh h4.w(TRUE), h0, h1
+ 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
+ 19: movr r1.zw(TRUE), v4.xxxy
+ 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
+ 22: minh h5.w(TRUE), h0, h1
+ 23: texpkb h0(TRUE), r2.xzxx, #0
+ 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
+ 27: maxh h4.x(TRUE), h2.z, h2.w
+ 28: texpkb h1(TRUE), r0.zwzz, #0
+ 30: addh_d2 h1(TRUE), h0, h1
+ 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 33: texpkb h0(TRUE), r0, #0
+ 35: minh h4.z(TRUE), h2, h2.w
+ 36: fenct TRUE
+ 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 39: texpkb h2(TRUE), r1, #0
+ 41: addh_d2 h0(TRUE), h0, h2
+ 42: maxh h2.w(TRUE), h4, h4.x
+ 43: minh h2.x(TRUE), h5.w, h4.z
+ 44: addh_d2 h0(TRUE), h0, h1
+ 45: slth h2.x(TRUE), h0.w, h2
+ 46: sgth h2.w(TRUE), h0, h2
+ 47: movh h0(TRUE), h0
+ 48: addx.c0 rc(TRUE), h2, h2.w
+ 49: movh h0(c0.NE.x), h1
+
+IPU0 ------ Simplified schedule: --------
+Pass |  Unit  |  uOp |  PC:  Op
+-----+--------+------+-------------------------
+   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |   SCB1 |  add |   2:  ADDh h2.z, h0.--w-, const.--x-;
+     |        |      |
+   2 | SCT0/1 |  mov |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |    TEX |  txl |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |   SCB1 |  add |   6:  ADDh h0.z,-h2, h0.--w-;
+     |        |      |
+   3 | SCT0/1 |  mov |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
+     |    TEX |  txl |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
+     |   SCB0 |  add |   9:  ADDh h0.x, h0.z---,-h1.w---;
+     |   SCB1 |  add |  10:  ADDh h3.w, h0.---z, h1;
+     |        |      |
+   4 | SCT0/1 |  mov |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |   SCB0 |  add |  14:  ADDh h0.x, h2.w---, h0;
+     |   SCB1 |  add |  13:  ADDh h0.z, h3.--w-,-h2.--w-;
+     |        |      |
+   5 |   SCT1 |  mov |  15:  NRMh h1.xz, h0;
+     |    SRB |  nrm |  15:  NRMh h1.xz, h0;
+     |   SCB0 |  min |  16:  MINh*8 h0.x, |h1|, |h1.z---|;
+     |   SCB1 |  max |  17:  MAXh h4.w, h0, h1;
+     |        |      |
+   6 |   SCT0 |  div |  18:  DIVx h2.xy, h1.xz--, h0;
+     |   SCT1 |  mov |  19:  MOVr r1.zw, g[TEX0].--xy;
+     |   SCB0 |  mad |  20:  MADr r2.xz,-h1, const.z-w-, r1.z-w-;
+     |   SCB1 |  min |  22:  MINh h5.w, h0, h1;
+     |        |      |
+   7 | SCT0/1 |  mov |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
+     |    TEX |  txl |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
+     |   SCB0 |  max |  27:  MAXh h4.x, h2.z---, h2.w---;
+     |   SCB1 |  mad |  25:  MADr r0.zw, h1.--xz, const, r1;
+     |        |      |
+   8 | SCT0/1 |  mov |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
+     | SCB0/1 |  add |  30:  ADDh/2 h1, h0, h1;
+     |        |      |
+   9 |   SCT0 |  mad |  31:  MADr r0.xy,-h2, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  33:  TXLr h0, r0, const.zzzz, TEX0;
+     |    TEX |  txl |  33:  TXLr h0, r0, const.zzzz, TEX0;
+     |   SCB1 |  min |  35:  MINh h4.z, h2, h2.--w-;
+     |        |      |
+  10 |   SCT0 |  mad |  37:  MADr r1.xy, h2, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  39:  TXLr h2, r1, const.zzzz, TEX0;
+     |    TEX |  txl |  39:  TXLr h2, r1, const.zzzz, TEX0;
+     | SCB0/1 |  add |  41:  ADDh/2 h0, h0, h2;
+     |        |      |
+  11 |   SCT0 |  min |  43:  MINh h2.x, h5.w---, h4.z---;
+     |   SCT1 |  max |  42:  MAXh h2.w, h4, h4.---x;
+     | SCB0/1 |  add |  44:  ADDh/2 h0, h0, h1;
+     |        |      |
+  12 |   SCT0 |  set |  45:  SLTh h2.x, h0.w---, h2;
+     |   SCT1 |  set |  46:  SGTh h2.w, h0, h2;
+     | SCB0/1 |  mul |  47:  MOVh h0, h0;
+     |        |      |
+  13 |   SCT0 |  mad |  48:  ADDxc0_s rc, h2, h2.w---;
+     | SCB0/1 |  mul |  49:  MOVh h0(NE0.xxxx), h1;
  
+Pass   SCT  TEX  SCB
+  1:   0% 100%  25%
+  2:   0% 100%  25%
+  3:   0% 100%  50%
+  4:   0% 100%  50%
+  5:   0%   0%  50%
+  6: 100%   0%  75%
+  7:   0% 100%  75%
+  8:   0% 100% 100%
+  9:   0% 100%  25%
+ 10:   0% 100% 100%
+ 11:  50%   0% 100%
+ 12:  50%   0% 100%
+ 13:  25%   0% 100%
 
+MEAN:  17%  61%  67%
 
-#extension GL_ARB_texture_rectangle : enable
+Pass   SCT0  SCT1   TEX  SCB0  SCB1
+  1:    0%    0%  100%    0%  100%
+  2:    0%    0%  100%    0%  100%
+  3:    0%    0%  100%  100%  100%
+  4:    0%    0%  100%  100%  100%
+  5:    0%    0%    0%  100%  100%
+  6:  100%  100%    0%  100%  100%
+  7:    0%    0%  100%  100%  100%
+  8:    0%    0%  100%  100%  100%
+  9:    0%    0%  100%    0%  100%
+ 10:    0%    0%  100%  100%  100%
+ 11:  100%  100%    0%  100%  100%
+ 12:  100%  100%    0%  100%  100%
+ 13:  100%    0%    0%  100%  100%
+
+MEAN:   30%   23%   61%   76%  100%
+Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
+Results 13 cycles, 3 r regs, 923,076,923 pixels/s
+============================================================================*/
+#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
+/*--------------------------------------------------------------------------*/
+#pragma regcount 7
+#pragma disablepc all
+#pragma option O3
+#pragma option OutColorPrec=fp16
+#pragma texformat default RGBA8
+/*==========================================================================*/
+half4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+// (1)
+    half4 dir;
+    half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        lumaNe.w += half(1.0/512.0);
+        dir.x = -lumaNe.w;
+        dir.z = -lumaNe.w;
+    #else
+        lumaNe.y += half(1.0/512.0);
+        dir.x = -lumaNe.y;
+        dir.z = -lumaNe.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (2)
+    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x += lumaSw.w;
+        dir.z += lumaSw.w;
+    #else
+        dir.x += lumaSw.y;
+        dir.z += lumaSw.y;
+    #endif        
+/*--------------------------------------------------------------------------*/
+// (3)
+    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x -= lumaNw.w;
+        dir.z += lumaNw.w;
+    #else
+        dir.x -= lumaNw.y;
+        dir.z += lumaNw.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (4)
+    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x += lumaSe.w;
+        dir.z -= lumaSe.w;
+    #else
+        dir.x += lumaSe.y;
+        dir.z -= lumaSe.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (5)
+    half4 dir1_pos;
+    dir1_pos.xy = normalize(dir.xyz).xz;
+    half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
+/*--------------------------------------------------------------------------*/
+// (6)
+    half4 dir2_pos;
+    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
+    dir1_pos.zw = pos.xy;
+    dir2_pos.zw = pos.xy;
+    half4 temp1N;
+    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+/*--------------------------------------------------------------------------*/
+// (7)
+    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
+    half4 rgby1;
+    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+/*--------------------------------------------------------------------------*/
+// (8)
+    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
+    rgby1 = (temp1N + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (9)
+    half4 temp2N;
+    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
+/*--------------------------------------------------------------------------*/
+// (10)
+    half4 rgby2;
+    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
+    rgby2 = (temp2N + rgby2) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (11)
+    // compilier moves these scalar ops up to other cycles
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
+        half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
+    #else
+        half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
+        half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
+    #endif        
+    rgby2 = (rgby2 + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (12)
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        bool twoTapLt = rgby2.w < lumaMin;
+        bool twoTapGt = rgby2.w > lumaMax;
+    #else
+        bool twoTapLt = rgby2.y < lumaMin;
+        bool twoTapGt = rgby2.y > lumaMax;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (13)
+    if(twoTapLt || twoTapGt) rgby2 = rgby1;
+/*--------------------------------------------------------------------------*/
+    return rgby2; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+       FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
+
+==============================================================================
+The code mostly matches the assembly.
+I have a feeling that 14 cycles is possible, but was not able to get there.
+Might have to increase register count to get full performance.
+Note this shader does not use perspective interpolation.
+
+Use the following cgc options,
+
+ --fenable-bx2 --fastmath --fastprecision --nofloatbindings
+
+Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
+Will look at fixing this for FXAA 3.12.
+------------------------------------------------------------------------------
+                             NVSHADERPERF OUTPUT
+------------------------------------------------------------------------------
+For reference and to aid in debug, output of NVShaderPerf should match this,
+
+Shader to schedule:
+  0: texpkb h0.w(TRUE), v5.zyxx, #0
+  2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
+  4: texpkb h1.w(TRUE), v5.xwxx, #0
+  6: addh h0.x(TRUE), h1.w, -h2.y
+  7: texpkb h2.w(TRUE), v5.zwzz, #0
+  9: minh h4.w(TRUE), h2.y, h2
+ 10: maxh h5.x(TRUE), h2.y, h2.w
+ 11: texpkb h0.w(TRUE), v5, #0
+ 13: addh h3.w(TRUE), -h0, h0.x
+ 14: addh h0.x(TRUE), h0.w, h0
+ 15: addh h0.z(TRUE), -h2.w, h0.x
+ 16: addh h0.x(TRUE), h2.w, h3.w
+ 17: minh h5.y(TRUE), h0.w, h1.w
+ 18: nrmh h2.xz(TRUE), h0_n
+ 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
+ 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
+ 21: movr r1.zw(TRUE), v4.xxxy
+ 22: maxh h2.w(TRUE), h0, h1
+ 23: fenct TRUE
+ 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
+ 26: texpkb h0(TRUE), r0, #0
+ 28: maxh h5.x(TRUE), h2.w, h5
+ 29: minh h5.w(TRUE), h5.y, h4
+ 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
+ 32: texpkb h2(TRUE), r1, #0
+ 34: addh_d2 h2(TRUE), h0, h2
+ 35: texpkb h1(TRUE), v4, #0
+ 37: maxh h5.y(TRUE), h5.x, h1.w
+ 38: minh h4.w(TRUE), h1, h5
+ 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 41: texpkb h0(TRUE), r0, #0
+ 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
+ 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 46: texpkb h3(TRUE), r2, #0
+ 48: addh_d2 h0(TRUE), h0, h3
+ 49: addh_d2 h3(TRUE), h0, h2
+ 50: movh h0(TRUE), h3
+ 51: slth h3.x(TRUE), h3.w, h5.w
+ 52: sgth h3.w(TRUE), h3, h5.x
+ 53: addx.c0 rc(TRUE), h3.x, h3
+ 54: slth.c0 rc(TRUE), h5.z, h5
+ 55: movh h0(c0.NE.w), h2
+ 56: movh h0(c0.NE.x), h1
+
+IPU0 ------ Simplified schedule: --------
+Pass |  Unit  |  uOp |  PC:  Op
+-----+--------+------+-------------------------
+   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |   SCB0 |  add |   2:  ADDh h2.y, h0.-w--, const.-x--;
+     |        |      |
+   2 | SCT0/1 |  mov |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |    TEX |  txl |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |   SCB0 |  add |   6:  ADDh h0.x, h1.w---,-h2.y---;
+     |        |      |
+   3 | SCT0/1 |  mov |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |   SCB0 |  max |  10:  MAXh h5.x, h2.y---, h2.w---;
+     |   SCB1 |  min |   9:  MINh h4.w, h2.---y, h2;
+     |        |      |
+   4 | SCT0/1 |  mov |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
+     |    TEX |  txl |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
+     |   SCB0 |  add |  14:  ADDh h0.x, h0.w---, h0;
+     |   SCB1 |  add |  13:  ADDh h3.w,-h0, h0.---x;
+     |        |      |
+   5 |   SCT0 |  mad |  16:  ADDh h0.x, h2.w---, h3.w---;
+     |   SCT1 |  mad |  15:  ADDh h0.z,-h2.--w-, h0.--x-;
+     |   SCB0 |  min |  17:  MINh h5.y, h0.-w--, h1.-w--;
+     |        |      |
+   6 |   SCT1 |  mov |  18:  NRMh h2.xz, h0;
+     |    SRB |  nrm |  18:  NRMh h2.xz, h0;
+     |   SCB1 |  min |  19:  MINh*8 h2.w, |h2.---x|, |h2.---z|;
+     |        |      |
+   7 |   SCT0 |  div |  20:  DIVx h4.xy, h2.xz--, h2.ww--;
+     |   SCT1 |  mov |  21:  MOVr r1.zw, g[TEX0].--xy;
+     |   SCB1 |  max |  22:  MAXh h2.w, h0, h1;
+     |        |      |
+   8 |   SCT0 |  mad |  24:  MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
+     |   SCT1 |  mov |  26:  TXLr h0, r0, const.xxxx, TEX0;
+     |    TEX |  txl |  26:  TXLr h0, r0, const.xxxx, TEX0;
+     |   SCB0 |  max |  28:  MAXh h5.x, h2.w---, h5;
+     |   SCB1 |  min |  29:  MINh h5.w, h5.---y, h4;
+     |        |      |
+   9 |   SCT0 |  mad |  30:  MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
+     |   SCT1 |  mov |  32:  TXLr h2, r1, const.xxxx, TEX0;
+     |    TEX |  txl |  32:  TXLr h2, r1, const.xxxx, TEX0;
+     | SCB0/1 |  add |  34:  ADDh/2 h2, h0, h2;
+     |        |      |
+  10 | SCT0/1 |  mov |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
+     |    TEX |  txl |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
+     |   SCB0 |  max |  37:  MAXh h5.y, h5.-x--, h1.-w--;
+     |   SCB1 |  min |  38:  MINh h4.w, h1, h5;
+     |        |      |
+  11 |   SCT0 |  mad |  39:  MADr r0.xy,-h4, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  41:  TXLr h0, r0, const.zzzz, TEX0;
+     |    TEX |  txl |  41:  TXLr h0, r0, const.zzzz, TEX0;
+     |   SCB0 |  mad |  44:  MADr r2.xy, h4, const.xy--, r1.zw--;
+     |   SCB1 |  add |  43:  ADDh*8 h5.z, h5.--y-,-h4.--w-;
+     |        |      |
+  12 | SCT0/1 |  mov |  46:  TXLr h3, r2, const.xxxx, TEX0;
+     |    TEX |  txl |  46:  TXLr h3, r2, const.xxxx, TEX0;
+     | SCB0/1 |  add |  48:  ADDh/2 h0, h0, h3;
+     |        |      |
+  13 | SCT0/1 |  mad |  49:  ADDh/2 h3, h0, h2;
+     | SCB0/1 |  mul |  50:  MOVh h0, h3;
+     |        |      |
+  14 |   SCT0 |  set |  51:  SLTh h3.x, h3.w---, h5.w---;
+     |   SCT1 |  set |  52:  SGTh h3.w, h3, h5.---x;
+     |   SCB0 |  set |  54:  SLThc0 rc, h5.z---, h5;
+     |   SCB1 |  add |  53:  ADDxc0_s rc, h3.---x, h3;
+     |        |      |
+  15 | SCT0/1 |  mul |  55:  MOVh h0(NE0.wwww), h2;
+     | SCB0/1 |  mul |  56:  MOVh h0(NE0.xxxx), h1;
+ 
+Pass   SCT  TEX  SCB
+  1:   0% 100%  25%
+  2:   0% 100%  25%
+  3:   0% 100%  50%
+  4:   0% 100%  50%
+  5:  50%   0%  25%
+  6:   0%   0%  25%
+  7: 100%   0%  25%
+  8:   0% 100%  50%
+  9:   0% 100% 100%
+ 10:   0% 100%  50%
+ 11:   0% 100%  75%
+ 12:   0% 100% 100%
+ 13: 100%   0% 100%
+ 14:  50%   0%  50%
+ 15: 100%   0% 100%
+
+MEAN:  26%  60%  56%
+
+Pass   SCT0  SCT1   TEX  SCB0  SCB1
+  1:    0%    0%  100%  100%    0%
+  2:    0%    0%  100%  100%    0%
+  3:    0%    0%  100%  100%  100%
+  4:    0%    0%  100%  100%  100%
+  5:  100%  100%    0%  100%    0%
+  6:    0%    0%    0%    0%  100%
+  7:  100%  100%    0%    0%  100%
+  8:    0%    0%  100%  100%  100%
+  9:    0%    0%  100%  100%  100%
+ 10:    0%    0%  100%  100%  100%
+ 11:    0%    0%  100%  100%  100%
+ 12:    0%    0%  100%  100%  100%
+ 13:  100%  100%    0%  100%  100%
+ 14:  100%  100%    0%  100%  100%
+ 15:  100%  100%    0%  100%  100%
+
+MEAN:   33%   33%   60%   86%   80%
+Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
+Results 15 cycles, 3 r regs, 800,000,000 pixels/s
+============================================================================*/
+#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
+/*--------------------------------------------------------------------------*/
+#pragma regcount 7
+#pragma disablepc all
+#pragma option O2
+#pragma option OutColorPrec=fp16
+#pragma texformat default RGBA8
+/*==========================================================================*/
+half4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+// (1)
+    half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaNe = rgbyNe.w + half(1.0/512.0);
+    #else
+        half lumaNe = rgbyNe.y + half(1.0/512.0);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (2)
+    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaSwNegNe = lumaSw.w - lumaNe;
+    #else
+        half lumaSwNegNe = lumaSw.y - lumaNe;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (3)
+    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
+        half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
+    #else
+        half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
+        half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (4)
+    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half dirZ =  lumaNw.w + lumaSwNegNe;
+        half dirX = -lumaNw.w + lumaSwNegNe;
+    #else
+        half dirZ =  lumaNw.y + lumaSwNegNe;
+        half dirX = -lumaNw.y + lumaSwNegNe;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (5)
+    half3 dir;
+    dir.y = 0.0;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x =  lumaSe.w + dirX;
+        dir.z = -lumaSe.w + dirZ;
+        half lumaMinNeSe = min(lumaNe, lumaSe.w);
+    #else
+        dir.x =  lumaSe.y + dirX;
+        dir.z = -lumaSe.y + dirZ;
+        half lumaMinNeSe = min(lumaNe, lumaSe.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (6)
+    half4 dir1_pos;
+    dir1_pos.xy = normalize(dir).xz;
+    half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
+/*--------------------------------------------------------------------------*/
+// (7)
+    half4 dir2_pos;
+    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
+    dir1_pos.zw = pos.xy;
+    dir2_pos.zw = pos.xy;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxNeSe = max(lumaNe, lumaSe.w);
+    #else
+        half lumaMaxNeSe = max(lumaNe, lumaSe.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (8)
+    half4 temp1N;
+    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
+    half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
+    half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
+/*--------------------------------------------------------------------------*/
+// (9)
+    half4 rgby1;
+    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
+    rgby1 = (temp1N + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (10)
+    half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxM = max(lumaMax, rgbyM.w);
+        half lumaMinM = min(lumaMin, rgbyM.w);
+    #else
+        half lumaMaxM = max(lumaMax, rgbyM.y);
+        half lumaMinM = min(lumaMin, rgbyM.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (11)
+    half4 temp2N;
+    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
+    half4 rgby2;
+    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
+/*--------------------------------------------------------------------------*/
+// (12)
+    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
+    rgby2 = (temp2N + rgby2) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (13)
+    rgby2 = (rgby2 + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (14)
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        bool twoTapLt = rgby2.w < lumaMin;
+        bool twoTapGt = rgby2.w > lumaMax;
+    #else
+        bool twoTapLt = rgby2.y < lumaMin;
+        bool twoTapGt = rgby2.y > lumaMax;
+    #endif
+    bool earlyExit = lumaRangeM < lumaMax;
+    bool twoTap = twoTapLt || twoTapGt;
+/*--------------------------------------------------------------------------*/
+// (15)
+    if(twoTap) rgby2 = rgby1;
+    if(earlyExit) rgby2 = rgbyM;
+/*--------------------------------------------------------------------------*/
+    return rgby2; }
+/*==========================================================================*/
+#endif
 
-uniform sampler2DRect diffuseRect;
-uniform sampler2DRect edgeMap;
+uniform sampler2D diffuseMap;
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
-uniform sampler2D bloomMap;
+
+uniform vec2 tc_scale;
+uniform vec2 rcp_screen_res;
+uniform vec4 rcp_frame_opt;
+uniform vec4 rcp_frame_opt2;
+uniform vec2 screen_res;
 
 uniform float depth_cutoff;
 uniform float norm_cutoff;
@@ -41,9 +2095,10 @@ uniform float tan_pixel_angle;
 uniform float magnification;
 
 uniform mat4 inv_proj;
-uniform vec2 screen_res;
 
 varying vec2 vary_fragcoord;
+varying vec2 vary_tc;
+
 
 float getDepth(vec2 pos_screen)
 {
@@ -76,8 +2131,8 @@ void dofSampleNear(inout vec4 diff, inout float w, float cur_sc, vec2 tc)
 	float sc = calc_cof(d);
 	
 	float wg = 0.25;
-		
-	vec4 s = texture2DRect(diffuseRect, tc);
+	
+	vec4 s = texture2D(diffuseMap, tc*tc_scale/screen_res);
 	// de-weight dull areas to make highlights 'pop'
 	wg += s.r+s.g+s.b;
 	
@@ -97,7 +2152,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ve
 	{
 		float wg = 0.25;
 		
-		vec4 s = texture2DRect(diffuseRect, tc);
+		vec4 s = texture2D(diffuseMap, tc*tc_scale/screen_res);
 		// de-weight dull areas to make highlights 'pop'
 		wg += s.r+s.g+s.b;
 	
@@ -107,7 +2162,6 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ve
 	}
 }
 
-
 void main() 
 {
 	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
@@ -117,7 +2171,7 @@ void main()
 	
 	float depth = getDepth(tc);
 	
-	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
+	vec4 diff = texture2D(diffuseMap, vary_fragcoord.xy*tc_scale/screen_res);
 	
 	{ 
 		float w = 1.0;
@@ -131,6 +2185,7 @@ void main()
 
 		// sample quite uniformly spaced points within a circle, for a circular 'bokeh'		
 		//if (depth < focal_distance)
+		if (sc > 0.5)
 		{
 			while (sc > 0.5)
 			{
@@ -146,10 +2201,30 @@ void main()
 				sc -= 1.0;
 			}
 		}
+		else
+		{
+				diff =			FxaaPixelShader(vary_tc,			//pos
+										vec4(vary_fragcoord.xy, 0, 0), //fxaaConsolePosPos
+										diffuseMap,					//tex
+										diffuseMap,					
+										diffuseMap,
+										rcp_screen_res,				//fxaaQualityRcpFrame
+										vec4(0,0,0,0),				//fxaaConsoleRcpFrameOpt
+										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
+										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
+										0.75,						//fxaaQualitySubpix
+										0.166,						//fxaaQualityEdgeThreshold
+										0.0833,						//fxaaQualityEdgeThresholdMin
+										8.0,						//fxaaConsoleEdgeSharpness
+										0.125,						//fxaaConsoleEdgeThreshold
+										0.05,						//fxaaConsoleEdgeThresholdMin
+										vec4(0,0,0,0));				//fxaaConsole360ConstDir
+
+
+		}
 		
 		diff /= w;
 	}
 		
-	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor = diff + bloom;
+	gl_FragColor = diff;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
new file mode 100644
index 00000000000..d43bf3fb50d
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -0,0 +1,31 @@
+/** 
+ * @file debugF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+uniform vec4 color;
+
+void main() 
+{
+	gl_FragColor = color;
+}
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
new file mode 100644
index 00000000000..2f64fdb7bc6
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
@@ -0,0 +1,32 @@
+/** 
+ * @file debugV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+attribute vec3 position;
+
+void main()
+{
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
new file mode 100644
index 00000000000..c263f4dc6a9
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -0,0 +1,33 @@
+/** 
+ * @file splattexturerectF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+#extension GL_ARB_texture_rectangle : enable
+
+uniform sampler2DRect screenMap;
+
+void main() 
+{
+	gl_FragColor = 	texture2DRect(screenMap, gl_TexCoord[0].xy) * gl_Color;
+}
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
new file mode 100644
index 00000000000..085970f549e
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
@@ -0,0 +1,36 @@
+/** 
+ * @file splattexturerectV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec4 diffuse_color;
+
+void main()
+{
+	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	gl_FrontColor = diffuse_color;
+}
+
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index b1c7b7f1593..d7d5e5f432c 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2876,10 +2876,9 @@ void renderNormals(LLDrawable* drawablep)
 		{
 			const LLVolumeFace& face = volume->getVolumeFace(i);
 
-			gGL.begin(LLRender::LINES);
-			
 			for (S32 j = 0; j < face.mNumVertices; ++j)
 			{
+				gGL.begin(LLRender::LINES);
 				LLVector4a n,p;
 				
 				n.setMul(face.mNormals[j], scale);
@@ -2898,9 +2897,8 @@ void renderNormals(LLDrawable* drawablep)
 					gGL.vertex3fv(face.mPositions[j].getF32ptr());
 					gGL.vertex3fv(p.getF32ptr());
 				}	
+				gGL.end();
 			}
-
-			gGL.end();
 		}
 
 		gGL.popMatrix();
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index de9d853c7c3..9fac986bf13 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -65,9 +65,11 @@ LLVector4			gShinyOrigin;
 LLGLSLShader	gOcclusionProgram;
 LLGLSLShader	gCustomAlphaProgram;
 LLGLSLShader	gGlowCombineProgram;
+LLGLSLShader	gSplatTextureRectProgram;
 LLGLSLShader	gGlowCombineFXAAProgram;
 LLGLSLShader	gTwoTextureAddProgram;
 LLGLSLShader	gOneTextureNoColorProgram;
+LLGLSLShader	gDebugProgram;
 
 //object shaders
 LLGLSLShader		gObjectSimpleProgram;
@@ -216,6 +218,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gOneTextureNoColorProgram);
 	mShaderList.push_back(&gSolidColorProgram);
 	mShaderList.push_back(&gOcclusionProgram);
+	mShaderList.push_back(&gDebugProgram);
 	mShaderList.push_back(&gObjectEmissiveProgram);
 	mShaderList.push_back(&gObjectEmissiveWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightProgram);
@@ -670,9 +673,11 @@ void LLViewerShaderMgr::setShaders()
 void LLViewerShaderMgr::unloadShaders()
 {
 	gOcclusionProgram.unload();
+	gDebugProgram.unload();
 	gUIProgram.unload();
 	gCustomAlphaProgram.unload();
 	gGlowCombineProgram.unload();
+	gSplatTextureRectProgram.unload();
 	gGlowCombineFXAAProgram.unload();
 	gTwoTextureAddProgram.unload();
 	gOneTextureNoColorProgram.unload();
@@ -2713,6 +2718,22 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
 		success = gCustomAlphaProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gSplatTextureRectProgram.mName = "Splat Texture Rect Shader";
+		gSplatTextureRectProgram.mShaderFiles.clear();
+		gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER_ARB));
+		gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gSplatTextureRectProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gSplatTextureRectProgram.createShader(NULL, NULL);
+		if (success)
+		{
+			gSplatTextureRectProgram.bind();
+			gSplatTextureRectProgram.uniform1i("screenMap", 0);
+			gSplatTextureRectProgram.unbind();
+		}
+	}
+
 	if (success)
 	{
 		gGlowCombineProgram.mName = "Glow Combine Shader";
@@ -2805,6 +2826,16 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
 		success = gOcclusionProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gDebugProgram.mName = "Debug Shader";
+		gDebugProgram.mShaderFiles.clear();
+		gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugV.glsl", GL_VERTEX_SHADER_ARB));
+		gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDebugProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gDebugProgram.createShader(NULL, NULL);
+	}
+
 	if( !success )
 	{
 		mVertexShaderLevel[SHADER_INTERFACE] = 0;
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index c63260fb2ec..1c9d7f84532 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -273,7 +273,9 @@ extern LLVector4			gShinyOrigin;
 extern LLGLSLShader			gOcclusionProgram;
 extern LLGLSLShader			gCustomAlphaProgram;
 extern LLGLSLShader			gGlowCombineProgram;
+extern LLGLSLShader			gSplatTextureRectProgram;
 extern LLGLSLShader			gGlowCombineFXAAProgram;
+extern LLGLSLShader		gDebugProgram;
 
 //output tex0[tc0] + tex1[tc1]
 extern LLGLSLShader			gTwoTextureAddProgram;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 45268d203db..27672a05cb0 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4126,6 +4126,11 @@ void LLPipeline::renderPhysicsDisplay()
 
 	gGL.setColorMask(true, false);
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gDebugProgram.bind();
+	}
+
 	for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); 
 			iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
 	{
@@ -4155,8 +4160,13 @@ void LLPipeline::renderPhysicsDisplay()
 		}
 	}
 
-
 	gGL.flush();
+
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gDebugProgram.unbind();
+	}
+
 	mPhysicsDisplay.flush();
 }
 
@@ -6137,8 +6147,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 {
 	LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM);
 	if (!(gPipeline.canUseVertexShaders() &&
-		sRenderGlow) ||
-		(!sRenderDeferred && hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES)))
+		sRenderGlow))
 	{
 		return;
 	}
@@ -6569,19 +6578,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		
 	}
 
-	if (LLRenderTarget::sUseFBO)
-	{ //copy depth buffer from mScreen to framebuffer
-		LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), 
-			0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);
-	}
-	
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
 
 	if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES))
 	{
 		if (LLGLSLShader::sNoFixedFunction)
 		{
-			gUIProgram.bind();
+			gSplatTextureRectProgram.bind();
 		}
 
 		gGL.setColorMask(true, false);
@@ -6595,7 +6598,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 		gGL.getTexUnit(0)->bind(&mPhysicsDisplay);
 
-		gGL.begin(LLRender::TRIANGLE_STRIP);
+		gGL.begin(LLRender::TRIANGLES);
 		gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
 		gGL.vertex2f(-1,-1);
 		
@@ -6610,10 +6613,17 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 		if (LLGLSLShader::sNoFixedFunction)
 		{
-			gUIProgram.unbind();
+			gSplatTextureRectProgram.unbind();
 		}
+	}
 
+	
+	if (LLRenderTarget::sUseFBO)
+	{ //copy depth buffer from mScreen to framebuffer
+		LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), 
+			0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);
 	}
+	
 
 	glMatrixMode(GL_PROJECTION);
 	glPopMatrix();
-- 
GitLab


From 764b7a1ec0a92bd9948010ac76a7c4362d66acf6 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 22 Aug 2011 15:58:12 -0700
Subject: [PATCH 009/933] Mac build fixes.

---
 indra/llrender/llshadermgr.cpp   | 2 ++
 indra/newview/llviewerwindow.cpp | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 23344356442..b487cda4ef3 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -704,6 +704,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 				LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL;
 				dumpObjectLog(ret);
 
+#if LL_WINDOWS
 				std::stringstream ostr;
 				//dump shader source for debugging
 				for (GLuint i = 0; i < count; i++)
@@ -719,6 +720,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 				}
 
 				LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
+#endif // LL_WINDOWS
 
 				ret = 0;
 			}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 9f66c074fd2..254fa9d4a1a 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3456,7 +3456,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 						LLColor4 color(vovolume->getLightColor(), .5f);
 						gGL.color4fv(color.mV);
 					
-						F32 pixel_area = 100000.f;
+						//F32 pixel_area = 100000.f;
 						// Render Outside
 						gSphere.render();
 
-- 
GitLab


From 11d7a7f197d31617602ff9c109674a783fd6fa71 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 23 Aug 2011 11:19:04 -0700
Subject: [PATCH 010/933] Mac crash fixes.

Reviewed by davep.
---
 .../app_settings/shaders/class1/environment/waterV.glsl    | 7 ++++---
 indra/newview/llspatialpartition.cpp                       | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index b99fab2c0fb..831a7de0ea1 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -57,19 +57,20 @@ void main()
 	float d = length(oEyeVec.xy);
 	float ld = min(d, 2560.0);
 	
-	position.xy = eyeVec.xy + oEyeVec.xy/d*ld;
+	vec3 lpos = position;
+	lpos.xy = eyeVec.xy + oEyeVec.xy/d*ld;
 	view.xyz = oEyeVec;
 		
 	d = clamp(ld/1536.0-0.5, 0.0, 1.0);	
 	d *= d;
 		
-	oPosition = vec4(position, 1.0);
+	oPosition = vec4(lpos, 1.0);
 	oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
 	oPosition = modelViewProj * oPosition;
 	refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
 	
 	//get wave position parameter (create sweeping horizontal waves)
-	vec3 v = position.xyz;
+	vec3 v = lpos;
 	v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0;
 	    
 	//push position for further horizon effect.
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index d7d5e5f432c..78b2db2bded 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2416,7 +2416,7 @@ void pushVerts(LLFace* face, U32 mask)
 
 	LLVertexBuffer* buffer = face->getVertexBuffer();
 
-	if (buffer)
+	if (buffer && (face->getGeomCount() >= 3))
 	{
 		buffer->setBuffer(mask);
 		U16 start = face->getGeomStart();
-- 
GitLab


From bf0d36bf889bb913fbc2a53c5a1b9818acb11ee6 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 24 Aug 2011 15:41:00 -0700
Subject: [PATCH 011/933] Mac rendering now with 100% fewer crashes when
 enabling shadows.

---
 indra/llrender/llglslshader.cpp                             | 2 ++
 indra/llrender/llshadermgr.cpp                              | 3 +++
 indra/newview/app_settings/settings.xml                     | 2 +-
 .../app_settings/shaders/class1/deferred/postDeferredF.glsl | 2 +-
 .../shaders/class1/deferred/postDeferredNoDoFF.glsl         | 2 +-
 .../app_settings/shaders/class2/deferred/sunLightF.glsl     | 6 +++---
 .../app_settings/shaders/class2/deferred/sunLightV.glsl     | 4 +---
 indra/newview/lltexlayer.cpp                                | 6 +++---
 8 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 02bcc9e338b..61648e527da 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -117,10 +117,12 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
 	// Create program
 	mProgramObject = glCreateProgramObjectARB();
 	
+#if !LL_DARWIN
 	if (gGLManager.mGLVersion < 3.1f)
 	{ //force indexed texture channels to 1 if GL version is old (performance improvement for drivers with poor branching shader model support)
 		mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
 	}
+#endif // !LL_DARWIN
 
 	//compile new source
 	vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index b487cda4ef3..db3d7becd90 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -544,10 +544,13 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	{
 		//set version to 1.20
 		text[count++] = strdup("#version 120\n");
+		text[count++] = strdup("#define FXAA_GLSL_120 1\n");
+		text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n");
 	}
 	else
 	{  //set version to 1.30
 		text[count++] = strdup("#version 130\n");
+		text[count++] = strdup("#define FXAA_GLSL_130 1\n");
 	}
 
 	//copy preprocessor definitions into buffer
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1ea986b16d0..7c017312829 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7571,7 +7571,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
   <key>RenderDebugNormalScale</key>
   <map>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index cfcd8585f19..daef6a938c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #define FXAA_PC 1
-#define FXAA_GLSL_130 1
+//#define FXAA_GLSL_130 1
 #define FXAA_QUALITY__PRESET 12
 
 /*============================================================================
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index e9122fc9d3d..f67615bdd5b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #define FXAA_PC 1
-#define FXAA_GLSL_130 1
+//#define FXAA_GLSL_130 1
 #define FXAA_QUALITY__PRESET 12
 
 /*============================================================================
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 1809cff1e5d..146fac56e9e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -48,12 +48,12 @@ uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
 varying vec2 vary_fragcoord;
-varying vec4 vary_light;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 uniform vec2 shadow_res;
 uniform vec2 proj_shadow_res;
+uniform vec3 sun_dir;
 
 uniform float shadow_bias;
 uniform float shadow_offset;
@@ -132,10 +132,10 @@ void main()
 	}*/
 	
 	float shadow = 1.0;
-	float dp_directional_light = max(0.0, dot(norm, vary_light.xyz));
+	float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
 
 	vec3 shadow_pos = pos.xyz + displace*norm;
-	vec3 offset = vary_light.xyz * (1.0-dp_directional_light);
+	vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
 	
 	vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 827ec15621d..2cf7375d4d2 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -1,5 +1,5 @@
 /** 
- * @file sunLightF.glsl
+ * @file sunLightV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -25,8 +25,6 @@
  
 attribute vec3 position;
 
-
-varying vec4 vary_light;
 varying vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 87e7a57ae81..f44e62335da 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -306,9 +306,6 @@ BOOL LLTexLayerSetBuffer::render()
 	success &= mTexLayerSet->render( mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight );
 	gGL.flush();
 
-	LLVertexBuffer::unbind();
-	LLGLSLShader::sNoFixedFunction = no_ff;
-	
 	if(upload_now)
 	{
 		if (!success)
@@ -338,6 +335,9 @@ BOOL LLTexLayerSetBuffer::render()
 		doUpdate();
 	}
 
+	LLVertexBuffer::unbind();
+	LLGLSLShader::sNoFixedFunction = no_ff;
+	
 	// reset GL state
 	gGL.setColorMask(true, true);
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
-- 
GitLab


From 7821ff23baafff4e7712a126c17c3947e7b4989e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 27 Aug 2011 00:38:53 -0500
Subject: [PATCH 012/933] SH-2242 Physics shape display works again, added
 asserts to flush out areas where state being consumed by a shader does not
 match state being provided by vertex buffers.

---
 indra/llrender/llrender.cpp                   | 54 ++++++-------------
 indra/llrender/llvertexbuffer.cpp             | 50 ++++++++++++++++-
 .../shaders/class1/deferred/bumpV.glsl        |  4 +-
 .../shaders/class1/interface/highlightF.glsl  |  4 +-
 .../shaders/class1/objects/bumpV.glsl         |  2 -
 indra/newview/lldrawpoolalpha.cpp             |  3 +-
 indra/newview/lldrawpoolwlsky.cpp             |  4 +-
 indra/newview/llselectmgr.cpp                 | 12 ++---
 indra/newview/llspatialpartition.cpp          | 19 ++-----
 indra/newview/llviewerdisplay.cpp             | 12 +++++
 indra/newview/pipeline.cpp                    |  2 -
 11 files changed, 89 insertions(+), 77 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 03a45c35dc4..ea398c61dee 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1583,15 +1583,11 @@ void LLRender::color3fv(const GLfloat* c)
 void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
 {
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-	S32 loc = -1;
-	if (shader)
-	{
-		loc = shader->getUniformLocation("color");
-	}
+	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
 
-	if (loc >= 0)
+	if (shader)
 	{
-		shader->uniform4f(loc, r,g,b,1.f);
+		shader->uniform4f("color", r,g,b,1.f);
 	}
 	else
 	{
@@ -1602,15 +1598,11 @@ void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
 void LLRender::diffuseColor3fv(const F32* c)
 {
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-	S32 loc = -1;
-	if (shader)
-	{
-		loc = shader->getUniformLocation("color");
-	}
+	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
 
-	if (loc >= 0)
+	if (shader)
 	{
-		shader->uniform4f(loc, c[0], c[1], c[2], 1.f);
+		shader->uniform4f("color", c[0], c[1], c[2], 1.f);
 	}
 	else
 	{
@@ -1621,35 +1613,26 @@ void LLRender::diffuseColor3fv(const F32* c)
 void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
 {
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-	S32 loc = -1;
-	if (shader)
-	{
-		loc = shader->getUniformLocation("color");
-	}
+	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
 
-	if (loc >= 0)
+	if (shader)
 	{
-		shader->uniform4f(loc, r,g,b,a);
+		shader->uniform4f("color", r,g,b,a);
 	}
 	else
 	{
 		glColor4f(r,g,b,a);
 	}
-
 }
 
 void LLRender::diffuseColor4fv(const F32* c)
 {
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-	S32 loc = -1;
-	if (shader)
-	{
-		loc = shader->getUniformLocation("color");
-	}
+	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
 
-	if (loc >= 0)
+	if (shader)
 	{
-		shader->uniform4fv(loc, 1, c);
+		shader->uniform4fv("color", 1, c);
 	}
 	else
 	{
@@ -1660,15 +1643,11 @@ void LLRender::diffuseColor4fv(const F32* c)
 void LLRender::diffuseColor4ubv(const U8* c)
 {
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-	S32 loc = -1;
-	if (shader)
-	{
-		loc = shader->getUniformLocation("color");
-	}
+	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
 
-	if (loc >= 0)
+	if (shader)
 	{
-		shader->uniform4f(loc, c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f);
+		shader->uniform4f("color", c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f);
 	}
 	else
 	{
@@ -1676,9 +1655,6 @@ void LLRender::diffuseColor4ubv(const U8* c)
 	}
 }
 
-
-
-
 void LLRender::debugTexUnits(void)
 {
 	LL_INFOS("TextureUnit") << "Active TexUnit: " << mCurrTextureUnitIndex << LL_ENDL;
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 5d191688420..86352215ff8 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -364,8 +364,26 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
 	
 	setupClientArrays(MAP_VERTEX | MAP_NORMAL);
 
-	glVertexPointer(3, GL_FLOAT, 0, pos[0].mV);
-	glNormalPointer(GL_FLOAT, 0, norm[0].mV);
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (shader)
+	{
+		S32 loc = shader->getAttribLocation(LLVertexBuffer::TYPE_VERTEX);
+		if (loc > -1)
+		{
+			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, pos[0].mV);
+		}
+		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_NORMAL);
+		if (loc > -1)
+		{
+			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, norm[0].mV);
+		}
+	}
+	else
+	{
+		glVertexPointer(3, GL_FLOAT, 0, pos[0].mV);
+		glNormalPointer(GL_FLOAT, 0, norm[0].mV);
+	}
 
 	glDrawArrays(sGLMode[mode], 0, count);
 }
@@ -1730,6 +1748,34 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 	//set up pointers if the data mask is different ...
 	BOOL setup = (sLastMask != data_mask);
 
+	if (gDebugGL && data_mask != 0)
+	{
+		LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+		if (shader)
+		{
+			U32 required_mask = 0;
+			for (U32 i = 0; i < LLVertexBuffer::TYPE_MAX; ++i)
+			{
+				if (shader->getAttribLocation(i) > -1)
+				{
+					U32 required = 1 << i;
+					if ((data_mask & required) == 0)
+					{
+						llwarns << "Missing attribute: " << i << llendl;
+					}
+
+					required_mask |= required;
+
+				}
+			}
+
+			if ((data_mask & required_mask) != required_mask)
+			{
+				llerrs << "Shader consumption mismatches data provision." << llendl;
+			}
+		}
+	}
+
 	if (useVBOs())
 	{
 		if (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index 99ddeaf0b99..b724def93de 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -27,7 +27,7 @@ attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec3 normal;
 attribute vec2 texcoord0;
-attribute vec2 texcoord2;
+attribute vec3 binormal;
 
 varying vec3 vary_mat0;
 varying vec3 vary_mat1;
@@ -40,7 +40,7 @@ void main()
 	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	
 	vec3 n = normalize(gl_NormalMatrix * normal);
-	vec3 b = normalize(gl_NormalMatrix * vec4(texcoord2,0,1).xyz);
+	vec3 b = normalize(gl_NormalMatrix * binormal);
 	vec3 t = cross(b, n);
 	
 	vary_mat0 = vec3(t.x, b.x, n.x);
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 4c0455502f8..3a48205101c 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -24,10 +24,10 @@
  */
  
 
-uniform vec4 highlight_color;
+uniform vec4 color;
 uniform sampler2D diffuseMap;
 
 void main() 
 {
-	gl_FragColor = highlight_color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = color*texture2D(diffuseMap, gl_TexCoord[0].xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index bb6f0aa5e86..7d38e07d65b 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -25,7 +25,6 @@
  
 
 attribute vec3 position;
-attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
 attribute vec2 texcoord1;
 
@@ -35,5 +34,4 @@ void main()
 	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
 	gl_TexCoord[1] = gl_TextureMatrix[1] * vec4(texcoord1,0,1);
-	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index a3f8eb377ae..1e04cd9c176 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -322,13 +322,12 @@ void LLDrawPoolAlpha::render(S32 pass)
 		if(shaders) 
 		{
 			gHighlightProgram.bind();
-			gHighlightProgram.uniform4f("highlight_color", 1,0,0,1);
 		}
 		else
 		{
 			gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
-			gGL.diffuseColor4f(1,0,0,1);
 		}
+		gGL.diffuseColor4f(1,0,0,1);
 		
 		LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f);
 		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ;
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index e4de92490e9..852de39781e 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -269,7 +269,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
 	{
 		if (gPipeline.canUseVertexShaders())
 		{
-			gUIProgram.bind();
+			gHighlightProgram.bind();
 		}
 		// *NOTE: even though we already bound this texture above for the
 		// stars register combiners, we bind again here for defensive reasons,
@@ -289,7 +289,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
 
 		if (gPipeline.canUseVertexShaders())
 		{
-			gUIProgram.unbind();
+			gHighlightProgram.unbind();
 		}
 	}
 }
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 568c967a9a5..48cccc12ef9 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5637,7 +5637,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 		LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL);
 		if (shader)
 		{
-			gHighlightProgram.uniform4f("highlight_color", color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
+			gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
 			pushWireframe(drawable);
 		}
 		else
@@ -5661,14 +5661,8 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 	gGL.flush();
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
 
-	if (shader)
-	{
-		gHighlightProgram.uniform4f("highlight_color", color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
-	}
-	else
-	{
-		gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
-	}
+	gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
+	
 	LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
 	glPolygonOffset(3.f, 3.f);
 	glLineWidth(3.f);
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 78b2db2bded..e0c3b431101 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2944,7 +2944,7 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLCo
 		else
 		{
 			gMeshRepo.buildPhysicsMesh(*decomp);
-			gGL.color3f(0,1,1);
+			gGL.diffuseColor4f(0,1,1,1);
 			drawBoxOutline(center, size);
 		}
 
@@ -3078,7 +3078,6 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		{
 			renderMeshBaseHull(volume, data_mask, color, line_color);
 		}
-#if LL_WINDOWS 
 		else
 		{
 			LLVolumeParams volume_params = volume->getVolume()->getParams();
@@ -3190,13 +3189,12 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 			}
 			else
 			{
-				gGL.color3f(1,0,1);
+				gGL.diffuseColor4f(1,0,1,1);
 				drawBoxOutline(center, size);
 			}
 
 			LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
 		}
-#endif //LL_WINDOWS			
 	}
 	else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::BOX)
 	{
@@ -3210,7 +3208,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 	}
 	else if	(type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE)
 	{
-		LLVolumeParams volume_params;
+		/*LLVolumeParams volume_params;
 		volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE );
 		volume_params.setBeginAndEndS( 0.f, 1.f );
 		volume_params.setBeginAndEndT( 0.f, 1.f );
@@ -3220,7 +3218,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		
 		gGL.diffuseColor4fv(color.mV);
 		pushVerts(sphere);
-		LLPrimitive::sVolumeManager->unrefVolume(sphere);
+		LLPrimitive::sVolumeManager->unrefVolume(sphere);*/
 	}
 	else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::CYLINDER)
 	{
@@ -3290,15 +3288,6 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 	}
 
 	gGL.popMatrix();
-
-	/*{ //analytical shape, just push visual rep.
-		gGL.diffuseColor3fv(color.mV);
-		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-		pushVerts(drawable, data_mask);
-		gGL.diffuseColor4fv(color.mV);
-		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-		pushVerts(drawable, data_mask);
-	}*/
 }
 
 void renderPhysicsShapes(LLSpatialGroup* group)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 39053fe9e4b..eeb33ea5d21 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -719,6 +719,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			LLAppViewer::instance()->pingMainloopTimeout("Display:Imagery");
 			gPipeline.generateWaterReflection(*LLViewerCamera::getInstance());
 			gPipeline.generateHighlight(*LLViewerCamera::getInstance());
+			gPipeline.renderPhysicsDisplay();
 		}
 
 		LLGLState::checkStates();
@@ -1454,6 +1455,11 @@ void render_ui_2d()
 
 void render_disconnected_background()
 {
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	gGL.color4f(1,1,1,1);
 	if (!gDisconnectedImagep && gDisconnected)
 	{
@@ -1523,6 +1529,12 @@ void render_disconnected_background()
 		glPopMatrix();
 	}
 	gGL.flush();
+
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.unbind();
+	}
+
 }
 
 void display_cleanup()
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 27672a05cb0..8d5bc22e6fd 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4480,8 +4480,6 @@ void LLPipeline::renderDebug()
 	{
 		gUIProgram.unbind();
 	}
-
-	gPipeline.renderPhysicsDisplay();
 }
 
 void LLPipeline::rebuildPools()
-- 
GitLab


From c8b8b153f14b65fa7d833d787df6c03539eb85a8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 27 Aug 2011 00:48:14 -0500
Subject: [PATCH 013/933] SH-2242 Don't make LLDynamicTexture targets use
 shaders all the time (revisit later).

---
 indra/newview/lldynamictexture.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 4955b6224ee..f9a213a86f0 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -210,6 +210,9 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 	LLGLSLShader::bindNoShader();
 	LLVertexBuffer::unbind();
 	
+	bool no_ff = LLGLSLShader::sNoFixedFunction;
+	LLGLSLShader::sNoFixedFunction = false;
+
 	BOOL result = FALSE;
 	BOOL ret = FALSE ;
 	for( S32 order = 0; order < ORDER_COUNT; order++ )
@@ -240,6 +243,8 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		}
 	}
 
+	LLGLSLShader::sNoFixedFunction = no_ff;
+
 	return ret;
 }
 
-- 
GitLab


From 7ee10ae1def26708fa44c25355982aa56195d5f9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 27 Aug 2011 01:30:31 -0500
Subject: [PATCH 014/933] SH-2242 Remove old multisample shaders and make FXAA
 turn itself off when FSAA is disabled.

---
 .../shaders/class1/deferred/blurLightMSF.glsl | 131 -------
 .../class1/deferred/multiPointLightMSF.glsl   | 155 --------
 .../class1/deferred/multiSpotLightMSF.glsl    | 250 -------------
 .../class1/deferred/pointLightMSF.glsl        | 126 -------
 ...MSF.glsl => postDeferredNoDoFNoFXAAF.glsl} |  24 +-
 ...erredMSF.glsl => postDeferredNoFXAAF.glsl} |  76 ++--
 .../class1/deferred/softenLightMSF.glsl       | 342 ------------------
 .../shaders/class1/deferred/spotLightMSF.glsl | 252 -------------
 .../shaders/class1/deferred/sunLightMSF.glsl  |  35 --
 .../class1/deferred/sunLightSSAOMSF.glsl      | 140 -------
 indra/newview/llviewershadermgr.cpp           | 121 +------
 indra/newview/pipeline.cpp                    |  43 ++-
 12 files changed, 90 insertions(+), 1605 deletions(-)
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl
 rename indra/newview/app_settings/shaders/class1/deferred/{postDeferredNoDoFMSF.glsl => postDeferredNoDoFNoFXAAF.glsl} (77%)
 rename indra/newview/app_settings/shaders/class1/deferred/{postDeferredMSF.glsl => postDeferredNoFXAAF.glsl} (68%)
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl

diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl
deleted file mode 100644
index c858eb7a3a8..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl
+++ /dev/null
@@ -1,131 +0,0 @@
-/** 
- * @file blurLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2DRect lightMap;
-
-uniform float dist_factor;
-uniform float blur_size;
-uniform vec2 delta;
-uniform vec3 kern[4];
-uniform float kern_scale;
-
-varying vec2 vary_fragcoord;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-vec3 texture2DMS3(sampler2DMS tex, ivec2 tc)
-{
-	vec3 ret = vec3(0,0,0);
-	for (int i = 0; i < samples; i++)
-	{
-		ret += texelFetch(tex, tc, i).rgb;
-	}
-
-	return ret/samples;
-}
-
-float texture2DMS1(sampler2DMS tex, ivec2 tc)
-{
-	float ret = 0;
-	for (int i = 0; i < samples; i++)
-	{
-		ret += texelFetch(tex, tc, i).r;
-	}
-
-	return ret/samples;
-}
-
-vec4 getPosition(ivec2 pos_screen)
-{
-	float depth = texture2DMS1(depthMap, pos_screen.xy);
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-    vec2 tc = vary_fragcoord.xy;
-	ivec2 itc = ivec2(tc);
-
-	vec3 norm = texture2DMS3(normalMap, itc).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	vec3 pos = getPosition(itc).xyz;
-	vec4 ccol = texture2DRect(lightMap, tc).rgba;
-	
-	vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy);
-	dlt /= max(-pos.z*dist_factor, 1.0);
-	
-	vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free'
-	vec4 col = defined_weight.xyxx * ccol;
-
-	// relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances
-	float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005;
-
-	// perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large
-	tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 );
-
-	for (int i = 1; i < 4; i++)
-	{
-		vec2 samptc = tc + kern[i].z*dlt;
-		vec3 samppos = getPosition(ivec2(samptc)).xyz; 
-		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
-		if (d*d <= pointplanedist_tolerance_pow2)
-		{
-			col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
-			defined_weight += kern[i].xy;
-		}
-	}
-	for (int i = 1; i < 4; i++)
-	{
-		vec2 samptc = vec2(tc - kern[i].z*dlt);
-		vec3 samppos = getPosition(ivec2(samptc)).xyz; 
-		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
-		if (d*d <= pointplanedist_tolerance_pow2)
-		{
-			col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
-			defined_weight += kern[i].xy;
-		}
-	}
-
-	col /= defined_weight.xyxx;
-	col.y *= col.y;
-
-	gl_FragColor = col;
-}
-
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl
deleted file mode 100644
index 863bac19cfa..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl
+++ /dev/null
@@ -1,155 +0,0 @@
-/** 
- * @file multiPointLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS normalMap;
-uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
-
-
-uniform vec3 env_mat[3];
-uniform float sun_wash;
-
-uniform int light_count;
-
-#define MAX_LIGHT_COUNT		16
-uniform vec4 light[MAX_LIGHT_COUNT];
-uniform vec4 light_col[MAX_LIGHT_COUNT];
-
-varying vec4 vary_fragcoord;
-uniform vec2 screen_res;
-
-uniform float far_z;
-
-uniform mat4 inv_proj;
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-	vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res;
-	ivec2 itc = ivec2(frag);
-
-	int wght = 0;
-	vec3 fcol = vec3(0,0,0);
-
-	for (int s = 0; s < samples; ++s)
-	{
-		vec3 pos = getPosition(itc, s).xyz;
-		if (pos.z >= far_z)
-		{
-			vec3 norm = texelFetch(normalMap, itc, s).xyz;
-			norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-			norm = normalize(norm);
-			vec4 spec = texelFetch(specularRect, itc, s);
-			vec3 diff = texelFetch(diffuseRect, itc, s).rgb;
-			float noise = texture2D(noiseMap, frag.xy/128.0).b;
-			vec3 out_col = vec3(0,0,0);
-			vec3 npos = normalize(-pos);
-
-			// As of OSX 10.6.7 ATI Apple's crash when using a variable size loop
-			for (int i = 0; i < MAX_LIGHT_COUNT; ++i)
-			{
-				bool light_contrib = (i < light_count);
-		
-				vec3 lv = light[i].xyz-pos;
-				float dist2 = dot(lv,lv);
-				dist2 /= light[i].w;
-				if (dist2 > 1.0)
-				{
-					light_contrib = false;
-				}
-		
-				float da = dot(norm, lv);
-				if (da < 0.0)
-				{
-					light_contrib = false;
-				}
-		
-				if (light_contrib)
-				{
-					lv = normalize(lv);
-					da = dot(norm, lv);
-					
-					float fa = light_col[i].a+1.0;
-					float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
-					dist_atten *= noise;
-
-					float lit = da * dist_atten;
-			
-					vec3 col = light_col[i].rgb*lit*diff;
-					//vec3 col = vec3(dist2, light_col[i].a, lit);
-			
-					if (spec.a > 0.0)
-					{
-						//vec3 ref = dot(pos+lv, norm);
-				
-						float sa = dot(normalize(lv+npos),norm);
-				
-						if (sa > 0.0)
-						{
-							sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
-							sa *= noise;
-							col += da*sa*light_col[i].rgb*spec.rgb;
-						}
-					}
-			
-					out_col += col;
-				}
-			}
-	
-			fcol += out_col;
-			++wght;
-		}
-	}
-
-	if (wght <= 0)
-	{
-		discard;
-	}
-
-	gl_FragColor.rgb = fcol/samples;
-	gl_FragColor.a = 0.0;
-
-	
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl
deleted file mode 100644
index 10285817c21..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl
+++ /dev/null
@@ -1,250 +0,0 @@
-/** 
- * @file multiSpotLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-
-
-//class 1 -- no shadows
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
-uniform sampler2D projectionMap;
-
-uniform mat4 proj_mat; //screen space to light space
-uniform float proj_near; //near clip for projection
-uniform vec3 proj_p; //plane projection is emitting from (in screen space)
-uniform vec3 proj_n;
-uniform float proj_focus; //distance from plane to begin blurring
-uniform float proj_lod;  //(number of mips in proj map)
-uniform float proj_range; //range between near clip and far clip plane of projection
-uniform float proj_ambient_lod;
-uniform float proj_ambiance;
-uniform float near_clip;
-uniform float far_clip;
-
-uniform vec3 proj_origin; //origin of projection to be used for angular attenuation
-uniform float sun_wash;
-uniform float shadow_fade;
-
-varying vec4 vary_light;
-
-varying vec4 vary_fragcoord;
-uniform vec2 screen_res;
-
-uniform mat4 inv_proj;
-
-vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float det = max(1.0-lod/(proj_lod*0.5), 0.0);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
-	
-	float det = min(lod/(proj_lod*0.5), 1.0);
-	
-	float d = min(dist.x, dist.y);
-	
-	float edge = 0.25*det;
-		
-	ret *= clamp(d/edge, 0.0, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0);
-	
-	return ret;
-}
-
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-	int wght = 0;
-
-	vec3 fcol = vec3(0,0,0);
-
-	vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res;
-	
-	ivec2 itc = ivec2(frag.xy);
-
-	for (int i = 0; i < samples; ++i)
-	{
-		vec3 pos = getPosition(itc, i).xyz;
-		vec3 lv = vary_light.xyz-pos.xyz;
-		float dist2 = dot(lv,lv);
-		dist2 /= vary_light.w;
-		if (dist2 <= 1.0)
-		{
-			vec3 norm = texelFetch(normalMap, itc, i).xyz*2.0-1.0;
-	
-			norm = normalize(norm);
-			float l_dist = -dot(lv, proj_n);
-	
-			vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0));
-			if (proj_tc.z >= 0.0)
-			{
-				proj_tc.xyz /= proj_tc.w;
-	
-				float fa = gl_Color.a+1.0;
-				float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
-				if (dist_atten > 0.0)
-				{
-					lv = proj_origin-pos.xyz;
-					lv = normalize(lv);
-					float da = dot(norm, lv);
-		
-					vec3 col = vec3(0,0,0);
-		
-					vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb;
-		
-					float noise = texture2D(noiseMap, frag.xy/128.0).b;
-					if (proj_tc.z > 0.0 &&
-						proj_tc.x < 1.0 &&
-						proj_tc.y < 1.0 &&
-						proj_tc.x > 0.0 &&
-						proj_tc.y > 0.0)
-					{
-						float lit = 0.0;
-						float amb_da = proj_ambiance;
-		
-						if (da > 0.0)
-						{
-							float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0);
-							float lod = diff * proj_lod;
-			
-							vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
-		
-							vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
-			
-							lit = da * dist_atten * noise;
-			
-							col = lcol*lit*diff_tex;
-							amb_da += (da*0.5)*proj_ambiance;
-						}
-		
-						//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
-						vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
-							
-						amb_da += (da*da*0.5+0.5)*proj_ambiance;
-				
-						amb_da *= dist_atten * noise;
-			
-						amb_da = min(amb_da, 1.0-lit);
-			
-						col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
-					}
-	
-	
-					vec4 spec = texelFetch(specularRect, itc, i);
-					if (spec.a > 0.0)
-					{
-						vec3 ref = reflect(normalize(pos), norm);
-		
-						//project from point pos in direction ref to plane proj_p, proj_n
-						vec3 pdelta = proj_p-pos;
-						float ds = dot(ref, proj_n);
-		
-						if (ds < 0.0)
-						{
-							vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
-			
-							vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
-
-							if (stc.z > 0.0)
-							{
-								stc.xy /= stc.w;
-
-								float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0);
-				
-								stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
-								
-								if (stc.x < 1.0 &&
-									stc.y < 1.0 &&
-									stc.x > 0.0 &&
-									stc.y > 0.0)
-								{
-									vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-									col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb;
-								}
-							}
-						}
-					}
-	
-					fcol += col;
-					++wght;
-				}
-			}
-		}
-	}
-
-	if (wght <= 0)
-	{
-		discard;
-	}
-
-	gl_FragColor.rgb = fcol/samples;	
-	gl_FragColor.a = 0.0;
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl
deleted file mode 100644
index cdce58c84ef..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl
+++ /dev/null
@@ -1,126 +0,0 @@
-/** 
- * @file pointLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
- 
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS normalMap;
-uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
-
-
-uniform vec3 env_mat[3];
-uniform float sun_wash;
-
-varying vec4 vary_light;
-
-varying vec4 vary_fragcoord;
-uniform vec2 screen_res;
-
-uniform mat4 inv_proj;
-uniform vec4 viewport;
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = (vec2(pos_screen.xy)-viewport.xy)*2.0;
-	sc /= viewport.zw;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-	vec4 frag = vary_fragcoord;
-	frag.xyz /= frag.w;
-	frag.xyz = frag.xyz*0.5+0.5;
-	frag.xy *= screen_res;
-	
-	ivec2 itc = ivec2(frag.xy);
-
-	int wght = 0;
-	vec3 fcol = vec3(0,0,0);
-
-	for (int s = 0; s < samples; ++s)
-	{
-		vec3 pos = getPosition(itc, s).xyz;
-		vec3 lv = vary_light.xyz-pos;
-		float dist2 = dot(lv,lv);
-		dist2 /= vary_light.w;
-		if (dist2 <= 1.0)
-		{
-			vec3 norm = texelFetch(normalMap, itc, s).xyz;
-			norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-			float da = dot(norm, lv);
-			if (da >= 0.0)
-			{
-				norm = normalize(norm);
-				lv = normalize(lv);
-				da = dot(norm, lv);
-	
-				float noise = texture2D(noiseMap, frag.xy/128.0).b;
-	
-				vec3 col = texelFetch(diffuseRect, itc, s).rgb;
-				float fa = gl_Color.a+1.0;
-				float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
-				float lit = da * dist_atten * noise;
-	
-				col = gl_Color.rgb*lit*col;
-
-				vec4 spec = texelFetch(specularRect, itc, s);
-				if (spec.a > 0.0)
-				{
-					float sa = dot(normalize(lv-normalize(pos)),norm);
-					if (sa > 0.0)
-					{
-						sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
-						sa *= noise;
-						col += da*sa*gl_Color.rgb*spec.rgb;
-					}
-				}
-
-				fcol += col;
-				++wght;
-			}
-		}
-	}
-	
-	if (wght <= 0)
-	{
-		discard;
-	}
-		
-	gl_FragColor.rgb = fcol/samples;	
-	gl_FragColor.a = 0.0;
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
similarity index 77%
rename from indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl
rename to indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
index 41849858e7d..b519dbc4b06 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
@@ -1,5 +1,5 @@
 /** 
- * @file postDeferredF.glsl
+ * @file postDeferredNoDoFF.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -23,33 +23,19 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
 
-uniform sampler2DMS diffuseRect;
+uniform sampler2DRect diffuseRect;
 uniform sampler2D bloomMap;
 
 uniform vec2 screen_res;
 varying vec2 vary_fragcoord;
 
-vec4 texture2DMS(sampler2DMS tex, ivec2 tc)
-{
-	vec4 ret = vec4(0,0,0,0);
-
-	for (int i = 0; i < samples; ++i)
-	{
-		 ret += texelFetch(tex,tc,i);
-	}
-
-	return ret/samples;
-}
-
 void main() 
 {
-	vec4 diff = texture2DMS(diffuseRect, ivec2(vary_fragcoord.xy));
-
+	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
+	
 	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
 	gl_FragColor = diff + bloom;
 }
+
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
similarity index 68%
rename from indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl
rename to indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
index 792102a64d7..861bb9f7358 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
@@ -22,16 +22,13 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
-
 
 #extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
 
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS edgeMap;
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
+uniform sampler2DRect diffuseRect;
+uniform sampler2DRect edgeMap;
+uniform sampler2DRect depthMap;
+uniform sampler2DRect normalMap;
 uniform sampler2D bloomMap;
 
 uniform float depth_cutoff;
@@ -46,20 +43,9 @@ uniform vec2 screen_res;
 
 varying vec2 vary_fragcoord;
 
-vec4 texture2DMS(sampler2DMS tex, ivec2 tc)
-{
-	vec4 ret = vec4(0,0,0,0);
-	for (int i = 0; i < samples; ++i)
-	{
-		ret += texelFetch(tex, tc, i);
-	}
-
-	return ret/samples;
-}
-
-float getDepth(ivec2 pos_screen)
+float getDepth(vec2 pos_screen)
 {
-	float z = texture2DMS(depthMap, pos_screen.xy).r;
+	float z = texture2DRect(depthMap, pos_screen.xy).r;
 	z = z*2.0-1.0;
 	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
 	vec4 p = inv_proj*ndc;
@@ -81,7 +67,24 @@ float calc_cof(float depth)
 	return sc;
 }
 
-void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ivec2 tc)
+void dofSampleNear(inout vec4 diff, inout float w, float cur_sc, vec2 tc)
+{
+	float d = getDepth(tc);
+	
+	float sc = calc_cof(d);
+	
+	float wg = 0.25;
+		
+	vec4 s = texture2DRect(diffuseRect, tc);
+	// de-weight dull areas to make highlights 'pop'
+	wg += s.r+s.g+s.b;
+	
+	diff += wg*s;
+	
+	w += wg;
+}
+
+void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, vec2 tc)
 {
 	float d = getDepth(tc);
 	
@@ -92,7 +95,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, iv
 	{
 		float wg = 0.25;
 		
-		vec4 s = texture2DMS(diffuseRect, tc);
+		vec4 s = texture2DRect(diffuseRect, tc);
 		// de-weight dull areas to make highlights 'pop'
 		wg += s.r+s.g+s.b;
 	
@@ -105,14 +108,14 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, iv
 
 void main() 
 {
-	ivec2 itc = ivec2(vary_fragcoord.xy);
-
-	vec3 norm = texture2DMS(normalMap, itc).xyz;
+	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
 		
-	float depth = getDepth(itc);
+	vec2 tc = vary_fragcoord.xy;
 	
-	vec4 diff = texture2DMS(diffuseRect, itc);
+	float depth = getDepth(tc);
+	
+	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
 	{ 
 		float w = 1.0;
@@ -124,22 +127,21 @@ void main()
 		
 		float PI = 3.14159265358979323846264;
 
-		int isc = int(sc);
-		
 		// sample quite uniformly spaced points within a circle, for a circular 'bokeh'		
 		//if (depth < focal_distance)
 		{
-			for (int x = -isc; x <= isc; x+=2)
+			while (sc > 0.5)
 			{
-				for (int y = -isc; y <= isc; y+=2)
+				int its = int(max(1.0,(sc*3.7)));
+				for (int i=0; i<its; ++i)
 				{
-					ivec2 cur_samp = ivec2(x,y);
-					float cur_sc = length(vec2(cur_samp));
-					if (cur_sc < sc)
-					{
-						dofSample(diff, w, cur_sc, depth, itc+cur_samp);
-					}
+					float ang = sc+i*2*PI/its; // sc is added for rotary perturbance
+					float samp_x = sc*sin(ang);
+					float samp_y = sc*cos(ang);
+					// you could test sample coords against an interesting non-circular aperture shape here, if desired.
+					dofSample(diff, w, sc, depth, vary_fragcoord.xy + vec2(samp_x,samp_y));
 				}
+				sc -= 1.0;
 			}
 		}
 		
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl
deleted file mode 100644
index f118b0da2a4..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl
+++ /dev/null
@@ -1,342 +0,0 @@
-/** 
- * @file softenLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS normalMap;
-uniform sampler2DMS depthMap;
-uniform sampler2D	  noiseMap;
-uniform samplerCube environmentMap;
-uniform sampler2D	  lightFunc;
-
-uniform float blur_size;
-uniform float blur_fidelity;
-
-// Inputs
-uniform vec4 morphFactor;
-uniform vec3 camPosLocal;
-//uniform vec4 camPosWorld;
-uniform vec4 gamma;
-uniform vec4 lightnorm;
-uniform vec4 sunlight_color;
-uniform vec4 ambient;
-uniform vec4 blue_horizon;
-uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 distance_multiplier;
-uniform vec4 max_y;
-uniform vec4 glow;
-uniform float scene_light_strength;
-uniform vec3 env_mat[3];
-//uniform mat4 shadow_matrix[3];
-//uniform vec4 shadow_clip;
-uniform mat3 ssao_effect_mat;
-
-varying vec4 vary_light;
-varying vec2 vary_fragcoord;
-
-vec3 vary_PositionEye;
-
-vec3 vary_SunlitColor;
-vec3 vary_AmblitColor;
-vec3 vary_AdditiveColor;
-vec3 vary_AtmosAttenuation;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-vec4 getPosition_d(vec2 pos_screen, float depth)
-{
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-vec3 getPositionEye()
-{
-	return vary_PositionEye;
-}
-vec3 getSunlitColor()
-{
-	return vary_SunlitColor;
-}
-vec3 getAmblitColor()
-{
-	return vary_AmblitColor;
-}
-vec3 getAdditiveColor()
-{
-	return vary_AdditiveColor;
-}
-vec3 getAtmosAttenuation()
-{
-	return vary_AtmosAttenuation;
-}
-
-
-void setPositionEye(vec3 v)
-{
-	vary_PositionEye = v;
-}
-
-void setSunlitColor(vec3 v)
-{
-	vary_SunlitColor = v;
-}
-
-void setAmblitColor(vec3 v)
-{
-	vary_AmblitColor = v;
-}
-
-void setAdditiveColor(vec3 v)
-{
-	vary_AdditiveColor = v;
-}
-
-void setAtmosAttenuation(vec3 v)
-{
-	vary_AtmosAttenuation = v;
-}
-
-void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
-
-	vec3 P = inPositionEye;
-	setPositionEye(P);
-	
-	//(TERRAIN) limit altitude
-	if (P.y > max_y.x) P *= (max_y.x / P.y);
-	if (P.y < -max_y.x) P *= (-max_y.x / P.y);
-
-	vec3 tmpLightnorm = lightnorm.xyz;
-
-	vec3 Pn = normalize(P);
-	float Plen = length(P);
-
-	vec4 temp1 = vec4(0);
-	vec3 temp2 = vec3(0);
-	vec4 blue_weight;
-	vec4 haze_weight;
-	vec4 sunlight = sunlight_color;
-	vec4 light_atten;
-
-	//sunlight attenuation effect (hue and brightness) due to atmosphere
-	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
-		//I had thought blue_density and haze_density should have equal weighting,
-		//but attenuation due to haze_density tends to seem too strong
-
-	temp1 = blue_density + vec4(haze_density.r);
-	blue_weight = blue_density / temp1;
-	haze_weight = vec4(haze_density.r) / temp1;
-
-	//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
-	temp2.y = max(0.0, tmpLightnorm.y);
-	temp2.y = 1. / temp2.y;
-	sunlight *= exp( - light_atten * temp2.y);
-
-	// main atmospheric scattering line integral
-	temp2.z = Plen * density_multiplier.x;
-
-	// Transparency (-> temp1)
-	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
-	// compiler gets confused.
-	temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
-
-	//final atmosphere attenuation factor
-	setAtmosAttenuation(temp1.rgb);
-	
-	//compute haze glow
-	//(can use temp2.x as temp because we haven't used it yet)
-	temp2.x = dot(Pn, tmpLightnorm.xyz);
-	temp2.x = 1. - temp2.x;
-		//temp2.x is 0 at the sun and increases away from sun
-	temp2.x = max(temp2.x, .03);	//was glow.y
-		//set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
-	temp2.x *= glow.x;
-		//higher glow.x gives dimmer glow (because next step is 1 / "angle")
-	temp2.x = pow(temp2.x, glow.z);
-		//glow.z should be negative, so we're doing a sort of (1 / "angle") function
-
-	//add "minimum anti-solar illumination"
-	temp2.x += .25;
-	
-	//increase ambient when there are more clouds
-	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
-	
-	/*  decrease value and saturation (that in HSV, not HSL) for occluded areas
-	 * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
-	 * // The following line of code performs the equivalent of:
-	 * float ambAlpha = tmpAmbient.a;
-	 * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis
-	 * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue);
-	 * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha);
-	 */
-	tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
-
-	//haze color
-	setAdditiveColor(
-		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
-	  + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
-		  + tmpAmbient)));
-
-	//brightness of surface both sunlight and ambient
-	setSunlitColor(vec3(sunlight * .5));
-	setAmblitColor(vec3(tmpAmbient * .25));
-	setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1));
-}
-
-vec3 atmosLighting(vec3 light)
-{
-	light *= getAtmosAttenuation().r;
-	light += getAdditiveColor();
-	return (2.0 * light);
-}
-
-vec3 atmosTransport(vec3 light) {
-	light *= getAtmosAttenuation().r;
-	light += getAdditiveColor() * 2.0;
-	return light;
-}
-vec3 atmosGetDiffuseSunlightColor()
-{
-	return getSunlitColor();
-}
-
-vec3 scaleDownLight(vec3 light)
-{
-	return (light / scene_light_strength );
-}
-
-vec3 scaleUpLight(vec3 light)
-{
-	return (light * scene_light_strength);
-}
-
-vec3 atmosAmbient(vec3 light)
-{
-	return getAmblitColor() + light / 2.0;
-}
-
-vec3 atmosAffectDirectionalLight(float lightIntensity)
-{
-	return getSunlitColor() * lightIntensity;
-}
-
-vec3 scaleSoftClip(vec3 light)
-{
-	//soft clip effect:
-	light = 1. - clamp(light, vec3(0.), vec3(1.));
-	light = 1. - pow(light, gamma.xxx);
-
-	return light;
-}
-
-vec4 texture2DMS(sampler2DMS tex, ivec2 tc)
-{
-	vec4 ret = vec4(0,0,0,0);
-
-	for (int i = 0; i < samples; ++i)
-	{
-		 ret += texelFetch(tex,tc,i);
-	}
-
-	return ret/samples;
-}
-
-void main() 
-{
-	vec2 tc = vary_fragcoord.xy;
-	ivec2 itc = ivec2(tc);
-
-	vec4 fcol = vec4(0,0,0,0);
-
-	for (int i = 0; i < samples; ++i)
-	{
-		float depth = texelFetch(depthMap, itc, i).r;
-		vec3 pos = getPosition_d(tc, depth).xyz;
-		vec3 norm = texelFetch(normalMap, itc, i).xyz;
-
-		norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-		//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
-	
-		float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
-	
-		vec4 diffuse = texelFetch(diffuseRect, itc, i);
-		vec3 col;
-		float bloom = 0.0;
-
-		if (diffuse.a < 0.9)
-		{
-			vec4 spec = texelFetch(specularRect, itc, i);
-	
-			calcAtmospherics(pos.xyz, 1.0);
-	
-			col = atmosAmbient(vec3(0));
-			col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a));
-	
-			col *= diffuse.rgb;
-	
-			if (spec.a > 0.0) // specular reflection
-			{
-				// the old infinite-sky shiny reflection
-				//
-				vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-				float sa = dot(refnormpersp, vary_light.xyz);
-				vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
-
-				// add the two types of shiny together
-				vec3 spec_contrib = dumbshiny * spec.rgb;
-				bloom = dot(spec_contrib, spec_contrib);
-				col += spec_contrib;
-			}
-
-			col = atmosLighting(col);
-			col = scaleSoftClip(col);
-			col = mix(col, diffuse.rgb, diffuse.a);
-		}
-		else
-		{
-			col = diffuse.rgb;
-		}
-
-		fcol += vec4(col, bloom);
-	}
-				
-	gl_FragColor = fcol/samples;
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl
deleted file mode 100644
index 0c0171881fb..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl
+++ /dev/null
@@ -1,252 +0,0 @@
-/** 
- * @file multiSpotLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-
-
-//class 1 -- no shadows
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
-uniform sampler2D projectionMap;
-
-uniform mat4 proj_mat; //screen space to light space
-uniform float proj_near; //near clip for projection
-uniform vec3 proj_p; //plane projection is emitting from (in screen space)
-uniform vec3 proj_n;
-uniform float proj_focus; //distance from plane to begin blurring
-uniform float proj_lod;  //(number of mips in proj map)
-uniform float proj_range; //range between near clip and far clip plane of projection
-uniform float proj_ambient_lod;
-uniform float proj_ambiance;
-uniform float near_clip;
-uniform float far_clip;
-
-uniform vec3 proj_origin; //origin of projection to be used for angular attenuation
-uniform float sun_wash;
-uniform int proj_shadow_idx;
-uniform float shadow_fade;
-
-varying vec4 vary_light;
-
-varying vec4 vary_fragcoord;
-uniform vec2 screen_res;
-
-uniform mat4 inv_proj;
-
-vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float det = max(1.0-lod/(proj_lod*0.5), 0.0);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
-	
-	float det = min(lod/(proj_lod*0.5), 1.0);
-	
-	float d = min(dist.x, dist.y);
-	
-	float edge = 0.25*det;
-		
-	ret *= clamp(d/edge, 0.0, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0);
-	
-	return ret;
-}
-
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-	vec4 frag = vary_fragcoord;
-	frag.xyz /= frag.w;
-	frag.xyz = frag.xyz*0.5+0.5;
-	frag.xy *= screen_res;
-	ivec2 itc = ivec2(frag.xy);
-
-	vec3 fcol = vec3(0,0,0);
-	int wght = 0;
-	
-	for (int i = 0; i < samples; ++i)
-	{
-		vec3 pos = getPosition(itc, i).xyz;
-		vec3 lv = vary_light.xyz-pos.xyz;
-		float dist2 = dot(lv,lv);
-		dist2 /= vary_light.w;
-		if (dist2 <= 1.0)
-		{
-			vec3 norm = texelFetch(normalMap, itc, i).xyz*2.0-1.0;
-	
-			norm = normalize(norm);
-			float l_dist = -dot(lv, proj_n);
-	
-			vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0));
-			if (proj_tc.z >= 0.0)
-			{
-				proj_tc.xyz /= proj_tc.w;
-	
-				float fa = gl_Color.a+1.0;
-				float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
-				if (dist_atten > 0.0)
-				{
-					lv = proj_origin-pos.xyz;
-					lv = normalize(lv);
-					float da = dot(norm, lv);
-		
-					vec3 col = vec3(0,0,0);
-		
-					vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb;
-		
-					float noise = texture2D(noiseMap, frag.xy/128.0).b;
-					if (proj_tc.z > 0.0 &&
-						proj_tc.x < 1.0 &&
-						proj_tc.y < 1.0 &&
-						proj_tc.x > 0.0 &&
-						proj_tc.y > 0.0)
-					{
-						float lit = 0.0;
-						float amb_da = proj_ambiance;
-		
-						if (da > 0.0)
-						{
-							float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0);
-							float lod = diff * proj_lod;
-			
-							vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
-		
-							vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
-			
-							lit = da * dist_atten * noise;
-			
-							col = lcol*lit*diff_tex;
-							amb_da += (da*0.5)*proj_ambiance;
-						}
-		
-						//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
-						vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
-							
-						amb_da += (da*da*0.5+0.5)*proj_ambiance;
-				
-						amb_da *= dist_atten * noise;
-			
-						amb_da = min(amb_da, 1.0-lit);
-			
-						col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
-					}
-	
-	
-					vec4 spec = texelFetch(specularRect, itc, i);
-					if (spec.a > 0.0)
-					{
-						vec3 ref = reflect(normalize(pos), norm);
-		
-						//project from point pos in direction ref to plane proj_p, proj_n
-						vec3 pdelta = proj_p-pos;
-						float ds = dot(ref, proj_n);
-		
-						if (ds < 0.0)
-						{
-							vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
-			
-							vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
-
-							if (stc.z > 0.0)
-							{
-								stc.xy /= stc.w;
-
-								float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0);
-				
-								stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
-								
-								if (stc.x < 1.0 &&
-									stc.y < 1.0 &&
-									stc.x > 0.0 &&
-									stc.y > 0.0)
-								{
-									vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-									col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb;
-								}
-							}
-						}
-					}
-	
-					fcol += col;
-					++wght;
-				}
-			}
-		}
-	}
-
-	if (wght <= 0)
-	{
-		discard;
-	}
-
-	gl_FragColor.rgb = fcol/samples;	
-	gl_FragColor.a = 0.0;
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl
deleted file mode 100644
index 78ea15e87a9..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl
+++ /dev/null
@@ -1,35 +0,0 @@
-/** 
- * @file sunLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-//class 1, no shadow, no SSAO, should never be called
-
-#extension GL_ARB_texture_rectangle : enable
-
-void main() 
-{
-	gl_FragColor = vec4(0,0,0,0);
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl
deleted file mode 100644
index abb64334ed2..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl
+++ /dev/null
@@ -1,140 +0,0 @@
-/** 
- * @file sunLightSSAOF.glsl
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-//class 1 -- no shadow, SSAO only
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2D noiseMap;
-
-
-// Inputs
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
-uniform float ssao_radius;
-uniform float ssao_max_radius;
-uniform float ssao_factor;
-uniform float ssao_factor_inv;
-
-varying vec2 vary_fragcoord;
-varying vec4 vary_light;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-uniform float shadow_bias;
-uniform float shadow_offset;
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-//calculate decreases in ambient lighting when crowded out (SSAO)
-float calcAmbientOcclusion(vec4 pos, vec3 norm, int sample)
-{
-	float ret = 1.0;
-	
-	vec2 kern[8];
-	// exponentially (^2) distant occlusion samples spread around origin
-	kern[0] = vec2(-1.0, 0.0) * 0.125*0.125;
-	kern[1] = vec2(1.0, 0.0) * 0.250*0.250;
-	kern[2] = vec2(0.0, 1.0) * 0.375*0.375;
-	kern[3] = vec2(0.0, -1.0) * 0.500*0.500;
-	kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625;
-	kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750;
-	kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875;
-	kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000;
-
-	vec2 pos_screen = vary_fragcoord.xy;
-	vec3 pos_world = pos.xyz;
-	vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy;
-		
-	float angle_hidden = 0.0;
-	int points = 0;
-		
-	float scale = min(ssao_radius / -pos_world.z, ssao_max_radius);
-		
-	// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations unrolling?)
-	for (int i = 0; i < 8; i++)
-	{
-		ivec2 samppos_screen = ivec2(pos_screen + scale * reflect(kern[i], noise_reflect));
-		vec3 samppos_world = getPosition(samppos_screen, sample).xyz; 
-			
-		vec3 diff = pos_world - samppos_world;
-		float dist2 = dot(diff, diff);
-			
-		// assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area
-		// --> solid angle shrinking by the square of distance
-		//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2
-		//(k should vary inversely with # of samples, but this is taken care of later)
-			
-		angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv);
-			
-		// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" 
-		points = points + int(diff.z > -1.0);
-	}
-		
-	angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0);
-		
-	ret = (1.0 - (float(points != 0) * angle_hidden));
-	
-	return min(ret, 1.0);
-}
-
-void main() 
-{
-	vec2 pos_screen = vary_fragcoord.xy;
-	ivec2 itc = ivec2(pos_screen);
-		
-	float col = 0;
-
-	for (int i = 0; i < samples; i++)
-	{
-		vec4 pos = getPosition(itc, i);
-		vec3 norm = texelFetch(normalMap, itc, i).xyz;
-		norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-		col += calcAmbientOcclusion(pos,norm,i);
-	}
-
-	col /= samples;
-
-	gl_FragColor[0] = 1.0;
-	gl_FragColor[1] = col;
-	gl_FragColor[2] = 1.0; 
-	gl_FragColor[3] = 1.0;
-}
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 9fac986bf13..917462c1ee7 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1159,8 +1159,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 
 	BOOL success = TRUE;
 
-	U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples"));
-	bool multisample = samples > 1 && gGLManager.mHasTextureMultisample;
+	U32 samples = gSavedSettings.getU32("RenderFSAASamples");
+	bool multisample = samples > 1;
 
 	if (success)
 	{
@@ -1295,84 +1295,41 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	}
 
 	if (success)
-	{
-		std::string fragment;
-
-		if (multisample)
-		{
-			fragment = "deferred/pointLightMSF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/pointLightF.glsl";
-		}
-
+	{		
 		gDeferredLightProgram.mName = "Deferred Light Shader";
 		gDeferredLightProgram.mShaderFiles.clear();
 		gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredLightProgram.createShader(NULL, NULL);
 	}
 
 	if (success)
 	{
-		std::string fragment;
-		if (multisample)
-		{
-			fragment = "deferred/multiPointLightMSF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/multiPointLightF.glsl";
-		}
-
 		gDeferredMultiLightProgram.mName = "Deferred MultiLight Shader";
 		gDeferredMultiLightProgram.mShaderFiles.clear();
 		gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredMultiLightProgram.createShader(NULL, NULL);
 	}
 
 	if (success)
 	{
-		std::string fragment;
-
-		if (multisample)
-		{
-			fragment = "deferred/spotLightMSF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/multiSpotLightF.glsl";
-		}
-
 		gDeferredSpotLightProgram.mName = "Deferred SpotLight Shader";
 		gDeferredSpotLightProgram.mShaderFiles.clear();
 		gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredSpotLightProgram.createShader(NULL, NULL);
 	}
 
 	if (success)
 	{
-		std::string fragment;
-
-		if (multisample)
-		{
-			fragment = "deferred/multiSpotLightMSF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/multiSpotLightF.glsl";
-		}
-
 		gDeferredMultiSpotLightProgram.mName = "Deferred MultiSpotLight Shader";
 		gDeferredMultiSpotLightProgram.mShaderFiles.clear();
 		gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredMultiSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL);
 	}
@@ -1383,25 +1340,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 
 		if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
 		{
-			if (multisample)
-			{
-				fragment = "deferred/sunLightSSAOMSF.glsl";
-			}
-			else
-			{
-				fragment = "deferred/sunLightSSAOF.glsl";
-			}
+			fragment = "deferred/sunLightSSAOF.glsl";
 		}
 		else
 		{
-			if (multisample)
-			{
-				fragment = "deferred/sunLightMSF.glsl";
-			}
-			else
-			{
-				fragment = "deferred/sunLightF.glsl";
-			}
+			fragment = "deferred/sunLightF.glsl";
 		}
 
 		gDeferredSunProgram.mName = "Deferred Sun Shader";
@@ -1414,21 +1357,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 
 	if (success)
 	{
-		std::string fragment;
-
-		if (multisample)
-		{
-			fragment = "deferred/blurLightMSF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/blurLightF.glsl";
-		}
-
 		gDeferredBlurLightProgram.mName = "Deferred Blur Light Shader";
 		gDeferredBlurLightProgram.mShaderFiles.clear();
 		gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredBlurLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredBlurLightProgram.createShader(NULL, NULL);
 	}
@@ -1516,21 +1448,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 
 	if (success)
 	{
-		std::string fragment;
-
-		if (multisample)
-		{
-			fragment = "deferred/softenLightMSF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/softenLightF.glsl";
-		}
-
 		gDeferredSoftenProgram.mName = "Deferred Soften Shader";
 		gDeferredSoftenProgram.mShaderFiles.clear();
 		gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredSoftenProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB));
 
 		gDeferredSoftenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 
@@ -1627,11 +1548,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		std::string fragment;
 		if (multisample)
 		{
-			fragment = "deferred/postDeferredMSF.glsl";
+			fragment = "deferred/postDeferredF.glsl";
 		}
 		else
 		{
-			fragment = "deferred/postDeferredF.glsl";
+			fragment = "deferred/postDeferredNoFXAAF.glsl";
 		}
 
 		gDeferredPostProgram.mName = "Deferred Post Shader";
@@ -1647,11 +1568,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		std::string fragment;
 		if (multisample)
 		{
-			fragment = "deferred/postDeferredNoDoFMSF.glsl";
+			fragment = "deferred/postDeferredNoDoFF.glsl";
 		}
 		else
 		{
-			fragment = "deferred/postDeferredNoDoFF.glsl";
+			fragment = "deferred/postDeferredNoDoFNoFXAAF.glsl";
 		}
 
 		gDeferredPostNoDoFProgram.mName = "Deferred Post Shader";
@@ -1700,20 +1621,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	{
 		if (success)
 		{
-			std::string fragment;
-			if (multisample)
-			{
-				fragment = "deferred/edgeMSF.glsl";
-			}
-			else
-			{
-				fragment = "deferred/edgeF.glsl";
-			}
-
 			gDeferredEdgeProgram.mName = "Deferred Edge Shader";
 			gDeferredEdgeProgram.mShaderFiles.clear();
 			gDeferredEdgeProgram.mShaderFiles.push_back(make_pair("deferred/edgeV.glsl", GL_VERTEX_SHADER_ARB));
-			gDeferredEdgeProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+			gDeferredEdgeProgram.mShaderFiles.push_back(make_pair("deferred/edgeF.glsl", GL_FRAGMENT_SHADER_ARB));
 			gDeferredEdgeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 			success = gDeferredEdgeProgram.createShader(NULL, NULL);
 		}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 8d5bc22e6fd..d9fa4881e75 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -592,11 +592,6 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 {
 	U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples"));
 
-	if (gGLManager.mIsATI)
-	{ //ATI doesn't like the way we use multisample texture
-		samples = 0;
-	}
-
 	//try to allocate screen buffers at requested resolution and samples
 	// - on failure, shrink number of samples and try again
 	// - if not multisampled, shrink resolution and try again (favor X resolution over Y)
@@ -673,7 +668,14 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		if (!addDeferredAttachments(mDeferredScreen)) return false;
 	
 		if (!mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
-		if (!mFXAABuffer.allocate(nhpo2(resX), nhpo2(resY), GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
+		if (samples > 0)
+		{
+			if (!mFXAABuffer.allocate(nhpo2(resX), nhpo2(resY), GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false;
+		}
+		else
+		{
+			mFXAABuffer.release();
+		}
 		
 #if LL_DARWIN
 		// As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
@@ -6322,6 +6324,9 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	if (LLPipeline::sRenderDeferred)
 	{
 		bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater();
+		bool multisample = gSavedSettings.getU32("RenderFSAASamples") > 1;
+
+		if (multisample)
 		{
 			//bake out texture2D with RGBL for FXAA shader
 			mFXAABuffer.bindTarget();
@@ -6344,8 +6349,9 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 			gGlowCombineFXAAProgram.unbind();
 			mFXAABuffer.flush();
-			gViewerWindow->setup3DViewport();
 		}
+
+		gViewerWindow->setup3DViewport();
 				
 		LLGLSLShader* shader = &gDeferredPostProgram;
 		if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
@@ -6358,8 +6364,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			shader = &gDeferredPostNoDoFProgram;
 			dof_enabled = false;
 		}
-		
-		
+				
 		LLGLDisable blend(GL_BLEND);
 		bindDeferredShader(*shader);
 
@@ -6485,12 +6490,24 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			shader->uniform1f("magnification", magnification);
 		}
 
-		S32 channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
-		if (channel > -1)
+		if (multisample)
 		{
-			mFXAABuffer.bindTexture(0, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
+			S32 channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
+			if (channel > -1)
+			{
+				mFXAABuffer.bindTexture(0, channel);
+				gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
+			}
 		}
+		else
+		{
+			S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+			if (channel > -1)
+			{
+				mScreen.bindTexture(0, channel);
+			}
+		}
+
 	
 		gGL.begin(LLRender::TRIANGLE_STRIP);
 		gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-- 
GitLab


From 38c19f4e55c0f6a104de87dfb57313a6c529b4d6 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 1 Sep 2011 17:18:16 -0600
Subject: [PATCH 015/933] for SH-2242: fixes the assertion caused by
 gGL.diffuseColor4f when shadows is on.

---
 indra/newview/lldrawpoolavatar.cpp |  6 +++---
 indra/newview/pipeline.cpp         | 10 ++++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index f0eb52909dc..96c4efde3dc 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -353,15 +353,15 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
 	{
 		sVertexProgram = &gDeferredAvatarShadowProgram;
 		
-		//gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f);
-		
-		gGL.diffuseColor4f(1,1,1,1);
+		//gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f);		
 
 		if ((sShaderLevel > 0))  // for hardware blending
 		{
 			sRenderingSkinned = TRUE;
 			sVertexProgram->bind();
 		}
+
+		gGL.diffuseColor4f(1,1,1,1);
 	}
 	else
 	{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d9fa4881e75..f821ab8e34f 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4041,6 +4041,8 @@ void LLPipeline::renderGeomShadow(LLCamera& camera)
 		pool_set_t::iterator iter2 = iter1;
 		if (hasRenderType(poolp->getType()) && poolp->getNumShadowPasses() > 0)
 		{
+			poolp->prerender() ;
+
 			gGLLastMatrix = NULL;
 			glLoadMatrixd(gGLModelView);
 		
@@ -8341,12 +8343,8 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 	}
 
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-			
-	gGL.diffuseColor4f(1,1,1,1);
 	
 	stop_glerror();
-
-	gGL.setColorMask(false, false);
 	
 	//glCullFace(GL_FRONT);
 
@@ -8357,6 +8355,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 		{ //occlusion program is general purpose depth-only no-textures
 			gOcclusionProgram.bind();
 		}
+
+		gGL.diffuseColor4f(1,1,1,1);
+		gGL.setColorMask(false, false);
+	
 		LLFastTimer ftm(FTM_SHADOW_SIMPLE);
 		gGL.getTexUnit(0)->disable();
 		for (U32 i = 0; i < sizeof(types)/sizeof(U32); ++i)
-- 
GitLab


From e6da5a4bbaaefa81a058087ddc567caa459b58b7 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 13 Sep 2011 18:05:44 -0400
Subject: [PATCH 016/933] SH-2353 FIX selection streaming cost always says 0.0

PE found that the streaming cost function definition wasn't lining up with
its inherited function definition. Fixed the inhereted funciton definition
to add the new parameter. Selection streaming cost works again, though
client-side generated. Should probably depricate/remove this feature.
---
 indra/newview/llviewerobject.cpp | 2 +-
 indra/newview/llviewerobject.h   | 2 +-
 indra/newview/llvovolume.cpp     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index d20b6641d32..c5c841d6663 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -3217,7 +3217,7 @@ F32 LLViewerObject::getLinksetPhysicsCost()
 	return mLinksetPhysicsCost;
 }
 
-F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes)
+F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const
 {
 	return 0.f;
 }
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 53e951e483f..be5b9819b13 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -340,7 +340,7 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 	
 	virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE);
 
-	virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL);
+	virtual	F32	getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
 	virtual U32 getTriangleCount();
 	virtual U32 getHighLODTriangleCount();
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 6b0a5d8642f..380d63c77b9 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3579,7 +3579,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
 		bool special_cursor = specialHoverCursor();
 		for (S32 i = start_face; i < end_face; ++i)
 		{
-			if (!special_cursor && !pick_transparent && getTE(i)->getColor().mV[3] == 0.f)
+			if (!special_cursor && !pick_transparent && getTE(i) && getTE(i)->getColor().mV[3] == 0.f)
 			{ //don't attempt to pick completely transparent faces unless
 				//pick_transparent is true
 				continue;
-- 
GitLab


From 7c95af74f195c9ec4ebc0fc0264d98cd4a85be49 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 14 Sep 2011 16:30:45 -0500
Subject: [PATCH 017/933] SH-2243 work in progress -- application side matrix
 stack management

---
 indra/llrender/llcubemap.cpp            |  14 +-
 indra/llrender/llgl.cpp                 |  30 +--
 indra/llrender/llpostprocess.cpp        |  22 +-
 indra/llrender/llrender.cpp             | 183 ++++++++++++++-
 indra/llrender/llrender.h               |  36 ++-
 indra/llrender/llvertexbuffer.cpp       |  14 +-
 indra/llui/llaccordionctrltab.cpp       |   2 +-
 indra/llui/llui.cpp                     |  10 +-
 indra/llui/llview.cpp                   |   2 +-
 indra/newview/llagent.cpp               |   4 +-
 indra/newview/lldrawpool.cpp            |  12 +-
 indra/newview/lldrawpoolalpha.cpp       |   8 +-
 indra/newview/lldrawpoolavatar.cpp      |   8 +-
 indra/newview/lldrawpoolbump.cpp        |  16 +-
 indra/newview/lldrawpoolground.cpp      |   6 +-
 indra/newview/lldrawpoolsky.cpp         |   6 +-
 indra/newview/lldrawpoolterrain.cpp     | 135 ++++++-----
 indra/newview/lldrawpooltree.cpp        |  10 +-
 indra/newview/lldrawpoolwater.cpp       |  14 +-
 indra/newview/lldrawpoolwlsky.cpp       |  28 +--
 indra/newview/llface.cpp                |  27 +--
 indra/newview/llfasttimerview.cpp       |  10 +-
 indra/newview/llfloateranimpreview.cpp  |  14 +-
 indra/newview/llfloaterimagepreview.cpp |  28 +--
 indra/newview/llfloatermodelpreview.cpp |  22 +-
 indra/newview/llfloaterpostcard.cpp     |  14 +-
 indra/newview/llfloatersnapshot.cpp     |  16 +-
 indra/newview/llglsandbox.cpp           |   6 +-
 indra/newview/llhudeffectbeam.cpp       |   8 +-
 indra/newview/llhudeffectlookat.cpp     |   4 +-
 indra/newview/llhudeffectpointat.cpp    |   2 +-
 indra/newview/llhudrender.cpp           |  14 +-
 indra/newview/llmanip.cpp               |  24 +-
 indra/newview/llmaniprotate.cpp         |  82 +++----
 indra/newview/llmanipscale.cpp          |  42 ++--
 indra/newview/llmaniptranslate.cpp      |  36 +--
 indra/newview/llnetmap.cpp              |  10 +-
 indra/newview/llpanellogin.cpp          |   8 +-
 indra/newview/llprogressview.cpp        |  12 +-
 indra/newview/llselectmgr.cpp           |  42 ++--
 indra/newview/llspatialpartition.cpp    |  34 +--
 indra/newview/lltexlayer.cpp            |  14 +-
 indra/newview/lltoolbrush.cpp           |   8 +-
 indra/newview/lltoolmorph.cpp           |  14 +-
 indra/newview/lltracker.cpp             |   4 +-
 indra/newview/llviewercamera.cpp        |  18 +-
 indra/newview/llviewerdisplay.cpp       |  68 +++---
 indra/newview/llviewerjoint.cpp         |  16 +-
 indra/newview/llviewerjointmesh.cpp     |   6 +-
 indra/newview/llviewerparceloverlay.cpp |  10 +-
 indra/newview/llviewerwindow.cpp        |  46 ++--
 indra/newview/llvotree.cpp              |  23 +-
 indra/newview/llvowlsky.cpp             |   1 +
 indra/newview/llworldmapview.cpp        |   4 +-
 indra/newview/pipeline.cpp              | 283 ++++++++++++------------
 55 files changed, 876 insertions(+), 654 deletions(-)

diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index 1b10354c229..5eb29efbfa5 100644
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -273,10 +273,10 @@ void LLCubeMap::setMatrix(S32 stage)
 	LLMatrix4 trans(mat3);
 	trans.transpose();
 
-	glMatrixMode(GL_TEXTURE);
-	glPushMatrix();
-	glLoadMatrixf((F32 *)trans.mMatrix);
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.pushMatrix();
+	gGL.loadMatrix((F32 *)trans.mMatrix);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	
 	/*if (stage > 0)
 	{
@@ -292,9 +292,9 @@ void LLCubeMap::restoreMatrix()
 	{
 		gGL.getTexUnit(mMatrixStage)->activate();
 	}
-	glMatrixMode(GL_TEXTURE);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	
 	/*if (mMatrixStage > 0)
 	{
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 1a2fe0ea0e9..1667afe1796 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1195,7 +1195,7 @@ void rotate_quat(LLQuaternion& rotation)
 {
 	F32 angle_radians, x, y, z;
 	rotation.getAngleAxis(&angle_radians, &x, &y, &z);
-	glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+	gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 }
 
 void flush_glerror()
@@ -1987,20 +1987,20 @@ void LLGLUserClipPlane::setPlane(F32 a, F32 b, F32 c, F32 d)
     glh::matrix4f suffix;
     suffix.set_row(2, cplane);
     glh::matrix4f newP = suffix * P;
-    glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-    glLoadMatrixf(newP.m);
+    gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+    gGL.loadMatrix(newP.m);
 	gGLObliqueProjectionInverse = LLMatrix4(newP.inverse().transpose().m);
-    glMatrixMode(GL_MODELVIEW);
+    gGL.matrixMode(LLRender::MM_MODELVIEW);
 }
 
 LLGLUserClipPlane::~LLGLUserClipPlane()
 {
 	if (mApply)
 	{
-		glMatrixMode(GL_PROJECTION);
-		glPopMatrix();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
+		gGL.popMatrix();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 	}
 }
 
@@ -2190,16 +2190,16 @@ LLGLSquashToFarClip::LLGLSquashToFarClip(glh::matrix4f P, U32 layer)
 		P.element(2, i) = P.element(3, i) * depth;
 	}
 
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadMatrixf(P.m);
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.loadMatrix(P.m);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 }
 
 LLGLSquashToFarClip::~LLGLSquashToFarClip()
 {
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 }
 
diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp
index d76b2d90048..c0045c80447 100644
--- a/indra/llrender/llpostprocess.cpp
+++ b/indra/llrender/llpostprocess.cpp
@@ -466,21 +466,21 @@ void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadT
 
 void LLPostProcess::viewOrthogonal(unsigned int width, unsigned int height)
 {
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadIdentity();
-	glOrtho( 0.f, (GLdouble) width , (GLdouble) height , 0.f, -1.f, 1.f );
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-	glLoadIdentity();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.loadIdentity();
+	gGL.ortho( 0.f, (GLdouble) width , (GLdouble) height , 0.f, -1.f, 1.f );
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
+	gGL.loadIdentity();
 }
 
 void LLPostProcess::viewPerspective(void)
 {
-	glMatrixMode( GL_PROJECTION );
-	glPopMatrix();
-	glMatrixMode( GL_MODELVIEW );
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 }
 
 void LLPostProcess::changeOrthogonal(unsigned int width, unsigned int height)
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 426419f912c..27d25c0d3a6 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -951,6 +951,15 @@ LLRender::LLRender()
 	mCurrBlendAlphaSFactor = BF_UNDEF;
 	mCurrBlendColorDFactor = BF_UNDEF;
 	mCurrBlendAlphaDFactor = BF_UNDEF;
+
+	mMatrixMode = LLRender::MM_MODELVIEW;
+	
+	for (U32 i = 0; i < NUM_MATRIX_MODES; ++i)
+	{
+		mMatIdx[i] = 0;
+		mMatHash[i] = 0;
+		mCurMatHash[i] = 0xFFFFFFFF;
+	}
 }
 
 LLRender::~LLRender()
@@ -1007,28 +1016,182 @@ void LLRender::refreshState(void)
 	mDirty = false;
 }
 
+void LLRender::syncMatrices()
+{
+	GLenum mode[] = 
+	{
+		GL_MODELVIEW,
+		GL_PROJECTION,
+		GL_TEXTURE,
+		GL_TEXTURE,
+		GL_TEXTURE,
+		GL_TEXTURE,
+	};
+
+	for (U32 i = 0; i < 2; ++i)
+	{
+		if (mMatHash[i] != mCurMatHash[i])
+		{
+			glMatrixMode(mode[i]);
+			glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
+			mCurMatHash[i] = mMatHash[i];
+		}
+	}
+
+	for (U32 i = 2; i < NUM_MATRIX_MODES; ++i)
+	{
+		if (mMatHash[i] != mCurMatHash[i])
+		{
+			gGL.getTexUnit(i-2)->activate();
+			glMatrixMode(mode[i]);
+			glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
+			mCurMatHash[i] = mMatHash[i];
+		}
+	}
+	
+}
+
 void LLRender::translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 {
 	flush();
-	glTranslatef(x,y,z);
+
+	glh::matrix4f trans_mat(1,0,0,x,
+							0,1,0,y,
+							0,0,1,z,
+							0,0,0,1);
+	
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(trans_mat);
+	mMatHash[mMatrixMode]++;
 }
 
 void LLRender::scalef(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 {
 	flush();
-	glScalef(x,y,z);
+	
+	glh::matrix4f scale_mat(x,0,0,0,
+							0,y,0,0,
+							0,0,z,0,
+							0,0,0,1);
+	
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(scale_mat);
+	mMatHash[mMatrixMode]++;
+}
+
+void LLRender::ortho(F32 left, F32 right, F32 bottom, F32 top, F32 zNear, F32 zFar)
+{
+	flush();
+
+	glh::matrix4f ortho_mat(2.f/(right-left),0,0,	-(right+left)/(right-left),
+							0,2.f/(top-bottom),0,	-(top+bottom)/(top-bottom),
+							0,0,-2.f/(zFar-zNear),	-(zFar+zNear)/(zFar-zNear),
+							0,0,0,1);
+	
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(ortho_mat);
+	mMatHash[mMatrixMode]++;
+}
+
+void LLRender::rotatef(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z)
+{
+	flush();
+	
+	F32 r = a * DEG_TO_RAD;
+
+	F32 c = cosf(r);
+	F32 s = sinf(r);
+
+	F32 ic = 1.f-c;
+
+	glh::matrix4f rot_mat(x*x*ic+c,		x*y*ic-z*s,		x*z*ic+y*s,		0,
+						  x*y*ic+z*s,	y*y*ic+c,		y*z*ic-x*s,		0,
+						  x*z*ic-y*s,	y*z*ic+x*s,		z*z*ic+c,		0,
+						  0,0,0,1);
+	
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(rot_mat);
+	mMatHash[mMatrixMode]++;
 }
 
 void LLRender::pushMatrix()
 {
 	flush();
-	glPushMatrix();
+	
+	if (mMatIdx[mMatrixMode] < LL_MATRIX_STACK_DEPTH-1)
+	{
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]+1] = mMatrix[mMatrixMode][mMatIdx[mMatrixMode]];
+		++mMatIdx[mMatrixMode];
+	}
+	else
+	{
+		llwarns << "Matrix stack overflow." << llendl;
+	}
 }
 
 void LLRender::popMatrix()
 {
 	flush();
-	glPopMatrix();
+	if (mMatIdx[mMatrixMode] > 0)
+	{
+		--mMatIdx[mMatrixMode];
+		mMatHash[mMatrixMode]++;
+	}
+	else
+	{
+		llwarns << "Matrix stack underflow." << llendl;
+	}
+}
+
+void LLRender::loadMatrix(const GLfloat* m)
+{
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].set_value((GLfloat*) m);
+	mMatHash[mMatrixMode]++;
+}
+
+void LLRender::loadMatrix(const GLdouble* dm)
+{
+	F32 m[16];
+	for (U32 i = 0; i < 16; i++)
+	{
+		m[i] = (F32) dm[i];
+	}
+
+	loadMatrix(m);
+}
+
+void LLRender::multMatrix(const GLfloat* m)
+{
+	flush();
+
+	glh::matrix4f mat((GLfloat*) m);
+	
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(mat);
+	mMatHash[mMatrixMode]++;
+}
+
+void LLRender::matrixMode(U32 mode)
+{
+	if (mode == MM_TEXTURE)
+	{
+		mode = MM_TEXTURE0 + gGL.getCurrentTexUnitIndex();
+	}
+
+	llassert(mode < NUM_MATRIX_MODES);
+	mMatrixMode = mode;
+}
+
+void LLRender::multMatrix(const GLdouble* dm)
+{
+	F32 m[16];
+	for (U32 i = 0; i < 16; i++)
+	{
+		m[i] = (F32) dm[i];
+	}
+
+	multMatrix(m);
+}
+
+void LLRender::loadIdentity()
+{
+	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
+	mMatHash[mMatrixMode]++;
 }
 
 void LLRender::translateUI(F32 x, F32 y, F32 z)
@@ -1421,12 +1584,16 @@ void LLRender::flush()
 			}
 		}
 
+		//store mCount in a local variable to avoid re-entrance (drawArrays may call flush)
+		U32 count = mCount;
+		mCount = 0;
+
 		mBuffer->setBuffer(immediate_mask);
-		mBuffer->drawArrays(mMode, 0, mCount);
+		mBuffer->drawArrays(mMode, 0, count);
 		
-		mVerticesp[0] = mVerticesp[mCount];
-		mTexcoordsp[0] = mTexcoordsp[mCount];
-		mColorsp[0] = mColorsp[mCount];
+		mVerticesp[0] = mVerticesp[count];
+		mTexcoordsp[0] = mTexcoordsp[count];
+		mColorsp[0] = mColorsp[count];
 		mCount = 0;
 	}
 }
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index c202aa4b73c..465c16f0de7 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -41,6 +41,8 @@
 #include "llstrider.h"
 #include "llpointer.h"
 #include "llglheaders.h"
+#include "llmatrix4a.h"
+#include "glh/glh_linear.h"
 
 class LLVertexBuffer;
 class LLCubeMap;
@@ -48,6 +50,8 @@ class LLImageGL;
 class LLRenderTarget;
 class LLTexture ;
 
+#define LL_MATRIX_STACK_DEPTH 32
+
 class LLTexUnit
 {
 	friend class LLRender;
@@ -308,6 +312,18 @@ class LLRender
 		BF_UNDEF
 	} eBlendFactor;
 
+	typedef enum
+	{
+		MM_MODELVIEW = 0,
+		MM_PROJECTION,
+		MM_TEXTURE0,
+		MM_TEXTURE1,
+		MM_TEXTURE2,
+		MM_TEXTURE3,
+		NUM_MATRIX_MODES,
+		MM_TEXTURE
+	} eMatrixMode;
+
 	LLRender();
 	~LLRender();
 	void init() ;
@@ -319,8 +335,19 @@ class LLRender
 
 	void translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
 	void scalef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
+	void rotatef(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z);
+	void ortho(F32 left, F32 right, F32 bottom, F32 top, F32 zNear, F32 zFar);
+
 	void pushMatrix();
 	void popMatrix();
+	void loadMatrix(const GLfloat* m);
+	void loadMatrix(const GLdouble* m);
+	void loadIdentity();
+	void multMatrix(const GLfloat* m);
+	void multMatrix(const GLdouble* m);
+	void matrixMode(U32 mode);	
+
+	void syncMatrices();
 
 	void translateUI(F32 x, F32 y, F32 z);
 	void scaleUI(F32 x, F32 y, F32 z);
@@ -397,7 +424,14 @@ class LLRender
 	static U32 sUIVerts;
 	
 private:
-	bool				mDirty;
+	U32 mMatrixMode;
+	U32 mMatIdx[NUM_MATRIX_MODES];
+	U32 mMatHash[NUM_MATRIX_MODES];
+	glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH];
+
+	U32 mCurMatHash[NUM_MATRIX_MODES];
+	
+	bool			mDirty;
 	U32				mCount;
 	U32				mMode;
 	U32				mCurrTextureUnitIndex;
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index bb8f067e8db..090da765ac6 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -63,10 +63,8 @@ U32 LLVertexBuffer::sAllocatedBytes = 0;
 BOOL LLVertexBuffer::sMapped = FALSE;
 BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
 BOOL LLVertexBuffer::sPreferStreamDraw = FALSE;
-
 std::vector<U32> LLVertexBuffer::sDeleteList;
 
-
 const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000;  //1 ms
 
 class LLGLSyncFence : public LLGLFence
@@ -149,6 +147,7 @@ U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] =
 	GL_LINE_LOOP,
 };
 
+
 //static
 void LLVertexBuffer::setupClientArrays(U32 data_mask)
 {
@@ -356,6 +355,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm)
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+	gGL.syncMatrices();
 
 	U32 count = pos.size();
 	llassert_always(norm.size() >= pos.size());
@@ -394,6 +394,8 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
 
+	gGL.syncMatrices();
+
 	U32 mask = LLVertexBuffer::MAP_VERTEX;
 	if (tc)
 	{
@@ -465,6 +467,8 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 {
 	validateRange(start, end, count, indices_offset);
 
+	gGL.syncMatrices();
+
 	llassert(mRequestedNumVerts >= 0);
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
 
@@ -497,6 +501,8 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
 
+	gGL.syncMatrices();
+
 	llassert(mRequestedNumIndices >= 0);
 	if (indices_offset >= (U32) mRequestedNumIndices ||
 	    indices_offset + count > (U32) mRequestedNumIndices)
@@ -530,7 +536,9 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-
+	
+	gGL.syncMatrices();
+	
 	llassert(mRequestedNumVerts >= 0);
 	if (first >= (U32) mRequestedNumVerts ||
 	    first + count > (U32) mRequestedNumVerts)
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 6afe2763790..e832b6bbeb6 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -973,7 +973,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child)
 		
 		if ( root_rect.overlaps(screen_rect)  && LLUI::sDirtyRect.overlaps(screen_rect))
 		{
-			glMatrixMode(GL_MODELVIEW);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
 			{
 				LLUI::translate((F32)child->getRect().mLeft, (F32)child->getRect().mBottom, 0.f);
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 58ba9e05f50..b7894f5bf7b 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -150,11 +150,11 @@ void gl_state_for_2d(S32 width, S32 height)
 	F32 window_width = (F32) width;//gViewerWindow->getWindowWidth();
 	F32 window_height = (F32) height;//gViewerWindow->getWindowHeight();
 
-	glMatrixMode(GL_PROJECTION);
-	glLoadIdentity();
-	glOrtho(0.0f, llmax(window_width, 1.f), 0.0f, llmax(window_height,1.f), -1.0f, 1.0f);
-	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.loadIdentity();
+	gGL.ortho(0.0f, llmax(window_width, 1.f), 0.0f, llmax(window_height,1.f), -1.0f, 1.0f);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.loadIdentity();
 	stop_glerror();
 }
 
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 659a54cc6e0..c16481c1c89 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1433,7 +1433,7 @@ void LLView::drawChild(LLView* childp, S32 x_offset, S32 y_offset, BOOL force_dr
 		if ((childp->getVisible() && childp->getRect().isValid()) 
 			|| force_draw)
 		{
-			glMatrixMode(GL_MODELVIEW);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
 			{
 				LLUI::translate((F32)childp->getRect().mLeft + x_offset, (F32)childp->getRect().mBottom + y_offset, 0.f);
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 64a5884e14c..48afe778273 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3918,7 +3918,7 @@ void LLAgent::renderAutoPilotTarget()
 		F32 height_meters;
 		LLVector3d target_global;
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.pushMatrix();
 
 		// not textured
@@ -3933,7 +3933,7 @@ void LLAgent::renderAutoPilotTarget()
 
 		height_meters = 1.f;
 
-		glScalef(height_meters, height_meters, height_meters);
+		gGL.scalef(height_meters, height_meters, height_meters);
 
 		gSphere.render();
 
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 0c572def72c..35f8a857967 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -457,10 +457,10 @@ void LLRenderPass::applyModelMatrix(LLDrawInfo& params)
 	if (params.mModelMatrix != gGLLastMatrix)
 	{
 		gGLLastMatrix = params.mModelMatrix;
-		glLoadMatrixd(gGLModelView);
+		gGL.loadMatrix(gGLModelView);
 		if (params.mModelMatrix)
 		{
-			glMultMatrixf((GLfloat*) params.mModelMatrix->mMatrix);
+			gGL.multMatrix((GLfloat*) params.mModelMatrix->mMatrix);
 		}
 		gPipeline.mMatrixOpCount++;
 	}
@@ -494,8 +494,8 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba
 				{
 					tex_setup = true;
 					gGL.getTexUnit(0)->activate();
-					glMatrixMode(GL_TEXTURE);
-					glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
+					gGL.matrixMode(LLRender::MM_TEXTURE);
+					gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
 					gPipeline.mTextureMatrixOps++;
 				}
 			}
@@ -519,8 +519,8 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba
 
 	if (tex_setup)
 	{
-		glLoadIdentity();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 	}
 }
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 1e04cd9c176..a5032d007f2 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -475,8 +475,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
 						{
 							tex_setup = true;
 							gGL.getTexUnit(0)->activate();
-							glMatrixMode(GL_TEXTURE);
-							glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
+							gGL.matrixMode(LLRender::MM_TEXTURE);
+							gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
 							gPipeline.mTextureMatrixOps++;
 						}
 					}
@@ -517,8 +517,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
 				if (tex_setup)
 				{
 					gGL.getTexUnit(0)->activate();
-					glLoadIdentity();
-					glMatrixMode(GL_MODELVIEW);
+					gGL.loadIdentity();
+					gGL.matrixMode(LLRender::MM_MODELVIEW);
 				}
 			}
 		}
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 96c4efde3dc..f161790b99d 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1502,11 +1502,11 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 
 			if (face->mTextureMatrix)
 			{
-				glMatrixMode(GL_TEXTURE);
-				glLoadMatrixf((F32*) face->mTextureMatrix->mMatrix);
+				gGL.matrixMode(LLRender::MM_TEXTURE);
+				gGL.loadMatrix((F32*) face->mTextureMatrix->mMatrix);
 				buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);
-				glLoadIdentity();
-				glMatrixMode(GL_MODELVIEW);
+				gGL.loadIdentity();
+				gGL.matrixMode(LLRender::MM_MODELVIEW);
 			}
 			else
 			{
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 0c3e93cd8af..501bd889704 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1369,18 +1369,18 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
 			if (mShiny)
 			{
 				gGL.getTexUnit(0)->activate();
-				glMatrixMode(GL_TEXTURE);
+				gGL.matrixMode(LLRender::MM_TEXTURE);
 			}
 			else
 			{
 				gGL.getTexUnit(1)->activate();
-				glMatrixMode(GL_TEXTURE);
-				glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
+				gGL.matrixMode(LLRender::MM_TEXTURE);
+				gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
 				gPipeline.mTextureMatrixOps++;
 				gGL.getTexUnit(0)->activate();
 			}
 
-			glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix);
+			gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
 			gPipeline.mTextureMatrixOps++;
 
 			tex_setup = true;
@@ -1416,11 +1416,11 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
 		else
 		{
 			gGL.getTexUnit(1)->activate();
-			glLoadIdentity();
+			gGL.loadIdentity();
 			gGL.getTexUnit(0)->activate();
 		}
-		glLoadIdentity();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 	}
 }
 
@@ -1465,6 +1465,7 @@ void LLDrawPoolInvisible::endDeferredPass( S32 pass )
 
 void LLDrawPoolInvisible::renderDeferred( S32 pass )
 { //render invisiprims; this doesn't work becaue it also blocks all the post-deferred stuff
+#if 0 
 	LLFastTimer t(FTM_RENDER_INVISIBLE);
   
 	U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
@@ -1482,4 +1483,5 @@ void LLDrawPoolInvisible::renderDeferred( S32 pass )
 		renderShiny(true);
 		endShiny(true);
 	}
+#endif
 }
diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp
index ce07e62122d..59c3fbf7a12 100644
--- a/indra/newview/lldrawpoolground.cpp
+++ b/indra/newview/lldrawpoolground.cpp
@@ -71,9 +71,9 @@ void LLDrawPoolGround::render(S32 pass)
 	LLGLSquashToFarClip far_clip(glh_get_current_projection());
 
 	F32 water_height = gAgent.getRegion()->getWaterHeight();
-	glPushMatrix();
+	gGL.pushMatrix();
 	LLVector3 origin = LLViewerCamera::getInstance()->getOrigin();
-	glTranslatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height));
+	gGL.translatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height));
 
 	LLFace *facep = mDrawFace[0];
 
@@ -82,6 +82,6 @@ void LLDrawPoolGround::render(S32 pass)
 	LLOverrideFaceColor col(this, gSky.mVOSkyp->getGLFogColor());
 	facep->renderIndexed();
 	
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp
index d1c8fa5fc95..8a3871b6b42 100644
--- a/indra/newview/lldrawpoolsky.cpp
+++ b/indra/newview/lldrawpoolsky.cpp
@@ -111,9 +111,9 @@ void LLDrawPoolSky::render(S32 pass)
 	
 	LLGLDisable clip(GL_CLIP_PLANE0);
 
-	glPushMatrix();
+	gGL.pushMatrix();
 	LLVector3 origin = LLViewerCamera::getInstance()->getOrigin();
-	glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+	gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
 
 	S32 face_count = (S32)mDrawFace.size();
 
@@ -125,7 +125,7 @@ void LLDrawPoolSky::render(S32 pass)
 		renderSkyCubeFace(i);
 	}
 
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 void LLDrawPoolSky::renderSkyCubeFace(U8 side)
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 8d6b31912a0..3ba4a89686b 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -323,9 +323,9 @@ void LLDrawPoolTerrain::renderFullShader()
 
 	glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
 	glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	//
 	// detail texture 1
@@ -335,9 +335,9 @@ void LLDrawPoolTerrain::renderFullShader()
 	
 	/// ALPHA TEXTURE COORDS 0:
 	gGL.getTexUnit(1)->activate();
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	
 	// detail texture 2
 	//
@@ -347,10 +347,10 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(2)->activate();
 	
 	/// ALPHA TEXTURE COORDS 1:
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glTranslatef(-2.f, 0.f, 0.f);
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.translatef(-2.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	//
 	// detail texture 3
@@ -360,10 +360,10 @@ void LLDrawPoolTerrain::renderFullShader()
 	
 	/// ALPHA TEXTURE COORDS 2:
 	gGL.getTexUnit(3)->activate();
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glTranslatef(-1.f, 0.f, 0.f);
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.translatef(-1.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	//
 	// Alpha Ramp 
@@ -386,36 +386,33 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(4)->activate();
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
-
+	
 	gGL.getTexUnit(detail3)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(3)->disable();
 	gGL.getTexUnit(3)->activate();
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	gGL.getTexUnit(detail2)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(2)->disable();
 	gGL.getTexUnit(2)->activate();
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	gGL.getTexUnit(detail1)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(1)->disable();
 	gGL.getTexUnit(1)->activate();
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	
 	//----------------------------------------------------------------------------
 	// Restore Texture Unit 0 defaults
@@ -425,9 +422,9 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(0)->activate();
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 }
 
 void LLDrawPoolTerrain::renderFull4TU()
@@ -538,9 +535,9 @@ void LLDrawPoolTerrain::renderFull4TU()
 	gGL.getTexUnit(1)->activate();
 
 	// Set the texture matrix
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glTranslatef(-2.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.translatef(-2.f, 0.f, 0.f);
 
 	// Care about alpha only
 	gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
@@ -570,9 +567,9 @@ void LLDrawPoolTerrain::renderFull4TU()
 	gGL.getTexUnit(3)->activate();
 
 	// Set the texture matrix
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glTranslatef(-1.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.translatef(-1.f, 0.f, 0.f);
   
 	// Set alpha texture and do lighting modulation
 	gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR);
@@ -590,9 +587,9 @@ void LLDrawPoolTerrain::renderFull4TU()
 	gGL.getTexUnit(3)->disable();
 	gGL.getTexUnit(3)->activate();
 	
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	gGL.getTexUnit(2)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(2)->disable();
@@ -600,17 +597,17 @@ void LLDrawPoolTerrain::renderFull4TU()
 	
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE);	
 	gGL.getTexUnit(1)->disable();
 	gGL.getTexUnit(1)->activate();
  	
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	// Restore blend state
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -624,9 +621,9 @@ void LLDrawPoolTerrain::renderFull4TU()
 	
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
 }
@@ -718,9 +715,9 @@ void LLDrawPoolTerrain::renderFull2TU()
 	gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
 
 	// Set the texture matrix
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glTranslatef(-1.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.translatef(-1.f, 0.f, 0.f);
 
 	// Care about alpha only
 	gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
@@ -757,9 +754,9 @@ void LLDrawPoolTerrain::renderFull2TU()
 	gGL.getTexUnit(0)->activate();
 	gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
 	// Set the texture matrix
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glTranslatef(-2.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.translatef(-2.f, 0.f, 0.f);
 
 	// Care about alpha only
 	gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
@@ -797,9 +794,9 @@ void LLDrawPoolTerrain::renderFull2TU()
 
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	//----------------------------------------------------------------------------
 	// Restore Texture Unit 0 defaults
@@ -809,9 +806,9 @@ void LLDrawPoolTerrain::renderFull2TU()
 
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
 }
 
@@ -853,9 +850,9 @@ void LLDrawPoolTerrain::renderSimple()
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	glDisable(GL_TEXTURE_GEN_S);
 	glDisable(GL_TEXTURE_GEN_T);
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
 }
 
@@ -886,11 +883,11 @@ void LLDrawPoolTerrain::renderOwnership()
 	// texture coordinates for pixel 256x256 is not 1,1. This makes the
 	// ownership map not line up with the selection. We address this with
 	// a texture matrix multiply.
-	glMatrixMode(GL_TEXTURE);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.pushMatrix();
 
 	const F32 TEXTURE_FUDGE = 257.f / 256.f;
-	glScalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f );
+	gGL.scalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f );
 	for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
 		 iter != mDrawFace.end(); iter++)
 	{
@@ -899,9 +896,9 @@ void LLDrawPoolTerrain::renderOwnership()
 							LLVertexBuffer::MAP_TEXCOORD0);
 	}
 
-	glMatrixMode(GL_TEXTURE);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 }
 
 
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index da8e3e8b3a6..3fe5b4d9291 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -197,7 +197,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
 		
 	U32 indices_drawn = 0;
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	
 	for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
 		 iter != mDrawFace.end(); iter++)
@@ -228,8 +228,8 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
 			}
 			
 			gGLLastMatrix = NULL;
-			glLoadMatrixd(gGLModelView);
-			//glPushMatrix();
+			gGL.loadMatrix(gGLModelView);
+			//gGL.pushMatrix();
 			F32 mat[16];
 			for (U32 i = 0; i < 16; i++)
 				mat[i] = (F32) gGLModelView[i];
@@ -238,7 +238,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
 			
 			// Translate to tree base  HACK - adjustment in Z plants tree underground
 			const LLVector3 &pos_agent = treep->getPositionAgent();
-			//glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
+			//gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
 			LLMatrix4 trans_mat;
 			trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
 			trans_mat *= matrix;
@@ -309,7 +309,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
 				indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
 			}
 			
-			//glPopMatrix();
+			//gGL.popMatrix();
 		}
 	}
 }
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index ae1598907bd..c97f92fa6f5 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -275,15 +275,15 @@ void LLDrawPoolWater::render(S32 pass)
 		gSky.mVOSkyp->getCubeMap()->enable(0);
 		gSky.mVOSkyp->getCubeMap()->bind();
 
-		glMatrixMode(GL_TEXTURE);
-		glLoadIdentity();
+		gGL.matrixMode(LLRender::MM_TEXTURE);
+		gGL.loadIdentity();
 		LLMatrix4 camera_mat = LLViewerCamera::getInstance()->getModelview();
 		LLMatrix4 camera_rot(camera_mat.getMat3());
 		camera_rot.invert();
 
-		glLoadMatrixf((F32 *)camera_rot.mMatrix);
+		gGL.loadMatrix((F32 *)camera_rot.mMatrix);
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		LLOverrideFaceColor overrid(this, 1.f, 1.f, 1.f,  0.5f*up_dot);
 
 		gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
@@ -310,9 +310,9 @@ void LLDrawPoolWater::render(S32 pass)
 		
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
-		glMatrixMode(GL_TEXTURE);
-		glLoadIdentity();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_TEXTURE);
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		
 	}
 
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 852de39781e..f2d077030cf 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -130,33 +130,33 @@ void LLDrawPoolWLSky::renderDome(F32 camHeightLocal, LLGLSLShader * shader) cons
 
 	llassert_always(NULL != shader);
 
-	glPushMatrix();
+	gGL.pushMatrix();
 
 	//chop off translation
 	if (LLPipeline::sReflectionRender && origin.mV[2] > 256.f)
 	{
-		glTranslatef(origin.mV[0], origin.mV[1], 256.f-origin.mV[2]*0.5f);
+		gGL.translatef(origin.mV[0], origin.mV[1], 256.f-origin.mV[2]*0.5f);
 	}
 	else
 	{
-		glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+		gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
 	}
 		
 
 	// the windlight sky dome works most conveniently in a coordinate system
 	// where Y is up, so permute our basis vectors accordingly.
-	glRotatef(120.f, 1.f / F_SQRT3, 1.f / F_SQRT3, 1.f / F_SQRT3);
+	gGL.rotatef(120.f, 1.f / F_SQRT3, 1.f / F_SQRT3, 1.f / F_SQRT3);
 
-	glScalef(0.333f, 0.333f, 0.333f);
+	gGL.scalef(0.333f, 0.333f, 0.333f);
 
-	glTranslatef(0.f,-camHeightLocal, 0.f);
+	gGL.translatef(0.f,-camHeightLocal, 0.f);
 	
 	// Draw WL Sky	
 	shader->uniform3f("camPosLocal", 0.f, camHeightLocal, 0.f);
 
 	gSky.mVOWLSkyp->drawDome();
 
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 void LLDrawPoolWLSky::renderSkyHaze(F32 camHeightLocal) const
@@ -197,7 +197,7 @@ void LLDrawPoolWLSky::renderStars(void) const
 	gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getBloomTex());
 
 	gGL.pushMatrix();
-	glRotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f);
+	gGL.rotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f);
 	// gl_FragColor.rgb = gl_Color.rgb;
 	// gl_FragColor.a = gl_Color.a * star_alpha.a;
 	if (LLGLSLShader::sNoFixedFunction)
@@ -315,10 +315,10 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
 	renderSkyHaze(camHeightLocal);
 
 	LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
-	glPushMatrix();
+	gGL.pushMatrix();
 
 		
-		glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+		gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
 
 		gDeferredStarProgram.bind();
 		// *NOTE: have to bind a texture here since register combiners blending in
@@ -332,7 +332,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
 		
 		gDeferredStarProgram.unbind();
 
-	glPopMatrix();
+	gGL.popMatrix();
 
 	renderSkyClouds(camHeightLocal);
 
@@ -360,9 +360,9 @@ void LLDrawPoolWLSky::render(S32 pass)
 	renderSkyHaze(camHeightLocal);
 
 	LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
-	glPushMatrix();
+	gGL.pushMatrix();
 
-		glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+		gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
 
 		// *NOTE: have to bind a texture here since register combiners blending in
 		// renderStars() requires something to be bound and we might as well only
@@ -374,7 +374,7 @@ void LLDrawPoolWLSky::render(S32 pass)
 		renderStars();
 		
 
-	glPopMatrix();
+	gGL.popMatrix();
 
 	renderSkyClouds(camHeightLocal);
 
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index f5a8013f4df..7ae11bff94d 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -496,11 +496,11 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
 		gGL.pushMatrix();
 		if (mDrawablep->isActive())
 		{
-			glMultMatrixf((GLfloat*)mDrawablep->getRenderMatrix().mMatrix);
+			gGL.multMatrix((GLfloat*)mDrawablep->getRenderMatrix().mMatrix);
 		}
 		else
 		{
-			glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix);
+			gGL.multMatrix((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix);
 		}
 
 		gGL.diffuseColor4fv(color.mV);
@@ -515,7 +515,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
 				{
 					LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
 					glPolygonOffset(-1.f, -1.f);
-					glMultMatrixf((F32*) volume->getRelativeXform().mMatrix);
+					gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
 					const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset());
 					LLVertexBuffer::unbind();
 					glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions);
@@ -524,6 +524,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
 						glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 						glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
 					}
+					gGL.syncMatrices();
 					glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
 					glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 				}
@@ -557,17 +558,17 @@ void LLFace::renderSelectedUV()
 
 	// add green dither pattern on top of red/blue gradient
 	gGL.blendFunc(LLRender::BF_ONE, LLRender::BF_ONE);
-	glMatrixMode(GL_TEXTURE);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.pushMatrix();
 	// make green pattern repeat once per texel in red/blue texture
-	glScalef(256.f, 256.f, 1.f);
-	glMatrixMode(GL_MODELVIEW);
+	gGL.scalef(256.f, 256.f, 1.f);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	renderSelected(green_imagep, LLColor4::white);
 
-	glMatrixMode(GL_TEXTURE);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
 }
 */
@@ -2170,10 +2171,10 @@ S32 LLFace::renderElements(const U16 *index_array) const
 	}
 	else
 	{
-		glPushMatrix();
-		glMultMatrixf((float*)getRenderMatrix().mMatrix);
+		gGL.pushMatrix();
+		gGL.multMatrix((float*)getRenderMatrix().mMatrix);
 		ret = pushVertices(index_array);
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 	
 	return ret;
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 366154302cd..c24e0014be6 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -1107,10 +1107,10 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
 	LLPointer<LLImageRaw> scratch = new LLImageRaw(1024, 512, 3);
 
 	gGL.pushMatrix();
-	glLoadIdentity();
-	glMatrixMode(GL_PROJECTION);
-	glLoadIdentity();
-	glOrtho(-0.05, 1.05, -0.05, 1.05, -1.0, 1.0);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.loadIdentity();
+	gGL.ortho(-0.05f, 1.05f, -0.05f, 1.05f, -1.0f, 1.0f);
 
 	//render charts
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1349,7 +1349,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
 	buffer.flush();
 
 	gGL.popMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.popMatrix();
 }
 
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp
index 1318dfdf2a5..54b9a1f27bd 100644
--- a/indra/newview/llfloateranimpreview.cpp
+++ b/indra/newview/llfloateranimpreview.cpp
@@ -1062,14 +1062,14 @@ BOOL	LLPreviewAnimation::render()
 	mNeedsUpdate = FALSE;
 	LLVOAvatar* avatarp = mDummyAvatar;
 	
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.pushMatrix();
-	glLoadIdentity();
-	glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
+	gGL.loadIdentity();
+	gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
-	glLoadIdentity();
+	gGL.loadIdentity();
 
 	if (LLGLSLShader::sNoFixedFunction)
 	{
@@ -1082,10 +1082,10 @@ BOOL	LLPreviewAnimation::render()
 
 	gl_rect_2d_simple( mFullWidth, mFullHeight );
 
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.popMatrix();
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.popMatrix();
 
 	gGL.flush();
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index b9c298ff9d9..69de15d9eae 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -650,14 +650,14 @@ BOOL LLImagePreviewAvatar::render()
 	gGL.pushUIMatrix();
 	gGL.loadUIIdentity();
 
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.pushMatrix();
-	glLoadIdentity();
-	glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
+	gGL.loadIdentity();
+	gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
-	glLoadIdentity();
+	gGL.loadIdentity();
 	
 
 	LLGLSUIDefault def;
@@ -670,10 +670,10 @@ BOOL LLImagePreviewAvatar::render()
 
 	gl_rect_2d_simple( mFullWidth, mFullHeight );
 
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.popMatrix();
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.popMatrix();
 
 	gGL.flush();
@@ -844,14 +844,14 @@ BOOL LLImagePreviewSculpted::render()
 	LLGLEnable cull(GL_CULL_FACE);
 	LLGLDepthTest depth(GL_TRUE);
 
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.pushMatrix();
-	glLoadIdentity();
-	glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
+	gGL.loadIdentity();
+	gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
-	glLoadIdentity();
+	gGL.loadIdentity();
 		
 	gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
 
@@ -862,10 +862,10 @@ BOOL LLImagePreviewSculpted::render()
 
 	gl_rect_2d_simple( mFullWidth, mFullHeight );
 	
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.popMatrix();
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.popMatrix();
 
 	glClear(GL_DEPTH_BUFFER_BIT);
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6817f1e2c8e..6412a573f5f 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4746,23 +4746,23 @@ BOOL LLModelPreview::render()
 
 	{
 		//clear background to blue
-		glMatrixMode(GL_PROJECTION);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
 		gGL.pushMatrix();
-		glLoadIdentity();
-		glOrtho(0.0f, width, 0.0f, height, -1.0f, 1.0f);
+		gGL.loadIdentity();
+		gGL.ortho(0.0f, width, 0.0f, height, -1.0f, 1.0f);
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.pushMatrix();
-		glLoadIdentity();
+		gGL.loadIdentity();
 
 		gGL.color4f(0.169f, 0.169f, 0.169f, 1.f);
 
 		gl_rect_2d_simple( width, height );
 
-		glMatrixMode(GL_PROJECTION);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
 		gGL.popMatrix();
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.popMatrix();
 	}
 
@@ -4872,7 +4872,7 @@ BOOL LLModelPreview::render()
 		refresh();
 	}
 
-	glLoadIdentity();
+	gGL.loadIdentity();
 	gPipeline.enableLightsPreview();
 
 	LLQuaternion camera_rot = LLQuaternion(mCameraPitch, LLVector3::y_axis) *
@@ -4951,7 +4951,7 @@ BOOL LLModelPreview::render()
 				gGL.pushMatrix();
 				LLMatrix4 mat = instance.mTransform;
 
-				glMultMatrixf((GLfloat*) mat.mMatrix);
+				gGL.multMatrix((GLfloat*) mat.mMatrix);
 
 				for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i)
 				{
@@ -5018,7 +5018,7 @@ BOOL LLModelPreview::render()
 					gGL.pushMatrix();
 					LLMatrix4 mat = instance.mTransform;
 
-					glMultMatrixf((GLfloat*) mat.mMatrix);
+					gGL.multMatrix((GLfloat*) mat.mMatrix);
 
 
 					bool render_mesh = true;
@@ -5127,7 +5127,7 @@ BOOL LLModelPreview::render()
 					gGL.pushMatrix();
 					LLMatrix4 mat = instance.mTransform;
 
-					glMultMatrixf((GLfloat*) mat.mMatrix);
+					gGL.multMatrix((GLfloat*) mat.mMatrix);
 
 
 					LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread;
diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp
index 3bcbb987f75..2fd7c0ef0ed 100644
--- a/indra/newview/llfloaterpostcard.cpp
+++ b/indra/newview/llfloaterpostcard.cpp
@@ -159,11 +159,11 @@ void LLFloaterPostcard::draw()
 		}
 		{
 
-		glMatrixMode(GL_TEXTURE);
-		glPushMatrix();
+		gGL.matrixMode(LLRender::MM_TEXTURE);
+		gGL.pushMatrix();
 		{
-			glScalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f);
-			glMatrixMode(GL_MODELVIEW);
+			gGL.scalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			gl_draw_scaled_image(rect.mLeft,
 								 rect.mBottom,
 								 rect.getWidth(),
@@ -171,9 +171,9 @@ void LLFloaterPostcard::draw()
 								 mViewerImage.get(), 
 								 LLColor4::white % alpha);
 		}
-		glMatrixMode(GL_TEXTURE);
-		glPopMatrix();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_TEXTURE);
+		gGL.popMatrix();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		}
 	}
 }
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 00dc7b16275..a6678b9feee 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -445,9 +445,9 @@ void LLSnapshotLivePreview::draw()
 		// calculate UV scale
 		F32 uv_width = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mWidth[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f);
 		F32 uv_height = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mHeight[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f);
-		glPushMatrix();
+		gGL.pushMatrix();
 		{
-			glTranslatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
+			gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
 			gGL.begin(LLRender::QUADS);
 			{
 				gGL.texCoord2f(uv_width, uv_height);
@@ -464,7 +464,7 @@ void LLSnapshotLivePreview::draw()
 			}
 			gGL.end();
 		}
-		glPopMatrix();
+		gGL.popMatrix();
 
 		gGL.color4f(1.f, 1.f, 1.f, mFlashAlpha);
 		gl_rect_2d(getRect());
@@ -580,11 +580,11 @@ void LLSnapshotLivePreview::draw()
 			BOOL rescale = !mImageScaled[old_image_index] && mViewerImage[mCurImageIndex].notNull();
 			F32 uv_width = rescale ? llmin((F32)mWidth[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f) : 1.f;
 			F32 uv_height = rescale ? llmin((F32)mHeight[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f) : 1.f;
-			glPushMatrix();
+			gGL.pushMatrix();
 			{
 				LLRect& rect = mImageRect[old_image_index];
-				glTranslatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
-				glRotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
+				gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
+				gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
 				gGL.begin(LLRender::QUADS);
 				{
 					gGL.texCoord2f(uv_width, uv_height);
@@ -601,7 +601,7 @@ void LLSnapshotLivePreview::draw()
 				}
 				gGL.end();
 			}
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 	}
 }
@@ -2226,7 +2226,7 @@ void LLFloaterSnapshot::draw()
 			S32 offset_x = (getRect().getWidth() - previewp->getThumbnailWidth()) / 2 ;
 			S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ;
 
-			glMatrixMode(GL_MODELVIEW);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			// Apply floater transparency to the texture unless the floater is focused.
 			F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
 			gl_draw_scaled_image(offset_x, offset_y, 
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index fa3f546157b..8c872283bdf 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -115,7 +115,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
 	S32 center_y = (top + bottom) / 2;
 
 	// save drawing mode
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.pushMatrix();
 
 	BOOL limit_select_distance = gSavedSettings.getBOOL("LimitSelectDistance");
@@ -230,9 +230,9 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
 	}
 
 	// restore drawing mode
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.popMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	// restore camera
 	LLViewerCamera::getInstance()->setFar(old_far_plane);
diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp
index ec5a0926c4c..8abad3d292f 100644
--- a/indra/newview/llhudeffectbeam.cpp
+++ b/indra/newview/llhudeffectbeam.cpp
@@ -297,11 +297,11 @@ void LLHUDEffectBeam::render()
 		coloru.mV[3] = (U8)alpha;
 		gGL.color4ubv(coloru.mV);
 
-		glPushMatrix();
-		glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
-		glScalef(scale, scale, scale);
+		gGL.pushMatrix();
+		gGL.translatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
+		gGL.scalef(scale, scale, scale);
 		gSphere.render();
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 }
 
diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp
index b380b3fe202..bc3b220dc09 100644
--- a/indra/newview/llhudeffectlookat.cpp
+++ b/indra/newview/llhudeffectlookat.cpp
@@ -498,10 +498,10 @@ void LLHUDEffectLookAt::render()
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
 		LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.pushMatrix();
 		gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]);
-		glScalef(0.3f, 0.3f, 0.3f);
+		gGL.scalef(0.3f, 0.3f, 0.3f);
 		gGL.begin(LLRender::LINES);
 		{
 			LLColor3 color = (*mAttentions)[mTargetType].mColor;
diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp
index 28fe8e1c015..114a633821c 100644
--- a/indra/newview/llhudeffectpointat.cpp
+++ b/indra/newview/llhudeffectpointat.cpp
@@ -327,7 +327,7 @@ void LLHUDEffectPointAt::render()
 		LLVector3 target = mTargetPos + mSourceObject->getRenderPosition();
 		gGL.pushMatrix();
 		gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]);
-		glScalef(0.3f, 0.3f, 0.3f);
+		gGL.scalef(0.3f, 0.3f, 0.3f);
 		gGL.begin(LLRender::LINES);
 		{
 			gGL.color3f(1.f, 0.f, 0.f);
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp
index 1156e764a17..607f7f7f4b8 100644
--- a/indra/newview/llhudrender.cpp
+++ b/indra/newview/llhudrender.cpp
@@ -112,9 +112,9 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
 				&winX, &winY, &winZ);
 		
 	//fonts all render orthographically, set up projection``
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	LLUI::pushMatrix();
 		
@@ -124,7 +124,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
 	winX -= world_view_rect.mLeft;
 	winY -= world_view_rect.mBottom;
 	LLUI::loadIdentity();
-	glLoadIdentity();
+	gGL.loadIdentity();
 	LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f));
 	F32 right_x;
 	
@@ -133,7 +133,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
 	LLUI::popMatrix();
 	gGL.popMatrix();
 
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 }
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index d10f6562f79..6e0f360cbc0 100644
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -372,14 +372,14 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z)
 	//LLVector3  center_agent  = LLSelectMgr::getInstance()->getBBoxOfSelection().getCenterAgent();
 	LLVector3  center_agent  = getPivotPoint();
 
-	glPushMatrix();
+	gGL.pushMatrix();
 	{
-		glTranslatef(center_agent.mV[VX], center_agent.mV[VY], center_agent.mV[VZ]);
+		gGL.translatef(center_agent.mV[VX], center_agent.mV[VY], center_agent.mV[VZ]);
 
 		F32 angle_radians, x, y, z;
 
 		grid_rot.getAngleAxis(&angle_radians, &x, &y, &z);
-		glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+		gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 
 		F32 region_size = LLWorld::getInstance()->getRegionWidthInMeters();
 
@@ -416,7 +416,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z)
 		}
 		LLUI::setLineWidth(1.0f);
 	}
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 void LLManip::renderXYZ(const LLVector3 &vec) 
@@ -481,8 +481,8 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons
 	const LLFontGL* big_fontp = LLFontGL::getFontSansSerif();
 
 	BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD;
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 	LLVector3 render_pos = pos;
 	if (hud_selection)
 	{
@@ -490,7 +490,7 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons
 		F32 inv_zoom_amt = 1.f / zoom_amt;
 		// scale text back up to counter-act zoom level
 		render_pos = pos * zoom_amt;
-		glScalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
+		gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
 	}
 
 	// render shadow first
@@ -501,7 +501,7 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons
 	gViewerWindow->setup3DViewport();
 	hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(text), 3.f, color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
 
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string& suffix, const LLColor4 &color)
@@ -539,8 +539,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
 	}
 
 	BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD;
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 	LLVector3 render_pos = pos;
 	if (hud_selection)
 	{
@@ -548,7 +548,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
 		F32 inv_zoom_amt = 1.f / zoom_amt;
 		// scale text back up to counter-act zoom level
 		render_pos = pos * zoom_amt;
-		glScalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
+		gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
 	}
 
 	LLColor4 shadow_color = LLColor4::black;
@@ -573,7 +573,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
 		gViewerWindow->setup3DViewport();
 		hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection);
 	}
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass)
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index 6ee095475fb..19798ef7529 100644
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -130,12 +130,12 @@ void LLManipRotate::render()
 		return;
 	}
 
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 	if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
 	{
 		F32 zoom = gAgentCamera.mHUDCurZoom;
-		glScalef(zoom, zoom, zoom);
+		gGL.scalef(zoom, zoom, zoom);
 	}
 
 
@@ -145,7 +145,7 @@ void LLManipRotate::render()
 	LLColor4 highlight_inside( 0.7f, 0.7f, 0.f, 0.5f );
 	F32 width_meters = WIDTH_PIXELS * mRadiusMeters / RADIUS_PIXELS;
 
-	glPushMatrix();
+	gGL.pushMatrix();
 	{
 		// are we in the middle of a constrained drag?
 		if (mManipPart >= LL_ROT_X && mManipPart <= LL_ROT_Z)
@@ -156,11 +156,11 @@ void LLManipRotate::render()
 		{
 			LLGLEnable cull_face(GL_CULL_FACE);
 			LLGLDepthTest gls_depth(GL_FALSE);
-			glPushMatrix();
+			gGL.pushMatrix();
 			{
 				// Draw "sphere" (intersection of sphere with tangent cone that has apex at camera)
-				glTranslatef( mCenterToProfilePlane.mV[VX], mCenterToProfilePlane.mV[VY], mCenterToProfilePlane.mV[VZ] );
-				glTranslatef( center.mV[VX], center.mV[VY], center.mV[VZ] );
+				gGL.translatef( mCenterToProfilePlane.mV[VX], mCenterToProfilePlane.mV[VY], mCenterToProfilePlane.mV[VZ] );
+				gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] );
 
 				// Inverse change of basis vectors
 				LLVector3 forward = mCenterToCamNorm;
@@ -177,14 +177,14 @@ void LLManipRotate::render()
 				LLMatrix4 mat;
 				mat.initRows(a, b, c, LLVector4(0.f, 0.f, 0.f, 1.f));
 
-				glMultMatrixf( &mat.mMatrix[0][0] );
+				gGL.multMatrix( &mat.mMatrix[0][0] );
 
-				glRotatef( -90, 0.f, 1.f, 0.f);
+				gGL.rotatef( -90, 0.f, 1.f, 0.f);
 				LLColor4 color;
 				if (mManipPart == LL_ROT_ROLL || mHighlightedPart == LL_ROT_ROLL)
 				{
 					color.setVec(0.8f, 0.8f, 0.8f, 0.8f);
-					glScalef(mManipulatorScales.mV[VW], mManipulatorScales.mV[VW], mManipulatorScales.mV[VW]);
+					gGL.scalef(mManipulatorScales.mV[VW], mManipulatorScales.mV[VW], mManipulatorScales.mV[VW]);
 				}
 				else
 				{
@@ -202,10 +202,10 @@ void LLManipRotate::render()
 				GLdouble plane_eqn[] = { 0, 0, 1, 0 };
 				glClipPlane( GL_CLIP_PLANE0, plane_eqn );
 			}
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 
-		glTranslatef( center.mV[VX], center.mV[VY], center.mV[VZ] );
+		gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] );
 
 		LLQuaternion rot;
 		F32 angle_radians, x, y, z;
@@ -217,41 +217,41 @@ void LLManipRotate::render()
 		LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
 
 		grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
-		glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+		gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 
 
 		if (mManipPart == LL_ROT_Z)
 		{
 			mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
-			glPushMatrix();
+			gGL.pushMatrix();
 			{
 				// selected part
-				glScalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]);
+				gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]);
 				renderActiveRing( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f) , LLColor4( 0.f, 0.f, 1.f, 0.3f ));
 			}
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 		else if (mManipPart == LL_ROT_Y)
 		{
 			mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
-			glPushMatrix();
+			gGL.pushMatrix();
 			{
-				glRotatef( 90.f, 1.f, 0.f, 0.f );
-				glScalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]);
+				gGL.rotatef( 90.f, 1.f, 0.f, 0.f );
+				gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]);
 				renderActiveRing( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f), LLColor4( 0.f, 1.f, 0.f, 0.3f));
 			}
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 		else if (mManipPart == LL_ROT_X)
 		{
 			mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
-			glPushMatrix();
+			gGL.pushMatrix();
 			{
-				glRotatef( 90.f, 0.f, 1.f, 0.f );
-				glScalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]);
+				gGL.rotatef( 90.f, 0.f, 1.f, 0.f );
+				gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]);
 				renderActiveRing( mRadiusMeters, width_meters, LLColor4( 1.f, 0.f, 0.f, 1.f), LLColor4( 1.f, 0.f, 0.f, 0.3f));
 			}
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 		else if (mManipPart == LL_ROT_ROLL)
 		{
@@ -271,12 +271,12 @@ void LLManipRotate::render()
 			// First pass: centers. Second pass: sides.
 			for( S32 i=0; i<2; i++ )
 			{
-				glPushMatrix();
+				gGL.pushMatrix();
 				{
 					if (mHighlightedPart == LL_ROT_Z)
 					{
 						mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
-						glScalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]);
+						gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]);
 						// hovering over part
 						gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i);
 					}
@@ -286,15 +286,15 @@ void LLManipRotate::render()
 						gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 0.8f, 0.8f ), LLColor4( 0.f, 0.f, 0.8f, 0.4f ), CIRCLE_STEPS, i);
 					}
 				}
-				glPopMatrix();
+				gGL.popMatrix();
 
-				glPushMatrix();
+				gGL.pushMatrix();
 				{
-					glRotatef( 90.f, 1.f, 0.f, 0.f );
+					gGL.rotatef( 90.f, 1.f, 0.f, 0.f );
 					if (mHighlightedPart == LL_ROT_Y)
 					{
 						mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
-						glScalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]);
+						gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]);
 						// hovering over part
 						gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i);
 					}
@@ -304,15 +304,15 @@ void LLManipRotate::render()
 						gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.8f, 0.f, 0.8f ), LLColor4( 0.f, 0.8f, 0.f, 0.4f ), CIRCLE_STEPS, i);
 					}						
 				}
-				glPopMatrix();
+				gGL.popMatrix();
 
-				glPushMatrix();
+				gGL.pushMatrix();
 				{
-					glRotatef( 90.f, 0.f, 1.f, 0.f );
+					gGL.rotatef( 90.f, 0.f, 1.f, 0.f );
 					if (mHighlightedPart == LL_ROT_X)
 					{
 						mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
-						glScalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]);
+						gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]);
 	
 						// hovering over part
 						gl_ring( mRadiusMeters, width_meters, LLColor4( 1.f, 0.f, 0.f, 1.f ), LLColor4( 1.f, 0.f, 0.f, 0.5f ), CIRCLE_STEPS, i);
@@ -323,7 +323,7 @@ void LLManipRotate::render()
 						gl_ring( mRadiusMeters, width_meters, LLColor4( 0.8f, 0.f, 0.f, 0.8f ), LLColor4( 0.8f, 0.f, 0.f, 0.4f ), CIRCLE_STEPS, i);
 					}
 				}
-				glPopMatrix();
+				gGL.popMatrix();
 
 				if (mHighlightedPart == LL_ROT_ROLL)
 				{
@@ -332,8 +332,8 @@ void LLManipRotate::render()
 			}
 		}
 	}
-	glPopMatrix();
-	glPopMatrix();
+	gGL.popMatrix();
+	gGL.popMatrix();
 
 	LLVector3 euler_angles;
 	LLQuaternion object_rot = first_object->getRotationEdit();
@@ -796,14 +796,14 @@ void LLManipRotate::renderSnapGuides()
 		for (S32 pass = 0; pass < 3; pass++)
 		{
 			// render snap guide ring
-			glPushMatrix();
+			gGL.pushMatrix();
 			
 			LLQuaternion snap_guide_rot;
 			F32 angle_radians, x, y, z;
 			snap_guide_rot.shortestArc(LLVector3::z_axis, getConstraintAxis());
 			snap_guide_rot.getAngleAxis(&angle_radians, &x, &y, &z);
-			glTranslatef(center.mV[VX], center.mV[VY], center.mV[VZ]);
-			glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+			gGL.translatef(center.mV[VX], center.mV[VY], center.mV[VZ]);
+			gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 
 			LLColor4 line_color = setupSnapGuideRenderPass(pass);
 
@@ -826,7 +826,7 @@ void LLManipRotate::renderSnapGuides()
 			{
 				gl_circle_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, FALSE);
 			}
-			glPopMatrix();
+			gGL.popMatrix();
 
 			for (S32 i = 0; i < 64; i++)
 			{
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 4eb94dfb8e8..f6df4cdfbfe 100644
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -217,12 +217,12 @@ void LLManipScale::render()
 	
 	if( canAffectSelection() )
 	{
-		glMatrixMode(GL_MODELVIEW);
-		glPushMatrix();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
+		gGL.pushMatrix();
 		if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
 		{
 			F32 zoom = gAgentCamera.mHUDCurZoom;
-			glScalef(zoom, zoom, zoom);
+			gGL.scalef(zoom, zoom, zoom);
 		}
 
 		////////////////////////////////////////////////////////////////////////
@@ -274,14 +274,14 @@ void LLManipScale::render()
 		LLVector3 pos_agent = bbox.getPositionAgent();
 		LLQuaternion rot = bbox.getRotation();
 
-		glMatrixMode(GL_MODELVIEW);
-		glPushMatrix();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
+		gGL.pushMatrix();
 		{
-			glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ]);
+			gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ]);
 
 			F32 angle_radians, x, y, z;
 			rot.getAngleAxis(&angle_radians, &x, &y, &z);
-			glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+			gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 
 			
 			{
@@ -303,13 +303,13 @@ void LLManipScale::render()
 				glPolygonOffset( 0.f, 0.f);
 			}
 		}
-		glPopMatrix();
+		gGL.popMatrix();
 
 		if (mManipPart != LL_NO_PART)
 		{
 			renderSnapGuides(bbox);
 		}
-		glPopMatrix();
+		gGL.popMatrix();
 
 		renderXYZ(bbox.getExtentLocal());
 	}
@@ -719,17 +719,17 @@ void LLManipScale::renderEdges( const LLBBox& bbox )
 		LLVector3 direction = edgeToUnitVector( part );
 		LLVector3 center_to_edge = unitVectorToLocalBBoxExtent( direction, bbox );
 
-		glPushMatrix();
+		gGL.pushMatrix();
 		{
-			glTranslatef( center_to_edge.mV[0], center_to_edge.mV[1], center_to_edge.mV[2] );
+			gGL.translatef( center_to_edge.mV[0], center_to_edge.mV[1], center_to_edge.mV[2] );
 			conditionalHighlight( part );
-			glScalef( 
+			gGL.scalef( 
 				direction.mV[0] ? edge_width : extent.mV[VX],
 				direction.mV[1] ? edge_width : extent.mV[VY],
 				direction.mV[2] ? edge_width : extent.mV[VZ] );
 			gBox.render();
 		}
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 }
 
@@ -766,13 +766,13 @@ void LLManipScale::renderBoxHandle( F32 x, F32 y, F32 z )
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	LLGLDepthTest gls_depth(GL_FALSE);
 
-	glPushMatrix();
+	gGL.pushMatrix();
 	{
-		glTranslatef( x, y, z );
-		glScalef( mScaledBoxHandleSize, mScaledBoxHandleSize, mScaledBoxHandleSize );
+		gGL.translatef( x, y, z );
+		gGL.scalef( mScaledBoxHandleSize, mScaledBoxHandleSize, mScaledBoxHandleSize );
 		gBox.render();
 	}
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 
@@ -788,16 +788,16 @@ void LLManipScale::renderAxisHandle( const LLVector3& start, const LLVector3& en
 		LLVector3 delta = end - offset_start;
 		LLVector3 pos = offset_start + 0.5f * delta;
 
-		glPushMatrix();
+		gGL.pushMatrix();
 		{
-			glTranslatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] );
-			glScalef( 
+			gGL.translatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] );
+			gGL.scalef( 
 				mBoxHandleSize + llabs(delta.mV[VX]),
 				mBoxHandleSize + llabs(delta.mV[VY]),
 				mBoxHandleSize + llabs(delta.mV[VZ]));
 			gBox.render();
 		}
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 	else
 	{
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index a9b14829b2d..3a88fbd96de 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1066,12 +1066,12 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask)
 
 void LLManipTranslate::render()
 {
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
 	{
 		F32 zoom = gAgentCamera.mHUDCurZoom;
-		glScalef(zoom, zoom, zoom);
+		gGL.scalef(zoom, zoom, zoom);
 	}
 	{
 		LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
@@ -1515,12 +1515,12 @@ void LLManipTranslate::renderSnapGuides()
 		F32 x,y,z,angle_radians;
 		grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
 		gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]);
-		glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+		gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 		
 		F32 sz = mGridSizeMeters;
 		F32 tiles = sz;
 
-		glMatrixMode(GL_TEXTURE);
+		gGL.matrixMode(LLRender::MM_TEXTURE);
 		gGL.pushMatrix();
 		usc = 1.0f/usc;
 		vsc = 1.0f/vsc;
@@ -1534,7 +1534,7 @@ void LLManipTranslate::renderSnapGuides()
 			vsc *= 0.5f;
 		}
 
-		glScalef(usc, vsc, 1.0f);
+		gGL.scalef(usc, vsc, 1.0f);
 		gGL.translatef(u, v, 0);
 		
 		float a = line_alpha;
@@ -1567,7 +1567,7 @@ void LLManipTranslate::renderSnapGuides()
 					renderGrid(u,v,tiles,1,1,1,a);
 
 					gGL.popMatrix();
-					glMatrixMode(GL_MODELVIEW);
+					gGL.matrixMode(LLRender::MM_MODELVIEW);
 					gGL.popMatrix();
 				}
 
@@ -1724,7 +1724,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
 	F32 x,y,z,angle_radians;
 	grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
 	gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]);
-	glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+	gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 	
 	F32 sz = mGridSizeMeters;
 	F32 tiles = sz;
@@ -1853,7 +1853,7 @@ void LLManipTranslate::renderTranslationHandles()
 	mGridSizeMeters = gSavedSettings.getF32("GridDrawSize");
 	mConeSize = mArrowLengthMeters / 4.f;
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	{
 		gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]);
@@ -1861,7 +1861,7 @@ void LLManipTranslate::renderTranslationHandles()
 		F32 angle_radians, x, y, z;
 		grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z);
 
-		glRotatef(angle_radians * RAD_TO_DEG, x, y, z);
+		gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 
 		LLQuaternion invRotation = grid_rotation;
 		invRotation.conjQuat();
@@ -1909,9 +1909,9 @@ void LLManipTranslate::renderTranslationHandles()
 			{
 				// render YZ plane manipulator
 				gGL.pushMatrix();
-				glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]);
+				gGL.scalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]);
 				gGL.translatef(0.f, mPlaneManipOffsetMeters, mPlaneManipOffsetMeters);
-				glScalef(mPlaneScales.mV[VX], mPlaneScales.mV[VX], mPlaneScales.mV[VX]);
+				gGL.scalef(mPlaneScales.mV[VX], mPlaneScales.mV[VX], mPlaneScales.mV[VX]);
 				if (mHighlightedPart == LL_YZ_PLANE)
 				{
 					color1.setVec(0.f, 1.f, 0.f, 1.f);
@@ -1963,9 +1963,9 @@ void LLManipTranslate::renderTranslationHandles()
 			{
 				// render XZ plane manipulator
 				gGL.pushMatrix();
-				glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]);
+				gGL.scalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]);
 				gGL.translatef(mPlaneManipOffsetMeters, 0.f, mPlaneManipOffsetMeters);
-				glScalef(mPlaneScales.mV[VY], mPlaneScales.mV[VY], mPlaneScales.mV[VY]);
+				gGL.scalef(mPlaneScales.mV[VY], mPlaneScales.mV[VY], mPlaneScales.mV[VY]);
 				if (mHighlightedPart == LL_XZ_PLANE)
 				{
 					color1.setVec(0.f, 0.f, 1.f, 1.f);
@@ -2019,7 +2019,7 @@ void LLManipTranslate::renderTranslationHandles()
 			{
 				// render XY plane manipulator
 				gGL.pushMatrix();
-				glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]);
+				gGL.scalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]);
 				
 /*				 			  Y
 				 			  ^
@@ -2044,7 +2044,7 @@ void LLManipTranslate::renderTranslationHandles()
 					v2 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f);
 					v3 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f);
 #endif
-					glScalef(mPlaneScales.mV[VZ], mPlaneScales.mV[VZ], mPlaneScales.mV[VZ]);
+					gGL.scalef(mPlaneScales.mV[VZ], mPlaneScales.mV[VZ], mPlaneScales.mV[VZ]);
 					if (mHighlightedPart == LL_XY_PLANE)
 					{
 						color1.setVec(1.f, 0.f, 0.f, 1.f);
@@ -2216,7 +2216,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
 		}
 		
 		gGL.translatef(vec.mV[0], vec.mV[1], vec.mV[2]);
-		glScalef(handle_size, handle_size, handle_size);
+		gGL.scalef(handle_size, handle_size, handle_size);
 
 		F32 rot = 0.0f;
 		LLVector3 axis;
@@ -2241,8 +2241,8 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
 		}
 
 		gGL.diffuseColor4fv(color.mV);
-		glRotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]);
-		glScalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f);
+		gGL.rotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]);
+		gGL.scalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f);
 
 		gCone.render();
 
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 5fe5c9b1e8a..15d5d7c1628 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -172,10 +172,10 @@ void LLNetMap::draw()
 	LLVector3 offset = gGL.getUITranslation();
 	LLVector3 scale = gGL.getUIScale();
 
-	glLoadIdentity();
+	gGL.loadIdentity();
 	gGL.loadUIIdentity();
 
-	glScalef(scale.mV[0], scale.mV[1], scale.mV[2]);
+	gGL.scalef(scale.mV[0], scale.mV[1], scale.mV[2]);
 	gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]);
 	
 	{
@@ -183,7 +183,7 @@ void LLNetMap::draw()
 		{
 			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
-			glMatrixMode(GL_MODELVIEW);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 			// Draw background rectangle
 			LLColor4 background_color = mBackgroundColor.get();
@@ -204,7 +204,7 @@ void LLNetMap::draw()
 		{
 			// rotate subsequent draws to agent rotation
 			rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] );
-			glRotatef( rotation * RAD_TO_DEG, 0.f, 0.f, 1.f);
+			gGL.rotatef( rotation * RAD_TO_DEG, 0.f, 0.f, 1.f);
 		}
 
 		// figure out where agent is
@@ -492,7 +492,7 @@ void LLNetMap::draw()
 			// If we don't rotate the map, we have to rotate the frustum.
 			gGL.pushMatrix();
 				gGL.translatef( ctr_x, ctr_y, 0 );
-				glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f);
+				gGL.rotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f);
 				gGL.begin( LLRender::TRIANGLES  );
 					gGL.vertex2f( 0, 0 );
 					gGL.vertex2f( -half_width_pixels, far_clip_pixels );
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index db7d836799c..a637ff156c9 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -287,15 +287,15 @@ LLPanelLogin::~LLPanelLogin()
 // virtual
 void LLPanelLogin::draw()
 {
-	glPushMatrix();
+	gGL.pushMatrix();
 	{
 		F32 image_aspect = 1.333333f;
 		F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight();
 		// stretch image to maintain aspect ratio
 		if (image_aspect > view_aspect)
 		{
-			glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f);
-			glScalef(image_aspect / view_aspect, 1.f, 1.f);
+			gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f);
+			gGL.scalef(image_aspect / view_aspect, 1.f, 1.f);
 		}
 
 		S32 width = getRect().getWidth();
@@ -310,7 +310,7 @@ void LLPanelLogin::draw()
 			mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
 		};
 	}
-	glPopMatrix();
+	gGL.popMatrix();
 
 	LLPanel::draw();
 }
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index a1f38f18547..5d7a5b1c59b 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -187,7 +187,7 @@ void LLProgressView::setVisible(BOOL visible)
 
 void LLProgressView::drawStartTexture(F32 alpha)
 {
-	glPushMatrix();	
+	gGL.pushMatrix();	
 	if (gStartTexture)
 	{
 		LLGLSUIDefault gls_ui;
@@ -200,13 +200,13 @@ void LLProgressView::drawStartTexture(F32 alpha)
 		// stretch image to maintain aspect ratio
 		if (image_aspect > view_aspect)
 		{
-			glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f);
-			glScalef(image_aspect / view_aspect, 1.f, 1.f);
+			gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f);
+			gGL.scalef(image_aspect / view_aspect, 1.f, 1.f);
 		}
 		else
 		{
-			glTranslatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f);
-			glScalef(1.f, view_aspect / image_aspect, 1.f);
+			gGL.translatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f);
+			gGL.scalef(1.f, view_aspect / image_aspect, 1.f);
 		}
 		gl_rect_2d_simple_tex( getRect().getWidth(), getRect().getHeight() );
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -217,7 +217,7 @@ void LLProgressView::drawStartTexture(F32 alpha)
 		gGL.color4f(0.f, 0.f, 0.f, 1.f);
 		gl_rect_2d(getRect());
 	}
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 48cccc12ef9..76d6954a88c 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5134,20 +5134,20 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
 		F32 cur_zoom = gAgentCamera.mHUDCurZoom;
 
 		// set up transform to encompass bounding box of HUD
-		glMatrixMode(GL_PROJECTION);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
 		gGL.pushMatrix();
-		glLoadIdentity();
+		gGL.loadIdentity();
 		F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f);
-		glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth);
+		gGL.ortho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth);
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.pushMatrix();
 		gGL.pushUIMatrix();
 		gGL.loadUIIdentity();
-		glLoadIdentity();
-		glLoadMatrixf(OGL_TO_CFR_ROTATION);		// Load Cory's favorite reference frame
-		glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f);
-		glScalef(cur_zoom, cur_zoom, cur_zoom);
+		gGL.loadIdentity();
+		gGL.loadMatrix(OGL_TO_CFR_ROTATION);		// Load Cory's favorite reference frame
+		gGL.translatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f);
+		gGL.scalef(cur_zoom, cur_zoom, cur_zoom);
 	}
 	if (mSelectedObjects->getNumNodes())
 	{
@@ -5240,10 +5240,10 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
 
 	if (isAgentAvatarValid() && for_hud)
 	{
-		glMatrixMode(GL_PROJECTION);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
 		gGL.popMatrix();
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.popMatrix();
 		gGL.popUIMatrix();
 		stop_glerror();
@@ -5567,7 +5567,7 @@ void pushWireframe(LLDrawable* drawable)
 			{
 				LLVertexBuffer::unbind();
 				gGL.pushMatrix();
-				glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix);
+				gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
 				for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i)
 				{
 					const LLVolumeFace& face = rigged_volume->getVolumeFace(i);
@@ -5611,22 +5611,22 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
 		gHighlightProgram.bind();
 	}
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	
 	BOOL is_hud_object = objectp->isHUDAttachment();
 
 	if (drawable->isActive())
 	{
-		glLoadMatrixd(gGLModelView);
-		glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix);
+		gGL.loadMatrix(gGLModelView);
+		gGL.multMatrix((F32*) objectp->getRenderMatrix().mMatrix);
 	}
 	else if (!is_hud_object)
 	{
-		glLoadIdentity();
-		glMultMatrixd(gGLModelView);
+		gGL.loadIdentity();
+		gGL.multMatrix(gGLModelView);
 		LLVector3 trans = objectp->getRegion()->getOriginAgent();		
-		glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]);		
+		gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);		
 	}
 	
 	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
@@ -5713,21 +5713,21 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
 		return;
 	}
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	gGL.pushUIMatrix();
 	gGL.loadUIIdentity();
 
 	if (!is_hud_object)
 	{
-		glLoadIdentity();
-		glMultMatrixd(gGLModelView);
+		gGL.loadIdentity();
+		gGL.multMatrix(gGLModelView);
 	}
 	
 	
 	if (drawable->isActive())
 	{
-		glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix);
+		gGL.multMatrix((F32*) objectp->getRenderMatrix().mMatrix);
 	}
 
 	LLVolume *volume = objectp->getVolume();
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index e0c3b431101..81d7fe70c15 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2552,9 +2552,9 @@ void renderOctree(LLSpatialGroup* group)
 				LLDrawable* drawable = *i;
 				if (!group->mSpatialPartition->isBridge())
 				{
-					glPushMatrix();
+					gGL.pushMatrix();
 					LLVector3 trans = drawable->getRegion()->getOriginAgent();
-					glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]);
+					gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
 				}
 				
 				for (S32 j = 0; j < drawable->getNumFaces(); j++)
@@ -2584,7 +2584,7 @@ void renderOctree(LLSpatialGroup* group)
 
 				if (!group->mSpatialPartition->isBridge())
 				{
-					glPopMatrix();
+					gGL.popMatrix();
 				}
 			}
 			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@@ -2866,7 +2866,7 @@ void renderNormals(LLDrawable* drawablep)
 	{
 		LLVolume* volume = vol->getVolume();
 		gGL.pushMatrix();
-		glMultMatrixf((F32*) vol->getRelativeXform().mMatrix);
+		gGL.multMatrix((F32*) vol->getRelativeXform().mMatrix);
 		
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
@@ -3018,7 +3018,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 	LLVector3 size(0.25f,0.25f,0.25f);
 
 	gGL.pushMatrix();
-	glMultMatrixf((F32*) volume->getRelativeXform().mMatrix);
+	gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
 		
 	if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH)
 	{
@@ -3264,6 +3264,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 			LLVertexBuffer::unbind();
 			glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
 			gGL.diffuseColor4fv(line_color.mV);
+			gGL.syncMatrices();
 			glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
 			
 			gGL.diffuseColor4fv(color.mV);
@@ -3302,7 +3303,7 @@ void renderPhysicsShapes(LLSpatialGroup* group)
 			{
 				gGL.pushMatrix();
 				LLVector3 trans = drawable->getRegion()->getOriginAgent();
-				glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]);
+				gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
 				renderPhysicsShape(drawable, volume);
 				gGL.popMatrix();
 			}
@@ -3618,8 +3619,8 @@ void renderRaycast(LLDrawable* drawablep)
 					}
 
 					gGL.pushMatrix();
-					glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]);					
-					glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix);
+					gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);					
+					gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
 
 					LLVector3 start, end;
 					if (transform)
@@ -3650,6 +3651,7 @@ void renderRaycast(LLDrawable* drawablep)
 						LLVertexBuffer::unbind();
 						gGL.diffuseColor4f(0,1,1,0.5f);
 						glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
+						gGL.syncMatrices();
 						glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
 					}
 						
@@ -3672,15 +3674,15 @@ void renderRaycast(LLDrawable* drawablep)
 		if (drawablep->getVObj() == gDebugRaycastObject)
 		{
 			// draw intersection point
-			glPushMatrix();
-			glLoadMatrixd(gGLModelView);
+			gGL.pushMatrix();
+			gGL.loadMatrix(gGLModelView);
 			LLVector3 translate = gDebugRaycastIntersection;
-			glTranslatef(translate.mV[0], translate.mV[1], translate.mV[2]);
+			gGL.translatef(translate.mV[0], translate.mV[1], translate.mV[2]);
 			LLCoordFrame orient;
 			orient.lookDir(gDebugRaycastNormal, gDebugRaycastBinormal);
 			LLMatrix4 rotation;
 			orient.getRotMatrixToParent(rotation);
-			glMultMatrixf((float*)rotation.mMatrix);
+			gGL.multMatrix((float*)rotation.mMatrix);
 			
 			gGL.color4f(1,0,0,0.5f);
 			drawBox(LLVector3(0, 0, 0), LLVector3(0.1f, 0.022f, 0.022f));
@@ -3688,7 +3690,7 @@ void renderRaycast(LLDrawable* drawablep)
 			drawBox(LLVector3(0, 0, 0), LLVector3(0.021f, 0.1f, 0.021f));
 			gGL.color4f(0,0,1,0.5f);
 			drawBox(LLVector3(0, 0, 0), LLVector3(0.02f, 0.02f, 0.1f));
-			glPopMatrix();
+			gGL.popMatrix();
 
 			// draw bounding box of prim
 			const LLVector4a* ext = drawablep->getSpatialExtents();
@@ -3763,13 +3765,13 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 				group->rebuildMesh();
 
 				gGL.flush();
-				glPushMatrix();
+				gGL.pushMatrix();
 				gGLLastMatrix = NULL;
-				glLoadMatrixd(gGLModelView);
+				gGL.loadMatrix(gGLModelView);
 				renderVisibility(group, mCamera);
 				stop_glerror();
 				gGLLastMatrix = NULL;
-				glPopMatrix();
+				gGL.popMatrix();
 				gGL.color4f(1,1,1,1);
 			}
 		}
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index f44e62335da..e2c2b2ae21c 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -216,22 +216,22 @@ void LLTexLayerSetBuffer::cancelUpload()
 
 void LLTexLayerSetBuffer::pushProjection() const
 {
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.pushMatrix();
-	glLoadIdentity();
-	glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
+	gGL.loadIdentity();
+	gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
-	glLoadIdentity();
+	gGL.loadIdentity();
 }
 
 void LLTexLayerSetBuffer::popProjection() const
 {
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.popMatrix();
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.popMatrix();
 }
 
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp
index 9782b90cf1b..aba43a97153 100644
--- a/indra/newview/lltoolbrush.cpp
+++ b/indra/newview/lltoolbrush.cpp
@@ -507,12 +507,12 @@ void LLToolBrushLand::render()
 void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region,
 									const LLVector3& pos_world)
 {
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	LLGLDepthTest mDepthTest(GL_TRUE);
-	glPushMatrix();
+	gGL.pushMatrix();
 	gGL.color4fv(OVERLAY_COLOR.mV);
-	glTranslatef(0.0f, 0.0f, 1.0f);
+	gGL.translatef(0.0f, 0.0f, 1.0f);
 	
 	S32 i = (S32) pos_region.mV[VX];
 	S32 j = (S32) pos_region.mV[VY];
@@ -566,7 +566,7 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region
 	}
 	gGL.end();
 
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 void LLToolBrushLand::determineAffectedRegions(region_list_t& regions,
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index eeb90a2b19d..718201e381a 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -169,14 +169,14 @@ BOOL LLVisualParamHint::render()
 	gGL.pushUIMatrix();
 	gGL.loadUIIdentity();
 
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.pushMatrix();
-	glLoadIdentity();
-	glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
+	gGL.loadIdentity();
+	gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
-	glLoadIdentity();
+	gGL.loadIdentity();
 
 	if (LLGLSLShader::sNoFixedFunction)
 	{
@@ -187,10 +187,10 @@ BOOL LLVisualParamHint::render()
 	//LLGLState::verify(TRUE);
 	mBackgroundp->draw(0, 0, mFullWidth, mFullHeight);
 
-	glMatrixMode(GL_PROJECTION);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
 	gGL.popMatrix();
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.popMatrix();
 
 	mNeedsUpdate = FALSE;
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 2ec7534025b..bec05bd3d2d 100644
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -505,10 +505,10 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
 	LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
 	
 	
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	{
-		glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
+		gGL.translatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
 		
 		draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color);
 
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index 7f7366dd3d9..c0ef4da1ffe 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -325,8 +325,8 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 	aspect = getAspect();
 
 	// Load camera view matrix
-	glMatrixMode( GL_PROJECTION );
-	glLoadIdentity();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.loadIdentity();
 
 	glh::matrix4f proj_mat;
 
@@ -385,14 +385,14 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 
 	proj_mat *= gl_perspective(fov_y,aspect,z_near,z_far);
 
-	glLoadMatrixf(proj_mat.m);
+	gGL.loadMatrix(proj_mat.m);
 
 	for (U32 i = 0; i < 16; i++)
 	{
 		gGLProjection[i] = proj_mat.m[i];
 	}
 
-	glMatrixMode( GL_MODELVIEW );
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	glh::matrix4f modelview((GLfloat*) OGL_TO_CFR_ROTATION);
 
@@ -402,7 +402,7 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 
 	modelview *= glh::matrix4f(ogl_matrix);
 	
-	glLoadMatrixf(modelview.m);
+	gGL.loadMatrix(modelview.m);
 	
 	if (for_selection && (width > 1 || height > 1))
 	{
@@ -431,10 +431,10 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 
 	/*if (gSavedSettings.getBOOL("CameraOffset"))
 	{
-		glMatrixMode(GL_PROJECTION);
-		glTranslatef(0,0,-50);
-		glRotatef(20.0,1,0,0);
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
+		gGL.translatef(0,0,-50);
+		gGL.rotatef(20.0,1,0,0);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 	}*/
 }
 
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index c8fe6f89974..5f4156732ed 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -701,10 +701,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 				glh_set_current_projection(proj);
 				glh_set_current_modelview(mod);
-				glMatrixMode(GL_PROJECTION);
-				glLoadMatrixf(proj.m);
-				glMatrixMode(GL_MODELVIEW);
-				glLoadMatrixf(mod.m);
+				gGL.matrixMode(LLRender::MM_PROJECTION);
+				gGL.loadMatrix(proj.m);
+				gGL.matrixMode(LLRender::MM_MODELVIEW);
+				gGL.loadMatrix(mod.m);
 				gViewerWindow->setup3DViewport();
 
 				LLGLState::checkStates();
@@ -813,13 +813,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//// assumes frontmost floater with focus is opaque
 		//if (frontmost_floaterp && gFocusMgr.childHasKeyboardFocus(frontmost_floaterp))
 		//{
-		//	glMatrixMode(GL_MODELVIEW);
-		//	glPushMatrix();
+		//	gGL.matrixMode(LLRender::MM_MODELVIEW);
+		//	gGL.pushMatrix();
 		//	{
 		//		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
 		//		glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
-		//		glLoadIdentity();
+		//		gGL.loadIdentity();
 
 		//		LLRect floater_rect = frontmost_floaterp->calcScreenRect();
 		//		// deflate by one pixel so rounding errors don't occlude outside of floater extents
@@ -829,8 +829,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//								(F32)floater_rect.mRight / (F32)gViewerWindow->getWindowWidthScaled(),
 		//								(F32)floater_rect.mBottom / (F32)gViewerWindow->getWindowHeightScaled());
 		//		floater_3d_rect.translate(-0.5f, -0.5f);
-		//		glTranslatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear());
-		//		glScalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f);
+		//		gGL.translatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear());
+		//		gGL.scalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f);
 		//		gGL.color4fv(LLColor4::white.mV);
 		//		gGL.begin(LLVertexBuffer::QUADS);
 		//		{
@@ -842,7 +842,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//		gGL.end();
 		//		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 		//	}
-		//	glPopMatrix();
+		//	gGL.popMatrix();
 		//}
 
 		LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
@@ -979,10 +979,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 void render_hud_attachments()
 {
 	LLMemType mt_ra(LLMemType::MTYPE_DISPLAY_RENDER_ATTACHMENTS);
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 		
 	glh::matrix4f current_proj = glh_get_current_projection();
 	glh::matrix4f current_mod = glh_get_current_modelview();
@@ -1068,10 +1068,10 @@ void render_hud_attachments()
 		}
 		LLPipeline::sUseOcclusion = use_occlusion;
 	}
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 	
 	glh_set_current_projection(current_proj);
 	glh_set_current_modelview(current_mod);
@@ -1154,12 +1154,12 @@ BOOL setup_hud_matrices(const LLRect& screen_region)
 	if (!result) return result;
 	
 	// set up transform to keep HUD objects in front of camera
-	glMatrixMode(GL_PROJECTION);
-	glLoadMatrixf(proj.m);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.loadMatrix(proj.m);
 	glh_set_current_projection(proj);
 	
-	glMatrixMode(GL_MODELVIEW);
-	glLoadMatrixf(model.m);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.loadMatrix(model.m);
 	glh_set_current_modelview(model);
 	return TRUE;
 }
@@ -1175,8 +1175,8 @@ void render_ui(F32 zoom_factor, int subfield)
 
 	if (!gSnapshot)
 	{
-		glPushMatrix();
-		glLoadMatrixd(gGLLastModelView);
+		gGL.pushMatrix();
+		gGL.loadMatrix(gGLLastModelView);
 		glh_set_current_modelview(glh_copy_matrix(gGLLastModelView));
 	}
 	
@@ -1232,7 +1232,7 @@ void render_ui(F32 zoom_factor, int subfield)
 	if (!gSnapshot)
 	{
 		glh_set_current_modelview(saved_view);
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 
 	if (gDisplaySwapBuffers)
@@ -1305,10 +1305,10 @@ void draw_axes()
 		gGL.vertex3f(0.0f, 0.0f, 40.0f);
 	gGL.end();
 	// Some coordinate axes
-	glPushMatrix();
-		glTranslatef( v.mV[VX], v.mV[VY], v.mV[VZ] );
+	gGL.pushMatrix();
+		gGL.translatef( v.mV[VX], v.mV[VY], v.mV[VZ] );
 		renderCoordinateAxes();
-	glPopMatrix();
+	gGL.popMatrix();
 }
 
 void render_ui_3d()
@@ -1378,10 +1378,10 @@ void render_ui_2d()
 		gGL.pushMatrix();
 		S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2);
 		S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2);
-		glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f);
-		glTranslatef((F32)half_width, (F32)half_height, 0.f);
+		gGL.scalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f);
+		gGL.translatef((F32)half_width, (F32)half_height, 0.f);
 		F32 zoom = gAgentCamera.mHUDCurZoom;
-		glScalef(zoom,zoom,1.f);
+		gGL.scalef(zoom,zoom,1.f);
 		gGL.color4fv(LLColor4::white.mV);
 		gl_rect_2d(-half_width, half_height, half_width, -half_height, FALSE);
 		gGL.popMatrix();
@@ -1518,20 +1518,20 @@ void render_disconnected_background()
 	{
 		LLGLSUIDefault gls_ui;
 		gViewerWindow->setup2DRender();
-		glPushMatrix();
+		gGL.pushMatrix();
 		{
 			// scale ui to reflect UIScaleFactor
 			// this can't be done in setup2DRender because it requires a
 			// pushMatrix/popMatrix pair
 			const LLVector2& display_scale = gViewerWindow->getDisplayScale();
-			glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f);
+			gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f);
 
 			gGL.getTexUnit(0)->bind(gDisconnectedImagep);
 			gGL.color4f(1.f, 1.f, 1.f, 1.f);
 			gl_rect_2d_simple_tex(width, height);
 			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		}
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 	gGL.flush();
 
diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp
index baf85d68848..f2e49ff2701 100644
--- a/indra/newview/llviewerjoint.cpp
+++ b/indra/newview/llviewerjoint.cpp
@@ -126,7 +126,7 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive )
 // 	//----------------------------------------------------------------
 // 	// push matrix stack
 // 	//----------------------------------------------------------------
-// 	glPushMatrix();
+// 	gGL.pushMatrix();
 
 // 	//----------------------------------------------------------------
 // 	// render the bone to my parent
@@ -140,8 +140,8 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive )
 // 	// offset to joint position and 
 // 	// rotate to our orientation
 // 	//----------------------------------------------------------------
-// 	glLoadIdentity();
-// 	glMultMatrixf( &getWorldMatrix().mMatrix[0][0] );
+// 	gGL.loadIdentity();
+// 	gGL.multMatrix( &getWorldMatrix().mMatrix[0][0] );
 
 // 	//----------------------------------------------------------------
 // 	// render joint axes
@@ -233,7 +233,7 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive )
 // 	//----------------------------------------------------------------
 // 	// pop matrix stack
 // 	//----------------------------------------------------------------
-// 	glPopMatrix();
+// 	gGL.popMatrix();
 // }
 
 
@@ -346,7 +346,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
 // 	F32 boneSize = 0.02f;
 
 // 	// rotate to point to child (bone direction)
-// 	glPushMatrix();
+// 	gGL.pushMatrix();
 
 // 	LLVector3 boneX = getPosition();
 // 	F32 length = boneX.normVec();
@@ -362,7 +362,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
 // 	rotateMat.setFwdRow( boneX );
 // 	rotateMat.setLeftRow( boneY );
 // 	rotateMat.setUpRow( boneZ );
-// 	glMultMatrixf( &rotateMat.mMatrix[0][0] );
+// 	gGL.multMatrix( &rotateMat.mMatrix[0][0] );
 
 // 	// render the bone
 // 	gGL.color3f( 0.5f, 0.5f, 0.0f );
@@ -388,7 +388,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
 // 	gGL.end();
 
 // 	// restore matrix
-// 	glPopMatrix();
+// 	gGL.popMatrix();
 // }
 
 //--------------------------------------------------------------------
@@ -541,7 +541,7 @@ void LLViewerJointCollisionVolume::renderCollision()
 	updateWorldMatrix();
 	
 	gGL.pushMatrix();
-	glMultMatrixf( &mXform.getWorldMatrix().mMatrix[0][0] );
+	gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] );
 
 	gGL.color3f( 0.f, 0.f, 1.f );
 	
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 2d08a279237..20ee4759393 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -616,12 +616,12 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 	}
 	else
 	{
-		glPushMatrix();
+		gGL.pushMatrix();
 		LLMatrix4 jointToWorld = getWorldMatrix();
-		glMultMatrixf((GLfloat*)jointToWorld.mMatrix);
+		gGL.multMatrix((GLfloat*)jointToWorld.mMatrix);
 		buff->setBuffer(mask);
 		buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);
-		glPopMatrix();
+		gGL.popMatrix();
 	}
 	gPipeline.addTrianglesDrawn(count);
 
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index eff16b6a6e4..6482336f374 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -825,14 +825,14 @@ S32 LLViewerParcelOverlay::renderPropertyLines	()
 	// Always fudge a little vertically.
 	pull_toward_camera.mV[VZ] += 0.01f;
 
-	glMatrixMode( GL_MODELVIEW );
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 
 	// Move to appropriate region coords
 	LLVector3 origin = mRegion->getOriginAgent();
-	glTranslatef( origin.mV[VX], origin.mV[VY], origin.mV[VZ] );
+	gGL.translatef( origin.mV[VX], origin.mV[VY], origin.mV[VZ] );
 
-	glTranslatef(pull_toward_camera.mV[VX], pull_toward_camera.mV[VY],
+	gGL.translatef(pull_toward_camera.mV[VX], pull_toward_camera.mV[VY],
 		pull_toward_camera.mV[VZ]);
 
 	// Include +1 because vertices are fenceposts.
@@ -931,7 +931,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines	()
 		
 	}
 
-	glPopMatrix();
+	gGL.popMatrix();
 
 	return drawn;
 }
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 95e17448bb3..010bcfb1257 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2275,9 +2275,9 @@ void LLViewerWindow::draw()
 
 	LLUI::setLineWidth(1.f);
 	// Reset any left-over transforms
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	
-	glLoadIdentity();
+	gGL.loadIdentity();
 
 	//S32 screen_x, screen_y;
 
@@ -2292,7 +2292,7 @@ void LLViewerWindow::draw()
 		// draw timecode block
 		std::string text;
 
-		glLoadIdentity();
+		gGL.loadIdentity();
 
 		microsecondsToTimecodeString(gFrameTime,text);
 		const LLFontGL* font = LLFontGL::getFontSansSerif();
@@ -2328,10 +2328,10 @@ void LLViewerWindow::draw()
 			int pos_y = sub_region / llceil(zoom_factor);
 			int pos_x = sub_region - (pos_y*llceil(zoom_factor));
 			// offset for this tile
-			glTranslatef((F32)getWindowWidthScaled() * -(F32)pos_x, 
+			gGL.translatef((F32)getWindowWidthScaled() * -(F32)pos_x, 
 						(F32)getWindowHeightScaled() * -(F32)pos_y, 
 						0.f);
-			glScalef(zoom_factor, zoom_factor, 1.f);
+			gGL.scalef(zoom_factor, zoom_factor, 1.f);
 			LLUI::sGLScaleFactor *= zoom_factor;
 		}
 
@@ -2360,7 +2360,7 @@ void LLViewerWindow::draw()
 			S32 screen_x, screen_y;
 			top_ctrl->localPointToScreen(0, 0, &screen_x, &screen_y);
 
-			glMatrixMode(GL_MODELVIEW);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
 			LLUI::translate( (F32) screen_x, (F32) screen_y, 0.f);
 			top_ctrl->draw();	
@@ -3424,17 +3424,17 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 			LLBBox hud_bbox = gAgentAvatarp->getHUDBBox();
 
 			// set up transform to encompass bounding box of HUD
-			glMatrixMode(GL_PROJECTION);
-			glPushMatrix();
-			glLoadIdentity();
+			gGL.matrixMode(LLRender::MM_PROJECTION);
+			gGL.pushMatrix();
+			gGL.loadIdentity();
 			F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f);
-			glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth);
+			gGL.ortho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth);
 			
-			glMatrixMode(GL_MODELVIEW);
-			glPushMatrix();
-			glLoadIdentity();
-			glLoadMatrixf(OGL_TO_CFR_ROTATION);		// Load Cory's favorite reference frame
-			glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f);
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
+			gGL.pushMatrix();
+			gGL.loadIdentity();
+			gGL.loadMatrix(OGL_TO_CFR_ROTATION);		// Load Cory's favorite reference frame
+			gGL.translatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f);
 		}
 
 		// Render light for editing
@@ -3444,12 +3444,12 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 			LLGLEnable gls_blend(GL_BLEND);
 			LLGLEnable gls_cull(GL_CULL_FACE);
 			LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
-			glMatrixMode(GL_MODELVIEW);
-			glPushMatrix();
+			gGL.matrixMode(LLRender::MM_MODELVIEW);
+			gGL.pushMatrix();
 			if (selection->getSelectType() == SELECT_TYPE_HUD)
 			{
 				F32 zoom = gAgentCamera.mHUDCurZoom;
-				glScalef(zoom, zoom, zoom);
+				gGL.scalef(zoom, zoom, zoom);
 			}
 
 			struct f : public LLSelectedObjectFunctor
@@ -3486,7 +3486,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 			} func;
 			LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func);
 			
-			glPopMatrix();
+			gGL.popMatrix();
 		}				
 		
 		// NOTE: The average position for the axis arrows of the selected objects should
@@ -3549,11 +3549,11 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 			}
 			if (selection->getSelectType() == SELECT_TYPE_HUD && selection->getObjectCount())
 			{
-				glMatrixMode(GL_PROJECTION);
-				glPopMatrix();
+				gGL.matrixMode(LLRender::MM_PROJECTION);
+				gGL.popMatrix();
 
-				glMatrixMode(GL_MODELVIEW);
-				glPopMatrix();
+				gGL.matrixMode(LLRender::MM_MODELVIEW);
+				gGL.popMatrix();
 				stop_glerror();
 			}
 		}
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 890861df71f..4cef0f5b5be 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -882,7 +882,7 @@ void LLVOTree::updateMesh()
 	
 	// Translate to tree base  HACK - adjustment in Z plants tree underground
 	const LLVector3 &pos_agent = getPositionAgent();
-	//glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
+	//gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
 	LLMatrix4 trans_mat;
 	trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
 	trans_mat *= matrix;
@@ -1158,7 +1158,8 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
 				scale_mat.mMatrix[2][2] = scale*length;
 				scale_mat *= matrix;
 
-				glLoadMatrixf((F32*) scale_mat.mMatrix);
+				gGL.loadMatrix((F32*) scale_mat.mMatrix);
+				gGL.syncMatrices();
  				glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_SHORT, indicesp + sLODIndexOffset[trunk_LOD]);
 				gPipeline.addTrianglesDrawn(LEAF_INDICES);
 				stop_glerror();
@@ -1208,7 +1209,8 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
 				scale_mat *= matrix;
 
 			
-				glLoadMatrixf((F32*) scale_mat.mMatrix);
+				gGL.loadMatrix((F32*) scale_mat.mMatrix);
+				gGL.syncMatrices();
 				glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp);
 				gPipeline.addTrianglesDrawn(LEAF_INDICES);							
 				stop_glerror();
@@ -1229,19 +1231,20 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
 
 		scale_mat *= matrix;
 	
-		glMatrixMode(GL_TEXTURE);
-		glTranslatef(0.0, -0.5, 0.0);
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_TEXTURE);
+		gGL.translatef(0.0, -0.5, 0.0);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 					
-		glLoadMatrixf((F32*) scale_mat.mMatrix);
+		gGL.loadMatrix((F32*) scale_mat.mMatrix);
+		gGL.syncMatrices();
 		glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp);
 		gPipeline.addTrianglesDrawn(LEAF_INDICES);
 		stop_glerror();
 		ret += LEAF_INDICES;
 
-		glMatrixMode(GL_TEXTURE);
-		glLoadIdentity();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_TEXTURE);
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 	}
 
 	return ret;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index 7b1c7254832..39c9945fb4f 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -518,6 +518,7 @@ void LLVOWLSky::drawDome(void)
 
 #else
 	mStripsVerts->setBuffer(data_mask);
+	gGL.syncMatrices();
 	glDrawRangeElements(
 		GL_TRIANGLES,
 		0, mStripsVerts->getNumVerts()-1, mStripsVerts->getNumIndices(),
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 265d5dc801b..3959e7c073c 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -314,7 +314,7 @@ void LLWorldMapView::draw()
 	{
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 		// Clear the background alpha to 0
 		gGL.flush();
@@ -1307,7 +1307,7 @@ void LLWorldMapView::drawTrackingCircle( const LLRect& rect, S32 x, S32 y, const
 		end_theta -= angle_adjust_y;
 	}
 
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	gGL.translatef((F32)x, (F32)y, 0.f);
 	gl_washer_segment_2d(inner_radius, outer_radius, start_theta, end_theta, 40, color, color);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index b4be863c6d4..60d504e9484 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2018,13 +2018,13 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
 		gGL.setColorMask(false, false);
 	}
 
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadMatrixd(gGLLastProjection);
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.loadMatrix(gGLLastProjection);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 	gGLLastMatrix = NULL;
-	glLoadMatrixd(gGLLastModelView);
+	gGL.loadMatrix(gGLLastModelView);
 
 
 	LLVertexBuffer::unbind();
@@ -2129,10 +2129,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
 	}
 	
 	
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 
 	if (sUseOcclusion > 1)
 	{
@@ -3450,10 +3450,10 @@ void LLPipeline::renderHighlights()
 		//gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
 
 		gGL.pushMatrix();
-		glLoadIdentity();
-		glMatrixMode(GL_PROJECTION);
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_PROJECTION);
 		gGL.pushMatrix();
-		glLoadIdentity();
+		gGL.loadIdentity();
 
 		gGL.getTexUnit(0)->bind(&mHighlight);
 
@@ -3513,7 +3513,7 @@ void LLPipeline::renderHighlights()
 		gGL.end();
 
 		gGL.popMatrix();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.popMatrix();
 		
 		//gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -3629,9 +3629,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 	LLAppViewer::instance()->pingMainloopTimeout("Pipeline:ForceVBO");
 	
 	// Initialize lots of GL state to "safe" values
-	glMatrixMode(GL_TEXTURE);
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
+	gGL.matrixMode(LLRender::MM_TEXTURE);
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	LLGLSPipeline gls_pipeline;
 	LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
@@ -3700,7 +3700,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 			{
 				occlude = FALSE;
 				gGLLastMatrix = NULL;
-				glLoadMatrixd(gGLModelView);
+				gGL.loadMatrix(gGLModelView);
 				LLGLSLShader::bindNoShader();
 				doOcclusion(camera);
 			}
@@ -3711,7 +3711,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 				LLFastTimer t(FTM_POOLRENDER);
 
 				gGLLastMatrix = NULL;
-				glLoadMatrixd(gGLModelView);
+				gGL.loadMatrix(gGLModelView);
 			
 				for( S32 i = 0; i < poolp->getNumPasses(); i++ )
 				{
@@ -3760,13 +3760,13 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 		LLVertexBuffer::unbind();
 			
 		gGLLastMatrix = NULL;
-		glLoadMatrixd(gGLModelView);
+		gGL.loadMatrix(gGLModelView);
 
 		if (occlude)
 		{
 			occlude = FALSE;
 			gGLLastMatrix = NULL;
-			glLoadMatrixd(gGLModelView);
+			gGL.loadMatrix(gGLModelView);
 			LLGLSLShader::bindNoShader();
 			doOcclusion(camera);
 		}
@@ -3886,7 +3886,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 			LLFastTimer t(FTM_POOLRENDER);
 
 			gGLLastMatrix = NULL;
-			glLoadMatrixd(gGLModelView);
+			gGL.loadMatrix(gGLModelView);
 		
 			for( S32 i = 0; i < poolp->getNumDeferredPasses(); i++ )
 			{
@@ -3934,7 +3934,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 	}
 
 	gGLLastMatrix = NULL;
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 
 	gGL.setColorMask(true, false);
 }
@@ -3967,7 +3967,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 		{
 			occlude = FALSE;
 			gGLLastMatrix = NULL;
-			glLoadMatrixd(gGLModelView);
+			gGL.loadMatrix(gGLModelView);
 			LLGLSLShader::bindNoShader();
 			doOcclusion(camera);
 			gGL.setColorMask(true, false);
@@ -3979,7 +3979,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 			LLFastTimer t(FTM_POOLRENDER);
 
 			gGLLastMatrix = NULL;
-			glLoadMatrixd(gGLModelView);
+			gGL.loadMatrix(gGLModelView);
 		
 			for( S32 i = 0; i < poolp->getNumPostDeferredPasses(); i++ )
 			{
@@ -4027,17 +4027,17 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 	}
 
 	gGLLastMatrix = NULL;
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 
 	if (occlude)
 	{
 		occlude = FALSE;
 		gGLLastMatrix = NULL;
-		glLoadMatrixd(gGLModelView);
+		gGL.loadMatrix(gGLModelView);
 		LLGLSLShader::bindNoShader();
 		doOcclusion(camera);
 		gGLLastMatrix = NULL;
-		glLoadMatrixd(gGLModelView);
+		gGL.loadMatrix(gGLModelView);
 	}
 }
 
@@ -4064,7 +4064,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera)
 			poolp->prerender() ;
 
 			gGLLastMatrix = NULL;
-			glLoadMatrixd(gGLModelView);
+			gGL.loadMatrix(gGLModelView);
 		
 			for( S32 i = 0; i < poolp->getNumShadowPasses(); i++ )
 			{
@@ -4103,7 +4103,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera)
 	}
 
 	gGLLastMatrix = NULL;
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 }
 
 
@@ -4177,10 +4177,10 @@ void LLPipeline::renderPhysicsDisplay()
 		LLSpatialBridge* bridge = *i;
 		if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
 		{
-			glPushMatrix();
-			glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
+			gGL.pushMatrix();
+			gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
 			bridge->renderPhysicsShapes();
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 	}
 
@@ -4204,7 +4204,7 @@ void LLPipeline::renderDebug()
 	gGL.color4f(1,1,1,1);
 
 	gGLLastMatrix = NULL;
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 	gGL.setColorMask(true, false);
 
 	bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
@@ -4264,10 +4264,10 @@ void LLPipeline::renderDebug()
 		LLSpatialBridge* bridge = *i;
 		if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
 		{
-			glPushMatrix();
-			glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
+			gGL.pushMatrix();
+			gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
 			bridge->renderDebug();
-			glPopMatrix();
+			gGL.popMatrix();
 		}
 	}
 
@@ -4455,7 +4455,7 @@ void LLPipeline::renderDebug()
 		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
 		
 		gGL.pushMatrix();
-		glLoadMatrixd(gGLModelView);
+		gGL.loadMatrix(gGLModelView);
 		gGLLastMatrix = NULL;
 
 		for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter)
@@ -4476,7 +4476,7 @@ void LLPipeline::renderDebug()
 			if (bridge)
 			{
 				gGL.pushMatrix();
-				glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
+				gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
 			}
 
 			F32 alpha = llclamp((F32) (size-count)/size, 0.f, 1.f);
@@ -4824,6 +4824,8 @@ void LLPipeline::setupAvatarLights(BOOL for_edit)
 {
 	assertInitialized();
 
+	gGL.syncMatrices();
+
 	if (for_edit)
 	{
 		LLColor4 diffuse(1.f, 1.f, 1.f, 0.f);
@@ -5052,6 +5054,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
 void LLPipeline::setupHWLights(LLDrawPool* pool)
 {
 	assertInitialized();
+	gGL.syncMatrices();
 
 	// Ambient
 	LLColor4 ambient = gSky.getTotalAmbientColor();
@@ -5332,6 +5335,8 @@ void LLPipeline::enableLightsPreview()
 {
 	disableLights();
 
+	gGL.syncMatrices();
+
 	glEnable(GL_LIGHTING);
 	LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor");
 	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
@@ -6096,10 +6101,10 @@ void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture)
 {
 	LLMemType mt_ro(LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS);
 	assertInitialized();
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 	gGLLastMatrix = NULL;
 	mSimplePool->pushBatches(type, mask);
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 	gGLLastMatrix = NULL;		
 }
 
@@ -6108,25 +6113,25 @@ void apply_cube_face_rotation(U32 face)
 	switch (face)
 	{
 		case 0: 
-			glRotatef(90.f, 0, 1, 0);
-			glRotatef(180.f, 1, 0, 0);
+			gGL.rotatef(90.f, 0, 1, 0);
+			gGL.rotatef(180.f, 1, 0, 0);
 		break;
 		case 2: 
-			glRotatef(-90.f, 1, 0, 0);
+			gGL.rotatef(-90.f, 1, 0, 0);
 		break;
 		case 4:
-			glRotatef(180.f, 0, 1, 0);
-			glRotatef(180.f, 0, 0, 1);
+			gGL.rotatef(180.f, 0, 1, 0);
+			gGL.rotatef(180.f, 0, 0, 1);
 		break;
 		case 1: 
-			glRotatef(-90.f, 0, 1, 0);
-			glRotatef(180.f, 1, 0, 0);
+			gGL.rotatef(-90.f, 0, 1, 0);
+			gGL.rotatef(180.f, 1, 0, 0);
 		break;
 		case 3:
-			glRotatef(90, 1, 0, 0);
+			gGL.rotatef(90, 1, 0, 0);
 		break;
 		case 5: 
-			glRotatef(180, 0, 0, 1);
+			gGL.rotatef(180, 0, 0, 1);
 		break;
 	}
 }
@@ -6204,12 +6209,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	
 	enableLightsFullbright(LLColor4(1,1,1,1));
 
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-	glLoadIdentity();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.loadIdentity();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
+	gGL.loadIdentity();
 
 	LLGLDisable test(GL_ALPHA_TEST);
 
@@ -6662,10 +6667,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	}
 	
 
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 
 	LLVertexBuffer::unbind();
 
@@ -7116,11 +7121,11 @@ void LLPipeline::renderDeferredLighting()
 			mTransformedSunDir.set(tc.v);
 		}
 
-		glPushMatrix();
-		glLoadIdentity();
-		glMatrixMode(GL_PROJECTION);
-		glPushMatrix();
-		glLoadIdentity();
+		gGL.pushMatrix();
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_PROJECTION);
+		gGL.pushMatrix();
+		gGL.loadIdentity();
 
 		if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0)
 		{
@@ -7340,11 +7345,11 @@ void LLPipeline::renderDeferredLighting()
 		}
 
 		stop_glerror();
-		glPopMatrix();
+		gGL.popMatrix();
 		stop_glerror();
-		glMatrixMode(GL_MODELVIEW);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		stop_glerror();
-		glPopMatrix();
+		gGL.popMatrix();
 		stop_glerror();
 
 		//copy depth and stencil from deferred screen
@@ -7376,19 +7381,19 @@ void LLPipeline::renderDeferredLighting()
 				LLGLDisable test(GL_ALPHA_TEST);
 
 				//full screen blit
-				glPushMatrix();
-				glLoadIdentity();
-				glMatrixMode(GL_PROJECTION);
-				glPushMatrix();
-				glLoadIdentity();
+				gGL.pushMatrix();
+				gGL.loadIdentity();
+				gGL.matrixMode(LLRender::MM_PROJECTION);
+				gGL.pushMatrix();
+				gGL.loadIdentity();
 
 				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 				
 				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 
-				glPopMatrix();
-				glMatrixMode(GL_MODELVIEW);
-				glPopMatrix();
+				gGL.popMatrix();
+				gGL.matrixMode(LLRender::MM_MODELVIEW);
+				gGL.popMatrix();
 			}
 
 			unbindDeferredShader(gDeferredSoftenProgram);
@@ -7528,6 +7533,7 @@ void LLPipeline::renderDeferredLighting()
 							gDeferredLightProgram.uniform3fv("color", 1, col.mV);
 							gDeferredLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
 							//gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
+							gGL.syncMatrices();
 							glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 								GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 							stop_glerror();
@@ -7598,6 +7604,7 @@ void LLPipeline::renderDeferredLighting()
 					gDeferredSpotLightProgram.uniform1f("size", s*s);
 					gDeferredSpotLightProgram.uniform3fv("color", 1, col.mV);
 					gDeferredSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
+					gGL.syncMatrices();
 					glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 							GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 				}
@@ -7618,11 +7625,11 @@ void LLPipeline::renderDeferredLighting()
 				LLGLDepthTest depth(GL_FALSE);
 
 				//full screen blit
-				glPushMatrix();
-				glLoadIdentity();
-				glMatrixMode(GL_PROJECTION);
-				glPushMatrix();
-				glLoadIdentity();
+				gGL.pushMatrix();
+				gGL.loadIdentity();
+				gGL.matrixMode(LLRender::MM_PROJECTION);
+				gGL.pushMatrix();
+				gGL.loadIdentity();
 
 				U32 count = 0;
 
@@ -7697,9 +7704,9 @@ void LLPipeline::renderDeferredLighting()
 				gDeferredMultiSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
 				unbindDeferredShader(gDeferredMultiSpotLightProgram);
 
-				glPopMatrix();
-				glMatrixMode(GL_MODELVIEW);
-				glPopMatrix();
+				gGL.popMatrix();
+				gGL.matrixMode(LLRender::MM_MODELVIEW);
+				gGL.popMatrix();
 			}
 		}
 
@@ -7730,17 +7737,17 @@ void LLPipeline::renderDeferredLighting()
 //				glVertexPointer(2, GL_FLOAT, 0, vert);
 				gGL.diffuseColor3f(1,1,1);
 
-				glPushMatrix();
-				glLoadIdentity();
-				glMatrixMode(GL_PROJECTION);
-				glPushMatrix();
-				glLoadIdentity();
+				gGL.pushMatrix();
+				gGL.loadIdentity();
+				gGL.matrixMode(LLRender::MM_PROJECTION);
+				gGL.pushMatrix();
+				gGL.loadIdentity();
 
 				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 				
-				glPopMatrix();
-				glMatrixMode(GL_MODELVIEW);
-				glPopMatrix();
+				gGL.popMatrix();
+				gGL.matrixMode(LLRender::MM_MODELVIEW);
+				gGL.popMatrix();
 
 				unbindDeferredShader(gDeferredPostProgram);
 			}
@@ -8078,7 +8085,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 
 			stop_glerror();
 
-			glPushMatrix();
+			gGL.pushMatrix();
 
 			mat.set_scale(glh::vec3f(1,1,-1));
 			mat.set_translate(glh::vec3f(0,0,height*2.f));
@@ -8088,7 +8095,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 			mat = current * mat;
 
 			glh_set_current_modelview(mat);
-			glLoadMatrixf(mat.m);
+			gGL.loadMatrix(mat.m);
 
 			LLViewerCamera::updateFrustumPlanes(camera, FALSE, TRUE);
 
@@ -8166,7 +8173,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 				gPipeline.popRenderTypeMask();
 			}	
 			glCullFace(GL_BACK);
-			glPopMatrix();
+			gGL.popMatrix();
 			mWaterRef.flush();
 			glh_set_current_modelview(current);
 			LLPipeline::sUseOcclusion = occlusion;
@@ -8347,12 +8354,12 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 	stateSort(shadow_cam, result);
 	
 	//generate shadow map
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadMatrixf(proj.m);
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-	glLoadMatrixd(gGLModelView);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.loadMatrix(proj.m);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
+	gGL.loadMatrix(gGLModelView);
 
 	stop_glerror();
 	gGLLastMatrix = NULL;
@@ -8417,7 +8424,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 
 	gDeferredShadowProgram.bind();
 	gGLLastMatrix = NULL;
-	glLoadMatrixd(gGLModelView);
+	gGL.loadMatrix(gGLModelView);
 	doOcclusion(shadow_cam);
 
 	if (use_shader)
@@ -8427,10 +8434,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 	
 	gGL.setColorMask(true, true);
 			
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 	gGLLastMatrix = NULL;
 
 	LLPipeline::sUseOcclusion = occlude;
@@ -8757,12 +8764,12 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<L
 	LLGLEnable cull(GL_CULL_FACE);
 
 	//generate GI map
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadMatrixf(proj.m);
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-	glLoadMatrixf(view.m);
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
+	gGL.loadMatrix(proj.m);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
+	gGL.loadMatrix(view.m);
 
 	stop_glerror();
 	gGLLastMatrix = NULL;
@@ -8776,10 +8783,10 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<L
 
 	mGIMap.flush();
 	
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 	gGLLastMatrix = NULL;
 
 	LLPipeline::sUseOcclusion = occlude;
@@ -9564,10 +9571,10 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	{
 		glh_set_current_modelview(view[1]);
 		glh_set_current_projection(proj[1]);
-		glLoadMatrixf(view[1].m);
-		glMatrixMode(GL_PROJECTION);
-		glLoadMatrixf(proj[1].m);
-		glMatrixMode(GL_MODELVIEW);
+		gGL.loadMatrix(view[1].m);
+		gGL.matrixMode(LLRender::MM_PROJECTION);
+		gGL.loadMatrix(proj[1].m);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
 	}
 	gGL.setColorMask(true, false);
 
@@ -9699,24 +9706,24 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 	tdim.mV[0] = fabsf(half_height.dot3(left).getF32());
 	tdim.mV[1] = fabsf(half_height.dot3(up).getF32());
 
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.pushMatrix();
 	
 	F32 distance = (pos-camera.getOrigin()).length();
 	F32 fov = atanf(tdim.mV[1]/distance)*2.f*RAD_TO_DEG;
 	F32 aspect = tdim.mV[0]/tdim.mV[1];
 	glh::matrix4f persp = gl_perspective(fov, aspect, 1.f, 256.f);
 	glh_set_current_projection(persp);
-	glLoadMatrixf(persp.m);
+	gGL.loadMatrix(persp.m);
 
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.pushMatrix();
 	glh::matrix4f mat;
 	camera.getOpenGLTransform(mat.m);
 
 	mat = glh::matrix4f((GLfloat*) OGL_TO_CFR_ROTATION) * mat;
 
-	glLoadMatrixf(mat.m);
+	gGL.loadMatrix(mat.m);
 	glh_set_current_modelview(mat);
 
 	glClearColor(0.0f,0.0f,0.0f,0.0f);
@@ -9784,11 +9791,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 
 		gGL.flush();
 
-		glPushMatrix();
-		glLoadIdentity();
-		glMatrixMode(GL_PROJECTION);
-		glPushMatrix();
-		glLoadIdentity();
+		gGL.pushMatrix();
+		gGL.loadIdentity();
+		gGL.matrixMode(LLRender::MM_PROJECTION);
+		gGL.pushMatrix();
+		gGL.loadIdentity();
 
 		static const F32 clip_plane = 0.99999f;
 
@@ -9811,9 +9818,9 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 			gUIProgram.unbind();
 		}
 
-		glPopMatrix();
-		glMatrixMode(GL_MODELVIEW);
-		glPopMatrix();
+		gGL.popMatrix();
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
+		gGL.popMatrix();
 	}
 
 	avatar->mImpostor.flush();
@@ -9827,10 +9834,10 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 	sShadowRender = FALSE;
 	popRenderTypeMask();
 
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gGL.matrixMode(LLRender::MM_PROJECTION);
+	gGL.popMatrix();
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+	gGL.popMatrix();
 
 	avatar->mNeedsImpostorUpdate = FALSE;
 	avatar->cacheImpostorValues();
-- 
GitLab


From 530981a2149a74e1dc003cea1bbc9dc392fcae60 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 15 Sep 2011 00:54:25 -0500
Subject: [PATCH 018/933] SH-2243 work in progress -- no more deprecated
 built-in matrix state when using shaders.

---
 indra/llrender/llglslshader.cpp               |   4 +
 indra/llrender/llglslshader.h                 |   3 +-
 indra/llrender/llrender.cpp                   | 106 +++++++++++++++---
 .../shaders/class1/avatar/avatarV.glsl        |   8 +-
 .../shaders/class1/avatar/eyeballV.glsl       |  14 ++-
 .../shaders/class1/avatar/pickAvatarV.glsl    |   6 +-
 .../class1/deferred/alphaSkinnedV.glsl        |  10 +-
 .../shaders/class1/deferred/alphaV.glsl       |  15 ++-
 .../class1/deferred/attachmentShadowV.glsl    |  10 +-
 .../shaders/class1/deferred/avatarAlphaV.glsl |   6 +-
 .../shaders/class1/deferred/avatarEyesV.glsl  |  11 +-
 .../class1/deferred/avatarShadowV.glsl        |   4 +-
 .../shaders/class1/deferred/avatarV.glsl      |   4 +-
 .../shaders/class1/deferred/blurLightV.glsl   |   6 +-
 .../shaders/class1/deferred/bumpSkinnedV.glsl |  10 +-
 .../shaders/class1/deferred/bumpV.glsl        |  14 ++-
 .../shaders/class1/deferred/cloudsV.glsl      |   6 +-
 .../class1/deferred/diffuseNoColorV.glsl      |  31 ++++-
 .../class1/deferred/diffuseSkinnedV.glsl      |  10 +-
 .../shaders/class1/deferred/diffuseV.glsl     |  11 +-
 .../shaders/class1/deferred/emissiveV.glsl    |  31 ++++-
 .../shaders/class1/deferred/fullbrightV.glsl  |  12 +-
 .../shaders/class1/deferred/giV.glsl          |   6 +-
 .../shaders/class1/deferred/impostorV.glsl    |   9 +-
 .../shaders/class1/deferred/luminanceV.glsl   |   3 +-
 .../class1/deferred/multiPointLightV.glsl     |   3 +-
 .../shaders/class1/deferred/pointLightV.glsl  |   4 +-
 .../class1/deferred/postDeferredV.glsl        |   6 +-
 .../shaders/class1/deferred/postgiV.glsl      |   4 +-
 .../class1/deferred/shadowAlphaMaskV.glsl     |   9 +-
 .../shaders/class1/deferred/shadowV.glsl      |   6 +-
 .../shaders/class1/deferred/skyV.glsl         |   6 +-
 .../shaders/class1/deferred/softenLightV.glsl |   3 +-
 .../shaders/class1/deferred/starsV.glsl       |   8 +-
 .../shaders/class1/deferred/sunLightV.glsl    |   4 +-
 .../shaders/class1/deferred/terrainV.glsl     |  12 +-
 .../shaders/class1/deferred/treeShadowV.glsl  |  27 ++++-
 .../shaders/class1/deferred/treeV.glsl        |  11 +-
 .../shaders/class1/deferred/waterV.glsl       |  10 +-
 .../shaders/class1/effects/glowExtractV.glsl  |   4 +-
 .../shaders/class1/effects/glowV.glsl         |   4 +-
 .../shaders/class1/environment/terrainV.glsl  |  24 ++--
 .../shaders/class1/environment/waterV.glsl    |   8 +-
 .../class1/interface/customalphaV.glsl        |   6 +-
 .../shaders/class1/interface/debugV.glsl      |   4 +-
 .../class1/interface/glowcombineFXAAV.glsl    |  26 ++++-
 .../class1/interface/glowcombineV.glsl        |   6 +-
 .../shaders/class1/interface/highlightV.glsl  |   9 +-
 .../shaders/class1/interface/occlusionV.glsl  |   4 +-
 .../class1/interface/onetexturenocolorV.glsl  |  21 +++-
 .../shaders/class1/interface/solidcolorV.glsl |   4 +-
 .../class1/interface/splattexturerectV.glsl   |   6 +-
 .../class1/interface/twotextureaddV.glsl      |   3 +-
 .../shaders/class1/interface/uiV.glsl         |   8 +-
 .../shaders/class1/objects/bumpV.glsl         |  11 +-
 .../class1/objects/emissiveSkinnedV.glsl      |  31 ++++-
 .../shaders/class1/objects/emissiveV.glsl     |  32 +++++-
 .../class1/objects/fullbrightNoColorV.glsl    |  30 ++++-
 .../objects/fullbrightShinySkinnedV.glsl      |  12 +-
 .../class1/objects/fullbrightShinyV.glsl      |  17 ++-
 .../class1/objects/fullbrightSkinnedV.glsl    |   9 +-
 .../shaders/class1/objects/fullbrightV.glsl   |  12 +-
 .../shaders/class1/objects/impostorV.glsl     |   8 +-
 .../shaders/class1/objects/previewV.glsl      |  33 +++++-
 .../class1/objects/shinySimpleSkinnedV.glsl   |  13 ++-
 .../shaders/class1/objects/shinyV.glsl        |  15 ++-
 .../class1/objects/simpleNoColorV.glsl        |  33 +++++-
 .../class1/objects/simpleSkinnedV.glsl        |  10 +-
 .../shaders/class1/objects/simpleV.glsl       |  15 ++-
 .../shaders/class1/objects/treeV.glsl         |  31 ++++-
 .../shaders/class2/avatar/eyeballV.glsl       |  14 ++-
 .../class2/deferred/alphaSkinnedV.glsl        |  13 ++-
 .../shaders/class2/deferred/alphaV.glsl       |  17 ++-
 .../shaders/class2/deferred/avatarAlphaV.glsl |   3 +-
 .../shaders/class2/deferred/edgeV.glsl        |   3 +-
 .../shaders/class2/deferred/softenLightV.glsl |   5 +-
 .../shaders/class2/deferred/sunLightV.glsl    |   6 +-
 .../shaders/class2/effects/blurV.glsl         |   5 +-
 .../shaders/class2/effects/drawQuadV.glsl     |   5 +-
 .../shaders/class2/environment/terrainV.glsl  |  14 ++-
 .../class2/objects/fullbrightShinyV.glsl      |  17 ++-
 .../shaders/class2/objects/fullbrightV.glsl   |  11 +-
 .../shaders/class2/objects/shinyV.glsl        |  17 ++-
 .../class2/objects/simpleNonIndexedV.glsl     |  31 ++++-
 .../shaders/class2/objects/simpleV.glsl       |  13 ++-
 .../shaders/class2/windlight/cloudsV.glsl     |   6 +-
 .../shaders/class2/windlight/skyV.glsl        |   3 +-
 .../shaders/class3/avatar/avatarV.glsl        |   6 +-
 .../class3/deferred/giDownsampleV.glsl        |   6 +-
 .../shaders/class3/deferred/giFinalV.glsl     |   6 +-
 .../shaders/class3/deferred/giV.glsl          |   6 +-
 .../shaders/class3/deferred/luminanceV.glsl   |   6 +-
 .../class3/deferred/postDeferredV.glsl        |   6 +-
 .../shaders/class3/deferred/postgiV.glsl      |   6 +-
 .../shaders/class3/deferred/softenLightV.glsl |   5 +-
 indra/newview/llviewershadermgr.cpp           |   2 +-
 96 files changed, 847 insertions(+), 297 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 61648e527da..95ce2271710 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -76,6 +76,10 @@ hasAlphaMask(false)
 LLGLSLShader::LLGLSLShader()
 	: mProgramObject(0), mActiveTextureChannels(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE)
 {
+	for (U32 i = 0; i < LLRender::NUM_MATRIX_MODES; ++i)
+	{
+		mMatHash[i] = 0xFFFFFFFF;
+	}
 }
 
 void LLGLSLShader::unload()
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 558ea66b50f..c1765e2701a 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -117,7 +117,6 @@ class LLGLSLShader
 	GLint getAttribLocation(U32 attrib);
 	GLint mapUniformTextureChannel(GLint location, GLenum type);
 	
-
 	//enable/disable texture channel for specified uniform
 	//if given texture uniform is active in the shader, 
 	//the corresponding channel will be active upon return
@@ -132,6 +131,8 @@ class LLGLSLShader
 	// Unbinds any previously bound shader by explicitly binding no shader.
 	static void bindNoShader(void);
 
+	U32 mMatHash[LLRender::NUM_MATRIX_MODES];
+
 	GLhandleARB mProgramObject;
 	std::vector<GLint> mAttribute; //lookup table of attribute enum to attribute channel
 	std::vector<GLint> mUniform;   //lookup table of uniform enum to uniform location
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 27d25c0d3a6..359e6fd5609 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1018,6 +1018,8 @@ void LLRender::refreshState(void)
 
 void LLRender::syncMatrices()
 {
+	stop_glerror();
+
 	GLenum mode[] = 
 	{
 		GL_MODELVIEW,
@@ -1028,27 +1030,105 @@ void LLRender::syncMatrices()
 		GL_TEXTURE,
 	};
 
-	for (U32 i = 0; i < 2; ++i)
+	std::string name[] = 
+	{
+		"modelview_matrix",
+		"projection_matrix",
+		"texture_matrix0",
+		"texture_matrix1",
+		"texture_matrix2",
+		"texture_matrix3",
+	};
+
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (shader)
 	{
-		if (mMatHash[i] != mCurMatHash[i])
+		
+		llassert(shader);
+
+		bool do_normal = false;
+		bool do_mvp = false;
+
+		for (U32 i = 0; i < NUM_MATRIX_MODES; ++i)
 		{
-			glMatrixMode(mode[i]);
-			glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
-			mCurMatHash[i] = mMatHash[i];
+			if (mMatHash[i] != shader->mMatHash[i])
+			{
+				shader->uniformMatrix4fv(name[i], 1, GL_FALSE, mMatrix[i][mMatIdx[i]].m);
+				shader->mMatHash[i] = mMatHash[i];
+
+				if (i == MM_MODELVIEW)
+				{
+					do_normal = true;
+					do_mvp = true;
+				}
+				else if (i == MM_PROJECTION)
+				{
+					do_mvp = true;
+				}
+			}
 		}
-	}
 
-	for (U32 i = 2; i < NUM_MATRIX_MODES; ++i)
+		if (do_normal)
+		{
+			S32 loc = shader->getUniformLocation("normal_matrix");
+			if (loc > -1)
+			{
+				U32 i = MM_MODELVIEW;
+
+				glh::matrix4f norm = mMatrix[i][mMatIdx[i]].inverse().transpose();
+
+				F32 norm_mat[] = 
+				{
+					norm.m[0], norm.m[1], norm.m[2],
+					norm.m[4], norm.m[5], norm.m[6],
+					norm.m[8], norm.m[9], norm.m[10] 
+				};
+
+				shader->uniformMatrix3fv("normal_matrix", 1, GL_FALSE, norm_mat);
+			}
+		}
+
+		if (do_mvp)
+		{
+			S32 loc = shader->getUniformLocation("modelview_projection_matrix");
+			if (loc > -1)
+			{
+				U32 mv = MM_MODELVIEW;
+				U32 proj = MM_PROJECTION;
+
+				glh::matrix4f mvp = mMatrix[mv][mMatIdx[mv]];
+				mvp.mult_left(mMatrix[proj][mMatIdx[proj]]);
+				
+				shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, mvp.m);
+			}
+		}
+	}
+	else
 	{
-		if (mMatHash[i] != mCurMatHash[i])
+		for (U32 i = 0; i < 2; ++i)
 		{
-			gGL.getTexUnit(i-2)->activate();
-			glMatrixMode(mode[i]);
-			glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
-			mCurMatHash[i] = mMatHash[i];
+			if (mMatHash[i] != mCurMatHash[i])
+			{
+				glMatrixMode(mode[i]);
+				glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
+				mCurMatHash[i] = mMatHash[i];
+			}
+		}
+
+		for (U32 i = 2; i < NUM_MATRIX_MODES; ++i)
+		{
+			if (mMatHash[i] != mCurMatHash[i])
+			{
+				gGL.getTexUnit(i-2)->activate();
+				glMatrixMode(mode[i]);
+				glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
+				mCurMatHash[i] = mMatHash[i];
+			}
 		}
 	}
-	
+
+	stop_glerror();
 }
 
 void LLRender::translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z)
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index ec1a8137907..c98b99b15ac 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
@@ -51,9 +53,7 @@ void main()
 	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
-	gl_Position = gl_ProjectionMatrix * pos;
-	
-	//gl_Position = gl_ModelViewProjectionMatrix * position;
+	gl_Position = projection_matrix * pos;
 	
 	gl_FogFragCoord = length(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
index 31db10ae855..9a19fb928bd 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -35,12 +39,12 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	vec3 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)).xyz;
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz;
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 		
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
index f07e5c124b1..21a9e91bf51 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -41,5 +43,5 @@ void main()
 			
 	gl_FrontColor = diffuse_color;
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_Position = gl_ProjectionMatrix * pos;
+	gl_Position = projection_matrix * pos;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 2c2b58d59b3..9deb9a701e6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -21,7 +21,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 projection_matrix;
+uniform mat4 modelview_matrix;
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -86,14 +88,14 @@ void main()
 	vec3 norm;
 	
 	mat4 trans = getObjectSkinnedTransform();
-	trans = gl_ModelViewMatrix * trans;
+	trans = modelview_matrix * trans;
 	
 	pos = trans * vec4(position.xyz, 1.0);
 	
 	norm = position.xyz + normal.xyz;
-	norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
+	norm = normalize(( trans*vec4(norojrm, 1.0) ).xyz-pos.xyz);
 	
-	vec4 frag_pos = gl_ProjectionMatrix * pos;
+	vec4 frag_pos = projection_matrix * pos;
 	gl_Position = frag_pos;
 	
 	vary_position = pos.xyz;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 7a2f34ca1df..51e7c0780de 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -23,6 +23,11 @@
  * $/LicenseInfo$
  */
 
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec4 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -85,12 +90,12 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
 	vary_texture_index = position.w;
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 	
 	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
 	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
@@ -126,7 +131,7 @@ void main()
 
 	gl_FogFragCoord = pos.z;
 	
-	pos = gl_ModelViewProjectionMatrix * vert;
+	pos = modelview_projection_matrix * vert;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
 	
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index e03615eebbd..fc055e555d2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -22,6 +22,10 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 projection_matrix;
+uniform mat4 modelview_matrix;
+uniform mat4 texture_matrix0;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -31,16 +35,16 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	gl_FrontColor = diffuse_color;
 	
-	vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0);
+	vec4 p = projection_matrix * vec4(pos, 1.0);
 	p.z = max(p.z, -p.w+0.01);
 	gl_Position = p;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index e15727f6f7b..df4de4f4329 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
@@ -96,7 +98,7 @@ void main()
 	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
-	vec4 frag_pos = gl_ProjectionMatrix * pos;
+	vec4 frag_pos = projection_matrix * pos;
 	gl_Position = frag_pos;
 	
 	vary_position = pos.xyz;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index 58efa475671..d5c20a22d93 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -34,10 +37,10 @@ varying vec3 vary_normal;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
-	vary_normal = normalize(gl_NormalMatrix * normal);
+	vary_normal = normalize(normal_matrix * normal);
 
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index 543e998def7..6835b9c0214 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-
+uniform mat4 projection_matrix;
 
 mat4 getSkinnedTransform();
 
@@ -52,7 +52,7 @@ void main()
 	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 	
-	pos = gl_ProjectionMatrix * pos;
+	pos = projection_matrix * pos;
 	post_pos = pos;
 
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 66e9119e28e..704845d310a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -23,6 +23,8 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
@@ -54,7 +56,7 @@ void main()
 	
 	vary_normal = norm;
 	
-	gl_Position = gl_ProjectionMatrix * pos;
+	gl_Position = projection_matrix * pos;
 }
 
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 0168c40ae53..5339e380181 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
@@ -31,7 +33,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
index 421299d4a78..cf93430217e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -22,6 +22,10 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec3 normal;
@@ -36,11 +40,11 @@ mat4 getObjectSkinnedTransform();
 
 void main()
 {
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
@@ -53,6 +57,6 @@ void main()
 	vary_mat1 = vec3(t.y, b.y, n.y);
 	vary_mat2 = vec3(t.z, b.z, n.z);
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index b724def93de..9ec31383acf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec3 normal;
@@ -36,11 +40,11 @@ varying vec3 vary_mat2;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
-	vec3 n = normalize(gl_NormalMatrix * normal);
-	vec3 b = normalize(gl_NormalMatrix * binormal);
+	vec3 n = normalize(normal_matrix * normal);
+	vec3 b = normalize(normal_matrix * binormal);
 	vec3 t = cross(b, n);
 	
 	vary_mat0 = vec3(t.x, b.x, n.x);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 297b3904a60..67b5e7fb837 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 
@@ -60,7 +62,7 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
index ff9578e2533..37864578ecd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -1,10 +1,31 @@
 /** 
  * @file diffuseNoColorV.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix; 
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -16,8 +37,8 @@ varying float vary_texture_index;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
-	vary_normal = normalize(gl_NormalMatrix * normal);
+	vary_normal = normalize(normal_matrix * normal);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index 02fb34af326..880a7ea0a29 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -22,7 +22,9 @@
  * $/LicenseInfo$
  */
 
-
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -35,11 +37,11 @@ mat4 getObjectSkinnedTransform();
 
 void main()
 {
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	vec4 norm = vec4(position.xyz, 1.0);
@@ -51,5 +53,5 @@ void main()
 			
 	gl_FrontColor = diffuse_color;
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index 553cfff52f2..e158df13f70 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec4 position;
 attribute vec4 diffuse_color;
@@ -35,11 +38,11 @@ varying float vary_texture_index;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	vary_texture_index = position.w;
-	vary_normal = normalize(gl_NormalMatrix * normal);
+	vary_normal = normalize(normal_matrix * normal);
 
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index 9841943fe69..fccf8554d21 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -1,10 +1,31 @@
 /** 
  * @file emissiveV.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec4 position;
 attribute float emissive;
@@ -23,12 +44,12 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
-	vec4 pos = (gl_ModelViewMatrix * vert);
+	vec4 pos = (modelview_matrix * vert);
 	vary_texture_index = position.w;
 
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	calcAtmospherics(pos.xyz);
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 93571058dce..27591654719 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 
 attribute vec4 position;
 attribute vec4 diffuse_color;
@@ -41,12 +45,12 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
-	vec4 pos = (gl_ModelViewMatrix * vert);
+	vec4 pos = (modelview_matrix * vert);
 	vary_texture_index = position.w;
 
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	calcAtmospherics(pos.xyz);
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
index 1a23be349ee..2766691bd02 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -35,7 +37,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 28ba2c432da..645b0d793a7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -30,8 +33,8 @@ attribute vec2 texcoord0;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
index 3f2e07cf087..dafc55a6ff5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 modelview_projection_matrix;
  
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -34,7 +35,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos;
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 39e60b6cc8d..1d54d7bede0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 
@@ -31,7 +32,7 @@ varying vec4 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	vary_fragcoord = pos;
 
 	gl_Position = pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index afaf58020bc..cab98175834 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -23,6 +23,8 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec4 vary_fragcoord;
@@ -30,7 +32,7 @@ varying vec4 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	vary_fragcoord = pos;
 		
 	gl_Position = pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index 74a9df64e0b..b11f26fbae3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
@@ -35,7 +37,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos;	
 	vary_tc = (pos.xy*0.5+0.5)*tc_scale;
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
index a3751be1fbf..61c63936482 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
@@ -22,6 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+uniform mat4 modelview_projection_matrix;
  
 attribute vec3 position;
 
@@ -32,7 +34,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index bbd7516337a..f7bed00214d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -32,12 +35,12 @@ varying vec4 post_pos;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
 	post_pos = pos;
 	
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
index 1ac3dbd5dea..190cac9e2ce 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec4 post_pos;
@@ -30,7 +32,7 @@ varying vec4 post_pos;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
 	post_pos = pos;
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 23171fe940b..e97d3e08287 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 
@@ -58,7 +60,7 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
 	// Get relative position
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
index 4b6b3c242ea..7d1e99b4aaf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 
@@ -32,7 +33,7 @@ varying vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 		
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index dbd2b5595a3..1fcb05ef2c8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -31,7 +33,7 @@ attribute vec2 texcoord0;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
index d19e67b67de..10751304ae2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -22,6 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+uniform mat4 modelview_projection_matrix;
  
 attribute vec3 position;
 
@@ -32,7 +34,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index 793106f2cf2..7f84ef1cff3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -48,12 +52,12 @@ vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 			
-	vary_normal = normalize(gl_NormalMatrix * normal);
+	vary_normal = normalize(normal_matrix * normal);
 	
 	// Transform and pass tex coords
- 	gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ 	gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
 	
 	vec4 t = vec4(texcoord1,0,1);
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
index 42ce2f52267..c695d374ac9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
@@ -1,9 +1,30 @@
 /** 
  * @file treeShadowV.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
  
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -13,11 +34,11 @@ varying vec4 post_pos;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
 	post_pos = pos;
 	
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index 2ec73980242..45bfc0ce09c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+uniform mat3 normal_matrix;
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -33,10 +36,10 @@ varying vec3 vary_normal;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
-	vary_normal = normalize(gl_NormalMatrix * normal);
+	vary_normal = normalize(normal_matrix * normal);
 
 	gl_FrontColor = vec4(1,1,1,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
index 2f808b25db2..ac51cb1741b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 
@@ -50,7 +52,7 @@ void main()
 {
 	//transform vertex
 	vec4 pos = vec4(position.xyz, 1.0);
-	mat4 modelViewProj = gl_ModelViewProjectionMatrix;
+	mat4 modelViewProj = modelview_projection_matrix;
 	
 	vec4 oPosition;
 		    
@@ -69,7 +71,7 @@ void main()
 		
 	oPosition = vec4(position, 1.0);
 	oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
-	vary_position = gl_ModelViewMatrix * oPosition;
+	vary_position = modelview_matrix * oPosition;
 	oPosition = modelViewProj * oPosition;
 	
 	refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
@@ -81,7 +83,7 @@ void main()
 	//push position for further horizon effect.
 	pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
 	pos.w = 1.0;
-	pos = gl_ModelViewMatrix*pos;
+	pos = modelview_matrix*pos;
 	
 	calcAtmospherics(pos.xyz);
 		
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index b5f6cb62d93..628489296fa 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -23,13 +23,15 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 
 
 void main() 
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position, 1.0);
 	
 	gl_TexCoord[0].xy = texcoord0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index e8fd7a796d4..615ca6a0b4d 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -23,6 +23,8 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 
@@ -30,7 +32,7 @@ uniform vec2 glowDelta;
 
 void main() 
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position, 1.0);
 	
 	gl_TexCoord[0].xy = texcoord0 + glowDelta*(-3.5);
 	gl_TexCoord[1].xy = texcoord0 + glowDelta*(-2.5);
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index 8facc1ca963..04b3033dd83 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -22,7 +22,15 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 texture_matrix2;
+uniform mat4 texture_matrix3;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -51,17 +59,17 @@ vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 			
-	vec4 pos = gl_ModelViewMatrix * position;
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec4 pos = modelview_matrix * position;
+	vec3 norm = normalize(normal_matrix * normal);
 	
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color);
 	
 	gl_FrontColor = color;
 	
-	gl_TexCoord[0] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),gl_TextureMatrix[0],gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(texcoord1,0,1);
-	gl_TexCoord[2] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),gl_TextureMatrix[2],gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
-	gl_TexCoord[3] = gl_TextureMatrix[3]*vec4(texcoord3,0,1);
+	gl_TexCoord[0] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
+	gl_TexCoord[1] = texture_matrix1*vec4(texcoord1,0,1);
+	gl_TexCoord[2] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
+	gl_TexCoord[3] = texture_matrix3*vec4(texcoord3,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index 831a7de0ea1..99433ada7bd 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 
@@ -46,7 +48,7 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
 void main()
 {
 	//transform vertex
-	mat4 modelViewProj = gl_ModelViewProjectionMatrix;
+	mat4 modelViewProj = modelview_projection_matrix;
 	
 	vec4 oPosition;
 		    
@@ -77,7 +79,7 @@ void main()
 	vec4 pos;
 	pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
 	pos.w = 1.0;
-	pos = gl_ModelViewMatrix*pos;
+	pos = modelview_matrix*pos;
 	
 	calcAtmospherics(pos.xyz);
 	
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
index df67f76ad5e..5bbc7deff03 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -30,7 +32,7 @@ attribute vec2 texcoord0;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
index 2f64fdb7bc6..cd3d090e52a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
index f54876135e9..bd5dd6046b0 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
@@ -1,17 +1,37 @@
 /** 
  * @file glowcombineFXAAV.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_tc;
 
 void main()
 {
-	vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	gl_Position = pos;
 
 	vary_tc = pos.xy*0.5+0.5;
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
index 303535ee310..94edbe5ab14 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
@@ -22,14 +22,16 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 attribute vec2 texcoord1;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_TexCoord[1] = vec4(texcoord1,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
index 1d312313a84..6bb5affd931 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
@@ -22,14 +22,17 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
index 62fe4a2ce5b..43dcd5dbe26 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
index 7df45e90e60..615412c7a2e 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
@@ -2,9 +2,28 @@
  * @file onetexturenocolorV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -12,7 +31,7 @@ attribute vec2 texcoord0;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1);
+	gl_Position = modelview_projection_matrix * vec4(position, 1);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
index be03d19290a..45e6a9febce 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
@@ -22,6 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+uniform mat4 modelview_projection_matrix;
  
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -29,7 +31,7 @@ attribute vec2 texcoord0;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_FrontColor = diffuse_color;
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
index 085970f549e..2b471d99e82 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
@@ -22,14 +22,16 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 attribute vec4 diffuse_color;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_FrontColor = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
index 80c57e77661..2a36feaa211 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -30,7 +31,7 @@ attribute vec2 texcoord1;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_TexCoord[1] = vec4(texcoord1,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
index faef21689e9..a9e42a432f0 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -31,8 +33,8 @@ attribute vec2 texcoord0;
 
 void main()
 {
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1);
-	gl_TexCoord[0] =  gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position, 1);
+	gl_TexCoord[0] =  texture_matrix0 * vec4(texcoord0,0,1);
 	gl_FrontColor = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index 7d38e07d65b..dccc6925930 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -31,7 +34,7 @@ attribute vec2 texcoord1;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = gl_TextureMatrix[1] * vec4(texcoord1,0,1);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = texture_matrix1 * vec4(texcoord1,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
index 78668711ac2..e2a00e84407 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -1,10 +1,31 @@
 /** 
  * @file emissiveSkinnedV.glsl
  *
- * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
- * $License$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
  */
 
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
 
 attribute vec3 position;
 attribute float emissive;
@@ -16,18 +37,18 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	calcAtmospherics(pos.xyz);
 
 	gl_FrontColor = vec4(0,0,0,emissive);
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
index 05d7cc397fd..dedf00f3743 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -1,10 +1,32 @@
 /**
  * @file emissiveV.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec4 position;
 attribute float emissive;
 attribute vec2 texcoord0;
@@ -17,10 +39,10 @@ void main()
 {
 	//transform vertex
 	vary_texture_index = position.w;
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
 	gl_FrontColor = vec4(0,0,0,emissive);
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
index 57d98038e09..b9c1078c309 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
@@ -2,9 +2,31 @@
  * @file fullbrightNoColorV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
-  
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 attribute vec3 normal;
@@ -15,9 +37,9 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index ebbcb2f719d..546b7cad4af 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -22,6 +22,10 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 modelview_matrix;
+uniform mat4 projection_matrix;
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -35,7 +39,7 @@ void main()
 {
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	vec4 norm = vec4(position.xyz, 1.0);
@@ -45,14 +49,14 @@ void main()
 		
 	vec3 ref = reflect(pos.xyz, -norm.xyz);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
 	gl_FrontColor = diffuse_color;
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 	
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index e8126daee04..a9b086e215e 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -22,7 +22,12 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -36,15 +41,15 @@ uniform vec4 origin;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
 
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
 	gl_FrontColor = diffuse_color;
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index 276f423eea9..f0722a1e4d8 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -22,6 +22,9 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -33,18 +36,18 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	calcAtmospherics(pos.xyz);
 
 	gl_FrontColor = diffuse_color;
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index 159e34f0448..d8f223d403f 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -32,9 +36,9 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
index f175e3e76d8..69007610c6e 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
 
 
 attribute vec3 position;
@@ -31,6 +33,6 @@ attribute vec2 texcoord0;
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
index 555c59c37ec..3771c2e795d 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -2,9 +2,32 @@
  * @file previewV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
@@ -15,11 +38,11 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 		
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
index f0bea5f3e7d..7e5c8ca2d59 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
@@ -22,6 +22,11 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 modelview_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -35,7 +40,7 @@ void main()
 {
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	vec4 norm = vec4(position.xyz, 1.0);
@@ -45,13 +50,13 @@ void main()
 		
 	vec3 ref = reflect(pos.xyz, -norm.xyz);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
 	gl_FrontColor = color;
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index e8b6b71b3d5..da47f8a58aa 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -22,7 +22,12 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -35,10 +40,10 @@ uniform vec4 origin;
 void main()
 {
 	//transform vertex
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 	
@@ -46,7 +51,7 @@ void main()
 	
 	vec3 ref = reflect(pos.xyz, -norm);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0]*vec4(ref,1.0);
+	gl_TexCoord[0] = texture_matrix0*vec4(ref,1.0);
 	
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index 54c262885e5..d1d8126cb46 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -2,9 +2,32 @@
  * @file simpleNoColorV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
@@ -15,11 +38,11 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 		
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index 14c4a3aa8d9..bf083a55c47 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -22,6 +22,10 @@
  * $/LicenseInfo$
  */
 
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -34,11 +38,11 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
 	vec4 norm = vec4(position.xyz, 1.0);
@@ -51,7 +55,7 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
 	gl_FrontColor = color;
 	
-	gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+	gl_Position = projection_matrix*vec4(pos, 1.0);
 	
 	gl_FogFragCoord = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index bbc170b1af4..87ece3972ee 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -22,7 +22,12 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -34,11 +39,11 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 		
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
index 1e9e7f4b0b3..64ca63731b1 100644
--- a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
@@ -2,10 +2,31 @@
  * @file treeV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -19,12 +40,12 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	
-	gl_Position = gl_ModelViewProjectionMatrix*vert;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	gl_Position = modelview_projection_matrix*vert;
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
 	
-	vec4 pos = (gl_ModelViewMatrix * vert);
+	vec4 pos = (modelview_matrix * vert);
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
index c0065f0bbe8..43e19909d4e 100644
--- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec4 diffuse_color;
@@ -35,11 +39,11 @@ void calcAtmospherics(vec3 inPositionEye);
 void main()
 {
 	//transform vertex
-	vec3 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)).xyz;
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz;
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 		
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index 501fcb004b1..df4d26997ac 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -21,6 +21,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
  
 attribute vec3 position;
 attribute vec3 normal;
@@ -79,15 +84,15 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
-	mat = gl_ModelViewMatrix * mat;
+	mat = modelview_matrix * mat;
 	
 	vec3 pos = (mat*vec4(position, 1.0)).xyz;
 	
-	gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0);
+	gl_Position = projection_matrix * vec4(pos, 1.0);
 	
 	vec4 n = vec4(position, 1.0);
 	n.xyz += normal.xyz;
@@ -128,7 +133,7 @@ void main()
 
 	gl_FogFragCoord = pos.z;
 	
-	pos.xyz = (gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0)).xyz;
+	pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
 	
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index b0ae0107fb2..996203ffd62 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -22,7 +22,12 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
 attribute vec4 position;
 attribute vec3 normal;
 attribute vec4 diffuse_color;
@@ -84,12 +89,12 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
 	vary_texture_index = position.w;
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 		
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 	
 	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
 	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
@@ -123,7 +128,7 @@ void main()
 
 	gl_FogFragCoord = pos.z;
 	
-	pos = gl_ModelViewProjectionMatrix * vert;
+	pos = modelview_projection_matrix * vert;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
 	
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index f35af53f952..3e356757844 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 projection_matrix;
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -99,7 +100,7 @@ void main()
 	norm.z = dot(trans[2].xyz, normal);
 	norm = normalize(norm);
 		
-	gl_Position = gl_ProjectionMatrix * pos;
+	gl_Position = projection_matrix * pos;
 	
 	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
 	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
index 964f12afcfd..1f5470db3c3 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 
@@ -32,7 +33,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index e52edcba412..424299269fd 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
@@ -22,7 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 
@@ -33,7 +34,7 @@ varying vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 2cf7375d4d2..60ba2d7ad4d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
@@ -32,7 +34,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
index 556e131d348..4fd4b101ff7 100644
--- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
@@ -22,7 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -34,7 +35,7 @@ uniform float blurWidth;
 void main(void)
 {
 	// Transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	
 	vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth);
 	vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0);
diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
index fbb87b65787..d3c93ab05f1 100644
--- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
@@ -22,7 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -32,7 +33,7 @@ attribute vec2 texcoord1;
 void main(void)
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 	gl_TexCoord[1] = vec4(texcoord1,0,1);
 }
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
index 1a7edbd61b8..69f4d4ae458 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec3 normal;
@@ -52,10 +56,10 @@ vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 void main()
 {
 	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 
-	vec4 pos = gl_ModelViewMatrix * vec4(position.xyz, 1.0);
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec4 pos = modelview_matrix * vec4(position.xyz, 1.0);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
@@ -67,7 +71,7 @@ void main()
 	gl_FrontColor = color;
 
 	// Transform and pass tex coords
- 	gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ 	gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
 	
 	vec4 t = vec4(texcoord1,0,1);
 	
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
index 8a889576591..b9eff87a13b 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
@@ -22,7 +22,12 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 
 void calcAtmospherics(vec3 inPositionEye);
@@ -41,14 +46,14 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	vary_texture_index = position.w;
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
index f5ff1d1d008..b7f7af7885b 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
  
 attribute vec4 position;
 attribute vec2 texcoord0;
@@ -39,9 +42,9 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	vary_texture_index = position.w;
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
 	
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
index d6fca4cda71..4511c4bc91d 100644
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
@@ -22,7 +22,12 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec4 position;
 attribute vec2 texcoord0;
@@ -42,14 +47,14 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	vary_texture_index = position.w;
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 		
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
index d2a83c97249..5f78495ae36 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
@@ -2,10 +2,31 @@
  * @file simpleNonIndexedV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -20,12 +41,12 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	
-	gl_Position = gl_ModelViewProjectionMatrix*vert;
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	gl_Position = modelview_projection_matrix*vert;
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
 	
-	vec4 pos = (gl_ModelViewMatrix * vert);
+	vec4 pos = (modelview_matrix * vert);
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
index c2db1e19495..91ee5e016e0 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
@@ -22,8 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
 
 attribute vec4 position;
 attribute vec2 texcoord0;
@@ -40,13 +43,13 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	vary_texture_index = position.w;
-	vec4 pos = (gl_ModelViewMatrix * vert);
-	gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
 	
 	
 	
-	vec3 norm = normalize(gl_NormalMatrix * normal);
+	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 297b3904a60..67b5e7fb837 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec2 texcoord0;
 
@@ -60,7 +62,7 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 84e1f827d6c..50fdba64c25 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -23,6 +23,7 @@
  * $/LicenseInfo$
  */
  
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -59,7 +60,7 @@ void main()
 {
 
 	// World / view / projection
-	gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_TexCoord[0] = vec4(texcoord0,0,1);
 
 	// Get relative position
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index f1d06b4fec8..c10635c898c 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 projection_matrix;
+
 attribute vec3 position;
 attribute vec3 normal;
 attribute vec2 texcoord0;
@@ -123,7 +125,7 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.0));			
 	gl_FrontColor = color; 
 					
-	gl_Position = gl_ProjectionMatrix * pos;
+	gl_Position = projection_matrix * pos;
 	
 	
 	gl_TexCoord[2] = vec4(pos.xyz, 1.0);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
index 870d4c36bcb..5e75aec171d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
@@ -31,7 +33,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
index 76206f88d9e..969b6e2f1c0 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 
@@ -32,7 +34,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos;
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
index 1a23be349ee..2766691bd02 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 attribute vec4 diffuse_color;
 attribute vec2 texcoord0;
@@ -35,7 +37,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
index a2606f2fb2d..d0205fa824c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 varying vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
@@ -33,7 +35,7 @@ attribute vec4 diffuse_color;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
index 2d0b60d513b..2d7fa22edcb 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
@@ -31,7 +33,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
index 25bdfdce453..e9c6f3e27b8 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
@@ -22,7 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
+
 attribute vec3 position;
 
 varying vec2 vary_fragcoord;
@@ -31,7 +33,7 @@ uniform vec2 screen_res;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
index 9e07a4d219f..8e405de9a3d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
@@ -22,7 +22,8 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+uniform mat4 modelview_projection_matrix;
 
 attribute vec3 position;
 attribute vec2 texcoord0;
@@ -34,7 +35,7 @@ varying vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
-	vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	gl_Position = pos; 	
 	
 	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 917462c1ee7..7155311f8ef 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -380,7 +380,7 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void)
 		mReservedUniforms.push_back("lastNormalGIMap");
 		mReservedUniforms.push_back("lastMinpGIMap");
 		mReservedUniforms.push_back("lastMaxpGIMap");
-					
+
 		mWLUniforms.push_back("camPosLocal");
 
 		mTerrainUniforms.reserve(5);
-- 
GitLab


From 24ae2fb5af52d7128e79a0f63afce9a8db1123eb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 15 Sep 2011 16:38:31 -0500
Subject: [PATCH 019/933] SH-2243 work in progress -- don't use built-in GL
 light state when shaders are available.

---
 indra/llrender/llrender.cpp                   | 109 ++++++++++++++++--
 indra/llrender/llrender.h                     |   5 +
 .../class1/deferred/alphaSkinnedV.glsl        |  21 ++--
 .../shaders/class1/deferred/alphaV.glsl       |  25 ++--
 .../shaders/class1/deferred/avatarAlphaV.glsl |  19 +--
 .../class1/lighting/lightSpecularV.glsl       |   8 +-
 .../shaders/class1/lighting/lightV.glsl       |   8 +-
 .../class1/lighting/sumLightsSpecularV.glsl   |   7 +-
 .../shaders/class1/lighting/sumLightsV.glsl   |   7 +-
 .../windlight/atmosphericsHelpersV.glsl       |   8 +-
 .../class2/deferred/alphaSkinnedV.glsl        |  23 ++--
 .../shaders/class2/deferred/alphaV.glsl       |  26 +++--
 .../shaders/class2/deferred/avatarAlphaV.glsl |  23 ++--
 .../class2/lighting/sumLightsSpecularV.glsl   |  13 ++-
 .../shaders/class2/lighting/sumLightsV.glsl   |  15 ++-
 .../class3/lighting/sumLightsSpecularV.glsl   |  22 ++--
 .../shaders/class3/lighting/sumLightsV.glsl   |  23 ++--
 indra/newview/llviewerdisplay.cpp             |  11 +-
 indra/newview/llviewerwindow.cpp              |   5 +-
 indra/newview/pipeline.cpp                    |  43 ++++---
 20 files changed, 294 insertions(+), 127 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 359e6fd5609..bebf1455d35 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -840,7 +840,10 @@ void LLLightState::setDiffuse(const LLColor4& diffuse)
 	if (mDiffuse != diffuse)
 	{
 		mDiffuse = diffuse;
-		glLightfv(GL_LIGHT0+mIndex, GL_DIFFUSE, mDiffuse.mV);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightfv(GL_LIGHT0+mIndex, GL_DIFFUSE, mDiffuse.mV);
+		}
 	}
 }
 
@@ -849,7 +852,10 @@ void LLLightState::setAmbient(const LLColor4& ambient)
 	if (mAmbient != ambient)
 	{
 		mAmbient = ambient;
-		glLightfv(GL_LIGHT0+mIndex, GL_AMBIENT, mAmbient.mV);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightfv(GL_LIGHT0+mIndex, GL_AMBIENT, mAmbient.mV);
+		}
 	}
 }
 
@@ -858,7 +864,10 @@ void LLLightState::setSpecular(const LLColor4& specular)
 	if (mSpecular != specular)
 	{
 		mSpecular = specular;
-		glLightfv(GL_LIGHT0+mIndex, GL_SPECULAR, mSpecular.mV);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightfv(GL_LIGHT0+mIndex, GL_SPECULAR, mSpecular.mV);
+		}
 	}
 }
 
@@ -866,7 +875,20 @@ void LLLightState::setPosition(const LLVector4& position)
 {
 	//always set position because modelview matrix may have changed
 	mPosition = position;
-	glLightfv(GL_LIGHT0+mIndex, GL_POSITION, mPosition.mV);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glLightfv(GL_LIGHT0+mIndex, GL_POSITION, mPosition.mV);
+	}
+	else
+	{ //transform position by current modelview matrix
+		glh::vec4f pos(position.mV);
+
+		const glh::matrix4f& mat = gGL.getModelviewMatrix();
+		mat.mult_matrix_vec(pos);
+
+		mPosition.set(pos.v);
+	}
+
 }
 
 void LLLightState::setConstantAttenuation(const F32& atten)
@@ -874,7 +896,10 @@ void LLLightState::setConstantAttenuation(const F32& atten)
 	if (mConstantAtten != atten)
 	{
 		mConstantAtten = atten;
-		glLightf(GL_LIGHT0+mIndex, GL_CONSTANT_ATTENUATION, atten);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightf(GL_LIGHT0+mIndex, GL_CONSTANT_ATTENUATION, atten);
+		}
 	}
 }
 
@@ -883,7 +908,10 @@ void LLLightState::setLinearAttenuation(const F32& atten)
 	if (mLinearAtten != atten)
 	{
 		mLinearAtten = atten;
-		glLightf(GL_LIGHT0+mIndex, GL_LINEAR_ATTENUATION, atten);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightf(GL_LIGHT0+mIndex, GL_LINEAR_ATTENUATION, atten);
+		}
 	}
 }
 
@@ -892,7 +920,10 @@ void LLLightState::setQuadraticAttenuation(const F32& atten)
 	if (mQuadraticAtten != atten)
 	{
 		mQuadraticAtten = atten;
-		glLightf(GL_LIGHT0+mIndex, GL_QUADRATIC_ATTENUATION, atten);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightf(GL_LIGHT0+mIndex, GL_QUADRATIC_ATTENUATION, atten);
+		}
 	}
 }
 
@@ -901,7 +932,10 @@ void LLLightState::setSpotExponent(const F32& exponent)
 	if (mSpotExponent != exponent)
 	{
 		mSpotExponent = exponent;
-		glLightf(GL_LIGHT0+mIndex, GL_SPOT_EXPONENT, exponent);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightf(GL_LIGHT0+mIndex, GL_SPOT_EXPONENT, exponent);
+		}
 	}
 }
 
@@ -910,7 +944,10 @@ void LLLightState::setSpotCutoff(const F32& cutoff)
 	if (mSpotCutoff != cutoff)
 	{
 		mSpotCutoff = cutoff;
-		glLightf(GL_LIGHT0+mIndex, GL_SPOT_CUTOFF, cutoff);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightf(GL_LIGHT0+mIndex, GL_SPOT_CUTOFF, cutoff);
+		}
 	}
 }
 
@@ -918,7 +955,19 @@ void LLLightState::setSpotDirection(const LLVector3& direction)
 {
 	//always set direction because modelview matrix may have changed
 	mSpotDirection = direction;
-	glLightfv(GL_LIGHT0+mIndex, GL_SPOT_DIRECTION, direction.mV);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glLightfv(GL_LIGHT0+mIndex, GL_SPOT_DIRECTION, direction.mV);
+	}
+	else
+	{ //transform direction by current modelview matrix
+		glh::vec3f dir(direction.mV);
+
+		const glh::matrix4f& mat = gGL.getModelviewMatrix();
+		mat.mult_matrix_dir(dir);
+
+		mSpotDirection.set(direction);
+	}
 }
 
 LLRender::LLRender()
@@ -1016,6 +1065,36 @@ void LLRender::refreshState(void)
 	mDirty = false;
 }
 
+void LLRender::syncLightState()
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (!shader)
+	{
+		return;
+	}
+
+	LLVector4 position[8];
+	LLVector3 direction[8];
+	LLVector3 attenuation[8];
+	LLVector3 diffuse[8];
+
+	for (U32 i = 0; i < 8; i++)
+	{
+		LLLightState* light = mLightState[i];
+
+		position[i] = light->mPosition;
+		direction[i] = light->mSpotDirection;
+		attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]);
+		diffuse[i].set(light->mDiffuse.mV);
+	}
+
+	shader->uniform4fv("light_position", 8, position[0].mV);
+	shader->uniform3fv("light_direction", 8, direction[0].mV);
+	shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);
+	shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);
+}
+
 void LLRender::syncMatrices()
 {
 	stop_glerror();
@@ -1103,6 +1182,11 @@ void LLRender::syncMatrices()
 				shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, mvp.m);
 			}
 		}
+
+		if (shader->mFeatures.hasLighting || shader->mFeatures.calculatesLighting)
+		{ //also sync light state
+			syncLightState();
+		}
 	}
 	else
 	{
@@ -1274,6 +1358,11 @@ void LLRender::loadIdentity()
 	mMatHash[mMatrixMode]++;
 }
 
+const glh::matrix4f& LLRender::getModelviewMatrix()
+{
+	return mMatrix[MM_MODELVIEW][mMatIdx[MM_MODELVIEW]];
+}
+
 void LLRender::translateUI(F32 x, F32 y, F32 z)
 {
 	if (mUIOffset.empty())
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 465c16f0de7..0805ebb61a1 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -239,6 +239,8 @@ class LLLightState
 	void setSpotDirection(const LLVector3& direction);
 
 protected:
+	friend class LLRender;
+
 	S32 mIndex;
 	bool mEnabled;
 	LLColor4 mDiffuse;
@@ -347,7 +349,10 @@ class LLRender
 	void multMatrix(const GLdouble* m);
 	void matrixMode(U32 mode);	
 
+	const glh::matrix4f& getModelviewMatrix();
+
 	void syncMatrices();
+	void syncLightState();
 
 	void translateUI(F32 x, F32 y, F32 z);
 	void scaleUI(F32 x, F32 y, F32 z);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 9deb9a701e6..9d2c009d2af 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -50,6 +50,11 @@ varying vec3 vary_pointlight_col;
 
 uniform float near_clip;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
@@ -106,13 +111,13 @@ void main()
 	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
-	
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
+
 	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
@@ -121,7 +126,7 @@ void main()
 	col.rgb = atmosAmbient(vec3(0.));
 	
 	vary_ambient = col.rgb*diffuse_color.rgb;
-	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
+	vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
 	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 51e7c0780de..490ac7c0676 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -55,6 +55,11 @@ uniform float near_clip;
 uniform float shadow_offset;
 uniform float shadow_bias;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
@@ -97,8 +102,8 @@ void main()
 	
 	vec3 norm = normalize(normal_matrix * normal);
 	
-	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
-	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
+	float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz));
+	vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset;
 		
 	calcAtmospherics(pos.xyz);
 
@@ -106,12 +111,12 @@ void main()
 	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
 	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
@@ -120,10 +125,10 @@ void main()
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_light = gl_LightSource[0].position.xyz;
+	vary_light = light_position[0].xyz;
 	
 	vary_ambient = col.rgb*diffuse_color.rgb;
-	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
+	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
 	col.rgb = col.rgb*diffuse_color.rgb;
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index df4de4f4329..16f2b889f8a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -49,6 +49,11 @@ varying vec3 vary_pointlight_col;
 
 uniform float near_clip;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
@@ -108,12 +113,12 @@ void main()
 	vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
 
 	// Collect normal lights
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
 	vary_pointlight_col = col.rgb;
 
@@ -123,7 +128,7 @@ void main()
 	col.rgb = atmosAmbient(vec3(0.));
 	
 	vary_ambient = col.rgb;
-	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), 0.0));
+	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
 	
 	col.rgb = min(col.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
index 4a59b8245dc..bf6ed5988e5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
@@ -24,6 +24,8 @@
  */
  
 
+uniform vec4 light_position[8];
+uniform vec3 light_diffuse[8];
 
 float calcDirectionalLight(vec3 n, vec3 l);
 
@@ -34,10 +36,10 @@ vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularCo
 	vec4 col;
 	col.a = color.a;
 
-	col.rgb = gl_LightModel.ambient.rgb + baseCol.rgb;
+	col.rgb = baseCol.rgb;  //need ambient?
 
-	col.rgb += gl_LightSource[0].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[0].position.xyz);
-	col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
+	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz);
+	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
 
 	col.rgb = min(col.rgb*color.rgb, 1.0);
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
index 742cb38d804..79e22079322 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
@@ -24,6 +24,8 @@
  */
  
 
+uniform vec4 light_position[8];
+uniform vec3 light_diffuse[8];
 
 float calcDirectionalLight(vec3 n, vec3 l);
 
@@ -32,10 +34,10 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
 	vec4 col;
 	col.a = color.a;
 	
-	col.rgb = gl_LightModel.ambient.rgb + baseLight.rgb;
+	col.rgb = baseLight.rgb;  //need ambient?
 	
-	col.rgb += gl_LightSource[0].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[0].position.xyz);
-	col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
+	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz);
+	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
 						
 	col.rgb = min(col.rgb*color.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
index 3e0815226c6..dcd405716c6 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
@@ -31,6 +31,9 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 atmosGetDiffuseSunlightColor();
 vec3 scaleDownLight(vec3 light);
 
+uniform vec4 light_position[8];
+uniform vec3 light_diffuse[8];
+
 vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
 {
 	vec4 col;
@@ -42,10 +45,10 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor
 	/// collect all the specular values from each calcXXXLightSpecular() function
 	vec4 specularSum = vec4(0.0);
 
-	col.rgb = gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz, gl_LightSource[1].diffuse.rgb, 1.0);
+	col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0);
 	col.rgb = scaleDownLight(col.rgb);
 	col.rgb += atmosAmbient(baseCol.rgb);
-	col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz,atmosGetDiffuseSunlightColor() * baseCol.a, 1.0));
+	col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0));
 
 	col.rgb = min(col.rgb * color.rgb, 1.0);
 	specularColor.rgb = min(specularColor.rgb * specularSum.rgb, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
index c271dbcd189..41288c21c19 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
@@ -23,7 +23,8 @@
  * $/LicenseInfo$
  */
  
-
+uniform vec4 light_position[8];
+uniform vec3 light_diffuse[8];
 
 float calcDirectionalLight(vec3 n, vec3 l);
 
@@ -36,10 +37,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
 	vec4 col;
 	col.a = color.a;
 	
-	col.rgb = gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
+	col.rgb = light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
 	col.rgb = scaleDownLight(col.rgb);
 	col.rgb += atmosAmbient(baseLight.rgb);
-	col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz));
+	col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
 	
 	col.rgb = min(col.rgb*color.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index 15738e37e82..9aa583afa1d 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -23,21 +23,21 @@
  * $/LicenseInfo$
  */
  
-
+uniform vec3 light_diffuse[8];
 
 vec3 atmosAmbient(vec3 light)
 {
-	return gl_LightModel.ambient.rgb + light;
+	return light;  //need ambient?
 }
 
 vec3 atmosAffectDirectionalLight(float lightIntensity)
 {
-	return gl_LightSource[0].diffuse.rgb * lightIntensity;
+	return light_diffuse[0].rgb * lightIntensity;
 }
 
 vec3 atmosGetDiffuseSunlightColor()
 {
-	return gl_LightSource[0].diffuse.rgb;
+	return light_diffuse[0].rgb;
 }
 
 vec3 scaleDownLight(vec3 light)
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index df4d26997ac..c3148d5fdf0 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -52,6 +52,11 @@ uniform float near_clip;
 uniform float shadow_offset;
 uniform float shadow_bias;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
@@ -101,8 +106,8 @@ void main()
 	
 	vec3 norm = n.xyz;
 	
-	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
-	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
+	float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz));
+	vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset;
 			
 	calcAtmospherics(pos.xyz);
 
@@ -110,12 +115,12 @@ void main()
 	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
 	// Collect normal lights
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
 	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
@@ -125,7 +130,7 @@ void main()
 	col.rgb = atmosAmbient(vec3(0.));
 		
 	vary_ambient = col.rgb*diffuse_color.rgb;
-	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
+	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
 	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 996203ffd62..8d55616e67c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -54,6 +54,11 @@ uniform float near_clip;
 uniform float shadow_offset;
 uniform float shadow_bias;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
@@ -96,22 +101,23 @@ void main()
 		
 	vec3 norm = normalize(normal_matrix * normal);
 	
-	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
-	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
+	float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz));
+	vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset;
 		
 	calcAtmospherics(pos.xyz);
 
 	//vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
 
-	// Collect normal lights
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
 	
+	// Collect normal lights
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
+
 	vary_pointlight_col = col.rgb*diffuse_color.rgb;
 
 	col.rgb = vec3(0,0,0);
@@ -120,7 +126,7 @@ void main()
 	col.rgb = atmosAmbient(vec3(0.));
 	
 	vary_ambient = col.rgb*diffuse_color.rgb;
-	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
+	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
 	col.rgb = col.rgb*diffuse_color.rgb;
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 3e356757844..0273f3c1210 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -51,6 +51,11 @@ uniform float near_clip;
 uniform float shadow_offset;
 uniform float shadow_bias;
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
@@ -102,20 +107,20 @@ void main()
 		
 	gl_Position = projection_matrix * pos;
 	
-	float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
-	vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
+	float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz));
+	vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset;
 	
 	calcAtmospherics(pos.xyz);
 
 	vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
 
 	// Collect normal lights
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
 	vary_pointlight_col = col.rgb;
 
@@ -125,7 +130,7 @@ void main()
 	col.rgb = atmosAmbient(vec3(0.));
 	
 	vary_ambient = col.rgb;
-	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), 0.0));
+	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
 	
 	col.rgb = min(col.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
index d0a12479db3..3acf9fe883f 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
@@ -33,6 +33,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 atmosGetDiffuseSunlightColor();
 vec3 scaleDownLight(vec3 light);
 
+uniform vec4 light_position[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
 {
 	vec4 col = vec4(0.0, 0.0, 0.0, color.a);
@@ -43,15 +47,14 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor
 	vec4 specularSum = vec4(0.0);
 	
 	// Collect normal lights (need to be divided by two, as we later multiply by 2)
-	col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz, gl_LightSource[1].diffuse.rgb, 1.0);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[2].position.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].diffuse.rgb);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[3].position.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation, gl_LightSource[3].diffuse.rgb);
-	//col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[4].position.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].diffuse.rgb);
+	col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0);
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[2].xyz, light_attenuation[2].x, light_attenuation[2].y, light_diffuse[2].rgb); 
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[3].xyz, light_attenuation[3].x, light_attenuation[3].y, light_diffuse[3].rgb); 
 	col.rgb = scaleDownLight(col.rgb);
 						
 	// Add windlight lights
 	col.rgb += atmosAmbient(baseCol.rgb);
-	col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz, atmosGetDiffuseSunlightColor()*baseCol.a, 1.0));
+	col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0));
 
 	col.rgb = min(col.rgb*color.rgb, 1.0);
 	specularColor.rgb = min(specularColor.rgb*specularSum.rgb, 1.0);
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
index 55dfab2aa19..c9987ef3b94 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
@@ -30,21 +30,26 @@ vec3 atmosAmbient(vec3 light);
 vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
 {
 	vec4 col = vec4(0.0, 0.0, 0.0, color.a);
 	
 	// Collect normal lights (need to be divided by two, as we later multiply by 2)
-	col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
+	col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
+
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
 
-	col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a);
-	//col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a);
 	col.rgb = scaleDownLight(col.rgb);
 
 	// Add windlight lights
 	col.rgb += atmosAmbient(baseLight.rgb);
-	col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz));
+	col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
 				
 	col.rgb = min(col.rgb*color.rgb, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
index 79bd017efc0..e043ac873eb 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
@@ -23,8 +23,6 @@
  * $/LicenseInfo$
  */
  
-
-
 float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da);
 vec3 calcPointLightSpecular(inout vec4 specular, vec3 view, vec3 v, vec3 n, vec3 l, float r, float pw, vec3 lightCol);
 
@@ -33,6 +31,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 atmosGetDiffuseSunlightColor();
 vec3 scaleDownLight(vec3 light);
 
+uniform vec4 light_position[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
 {
 	vec4 col = vec4(0.0, 0.0, 0.0, color.a);
@@ -43,18 +45,18 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor
 	vec4 specularSum = vec4(0.0);
 	
 	// Collect normal lights (need to be divided by two, as we later multiply by 2)
-	col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz,gl_LightSource[1].diffuse.rgb, 1.0);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[2].position.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation,gl_LightSource[2].diffuse.rgb);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[3].position.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation,gl_LightSource[3].diffuse.rgb);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[4].position.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation,gl_LightSource[4].diffuse.rgb);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[5].position.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation,gl_LightSource[5].diffuse.rgb);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[6].position.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation,gl_LightSource[6].diffuse.rgb);
-	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[7].position.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation,gl_LightSource[7].diffuse.rgb);
+	col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0);
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[2].xyz, light_attenuation[2].x, light_attenuation[2].y, light_diffuse[2].rgb); 
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[3].xyz, light_attenuation[3].x, light_attenuation[3].y, light_diffuse[3].rgb); 
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[4].xyz, light_attenuation[4].x, light_attenuation[4].y, light_diffuse[4].rgb); 
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[5].xyz, light_attenuation[5].x, light_attenuation[5].y, light_diffuse[5].rgb); 
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[6].xyz, light_attenuation[6].x, light_attenuation[6].y, light_diffuse[6].rgb); 
+	col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[7].xyz, light_attenuation[7].x, light_attenuation[7].y, light_diffuse[7].rgb); 
 	col.rgb = scaleDownLight(col.rgb);
 						
 	// Add windlight lights
 	col.rgb += atmosAmbient(baseCol.rgb);
-	col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0));
+	col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0));
 
 	col.rgb = min(col.rgb*color.rgb, 1.0);
 	specularColor.rgb = min(specularColor.rgb*specularSum.rgb, 1.0);
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
index c31afb6268f..dadff40933a 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
@@ -32,22 +32,29 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
 vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
 {
 	vec4 col = vec4(0.0, 0.0, 0.0, color.a);
 	
 	// Collect normal lights (need to be divided by two, as we later multiply by 2)
-	col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a);
-	col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a);
-	col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a);
-	col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a);
-	col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a);
-	col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a);
-	col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
+	
+	// Collect normal lights
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].z);
+	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
 	col.rgb = scaleDownLight(col.rgb);
 
 	// Add windlight lights
-	col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz));
+	col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
 	col.rgb += atmosAmbient(baseLight.rgb);
 
 	col.rgb = min(col.rgb*color.rgb, 1.0);
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 5f4156732ed..22f4db56ddc 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -522,10 +522,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 	// Slam lighting parameters back to our defaults.
 	// Note that these are not the same as GL defaults...
 
-	stop_glerror();
-	F32 one[4] =	{1.f, 1.f, 1.f, 1.f};
-	glLightModelfv (GL_LIGHT_MODEL_AMBIENT,one);
-	stop_glerror();
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		stop_glerror();
+		F32 one[4] =	{1.f, 1.f, 1.f, 1.f};
+		glLightModelfv (GL_LIGHT_MODEL_AMBIENT,one);
+		stop_glerror();
+	}
 		
 	/////////////////////////////////////
 	//
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 010bcfb1257..cd9dc461d56 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1725,7 +1725,10 @@ void LLViewerWindow::initGLDefaults()
 	// lights for objects
 	glShadeModel( GL_SMOOTH );
 
-	glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
+	}
 	
 	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 60d504e9484..ebad1f77c4c 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4824,8 +4824,6 @@ void LLPipeline::setupAvatarLights(BOOL for_edit)
 {
 	assertInitialized();
 
-	gGL.syncMatrices();
-
 	if (for_edit)
 	{
 		LLColor4 diffuse(1.f, 1.f, 1.f, 0.f);
@@ -5054,11 +5052,13 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
 void LLPipeline::setupHWLights(LLDrawPool* pool)
 {
 	assertInitialized();
-	gGL.syncMatrices();
-
+	
 	// Ambient
-	LLColor4 ambient = gSky.getTotalAmbientColor();
-	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		LLColor4 ambient = gSky.getTotalAmbientColor();
+		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
+	}
 
 	// Light 0 = Sun or Moon (All objects)
 	{
@@ -5282,11 +5282,15 @@ void LLPipeline::enableLights(U32 mask)
 		{
 			glDisable(GL_LIGHTING);
 		}
-		stop_glerror();
 		mLightMask = mask;
-		LLColor4 ambient = gSky.getTotalAmbientColor();
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
 		stop_glerror();
+
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			LLColor4 ambient = gSky.getTotalAmbientColor();
+			glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
+		}
+		
 	}
 }
 
@@ -5335,11 +5339,12 @@ void LLPipeline::enableLightsPreview()
 {
 	disableLights();
 
-	gGL.syncMatrices();
-
-	glEnable(GL_LIGHTING);
-	LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor");
-	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glEnable(GL_LIGHTING);
+		LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor");
+		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
+	}
 
 
 	LLColor4 diffuse0 = gSavedSettings.getColor4("PreviewDiffuse0");
@@ -5398,7 +5403,10 @@ void LLPipeline::enableLightsAvatarEdit(const LLColor4& color)
 	setupAvatarLights(TRUE);
 	enableLights(mask);
 
-	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
+	}
 }
 
 void LLPipeline::enableLightsFullbright(const LLColor4& color)
@@ -5407,7 +5415,10 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color)
 	U32 mask = 0x1000; // Non-0 mask, set ambient
 	enableLights(mask);
 
-	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
+	}
 }
 
 void LLPipeline::disableLights()
-- 
GitLab


From 4fea7dcb3ef35cae9e31ba467403d31ce9083905 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 15 Sep 2011 17:10:33 -0500
Subject: [PATCH 020/933] SH-2243 work in progress -- use a hash check to avoid
 redundantly setting light state

---
 indra/llrender/llglslshader.cpp |  1 +
 indra/llrender/llglslshader.h   |  1 +
 indra/llrender/llrender.cpp     | 60 ++++++++++++++++++++++-----------
 indra/llrender/llrender.h       |  4 ++-
 4 files changed, 46 insertions(+), 20 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 95ce2271710..2488e4c5398 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -80,6 +80,7 @@ LLGLSLShader::LLGLSLShader()
 	{
 		mMatHash[i] = 0xFFFFFFFF;
 	}
+	mLightHash = 0xFFFFFFFF;
 }
 
 void LLGLSLShader::unload()
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index c1765e2701a..04dc594d872 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -132,6 +132,7 @@ class LLGLSLShader
 	static void bindNoShader(void);
 
 	U32 mMatHash[LLRender::NUM_MATRIX_MODES];
+	U32 mLightHash;
 
 	GLhandleARB mProgramObject;
 	std::vector<GLint> mAttribute; //lookup table of attribute enum to attribute channel
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index bebf1455d35..5f5b76d4251 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -814,14 +814,16 @@ LLLightState::LLLightState(S32 index)
 	mAmbient.set(0,0,0,1);
 	mPosition.set(0,0,1,0);
 	mSpotDirection.set(0,0,-1);
-
 }
 
 void LLLightState::enable()
 {
 	if (!mEnabled)
 	{
-		glEnable(GL_LIGHT0+mIndex);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glEnable(GL_LIGHT0+mIndex);
+		}
 		mEnabled = true;
 	}
 }
@@ -830,7 +832,10 @@ void LLLightState::disable()
 {
 	if (mEnabled)
 	{
-		glDisable(GL_LIGHT0+mIndex);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glDisable(GL_LIGHT0+mIndex);
+		}
 		mEnabled = false;
 	}
 }
@@ -839,6 +844,7 @@ void LLLightState::setDiffuse(const LLColor4& diffuse)
 {
 	if (mDiffuse != diffuse)
 	{
+		++gGL.mLightHash;
 		mDiffuse = diffuse;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -851,6 +857,7 @@ void LLLightState::setAmbient(const LLColor4& ambient)
 {
 	if (mAmbient != ambient)
 	{
+		++gGL.mLightHash;
 		mAmbient = ambient;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -863,6 +870,7 @@ void LLLightState::setSpecular(const LLColor4& specular)
 {
 	if (mSpecular != specular)
 	{
+		++gGL.mLightHash;
 		mSpecular = specular;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -874,6 +882,7 @@ void LLLightState::setSpecular(const LLColor4& specular)
 void LLLightState::setPosition(const LLVector4& position)
 {
 	//always set position because modelview matrix may have changed
+	++gGL.mLightHash;
 	mPosition = position;
 	if (!LLGLSLShader::sNoFixedFunction)
 	{
@@ -896,6 +905,7 @@ void LLLightState::setConstantAttenuation(const F32& atten)
 	if (mConstantAtten != atten)
 	{
 		mConstantAtten = atten;
+		++gGL.mLightHash;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
 			glLightf(GL_LIGHT0+mIndex, GL_CONSTANT_ATTENUATION, atten);
@@ -907,6 +917,7 @@ void LLLightState::setLinearAttenuation(const F32& atten)
 {
 	if (mLinearAtten != atten)
 	{
+		++gGL.mLightHash;
 		mLinearAtten = atten;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -919,6 +930,7 @@ void LLLightState::setQuadraticAttenuation(const F32& atten)
 {
 	if (mQuadraticAtten != atten)
 	{
+		++gGL.mLightHash;
 		mQuadraticAtten = atten;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -931,6 +943,7 @@ void LLLightState::setSpotExponent(const F32& exponent)
 {
 	if (mSpotExponent != exponent)
 	{
+		++gGL.mLightHash;
 		mSpotExponent = exponent;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -943,6 +956,7 @@ void LLLightState::setSpotCutoff(const F32& cutoff)
 {
 	if (mSpotCutoff != cutoff)
 	{
+		++gGL.mLightHash;
 		mSpotCutoff = cutoff;
 		if (!LLGLSLShader::sNoFixedFunction)
 		{
@@ -954,6 +968,7 @@ void LLLightState::setSpotCutoff(const F32& cutoff)
 void LLLightState::setSpotDirection(const LLVector3& direction)
 {
 	//always set direction because modelview matrix may have changed
+	++gGL.mLightHash;
 	mSpotDirection = direction;
 	if (!LLGLSLShader::sNoFixedFunction)
 	{
@@ -1009,6 +1024,8 @@ LLRender::LLRender()
 		mMatHash[i] = 0;
 		mCurMatHash[i] = 0xFFFFFFFF;
 	}
+
+	mLightHash = 0;
 }
 
 LLRender::~LLRender()
@@ -1074,25 +1091,30 @@ void LLRender::syncLightState()
 		return;
 	}
 
-	LLVector4 position[8];
-	LLVector3 direction[8];
-	LLVector3 attenuation[8];
-	LLVector3 diffuse[8];
-
-	for (U32 i = 0; i < 8; i++)
+	if (shader->mLightHash != mLightHash)
 	{
-		LLLightState* light = mLightState[i];
+		shader->mLightHash = mLightHash;
 
-		position[i] = light->mPosition;
-		direction[i] = light->mSpotDirection;
-		attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]);
-		diffuse[i].set(light->mDiffuse.mV);
-	}
+		LLVector4 position[8];
+		LLVector3 direction[8];
+		LLVector3 attenuation[8];
+		LLVector3 diffuse[8];
+
+		for (U32 i = 0; i < 8; i++)
+		{
+			LLLightState* light = mLightState[i];
 
-	shader->uniform4fv("light_position", 8, position[0].mV);
-	shader->uniform3fv("light_direction", 8, direction[0].mV);
-	shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);
-	shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);
+			position[i] = light->mPosition;
+			direction[i] = light->mSpotDirection;
+			attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]);
+			diffuse[i].set(light->mDiffuse.mV);
+		}
+
+		shader->uniform4fv("light_position", 8, position[0].mV);
+		shader->uniform3fv("light_direction", 8, direction[0].mV);
+		shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);
+		shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);
+	}
 }
 
 void LLRender::syncMatrices()
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 0805ebb61a1..3f319022f69 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -429,12 +429,14 @@ class LLRender
 	static U32 sUIVerts;
 	
 private:
+	friend class LLLightState;
+
 	U32 mMatrixMode;
 	U32 mMatIdx[NUM_MATRIX_MODES];
 	U32 mMatHash[NUM_MATRIX_MODES];
 	glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH];
-
 	U32 mCurMatHash[NUM_MATRIX_MODES];
+	U32 mLightHash;
 	
 	bool			mDirty;
 	U32				mCount;
-- 
GitLab


From 10d92237adca8bffc82c887dbd37b988602b2d59 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 15 Sep 2011 16:39:46 -0700
Subject: [PATCH 021/933] * Re-enabling outbox

---
 indra/newview/llinventorybridge.cpp    | 2 +-
 indra/newview/llsidepanelinventory.cpp | 2 +-
 indra/newview/llviewermedia.cpp        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index a36aa3dedf9..5482b07ce5c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -71,7 +71,7 @@
 #include "llwearablelist.h"
 
 // Marketplace outbox current disabled
-#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	0	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL
+#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
 typedef std::list<two_uuids_t> two_uuids_list_t;
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index bd62b5c101a..ec1de4af212 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -68,7 +68,7 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
 #define AUTO_EXPAND_INBOX	0
 
 // Temporarily disabling the outbox until we straighten out the API
-#define ENABLE_MERCHANT_OUTBOX_PANEL		0	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+#define ENABLE_MERCHANT_OUTBOX_PANEL		1	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
 
 static const char * const INBOX_BUTTON_NAME = "inbox_btn";
 static const char * const OUTBOX_BUTTON_NAME = "outbox_btn";
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 13dbc5e3863..e7f05dcaa3b 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1368,7 +1368,7 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom
 
 // This is defined in two files but I don't want to create a dependence between this and llsidepanelinventory
 // just to be able to temporarily disable the outbox.
-#define ENABLE_INVENTORY_DISPLAY_OUTBOX		0	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+#define ENABLE_INVENTORY_DISPLAY_OUTBOX		1	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
 
 class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
 {
-- 
GitLab


From da84f5552731e1ece3a463c4c385bb327f1048a1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 16 Sep 2011 12:40:53 -0500
Subject: [PATCH 022/933] SH-2243 work in progress -- don't use deprecated
 shader state

---
 indra/llrender/llshadermgr.cpp                | 39 ++++++++++++++++---
 .../shaders/class1/avatar/avatarSkinV.glsl    |  2 +-
 .../shaders/class1/avatar/avatarV.glsl        | 16 +++++---
 .../shaders/class1/avatar/eyeballV.glsl       | 15 ++++---
 .../shaders/class1/avatar/objectSkinV.glsl    |  2 +-
 .../shaders/class1/avatar/pickAvatarF.glsl    |  5 ++-
 .../shaders/class1/avatar/pickAvatarV.glsl    | 13 ++++---
 .../shaders/class1/deferred/alphaF.glsl       | 17 ++++----
 .../class1/deferred/alphaNonIndexedF.glsl     | 16 ++++----
 .../deferred/alphaNonIndexedNoColorF.glsl     | 33 ++++++++++++----
 .../class1/deferred/alphaSkinnedV.glsl        | 29 +++++++-------
 .../shaders/class1/deferred/alphaV.glsl       | 31 ++++++++-------
 .../class1/deferred/attachmentShadowF.glsl    |  4 +-
 .../class1/deferred/attachmentShadowV.glsl    | 13 ++++---
 .../shaders/class1/deferred/avatarAlphaV.glsl | 25 ++++++------
 .../shaders/class1/deferred/avatarEyesV.glsl  | 16 ++++----
 .../shaders/class1/deferred/avatarF.glsl      |  5 ++-
 .../class1/deferred/avatarShadowF.glsl        |  2 +-
 .../class1/deferred/avatarShadowV.glsl        | 11 +++---
 .../shaders/class1/deferred/avatarV.glsl      | 13 ++++---
 .../shaders/class1/deferred/blurLightF.glsl   |  2 +-
 .../shaders/class1/deferred/blurLightV.glsl   |  4 +-
 .../shaders/class1/deferred/bumpF.glsl        | 17 ++++----
 .../shaders/class1/deferred/bumpSkinnedV.glsl | 22 ++++++-----
 .../shaders/class1/deferred/bumpV.glsl        | 22 ++++++-----
 .../shaders/class1/deferred/cloudsF.glsl      | 19 +++++----
 .../shaders/class1/deferred/cloudsV.glsl      | 35 ++++++++++-------
 .../class1/deferred/diffuseAlphaMaskF.glsl    |  6 ++-
 .../deferred/diffuseAlphaMaskIndexedF.glsl    |  7 +++-
 .../deferred/diffuseAlphaMaskNoColorF.glsl    | 25 ++++++++++--
 .../shaders/class1/deferred/diffuseF.glsl     | 10 +++--
 .../class1/deferred/diffuseIndexedF.glsl      | 10 +++--
 .../class1/deferred/diffuseNoColorV.glsl      | 13 ++++---
 .../class1/deferred/diffuseSkinnedV.glsl      | 16 ++++----
 .../shaders/class1/deferred/diffuseV.glsl     | 18 +++++----
 .../shaders/class1/deferred/emissiveF.glsl    | 24 +++++++++++-
 .../shaders/class1/deferred/emissiveV.glsl    | 17 ++++----
 .../shaders/class1/deferred/fullbrightF.glsl  |  5 ++-
 .../shaders/class1/deferred/fullbrightV.glsl  | 17 ++++----
 .../shaders/class1/deferred/giF.glsl          |  2 +-
 .../shaders/class1/deferred/giV.glsl          | 12 +++---
 .../shaders/class1/deferred/impostorF.glsl    |  8 ++--
 .../shaders/class1/deferred/impostorV.glsl    | 13 ++++---
 .../shaders/class1/deferred/luminanceF.glsl   |  2 +-
 .../shaders/class1/deferred/luminanceV.glsl   |  9 +++--
 .../class1/deferred/multiPointLightF.glsl     |  2 +-
 .../class1/deferred/multiPointLightV.glsl     |  4 +-
 .../class1/deferred/multiSpotLightF.glsl      |  2 +-
 .../shaders/class1/deferred/pointLightF.glsl  |  2 +-
 .../shaders/class1/deferred/pointLightV.glsl  |  4 +-
 .../class1/deferred/postDeferredF.glsl        |  4 +-
 .../class1/deferred/postDeferredNoDoFF.glsl   |  4 +-
 .../deferred/postDeferredNoDoFNoFXAAF.glsl    |  2 +-
 .../class1/deferred/postDeferredNoFXAAF.glsl  |  2 +-
 .../class1/deferred/postDeferredV.glsl        |  6 +--
 .../shaders/class1/deferred/postgiF.glsl      |  2 +-
 .../shaders/class1/deferred/postgiV.glsl      |  4 +-
 .../class1/deferred/shadowAlphaMaskF.glsl     |  6 ++-
 .../class1/deferred/shadowAlphaMaskV.glsl     | 14 ++++---
 .../shaders/class1/deferred/shadowF.glsl      |  2 +-
 .../shaders/class1/deferred/shadowV.glsl      |  4 +-
 .../shaders/class1/deferred/skyF.glsl         |  2 +-
 .../shaders/class1/deferred/skyV.glsl         |  9 +++--
 .../shaders/class1/deferred/softenLightF.glsl |  2 +-
 .../shaders/class1/deferred/softenLightV.glsl |  4 +-
 .../shaders/class1/deferred/spotLightF.glsl   |  2 +-
 .../shaders/class1/deferred/starsF.glsl       |  5 ++-
 .../shaders/class1/deferred/starsV.glsl       | 13 ++++---
 .../class1/deferred/sunLightSSAOF.glsl        |  2 +-
 .../shaders/class1/deferred/sunLightV.glsl    |  4 +-
 .../shaders/class1/deferred/terrainF.glsl     | 18 +++++----
 .../shaders/class1/deferred/terrainV.glsl     | 26 ++++++++-----
 .../shaders/class1/deferred/treeF.glsl        |  8 ++--
 .../shaders/class1/deferred/treeShadowF.glsl  | 25 ++++++++++--
 .../shaders/class1/deferred/treeShadowV.glsl  |  9 +++--
 .../shaders/class1/deferred/treeV.glsl        | 14 ++++---
 .../shaders/class1/deferred/waterF.glsl       |  8 ++--
 .../shaders/class1/deferred/waterV.glsl       | 10 ++---
 .../shaders/class1/effects/glowExtractF.glsl  |  4 +-
 .../class1/effects/glowExtractMSF.glsl        |  4 +-
 .../shaders/class1/effects/glowExtractV.glsl  |  7 ++--
 .../shaders/class1/effects/glowF.glsl         | 21 ++++++----
 .../shaders/class1/effects/glowV.glsl         | 25 +++++++-----
 .../shaders/class1/environment/terrainF.glsl  | 13 +++++--
 .../shaders/class1/environment/terrainV.glsl  | 34 +++++++++-------
 .../class1/environment/terrainWaterF.glsl     | 13 +++++--
 .../class1/environment/underWaterF.glsl       |  6 +--
 .../shaders/class1/environment/waterF.glsl    |  6 +--
 .../shaders/class1/environment/waterFogF.glsl |  7 ++--
 .../shaders/class1/environment/waterV.glsl    |  8 ++--
 .../class1/interface/customalphaF.glsl        |  5 ++-
 .../class1/interface/customalphaV.glsl        | 12 +++---
 .../shaders/class1/interface/debugV.glsl      |  2 +-
 .../class1/interface/glowcombineF.glsl        |  7 +++-
 .../class1/interface/glowcombineFXAAF.glsl    | 22 ++++++++++-
 .../class1/interface/glowcombineFXAAV.glsl    |  4 +-
 .../class1/interface/glowcombineV.glsl        | 13 ++++---
 .../shaders/class1/interface/highlightF.glsl  |  4 +-
 .../shaders/class1/interface/highlightV.glsl  |  8 ++--
 .../shaders/class1/interface/occlusionV.glsl  |  2 +-
 .../class1/interface/onetexturenocolorF.glsl  | 24 +++++++++++-
 .../class1/interface/onetexturenocolorV.glsl  |  7 ++--
 .../shaders/class1/interface/solidcolorF.glsl |  7 +++-
 .../shaders/class1/interface/solidcolorV.glsl | 13 ++++---
 .../class1/interface/splattexturerectF.glsl   |  5 ++-
 .../class1/interface/splattexturerectV.glsl   | 13 ++++---
 .../class1/interface/twotextureaddF.glsl      |  5 ++-
 .../class1/interface/twotextureaddV.glsl      | 13 ++++---
 .../shaders/class1/interface/uiF.glsl         |  5 ++-
 .../shaders/class1/interface/uiV.glsl         | 12 +++---
 .../shaders/class1/lighting/lightF.glsl       |  5 ++-
 .../class1/lighting/lightFullbrightF.glsl     |  4 +-
 .../lighting/lightFullbrightShinyF.glsl       |  4 +-
 .../lighting/lightFullbrightShinyWaterF.glsl  |  4 +-
 .../lighting/lightFullbrightWaterF.glsl       |  4 +-
 .../shaders/class1/lighting/lightShinyF.glsl  |  5 ++-
 .../class1/lighting/lightShinyWaterF.glsl     |  5 ++-
 .../shaders/class1/lighting/lightWaterF.glsl  |  5 ++-
 .../shaders/class1/objects/bumpF.glsl         |  7 +++-
 .../shaders/class1/objects/bumpV.glsl         | 13 ++++---
 .../class1/objects/emissiveSkinnedV.glsl      | 16 +++++---
 .../shaders/class1/objects/emissiveV.glsl     | 18 +++++----
 .../class1/objects/fullbrightNoColorV.glsl    | 16 +++++---
 .../objects/fullbrightShinySkinnedV.glsl      | 21 ++++++----
 .../class1/objects/fullbrightShinyV.glsl      | 21 ++++++----
 .../class1/objects/fullbrightSkinnedV.glsl    | 16 +++++---
 .../shaders/class1/objects/fullbrightV.glsl   | 16 +++++---
 .../shaders/class1/objects/impostorF.glsl     |  4 +-
 .../shaders/class1/objects/impostorV.glsl     |  8 ++--
 .../shaders/class1/objects/previewV.glsl      | 16 +++++---
 .../class1/objects/shinySimpleSkinnedV.glsl   | 18 +++++----
 .../shaders/class1/objects/shinyV.glsl        | 18 +++++----
 .../class1/objects/simpleNoColorV.glsl        | 16 +++++---
 .../class1/objects/simpleSkinnedV.glsl        | 18 +++++----
 .../shaders/class1/objects/simpleV.glsl       | 18 +++++----
 .../shaders/class1/objects/treeV.glsl         | 16 +++++---
 .../class1/windlight/atmosphericsVarsF.glsl   |  2 +-
 .../class1/windlight/atmosphericsVarsV.glsl   |  2 +-
 .../shaders/class2/avatar/eyeballV.glsl       | 18 +++++----
 .../shaders/class2/deferred/alphaF.glsl       | 19 +++++----
 .../class2/deferred/alphaNonIndexedF.glsl     | 18 +++++----
 .../deferred/alphaNonIndexedNoColorF.glsl     | 33 ++++++++++++----
 .../class2/deferred/alphaSkinnedV.glsl        | 28 +++++++------
 .../shaders/class2/deferred/alphaV.glsl       | 29 +++++++-------
 .../shaders/class2/deferred/avatarAlphaV.glsl | 25 ++++++------
 .../shaders/class2/deferred/edgeF.glsl        |  2 +-
 .../shaders/class2/deferred/edgeMSF.glsl      |  2 +-
 .../shaders/class2/deferred/edgeV.glsl        |  4 +-
 .../class2/deferred/multiSpotLightF.glsl      |  2 +-
 .../class2/deferred/multiSpotLightMSF.glsl    | 14 ++++---
 .../shaders/class2/deferred/softenLightF.glsl |  2 +-
 .../class2/deferred/softenLightMSF.glsl       |  4 +-
 .../shaders/class2/deferred/softenLightV.glsl |  4 +-
 .../shaders/class2/deferred/spotLightF.glsl   | 14 ++++---
 .../shaders/class2/deferred/spotLightMSF.glsl | 14 ++++---
 .../shaders/class2/deferred/sunLightF.glsl    | 12 +++---
 .../shaders/class2/deferred/sunLightMSF.glsl  | 14 +++----
 .../class2/deferred/sunLightSSAOF.glsl        | 12 +++---
 .../class2/deferred/sunLightSSAOMSF.glsl      | 14 +++----
 .../shaders/class2/deferred/sunLightV.glsl    |  4 +-
 .../shaders/class2/effects/blurF.glsl         | 26 +------------
 .../shaders/class2/effects/blurV.glsl         | 33 +---------------
 .../shaders/class2/effects/colorFilterF.glsl  |  2 +-
 .../shaders/class2/effects/drawQuadV.glsl     | 10 ++---
 .../shaders/class2/effects/extractF.glsl      |  2 +-
 .../shaders/class2/effects/nightVisionF.glsl  |  7 +++-
 .../shaders/class2/effects/simpleF.glsl       |  4 +-
 .../shaders/class2/environment/terrainF.glsl  | 19 +++++----
 .../shaders/class2/environment/terrainV.glsl  | 26 ++++++++-----
 .../class2/environment/terrainWaterF.glsl     | 20 +++++-----
 .../class2/environment/underWaterF.glsl       |  6 +--
 .../shaders/class2/environment/waterF.glsl    |  6 +--
 .../class2/lighting/lightAlphaMaskF.glsl      |  5 ++-
 .../lighting/lightAlphaMaskNonIndexedF.glsl   |  5 ++-
 .../shaders/class2/lighting/lightF.glsl       |  5 ++-
 .../lighting/lightFullbrightAlphaMaskF.glsl   |  5 ++-
 .../class2/lighting/lightFullbrightF.glsl     |  5 ++-
 .../lightFullbrightNonIndexedAlphaMaskF.glsl  |  5 ++-
 .../lighting/lightFullbrightNonIndexedF.glsl  |  5 ++-
 .../lighting/lightFullbrightShinyF.glsl       | 14 ++++---
 .../lightFullbrightShinyNonIndexedF.glsl      | 14 ++++---
 .../lighting/lightFullbrightShinyWaterF.glsl  | 14 ++++---
 .../lightFullbrightShinyWaterNonIndexedF.glsl | 14 ++++---
 .../lightFullbrightWaterAlphaMaskF.glsl       |  5 ++-
 .../lighting/lightFullbrightWaterF.glsl       |  5 ++-
 ...htFullbrightWaterNonIndexedAlphaMaskF.glsl |  5 ++-
 .../lightFullbrightWaterNonIndexedF.glsl      |  4 +-
 .../class2/lighting/lightNonIndexedF.glsl     |  5 ++-
 .../shaders/class2/lighting/lightShinyF.glsl  | 14 ++++---
 .../lighting/lightShinyNonIndexedF.glsl       | 15 +++----
 .../class2/lighting/lightShinyWaterF.glsl     | 14 ++++---
 .../lighting/lightShinyWaterNonIndexedF.glsl  | 14 ++++---
 .../class2/lighting/lightWaterAlphaMaskF.glsl |  5 ++-
 .../lightWaterAlphaMaskNonIndexedF.glsl       |  5 ++-
 .../shaders/class2/lighting/lightWaterF.glsl  |  4 +-
 .../lighting/lightWaterNonIndexedF.glsl       |  4 +-
 .../class2/objects/fullbrightShinyV.glsl      | 23 ++++++-----
 .../shaders/class2/objects/fullbrightV.glsl   | 19 +++++----
 .../shaders/class2/objects/shinyV.glsl        | 23 ++++++-----
 .../class2/objects/simpleNonIndexedV.glsl     | 18 +++++----
 .../shaders/class2/objects/simpleV.glsl       | 19 +++++----
 .../class2/windlight/atmosphericsV.glsl       |  6 +--
 .../class2/windlight/atmosphericsVarsF.glsl   | 10 ++---
 .../class2/windlight/atmosphericsVarsV.glsl   | 10 ++---
 .../shaders/class2/windlight/cloudsF.glsl     | 18 +++++----
 .../shaders/class2/windlight/cloudsV.glsl     | 34 +++++++++-------
 .../shaders/class2/windlight/skyF.glsl        |  2 +-
 .../shaders/class2/windlight/skyV.glsl        |  9 +++--
 .../shaders/class3/avatar/avatarV.glsl        | 17 ++++----
 .../class3/deferred/giDownsampleF.glsl        |  2 +-
 .../class3/deferred/giDownsampleV.glsl        |  4 +-
 .../shaders/class3/deferred/giF.glsl          |  2 +-
 .../shaders/class3/deferred/giFinalF.glsl     |  2 +-
 .../shaders/class3/deferred/giFinalV.glsl     |  4 +-
 .../shaders/class3/deferred/giV.glsl          | 11 +++---
 .../shaders/class3/deferred/luminanceF.glsl   |  2 +-
 .../shaders/class3/deferred/luminanceV.glsl   |  9 +++--
 .../class3/deferred/postDeferredF.glsl        |  2 +-
 .../class3/deferred/postDeferredV.glsl        |  4 +-
 .../shaders/class3/deferred/postgiF.glsl      |  2 +-
 .../shaders/class3/deferred/postgiV.glsl      |  4 +-
 .../shaders/class3/deferred/softenLightF.glsl |  4 +-
 .../shaders/class3/deferred/softenLightV.glsl |  8 ++--
 .../shaders/class3/deferred/treeF.glsl        |  8 ++--
 indra/newview/lldrawpoolterrain.cpp           | 11 +++---
 225 files changed, 1465 insertions(+), 975 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index db3d7becd90..889b436ac56 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -477,7 +477,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns)
 		}
 		else
 		{
-			LL_DEBUGS("ShaderLoading") << log << LL_ENDL;
+			LL_INFOS("ShaderLoading") << log << LL_ENDL;
 		}
 	}
  }
@@ -546,11 +546,39 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		text[count++] = strdup("#version 120\n");
 		text[count++] = strdup("#define FXAA_GLSL_120 1\n");
 		text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n");
+		text[count++] = strdup("#define ATTRIBUTE attribute\n");
+		text[count++] = strdup("#define VARYING varying\n");
 	}
 	else
-	{  //set version to 1.30
-		text[count++] = strdup("#version 130\n");
+	{  
+		if (gGLManager.mGLVersion < 4.f)
+		{
+			//set version to 1.30
+			text[count++] = strdup("#version 130\n");
+		}
+		else
+		{ //set version to 400
+			text[count++] = strdup("#version 400\n");
+		}
+
 		text[count++] = strdup("#define FXAA_GLSL_130 1\n");
+
+		text[count++] = strdup("#define ATTRIBUTE in\n");
+
+		if (type == GL_VERTEX_SHADER_ARB)
+		{ //"varying" state is "out" in a vertex program, "in" in a fragment program 
+			// ("varying" is deprecated after version 1.20)
+			text[count++] = strdup("#define VARYING out\n");
+		}
+		else
+		{
+			text[count++] = strdup("#define VARYING in\n");
+		}
+
+		//backwards compatibility with legacy texture lookup syntax
+		text[count++] = strdup("#define textureCube texture\n");
+		text[count++] = strdup("#define texture2DLod textureLod\n");
+		text[count++] = strdup("#define	shadow2D texture\n");
 	}
 
 	//copy preprocessor definitions into buffer
@@ -574,7 +602,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		.
 		uniform sampler2D texN;
 		
-		varying float vary_texture_index;
+		VARYING float vary_texture_index;
 
 		vec4 diffuseLookup(vec2 texcoord)
 		{
@@ -600,7 +628,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 			text[count++] = strdup(decl.c_str());
 		}
 
-		text[count++] = strdup("varying float vary_texture_index;\n");
+		text[count++] = strdup("VARYING float vary_texture_index;\n");
 		text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n");
 		text[count++] = strdup("{\n");
 		
@@ -716,6 +744,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 
 					if (i % 128 == 0)
 					{ //dump every 128 lines
+
 						LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
 						ostr = std::stringstream();
 					}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index dca96910f20..bc63d07d726 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
@@ -24,7 +24,7 @@
  */
  
 
-attribute vec4 weight;
+ATTRIBUTE vec4 weight;
 
 uniform vec4 matrixPalette[45];
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index c98b99b15ac..cf939e2df8e 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -25,9 +25,13 @@
 
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -35,7 +39,7 @@ void calcAtmospherics(vec3 inPositionEye);
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 				
 	vec4 pos;
 	vec3 norm;
@@ -55,12 +59,12 @@ void main()
 		
 	gl_Position = projection_matrix * pos;
 	
-	gl_FogFragCoord = length(pos.xyz);
+	fog_depth = length(pos.xyz);
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
-	gl_FrontColor = color; 
+	vertex_color = color; 
 
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
index 9a19fb928bd..82db15c3aeb 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
@@ -28,10 +28,13 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -41,7 +44,7 @@ void main()
 	//transform vertex
 	vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz;
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	
 	vec3 norm = normalize(normal_matrix * normal);
@@ -50,7 +53,7 @@ void main()
 
 	vec4 specular = vec4(1.0);
 	vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));	
-	gl_FrontColor = color;
+	vertex_color = color;
 
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 6fef303723a..43ed41a2050 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -24,7 +24,7 @@
 
 
 
-attribute vec4 weight4;  
+ATTRIBUTE vec4 weight4;  
 
 uniform mat4 matrixPalette[32];
 
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
index 374808c0911..a64f6ea55ce 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
@@ -23,11 +23,12 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
 void main() 
 {
-	gl_FragColor = vec4(gl_Color.rgb, texture2D(diffuseMap, gl_TexCoord[0].xy).a);
+	gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
index 21a9e91bf51..78b5328c9a3 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
@@ -25,9 +25,12 @@
 
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 mat4 getSkinnedTransform();
 
@@ -41,7 +44,7 @@ void main()
 	pos.z = dot(trans[2], pos_in);
 	pos.w = 1.0;
 			
-	gl_FrontColor = diffuse_color;
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vertex_color = diffuse_color;
+	vary_texcoord0 = texcoord0;
 	gl_Position = projection_matrix * pos;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 19de0c0b39f..23142a3516d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -38,11 +38,14 @@ uniform vec2 screen_res;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform mat4 inv_proj;
 
@@ -66,9 +69,9 @@ void main()
 	
 	vec4 pos = vec4(vary_position, 1.0);
 	
-	vec4 diff= diffuseLookup(gl_TexCoord[0].xy);
+	vec4 diff= diffuseLookup(vary_texcoord0.xy);
 
-	vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a);
+	vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a);
 	vec4 color = diff * col;
 	
 	color.rgb = atmosLighting(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index d4f56896cfa..332bc9c262e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -38,11 +38,13 @@ uniform vec2 screen_res;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
+VARYING vec4 vertex_color;
 
 uniform mat4 inv_proj;
 
@@ -66,9 +68,9 @@ void main()
 	
 	vec4 pos = vec4(vary_position, 1.0);
 	
-	vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy);
+	vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy);
 
-	vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a);
+	vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a);
 	vec4 color = diff * col;
 	
 	color.rgb = atmosLighting(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index 5d1306bfc92..e8a2318f397 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -1,7 +1,25 @@
 /** 
  * @file alphaNonIndexedNoColorF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
@@ -19,11 +37,12 @@ uniform vec2 screen_res;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
 
 uniform mat4 inv_proj;
 
@@ -47,7 +66,7 @@ void main()
 	
 	vec4 pos = vec4(vary_position, 1.0);
 	
-	vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy);
+	vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy);
 
 	vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0);
 	vec4 color = diff * col;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 9d2c009d2af..e5899872db2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -25,10 +25,10 @@
 uniform mat4 projection_matrix;
 uniform mat4 modelview_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getObjectSkinnedTransform();
@@ -41,12 +41,15 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying vec3 vary_position;
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_normal;
-varying vec3 vary_fragcoord;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_position;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_normal;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_pointlight_col;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 uniform float near_clip;
 
@@ -87,7 +90,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 				
 	vec4 pos;
 	vec3 norm;
@@ -130,9 +133,9 @@ void main()
 	
 	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
-	gl_FrontColor = col;
+	vertex_color = col;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 	
 	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 490ac7c0676..9920caf7f66 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -28,10 +28,10 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -43,13 +43,16 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_light;
-varying vec3 vary_pointlight_col;
-varying float vary_texture_index;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_light;
+VARYING vec3 vary_pointlight_col;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -98,7 +101,7 @@ void main()
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vec3 norm = normalize(normal_matrix * normal);
 	
@@ -132,9 +135,9 @@ void main()
 	
 	col.rgb = col.rgb*diffuse_color.rgb;
 	
-	gl_FrontColor = col;
+	vertex_color = col;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 	
 	pos = modelview_projection_matrix * vert;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index 0c930848e58..40fa59b6375 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -26,10 +26,12 @@
 
 uniform sampler2D diffuseMap;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	//gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a);
+	//gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
 	gl_FragColor = vec4(1,1,1,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index fc055e555d2..533babf3dc2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -26,23 +26,26 @@ uniform mat4 projection_matrix;
 uniform mat4 modelview_matrix;
 uniform mat4 texture_matrix0;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 mat4 getObjectSkinnedTransform();
 
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 	
 	vec4 p = projection_matrix * vec4(pos, 1.0);
 	p.z = max(p.z, -p.w+0.01);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 16f2b889f8a..12e88ca5dd6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -41,11 +41,14 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying vec3 vary_position;
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_position;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_pointlight_col;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 uniform float near_clip;
 
@@ -86,7 +89,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 				
 	vec4 pos;
 	vec3 norm;
@@ -132,9 +135,9 @@ void main()
 	
 	col.rgb = min(col.rgb, 1.0);
 	
-	gl_FrontColor = col;
+	vertex_color = col;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 	
 	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index d5c20a22d93..01ffb862f70 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -27,20 +27,22 @@ uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vary_normal = normalize(normal_matrix * normal);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index a006b81ef76..b1fc9da8557 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -27,11 +27,12 @@
 
 uniform sampler2D diffuseMap;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	vec4 diff = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 diff = texture2D(diffuseMap, vary_texcoord0.xy);
 	
 	if (diff.a < 0.2)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index ba3cc82b399..c9386062c6a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -27,7 +27,7 @@
 
 uniform sampler2D diffuseMap;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index 6835b9c0214..525acbe4ea9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -27,15 +27,16 @@ uniform mat4 projection_matrix;
 
 mat4 getSkinnedTransform();
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 				
 	vec4 pos;
 	vec3 norm;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 704845d310a..1bd8fee7c97 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -25,19 +25,20 @@
  
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
 mat4 getSkinnedTransform();
 
-attribute vec4 weight;
+ATTRIBUTE vec4 weight;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 				
 	vec4 pos;
 	vec3 norm;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 3609cc054b9..e0a25b505a3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -37,7 +37,7 @@ uniform vec2 delta;
 uniform vec3 kern[4];
 uniform float kern_scale;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 5339e380181..212f7e56adf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
index 429a891f073..379420a8a00 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -28,22 +28,25 @@
 uniform sampler2D diffuseMap;
 uniform sampler2D bumpMap;
 
-varying vec3 vary_mat0;
-varying vec3 vary_mat1;
-varying vec3 vary_mat2;
+VARYING vec3 vary_mat0;
+VARYING vec3 vary_mat1;
+VARYING vec3 vary_mat2;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb;
-	vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0;
+	vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
+	vec3 norm = texture2D(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0;
 
 	vec3 tnorm = vec3(dot(norm,vary_mat0),
 			  dot(norm,vary_mat1),
 			  dot(norm,vary_mat2));
 						
 	gl_FragData[0] = vec4(col, 0.0);
-	gl_FragData[1] = gl_Color.aaaa; // spec
-	//gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
+	gl_FragData[1] = vertex_color.aaaa; // spec
+	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(tnorm);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
index cf93430217e..6c205074b4e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -26,21 +26,23 @@ uniform mat4 projection_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
-attribute vec2 texcoord2;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord2;
 
-varying vec3 vary_mat0;
-varying vec3 vary_mat1;
-varying vec3 vary_mat2;
+VARYING vec3 vary_mat0;
+VARYING vec3 vary_mat1;
+VARYING vec3 vary_mat2;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 mat4 getObjectSkinnedTransform();
 
 void main()
 {
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
@@ -58,5 +60,5 @@ void main()
 	vary_mat2 = vec3(t.z, b.z, n.z);
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index 9ec31383acf..c8d38bb8f74 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -27,21 +27,23 @@ uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
-attribute vec3 binormal;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 binormal;
 
-varying vec3 vary_mat0;
-varying vec3 vary_mat1;
-varying vec3 vary_mat2;
+VARYING vec3 vary_mat0;
+VARYING vec3 vary_mat1;
+VARYING vec3 vary_mat2;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vec3 n = normalize(normal_matrix * normal);
 	vec3 b = normalize(normal_matrix * binormal);
@@ -51,5 +53,5 @@ void main()
 	vary_mat1 = vec3(t.y, b.y, n.y);
 	vary_mat2 = vec3(t.z, b.z, n.z);
 	
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index f4310dae958..127136a12c2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -29,15 +29,20 @@
 // The fragment shader for the sky
 /////////////////////////////////////////////////////////////////////////
 
-varying vec4 vary_CloudColorSun;
-varying vec4 vary_CloudColorAmbient;
-varying float vary_CloudDensity;
+VARYING vec4 vary_CloudColorSun;
+VARYING vec4 vary_CloudColorAmbient;
+VARYING float vary_CloudDensity;
 
 uniform sampler2D cloud_noise_texture;
 uniform vec4 cloud_pos_density1;
 uniform vec4 cloud_pos_density2;
 uniform vec4 gamma;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
+
 /// Soft clips the light with a gamma correction
 vec3 scaleSoftClip(vec3 light) {
 	//soft clip effect:
@@ -50,14 +55,14 @@ vec3 scaleSoftClip(vec3 light) {
 void main()
 {
 	// Set variables
-	vec2 uv1 = gl_TexCoord[0].xy;
-	vec2 uv2 = gl_TexCoord[1].xy;
+	vec2 uv1 = vary_texcoord0.xy;
+	vec2 uv2 = vary_texcoord1.xy;
 
 	vec4 cloudColorSun = vary_CloudColorSun;
 	vec4 cloudColorAmbient = vary_CloudColorAmbient;
 	float cloudDensity = vary_CloudDensity;
-	vec2 uv3 = gl_TexCoord[2].xy;
-	vec2 uv4 = gl_TexCoord[3].xy;
+	vec2 uv3 = vary_texcoord2.xy;
+	vec2 uv4 = vary_texcoord3.xy;
 
 	// Offset texture coords
 	uv1 += cloud_pos_density1.xy;	//large texture, visible density
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 67b5e7fb837..64e094e3c5b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -25,17 +25,22 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
 //////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
 ///////////////////////////////////////////////////////////////////////////////
 
 // Output parameters
-varying vec4 vary_CloudColorSun;
-varying vec4 vary_CloudColorAmbient;
-varying float vary_CloudDensity;
+VARYING vec4 vary_CloudColorSun;
+VARYING vec4 vary_CloudColorAmbient;
+VARYING float vary_CloudDensity;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
 
 // Inputs
 uniform vec3 camPosLocal;
@@ -64,7 +69,7 @@ void main()
 	// World / view / projection
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 
 	// Get relative position
 	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
@@ -163,17 +168,17 @@ void main()
 
 
 	// Texture coords
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_TexCoord[0].xy -= 0.5;
-	gl_TexCoord[0].xy /= cloud_scale.x;
-	gl_TexCoord[0].xy += 0.5;
+	vary_texcoord0 = texcoord0;
+	vary_texcoord0.xy -= 0.5;
+	vary_texcoord0.xy /= cloud_scale.x;
+	vary_texcoord0.xy += 0.5;
 
-	gl_TexCoord[1] = gl_TexCoord[0];
-	gl_TexCoord[1].x += lightnorm.x * 0.0125;
-	gl_TexCoord[1].y += lightnorm.z * 0.0125;
+	vary_texcoord1 = vary_texcoord0;
+	vary_texcoord1.x += lightnorm.x * 0.0125;
+	vary_texcoord1.y += lightnorm.z * 0.0125;
 
-	gl_TexCoord[2] = gl_TexCoord[0] * 16.;
-	gl_TexCoord[3] = gl_TexCoord[1] * 16.;
+	vary_texcoord2 = vary_texcoord0 * 16.;
+	vary_texcoord3 = vary_texcoord1 * 16.;
 
 	// Combine these to minimize register use
 	vary_CloudColorAmbient += oHazeColorBelowCloud;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index e1dc1de0aff..51d67d2790e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -29,11 +29,13 @@ uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
+	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
 	
 	if (col.a < minimum_alpha || col.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index f3ad6f92de5..8868d33705f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -23,14 +23,17 @@
  * $/LicenseInfo$
  */
  
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
 
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	vec4 col = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 col = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
 	if (col.a < minimum_alpha || col.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index dfc1b52c2e7..2f46d43b9d5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -1,7 +1,25 @@
 /** 
  * @file diffuseAlphaMaskNoColorF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
@@ -11,11 +29,12 @@ uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
 	
 	if (col.a < minimum_alpha || col.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index 9c9a8b56c59..aaf89a22ef4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -27,14 +27,16 @@
 
 uniform sampler2D diffuseMap;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb;
+	vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
 	gl_FragData[0] = vec4(col, 0.0);
-	gl_FragData[1] = gl_Color.aaaa; // spec
-	//gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
+	gl_FragData[1] = vertex_color.aaaa; // spec
+	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(vary_normal);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index 4d996a099dc..e08e52c7cfe 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -23,15 +23,17 @@
  * $/LicenseInfo$
  */
  
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	vec3 col = gl_Color.rgb * diffuseLookup(gl_TexCoord[0].xy).rgb;
+	vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
 
 	gl_FragData[0] = vec4(col, 0.0);
-	gl_FragData[1] = gl_Color.aaaa; // spec
-	//gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
+	gl_FragData[1] = vertex_color.aaaa; // spec
+	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(vary_normal);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
index 37864578ecd..7ed41cbcb91 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -27,18 +27,19 @@ uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix; 
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec3 vary_normal;
-varying float vary_texture_index;
+VARYING vec3 vary_normal;
+VARYING float vary_texture_index;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vary_normal = normalize(normal_matrix * normal);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index 880a7ea0a29..a74290bfcd0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -26,18 +26,20 @@ uniform mat4 projection_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 mat4 getObjectSkinnedTransform();
 
 void main()
 {
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
@@ -51,7 +53,7 @@ void main()
 
 	vary_normal = norm.xyz;
 			
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index e158df13f70..36000b86d66 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -27,22 +27,24 @@ uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec3 vary_normal;
-varying float vary_texture_index;
+VARYING vec3 vary_normal;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vary_texture_index = position.w;
 	vary_normal = normalize(normal_matrix * normal);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index 5a9a6196f38..6cf563189a0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -1,7 +1,25 @@
 /** 
  * @file emissiveF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
@@ -12,12 +30,14 @@
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
 	float shadow = 1.0;
 
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
 	
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index fccf8554d21..b3558be6787 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -27,9 +27,9 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute float emissive;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE float emissive;
+ATTRIBUTE vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -38,7 +38,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void main()
 {
@@ -49,11 +52,11 @@ void main()
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	calcAtmospherics(pos.xyz);
 	
-	gl_FrontColor = vec4(0,0,0,emissive);
+	vertex_color = vec4(0,0,0,emissive);
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 6c506676afd..f54827f7208 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -27,6 +27,9 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
 
@@ -35,7 +38,7 @@ void main()
 {
 	float shadow = 1.0;
 
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
 	
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 27591654719..ef9f62da847 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -28,9 +28,9 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 
-attribute vec4 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -39,7 +39,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void main()
 {
@@ -50,11 +53,11 @@ void main()
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	calcAtmospherics(pos.xyz);
 	
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
index bfb7760af82..72c5a930873 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
@@ -38,7 +38,7 @@ uniform sampler2D		depthGIMap;
 uniform sampler2D		lightFunc;
 
 // Inputs
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
index 2766691bd02..e5d3bb8ea61 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
@@ -25,12 +25,12 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
-
-varying vec2 vary_fragcoord;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
 
@@ -44,5 +44,5 @@ void main()
 	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index 7152e13946f..e98f9aef878 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -31,9 +31,11 @@ uniform sampler2D diffuseMap;
 uniform sampler2D normalMap;
 uniform sampler2D specularMap;
 
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
 
 	if (col.a < minimum_alpha || col.a > maximum_alpha)
 	{
@@ -41,6 +43,6 @@ void main()
 	}
 
 	gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
-	gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy);
-	gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0);
+	gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy);
+	gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 645b0d793a7..58e5dc0b569 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -26,15 +26,18 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index 4ba26fb0c6e..4f13167c1c2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -27,7 +27,7 @@
 
 uniform sampler2DRect diffuseMap;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
index dafc55a6ff5..f2dc60aa5d2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
@@ -25,10 +25,11 @@
 
 uniform mat4 modelview_projection_matrix;
  
-attribute vec3 position;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vertex_color;
 
 uniform vec2 screen_res;
 
@@ -40,5 +41,5 @@ void main()
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 42212a978ea..279a2fa78dd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -45,7 +45,7 @@ uniform int light_count;
 uniform vec4 light[MAX_LIGHT_COUNT];
 uniform vec4 light_col[MAX_LIGHT_COUNT];
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform float far_z;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 1d54d7bede0..eefefa640de 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index c42935d8153..dff63607263 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -60,7 +60,7 @@ uniform vec3 color;
 uniform float falloff;
 uniform float size;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 8c34a554c2e..0fc23fecb41 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -43,7 +43,7 @@ uniform vec3 color;
 uniform float falloff;
 uniform float size;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index cab98175834..cb14e6d4e8b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index daef6a938c9..64044590c9c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -2096,8 +2096,8 @@ uniform float magnification;
 
 uniform mat4 inv_proj;
 
-varying vec2 vary_fragcoord;
-varying vec2 vary_tc;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
 
 
 float getDepth(vec2 pos_screen)
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index f67615bdd5b..16b61897d56 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -2083,8 +2083,8 @@ uniform vec2 rcp_screen_res;
 uniform vec4 rcp_frame_opt;
 uniform vec4 rcp_frame_opt2;
 uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
-varying vec2 vary_tc;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
index b519dbc4b06..a1986fca9a6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
@@ -29,7 +29,7 @@ uniform sampler2DRect diffuseRect;
 uniform sampler2D bloomMap;
 
 uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
index 861bb9f7358..84c23c97a02 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
@@ -41,7 +41,7 @@ uniform float magnification;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 float getDepth(vec2 pos_screen)
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index b11f26fbae3..8edf5b2723f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -25,10 +25,10 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
-varying vec2 vary_tc;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
 
 uniform vec2 tc_scale;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index 99257daca4a..a172f49d879 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -38,7 +38,7 @@ uniform int kern_length;
 uniform float kern_scale;
 uniform vec3 blur_quad;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
index 61c63936482..0d5c8e72874 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
@@ -25,10 +25,10 @@
 
 uniform mat4 modelview_projection_matrix;
  
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index 615317febfd..c63a6279710 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -28,11 +28,13 @@ uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a;
+	float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a;
 
 	if (alpha < minimum_alpha || alpha > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index f7bed00214d..6a3cba771bb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -26,11 +26,13 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
@@ -41,6 +43,6 @@ void main()
 	
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_FrontColor = diffuse_color;
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index 541f08d5fe7..ee0ea84e6f3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -25,7 +25,7 @@
  
 
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
index 190cac9e2ce..8b46e81f90c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 59c0a994cdd..26c7165e067 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -29,7 +29,7 @@
 // The fragment shader for the sky
 /////////////////////////////////////////////////////////////////////////
 
-varying vec4 vary_HazeColor;
+VARYING vec4 vary_HazeColor;
 
 uniform sampler2D cloud_noise_texture;
 uniform vec4 gamma;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index e97d3e08287..721de18e0b1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -25,15 +25,16 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
 // SKY ////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
 ///////////////////////////////////////////////////////////////////////////////
 
 // Output parameters
-varying vec4 vary_HazeColor;
+VARYING vec4 vary_HazeColor;
+VARYING vec2 vary_texcoord0;
 
 // Inputs
 uniform vec3 camPosLocal;
@@ -61,7 +62,7 @@ void main()
 
 	// World / view / projection
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 
 	// Get relative position
 	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 8116b7cdbfb..fa1d2cc7a7a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -64,7 +64,7 @@ uniform vec3 env_mat[3];
 uniform mat3 ssao_effect_mat;
 
 uniform vec3 sun_dir;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 vec3 vary_PositionEye;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
index 7d1e99b4aaf..c6031fc45a2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
@@ -25,11 +25,11 @@
  
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 uniform vec2 screen_res;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index e69fa074c4d..20970fc4ba4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -54,7 +54,7 @@ uniform vec3 color;
 uniform float falloff;
 uniform float size;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 4ab59d4d66a..8eb4be71777 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -23,13 +23,14 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
 void main() 
 {
-	vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
 	
 	gl_FragData[0] = col;
 	gl_FragData[1] = vec4(0,0,0,0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index 1fcb05ef2c8..8bc5b063799 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -26,14 +26,17 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_FrontColor = diffuse_color;
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 4a69192fc36..797648202d5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -41,7 +41,7 @@ uniform float ssao_max_radius;
 uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
index 10751304ae2..473d6df8faa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
  
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index c6578ea177c..effa994a48c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -31,20 +31,22 @@ uniform sampler2D detail_2;
 uniform sampler2D detail_3;
 uniform sampler2D alpha_ramp;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
 
 void main()
 {
 	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
 	
-	vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy);
-	vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy);
-	vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy);
-	vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy);
+	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
+	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
+	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
+	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
 
-	float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a;
-	float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a;
-	float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a;
+	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
+	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
+	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
 	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
 	
 	gl_FragData[0] = vec4(outColor.rgb, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index 7f84ef1cff3..5effee4e4ea 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -27,13 +27,19 @@ uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+
+uniform vec4 object_plane_s;
+uniform vec4 object_plane_t;
 
 vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
 {
@@ -57,11 +63,11 @@ void main()
 	vary_normal = normalize(normal_matrix * normal);
 	
 	// Transform and pass tex coords
- 	gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ 	vary_texcoord0.xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;
 	
 	vec4 t = vec4(texcoord1,0,1);
 	
-	gl_TexCoord[0].zw = t.xy;
-	gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
-	gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0);
+	vary_texcoord0.zw = t.xy;
+	vary_texcoord1.xy = t.xy-vec2(2.0, 0.0);
+	vary_texcoord1.zw = t.xy-vec2(1.0, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index a6406bdc12e..b0ef348cd14 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -27,20 +27,22 @@
 
 uniform sampler2D diffuseMap;
 
-varying vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
 
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
 void main() 
 {
-	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
 	if (col.a < minimum_alpha || col.a > maximum_alpha)
 	{
 		discard;
 	}
 
-	gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, 0.0);
+	gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
 	gl_FragData[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 9f0b902c96f..22ebaa9be6c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -1,7 +1,25 @@
 /** 
  * @file treeShadowF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
@@ -10,11 +28,12 @@ uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a;
+	float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a;
 
 	if (alpha < minimum_alpha || alpha > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
index c695d374ac9..e472a753045 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
@@ -26,10 +26,11 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
  
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
@@ -40,5 +41,5 @@ void main()
 	
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index 45bfc0ce09c..3b6571a24a9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -27,19 +27,21 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 uniform mat3 normal_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vary_normal = normalize(normal_matrix * normal);
 
-	gl_FrontColor = vec4(1,1,1,1);
+	vertex_color = vec4(1,1,1,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index c3e7371c8e4..d10548cbefc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -58,10 +58,10 @@ uniform vec2 screen_res;
 uniform mat4 norm_mat; //region space to screen space
 
 //bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
-varying vec4 vary_position;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
+VARYING vec4 vary_position;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
index ac51cb1741b..9734acf005a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
@@ -26,7 +26,7 @@
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 
 void calcAtmospherics(vec3 inPositionEye);
@@ -37,11 +37,11 @@ uniform float time;
 uniform vec3 eyeVec;
 uniform float waterHeight;
 
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
 
-varying vec4 vary_position;
+VARYING vec4 vary_position;
 
 float wave(vec2 v, float t, float f, vec2 d, float s) 
 {
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index c5ca9f48048..a34e76d25aa 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -34,9 +34,11 @@ uniform vec3 lumWeights;
 uniform vec3 warmthWeights;
 uniform float warmthAmount;
 
+VARYING vec2 vary_texcoord0;
+
 void main()
 {
-	vec4 col = texture2DRect(diffuseMap, gl_TexCoord[0].xy);	
+	vec4 col = texture2DRect(diffuseMap, vary_texcoord0.xy);	
 	/// CALCULATING LUMINANCE (Using NTSC lum weights)
 	/// http://en.wikipedia.org/wiki/Luma_%28video%29
 	float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
index c2cc8ed5677..cbf4dc4bea6 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
@@ -35,9 +35,11 @@ uniform vec3 lumWeights;
 uniform vec3 warmthWeights;
 uniform float warmthAmount;
 
+VARYING vec2 vary_texcoord0;
+
 void main()
 {
-	ivec2 itc = ivec2(gl_TexCoord[0].xy);
+	ivec2 itc = ivec2(vary_texcoord0.xy);
 	vec4 fcol = vec4(0,0,0,0);
 
 	for (int i = 0; i < samples; i++)
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index 628489296fa..1396dc69735 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -25,13 +25,14 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
+VARYING vec2 vary_texcoord0;
 
 void main() 
 {
 	gl_Position = modelview_projection_matrix * vec4(position, 1.0);
 	
-	gl_TexCoord[0].xy = texcoord0;
+	vary_texcoord0.xy = texcoord0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 75cff75ea9e..3d17a20fbbe 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -28,6 +28,11 @@
 uniform sampler2D diffuseMap;
 uniform float glowStrength;
 
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+VARYING vec4 vary_texcoord2;
+VARYING vec4 vary_texcoord3;
+
 void main()
 {
 
@@ -38,14 +43,14 @@ void main()
 		kern[0] = 0.25; kern[1] = 0.5; kern[2] = 0.8; kern[3] = 1.0;
 		kern[4] = 1.0;  kern[5] = 0.8; kern[6] = 0.5; kern[7] = 0.25;
 	
-	col += kern[0] * texture2D(diffuseMap, gl_TexCoord[0].xy);	
-	col += kern[1] * texture2D(diffuseMap, gl_TexCoord[1].xy);
-	col += kern[2] * texture2D(diffuseMap, gl_TexCoord[2].xy);	
-	col += kern[3] * texture2D(diffuseMap, gl_TexCoord[3].xy);	
-	col += kern[4] * texture2D(diffuseMap, gl_TexCoord[0].zw);	
-	col += kern[5] * texture2D(diffuseMap, gl_TexCoord[1].zw);	
-	col += kern[6] * texture2D(diffuseMap, gl_TexCoord[2].zw);	
-	col += kern[7] * texture2D(diffuseMap, gl_TexCoord[3].zw);	
+	col += kern[0] * texture2D(diffuseMap, vary_texcoord0.xy);	
+	col += kern[1] * texture2D(diffuseMap, vary_texcoord1.xy);
+	col += kern[2] * texture2D(diffuseMap, vary_texcoord2.xy);	
+	col += kern[3] * texture2D(diffuseMap, vary_texcoord3.xy);	
+	col += kern[4] * texture2D(diffuseMap, vary_texcoord0.zw);	
+	col += kern[5] * texture2D(diffuseMap, vary_texcoord1.zw);	
+	col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw);	
+	col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw);	
 	
 	gl_FragColor = vec4(col.rgb * glowStrength, col.a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index 615ca6a0b4d..cdb2281578e 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -25,21 +25,26 @@
  
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
 uniform vec2 glowDelta;
 
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+VARYING vec4 vary_texcoord2;
+VARYING vec4 vary_texcoord3;
+
 void main() 
 {
 	gl_Position = modelview_projection_matrix * vec4(position, 1.0);
 	
-	gl_TexCoord[0].xy = texcoord0 + glowDelta*(-3.5);
-	gl_TexCoord[1].xy = texcoord0 + glowDelta*(-2.5);
-	gl_TexCoord[2].xy = texcoord0 + glowDelta*(-1.5);
-	gl_TexCoord[3].xy = texcoord0 + glowDelta*(-0.5);
-	gl_TexCoord[0].zw = texcoord0 + glowDelta*(0.5);
-	gl_TexCoord[1].zw = texcoord0 + glowDelta*(1.5);
-	gl_TexCoord[2].zw = texcoord0 + glowDelta*(2.5);
-	gl_TexCoord[3].zw = texcoord0 + glowDelta*(3.5);
+	vary_texcoord0.xy = texcoord0 + glowDelta*(-3.5);
+	vary_texcoord1.xy = texcoord0 + glowDelta*(-2.5);
+	vary_texcoord2.xy = texcoord0 + glowDelta*(-1.5);
+	vary_texcoord3.xy = texcoord0 + glowDelta*(-0.5);
+	vary_texcoord0.zw = texcoord0 + glowDelta*(0.5);
+	vary_texcoord1.zw = texcoord0 + glowDelta*(1.5);
+	vary_texcoord2.zw = texcoord0 + glowDelta*(2.5);
+	vary_texcoord3.zw = texcoord0 + glowDelta*(3.5);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index c61d5a2a086..5d72390d2db 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -29,13 +29,18 @@ uniform sampler2D detail0;
 uniform sampler2D detail1;
 uniform sampler2D alphaRamp;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
+
 void main() 
 {
-	float a = texture2D(alphaRamp, gl_TexCoord[1].xy).a;
-	vec3 color = mix(texture2D(detail1, gl_TexCoord[2].xy).rgb,
-					 texture2D(detail0, gl_TexCoord[0].xy).rgb,
+	float a = texture2D(alphaRamp, vary_texcoord1.xy).a;
+	vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb,
+					 texture2D(detail0, vary_texcoord0.xy).rgb,
 					 a);
 
 	gl_FragColor.rgb = color;
-	gl_FragColor.a = texture2D(alphaRamp, gl_TexCoord[3].xy).a;
+	gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).a;
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index 04b3033dd83..d4a62db6841 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -31,14 +31,22 @@ uniform mat4 texture_matrix3;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
-attribute vec2 texcoord2;
-attribute vec2 texcoord3;
+uniform vec4 object_plane_t;
+uniform vec4 object_plane_s;
 
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+ATTRIBUTE vec2 texcoord2;
+ATTRIBUTE vec2 texcoord3;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 
@@ -61,15 +69,15 @@ void main()
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 			
-	vec4 pos = modelview_matrix * position;
+	vec4 pos = modelview_matrix * vec4(position, 1.0);
 	vec3 norm = normalize(normal_matrix * normal);
 	
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color);
 	
-	gl_FrontColor = color;
+	vertex_color = color;
 	
-	gl_TexCoord[0] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
-	gl_TexCoord[1] = texture_matrix1*vec4(texcoord1,0,1);
-	gl_TexCoord[2] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
-	gl_TexCoord[3] = texture_matrix3*vec4(texcoord3,0,1);
+	vary_texcoord0 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,object_plane_s,object_plane_t).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(texcoord1,0,1)).xy;
+	vary_texcoord2 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,object_plane_s,object_plane_t).xy;
+	vary_texcoord3 = (texture_matrix3*vec4(texcoord3,0,1)).xy;
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index 711b42b95ed..307b87e086f 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -31,13 +31,18 @@ uniform sampler2D detail0;
 uniform sampler2D detail1;
 uniform sampler2D alphaRamp;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
+
 void main() 
 {
-	float a = texture2D(alphaRamp, gl_TexCoord[1].xy).a;
-	vec3 color = mix(texture2D(detail1, gl_TexCoord[2].xy).rgb,
-					 texture2D(detail0, gl_TexCoord[0].xy).rgb,
+	float a = texture2D(alphaRamp, vary_texcoord1.xy).a;
+	vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb,
+					 texture2D(detail0, vary_texcoord0.xy).rgb,
 					 a);
 
 	gl_FragColor.rgb = color;
-	gl_FragColor.a = texture2D(alphaRamp, gl_TexCoord[3].xy).a;
+	gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).a;
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 72e8e739b39..48eea0bdda2 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -33,9 +33,9 @@ uniform float refScale;
 uniform vec4 waterFogColor;
 
 //bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 4d555b566ab..1bb04ceb348 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -50,9 +50,9 @@ uniform float blurMultiplier;
 uniform vec4 fogCol;
 
 //bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index d44690d1fb4..e4db326bede 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -24,15 +24,16 @@
  */
  
 
+VARYING float fog_depth;
 
 vec4 applyWaterFog(vec4 color)
 {
 	// GL_EXP2 Fog
-	//float fog = exp(-gl_Fog.density * gl_Fog.density * gl_FogFragCoord * gl_FogFragCoord);
+	//float fog = exp(-gl_Fog.density * gl_Fog.density * fog_depth * fog_depth);
 	// GL_EXP Fog
-	// float fog = exp(-gl_Fog.density * gl_FogFragCoord);
+	// float fog = exp(-gl_Fog.density * fog_depth);
 	// GL_LINEAR Fog
-	float fog = (gl_Fog.end - gl_FogFragCoord) * gl_Fog.scale;
+	float fog = (gl_Fog.end - fog_depth) * gl_Fog.scale;
 	fog = clamp(fog, 0.0, 1.0);
 	color.rgb = mix(gl_Fog.color.rgb, color.rgb, fog);
 	return color;
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index 99433ada7bd..f66ba1d2d94 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -26,7 +26,7 @@
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -36,9 +36,9 @@ uniform float time;
 uniform vec3 eyeVec;
 uniform float waterHeight;
 
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
 
 float wave(vec2 v, float t, float f, vec2 d, float s) 
 {
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
index 27c63fdc8b9..66f3e1ae11b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
@@ -27,9 +27,12 @@ uniform sampler2D diffuseMap;
 
 uniform float custom_alpha;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
 	color.a *= custom_alpha;
 	gl_FragColor = color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
index 5bbc7deff03..890474d6d8c 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
@@ -25,15 +25,17 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_FrontColor = diffuse_color;
+	vary_texcoord0 = texcoord0;
+	vertex_color = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
index cd3d090e52a..f4d704577ad 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
@@ -25,7 +25,7 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index b8963e1decb..caff5fc324a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -28,8 +28,11 @@
 uniform sampler2D glowMap;
 uniform sampler2DRect screenMap;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
 void main() 
 {
-	gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) +
-					texture2DRect(screenMap, gl_TexCoord[1].xy);
+	gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) +
+					texture2DRect(screenMap, vary_texcoord1.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index 6639f88047d..3e972f0cb49 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -1,7 +1,25 @@
 /** 
  * @file glowcombineFXAAF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
@@ -11,7 +29,7 @@ uniform sampler2D glowMap;
 uniform sampler2DRect screenMap;
 
 uniform vec2 screen_res;
-varying vec2 vary_tc;
+VARYING vec2 vary_tc;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
index bd5dd6046b0..058f3b1b820 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_tc;
+VARYING vec2 vary_tc;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
index 94edbe5ab14..f7970b7f78b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
@@ -25,14 +25,17 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_TexCoord[1] = vec4(texcoord1,0,1);
+	vary_texcoord0 = texcoord0;
+	vary_texcoord1 = texcoord1;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 3a48205101c..1d37b97bf16 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -27,7 +27,9 @@
 uniform vec4 color;
 uniform sampler2D diffuseMap;
 
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	gl_FragColor = color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
index 6bb5affd931..9bf7b60eb76 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
@@ -26,13 +26,15 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
index 43dcd5dbe26..c26fa08ddc6 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
@@ -25,7 +25,7 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
index a5442c9bf42..d8601063053 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -1,13 +1,33 @@
 /** 
  * @file onetexturenocolorF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
 uniform sampler2D tex0;
 
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy);
+	gl_FragColor = texture2D(tex0, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
index 615412c7a2e..6b9986c8d7f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
@@ -25,13 +25,14 @@
  
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position, 1);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index b1d2b949acc..a25c9a08fbe 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -25,9 +25,12 @@
  
 uniform sampler2D tex0;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a;
+	float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a;
 
-	gl_FragColor = vec4(gl_Color.rgb, alpha);
+	gl_FragColor = vec4(vertex_color.rgb, alpha);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
index 45e6a9febce..c58f9dfdaf8 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
@@ -25,14 +25,17 @@
 
 uniform mat4 modelview_projection_matrix;
  
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_FrontColor = diffuse_color;
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vertex_color = diffuse_color;
+	vary_texcoord0 = texcoord0;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
index c263f4dc6a9..9a295ce9f2a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -27,7 +27,10 @@
 
 uniform sampler2DRect screenMap;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void main() 
 {
-	gl_FragColor = 	texture2DRect(screenMap, gl_TexCoord[0].xy) * gl_Color;
+	gl_FragColor = 	texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
index 2b471d99e82..641d670c267 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
@@ -25,14 +25,17 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec4 diffuse_color;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_FrontColor = diffuse_color;
+	vary_texcoord0 = texcoord0;
+	vertex_color = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
index 3408cc44f8e..3ded949943e 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
@@ -26,7 +26,10 @@
 uniform sampler2D tex0;
 uniform sampler2D tex1;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
 void main() 
 {
-	gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy);
+	gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
index 2a36feaa211..3c2f297f7f5 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
@@ -25,14 +25,17 @@
  
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_TexCoord[1] = vec4(texcoord1,0,1);
+	vary_texcoord0 = texcoord0;
+	vary_texcoord1 = texcoord1;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 7694056b08f..2602e489c8b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -25,7 +25,10 @@
  
 uniform sampler2D diffuseMap;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec4 vertex_color;
+
 void main() 
 {
-	gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
index a9e42a432f0..220dafef25d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -26,15 +26,17 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	gl_Position = modelview_projection_matrix * vec4(position, 1);
-	gl_TexCoord[0] =  texture_matrix0 * vec4(texcoord0,0,1);
-	gl_FrontColor = diffuse_color;
+	vary_texcoord0 =  (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vertex_color = diffuse_color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 5cb3eb05a7c..0a687d7a33c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -23,13 +23,14 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
 void default_lighting() 
 {
-	vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index f3ba8b73a80..7ba6e9dec90 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -28,8 +28,10 @@
 
 uniform sampler2D diffuseMap;
 
+VARYING vec2 vary_texcoord0;
+
 void fullbright_lighting()
 {
-	gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index b4c8a9abced..00c08d59ef4 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -29,7 +29,9 @@
 uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
+VARYING vec2 vary_texcoord0;
+
 void fullbright_shiny_lighting() 
 {
-	gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index 925d6fbcfd8..2140b2f6128 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -28,7 +28,9 @@
 uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
+VARYING vec2 vary_texcoord0;
+
 void fullbright_shiny_lighting_water() 
 {
-	gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index 71238f7d316..ab6b561f08d 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -28,8 +28,10 @@
 
 uniform sampler2D diffuseMap;
 
+VARYING vec2 vary_texcoord0;
+
 void fullbright_lighting_water()
 {
-	gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index 7c9b7c218f9..183582e41f9 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -24,14 +24,15 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
 void shiny_lighting() 
 {
-	vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index ca1af8fc795..9c9f7ca658a 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -24,14 +24,15 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
 void shiny_lighting_water() 
 {
-	vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index da76a977b64..1a041c26ca6 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -23,13 +23,14 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
 void default_lighting_water() 
 {
-	vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index 11031a88298..53c0e77b48c 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -26,10 +26,13 @@
 uniform sampler2D texture0;
 uniform sampler2D texture1;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
 void main() 
 {
-	float tex0 = texture2D(texture0, gl_TexCoord[0].xy).a;
-	float tex1 = texture2D(texture1, gl_TexCoord[1].xy).a;
+	float tex0 = texture2D(texture0, vary_texcoord0.xy).a;
+	float tex1 = texture2D(texture1, vary_texcoord1.xy).a;
 
 	gl_FragColor = vec4(tex0+(1.0-tex1)-0.5);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index dccc6925930..09ec6ff7925 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -27,14 +27,17 @@ uniform mat4 texture_matrix0;
 uniform mat4 texture_matrix1;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = texture_matrix1 * vec4(texcoord1,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1 * vec4(texcoord1,0,1)).xy;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
index e2a00e84407..bf4c45f18f8 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -27,9 +27,13 @@ uniform mat4 projection_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 
-attribute vec3 position;
-attribute float emissive;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float emissive;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
@@ -37,7 +41,7 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
@@ -46,9 +50,9 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = vec4(0,0,0,emissive);
+	vertex_color = vec4(0,0,0,emissive);
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
index dedf00f3743..0e05beac678 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -27,25 +27,29 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute float emissive;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE float emissive;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING float fog_depth;
 
 void main()
 {
 	//transform vertex
 	vary_texture_index = position.w;
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = vec4(0,0,0,emissive);
+	vertex_color = vec4(0,0,0,emissive);
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
index b9c1078c309..f73760bfd4e 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
@@ -27,9 +27,13 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -39,11 +43,11 @@ void main()
 	vec4 vert = vec4(position.xyz,1.0);
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = vec4(1,1,1,1);
+	vertex_color = vec4(1,1,1,1);
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index 546b7cad4af..69cd858b4d3 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -27,10 +27,15 @@ uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+VARYING float fog_depth;
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
@@ -49,14 +54,14 @@ void main()
 		
 	vec3 ref = reflect(pos.xyz, -norm.xyz);
 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 	
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index a9b086e215e..a8e640018da 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -29,10 +29,15 @@ uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+VARYING float fog_depth;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -46,13 +51,13 @@ void main()
 	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index f0722a1e4d8..4de24fd46b0 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -26,17 +26,21 @@ uniform mat4 projection_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
+
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
@@ -45,9 +49,9 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index d8f223d403f..7286e5e2f45 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -27,9 +27,13 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -38,13 +42,13 @@ void main()
 	//transform vertex
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index d09db8e6a34..e5bf5bf2d30 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -28,9 +28,11 @@ uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
+VARYING vec2 vary_texcoord0;
+
 void main()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy);
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
 	
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
index 69007610c6e..e90dbb115a4 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
@@ -27,12 +27,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec2 vary_texcoord0;
 
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
index 3771c2e795d..282686a9b07 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -28,9 +28,13 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -40,14 +44,14 @@ void main()
 	//transform vertex
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 		
 	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
index 7e5c8ca2d59..591d6fc5c94 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
@@ -27,10 +27,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -50,13 +54,13 @@ void main()
 		
 	vec3 ref = reflect(pos.xyz, -norm.xyz);
 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index da47f8a58aa..86a78b190c1 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -28,10 +28,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec3 vary_texcoord0;
+VARYING float fog_depth;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -47,12 +51,12 @@ void main()
 
 	calcAtmospherics(pos.xyz);
 	
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 	
 	vec3 ref = reflect(pos.xyz, -norm);
 	
-	gl_TexCoord[0] = texture_matrix0*vec4(ref,1.0);
+	vary_texcoord0 = (texture_matrix0*vec4(ref,1.0)).xyz;
 	
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index d1d8126cb46..45a493e4f2d 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -28,9 +28,13 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -40,14 +44,14 @@ void main()
 	//transform vertex
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 		
 	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index bf083a55c47..aea0e25e60e 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -26,10 +26,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -38,7 +42,7 @@ mat4 getObjectSkinnedTransform();
 void main()
 {
 	//transform vertex
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
@@ -53,9 +57,9 @@ void main()
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 	
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index 87ece3972ee..4b6b2197516 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -28,10 +28,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -41,14 +45,14 @@ void main()
 	//transform vertex
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 		
 	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
index 64ca63731b1..250d99a9c76 100644
--- a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
@@ -28,20 +28,24 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
+
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
 	
 	gl_Position = modelview_projection_matrix*vert;
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
 	
 	vec4 pos = (modelview_matrix * vert);
 	
@@ -50,7 +54,7 @@ void main()
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
index dbacf286371..2e413601508 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
@@ -25,7 +25,7 @@
  
 
 
-varying vec3 vary_PositionEye;
+VARYING vec3 vary_PositionEye;
 
 vec3 getPositionEye()
 {
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
index e051ac9851e..42f8646f2d0 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
@@ -25,7 +25,7 @@
  
 
 
-varying vec3 vary_PositionEye;
+VARYING vec3 vary_PositionEye;
 
 
 vec3 getPositionEye()
diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
index 43e19909d4e..04d3e2aa1f9 100644
--- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
@@ -28,10 +28,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -41,7 +45,7 @@ void main()
 	//transform vertex
 	vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz;
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 		
 	vec3 norm = normalize(normal_matrix * normal);
 
@@ -51,8 +55,8 @@ void main()
 	vec4 specular = vec4(1.0);
 	vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));
 			
-	gl_FrontColor = color;
-	gl_FogFragCoord = pos.z;
+	vertex_color = color;
+	fog_depth = pos.z;
 
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 839606cdcb8..4fffb9e97fe 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -27,6 +27,9 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 uniform sampler2DRectShadow shadowMap0;
 uniform sampler2DRectShadow shadowMap1;
 uniform sampler2DRectShadow shadowMap2;
@@ -41,11 +44,11 @@ uniform vec2 shadow_res;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
 
 uniform float shadow_bias;
 
@@ -122,9 +125,9 @@ void main()
 		}
 	}
 	
-	vec4 diff = diffuseLookup(gl_TexCoord[0].xy);
+	vec4 diff = diffuseLookup(vary_texcoord0.xy);
 
-	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a);
+	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
 	vec4 color = diff * col;
 	
 	color.rgb = atmosLighting(color.rgb);
@@ -133,7 +136,7 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	//gl_FragColor = gl_Color;
+	//gl_FragColor = vertex_color;
 	gl_FragColor = color;
 	//gl_FragColor.r = 0.0;
 	//gl_FragColor = vec4(1,shadow,1,1);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index 84e49a5f8f1..30aa82473ad 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -42,11 +42,13 @@ uniform vec2 shadow_res;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
+VARYING vec4 vertex_color;
 
 uniform float shadow_bias;
 
@@ -123,9 +125,9 @@ void main()
 		}
 	}
 	
-	vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy);
+	vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
 
-	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a);
+	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
 	vec4 color = diff * col;
 	
 	color.rgb = atmosLighting(color.rgb);
@@ -134,7 +136,7 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	//gl_FragColor = gl_Color;
+	//gl_FragColor = vertex_color;
 	gl_FragColor = color;
 	//gl_FragColor.r = 0.0;
 	//gl_FragColor = vec4(1,shadow,1,1);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 294a000ab5d..9370b484b84 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -1,7 +1,25 @@
 /** 
  * @file alphaNonIndexedNoColorF.glsl
  *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
  
@@ -24,11 +42,12 @@ uniform vec2 shadow_res;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
 
 uniform float shadow_bias;
 
@@ -105,7 +124,7 @@ void main()
 		}
 	}
 	
-	vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy);
+	vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
 
 	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0);
 	vec4 color = diff * col;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index c3148d5fdf0..ad353eb6247 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -27,10 +27,10 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
  
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -42,11 +42,15 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -89,7 +93,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	mat4 mat = getObjectSkinnedTransform();
 	
@@ -134,9 +138,9 @@ void main()
 	
 	col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
 	
-	gl_FrontColor = col;
+	vertex_color = col;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 	
 	pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 8d55616e67c..268e4127a28 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -28,10 +28,10 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -43,12 +43,15 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
-varying float vary_texture_index;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -97,7 +100,7 @@ void main()
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 		
 	vec3 norm = normalize(normal_matrix * normal);
 	
@@ -130,9 +133,9 @@ void main()
 	
 	col.rgb = col.rgb*diffuse_color.rgb;
 	
-	gl_FrontColor = col;
+	vertex_color = col;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 	
 	pos = modelview_projection_matrix * vert;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 0273f3c1210..091a8651609 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -25,9 +25,9 @@
  
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -41,11 +41,14 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-varying vec3 vary_position;
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_position;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_pointlight_col;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -88,7 +91,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 				
 	vec4 pos;
 	vec3 norm;
@@ -134,9 +137,9 @@ void main()
 	
 	col.rgb = min(col.rgb, 1.0);
 	
-	gl_FrontColor = col;
+	vertex_color = col;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
index d9eafb6ebad..4fc6c00caf0 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
@@ -30,7 +30,7 @@
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform float depth_cutoff;
 uniform float norm_cutoff;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
index a84fdd5dc13..11a7cf846d8 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
@@ -31,7 +31,7 @@
 uniform sampler2DMS depthMap;
 uniform sampler2DMS normalMap;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform float depth_cutoff;
 uniform float norm_cutoff;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
index 1f5470db3c3..69c6acc07a2 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
@@ -25,9 +25,9 @@
  
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 4c92d72f441..d1f2db61886 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -59,7 +59,7 @@ uniform float size;
 uniform vec3 color;
 uniform float falloff;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
index 1afa9a9fb40..74f78cfc06c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
@@ -28,6 +28,8 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+VARYING vec4 vertex_color;
+
 uniform sampler2DMS diffuseRect;
 uniform sampler2DMS specularRect;
 uniform sampler2DMS depthMap;
@@ -54,9 +56,9 @@ uniform float sun_wash;
 uniform int proj_shadow_idx;
 uniform float shadow_fade;
 
-varying vec4 vary_light;
+VARYING vec4 vary_light;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
@@ -160,7 +162,7 @@ void main()
 			{
 				proj_tc.xyz /= proj_tc.w;
 	
-				float fa = gl_Color.a+1.0;
+				float fa = vertex_color.a+1.0;
 				float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
 				if (dist_atten > 0.0)
 				{
@@ -189,7 +191,7 @@ void main()
 			
 							vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
 		
-							vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+							vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
 			
 							lit = da * dist_atten * noise;
 			
@@ -206,7 +208,7 @@ void main()
 			
 						amb_da = min(amb_da, 1.0-lit);
 			
-						col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+						col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
 					}
 	
 	
@@ -239,7 +241,7 @@ void main()
 									stc.y > 0.0)
 								{
 									vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-									col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+									col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
 								}
 							}
 						}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 22f52032a58..e9f1a3d3a5d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -67,7 +67,7 @@ uniform vec2 screen_res;
 
 uniform vec3 sun_dir;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 vec3 vary_PositionEye;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index 12442944514..6b979b13ed5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -66,8 +66,8 @@ uniform mat3 ssao_effect_mat;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
-varying vec4 vary_light;
-varying vec2 vary_fragcoord;
+VARYING vec4 vary_light;
+VARYING vec2 vary_fragcoord;
 
 vec3 vary_PositionEye;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index 424299269fd..c840d727843 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
@@ -25,11 +25,11 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 uniform vec2 screen_res;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 void main()
 {
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 25270f49392..19a1d1f1656 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -27,6 +27,8 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
+VARYING vec4 vertex_color;
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect depthMap;
@@ -53,9 +55,9 @@ uniform float sun_wash;
 uniform int proj_shadow_idx;
 uniform float shadow_fade;
 
-varying vec4 vary_light;
+VARYING vec4 vary_light;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
@@ -114,7 +116,7 @@ void main()
 	
 	proj_tc.xyz /= proj_tc.w;
 	
-	float fa = gl_Color.a+1.0;
+	float fa = vertex_color.a+1.0;
 	float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 	
 	lv = proj_origin-pos.xyz;
@@ -140,7 +142,7 @@ void main()
 			
 			vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod);
 		
-			vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+			vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
 			
 			lit = da * dist_atten * noise;
 			
@@ -163,7 +165,7 @@ void main()
 		
 		amb_da = min(amb_da, 1.0-lit);
 		
-		col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+		col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
 	}
 	
 	
@@ -192,7 +194,7 @@ void main()
 					stc.y > 0.0)
 				{
 					vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-					col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+					col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
 				}
 			}
 		}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
index 4962e73e390..85fea56411d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
@@ -28,6 +28,8 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+VARYING vec4 vertex_color;
+
 uniform sampler2DMS diffuseRect;
 uniform sampler2DMS specularRect;
 uniform sampler2DMS depthMap;
@@ -54,9 +56,9 @@ uniform float sun_wash;
 uniform int proj_shadow_idx;
 uniform float shadow_fade;
 
-varying vec4 vary_light;
+VARYING vec4 vary_light;
 
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
 uniform vec2 screen_res;
 
 uniform mat4 inv_proj;
@@ -161,7 +163,7 @@ void main()
 			{
 				proj_tc.xyz /= proj_tc.w;
 	
-				float fa = gl_Color.a+1.0;
+				float fa = vertex_color.a+1.0;
 				float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
 				if (dist_atten > 0.0)
 				{
@@ -190,7 +192,7 @@ void main()
 			
 							vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
 		
-							vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+							vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
 			
 							lit = da * dist_atten * noise;
 			
@@ -207,7 +209,7 @@ void main()
 			
 						amb_da = min(amb_da, 1.0-lit);
 			
-						col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+						col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
 					}
 	
 	
@@ -240,7 +242,7 @@ void main()
 									stc.y > 0.0)
 								{
 									vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-									col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+									col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
 								}
 							}
 						}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 146fac56e9e..bb742adb629 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -47,7 +47,7 @@ uniform float ssao_max_radius;
 uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
@@ -97,15 +97,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	
-	float cs = shadow2D(shadowMap, stc.xyz).x;
+	float cs = shadow2D(shadowMap, stc.xyz);
 	float shadow = cs;
 
 	vec2 off = 1.5/proj_shadow_res;
 	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
 				
 	return shadow/5.0;
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
index ac4fe526559..4933eb00b77 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
@@ -48,8 +48,8 @@ uniform float ssao_max_radius;
 uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
-varying vec2 vary_fragcoord;
-varying vec4 vary_light;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vary_light;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
@@ -98,15 +98,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	
-	float cs = shadow2D(shadowMap, stc.xyz).x;
+	float cs = shadow2D(shadowMap, stc.xyz);
 	float shadow = cs;
 
 	vec2 off = 1.5/proj_shadow_res;
 	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
 				
 	return shadow/5.0;
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 60741771d6b..042bb5f96c1 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -46,7 +46,7 @@ uniform float ssao_max_radius;
 uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec3 sun_dir;
 
 uniform mat4 inv_proj;
@@ -148,15 +148,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	
-	float cs = shadow2D(shadowMap, stc.xyz).x;
+	float cs = shadow2D(shadowMap, stc.xyz);
 	float shadow = cs;
 
 	vec2 off = 1.5/proj_shadow_res;
 	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
 	
 			
 	return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
index 0fd7b7525dc..e138ae58418 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
@@ -47,8 +47,8 @@ uniform float ssao_max_radius;
 uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
-varying vec2 vary_fragcoord;
-varying vec4 vary_light;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vary_light;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
@@ -149,15 +149,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	
-	float cs = shadow2D(shadowMap, stc.xyz).x;
+	float cs = shadow2D(shadowMap, stc.xyz);
 	float shadow = cs;
 
 	vec2 off = 1.5/proj_shadow_res;
 	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
 	
 			
 	return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 60ba2d7ad4d..bc5eb5181d0 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
 
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl
index 35411db04b3..01fe4a4e14d 100644
--- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl
@@ -23,29 +23,5 @@
  * $/LicenseInfo$
  */
  
+//NOT USED!!!
 
-
-uniform sampler2DRect RenderTexture;
-uniform float bloomStrength;
-
-varying vec4 gl_TexCoord[gl_MaxTextureCoords];
-void main(void) 
-{
-	float blurWeights[7];
-	blurWeights[0] = 0.05;
-	blurWeights[1] = 0.1;
-	blurWeights[2] = 0.2;
-	blurWeights[3] = 0.3;
-	blurWeights[4] = 0.2;
-	blurWeights[5] = 0.1;
-	blurWeights[6] = 0.05;
-	
-	vec3 color = vec3(0,0,0);
-	for (int i = 0; i < 7; i++){
-		color += vec3(texture2DRect(RenderTexture, gl_TexCoord[i].st)) * blurWeights[i];
-	}
-
-	color *= bloomStrength;
-
-	gl_FragColor = vec4(color, 1.0);
-}
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
index 4fd4b101ff7..b92e9b3f030 100644
--- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
@@ -23,36 +23,5 @@
  * $/LicenseInfo$
  */
 
-uniform mat4 modelview_projection_matrix;
+ // NOT USED!!
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-
-uniform vec2 texelSize;
-uniform vec2 blurDirection;
-uniform float blurWidth;
-
-void main(void)
-{
-	// Transform vertex
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	
-	vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth);
-	vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0);
-	
-	// for (int i = 0; i < 7; i++) {
-		// gl_TexCoord[i].st = s + (i * blurDelta);
-	// }
-
-	// MANUALLY UNROLL
-	gl_TexCoord[0].st = s;
-	gl_TexCoord[1].st = s + blurDelta;
-	gl_TexCoord[2].st = s + (2. * blurDelta);
-	gl_TexCoord[3].st = s + (3. * blurDelta);
-	gl_TexCoord[4].st = s + (4. * blurDelta);
-	gl_TexCoord[5].st = s + (5. * blurDelta);
-	gl_TexCoord[6].st = s + (6. * blurDelta);
-
-	// gl_TexCoord[0].st = s;
-	// gl_TexCoord[1].st = blurDelta;
-}
diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
index 42ab8d40e88..8d673237b84 100644
--- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
@@ -36,7 +36,7 @@ const float gamma = 2.0;
 
 void main(void) 
 {
-	vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st));
+	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
 
 	/// Modulate brightness
 	color *= brightness;
diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
index d3c93ab05f1..f03a6076c08 100644
--- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
@@ -25,15 +25,15 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
 
 
 void main(void)
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_TexCoord[1] = vec4(texcoord1,0,1);
+	vary_texcoord0 = texcoord0;
+	vary_texcoord1 = texcoord1;
 }
diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
index 9187c8ec313..06b83e3f5f0 100644
--- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
@@ -33,7 +33,7 @@ uniform vec3 lumWeights;
 void main(void) 
 {
 	/// Get scene color
-	vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st));
+	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
 	
 	/// Extract luminance and scale up by night vision brightness
 	float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights));
diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
index 76b675a9bdf..3050fa63cc8 100644
--- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
@@ -30,6 +30,9 @@ uniform sampler2D NoiseTexture;
 uniform float brightMult;
 uniform float noiseStrength;
 
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
 float luminance(vec3 color)
 {
 	/// CALCULATING LUMINANCE (Using NTSC lum weights)
@@ -40,7 +43,7 @@ float luminance(vec3 color)
 void main(void) 
 {
 	/// Get scene color
-	vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st));
+	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
 	
 	/// Extract luminance and scale up by night vision brightness
 	float lum = luminance(color) * brightMult;
@@ -50,7 +53,7 @@ void main(void)
 	vec3 outColor = (lum * vec3(0.91, 1.21, 0.9)) + vec3(-0.07, 0.1, -0.12); 
 
 	/// Add noise
-	float noiseValue = texture2D(NoiseTexture, gl_TexCoord[1].st).r;
+	float noiseValue = texture2D(NoiseTexture, vary_texcoord1.st).r;
 	noiseValue = (noiseValue - 0.5) * noiseStrength;
 
 	/// Older NVG colors (more muted)
diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
index abf1be6645c..74e9559185b 100644
--- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
@@ -27,8 +27,10 @@
 
 uniform sampler2DRect RenderTexture;
 
+VARYING vec2 vary_texcoord0;
+
 void main(void) 
 {
-	vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st));
+	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
 	gl_FragColor = vec4(1.0 - color, 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
index df08fce0daa..6b9c6296446 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
@@ -24,6 +24,9 @@
  */
  
 
+VARYING vec4 vertex_color;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
 
 uniform sampler2D detail_0;
 uniform sampler2D detail_1;
@@ -40,18 +43,18 @@ void main()
 	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
 	
 	/// TODO Confirm tex coords and bind them appropriately in vert shader.
-	vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy);
-	vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy);
-	vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy);
-	vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy);
+	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
+	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
+	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
+	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
 
-	float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a;
-	float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a;
-	float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a;
+	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
+	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
+	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
 	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
 	
 	/// Add WL Components
-	outColor.rgb = atmosLighting(outColor.rgb * gl_Color.rgb);
+	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
 	
 	gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);
 }
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
index 69f4d4ae458..f183b885d19 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
@@ -28,12 +28,18 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+uniform vec4 object_plane_t;
+uniform vec4 object_plane_s;
 
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec4 vertex_color;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -68,15 +74,15 @@ void main()
 
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
 	
-	gl_FrontColor = color;
+	vertex_color = color;
 
 	// Transform and pass tex coords
- 	gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ 	vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;
 	
 	vec4 t = vec4(texcoord1,0,1);
 	
-	gl_TexCoord[0].zw = t.xy;
-	gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
-	gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0);
+	vary_texcoord0.zw = t.xy;
+	vary_texcoord1.xy = t.xy-vec2(2.0, 0.0);
+	vary_texcoord1.zw = t.xy-vec2(1.0, 0.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
index 90468b45a22..9f1c4797c98 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
 
 uniform sampler2D detail_0;
 uniform sampler2D detail_1;
@@ -40,18 +42,18 @@ void main()
 	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
 	
 	/// TODO Confirm tex coords and bind them appropriately in vert shader.
-	vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy);
-	vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy);
-	vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy);
-	vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy);
+	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
+	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
+	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
+	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
 
-	float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a;
-	float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a;
-	float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a;
+	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
+	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
+	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
 	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
 	
 	/// Add WL Components
-	outColor.rgb = atmosLighting(outColor.rgb * gl_Color.rgb);
+	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
 	
 	outColor = applyWaterFog(outColor);
 	gl_FragColor = outColor;
diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
index f947aa4be10..e4b6402a8cf 100644
--- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
@@ -48,9 +48,9 @@ uniform float waterFogKS;
 uniform vec2 screenRes;
 
 //bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
 
 vec4 applyWaterFog(vec4 color, vec3 viewVec)
 {
diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
index dc543b2231a..0de77e6fe0b 100644
--- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
@@ -47,9 +47,9 @@ uniform float blurMultiplier;
 
 
 //bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
index 4c053290655..ea17e42fab0 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
@@ -30,9 +30,12 @@ uniform float maximum_alpha;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void default_lighting() 
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
index 0de909353e1..155d0756bec 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -33,9 +33,12 @@ uniform sampler2D diffuseMap;
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void default_lighting() 
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
index d12d88f1c5c..43970015c5b 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
@@ -23,14 +23,15 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 
 void default_lighting() 
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
 	color.rgb = atmosLighting(color.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
index 8c7713c08db..c6583a54dfd 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
@@ -29,9 +29,12 @@ uniform float maximum_alpha;
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void fullbright_lighting()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
index f03b1fdc749..ba2e8608f13 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
@@ -23,14 +23,15 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
 
 void fullbright_lighting()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
index 89468b96653..76f468d9148 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -31,9 +31,12 @@ vec3 fullbrightScaleSoftClip(vec3 light);
 
 uniform sampler2D diffuseMap;
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void fullbright_lighting()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 	
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
index a909ff608af..e88bf7f0ab0 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
@@ -23,7 +23,8 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
@@ -32,7 +33,7 @@ uniform sampler2D diffuseMap;
 
 void fullbright_lighting()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 	
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
index d2bc912edb2..045fc5276dd 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 
@@ -32,17 +34,17 @@ vec3 fullbrightScaleSoftClip(vec3 light);
 
 void fullbright_shiny_lighting()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
 
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 
 	gl_FragColor = color;
 }
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
index af73168c130..93b14ad6921 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 uniform sampler2D diffuseMap;
@@ -33,17 +35,17 @@ vec3 fullbrightScaleSoftClip(vec3 light);
 
 void fullbright_shiny_lighting()
 {
-	vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
 
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 
 	gl_FragColor = color;
 }
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
index e9dab850958..ffc91d9ee10 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
@@ -23,7 +23,9 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 
@@ -33,15 +35,15 @@ vec4 applyWaterFog(vec4 color);
 
 void fullbright_shiny_lighting_water()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 
 	gl_FragColor = applyWaterFog(color);
 }
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
index e0a7986705a..3f582d32286 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
@@ -23,7 +23,9 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 uniform sampler2D diffuseMap;
@@ -34,15 +36,15 @@ vec4 applyWaterFog(vec4 color);
 
 void fullbright_shiny_lighting_water()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 
 	gl_FragColor = applyWaterFog(color);
 }
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
index e5998b77a9c..fb2b6420223 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -31,9 +31,12 @@ vec4 diffuseLookup(vec2 texcoord);
 vec3 fullbrightAtmosTransport(vec3 light);
 vec4 applyWaterFog(vec4 color);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void fullbright_lighting_water()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
index 20ff3712af5..258cad3cfe9 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
@@ -23,7 +23,8 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec4 diffuseLookup(vec2 texcoord);
 
@@ -32,7 +33,7 @@ vec4 applyWaterFog(vec4 color);
 
 void fullbright_lighting_water()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
index 3fdd110f7d7..3f2802cbb87 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -31,9 +31,12 @@ uniform sampler2D diffuseMap;
 vec3 fullbrightAtmosTransport(vec3 light);
 vec4 applyWaterFog(vec4 color);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void fullbright_lighting_water()
 {
-	vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
 
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
index 01b89019b15..23700fa1b06 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
@@ -24,6 +24,8 @@
  */
  
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
@@ -32,7 +34,7 @@ vec4 applyWaterFog(vec4 color);
 
 void fullbright_lighting_water()
 {
-	vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
 
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
index d419c2d116e..09f02b9288f 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
@@ -23,7 +23,8 @@
  * $/LicenseInfo$
  */
  
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
@@ -32,7 +33,7 @@ vec3 scaleSoftClip(vec3 light);
 
 void default_lighting() 
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 	
 	color.rgb = atmosLighting(color.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
index ba4cd949d6a..66a2462b88d 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
@@ -24,7 +24,9 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 
@@ -34,16 +36,16 @@ vec4 applyWaterFog(vec4 color);
 
 void shiny_lighting()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = atmosLighting(color.rgb);
 
 	color.rgb = scaleSoftClip(color.rgb);
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
index 3b30ebf6f14..477408f5afe 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
@@ -23,8 +23,9 @@
  * $/LicenseInfo$
  */
  
-
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 uniform sampler2D diffuseMap;
@@ -35,16 +36,16 @@ vec4 applyWaterFog(vec4 color);
 
 void shiny_lighting()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = atmosLighting(color.rgb);
 
 	color.rgb = scaleSoftClip(color.rgb);
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
index c451e68763c..6df8641b47a 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
@@ -24,7 +24,9 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform samplerCube environmentMap;
 
@@ -33,14 +35,14 @@ vec4 applyWaterFog(vec4 color);
 
 void shiny_lighting_water()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = atmosLighting(color.rgb);
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 	gl_FragColor = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
index eeb997fb5f7..fce717d93af 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
  
 
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
@@ -34,14 +36,14 @@ vec4 applyWaterFog(vec4 color);
 
 void shiny_lighting_water()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy);
-	color.rgb *= gl_Color.rgb;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
 	
-	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
 
 	color.rgb = atmosLighting(color.rgb);
-	color.a = max(color.a, gl_Color.a);
+	color.a = max(color.a, vertex_color.a);
 	gl_FragColor = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
index 072dcaa6b65..4658b46a389 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
@@ -29,9 +29,12 @@ uniform float maximum_alpha;
 vec3 atmosLighting(vec3 light);
 vec4 applyWaterFog(vec4 color);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void default_lighting_water()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
index 2df34da4b47..0db9253cd15 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -31,9 +31,12 @@ uniform sampler2D diffuseMap;
 vec3 atmosLighting(vec3 light);
 vec4 applyWaterFog(vec4 color);
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
 void default_lighting_water()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 
 	if (color.a < minimum_alpha || color.a > maximum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
index ae7be4d231d..a691d4f54a0 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
@@ -24,13 +24,15 @@
  */
  
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec3 atmosLighting(vec3 light);
 vec4 applyWaterFog(vec4 color);
 
 void default_lighting_water()
 {
-	vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 
 	color.rgb = atmosLighting(color.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
index 5a86dad8278..6f5d6cd1c8c 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
@@ -24,6 +24,8 @@
  */
  
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
@@ -32,7 +34,7 @@ vec4 applyWaterFog(vec4 color);
 
 void default_lighting_water()
 {
-	vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 
 	color.rgb = atmosLighting(color.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
index b9eff87a13b..ef97e4f781f 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
@@ -34,12 +34,17 @@ void calcAtmospherics(vec3 inPositionEye);
 
 uniform vec4 origin;
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
 
-attribute vec4 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+VARYING float fog_depth;
 
 void main()
 {
@@ -52,12 +57,12 @@ void main()
 	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
index b7f7af7885b..2fd22cee9da 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
@@ -27,15 +27,18 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
  
-attribute vec4 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
 
 
 void calcAtmospherics(vec3 inPositionEye);
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void main()
 {
@@ -44,11 +47,11 @@ void main()
 	vary_texture_index = position.w;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
index 4511c4bc91d..472ff219e5b 100644
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
@@ -29,16 +29,21 @@ uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 
 void calcAtmospherics(vec3 inPositionEye);
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING float fog_depth;
 
 uniform vec4 origin;
 
@@ -53,12 +58,12 @@ void main()
 	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
 
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
-	gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
 	calcAtmospherics(pos.xyz);
 
-	gl_FrontColor = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));
+	vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
index 5f78495ae36..6799e43b9a3 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
@@ -28,10 +28,14 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -42,7 +46,7 @@ void main()
 	vec4 vert = vec4(position.xyz,1.0);
 	
 	gl_Position = modelview_projection_matrix*vert;
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
 	
 	vec4 pos = (modelview_matrix * vert);
 	
@@ -51,7 +55,7 @@ void main()
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
index 91ee5e016e0..144336417e9 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
@@ -28,15 +28,18 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-attribute vec4 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
 
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
 
 void main()
 {
@@ -45,7 +48,7 @@ void main()
 	vary_texture_index = position.w;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
 	
 	
 	
@@ -54,7 +57,7 @@ void main()
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-	gl_FrontColor = color;
+	vertex_color = color;
 
-	gl_FogFragCoord = pos.z;
+	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index be990c17579..6a83be1426d 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -25,7 +25,7 @@
  
 
 
-// varying param funcs
+// VARYING param funcs
 void setSunlitColor(vec3 v);
 void setAmblitColor(vec3 v);
 void setAdditiveColor(vec3 v);
@@ -34,8 +34,8 @@ void setPositionEye(vec3 v);
 
 vec3 getAdditiveColor();
 
-//varying vec4 vary_CloudUVs;
-//varying float vary_CloudDensity;
+//VARYING vec4 vary_CloudUVs;
+//VARYING float vary_CloudDensity;
 
 // Inputs
 uniform vec4 morphFactor;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
index a98c04b2593..08814b49d85 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
@@ -25,12 +25,12 @@
  
 
 
-varying vec3 vary_PositionEye;
+VARYING vec3 vary_PositionEye;
 
-varying vec3 vary_SunlitColor;
-varying vec3 vary_AmblitColor;
-varying vec3 vary_AdditiveColor;
-varying vec3 vary_AtmosAttenuation;
+VARYING vec3 vary_SunlitColor;
+VARYING vec3 vary_AmblitColor;
+VARYING vec3 vary_AdditiveColor;
+VARYING vec3 vary_AtmosAttenuation;
 
 vec3 getPositionEye()
 {
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index 7c3cb88b3ce..514f009adde 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -25,12 +25,12 @@
  
 
 
-varying vec3 vary_PositionEye;
+VARYING vec3 vary_PositionEye;
 
-varying vec3 vary_SunlitColor;
-varying vec3 vary_AmblitColor;
-varying vec3 vary_AdditiveColor;
-varying vec3 vary_AtmosAttenuation;
+VARYING vec3 vary_SunlitColor;
+VARYING vec3 vary_AmblitColor;
+VARYING vec3 vary_AdditiveColor;
+VARYING vec3 vary_AtmosAttenuation;
 
 vec3 getPositionEye()
 {
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index b90cec119b7..ea60d1df6cd 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -29,9 +29,13 @@
 // The fragment shader for the sky
 /////////////////////////////////////////////////////////////////////////
 
-varying vec4 vary_CloudColorSun;
-varying vec4 vary_CloudColorAmbient;
-varying float vary_CloudDensity;
+VARYING vec4 vary_CloudColorSun;
+VARYING vec4 vary_CloudColorAmbient;
+VARYING float vary_CloudDensity;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
 
 uniform sampler2D cloud_noise_texture;
 uniform vec4 cloud_pos_density1;
@@ -50,14 +54,14 @@ vec3 scaleSoftClip(vec3 light) {
 void main()
 {
 	// Set variables
-	vec2 uv1 = gl_TexCoord[0].xy;
-	vec2 uv2 = gl_TexCoord[1].xy;
+	vec2 uv1 = vary_texcoord0.xy;
+	vec2 uv2 = vary_texcoord1.xy;
 
 	vec4 cloudColorSun = vary_CloudColorSun;
 	vec4 cloudColorAmbient = vary_CloudColorAmbient;
 	float cloudDensity = vary_CloudDensity;
-	vec2 uv3 = gl_TexCoord[2].xy;
-	vec2 uv4 = gl_TexCoord[3].xy;
+	vec2 uv3 = vary_texcoord2.xy;
+	vec2 uv4 = vary_texcoord3.xy;
 
 	// Offset texture coords
 	uv1 += cloud_pos_density1.xy;	//large texture, visible density
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 67b5e7fb837..c5bb52169cc 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -25,17 +25,21 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
 //////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
 ///////////////////////////////////////////////////////////////////////////////
 
 // Output parameters
-varying vec4 vary_CloudColorSun;
-varying vec4 vary_CloudColorAmbient;
-varying float vary_CloudDensity;
+VARYING vec4 vary_CloudColorSun;
+VARYING vec4 vary_CloudColorAmbient;
+VARYING float vary_CloudDensity;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
 
 // Inputs
 uniform vec3 camPosLocal;
@@ -64,7 +68,7 @@ void main()
 	// World / view / projection
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 
 	// Get relative position
 	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
@@ -163,17 +167,17 @@ void main()
 
 
 	// Texture coords
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
-	gl_TexCoord[0].xy -= 0.5;
-	gl_TexCoord[0].xy /= cloud_scale.x;
-	gl_TexCoord[0].xy += 0.5;
+	vary_texcoord0 = texcoord0;
+	vary_texcoord0.xy -= 0.5;
+	vary_texcoord0.xy /= cloud_scale.x;
+	vary_texcoord0.xy += 0.5;
 
-	gl_TexCoord[1] = gl_TexCoord[0];
-	gl_TexCoord[1].x += lightnorm.x * 0.0125;
-	gl_TexCoord[1].y += lightnorm.z * 0.0125;
+	vary_texcoord1 = vary_texcoord0;
+	vary_texcoord1.x += lightnorm.x * 0.0125;
+	vary_texcoord1.y += lightnorm.z * 0.0125;
 
-	gl_TexCoord[2] = gl_TexCoord[0] * 16.;
-	gl_TexCoord[3] = gl_TexCoord[1] * 16.;
+	vary_texcoord2 = vary_texcoord0 * 16.;
+	vary_texcoord3 = vary_texcoord1 * 16.;
 
 	// Combine these to minimize register use
 	vary_CloudColorAmbient += oHazeColorBelowCloud;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
index ac569e82578..5c9ee5fd63c 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -29,7 +29,7 @@
 // The fragment shader for the sky
 /////////////////////////////////////////////////////////////////////////
 
-varying vec4 vary_HazeColor;
+VARYING vec4 vary_HazeColor;
 
 uniform sampler2D cloud_noise_texture;
 uniform vec4 gamma;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 50fdba64c25..b768cc9cf36 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -25,15 +25,16 @@
  
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
 // SKY ////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
 ///////////////////////////////////////////////////////////////////////////////
 
 // Output parameters
-varying vec4 vary_HazeColor;
+VARYING vec4 vary_HazeColor;
+VARYING vec2 vary_texcoord0;
 
 // Inputs
 uniform vec3 camPosLocal;
@@ -61,7 +62,7 @@ void main()
 
 	// World / view / projection
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 
 	// Get relative position
 	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index c10635c898c..9a14d496e9c 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -25,10 +25,13 @@
 
 uniform mat4 projection_matrix;
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
-attribute vec4 clothing; 
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec4 clothing; 
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -43,7 +46,7 @@ const vec4 gPiConstants	= vec4(0.159154943, 6.28318530, 3.141592653, 1.5707963);
 
 void main()
 {
-	gl_TexCoord[0] = vec4(texcoord0,0,1);
+	vary_texcoord0 = texcoord0;
 		
 	vec4 pos;
 	mat4 trans = getSkinnedTransform();
@@ -123,11 +126,11 @@ void main()
 	calcAtmospherics(pos.xyz);
 	
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.0));			
-	gl_FrontColor = color; 
+	vertex_color = color; 
 					
 	gl_Position = projection_matrix * pos;
 	
 	
-	gl_TexCoord[2] = vec4(pos.xyz, 1.0);
+	vary_texcoord2 = vec4(pos.xyz, 1.0);
 
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
index 616ea5fe9e7..eb9256b41b5 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
@@ -35,7 +35,7 @@ uniform int kern_length;
 uniform float kern_scale;
 uniform vec3 blur_quad;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
index 5e75aec171d..380d5207c30 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
index 95913a502c4..ba1d29b044a 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
@@ -42,7 +42,7 @@ uniform sampler2D		depthGIMap;
 uniform sampler2D		lightFunc;
 
 // Inputs
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 uniform vec2 screen_res;
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
index 7c55fcc2864..e3d5fdcf106 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
@@ -32,7 +32,7 @@ uniform sampler2D	  bloomMap;
 uniform sampler2DRect edgeMap;
 
 uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 
 void main() 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
index 969b6e2f1c0..60eca06d356 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
@@ -25,10 +25,10 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
index 2766691bd02..8272dbf31bb 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
@@ -25,12 +25,13 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
 
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vertex_color;
 
 uniform vec2 screen_res;
 
@@ -44,5 +45,5 @@ void main()
 	vec4 tex = vec4(texcoord0,0,1);
 	tex.w = 1.0;
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
index 13517a26bac..7c290fc993c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
@@ -30,7 +30,7 @@
 uniform sampler2DRect lightMap;
 uniform sampler2DRect diffuseRect;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 void main() 
 {
 	float i = texture2DRect(lightMap, vary_fragcoord.xy).r;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
index d0205fa824c..062875e72ff 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
@@ -25,12 +25,13 @@
 
 uniform mat4 modelview_projection_matrix;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vertex_color;
 
 uniform vec2 screen_res;
 
-attribute vec3 position;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
 
 void main()
 {
@@ -40,5 +41,5 @@ void main()
 	
 	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
 
-	gl_FrontColor = diffuse_color;
+	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
index 0364da62584..662f5fb6bec 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
@@ -53,7 +53,7 @@ uniform float gi_luminance;
 uniform vec4 sunlight_color;
 
 uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
index 2d7fa22edcb..0049d8ea78c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
index 009b5cc7439..ecab3baeee9 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
@@ -40,7 +40,7 @@ uniform float kern_scale;
 uniform float gi_edge_weight;
 uniform float gi_blur_brightness;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 
 void main() 
 {
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
index e9c6f3e27b8..6d590c8051d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
@@ -25,9 +25,9 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
+ATTRIBUTE vec3 position;
 
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
 uniform vec2 screen_res;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 1c02adea89b..664cec64c31 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -65,8 +65,8 @@ uniform sampler2DRect depthMap;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
-varying vec4 vary_light;
-varying vec2 vary_fragcoord;
+VARYING vec4 vary_light;
+VARYING vec2 vary_fragcoord;
 
 vec3 vary_PositionEye;
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
index 8e405de9a3d..682508aaf38 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
@@ -25,13 +25,13 @@
 
 uniform mat4 modelview_projection_matrix;
 
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
 
 uniform vec2 screen_res;
 
-varying vec4 vary_light;
-varying vec2 vary_fragcoord;
+VARYING vec4 vary_light;
+VARYING vec2 vary_fragcoord;
 void main()
 {
 	//transform vertex
diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
index 56a149523e0..80e08e8270f 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
@@ -24,15 +24,17 @@
  */
  
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
 
 uniform sampler2D diffuseMap;
 
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
 
 void main() 
 {
-	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
-	gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005);
+	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
+	gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005);
 	gl_FragData[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 3ba4a89686b..cac8439eb82 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -316,13 +316,12 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(detail0)->bind(detail_texture0p);
 	gGL.getTexUnit(0)->activate();
 
-	glEnable(GL_TEXTURE_GEN_S);
-	glEnable(GL_TEXTURE_GEN_T);
-	glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
-	glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	llassert(shader);
+		
+	shader->uniform4fv("object_plane_s", 1, tp0.mV);
+	shader->uniform4fv("object_plane_t", 1, tp1.mV);
 
-	glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
-	glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
-- 
GitLab


From 5af39ea28be1a76ec0c3042a0bf34e7d64835c18 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 16 Sep 2011 11:46:37 -0700
Subject: [PATCH 023/933] EXP-1169 FIX -- No synch error icon given on Outbox
 on Agni where API does not exist

* Moved marketplace URL related functions into a new file llmarketplacefunctions.cpp/h.
  This will the future home of more marketplace-related functions.
* Disabled sync button when the marketplace API is unavailable.
---
 indra/newview/CMakeLists.txt               |  2 +
 indra/newview/llmarketplacefunctions.cpp   | 80 +++++++++++++++++++++
 indra/newview/llmarketplacefunctions.h     | 42 +++++++++++
 indra/newview/llpanelmarketplaceoutbox.cpp | 22 ++----
 indra/newview/llviewermedia.cpp            | 81 ++++++++++------------
 5 files changed, 165 insertions(+), 62 deletions(-)
 create mode 100644 indra/newview/llmarketplacefunctions.cpp
 create mode 100644 indra/newview/llmarketplacefunctions.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 11b19ca4fec..8c1f98979b8 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -310,6 +310,7 @@ set(viewer_SOURCE_FILES
     llmaniprotate.cpp
     llmanipscale.cpp
     llmaniptranslate.cpp
+    llmarketplacefunctions.cpp
     llmediactrl.cpp
     llmediadataclient.cpp
     llmemoryview.cpp
@@ -873,6 +874,7 @@ set(viewer_HEADER_FILES
     llmaniprotate.h
     llmanipscale.h
     llmaniptranslate.h
+    llmarketplacefunctions.h
     llmediactrl.h
     llmediadataclient.h
     llmemoryview.h
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
new file mode 100644
index 00000000000..599731a6415
--- /dev/null
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -0,0 +1,80 @@
+/** 
+ * @file llmarketplacefunctions.cpp
+ * @brief Implementation of assorted functions related to the marketplace
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llmarketplacefunctions.h"
+
+#include "llagent.h"
+#include "llviewernetwork.h"
+
+
+std::string getMarketplaceBaseURL()
+{
+	std::string url = "https://marketplace.secondlife.com/";
+
+	if (!LLGridManager::getInstance()->isInProductionGrid())
+	{
+		std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
+		url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
+	}
+
+	url += "api/1/users/";
+	url += gAgent.getID().getString();
+
+	return url;
+}
+
+std::string getMarketplaceURL_InventoryImport()
+{
+	std::string url = getMarketplaceBaseURL();
+
+	url += "/inventory_import";
+
+	return url;
+}
+
+std::string getMarketplaceURL_UserStatus()
+{
+	std::string url = getMarketplaceBaseURL();
+
+	url += "/user_status";
+
+	return url;
+}
+
+
+static bool gMarketplaceSyncEnabled = false;
+
+bool getMarketplaceSyncEnabled()
+{
+	return gMarketplaceSyncEnabled;
+}
+
+void setMarketplaceSyncEnabled(bool syncEnabled)
+{
+	gMarketplaceSyncEnabled = syncEnabled;
+}
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
new file mode 100644
index 00000000000..e80e6a471cc
--- /dev/null
+++ b/indra/newview/llmarketplacefunctions.h
@@ -0,0 +1,42 @@
+/** 
+ * @file llmarketplacefunctions.h
+ * @brief Miscellaneous marketplace-related functions and classes
+ * class definition
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLMARKETPLACEFUNCTIONS_H
+#define LL_LLMARKETPLACEFUNCTIONS_H
+
+
+std::string getMarketplaceURL_InventoryImport();
+std::string getMarketplaceURL_UserStatus();
+
+bool getMarketplaceSyncEnabled();
+void setMarketplaceSyncEnabled(bool syncEnabled);
+
+
+#endif // LL_LLMARKETPLACEFUNCTIONS_H
+
+
+
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 73fb92ff727..2764527c447 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -35,6 +35,7 @@
 #include "lleventcoro.h"
 #include "llinventorypanel.h"
 #include "llloadingindicator.h"
+#include "llmarketplacefunctions.h"
 #include "llnotificationsutil.h"
 #include "llpanelmarketplaceinbox.h"
 #include "llsdutil.h"
@@ -82,7 +83,7 @@ void LLPanelMarketplaceOutbox::handleLoginComplete()
 {
 	mSyncButton = getChild<LLButton>("outbox_sync_btn");
 	mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this));
-	mSyncButton->setEnabled(!isOutboxEmpty());
+	mSyncButton->setEnabled(getMarketplaceSyncEnabled() && !isOutboxEmpty());
 	
 	mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator");
 }
@@ -223,20 +224,7 @@ void LLPanelMarketplaceOutbox::onSyncButtonClicked()
 	updateSyncButtonStatus();
 
 	// Make the url for the inventory import request
-	std::string url = "https://marketplace.secondlife.com/";
-
-	if (!LLGridManager::getInstance()->isInProductionGrid())
-	{
-		std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
-		url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
-
-		// TEMP for Jim's pdp
-		//url = "http://pdp24.lindenlab.com:3000/";
-	}
-	
-	url += "api/1/users/";
-	url += gAgent.getID().getString();
-	url += "/inventory_import";
+	std::string url = getMarketplaceURL_InventoryImport();
 
 	llinfos << "http get:  " << url << llendl;
 	LLHTTPClient::get(url, new LLInventorySyncResponder(this), LLViewerMedia::getHeaders());
@@ -311,7 +299,7 @@ void LLPanelMarketplaceOutbox::updateSyncButtonStatus()
 		mSyncIndicator->setVisible(false);
 
 		mSyncButton->setVisible(true);
-		mSyncButton->setEnabled(!isOutboxEmpty());
+		mSyncButton->setEnabled(getMarketplaceSyncEnabled() && !isOutboxEmpty());
 	}
 }
 
@@ -352,7 +340,7 @@ void LLPanelMarketplaceOutbox::draw()
 	
 	if (!isSyncInProgress())
 	{
-		mSyncButton->setEnabled(not_empty);
+		mSyncButton->setEnabled(getMarketplaceSyncEnabled() && not_empty);
 	}
 	
 	LLPanel::draw();
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index e7f05dcaa3b..b60881b5f1e 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -26,51 +26,49 @@
 
 #include "llviewerprecompiledheaders.h"
 
+#include "llviewermedia.h"
+
 #include "llagent.h"
 #include "llagentcamera.h"
-#include "llviewermedia.h"
-#include "llviewermediafocus.h"
-#include "llmimetypes.h"
+#include "llappviewer.h"
+#include "llaudioengine.h"  // for gAudiop
+#include "llcallbacklist.h"
+#include "lldir.h"
+#include "lldiriterator.h"
+#include "llevent.h"		// LLSimpleListener
+#include "llfilepicker.h"
+#include "llfloatermediabrowser.h"	// for handling window close requests and geometry change requests in media browser windows.
+#include "llfloaterwebcontent.h"	// for handling window close requests and geometry change requests in media browser windows.
+#include "llfocusmgr.h"
+#include "llkeyboard.h"
+#include "lllogininstance.h" 
+#include "llmarketplacefunctions.h"
 #include "llmediaentry.h"
+#include "llmimetypes.h"
+#include "llmutelist.h"
+#include "llnotifications.h"
+#include "llnotificationsutil.h"
+#include "llpanelprofile.h"
+#include "llparcel.h"
+#include "llpluginclassmedia.h"
+#include "llplugincookiestore.h"
+#include "llurldispatcher.h"
+#include "lluuid.h"
 #include "llversioninfo.h"
 #include "llviewercontrol.h"
-#include "llviewertexture.h"
+#include "llviewermediafocus.h"
 #include "llviewerparcelmedia.h"
 #include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+#include "llviewertexture.h"
 #include "llviewertexturelist.h"
-#include "llvovolume.h"
-#include "llpluginclassmedia.h"
-#include "llplugincookiestore.h"
 #include "llviewerwindow.h"
-#include "llfocusmgr.h"
-#include "llcallbacklist.h"
-#include "llparcel.h"
-#include "llaudioengine.h"  // for gAudiop
-#include "llurldispatcher.h"
 #include "llvoavatar.h"
 #include "llvoavatarself.h"
-#include "llviewerregion.h"
+#include "llvovolume.h"
 #include "llwebsharing.h"	// For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this!
-#include "llfilepicker.h"
-#include "llnotifications.h"
-#include "lldir.h"
-#include "lldiriterator.h"
-#include "llevent.h"		// LLSimpleListener
-#include "llnotificationsutil.h"
-#include "lluuid.h"
-#include "llkeyboard.h"
-#include "llmutelist.h"
-#include "llpanelprofile.h"
-#include "llappviewer.h"
-#include "lllogininstance.h" 
-//#include "llfirstuse.h"
-#include "llviewernetwork.h"
 #include "llwindow.h"
 
-
-#include "llfloatermediabrowser.h"	// for handling window close requests and geometry change requests in media browser windows.
-#include "llfloaterwebcontent.h"	// for handling window close requests and geometry change requests in media browser windows.
-
 #include <boost/bind.hpp>	// for SkinFolder listener
 #include <boost/signals2.hpp>
 
@@ -1394,14 +1392,20 @@ class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
 #if ENABLE_INVENTORY_DISPLAY_OUTBOX
 			gSavedSettings.setBOOL("InventoryDisplayOutbox", true);
 #endif
+
+			setMarketplaceSyncEnabled(true);
 		}
 		else if (status == 401)
 		{
 			// API is available for use but OpenID authorization failed
 			gSavedSettings.setBOOL("InventoryDisplayInbox", true);
+
+			setMarketplaceSyncEnabled(false);
 		}
 		else
 		{
+			setMarketplaceSyncEnabled(false);
+
 			// API in unavailable
 			llinfos << "Marketplace API is unavailable -- Inbox may be disabled, status = " << status << ", reason = " << reason << llendl;
 		}
@@ -1411,20 +1415,7 @@ class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
 
 void doOnetimeEarlyHTTPRequests()
 {
-	std::string url = "https://marketplace.secondlife.com/";
-
-	if (!LLGridManager::getInstance()->isInProductionGrid())
-	{
-		std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
-		url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
-
-		// TEMP for Jim's pdp
-		//url = "http://pdp24.lindenlab.com:3000/";
-	}
-	
-	url += "api/1/users/";
-	url += gAgent.getID().getString();
-	url += "/user_status";
+	std::string url = getMarketplaceURL_UserStatus();
 
 	llinfos << "http get: " << url << llendl;
 	LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), LLViewerMedia::getHeaders());
-- 
GitLab


From e550533e23323ebf8e380f7d88387fc04740bc2e Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 16 Sep 2011 15:59:19 -0400
Subject: [PATCH 024/933] SH-2434 WIP testing possibility of always using
 unnested mutex locks to see if that makes a difference.

---
 indra/llcommon/llthread.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index c732e3bc779..0fa98e5c45c 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -151,15 +151,15 @@ class LL_COMMON_API LLThread
 
 //============================================================================
 
-#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
+//#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
 
-#ifdef MUTEX_DEBUG
+//#ifdef MUTEX_DEBUG
 // We really shouldn't be using recursive locks. Make sure of that in debug mode.
 #define MUTEX_FLAG APR_THREAD_MUTEX_UNNESTED
-#else
+//#else
 // Use the fastest platform-optimal lock behavior (can be recursive or non-recursive).
-#define MUTEX_FLAG APR_THREAD_MUTEX_DEFAULT
-#endif
+//#define MUTEX_FLAG APR_THREAD_MUTEX_DEFAULT
+//#endif
 
 class LL_COMMON_API LLMutexBase
 {
-- 
GitLab


From 8a1baaea6c0462b645499e8e7b88345e46b92621 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 16 Sep 2011 17:08:39 -0500
Subject: [PATCH 025/933] SH-2243 work in progress -- don't use gl_FragColor or
 gl_FragData for outputs -- no more deprecation warnings on nvidia

---
 .../shaders/class1/avatar/pickAvatarF.glsl           |  6 +++++-
 .../app_settings/shaders/class1/deferred/alphaF.glsl |  9 ++++-----
 .../shaders/class1/deferred/alphaNonIndexedF.glsl    |  6 ++++--
 .../class1/deferred/alphaNonIndexedNoColorF.glsl     |  6 ++++--
 .../shaders/class1/deferred/alphaSkinnedV.glsl       |  2 +-
 .../shaders/class1/deferred/attachmentShadowF.glsl   |  4 +++-
 .../shaders/class1/deferred/avatarF.glsl             |  4 +++-
 .../shaders/class1/deferred/avatarShadowF.glsl       |  4 +++-
 .../shaders/class1/deferred/blurLightF.glsl          |  6 ++++--
 .../app_settings/shaders/class1/deferred/bumpF.glsl  |  4 +++-
 .../shaders/class1/deferred/cloudsF.glsl             |  3 +++
 .../shaders/class1/deferred/diffuseAlphaMaskF.glsl   |  5 ++++-
 .../class1/deferred/diffuseAlphaMaskIndexedF.glsl    |  6 +++++-
 .../class1/deferred/diffuseAlphaMaskNoColorF.glsl    |  4 ++++
 .../shaders/class1/deferred/diffuseF.glsl            |  4 +++-
 .../shaders/class1/deferred/diffuseIndexedF.glsl     |  6 +++++-
 .../shaders/class1/deferred/emissiveF.glsl           |  6 ++++--
 .../shaders/class1/deferred/fullbrightF.glsl         |  6 ++++--
 .../app_settings/shaders/class1/deferred/giF.glsl    |  8 +++++---
 .../shaders/class1/deferred/impostorF.glsl           |  6 +++++-
 .../shaders/class1/deferred/luminanceF.glsl          |  8 +++++---
 .../shaders/class1/deferred/multiPointLightF.glsl    |  8 ++++----
 .../shaders/class1/deferred/multiSpotLightF.glsl     |  4 +++-
 .../shaders/class1/deferred/pointLightF.glsl         |  6 ++++--
 .../shaders/class1/deferred/postDeferredF.glsl       |  4 ++++
 .../shaders/class1/deferred/postDeferredNoDoFF.glsl  |  4 ++++
 .../class1/deferred/postDeferredNoDoFNoFXAAF.glsl    |  4 ++++
 .../shaders/class1/deferred/postDeferredNoFXAAF.glsl |  4 ++++
 .../shaders/class1/deferred/postgiF.glsl             | 10 +++++-----
 .../shaders/class1/deferred/shadowAlphaMaskF.glsl    |  6 +++++-
 .../shaders/class1/deferred/shadowF.glsl             |  4 +++-
 .../app_settings/shaders/class1/deferred/skyF.glsl   |  4 +++-
 .../shaders/class1/deferred/softenLightF.glsl        |  6 ++++--
 .../shaders/class1/deferred/spotLightF.glsl          |  7 +++++--
 .../app_settings/shaders/class1/deferred/starsF.glsl |  6 +++++-
 .../shaders/class1/deferred/sunLightF.glsl           |  6 ++++--
 .../shaders/class1/deferred/sunLightSSAOF.glsl       |  5 ++++-
 .../shaders/class1/deferred/terrainF.glsl            |  4 +++-
 .../app_settings/shaders/class1/deferred/treeF.glsl  |  4 +++-
 .../shaders/class1/deferred/treeShadowF.glsl         |  6 +++++-
 .../app_settings/shaders/class1/deferred/waterF.glsl |  6 ++++--
 .../shaders/class1/effects/glowExtractF.glsl         |  6 ++++--
 .../shaders/class1/effects/glowExtractMSF.glsl       |  6 ++++--
 .../app_settings/shaders/class1/effects/glowF.glsl   |  4 +++-
 .../shaders/class1/environment/terrainF.glsl         |  4 +++-
 .../shaders/class1/environment/terrainWaterF.glsl    |  4 +++-
 .../shaders/class1/environment/underWaterF.glsl      |  4 +++-
 .../shaders/class1/environment/waterF.glsl           |  4 +++-
 .../shaders/class1/interface/customalphaF.glsl       |  6 +++++-
 .../shaders/class1/interface/debugF.glsl             |  6 +++++-
 .../shaders/class1/interface/glowcombineF.glsl       |  6 +++++-
 .../shaders/class1/interface/glowcombineFXAAF.glsl   |  4 ++++
 .../shaders/class1/interface/highlightF.glsl         |  3 +++
 .../shaders/class1/interface/occlusionF.glsl         |  4 ++++
 .../shaders/class1/interface/onetexturenocolorF.glsl |  6 +++++-
 .../shaders/class1/interface/solidcolorF.glsl        |  6 +++++-
 .../shaders/class1/interface/splattexturerectF.glsl  |  4 ++++
 .../shaders/class1/interface/twotextureaddF.glsl     |  6 +++++-
 .../app_settings/shaders/class1/interface/uiF.glsl   |  6 +++++-
 .../app_settings/shaders/class1/lighting/lightF.glsl |  4 ++++
 .../shaders/class1/lighting/lightFullbrightF.glsl    |  4 +++-
 .../class1/lighting/lightFullbrightShinyF.glsl       |  4 +++-
 .../class1/lighting/lightFullbrightShinyWaterF.glsl  |  4 +++-
 .../class1/lighting/lightFullbrightWaterF.glsl       |  5 +++--
 .../shaders/class1/lighting/lightShinyF.glsl         |  5 ++++-
 .../shaders/class1/lighting/lightShinyWaterF.glsl    |  5 ++++-
 .../shaders/class1/lighting/lightWaterF.glsl         |  4 ++++
 .../app_settings/shaders/class1/objects/bumpF.glsl   |  6 +++++-
 .../shaders/class1/objects/impostorF.glsl            |  6 +++++-
 .../app_settings/shaders/class2/deferred/alphaF.glsl | 10 ++++------
 .../shaders/class2/deferred/alphaNonIndexedF.glsl    | 12 +++++-------
 .../class2/deferred/alphaNonIndexedNoColorF.glsl     |  6 ++++--
 .../app_settings/shaders/class2/deferred/edgeF.glsl  |  7 ++++---
 .../shaders/class2/deferred/edgeMSF.glsl             |  6 ++++--
 .../shaders/class2/deferred/multiSpotLightF.glsl     |  8 +++++---
 .../shaders/class2/deferred/multiSpotLightMSF.glsl   |  6 ++++--
 .../shaders/class2/deferred/softenLightF.glsl        |  6 ++++--
 .../shaders/class2/deferred/softenLightMSF.glsl      |  6 ++++--
 .../shaders/class2/deferred/spotLightF.glsl          |  6 ++++--
 .../shaders/class2/deferred/spotLightMSF.glsl        |  6 ++++--
 .../shaders/class2/deferred/sunLightF.glsl           |  6 ++++--
 .../shaders/class2/deferred/sunLightMSF.glsl         |  6 ++++--
 .../shaders/class2/deferred/sunLightSSAOF.glsl       |  6 ++++--
 .../shaders/class2/deferred/sunLightSSAOMSF.glsl     |  6 ++++--
 .../shaders/class2/effects/colorFilterF.glsl         |  4 +++-
 .../shaders/class2/effects/extractF.glsl             |  4 +++-
 .../shaders/class2/effects/nightVisionF.glsl         |  4 +++-
 .../app_settings/shaders/class2/effects/simpleF.glsl |  4 +++-
 .../shaders/class2/environment/terrainF.glsl         |  3 +++
 .../shaders/class2/environment/terrainWaterF.glsl    |  6 +++++-
 .../shaders/class2/environment/underWaterF.glsl      |  4 +++-
 .../shaders/class2/environment/waterF.glsl           |  4 +++-
 .../shaders/class2/lighting/lightAlphaMaskF.glsl     |  3 +++
 .../class2/lighting/lightAlphaMaskNonIndexedF.glsl   |  5 ++++-
 .../app_settings/shaders/class2/lighting/lightF.glsl |  6 +++++-
 .../class2/lighting/lightFullbrightAlphaMaskF.glsl   |  6 +++++-
 .../shaders/class2/lighting/lightFullbrightF.glsl    |  6 +++++-
 .../lightFullbrightNonIndexedAlphaMaskF.glsl         |  6 +++++-
 .../class2/lighting/lightFullbrightNonIndexedF.glsl  |  6 +++++-
 .../class2/lighting/lightFullbrightShinyF.glsl       |  6 +++++-
 .../lighting/lightFullbrightShinyNonIndexedF.glsl    |  6 +++++-
 .../class2/lighting/lightFullbrightShinyWaterF.glsl  |  3 +++
 .../lightFullbrightShinyWaterNonIndexedF.glsl        |  3 +++
 .../lighting/lightFullbrightWaterAlphaMaskF.glsl     |  4 ++++
 .../class2/lighting/lightFullbrightWaterF.glsl       |  6 +++++-
 .../lightFullbrightWaterNonIndexedAlphaMaskF.glsl    |  6 +++++-
 .../lighting/lightFullbrightWaterNonIndexedF.glsl    |  5 ++++-
 .../shaders/class2/lighting/lightNonIndexedF.glsl    |  4 ++++
 .../shaders/class2/lighting/lightShinyF.glsl         |  5 ++++-
 .../class2/lighting/lightShinyNonIndexedF.glsl       |  4 ++++
 .../shaders/class2/lighting/lightShinyWaterF.glsl    |  5 ++++-
 .../class2/lighting/lightShinyWaterNonIndexedF.glsl  |  5 ++++-
 .../class2/lighting/lightWaterAlphaMaskF.glsl        |  6 +++++-
 .../lighting/lightWaterAlphaMaskNonIndexedF.glsl     |  6 +++++-
 .../shaders/class2/lighting/lightWaterF.glsl         |  5 ++++-
 .../class2/lighting/lightWaterNonIndexedF.glsl       |  5 ++++-
 .../shaders/class2/windlight/cloudsF.glsl            |  4 +++-
 .../app_settings/shaders/class2/windlight/skyF.glsl  |  4 +++-
 .../shaders/class3/deferred/giDownsampleF.glsl       |  7 ++++---
 .../app_settings/shaders/class3/deferred/giF.glsl    |  8 +++++---
 .../shaders/class3/deferred/giFinalF.glsl            |  6 ++++--
 .../shaders/class3/deferred/luminanceF.glsl          |  6 ++++--
 .../shaders/class3/deferred/postDeferredF.glsl       |  7 ++++---
 .../shaders/class3/deferred/postgiF.glsl             |  6 ++++--
 .../shaders/class3/deferred/softenLightF.glsl        |  6 ++++--
 .../app_settings/shaders/class3/deferred/treeF.glsl  |  5 ++++-
 126 files changed, 503 insertions(+), 171 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
index a64f6ea55ce..a009d0dd86f 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 23142a3516d..c40a62e49cc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 
 vec4 diffuseLookup(vec2 texcoord);
@@ -81,8 +83,5 @@ void main()
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
 	gl_FragColor = color;
-	//gl_FragColor = vec4(1,0,1,1);
-	//gl_FragColor = vec4(1,0,1,1)*shadow;
-	
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index 332bc9c262e..3f6d6a8fd62 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index e8a2318f397..e24734c2dba 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index e5899872db2..15781bc92d7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -101,7 +101,7 @@ void main()
 	pos = trans * vec4(position.xyz, 1.0);
 	
 	norm = position.xyz + normal.xyz;
-	norm = normalize(( trans*vec4(norojrm, 1.0) ).xyz-pos.xyz);
+	norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
 	
 	vec4 frag_pos = projection_matrix * pos;
 	gl_Position = frag_pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index 40fa59b6375..f899ecabe08 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -22,7 +22,9 @@
  * $/LicenseInfo$
  */
 
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index b1fc9da8557..945a1e71a52 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -22,8 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index c9386062c6a..4591bb93974 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index e0a25b505a3..1b04be7d9c3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -22,11 +22,13 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
-
 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform sampler2DRect lightMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
index 379420a8a00..463c61090f1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 uniform sampler2D diffuseMap;
 uniform sampler2D bumpMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index 127136a12c2..73e726fe15f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -24,6 +24,9 @@
  */
  
 
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 /////////////////////////////////////////////////////////////////////////
 // The fragment shader for the sky
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index 51d67d2790e..f3351c08bf8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 uniform float minimum_alpha;
 uniform float maximum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index 8868d33705f..7d83b9a72c2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
+
 VARYING vec3 vary_normal;
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index 2f46d43b9d5..a24623d7b5e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -24,6 +24,10 @@
  */
  
 
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index aaf89a22ef4..a8e5ae4a622 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index e08e52c7cfe..9a0e511bef8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
+
 VARYING vec3 vary_normal;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index 6cf563189a0..fdcce789404 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index f54827f7208..25d5906b77f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
index 72c5a930873..55b816041b4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform sampler2D noiseMap;
@@ -182,5 +184,5 @@ void main()
 	vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
 	
-	gl_FragData[0].xyz = giAmbient(pos, norm);
+	gl_FragColor.xyz = giAmbient(pos, norm);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index e98f9aef878..a929c0e4f59 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index 4f13167c1c2..f17c64e7514 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -22,11 +22,13 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
-
-
-
+ 
 uniform sampler2DRect diffuseMap;
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec2 vary_fragcoord;
 
 void main() 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 279a2fa78dd..585faf6cd56 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
 
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
@@ -141,6 +143,4 @@ void main()
 	
 	gl_FragColor.rgb = out_col;
 	gl_FragColor.a = 0.0;
-	
-	//gl_FragColor = vec4(0.1, 0.025, 0.025/4.0, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index dff63607263..6351a5ac0da 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
 
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 //class 1 -- no shadows
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 0fc23fecb41..60f99fac155 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
- 
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect normalMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 64044590c9c..c8ee1dac00c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -25,6 +25,10 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 #define FXAA_PC 1
 //#define FXAA_GLSL_130 1
 #define FXAA_QUALITY__PRESET 12
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index 16b61897d56..7f16c323313 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -25,6 +25,10 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 #define FXAA_PC 1
 //#define FXAA_GLSL_130 1
 #define FXAA_QUALITY__PRESET 12
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
index a1986fca9a6..e3a54625895 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
@@ -25,6 +25,10 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2D bloomMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
index 84c23c97a02..55e07db8794 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
@@ -25,6 +25,10 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect edgeMap;
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index a172f49d879..0f85a299a5a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -22,9 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
-
 
+ #ifndef gl_FragColor
+ out vec4 gl_FragColor;
+ #endif
+ 
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform sampler2DRect giLightMap;
@@ -94,7 +96,5 @@ void main()
 	
 	col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z;
 	
-	gl_FragData[0].xyz = col;
-	
-	//gl_FragColor = ccol;
+	gl_FragColor.rgb = col;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index c63a6279710..a35826ce7d5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index ee0ea84e6f3..608ac4d3de4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 post_pos;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 26c7165e067..dac1ee1294f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 /////////////////////////////////////////////////////////////////////////
 // The fragment shader for the sky
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index fa1d2cc7a7a..e86b0445ede 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect positionMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 20970fc4ba4..8eac16d3f06 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -23,10 +23,13 @@
  * $/LicenseInfo$
  */
 
-
-
+ 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 8eb4be71777..7986320c38d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
index 78ea15e87a9..1114a0f0c44 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
@@ -23,12 +23,14 @@
  * $/LicenseInfo$
  */
  
-
-
 //class 1, no shadow, no SSAO, should never be called
 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 void main() 
 {
 	gl_FragColor = vec4(0,0,0,0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 797648202d5..96f3248e557 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -23,9 +23,12 @@
  */
  
 
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 //class 1 -- no shadow, SSAO only
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index effa994a48c..3112a1ea7f8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 uniform sampler2D detail_0;
 uniform sampler2D detail_1;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index b0ef348cd14..06071056ac1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -22,8 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 22ebaa9be6c..910b8f6c8c1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index d10548cbefc..43cd4c2eed8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
+
 vec3 scaleSoftClip(vec3 inColor);
 vec3 atmosTransport(vec3 inColor);
 
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index a34e76d25aa..b2d3a135ba8 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseMap;
 uniform float minLuminance;
 uniform float maxExtractAlpha;
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
index cbf4dc4bea6..18b6e503e1a 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
@@ -23,11 +23,13 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DMS diffuseMap;
 uniform float minLuminance;
 uniform float maxExtractAlpha;
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 3d17a20fbbe..8e83e53b788 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D diffuseMap;
 uniform float glowStrength;
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index 5d72390d2db..5f12b18398f 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D detail0;
 uniform sampler2D detail1;
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index 307b87e086f..0d1d7d6b89c 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -22,8 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 // this class1 shader is just a copy of terrainF
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 48eea0bdda2..4ad1b82e0a1 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D diffuseMap;
 uniform sampler2D bumpMap;   
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 1bb04ceb348..8aa4cb5434a 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 vec3 scaleSoftClip(vec3 inColor);
 vec3 atmosTransport(vec3 inColor);
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
index 66f3e1ae11b..765040a27f2 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D diffuseMap;
 
 uniform float custom_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
index d43bf3fb50d..d89c7b00727 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform vec4 color;
 
 void main() 
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index caff5fc324a..8023545c4ed 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 #extension GL_ARB_texture_rectangle : enable
 
 uniform sampler2D glowMap;
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index 3e972f0cb49..57e9f937686 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -25,6 +25,10 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D glowMap;
 uniform sampler2DRect screenMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 1d37b97bf16..ce5409c816e 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -23,6 +23,9 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform vec4 color;
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
index 57248699cb9..5f91ce5e80e 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
@@ -23,6 +23,10 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 void main() 
 {
 	gl_FragColor = vec4(1,1,1,1);
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
index d8601063053..95b7632521c 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D tex0;
 
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index a25c9a08fbe..7ba2d07ca4c 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D tex0;
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
index 9a295ce9f2a..b085eb17608 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -25,6 +25,10 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect screenMap;
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
index 3ded949943e..9cbdfea2df3 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D tex0;
 uniform sampler2D tex1;
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 2602e489c8b..0c5479af364 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D diffuseMap;
 
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 0a687d7a33c..7f23c5e78c5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -23,6 +23,10 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index 7ba6e9dec90..b67203065f1 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index 00c08d59ef4..d9b7ba0db10 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index 2140b2f6128..0ace495d5ac 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -22,7 +22,9 @@
  * $/LicenseInfo$
  */
 
- 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif 
 
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index ab6b561f08d..fac476e2ce8 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -23,8 +23,9 @@
  * $/LicenseInfo$
  */
 
- 
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D diffuseMap;
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index 183582e41f9..b1ab065712a 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index 9c9f7ca658a..05c9310a37f 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index 1a041c26ca6..27d05baaa71 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -22,6 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
  
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index 53c0e77b48c..664967d36fd 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2D texture0;
 uniform sampler2D texture1;
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index e5bf5bf2d30..8a4932122fa 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 4fffb9e97fe..ab4ed093c80 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -22,11 +22,13 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
-
 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
@@ -136,10 +138,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	//gl_FragColor = vertex_color;
 	gl_FragColor = color;
-	//gl_FragColor.r = 0.0;
-	//gl_FragColor = vec4(1,shadow,1,1);
-	
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index 30aa82473ad..a9ee534bdfe 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRectShadow shadowMap0;
 uniform sampler2DRectShadow shadowMap1;
 uniform sampler2DRectShadow shadowMap2;
@@ -136,10 +138,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	//gl_FragColor = vertex_color;
-	gl_FragColor = color;
-	//gl_FragColor.r = 0.0;
-	//gl_FragColor = vec4(1,shadow,1,1);
-	
+	gl_FragColor = color;	
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 9370b484b84..98dd9d4a1ea 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRectShadow shadowMap0;
 uniform sampler2DRectShadow shadowMap1;
 uniform sampler2DRectShadow shadowMap2;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
index 4fc6c00caf0..96e71b46d7d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 
@@ -77,5 +79,4 @@ void main()
 	ne = step(norm_cutoff, ne);
 	
 	gl_FragColor.a = dot(de,de)+dot(ne,ne);
-	//gl_FragColor.a = dot(de,de);
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
index 11a7cf846d8..540c71c5e34 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
@@ -23,11 +23,13 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DMS depthMap;
 uniform sampler2DMS normalMap;
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index d1f2db61886..409db862e65 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -22,11 +22,13 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
-
-
-
+ 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
index 74f78cfc06c..9e7542c01c6 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
@@ -23,11 +23,13 @@
  * $/LicenseInfo$
  */
 
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 
 uniform sampler2DMS diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index e9f1a3d3a5d..642145a856f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect normalMap;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index 6b979b13ed5..ab187ccfa58 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -23,11 +23,13 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DMS diffuseRect;
 uniform sampler2DMS specularRect;
 uniform sampler2DMS normalMap;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 19a1d1f1656..c2e36abbd60 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
index 85fea56411d..50369cb2054 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
@@ -23,11 +23,13 @@
  * $/LicenseInfo$
  */
 
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 
 uniform sampler2DMS diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index bb742adb629..efb19848746 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -22,11 +22,13 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
-
 
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 //class 2, shadows, no SSAO
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
index 4933eb00b77..96b6140c0a3 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
@@ -23,11 +23,13 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 //class 2, shadows, no SSAO
 
 uniform sampler2DMS depthMap;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 042bb5f96c1..1886178731d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -22,10 +22,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 //class 2 -- shadows and SSAO
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
index e138ae58418..4a2ba0afc5c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
@@ -22,11 +22,13 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 //class 2 -- shadows and SSAO
 
 uniform sampler2DMS depthMap;
diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
index 8d673237b84..439855910e4 100644
--- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
@@ -22,8 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2DRect RenderTexture;
 uniform float brightness;
diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
index 06b83e3f5f0..786c00f946d 100644
--- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2DRect RenderTexture;
 uniform float extractLow;
diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
index 3050fa63cc8..4074540591a 100644
--- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2DRect RenderTexture;
 uniform sampler2D NoiseTexture;
diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
index 74e9559185b..7e8be3c19c8 100644
--- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2DRect RenderTexture;
 
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
index 6b9c6296446..eed8b3cc017 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
@@ -23,6 +23,9 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec4 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
index 9f1c4797c98..c48333aa87e 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec4 vary_texcoord0;
 VARYING vec4 vary_texcoord1;
diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
index e4b6402a8cf..90a7aab62e3 100644
--- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2D diffuseMap;
 uniform sampler2D bumpMap;   
diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
index 0de77e6fe0b..33ffeaefb0f 100644
--- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 vec3 scaleSoftClip(vec3 inColor);
 vec3 atmosTransport(vec3 inColor);
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
index ea17e42fab0..7325e0fe4ef 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
@@ -23,6 +23,9 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform float minimum_alpha;
 uniform float maximum_alpha;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
index 155d0756bec..9a9f8fbf75c 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform float minimum_alpha;
 uniform float maximum_alpha;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
index 43970015c5b..c2847bbce8a 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
index c6583a54dfd..29dbcb2d8c0 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
index ba2e8608f13..5dd8822a686 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
index 76f468d9148..ccd8fddb997 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
index e88bf7f0ab0..14d44de3d52 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
index 045fc5276dd..6cb6453f587 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_texcoord1;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
index 93b14ad6921..8940e1683b2 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_texcoord1;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
index ffc91d9ee10..560702c8ce0 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
@@ -22,6 +22,9 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
index 3f582d32286..b8b6a22a43c 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
@@ -22,6 +22,9 @@
  * $/LicenseInfo$
  */
  
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
index fb2b6420223..748e30b8fb1 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -23,6 +23,10 @@
  * $/LicenseInfo$
  */
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
index 258cad3cfe9..5a47f85833e 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
index 3f2802cbb87..8430091bf5d 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
index 23700fa1b06..fe9f330215e 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
index 09f02b9288f..fc880109783 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
@@ -22,6 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
  
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
index 66a2462b88d..9f416090aa8 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
index 477408f5afe..abc41fc09a8 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
@@ -22,6 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
  
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
index 6df8641b47a..99df846e685 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
index fce717d93af..d67aeb6655e 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
index 4658b46a389..ad219d0d2ae 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
index 0db9253cd15..3ec16b16812 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -22,7 +22,11 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform float minimum_alpha;
 uniform float maximum_alpha;
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
index a691d4f54a0..4dddc95afd7 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif 
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
index 6f5d6cd1c8c..f89b2dcea20 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index ea60d1df6cd..d06e80ec35c 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 /////////////////////////////////////////////////////////////////////////
 // The fragment shader for the sky
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
index 5c9ee5fd63c..be9fefcb33a 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -23,7 +23,9 @@
  * $/LicenseInfo$
  */
  
-
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 /////////////////////////////////////////////////////////////////////////
 // The fragment shader for the sky
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
index eb9256b41b5..af8c05dbebf 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
@@ -24,6 +24,9 @@
  */
  
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
 
 uniform sampler2DRect giLightMap;
 
@@ -100,7 +103,5 @@ void main()
 	
 	col = col*blur_quad.y;
 	
-	gl_FragData[0].xyz = col;
-	
-	//gl_FragColor = ccol;
+	gl_FragColor.xyz = col;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
index ba1d29b044a..dad62a074a9 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor;
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform sampler2DRect lightMap;
@@ -207,5 +209,5 @@ void main()
 	vec3 ambient = da > 0.0 ? giAmbient(pos.xyz, norm) : vec3(0);
 	
 		
-	gl_FragData[0].xyz = mix(vec3(0), ambient, da);
+	gl_FragColor.xyz = mix(vec3(0), ambient, da);
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
index e3d5fdcf106..5fbbc0a0cce 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2D	  bloomMap;
 uniform sampler2DRect edgeMap;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
index 7c290fc993c..53bbcc0300e 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect lightMap;
 uniform sampler2DRect diffuseRect;
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
index 662f5fb6bec..6d179426837 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
   
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 
@@ -96,5 +98,4 @@ void main()
 	col.rgb += bcol*lum;
 	
 	gl_FragColor = col;
-	//gl_FragColor.rgb = texture2DRect(giLightMap, vary_fragcoord.xy).rgb;
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
index ecab3baeee9..44b36d33070 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform sampler2DRect giLightMap;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 664cec64c31..cc6d080344a 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -23,10 +23,12 @@
  * $/LicenseInfo$
  */
  
-
-
 #extension GL_ARB_texture_rectangle : enable
 
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
 uniform sampler2DRect diffuseRect;
 uniform sampler2DRect specularRect;
 uniform sampler2DRect normalMap;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
index 80e08e8270f..4d4b5b190a0 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
@@ -22,7 +22,10 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
+#ifndef gl_FragData
+out vec4 gl_FragData[3];
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-- 
GitLab


From 4f99ace06944a704e46cc3014607f3a5a4ef246b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 17 Sep 2011 00:19:19 -0500
Subject: [PATCH 026/933] SH-2243 work in progress -- put back ambient lighting
 when atmospheric shaders disabled.

---
 indra/llrender/llrender.cpp                   | 14 +++++++++++
 indra/llrender/llrender.h                     |  4 +++-
 .../class1/deferred/alphaSkinnedV.glsl        |  2 +-
 .../class1/lighting/lightSpecularV.glsl       |  3 ++-
 .../shaders/class1/lighting/lightV.glsl       |  3 ++-
 .../windlight/atmosphericsHelpersV.glsl       |  3 ++-
 indra/newview/llviewerdisplay.cpp             | 12 ++++------
 indra/newview/llviewerwindow.cpp              | 11 +++------
 indra/newview/pipeline.cpp                    | 24 ++++++-------------
 9 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 5f5b76d4251..f0d59d0eaf6 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1114,6 +1114,7 @@ void LLRender::syncLightState()
 		shader->uniform3fv("light_direction", 8, direction[0].mV);
 		shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);
 		shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);
+		shader->uniform4fv("light_ambient", 1, mAmbientLightColor.mV);
 	}
 }
 
@@ -1638,6 +1639,19 @@ LLLightState* LLRender::getLight(U32 index)
 	return NULL;
 }
 
+void LLRender::setAmbientLightColor(const LLColor4& color)
+{
+	if (color != mAmbientLightColor)
+	{
+		++mLightHash;
+		mAmbientLightColor = color;
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glLightModelfv(GL_LIGHT_MODEL_AMBIENT, color.mV);
+		}
+	}
+}
+
 bool LLRender::verifyTexUnitActive(U32 unitToVerify)
 {
 	if (mCurrTextureUnitIndex == unitToVerify)
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 3f319022f69..7d636060f59 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -406,7 +406,8 @@ class LLRender
 		       eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor);
 
 	LLLightState* getLight(U32 index);
-
+	void setAmbientLightColor(const LLColor4& color);
+	
 	LLTexUnit* getTexUnit(U32 index);
 
 	U32	getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; }
@@ -437,6 +438,7 @@ class LLRender
 	glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH];
 	U32 mCurMatHash[NUM_MATRIX_MODES];
 	U32 mLightHash;
+	LLColor4 mAmbientLightColor;
 	
 	bool			mDirty;
 	U32				mCount;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 15781bc92d7..b07c1fda9b4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -105,7 +105,7 @@ void main()
 	
 	vec4 frag_pos = projection_matrix * pos;
 	gl_Position = frag_pos;
-	
+	GL
 	vary_position = pos.xyz;
 	vary_normal = norm;	
 	
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
index bf6ed5988e5..265d548ce9a 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
@@ -26,6 +26,7 @@
 
 uniform vec4 light_position[8];
 uniform vec3 light_diffuse[8];
+uniform vec4 light_ambient;
 
 float calcDirectionalLight(vec3 n, vec3 l);
 
@@ -36,7 +37,7 @@ vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularCo
 	vec4 col;
 	col.a = color.a;
 
-	col.rgb = baseCol.rgb;  //need ambient?
+	col.rgb = baseCol.rgb + light_ambient.rgb;
 
 	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz);
 	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
index 79e22079322..b886f977439 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
@@ -26,6 +26,7 @@
 
 uniform vec4 light_position[8];
 uniform vec3 light_diffuse[8];
+uniform vec4 light_ambient;
 
 float calcDirectionalLight(vec3 n, vec3 l);
 
@@ -34,7 +35,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
 	vec4 col;
 	col.a = color.a;
 	
-	col.rgb = baseLight.rgb;  //need ambient?
+	col.rgb = baseLight.rgb+light_ambient.rgb;  
 	
 	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz);
 	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index 9aa583afa1d..ed0249330ea 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -24,10 +24,11 @@
  */
  
 uniform vec3 light_diffuse[8];
+uniform vec4 light_ambient;
 
 vec3 atmosAmbient(vec3 light)
 {
-	return light;  //need ambient?
+	return light + light_ambient.rgb;
 }
 
 vec3 atmosAffectDirectionalLight(float lightIntensity)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 22f4db56ddc..4f3127805f8 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -522,14 +522,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 	// Slam lighting parameters back to our defaults.
 	// Note that these are not the same as GL defaults...
 
-	if (!LLGLSLShader::sNoFixedFunction)
-	{
-		stop_glerror();
-		F32 one[4] =	{1.f, 1.f, 1.f, 1.f};
-		glLightModelfv (GL_LIGHT_MODEL_AMBIENT,one);
-		stop_glerror();
-	}
-		
+	stop_glerror();
+	gGL.setAmbientLightColor(LLColor4::white);
+	stop_glerror();
+			
 	/////////////////////////////////////
 	//
 	// Render
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cd9dc461d56..cfdbfd3f03e 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1712,10 +1712,8 @@ void LLViewerWindow::initGLDefaults()
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
 	glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
 
-	F32 ambient[4] = {0.f,0.f,0.f,0.f };
-	F32 diffuse[4] = {1.f,1.f,1.f,1.f };
-	glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,ambient);
-	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,diffuse);
+	glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,LLColor4::black.mV);
+	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,LLColor4::white.mV);
 	
 	glPixelStorei(GL_PACK_ALIGNMENT,1);
 	glPixelStorei(GL_UNPACK_ALIGNMENT,1);
@@ -1725,10 +1723,7 @@ void LLViewerWindow::initGLDefaults()
 	// lights for objects
 	glShadeModel( GL_SMOOTH );
 
-	if (!LLGLSLShader::sNoFixedFunction)
-	{
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
-	}
+	gGL.setAmbientLightColor(LLColor4::black);
 	
 	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index ebad1f77c4c..db614388f43 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5057,7 +5057,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
 	if (!LLGLSLShader::sNoFixedFunction)
 	{
 		LLColor4 ambient = gSky.getTotalAmbientColor();
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
+		gGL.setAmbientLightColor(ambient);
 	}
 
 	// Light 0 = Sun or Moon (All objects)
@@ -5285,12 +5285,8 @@ void LLPipeline::enableLights(U32 mask)
 		mLightMask = mask;
 		stop_glerror();
 
-		if (!LLGLSLShader::sNoFixedFunction)
-		{
-			LLColor4 ambient = gSky.getTotalAmbientColor();
-			glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
-		}
-		
+		LLColor4 ambient = gSky.getTotalAmbientColor();
+		gGL.setAmbientLightColor(ambient);
 	}
 }
 
@@ -5342,10 +5338,10 @@ void LLPipeline::enableLightsPreview()
 	if (!LLGLSLShader::sNoFixedFunction)
 	{
 		glEnable(GL_LIGHTING);
-		LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor");
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV);
 	}
 
+	LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor");
+	gGL.setAmbientLightColor(ambient);
 
 	LLColor4 diffuse0 = gSavedSettings.getColor4("PreviewDiffuse0");
 	LLColor4 specular0 = gSavedSettings.getColor4("PreviewSpecular0");
@@ -5403,10 +5399,7 @@ void LLPipeline::enableLightsAvatarEdit(const LLColor4& color)
 	setupAvatarLights(TRUE);
 	enableLights(mask);
 
-	if (!LLGLSLShader::sNoFixedFunction)
-	{
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
-	}
+	gGL.setAmbientLightColor(color);
 }
 
 void LLPipeline::enableLightsFullbright(const LLColor4& color)
@@ -5415,10 +5408,7 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color)
 	U32 mask = 0x1000; // Non-0 mask, set ambient
 	enableLights(mask);
 
-	if (!LLGLSLShader::sNoFixedFunction)
-	{
-		glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
-	}
+	gGL.setAmbientLightColor(color);
 }
 
 void LLPipeline::disableLights()
-- 
GitLab


From 0c2876ef2c9c9b5e739329de9a2c261185b094f1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 17 Sep 2011 00:25:49 -0500
Subject: [PATCH 027/933] SH-2243 work in progress -- how'd that GL get there?

---
 .../app_settings/shaders/class1/deferred/alphaSkinnedV.glsl     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index b07c1fda9b4..15781bc92d7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -105,7 +105,7 @@ void main()
 	
 	vec4 frag_pos = projection_matrix * pos;
 	gl_Position = frag_pos;
-	GL
+	
 	vary_position = pos.xyz;
 	vary_normal = norm;	
 	
-- 
GitLab


From 421e52ff98b67398843482713d754678a7153f50 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 17 Sep 2011 02:36:43 -0500
Subject: [PATCH 028/933] SH-2243 work in progress -- gDEBugger guided removal
 of deprecated state changes

---
 indra/llrender/llcubemap.cpp        |  5 +++--
 indra/llrender/llgl.cpp             | 19 ++++++++++++++++---
 indra/llrender/llimagegl.cpp        |  4 +++-
 indra/newview/lldrawpoolterrain.cpp | 13 +++----------
 indra/newview/llvosky.cpp           |  5 ++++-
 indra/newview/pipeline.cpp          | 16 +++++++++++++---
 6 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index 5eb29efbfa5..a75f01c7088 100644
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -36,6 +36,7 @@
 #include "m4math.h"
 
 #include "llrender.h"
+#include "llglslshader.h"
 
 #include "llglheaders.h"
 
@@ -195,7 +196,7 @@ void LLCubeMap::enableTexture(S32 stage)
 void LLCubeMap::enableTextureCoords(S32 stage)
 {
 	mTextureCoordStage = stage;
-	if (gGLManager.mHasCubeMap && stage >= 0 && LLCubeMap::sUseCubeMaps)
+	if (!LLGLSLShader::sNoFixedFunction && gGLManager.mHasCubeMap && stage >= 0 && LLCubeMap::sUseCubeMaps)
 	{
 		if (stage > 0)
 		{
@@ -237,7 +238,7 @@ void LLCubeMap::disableTexture(void)
 
 void LLCubeMap::disableTextureCoords(void)
 {
-	if (gGLManager.mHasCubeMap && mTextureCoordStage >= 0 && LLCubeMap::sUseCubeMaps)
+	if (!LLGLSLShader::sNoFixedFunction && gGLManager.mHasCubeMap && mTextureCoordStage >= 0 && LLCubeMap::sUseCubeMaps)
 	{
 		if (mTextureCoordStage > 0)
 		{
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 1667afe1796..32d8b105a31 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1783,17 +1783,30 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) :
 	mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE)
 {
 	if (LLGLSLShader::sNoFixedFunction)
-	{ //always disable state that's deprecated post GL 3.0
+	{ //always ignore state that's deprecated post GL 3.0
 		switch (state)
 		{
 			case GL_ALPHA_TEST:
-				enabled = 0;
+			case GL_RESCALE_NORMAL:
+			case GL_NORMALIZE:
+			case GL_TEXTURE_GEN_R:
+			case GL_TEXTURE_GEN_S:
+			case GL_TEXTURE_GEN_T:
+			case GL_TEXTURE_GEN_Q:
+			case GL_VERTEX_PROGRAM_TWO_SIDE:
+			case GL_LIGHTING:
+			case GL_COLOR_MATERIAL:
+			case GL_CLAMP_VERTEX_COLOR:
+			case GL_CLAMP_FRAGMENT_COLOR:
+			case GL_FOG:
+			case GL_LINE_STIPPLE:
+				mState = 0;
 				break;
 		}
 	}
 
 	stop_glerror();
-	if (state)
+	if (mState)
 	{
 		mWasEnabled = sStateMap[state];
 		llassert(mWasEnabled == glIsEnabled(state));
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 7188b0fa440..128773df5aa 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -36,7 +36,9 @@
 
 #include "llmath.h"
 #include "llgl.h"
+#include "llglslshader.h"
 #include "llrender.h"
+
 //----------------------------------------------------------------------------
 const F32 MIN_TEXTURE_LIFETIME = 10.f;
 
@@ -723,7 +725,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 		}
 		else if (!is_compressed)
 		{
-			if (mAutoGenMips)
+			if (mAutoGenMips && !LLGLSLShader::sNoFixedFunction) //auto-generating mipmaps is deprecated in GL 3.0
 			{
 				glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
 				stop_glerror();
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index cac8439eb82..5078da02e39 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -383,14 +383,11 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(alpha_ramp)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(4)->disable();
 	gGL.getTexUnit(4)->activate();
-	glDisable(GL_TEXTURE_GEN_S);
-	glDisable(GL_TEXTURE_GEN_T);
 	
 	gGL.getTexUnit(detail3)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(3)->disable();
 	gGL.getTexUnit(3)->activate();
-	glDisable(GL_TEXTURE_GEN_S);
-	glDisable(GL_TEXTURE_GEN_T);
+	
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -398,8 +395,7 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(detail2)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(2)->disable();
 	gGL.getTexUnit(2)->activate();
-	glDisable(GL_TEXTURE_GEN_S);
-	glDisable(GL_TEXTURE_GEN_T);
+	
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -407,8 +403,7 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(detail1)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(1)->disable();
 	gGL.getTexUnit(1)->activate();
-	glDisable(GL_TEXTURE_GEN_S);
-	glDisable(GL_TEXTURE_GEN_T);
+	
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -419,8 +414,6 @@ void LLDrawPoolTerrain::renderFullShader()
 	gGL.getTexUnit(detail0)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(0)->activate();
-	glDisable(GL_TEXTURE_GEN_S);
-	glDisable(GL_TEXTURE_GEN_T);
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index ef21e7373e4..29ca16ede61 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -2162,7 +2162,10 @@ void LLVOSky::updateFog(const F32 distance)
 
 	glFogf(GL_FOG_DENSITY, fog_density);
 
-	glHint(GL_FOG_HINT, GL_NICEST);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glHint(GL_FOG_HINT, GL_NICEST);
+	}
 	stop_glerror();
 }
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index db614388f43..2248d181551 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5236,7 +5236,11 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
 	}
 
 	// Init GL state
-	glDisable(GL_LIGHTING);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glDisable(GL_LIGHTING);
+	}
+
 	for (S32 i = 0; i < 8; ++i)
 	{
 		gGL.getLight(i)->disable();
@@ -5257,7 +5261,10 @@ void LLPipeline::enableLights(U32 mask)
 		stop_glerror();
 		if (!mLightMask)
 		{
-			glEnable(GL_LIGHTING);
+			if (!LLGLSLShader::sNoFixedFunction)
+			{
+				glEnable(GL_LIGHTING);
+			}
 		}
 		if (mask)
 		{
@@ -5280,7 +5287,10 @@ void LLPipeline::enableLights(U32 mask)
 		}
 		else
 		{
-			glDisable(GL_LIGHTING);
+			if (!LLGLSLShader::sNoFixedFunction)
+			{
+				glDisable(GL_LIGHTING);
+			}
 		}
 		mLightMask = mask;
 		stop_glerror();
-- 
GitLab


From 861b7eba60ab71c5f9c68e46e207d8767d3e07f7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 17 Sep 2011 19:02:21 -0500
Subject: [PATCH 029/933] SH-2243 fix for mac build

---
 indra/llrender/llgl.cpp      | 4 ----
 indra/llrender/llimagegl.cpp | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 32d8b105a31..771693f2f0c 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1787,17 +1787,13 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) :
 		switch (state)
 		{
 			case GL_ALPHA_TEST:
-			case GL_RESCALE_NORMAL:
 			case GL_NORMALIZE:
 			case GL_TEXTURE_GEN_R:
 			case GL_TEXTURE_GEN_S:
 			case GL_TEXTURE_GEN_T:
 			case GL_TEXTURE_GEN_Q:
-			case GL_VERTEX_PROGRAM_TWO_SIDE:
 			case GL_LIGHTING:
 			case GL_COLOR_MATERIAL:
-			case GL_CLAMP_VERTEX_COLOR:
-			case GL_CLAMP_FRAGMENT_COLOR:
 			case GL_FOG:
 			case GL_LINE_STIPPLE:
 				mState = 0;
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 128773df5aa..0fb4a7784ab 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -725,7 +725,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 		}
 		else if (!is_compressed)
 		{
-			if (mAutoGenMips && !LLGLSLShader::sNoFixedFunction) //auto-generating mipmaps is deprecated in GL 3.0
+			if (mAutoGenMips) //auto-generating mipmaps is deprecated in GL 3.0
 			{
 				glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
 				stop_glerror();
-- 
GitLab


From 2ead1691317e9bf32e996fa1f6a70f6a2a9ced02 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 19 Sep 2011 17:41:29 -0500
Subject: [PATCH 030/933] SH-2243 fix for error in cloth shader

---
 indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index 9a14d496e9c..7fb3cb65529 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -129,8 +129,4 @@ void main()
 	vertex_color = color; 
 					
 	gl_Position = projection_matrix * pos;
-	
-	
-	vary_texcoord2 = vec4(pos.xyz, 1.0);
-
 }
-- 
GitLab


From 9ea41c8094695365bc7ea10165ffd54cda204e88 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 20 Sep 2011 00:54:37 -0500
Subject: [PATCH 031/933] SH-2243 No deprecated calls for the whole session.

---
 indra/llrender/llglslshader.cpp               |   1 +
 indra/llui/llui.cpp                           |  14 ++-
 .../shaders/class1/interface/alphamaskF.glsl  |  47 ++++++++
 .../shaders/class1/interface/alphamaskV.glsl  |  42 +++++++
 indra/newview/lldynamictexture.cpp            |   5 -
 indra/newview/llfloatermodelpreview.cpp       |  21 ++++
 indra/newview/llstartup.cpp                   |   5 -
 indra/newview/lltexlayer.cpp                  | 103 ++++++++++++++++--
 indra/newview/llviewershadermgr.cpp           |  13 +++
 indra/newview/llviewershadermgr.h             |   3 +-
 indra/newview/llviewerwindow.cpp              |  33 ++++--
 11 files changed, 251 insertions(+), 36 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 2488e4c5398..0dcf5634914 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -1000,6 +1000,7 @@ void LLGLSLShader::vertexAttrib4fv(U32 index, GLfloat* v)
 
 void LLGLSLShader::setAlphaRange(F32 minimum, F32 maximum)
 {
+	gGL.flush();
 	uniform1f("minimum_alpha", minimum);
 	uniform1f("maximum_alpha", maximum);
 }
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index b7894f5bf7b..212672b809e 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -992,10 +992,18 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
 	// ...gray squares
 	gGL.color4f( .7f, .7f, .7f, alpha );
 	gGL.flush();
-	glPolygonStipple( checkerboard );
 
-	LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE);
-	gl_rect_2d(rect);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{ //polygon stipple is deprecated
+		glPolygonStipple( checkerboard );
+
+		LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE);
+		gl_rect_2d(rect);
+	}
+	else
+	{
+		gl_rect_2d(rect);
+	}
 	gGL.flush();
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
new file mode 100644
index 00000000000..433ecc9d2aa
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -0,0 +1,47 @@
+/** 
+ * @file alphamaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef gl_FragColor
+out vec4 gl_FragColor;
+#endif
+
+uniform sampler2D diffuseMap;
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec4 vertex_color;
+
+void main() 
+{
+	vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
+	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	gl_FragColor = col;
+}
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl
new file mode 100644
index 00000000000..3580d1f27b2
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl
@@ -0,0 +1,42 @@
+/** 
+ * @file alphamaskV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void main()
+{
+	gl_Position = modelview_projection_matrix * vec4(position, 1);
+	vary_texcoord0 =  (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vertex_color = diffuse_color;
+}
+
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 6f9ff6c2108..5d6081a35cf 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -211,9 +211,6 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 	LLGLSLShader::bindNoShader();
 	LLVertexBuffer::unbind();
 	
-	bool no_ff = LLGLSLShader::sNoFixedFunction;
-	LLGLSLShader::sNoFixedFunction = false;
-
 	BOOL result = FALSE;
 	BOOL ret = FALSE ;
 	for( S32 order = 0; order < ORDER_COUNT; order++ )
@@ -244,8 +241,6 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		}
 	}
 
-	LLGLSLShader::sNoFixedFunction = no_ff;
-
 	return ret;
 }
 
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6412a573f5f..4e06fb434a4 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -102,6 +102,7 @@
 #include "llviewerobjectlist.h"
 #include "llanimationstates.h"
 #include "llviewernetwork.h"
+#include "llviewershadermgr.h"
 #include "glod/glod.h"
 #include <boost/algorithm/string.hpp>
 
@@ -4729,6 +4730,8 @@ BOOL LLModelPreview::render()
 	LLMutexLock lock(this);
 	mNeedsUpdate = FALSE;
 
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
 	bool edges = mViewOption["show_edges"];
 	bool joint_positions = mViewOption["show_joint_positions"];
 	bool skin_weight = mViewOption["show_skin_weight"];
@@ -4745,6 +4748,10 @@ BOOL LLModelPreview::render()
 	LLGLDisable fog(GL_FOG);
 
 	{
+		if (use_shaders)
+		{
+			gUIProgram.bind();
+		}
 		//clear background to blue
 		gGL.matrixMode(LLRender::MM_PROJECTION);
 		gGL.pushMatrix();
@@ -4764,6 +4771,10 @@ BOOL LLModelPreview::render()
 
 		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		gGL.popMatrix();
+		if (use_shaders)
+		{
+			gUIProgram.unbind();
+		}
 	}
 
 	LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
@@ -4895,6 +4906,11 @@ BOOL LLModelPreview::render()
 
 	const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
 
+	if (use_shaders)
+	{
+		gObjectPreviewProgram.bind();
+	}
+
 	LLGLEnable normalize(GL_NORMALIZE);
 
 	if (!mBaseModel.empty() && mVertexBuffer[5].empty())
@@ -5297,6 +5313,11 @@ BOOL LLModelPreview::render()
 		}
 	}
 
+	if (use_shaders)
+	{
+		gObjectPreviewProgram.unbind();
+	}
+
 	gGL.popMatrix();
 
 	return TRUE;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 749acea6c10..11a4c96f144 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1919,11 +1919,6 @@ bool idle_startup()
 				LLTrans::getString("LoginPrecaching"),
 					gAgent.mMOTD);
 			display_startup();
-			if (!LLViewerShaderMgr::sInitialized)
-			{
-				LLViewerShaderMgr::sInitialized = TRUE;
-				LLViewerShaderMgr::instance()->setShaders();
-			}
 		}
 		
 		return TRUE;
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index e2c2b2ae21c..9f5cbf6ec88 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -294,13 +294,17 @@ BOOL LLTexLayerSetBuffer::render()
 	const BOOL update_now = mNeedsUpdate && isReadyToUpdate();
 	
 	BOOL success = TRUE;
+	
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
+	if (use_shaders)
+	{
+		gAlphaMaskProgram.bind();
+		gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+	}
 
 	LLVertexBuffer::unbind();
 
-	//hack to use fixed function when updating tex layer sets
-	bool no_ff = LLGLSLShader::sNoFixedFunction;
-	LLGLSLShader::sNoFixedFunction = false;
-	
 	// Composite the color data
 	LLGLSUIDefault gls_ui;
 	success &= mTexLayerSet->render( mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight );
@@ -335,8 +339,12 @@ BOOL LLTexLayerSetBuffer::render()
 		doUpdate();
 	}
 
+	if (use_shaders)
+	{
+		gAlphaMaskProgram.unbind();
+	}
+
 	LLVertexBuffer::unbind();
-	LLGLSLShader::sNoFixedFunction = no_ff;
 	
 	// reset GL state
 	gGL.setColorMask(true, true);
@@ -927,6 +935,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 		}
 	}
 
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
 	LLGLSUIDefault gls_ui;
 	LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
 	gGL.setColorMask(true, true);
@@ -935,12 +945,20 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 	{
 		gGL.flush();
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.0f, 1.f);
+		}
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4f( 0.f, 0.f, 0.f, 1.f );
 
 		gl_rect_2d_simple( width, height );
 
 		gGL.flush();
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+		}
 	}
 
 	if (mIsVisible)
@@ -967,6 +985,11 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 
 		gGL.setSceneBlendType(LLRender::BT_REPLACE);
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+		}
+
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4f( 0.f, 0.f, 0.f, 0.f );
 
@@ -974,7 +997,10 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 		gGL.setSceneBlendType(LLRender::BT_ALPHA);
 
 		gGL.flush();
-
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+		}
 	}
 
 	return success;
@@ -1081,13 +1107,14 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
 {
 	const LLTexLayerSetInfo *info = getInfo();
 	
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
 	gGL.setColorMask(false, true);
 	gGL.setSceneBlendType(LLRender::BT_REPLACE);
 	
 	// (Optionally) replace alpha with a single component image from a tga file.
 	if (!info->mStaticAlphaFileName.empty())
 	{
-		LLGLSNoAlphaTest gls_no_alpha_test;
 		gGL.flush();
 		{
 			LLViewerTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, TRUE);
@@ -1106,12 +1133,20 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
 		// Set the alpha channel to one (clean up after previous blending)
 		gGL.flush();
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+		}
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4f( 0.f, 0.f, 0.f, 1.f );
 		
 		gl_rect_2d_simple( width, height );
 		
 		gGL.flush();
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+		}
 	}
 	
 	// (Optional) Mask out part of the baked texture with alpha masks
@@ -1596,6 +1631,8 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 	LLGLEnable color_mat(GL_COLOR_MATERIAL);
 	gPipeline.disableLights();
 
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
 	LLColor4 net_color;
 	BOOL color_specified = findNetColor(&net_color);
 	
@@ -1676,8 +1713,13 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 			{
 				if( tex )
 				{
-					LLGLDisable alpha_test(getInfo()->mWriteAllChannels ? GL_ALPHA_TEST : 0);
-
+					bool no_alpha_test = getInfo()->mWriteAllChannels;
+					LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0);
+					if (use_shaders && no_alpha_test)
+					{
+						gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+					}
+					
 					LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
 					
 					gGL.getTexUnit(0)->bind(tex, TRUE);
@@ -1687,6 +1729,11 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 
 					gGL.getTexUnit(0)->setTextureAddressMode(old_mode);
 					gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+					if (use_shaders && no_alpha_test)
+					{
+						gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+					}
+					
 				}
 			}
 //			else
@@ -1719,9 +1766,17 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 		color_specified )
 	{
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+		}
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4fv( net_color.mV );
 		gl_rect_2d_simple( width, height );
+		if (use_shaders)
+		{
+			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+		}
 	}
 
 	if( alpha_mask_specified || getInfo()->mWriteAllChannels )
@@ -1809,15 +1864,25 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
 
 	gGL.flush();
 	
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
 	if( !getInfo()->mStaticImageFileName.empty() )
 	{
 		LLViewerTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask );
 		if( tex )
 		{
 			LLGLSNoAlphaTest gls_no_alpha_test;
+			if (use_shaders)
+			{
+				gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+			}
 			gGL.getTexUnit(0)->bind(tex, TRUE);
 			gl_rect_2d_simple_tex( width, height );
 			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+			if (use_shaders)
+			{
+				gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+			}
 		}
 		else
 		{
@@ -1832,10 +1897,18 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
 			if (tex)
 			{
 				LLGLSNoAlphaTest gls_no_alpha_test;
+				if (use_shaders)
+				{
+					gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+				}
 				gGL.getTexUnit(0)->bind(tex);
 				gl_rect_2d_simple_tex( width, height );
 				gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 				success = TRUE;
+				if (use_shaders)
+				{
+					gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+				}
 			}
 		}
 	}
@@ -1854,6 +1927,13 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 
 	llassert( !mParamAlphaList.empty() );
 
+	bool use_shaders = LLGLSLShader::sNoFixedFunction;
+
+	if (use_shaders)
+	{
+		gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+	}
+
 	gGL.setColorMask(false, true);
 
 	LLTexLayerParamAlpha* first_param = *mParamAlphaList.begin();
@@ -1891,7 +1971,6 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 		if( tex && (tex->getComponents() == 4) )
 		{
 			LLGLSNoAlphaTest gls_no_alpha_test;
-
 			LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
 			
 			gGL.getTexUnit(0)->bind(tex, TRUE);
@@ -1930,6 +2009,10 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 		gl_rect_2d_simple( width, height );
 	}
 
+	if (use_shaders)
+	{
+		gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+	}
 
 	LLGLSUIDefault gls_ui;
 
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 7155311f8ef..23351fc9945 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -70,6 +70,7 @@ LLGLSLShader	gGlowCombineFXAAProgram;
 LLGLSLShader	gTwoTextureAddProgram;
 LLGLSLShader	gOneTextureNoColorProgram;
 LLGLSLShader	gDebugProgram;
+LLGLSLShader	gAlphaMaskProgram;
 
 //object shaders
 LLGLSLShader		gObjectSimpleProgram;
@@ -219,6 +220,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gSolidColorProgram);
 	mShaderList.push_back(&gOcclusionProgram);
 	mShaderList.push_back(&gDebugProgram);
+	mShaderList.push_back(&gAlphaMaskProgram);
 	mShaderList.push_back(&gObjectEmissiveProgram);
 	mShaderList.push_back(&gObjectEmissiveWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightProgram);
@@ -674,6 +676,7 @@ void LLViewerShaderMgr::unloadShaders()
 {
 	gOcclusionProgram.unload();
 	gDebugProgram.unload();
+	gAlphaMaskProgram.unload();
 	gUIProgram.unload();
 	gCustomAlphaProgram.unload();
 	gGlowCombineProgram.unload();
@@ -2747,6 +2750,16 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
 		success = gDebugProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gAlphaMaskProgram.mName = "Alpha Mask Shader";
+		gAlphaMaskProgram.mShaderFiles.clear();
+		gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER_ARB));
+		gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gAlphaMaskProgram.createShader(NULL, NULL);
+	}
+
 	if( !success )
 	{
 		mVertexShaderLevel[SHADER_INTERFACE] = 0;
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 1c9d7f84532..9988d1d4f73 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -275,7 +275,8 @@ extern LLGLSLShader			gCustomAlphaProgram;
 extern LLGLSLShader			gGlowCombineProgram;
 extern LLGLSLShader			gSplatTextureRectProgram;
 extern LLGLSLShader			gGlowCombineFXAAProgram;
-extern LLGLSLShader		gDebugProgram;
+extern LLGLSLShader			gDebugProgram;
+extern LLGLSLShader			gAlphaMaskProgram;
 
 //output tex0[tc0] + tex1[tc1]
 extern LLGLSLShader			gTwoTextureAddProgram;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cfdbfd3f03e..2e2614e4291 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1574,6 +1574,12 @@ LLViewerWindow::LLViewerWindow(
 		ignore_pixel_depth,
 		gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled
 
+	if (!LLViewerShaderMgr::sInitialized)
+	{ //immediately initialize shaders
+		LLViewerShaderMgr::sInitialized = TRUE;
+		LLViewerShaderMgr::instance()->setShaders();
+	}
+
 	if (NULL == mWindow)
 	{
 		LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate"));
@@ -1710,23 +1716,26 @@ LLViewerWindow::LLViewerWindow(
 void LLViewerWindow::initGLDefaults()
 {
 	gGL.setSceneBlendType(LLRender::BT_ALPHA);
-	glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
 
-	glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,LLColor4::black.mV);
-	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,LLColor4::white.mV);
-	
-	glPixelStorei(GL_PACK_ALIGNMENT,1);
-	glPixelStorei(GL_UNPACK_ALIGNMENT,1);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{ //initialize fixed function state
+		glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
 
-	gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
+		glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,LLColor4::black.mV);
+		glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,LLColor4::white.mV);
 
-	// lights for objects
-	glShadeModel( GL_SMOOTH );
+		// lights for objects
+		glShadeModel( GL_SMOOTH );
 
-	gGL.setAmbientLightColor(LLColor4::black);
-	
-	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
+		gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
+		gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
+	}
 
+	glPixelStorei(GL_PACK_ALIGNMENT,1);
+	glPixelStorei(GL_UNPACK_ALIGNMENT,1);
+
+	gGL.setAmbientLightColor(LLColor4::black);
+		
 	glCullFace(GL_BACK);
 
 	// RN: Need this for translation and stretch manip.
-- 
GitLab


From 66acb932ba7bbd7fecbe78a34e753b5aab2d2104 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 20 Sep 2011 03:34:09 -0500
Subject: [PATCH 032/933] SH-2244 Add "RenderGLCoreProfile" debug setting that
 allows the viewer to start with a non-compatibility-profile OpenGL context.

---
 indra/llrender/llgl.cpp                 | 13 ++++++++++++
 indra/llrender/llglheaders.h            |  2 ++
 indra/llrender/llrender.cpp             |  1 +
 indra/llrender/llrender.h               |  1 +
 indra/llwindow/llwindowwin32.cpp        | 28 +++++++++++++++++++++++++
 indra/newview/app_settings/settings.xml | 11 ++++++++++
 indra/newview/llappviewer.cpp           |  2 ++
 7 files changed, 58 insertions(+)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 771693f2f0c..718de346f6e 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -249,6 +249,10 @@ PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB = NULL;
 PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = NULL;
 PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = NULL;
 
+#if LL_WINDOWS
+PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
+#endif
+
 // vertex shader prototypes
 #if LL_LINUX || LL_SOLARIS
 PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB = NULL;
@@ -409,6 +413,15 @@ void LLGLManager::initWGL()
 		LL_WARNS("RenderInit") << "No ARB pixel format extensions" << LL_ENDL;
 	}
 
+	if (ExtensionExists("WGL_ARB_create_context",gGLHExts.mSysExts))
+	{
+		GLH_EXT_NAME(wglCreateContextAttribsARB) = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB");
+	}
+	else
+	{
+		LL_WARNS("RenderInit") << "No ARB create context extensions" << LL_ENDL;
+	}
+	
 	if (ExtensionExists("WGL_EXT_swap_control", gGLHExts.mSysExts))
 	{
         GLH_EXT_NAME(wglSwapIntervalEXT) = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT");
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 851a75629e1..f319009bc8e 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -531,6 +531,8 @@ extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 #include "GL/glext.h"
 #include "GL/glh_extensions.h"
 
+// WGL_ARB_create_context
+extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
 
 // GL_ARB_vertex_buffer_object
 extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index f0d59d0eaf6..efeb7709a44 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -47,6 +47,7 @@ S32	gGLViewport[4];
 U32 LLRender::sUICalls = 0;
 U32 LLRender::sUIVerts = 0;
 U32 LLTexUnit::sWhiteTexture = 0;
+bool LLRender::sGLCoreProfile = false;
 
 static const U32 LL_NUM_TEXTURE_LAYERS = 32; 
 static const U32 LL_NUM_LIGHT_UNITS = 8;
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 7d636060f59..44d9ec1f156 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -428,6 +428,7 @@ class LLRender
 public:
 	static U32 sUICalls;
 	static U32 sUIVerts;
+	static bool sGLCoreProfile;
 	
 private:
 	friend class LLLightState;
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 1239e2d40b0..2ba14f8f6ef 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1122,6 +1122,34 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 
 	gGLManager.initWGL();
 
+	if (wglCreateContextAttribsARB && LLRender::sGLCoreProfile)
+	{
+		S32 attribs[] = 
+		{
+			WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
+			WGL_CONTEXT_MINOR_VERSION_ARB, 0,
+			WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
+			0
+		};
+
+		HGLRC res = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
+
+		if (!res)
+		{
+			attribs[1] = 3;
+			attribs[3] = 1;
+
+			res = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
+		}
+
+		if (res)
+		{
+			wglMakeCurrent(mhDC, res);
+			wglDeleteContext(mhRC);
+			mhRC = res;
+		}
+	}
+	
 	if (wglChoosePixelFormatARB)
 	{
 		// OK, at this point, use the ARB wglChoosePixelFormatsARB function to see if we
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 27598c9aac3..32d4097ff36 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8591,6 +8591,17 @@
       <key>Value</key>
       <real>1.0</real>
     </map>
+    <key>RenderGLCoreProfile</key>
+    <map>
+      <key>Comment</key>
+      <string>Don't use a compatibility profile OpenGL context.  Requires restart.  Basic shaders MUST be enabled.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>RenderGlow</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 7e597fe5dc6..bb0679de74d 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -518,6 +518,8 @@ static void settings_to_globals()
 
 	LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
 	
+	LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile");
+
 	LLImageGL::sGlobalUseAnisotropic	= gSavedSettings.getBOOL("RenderAnisotropic");
 	LLVOVolume::sLODFactor				= gSavedSettings.getF32("RenderVolumeLODFactor");
 	LLVOVolume::sDistanceFactor			= 1.f-LLVOVolume::sLODFactor * 0.1f;
-- 
GitLab


From aeec2661071ff14c3a9526a24a629443264a635b Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 20 Sep 2011 12:11:04 -0400
Subject: [PATCH 033/933] SH-2434 revert mac viewer sometimes freezes at start
 up

mutex mode change was ineffective, reverting the patch. Will do
future tests on a sidebranch.
---
 indra/llcommon/llthread.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 3f7f918f573..b631b96252f 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -151,15 +151,15 @@ class LL_COMMON_API LLThread
 
 //============================================================================
 
-//#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
+#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
 
-//#ifdef MUTEX_DEBUG
+#ifdef MUTEX_DEBUG
 // We really shouldn't be using recursive locks. Make sure of that in debug mode.
 #define MUTEX_FLAG APR_THREAD_MUTEX_UNNESTED
-//#else
+#else
 // Use the fastest platform-optimal lock behavior (can be recursive or non-recursive).
-//#define MUTEX_FLAG APR_THREAD_MUTEX_DEFAULT
-//#endif
+#define MUTEX_FLAG APR_THREAD_MUTEX_DEFAULT
+#endif
 
 class LL_COMMON_API LLMutexBase
 {
-- 
GitLab


From 812b6c60edbdae57cbe77b9c60c74a4bcbaf24ca Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 21 Sep 2011 15:01:15 -0400
Subject: [PATCH 034/933] Fix for sh-2467

---
 indra/newview/llfloatermodelpreview.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 75e775072bb..b31fa620fe6 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5066,6 +5066,8 @@ BOOL LLModelPreview::render()
 
 	if (!mModel[mPreviewLOD].empty())
 	{
+		mFMP->childEnable("reset_btn");
+
 		bool regen = mVertexBuffer[mPreviewLOD].empty();
 		if (!regen)
 		{
@@ -5563,6 +5565,7 @@ void LLFloaterModelPreview::onReset(void* user_data)
 	assert_main_thread();
 
 	LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) user_data;
+	fmp->childDisable("reset_btn");
 	LLModelPreview* mp = fmp->mModelPreview;
 	std::string filename = mp->mLODFile[3]; 
 
-- 
GitLab


From a2d08a6d80c4be7456d30f728da1838e63eb397f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 22 Sep 2011 00:10:57 -0500
Subject: [PATCH 035/933] SH-2244 Fix "RenderGLCoreProfile" actually make a
 core profile context and modify viewer to run under said context without
 generating errors.

---
 indra/llrender/llfontgl.cpp             |   2 +-
 indra/llrender/llgl.cpp                 | 102 ++++++++++--
 indra/llrender/llgl.h                   |   2 +
 indra/llrender/llglheaders.h            |  13 ++
 indra/llrender/llglslshader.cpp         |   7 +
 indra/llrender/llimagegl.cpp            |  99 ++++++++++--
 indra/llrender/llrender.cpp             | 205 +++++++++++++++++++++---
 indra/llrender/llrender.h               |   1 +
 indra/llrender/llvertexbuffer.cpp       | 191 +++++++++++++++++-----
 indra/llrender/llvertexbuffer.h         |  10 +-
 indra/llwindow/llwindowwin32.cpp        |  61 +++----
 indra/newview/app_settings/settings.xml |   2 +-
 indra/newview/lldrawpoolterrain.cpp     |   7 +-
 indra/newview/llspatialpartition.cpp    |   1 -
 indra/newview/llviewerjointmesh.cpp     |   2 +-
 indra/newview/llviewershadermgr.cpp     |  14 ++
 indra/newview/llvoavatarself.cpp        |  85 +---------
 indra/newview/llvoavatarself.h          |   3 -
 indra/newview/llvowlsky.cpp             |  10 +-
 indra/newview/pipeline.cpp              |  45 +-----
 20 files changed, 615 insertions(+), 247 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 607473d4166..54f72d103ea 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -329,7 +329,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 		
 		if (glyph_count >= GLYPH_BATCH_SIZE)
 		{
-			gGL.begin(LLRender::QUADS);
+			gGL.begin(LLRender::TRIANGLES);
 			{
 				gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4);
 			}
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 718de346f6e..6875674e792 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -67,6 +67,22 @@ static const std::string HEADLESS_VERSION_STRING("1.0");
 
 std::ofstream gFailLog;
 
+void APIENTRY gl_debug_callback(GLenum source,
+                                GLenum type,
+                                GLuint id,
+                                GLenum severity,
+                                GLsizei length,
+                                const GLchar* message,
+                                GLvoid* userParam)
+{
+	llwarns << "----- GL ERROR --------" << llendl;
+	llwarns << "Type: " << std::hex << type << llendl;
+	llwarns << "ID: " << std::hex << id << llendl;
+	llwarns << "Severity: " << std::hex << severity << llendl;
+	llwarns << "Message: " << message << llendl;
+	llwarns << "-----------------------" << llendl;
+}
+
 void ll_init_fail_log(std::string filename)
 {
 	gFailLog.open(filename.c_str());
@@ -110,6 +126,9 @@ std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
 
 #if (LL_WINDOWS || LL_LINUX || LL_SOLARIS)  && !LL_MESA_HEADLESS
 // ATI prototypes
+
+PFNGLGETSTRINGIPROC glGetStringi = NULL;
+
 // vertex blending prototypes
 PFNGLWEIGHTPOINTERARBPROC			glWeightPointerARB = NULL;
 PFNGLVERTEXBLENDARBPROC				glVertexBlendARB = NULL;
@@ -128,6 +147,12 @@ PFNGLUNMAPBUFFERARBPROC				glUnmapBufferARB = NULL;
 PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB = NULL;
 PFNGLGETBUFFERPOINTERVARBPROC		glGetBufferPointervARB = NULL;
 
+//GL_ARB_vertex_array_object
+PFNGLBINDVERTEXARRAYPROC glBindVertexArray = NULL;
+PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays = NULL;
+PFNGLGENVERTEXARRAYSPROC glGenVertexArrays = NULL;
+PFNGLISVERTEXARRAYPROC glIsVertexArray = NULL;
+
 // GL_ARB_map_buffer_range
 PFNGLMAPBUFFERRANGEPROC			glMapBufferRange = NULL;
 PFNGLFLUSHMAPPEDBUFFERRANGEPROC	glFlushMappedBufferRange = NULL;
@@ -197,10 +222,16 @@ PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample = NULL;
 PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer = NULL;
 
 //GL_ARB_texture_multisample
-PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample;
-PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample;
-PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
-PFNGLSAMPLEMASKIPROC glSampleMaski;
+PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample = NULL;
+PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample = NULL;
+PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv = NULL;
+PFNGLSAMPLEMASKIPROC glSampleMaski = NULL;
+
+//GL_ARB_debug_output
+PFNGLDEBUGMESSAGECONTROLARBPROC glDebugMessageControlARB = NULL;
+PFNGLDEBUGMESSAGEINSERTARBPROC glDebugMessageInsertARB = NULL;
+PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARB = NULL;
+PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB = NULL;
 
 // GL_EXT_blend_func_separate
 PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT = NULL;
@@ -353,6 +384,7 @@ LLGLManager::LLGLManager() :
 	mHasBlendFuncSeparate(FALSE),
 	mHasSync(FALSE),
 	mHasVertexBufferObject(FALSE),
+	mHasVertexArrayObject(FALSE),
 	mHasMapBufferRange(FALSE),
 	mHasFlushBufferRange(FALSE),
 	mHasPBuffer(FALSE),
@@ -374,6 +406,7 @@ LLGLManager::LLGLManager() :
 	mHasAnisotropic(FALSE),
 	mHasARBEnvCombine(FALSE),
 	mHasCubeMap(FALSE),
+	mHasDebugOutput(FALSE),
 
 	mIsATI(FALSE),
 	mIsNVIDIA(FALSE),
@@ -451,13 +484,39 @@ bool LLGLManager::initGL()
 		LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL;
 	}
 
-	GLint alpha_bits;
-	glGetIntegerv( GL_ALPHA_BITS, &alpha_bits );
-	if( 8 != alpha_bits )
+	if (!glGetStringi)
 	{
-		LL_WARNS("RenderInit") << "Frame buffer has less than 8 bits of alpha.  Avatar texture compositing will fail." << LL_ENDL;
+		glGetStringi = (PFNGLGETSTRINGIPROC) GLH_EXT_GET_PROC_ADDRESS("glGetStringi");
 	}
 
+	//reload extensions string (may have changed after using wglCreateContextAttrib)
+	if (glGetStringi)
+	{
+		std::stringstream str;
+
+		GLint count = 0;
+		glGetIntegerv(GL_NUM_EXTENSIONS, &count);
+		for (GLint i = 0; i < count; ++i)
+		{
+			str << (const char*) glGetStringi(GL_EXTENSIONS, i) << " ";
+		}
+		
+#if LL_WINDOWS
+		{
+			PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0;
+			wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
+			if(wglGetExtensionsStringARB)
+			{
+				str << (const char*) wglGetExtensionsStringARB(wglGetCurrentDC());
+			}
+		}
+#endif
+		free(gGLHExts.mSysExts);
+		std::string extensions = str.str();
+		gGLHExts.mSysExts = strdup(extensions.c_str());
+		
+	}
+	
 	// Extract video card strings and convert to upper case to
 	// work around driver-to-driver variation in capitalization.
 	mGLVendor = std::string((const char *)glGetString(GL_VENDOR));
@@ -595,6 +654,12 @@ bool LLGLManager::initGL()
 		glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
 	}
 
+	if (mHasDebugOutput && gDebugGL)
+	{ //setup debug output callback
+		glDebugMessageCallbackARB((GLDEBUGPROCARB) gl_debug_callback, NULL);
+		glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
+	}
+
 	//HACK always disable texture multisample, use FXAA instead
 	mHasTextureMultisample = FALSE;
 #if LL_WINDOWS
@@ -789,7 +854,7 @@ void LLGLManager::initExtensions()
 	mHasVertexShader = FALSE;
 	mHasFragmentShader = FALSE;
 	mHasTextureRectangle = FALSE;
-#else // LL_MESA_HEADLESS
+#else // LL_MESA_HEADLESS //important, gGLHExts.mSysExts is uninitialized until after glh_init_extensions is called
 	mHasMultitexture = glh_init_extensions("GL_ARB_multitexture");
 	mHasATIMemInfo = ExtensionExists("GL_ATI_meminfo", gGLHExts.mSysExts);
 	mHasNVXMemInfo = ExtensionExists("GL_NVX_gpu_memory_info", gGLHExts.mSysExts);
@@ -803,6 +868,7 @@ void LLGLManager::initExtensions()
 	mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts);
 	mHasOcclusionQuery2 = ExtensionExists("GL_ARB_occlusion_query2", gGLHExts.mSysExts);
 	mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts);
+	mHasVertexArrayObject = ExtensionExists("GL_ARB_vertex_array_object", gGLHExts.mSysExts);
 	mHasSync = ExtensionExists("GL_ARB_sync", gGLHExts.mSysExts);
 	mHasMapBufferRange = ExtensionExists("GL_ARB_map_buffer_range", gGLHExts.mSysExts);
 	mHasFlushBufferRange = ExtensionExists("GL_APPLE_flush_buffer_range", gGLHExts.mSysExts);
@@ -821,6 +887,7 @@ void LLGLManager::initExtensions()
 	mHasBlendFuncSeparate = ExtensionExists("GL_EXT_blend_func_separate", gGLHExts.mSysExts);
 	mHasTextureRectangle = ExtensionExists("GL_ARB_texture_rectangle", gGLHExts.mSysExts);
 	mHasTextureMultisample = ExtensionExists("GL_ARB_texture_multisample", gGLHExts.mSysExts);
+	mHasDebugOutput = ExtensionExists("GL_ARB_debug_output", gGLHExts.mSysExts);
 #if !LL_DARWIN
 	mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts);
 #endif
@@ -1000,6 +1067,13 @@ void LLGLManager::initExtensions()
 			mHasVertexBufferObject = FALSE;
 		}
 	}
+	if (mHasVertexArrayObject)
+	{
+		glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) GLH_EXT_GET_PROC_ADDRESS("glBindVertexArray");
+		glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteVertexArrays");
+		glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) GLH_EXT_GET_PROC_ADDRESS("glGenVertexArrays");
+		glIsVertexArray = (PFNGLISVERTEXARRAYPROC) GLH_EXT_GET_PROC_ADDRESS("glIsVertexArray");
+	}
 	if (mHasSync)
 	{
 		glFenceSync = (PFNGLFENCESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glFenceSync");
@@ -1054,6 +1128,13 @@ void LLGLManager::initExtensions()
 		glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC) GLH_EXT_GET_PROC_ADDRESS("glGetMultisamplefv");
 		glSampleMaski = (PFNGLSAMPLEMASKIPROC) GLH_EXT_GET_PROC_ADDRESS("glSampleMaski");
 	}	
+	if (mHasDebugOutput)
+	{
+		glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDebugMessageControlARB");
+		glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDebugMessageInsertARB");
+		glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDebugMessageCallbackARB");
+		glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetDebugMessageLogARB");
+	}
 #if (!LL_LINUX && !LL_SOLARIS) || LL_LINUX_NV_GL_HEADERS
 	// This is expected to be a static symbol on Linux GL implementations, except if we use the nvidia headers - bah
 	glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements");
@@ -1341,9 +1422,6 @@ void LLGLState::initClass()
 	//make sure multisample defaults to disabled
 	sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE;
 	glDisable(GL_MULTISAMPLE_ARB);
-
-	sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE;
-	glDisable(GL_MULTISAMPLE_ARB);
 }
 
 //static
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 495e523c311..dee7ec07395 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -88,6 +88,7 @@ class LLGLManager
 		
 	// ARB Extensions
 	BOOL mHasVertexBufferObject;
+	BOOL mHasVertexArrayObject;
 	BOOL mHasSync;
 	BOOL mHasMapBufferRange;
 	BOOL mHasFlushBufferRange;
@@ -112,6 +113,7 @@ class LLGLManager
 	BOOL mHasAnisotropic;
 	BOOL mHasARBEnvCombine;
 	BOOL mHasCubeMap;
+	BOOL mHasDebugOutput;
 
 	// Vendor-specific extensions
 	BOOL mIsATI;
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index f319009bc8e..ede19836518 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -533,6 +533,7 @@ extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 
 // WGL_ARB_create_context
 extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
+extern PFNGLGETSTRINGIPROC glGetStringi;
 
 // GL_ARB_vertex_buffer_object
 extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
@@ -547,6 +548,12 @@ extern PFNGLUNMAPBUFFERARBPROC		glUnmapBufferARB;
 extern PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB;
 extern PFNGLGETBUFFERPOINTERVARBPROC	glGetBufferPointervARB;
 
+// GL_ARB_vertex_array_object
+extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
+extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
+extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
+extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
+
 // GL_ARB_sync
 extern PFNGLFENCESYNCPROC				glFenceSync;
 extern PFNGLISSYNCPROC					glIsSync;
@@ -737,6 +744,12 @@ extern PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample;
 extern PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
 extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 
+//GL_ARB_debug_output
+extern PFNGLDEBUGMESSAGECONTROLARBPROC glDebugMessageControlARB;
+extern PFNGLDEBUGMESSAGEINSERTARBPROC glDebugMessageInsertARB;
+extern PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARB;
+extern PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB;
+
 #elif LL_DARWIN
 //----------------------------------------------------------------------------
 // LL_DARWIN
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 0dcf5634914..da4658dc037 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -243,6 +243,13 @@ void LLGLSLShader::attachObjects(GLhandleARB* objects, S32 count)
 
 BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
 {
+	//before linking, make sure reserved attributes always have consistent locations
+	for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
+	{
+		const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str();
+		glBindAttribLocationARB(mProgramObject, i, (const GLcharARB *) name);
+	}
+	
 	//link the program
 	BOOL res = link();
 
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 0fb4a7784ab..4da796dd1e7 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -725,7 +725,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 		}
 		else if (!is_compressed)
 		{
-			if (mAutoGenMips) //auto-generating mipmaps is deprecated in GL 3.0
+			if (mAutoGenMips && !LLRender::sGLCoreProfile) //auto-generating mipmaps is deprecated in GL 3.0
 			{
 				glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
 				stop_glerror();
@@ -877,6 +877,9 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 
 BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
 {
+	//not compatible with core GL profile
+	llassert(!LLRender::sGLCoreProfile);
+
 	if (gGLManager.mIsDisabled)
 	{
 		llwarns << "Trying to create a texture while GL is disabled!" << llendl;
@@ -903,29 +906,29 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
 	{
 		switch (mComponents)
 		{
-		  case 1:
+			case 1:
 			// Use luminance alpha (for fonts)
 			mFormatInternal = GL_LUMINANCE8;
 			mFormatPrimary = GL_LUMINANCE;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  case 2:
+			case 2:
 			// Use luminance alpha (for fonts)
 			mFormatInternal = GL_LUMINANCE8_ALPHA8;
 			mFormatPrimary = GL_LUMINANCE_ALPHA;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  case 3:
+			case 3:
 			mFormatInternal = GL_RGB8;
 			mFormatPrimary = GL_RGB;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  case 4:
+			case 4:
 			mFormatInternal = GL_RGBA8;
 			mFormatPrimary = GL_RGBA;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  default:
+			default:
 			llerrs << "Bad number of components for texture: " << (U32)getComponents() << llendl;
 		}
 	}
@@ -1101,8 +1104,76 @@ void LLImageGL::deleteTextures(S32 numTextures, U32 *textures, bool immediate)
 // static
 void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels)
 {
-	glTexImage2D(target, miplevel, intformat, width, height, 0, pixformat, pixtype, pixels);
+	bool use_scratch = false;
+	U32* scratch = NULL;
+	if (LLRender::sGLCoreProfile)
+	{
+		if (intformat == GL_ALPHA8 && pixformat == GL_ALPHA && pixtype == GL_UNSIGNED_BYTE) 
+		{ //GL_ALPHA is deprecated, convert to RGBA
+			use_scratch = true;
+			scratch = new U32[width*height];
+
+			U32 pixel_count = (U32) (width*height);
+			for (U32 i = 0; i < pixel_count; i++)
+			{
+				U8* pix = (U8*) &scratch[i];
+				pix[0] = pix[1] = pix[2] = 0;
+				pix[3] = ((U8*) pixels)[i];
+			}				
+			
+			pixformat = GL_RGBA;
+			intformat = GL_RGBA8;
+		}
+
+		if (intformat == GL_LUMINANCE8_ALPHA8 && pixformat == GL_LUMINANCE_ALPHA && pixtype == GL_UNSIGNED_BYTE) 
+		{ //GL_LUMINANCE_ALPHA is deprecated, convert to RGBA
+			use_scratch = true;
+			scratch = new U32[width*height];
+
+			U32 pixel_count = (U32) (width*height);
+			for (U32 i = 0; i < pixel_count; i++)
+			{
+				U8 lum = ((U8*) pixels)[i*2+0];
+				U8 alpha = ((U8*) pixels)[i*2+1];
+
+				U8* pix = (U8*) &scratch[i];
+				pix[0] = pix[1] = pix[2] = lum;
+				pix[3] = alpha;
+			}				
+			
+			pixformat = GL_RGBA;
+			intformat = GL_RGBA8;
+		}
+
+		if (intformat == GL_LUMINANCE8 && pixformat == GL_LUMINANCE && pixtype == GL_UNSIGNED_BYTE) 
+		{ //GL_LUMINANCE_ALPHA is deprecated, convert to RGB
+			use_scratch = true;
+			scratch = new U32[width*height];
+
+			U32 pixel_count = (U32) (width*height);
+			for (U32 i = 0; i < pixel_count; i++)
+			{
+				U8 lum = ((U8*) pixels)[i*2+0];
+				U8 alpha = ((U8*) pixels)[i*2+1];
+
+				U8* pix = (U8*) &scratch[i];
+				pix[0] = pix[1] = pix[2] = lum;
+				pix[3] = 255;
+			}				
+			
+			pixformat = GL_RGBA;
+			intformat = GL_RGB8;
+		}
+	}
+
+	stop_glerror();
+	glTexImage2D(target, miplevel, intformat, width, height, 0, pixformat, pixtype, use_scratch ? scratch : pixels);
 	stop_glerror();
+
+	if (use_scratch)
+	{
+		delete [] scratch;
+	}
 }
 
 //create an empty GL texture: just create a texture name
@@ -1169,29 +1240,29 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
 	{
 		switch (mComponents)
 		{
-		  case 1:
+			case 1:
 			// Use luminance alpha (for fonts)
 			mFormatInternal = GL_LUMINANCE8;
 			mFormatPrimary = GL_LUMINANCE;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  case 2:
+			case 2:
 			// Use luminance alpha (for fonts)
 			mFormatInternal = GL_LUMINANCE8_ALPHA8;
 			mFormatPrimary = GL_LUMINANCE_ALPHA;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  case 3:
+			case 3:
 			mFormatInternal = GL_RGB8;
 			mFormatPrimary = GL_RGB;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  case 4:
+			case 4:
 			mFormatInternal = GL_RGBA8;
 			mFormatPrimary = GL_RGBA;
 			mFormatType = GL_UNSIGNED_BYTE;
 			break;
-		  default:
+			default:
 			llerrs << "Bad number of components for texture: " << (U32)getComponents() << llendl;
 		}
 
@@ -1214,6 +1285,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
 BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, S32 usename)
 {
 	llassert(data_in);
+	stop_glerror();
 
 	if (discard_level < 0)
 	{
@@ -1242,8 +1314,11 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
 		stop_glerror();
 		{
 			llverify(gGL.getTexUnit(0)->bind(this));
+			stop_glerror();
 			glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_TEXTURE_BASE_LEVEL, 0);
+			stop_glerror();
 			glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_TEXTURE_MAX_LEVEL,  mMaxDiscardLevel-discard_level);
+			stop_glerror();
 		}
 	}
 	if (!mTexName)
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index efeb7709a44..daeb58b279b 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -179,10 +179,13 @@ void LLTexUnit::enable(eTextureType type)
 
 	if ( (mCurrTexType != type || gGL.mDirty) && (type != TT_NONE) )
 	{
+		stop_glerror();
 		activate();
+		stop_glerror();
 		if (mCurrTexType != TT_NONE && !gGL.mDirty)
 		{
 			disable(); // Force a disable of a previous texture type if it's enabled.
+			stop_glerror();
 		}
 		mCurrTexType = type;
 
@@ -191,7 +194,9 @@ void LLTexUnit::enable(eTextureType type)
 			type != LLTexUnit::TT_MULTISAMPLE_TEXTURE &&
 			mIndex < gGLManager.mNumTextureUnits)
 		{
+			stop_glerror();
 			glEnable(sGLTextureType[type]);
+			stop_glerror();
 		}
 	}
 }
@@ -287,26 +292,35 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind)
 		{
 			return bind(LLImageGL::sDefaultGLTexture) ;
 		}
+		stop_glerror();
 		return false ;
 	}
 
 	if ((mCurrTexture != texture->getTexName()) || forceBind)
 	{
 		gGL.flush();
+		stop_glerror();
 		activate();
+		stop_glerror();
 		enable(texture->getTarget());
+		stop_glerror();
 		mCurrTexture = texture->getTexName();
 		glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture);
+		stop_glerror();
 		texture->updateBindStats(texture->mTextureMemory);		
 		mHasMipMaps = texture->mHasMipMaps;
 		if (texture->mTexOptionsDirty)
 		{
+			stop_glerror();
 			texture->mTexOptionsDirty = false;
 			setTextureAddressMode(texture->mAddressMode);
 			setTextureFilteringOption(texture->mFilterOption);
+			stop_glerror();
 		}
 	}
 
+	stop_glerror();
+
 	return true;
 }
 
@@ -989,6 +1003,7 @@ void LLLightState::setSpotDirection(const LLVector3& direction)
 LLRender::LLRender()
   : mDirty(false),
     mCount(0),
+	mQuadCycle(0),
     mMode(LLRender::TRIANGLES),
     mCurrTextureUnitIndex(0),
     mMaxAnisotropy(0.f) 
@@ -1678,6 +1693,11 @@ void LLRender::begin(const GLuint& mode)
 {
 	if (mode != mMode)
 	{
+		if (mode == LLRender::QUADS)
+		{
+			mQuadCycle = 1;
+		}
+
 		if (mMode == LLRender::QUADS ||
 			mMode == LLRender::LINES ||
 			mMode == LLRender::TRIANGLES ||
@@ -1765,7 +1785,7 @@ void LLRender::flush()
 		
 		if (gDebugGL)
 		{
-			if (mMode == LLRender::QUADS)
+			if (mMode == LLRender::QUADS && !sGLCoreProfile)
 			{
 				if (mCount%4 != 0)
 				{
@@ -1794,12 +1814,30 @@ void LLRender::flush()
 		U32 count = mCount;
 		mCount = 0;
 
+		if (mBuffer->useVBOs() && !mBuffer->isLocked())
+		{ //hack to only flush the part of the buffer that was updated (relies on stream draw using buffersubdata)
+			mBuffer->getVertexStrider(mVerticesp, 0, count);
+			mBuffer->getTexCoord0Strider(mTexcoordsp, 0, count);
+			mBuffer->getColorStrider(mColorsp, 0, count);
+		}
+		
+		//only flush the part of the 
 		mBuffer->setBuffer(immediate_mask);
-		mBuffer->drawArrays(mMode, 0, count);
+
+		if (mMode == LLRender::QUADS && sGLCoreProfile)
+		{
+			mBuffer->drawArrays(LLRender::TRIANGLES, 0, count);
+			mQuadCycle = 1;
+		}
+		else
+		{
+			mBuffer->drawArrays(mMode, 0, count);
+		}
 		
 		mVerticesp[0] = mVerticesp[count];
 		mTexcoordsp[0] = mTexcoordsp[count];
 		mColorsp[0] = mColorsp[count];
+		
 		mCount = 0;
 	}
 }
@@ -1823,10 +1861,29 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 		mVerticesp[mCount] = vert;
 	}
 
+	if (mMode == LLRender::QUADS && LLRender::sGLCoreProfile)
+	{
+		mQuadCycle++;
+		if (mQuadCycle == 4)
+		{ //copy two vertices so fourth quad element will add a triangle
+			mQuadCycle = 0;
+	
+			mCount++;
+			mVerticesp[mCount] = mVerticesp[mCount-3];
+			mColorsp[mCount] = mColorsp[mCount-3];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-3];
+
+			mCount++;
+			mVerticesp[mCount] = mVerticesp[mCount-2];
+			mColorsp[mCount] = mColorsp[mCount-2];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-2];
+		}
+	}
+
 	mCount++;
 	mVerticesp[mCount] = mVerticesp[mCount-1];
 	mColorsp[mCount] = mColorsp[mCount-1];
-	mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+	mTexcoordsp[mCount] = mTexcoordsp[mCount-1];	
 }
 
 void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count)
@@ -1837,13 +1894,50 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count)
 		return;
 	}
 
-	for (S32 i = 0; i < vert_count; i++)
+	if (sGLCoreProfile && mMode == LLRender::QUADS)
+	{ //quads are deprecated, convert to triangle list
+		S32 i = 0;
+		
+		while (i < vert_count)
+		{
+			//read first three
+			mVerticesp[mCount++] = verts[i++];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			mVerticesp[mCount++] = verts[i++];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			mVerticesp[mCount++] = verts[i++];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			//copy two
+			mVerticesp[mCount++] = verts[i-3];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			mVerticesp[mCount++] = verts[i-1];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+			
+			//copy last one
+			mVerticesp[mCount++] = verts[i++];
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+		}
+	}
+	else
 	{
-		mVerticesp[mCount] = verts[i];
+		for (S32 i = 0; i < vert_count; i++)
+		{
+			mVerticesp[mCount] = verts[i];
 
-		mCount++;
-		mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
-		mColorsp[mCount] = mColorsp[mCount-1];
+			mCount++;
+			mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+		}
 	}
 
 	mVerticesp[mCount] = mVerticesp[mCount-1];
@@ -1857,13 +1951,50 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 v
 		return;
 	}
 
-	for (S32 i = 0; i < vert_count; i++)
+	if (sGLCoreProfile && mMode == LLRender::QUADS)
+	{ //quads are deprecated, convert to triangle list
+		S32 i = 0;
+
+		while (i < vert_count)
+		{
+			//read first three
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount++] = uvs[i++];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount++] = uvs[i++];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount++] = uvs[i++];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			//copy last two
+			mVerticesp[mCount] = verts[i-3];
+			mTexcoordsp[mCount++] = uvs[i-3];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			mVerticesp[mCount] = verts[i-1];
+			mTexcoordsp[mCount++] = uvs[i-1];
+			mColorsp[mCount] = mColorsp[mCount-1];
+
+			//copy last one
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount++] = uvs[i++];
+			mColorsp[mCount] = mColorsp[mCount-1];
+		}
+	}
+	else
 	{
-		mVerticesp[mCount] = verts[i];
-		mTexcoordsp[mCount] = uvs[i];
+		for (S32 i = 0; i < vert_count; i++)
+		{
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount] = uvs[i];
 
-		mCount++;
-		mColorsp[mCount] = mColorsp[mCount-1];
+			mCount++;
+			mColorsp[mCount] = mColorsp[mCount-1];
+		}
 	}
 
 	mVerticesp[mCount] = mVerticesp[mCount-1];
@@ -1878,13 +2009,51 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol
 		return;
 	}
 
-	for (S32 i = 0; i < vert_count; i++)
+	
+	if (sGLCoreProfile && mMode == LLRender::QUADS)
+	{ //quads are deprecated, convert to triangle list
+		S32 i = 0;
+
+		while (i < vert_count)
+		{
+			//read first three
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount] = uvs[i];
+			mColorsp[mCount++] = colors[i++];
+
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount] = uvs[i];
+			mColorsp[mCount++] = colors[i++];
+
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount] = uvs[i];
+			mColorsp[mCount++] = colors[i++];
+
+			//copy last two
+			mVerticesp[mCount] = verts[i-3];
+			mTexcoordsp[mCount] = uvs[i-3];
+			mColorsp[mCount++] = colors[i-3];
+
+			mVerticesp[mCount] = verts[i-1];
+			mTexcoordsp[mCount] = uvs[i-1];
+			mColorsp[mCount++] = colors[i-1];
+
+			//copy last one
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount] = uvs[i];
+			mColorsp[mCount++] = colors[i++];
+		}
+	}
+	else
 	{
-		mVerticesp[mCount] = verts[i];
-		mTexcoordsp[mCount] = uvs[i];
-		mColorsp[mCount] = colors[i];
+		for (S32 i = 0; i < vert_count; i++)
+		{
+			mVerticesp[mCount] = verts[i];
+			mTexcoordsp[mCount] = uvs[i];
+			mColorsp[mCount] = colors[i];
 
-		mCount++;
+			mCount++;
+		}
 	}
 
 	mVerticesp[mCount] = mVerticesp[mCount-1];
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 44d9ec1f156..61e503d3841 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -442,6 +442,7 @@ class LLRender
 	LLColor4 mAmbientLightColor;
 	
 	bool			mDirty;
+	U32				mQuadCycle;
 	U32				mCount;
 	U32				mMode;
 	U32				mCurrTextureUnitIndex;
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 090da765ac6..f822a7babd1 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -55,6 +55,7 @@ S32 LLVertexBuffer::sMappedCount = 0;
 BOOL LLVertexBuffer::sDisableVBOMapping = FALSE ;
 BOOL LLVertexBuffer::sEnableVBOs = TRUE;
 U32 LLVertexBuffer::sGLRenderBuffer = 0;
+U32 LLVertexBuffer::sGLRenderArray = 0;
 U32 LLVertexBuffer::sGLRenderIndices = 0;
 U32 LLVertexBuffer::sLastMask = 0;
 BOOL LLVertexBuffer::sVBOActive = FALSE;
@@ -149,7 +150,7 @@ U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] =
 
 
 //static
-void LLVertexBuffer::setupClientArrays(U32 data_mask)
+void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 {
 	/*if (LLGLImmediate::sStarted)
 	{
@@ -158,13 +159,10 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
 
-	if (sLastMask != data_mask)
+	if (ref_mask != data_mask)
 	{
 		llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
-		static LLGLSLShader* last_shader = LLGLSLShader::sCurBoundShaderPtr;
-		llassert(sLastMask == 0 || last_shader == shader);
-		last_shader = shader;
-
+		
 		U32 mask[] =
 		{
 			MAP_VERTEX,
@@ -213,7 +211,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 				loc = shader->getAttribLocation(type[i]);
 			}
 
-			if (sLastMask & mask[i])
+			if (ref_mask & mask[i])
 			{ //was enabled
 				if (!(data_mask & mask[i]))
 				{ //needs to be disabled
@@ -297,7 +295,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 				loc = shader->getAttribLocation(type_tc[i]);
 			}
 
-			if (sLastMask & map_tc[i])
+			if (ref_mask & map_tc[i])
 			{
 				if (!(data_mask & map_tc[i]))
 				{ //disable
@@ -330,7 +328,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 
 		if (!shader)
 		{
-			if (sLastMask & MAP_BINORMAL)
+			if (ref_mask & MAP_BINORMAL)
 			{
 				if (!(data_mask & MAP_BINORMAL))
 				{
@@ -347,7 +345,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 			}
 		}
 		
-		sLastMask = data_mask;
+		ref_mask = data_mask;
 	}
 }
 
@@ -589,6 +587,12 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
 //static 
 void LLVertexBuffer::unbind()
 {
+	if (sGLRenderArray)
+	{
+		glBindVertexArray(0);
+		sGLRenderArray = 0;
+	}
+
 	if (sVBOActive)
 	{
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
@@ -640,6 +644,8 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 	mRequestedNumIndices(-1),
 	mUsage(usage),
 	mGLBuffer(0),
+	mGLArray(0),
+	mLastMask(0),
 	mGLIndices(0), 
 	mMappedData(NULL),
 	mMappedIndexData(NULL), 
@@ -669,12 +675,23 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 		mUsage = GL_STREAM_DRAW_ARB;
 	}
 
+	if (mUsage == 0 && LLRender::sGLCoreProfile)
+	{ //MUST use VBOs for all rendering
+		mUsage = GL_STREAM_DRAW_ARB;
+	}
+
 	//zero out offsets
 	for (U32 i = 0; i < TYPE_MAX; i++)
 	{
 		mOffsets[i] = 0;
 	}
 
+	//initialize cached attrib pointers
+	for (U32 i = 0; i < LL_MAX_VERTEX_ATTRIB_LOCATION; i++)
+	{
+		mLastPointer[i] = (void*) 0xFFFFFFFF;
+	}
+
 	mTypeMask = typemask;
 	mSize = 0;
 	mAlignedOffset = 0;
@@ -732,6 +749,12 @@ LLVertexBuffer::~LLVertexBuffer()
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTRUCTOR);
 	destroyGLBuffer();
 	destroyGLIndices();
+
+	if (mGLArray)
+	{
+		glDeleteVertexArrays(1, &mGLArray);
+	}
+
 	sCount--;
 
 	if (mFence)
@@ -1041,6 +1064,11 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 	{
 		createGLBuffer();
 		createGLIndices();
+
+		if (gGLManager.mHasVertexArrayObject && useVBOs())
+		{
+			glGenVertexArrays(1, &mGLArray);
+		}
 	}
 	
 	sAllocatedBytes += getSize() + getIndicesSize();
@@ -1762,7 +1790,8 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER);
 	//set up pointers if the data mask is different ...
-	BOOL setup = (sLastMask != data_mask);
+	U32& ref_mask = mGLArray ? mLastMask : sLastMask;
+	BOOL setup = (ref_mask != data_mask);
 
 	if (gDebugGL && data_mask != 0)
 	{
@@ -1794,15 +1823,19 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 
 	if (useVBOs())
 	{
+		if (mGLArray && mGLArray != sGLRenderArray)
+		{
+			glBindVertexArray(mGLArray);
+			sGLRenderArray = mGLArray;
+		}
+
 		if (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))
 		{
 			/*if (sMapped)
 			{
 				llerrs << "VBO bound while another VBO mapped!" << llendl;
 			}*/
-			stop_glerror();
 			glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
-			stop_glerror();
 			sBindCount++;
 			sVBOActive = TRUE;
 			setup = TRUE; // ... or the bound buffer changed
@@ -1813,13 +1846,12 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 			{
 				llerrs << "VBO bound while another VBO mapped!" << llendl;
 			}*/
-			stop_glerror();
 			glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
 			stop_glerror();
 			sBindCount++;
 			sIBOActive = TRUE;
 		}
-		
+
 		BOOL error = FALSE;
 		if (gDebugGL)
 		{
@@ -1957,7 +1989,10 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 		}
 	}
 
-	setupClientArrays(data_mask);
+	if (data_mask)
+	{
+		setupClientArrays(data_mask, ref_mask);
+	}
 	
 	if (mGLIndices)
 	{
@@ -1998,10 +2033,18 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 		{
 			loc = shader->getAttribLocation(TYPE_NORMAL);
 		}
-
+		
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
+			void* ptr = (void*)(base + mOffsets[TYPE_NORMAL]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2018,7 +2061,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
+			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD3]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2037,7 +2088,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
+			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD2]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2056,7 +2115,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
+			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD1]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2075,7 +2142,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
+			void* ptr = (void*)(base + mOffsets[TYPE_BINORMAL]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2094,7 +2169,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
+			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD0]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2111,7 +2194,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
+			void* ptr = (void*)(base + mOffsets[TYPE_COLOR]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 		else if (!shader)
 		{
@@ -2128,7 +2219,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 
 		if (loc >= 0)
 		{
-			glVertexAttribPointerARB(loc, 1, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], (void*)(base + mOffsets[TYPE_EMISSIVE]));
+			void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc, 1, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
 	}
 	if (data_mask & MAP_WEIGHT)
@@ -2139,13 +2238,18 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 			loc = shader->getAttribLocation(TYPE_WEIGHT);
 		}
 
-		if (loc < 0)
-		{ //legacy behavior, some shaders have weight hardcoded to location 1
-			loc = 1;
+		if (loc > -1)
+		{
+			void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
-		
-		glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], (void*)(base + mOffsets[TYPE_WEIGHT]));
-		
 	}
 
 	if (data_mask & MAP_WEIGHT4)
@@ -2155,7 +2259,15 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 			S32 loc = shader->getAttribLocation(TYPE_WEIGHT4);
 			if (loc > -1)
 			{
-				glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], (void*)(base+mOffsets[TYPE_WEIGHT4]));
+				void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
+				if (mLastPointer[loc] != ptr)
+				{
+					glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
+				}
+				if (mGLArray)
+				{
+					mLastPointer[loc] = ptr;
+				}
 			}
 		}
 	}
@@ -2168,11 +2280,18 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
 			loc = shader->getAttribLocation(TYPE_CLOTHWEIGHT);
 		}
 
-		if (loc < 0)
-		{ //legacy behavior, some shaders have weight hardcoded to location 4
-			loc = 4;
+		if (loc > -1)
+		{
+			void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
+			if (mLastPointer[loc] != ptr)
+			{
+				glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
+			}
+			if (mGLArray)
+			{
+				mLastPointer[loc] = ptr;
+			}
 		}
-		glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]));
 	}
 	if (data_mask & MAP_VERTEX)
 	{
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 7aa59285241..60cfde39f58 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -38,6 +38,8 @@
 #include <vector>
 #include <list>
 
+#define LL_MAX_VERTEX_ATTRIB_LOCATION 64
+
 //============================================================================
 // NOTES
 // Threading:
@@ -49,7 +51,6 @@
 
 //============================================================================
 // gl name pools for dynamic and streaming buffers
-
 class LLVBOPool : public LLGLNamePool
 {
 protected:
@@ -116,7 +117,7 @@ class LLVertexBuffer : public LLRefCount
 
 	static void initClass(bool use_vbo, bool no_vbo_mapping);
 	static void cleanupClass();
-	static void setupClientArrays(U32 data_mask);
+	static void setupClientArrays(U32 data_mask, U32& ref_mask = LLVertexBuffer::sLastMask);
 	static void drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm);
 	static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp);
 
@@ -271,6 +272,10 @@ class LLVertexBuffer : public LLRefCount
 	S32		mUsage;			// GL usage
 	U32		mGLBuffer;		// GL VBO handle
 	U32		mGLIndices;		// GL IBO handle
+	U32		mGLArray;		// GL VAO handle
+	U32		mLastMask;		
+	mutable void*   mLastPointer[LL_MAX_VERTEX_ATTRIB_LOCATION];
+
 	U8*		mMappedData;	// pointer to currently mapped data (NULL if unmapped)
 	U8*		mMappedIndexData;	// pointer to currently mapped indices (NULL if unmapped)
 	BOOL	mVertexLocked;			// if TRUE, vertex buffer is being or has been written to in client memory
@@ -307,6 +312,7 @@ class LLVertexBuffer : public LLRefCount
 	static S32 sTypeSize[TYPE_MAX];
 	static U32 sGLMode[LLRender::NUM_MODES];
 	static U32 sGLRenderBuffer;
+	static U32 sGLRenderArray;
 	static U32 sGLRenderIndices;
 	static BOOL sVBOActive;
 	static BOOL sIBOActive;
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 2ba14f8f6ef..bac23279cc1 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -41,6 +41,7 @@
 #include "llgl.h"
 #include "llstring.h"
 #include "lldir.h"
+#include "llglslshader.h"
 
 // System includes
 #include <commdlg.h>
@@ -1121,34 +1122,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 	}
 
 	gGLManager.initWGL();
-
-	if (wglCreateContextAttribsARB && LLRender::sGLCoreProfile)
-	{
-		S32 attribs[] = 
-		{
-			WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
-			WGL_CONTEXT_MINOR_VERSION_ARB, 0,
-			WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
-			0
-		};
-
-		HGLRC res = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
-
-		if (!res)
-		{
-			attribs[1] = 3;
-			attribs[3] = 1;
-
-			res = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
-		}
-
-		if (res)
-		{
-			wglMakeCurrent(mhDC, res);
-			wglDeleteContext(mhRC);
-			mhRC = res;
-		}
-	}
 	
 	if (wglChoosePixelFormatARB)
 	{
@@ -1406,7 +1379,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		return FALSE;
 	}
 
-	if (!(mhRC = wglCreateContext(mhDC)))
+	mhRC = 0;
+	if (wglCreateContextAttribsARB)
+	{ //attempt to create a non-compatibility profile context
+		S32 attribs[] = 
+		{
+			WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
+			WGL_CONTEXT_MINOR_VERSION_ARB, 0,
+			WGL_CONTEXT_PROFILE_MASK_ARB,  LLRender::sGLCoreProfile ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
+			WGL_CONTEXT_FLAGS_ARB, gDebugGL ? WGL_CONTEXT_DEBUG_BIT_ARB : 0,
+			0
+		};
+
+		mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
+
+		if (!mhRC)
+		{
+			attribs[1] = 3;
+			attribs[3] = 3;
+
+			mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
+		}
+
+		if (mhRC)
+		{ //success, disable fixed function calls
+			LLGLSLShader::sNoFixedFunction = true;
+		}
+	}
+
+	if (!mhRC && !(mhRC = wglCreateContext(mhDC)))
 	{
 		close();
 		OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK);
@@ -1426,7 +1427,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK);
 		return FALSE;
 	}
-
+	
 	// Disable vertical sync for swap
 	if (disable_vsync && wglSwapIntervalEXT)
 	{
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 32d4097ff36..a8a7b165a3c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7681,7 +7681,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
   <key>RenderDebugNormalScale</key>
   <map>
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 5078da02e39..d503d935d0d 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -62,13 +62,16 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
 	LLFacePool(POOL_TERRAIN),
 	mTexturep(texturep)
 {
+	U32 format = GL_ALPHA8;
+	U32 int_format = GL_ALPHA;
+
 	// Hack!
 	sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
 	sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
 	mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga", 
 													TRUE, LLViewerTexture::BOOST_UI, 
 													LLViewerTexture::FETCHED_TEXTURE,
-													GL_ALPHA8, GL_ALPHA,
+													format, int_format,
 													LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
 
 	//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
@@ -77,7 +80,7 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
 	m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c", 
 													TRUE, LLViewerTexture::BOOST_UI, 
 													LLViewerTexture::FETCHED_TEXTURE,
-													GL_ALPHA8, GL_ALPHA,
+													format, int_format,
 													LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
 
 	//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 81d7fe70c15..db5e4a2fb5c 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -261,7 +261,6 @@ void LLSpatialGroup::buildOcclusion()
 {
 	if (mOcclusionVerts.isNull())
 	{
-
 		mOcclusionVerts = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, 
 			LLVertexBuffer::sUseStreamDraw ? mBufferUsage : 0); //if GL has a hard time with VBOs, don't use them for occlusion culling.
 		mOcclusionVerts->allocateBuffer(8, 64, true);
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 20ee4759393..59835028a17 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -537,7 +537,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
 
 	stop_glerror();
 	
-	LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), mFace->getPool()->getVertexShaderLevel() > 0 ? 0.f : mShiny);
+	LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), (mFace->getPool()->getVertexShaderLevel() > 0 || LLGLSLShader::sNoFixedFunction) ? 0.f : mShiny);
 
 	//----------------------------------------------------------------
 	// setup current texture
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 23351fc9945..d1d3334fed9 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -443,6 +443,20 @@ void LLViewerShaderMgr::setShaders()
 		return;
 	}
 
+	if (LLRender::sGLCoreProfile)
+	{ 
+		if (!gSavedSettings.getBOOL("VertexShaderEnable"))
+		{ //vertex shaders MUST be enabled to use core profile
+			gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
+		}
+		
+		if (!gSavedSettings.getBOOL("RenderTransparentWater"))
+		{ //non-transparent water uses fixed function
+			gSavedSettings.setBOOL("RenderTransparentWater", TRUE);
+		}
+	}
+
+
 	//setup preprocessor definitions
 	LLShaderMgr::instance()->mDefinitions["samples"] = llformat("%d", gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples")));
 	LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 59883e0bb19..581912f8449 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -2558,7 +2558,7 @@ void LLVOAvatarSelf::deleteScratchTextures()
 			LLImageGL::decTextureCounter(tex_size, 1, LLViewerTexture::AVATAR_SCRATCH_TEX) ;
 			total_tex_size -= tex_size ;
 		}
-		if( sScratchTexNames.checkData( GL_LUMINANCE_ALPHA ) )
+		if( sScratchTexNames.checkData( LLRender::sGLCoreProfile ? GL_RG : GL_LUMINANCE_ALPHA ) )
 		{
 			LLImageGL::decTextureCounter(tex_size, 2, LLViewerTexture::AVATAR_SCRATCH_TEX) ;
 			total_tex_size -= 2 * tex_size ;
@@ -2600,89 +2600,6 @@ void LLVOAvatarSelf::deleteScratchTextures()
 	}
 }
 
-BOOL LLVOAvatarSelf::bindScratchTexture( LLGLenum format )
-{
-	U32 texture_bytes = 0;
-	S32 components = 0; 
-	GLuint gl_name = getScratchTexName( format, components, &texture_bytes );
-	if( gl_name )
-	{
-		gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name);
-		stop_glerror();
-
-		F32* last_bind_time = sScratchTexLastBindTime.getIfThere( format );
-		if( last_bind_time )
-		{
-			if( *last_bind_time != LLImageGL::sLastFrameTime )
-			{
-				*last_bind_time = LLImageGL::sLastFrameTime;
-				LLImageGL::updateBoundTexMem(texture_bytes, components, LLViewerTexture::AVATAR_SCRATCH_TEX) ;
-			}
-		}
-		else
-		{
-			LLImageGL::updateBoundTexMem(texture_bytes, components, LLViewerTexture::AVATAR_SCRATCH_TEX) ;
-			sScratchTexLastBindTime.addData( format, new F32(LLImageGL::sLastFrameTime) );
-		}
-		return TRUE;
-	}
-	return FALSE;
-}
-
-LLGLuint LLVOAvatarSelf::getScratchTexName( LLGLenum format, S32& components, U32* texture_bytes )
-{	
-	GLenum internal_format;
-	switch( format )
-	{
-		case GL_LUMINANCE:			components = 1; internal_format = GL_LUMINANCE8;		break;
-		case GL_ALPHA:				components = 1; internal_format = GL_ALPHA8;			break;
-		case GL_LUMINANCE_ALPHA:	components = 2; internal_format = GL_LUMINANCE8_ALPHA8;	break;
-		case GL_RGB:				components = 3; internal_format = GL_RGB8;				break;
-		case GL_RGBA:				components = 4; internal_format = GL_RGBA8;				break;
-		default:	llassert(0);	components = 4; internal_format = GL_RGBA8;				break;
-	}
-
-	*texture_bytes = components * SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT;
-	
-	if( sScratchTexNames.checkData( format ) )
-	{
-		return *( sScratchTexNames.getData( format ) );
-	}
-
-	LLGLSUIDefault gls_ui;
-
-	U32 name = 0;
-	LLImageGL::generateTextures(1, &name );
-	stop_glerror();
-
-	gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, name);
-	stop_glerror();
-
-	LLImageGL::setManualImage(
-		GL_TEXTURE_2D, 0, internal_format, 
-		SCRATCH_TEX_WIDTH, SCRATCH_TEX_HEIGHT,
-		format, GL_UNSIGNED_BYTE, NULL );
-	stop_glerror();
-
-	gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-	gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
-	stop_glerror();
-
-	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-	stop_glerror();
-
-	sScratchTexNames.addData( format, new LLGLuint( name ) );
-
-	sScratchTexBytes += *texture_bytes;
-	LLImageGL::sGlobalTextureMemoryInBytes += *texture_bytes;
-
-	if(gAuditTexture)
-	{
-		LLImageGL::incTextureCounter(SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT, components, LLViewerTexture::AVATAR_SCRATCH_TEX) ;
-	}
-	return name;
-}
-
 // static 
 void LLVOAvatarSelf::dumpScratchTextureByteCount()
 {
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 51f06dee5f5..74ff47a3e4b 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -249,10 +249,7 @@ class LLVOAvatarSelf :
 	// Scratch textures (used for compositing)
 	//--------------------------------------------------------------------
 public:
-	BOOL			bindScratchTexture(LLGLenum format);
 	static void		deleteScratchTextures();
-protected:
-	LLGLuint		getScratchTexName(LLGLenum format, S32& components, U32* texture_bytes);
 private:
 	static S32 		sScratchTexBytes;
 	static LLMap< LLGLenum, LLGLuint*> sScratchTexNames;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index 39c9945fb4f..824cb8a15f0 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -485,7 +485,7 @@ void LLVOWLSky::drawStars(void)
 	if (mStarsVerts.notNull())
 	{
 		mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK);
-		mStarsVerts->drawArrays(LLRender::QUADS, 0, getStarsNumVerts()*4);
+		mStarsVerts->drawArrays(LLRender::TRIANGLES, 0, getStarsNumVerts()*4);
 	}
 }
 
@@ -772,7 +772,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
 	if (mStarsVerts.isNull())
 	{
 		mStarsVerts = new LLVertexBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK, GL_DYNAMIC_DRAW);
-		mStarsVerts->allocateBuffer(getStarsNumVerts()*4, 0, TRUE);
+		mStarsVerts->allocateBuffer(getStarsNumVerts()*6, 0, TRUE);
 	}
  
 	BOOL success = mStarsVerts->getVertexStrider(verticesp)
@@ -807,17 +807,23 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
 		*(verticesp++)  = mStarVertices[vtx];
 		*(verticesp++) = mStarVertices[vtx]+left;
 		*(verticesp++) = mStarVertices[vtx]+left+up;
+		*(verticesp++) = mStarVertices[vtx]+left;
+		*(verticesp++) = mStarVertices[vtx]+left+up;
 		*(verticesp++) = mStarVertices[vtx]+up;
 
 		*(texcoordsp++) = LLVector2(0,0);
 		*(texcoordsp++) = LLVector2(0,1);
 		*(texcoordsp++) = LLVector2(1,1);
+		*(texcoordsp++) = LLVector2(0,1);
+		*(texcoordsp++) = LLVector2(1,1);
 		*(texcoordsp++) = LLVector2(1,0);
 
 		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
 		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
 		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
 		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
+		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
+		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
 	}
 
 	mStarsVerts->setBuffer(0);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 2248d181551..0ca28eb03bd 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -106,26 +106,6 @@
 #include "llnotifications.h"
 
 
-void check_stack_depth(S32 stack_depth)
-{
-	if (gDebugGL || gDebugSession)
-	{
-		GLint depth;
-		glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth);
-		if (depth != stack_depth)
-		{
-			if (gDebugSession)
-			{
-				ll_fail("GL matrix stack corrupted.");
-			}
-			else
-			{
-				llerrs << "GL matrix stack corrupted!" << llendl;
-			}
-		}
-	}
-}
-	
 #ifdef _DEBUG
 // Debug indices is disabled for now for debug performance - djs 4/24/02
 //#define DEBUG_INDICES
@@ -701,7 +681,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		// As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
 		if (!mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
 #else
-		if (!mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
+		if (!mEdgeMap.allocate(resX, resY, LLRender::sGLCoreProfile ? GL_RGBA : GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
 #endif
 
 		if (shadow_detail > 0 || ssao)
@@ -916,6 +896,7 @@ void LLPipeline::releaseScreenBuffers()
 
 void LLPipeline::createGLBuffers()
 {
+	stop_glerror();
 	LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS);
 	assertInitialized();
 
@@ -1020,7 +1001,7 @@ void LLPipeline::createGLBuffers()
 
 			LLImageGL::generateTextures(1, &mLightFunc);
 			gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc);
-			LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_ALPHA, lightResX, lightResY, GL_ALPHA, GL_UNSIGNED_BYTE, lg);
+			LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R8, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, lg);
 			gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
 			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR);
 
@@ -3597,13 +3578,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 		}
 	}
 
-	S32 stack_depth = 0;
-
-	if (gDebugGL)
-	{
-		glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &stack_depth);
-	}
-
 	///////////////////////////////////////////
 	//
 	// Sync and verify GL state
@@ -3731,7 +3705,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 					LLVertexBuffer::unbind();
 					if (gDebugGL)
 					{
-						check_stack_depth(stack_depth);
 						std::string msg = llformat("pass %d", i);
 						LLGLState::checkStates(msg);
 						//LLGLState::checkTextureChannels(msg);
@@ -3907,12 +3880,6 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 
 				if (gDebugGL || gDebugPipeline)
 				{
-					GLint depth;
-					glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth);
-					if (depth > 3)
-					{
-						llerrs << "GL matrix stack corrupted!" << llendl;
-					}
 					LLGLState::checkStates();
 				}
 			}
@@ -4000,12 +3967,6 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 
 				if (gDebugGL || gDebugPipeline)
 				{
-					GLint depth;
-					glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth);
-					if (depth > 3)
-					{
-						llerrs << "GL matrix stack corrupted!" << llendl;
-					}
 					LLGLState::checkStates();
 				}
 			}
-- 
GitLab


From e7b743d80bb6e7bde9c90eb0a7f0e0244bb41f8d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 22 Sep 2011 00:33:27 -0500
Subject: [PATCH 036/933] SH-2244 Fix for artifacts with L&S enabled when using
 core profile.

---
 .../shaders/class1/deferred/multiPointLightF.glsl           | 2 +-
 .../shaders/class1/deferred/multiSpotLightF.glsl            | 1 -
 .../app_settings/shaders/class1/deferred/pointLightF.glsl   | 2 +-
 .../app_settings/shaders/class1/deferred/softenLightF.glsl  | 2 +-
 .../app_settings/shaders/class1/deferred/spotLightF.glsl    | 1 -
 .../shaders/class2/deferred/multiSpotLightF.glsl            | 1 -
 .../shaders/class2/deferred/multiSpotLightMSF.glsl          | 1 -
 .../app_settings/shaders/class2/deferred/softenLightF.glsl  | 2 +-
 .../shaders/class2/deferred/softenLightMSF.glsl             | 2 +-
 .../app_settings/shaders/class2/deferred/spotLightF.glsl    | 1 -
 .../app_settings/shaders/class2/deferred/spotLightMSF.glsl  | 1 -
 indra/newview/app_settings/shaders/class3/deferred/giF.glsl | 4 ++--
 .../app_settings/shaders/class3/deferred/softenLightF.glsl  | 4 ++--
 indra/newview/pipeline.cpp                                  | 6 +++++-
 14 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 585faf6cd56..5f83d06388c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -126,7 +126,7 @@ void main()
 				
 				if (sa > 0.0)
 				{
-					sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
+					sa = texture2D(lightFunc,vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
 					sa *= noise;
 					col += da*sa*light_col[i].rgb*spec.rgb;
 				}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 6351a5ac0da..17955f32cdb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -37,7 +37,6 @@ uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform samplerCube environmentMap;
 uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
 
 uniform mat4 proj_mat; //screen space to light space
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 60f99fac155..b8ed398a811 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -107,7 +107,7 @@ void main()
 		float sa = dot(normalize(lv-normalize(pos)),norm);
 		if (sa > 0.0)
 		{
-			sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
+			sa = texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
 			sa *= noise;
 			col += da*sa*color.rgb*spec.rgb;
 		}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index e86b0445ede..0844e659b6b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -307,7 +307,7 @@ void main()
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
 			float sa = dot(refnormpersp, sun_dir.xyz);
-			vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
+			vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).r;
 			
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 8eac16d3f06..93842e818f4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -35,7 +35,6 @@ uniform sampler2DRect specularRect;
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
 uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
 
 uniform mat4 proj_mat; //screen space to light space
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 409db862e65..7ef26088416 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -36,7 +36,6 @@ uniform sampler2DRect normalMap;
 uniform samplerCube environmentMap;
 uniform sampler2DRect lightMap;
 uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
 
 uniform mat4 proj_mat; //screen space to light space
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
index 9e7542c01c6..c2d374d22c3 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
@@ -38,7 +38,6 @@ uniform sampler2DMS depthMap;
 uniform sampler2DMS normalMap;
 uniform sampler2DRect lightMap;
 uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
 
 uniform mat4 proj_mat; //screen space to light space
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 642145a856f..c09e3bb6e6e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -313,7 +313,7 @@ void main()
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
 			float sa = dot(refnormpersp, sun_dir.xyz);
-			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
+			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r;
 
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index ab187ccfa58..6d746ebbba7 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -314,7 +314,7 @@ void main()
 				//
 				vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
 				float sa = dot(refnormpersp, vary_light.xyz);
-				vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
+				vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r;
 
 				// add the two types of shiny together
 				vec3 spec_contrib = dumbshiny * spec.rgb;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index c2e36abbd60..93b385cbf55 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -38,7 +38,6 @@ uniform sampler2DRect normalMap;
 uniform samplerCube environmentMap;
 uniform sampler2DRect lightMap;
 uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
 
 uniform mat4 proj_mat; //screen space to light space
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
index 50369cb2054..1e3257d4a24 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
@@ -38,7 +38,6 @@ uniform sampler2DMS depthMap;
 uniform sampler2DMS normalMap;
 uniform sampler2DRect lightMap;
 uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
 uniform sampler2D projectionMap;
 
 uniform mat4 proj_mat; //screen space to light space
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
index dad62a074a9..39975f82495 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
@@ -156,7 +156,7 @@ vec3 giAmbient(vec3 pos, vec3 norm)
 						if (spec.a > 0.0)
 						{
 							float sa = dot(ha,lnorm);
-							da = texture2D(lightFunc, vec2(sa, spec.a)).a;
+							da = texture2D(lightFunc, vec2(sa, spec.a)).r;
 						}
 						else
 						{
@@ -171,7 +171,7 @@ vec3 giAmbient(vec3 pos, vec3 norm)
 							if (c_spec.a > 0.0)
 							{
 								float sa = dot(ha, gi_norm);
-								da = dist_atten*texture2D(lightFunc, vec2(sa, c_spec.a)).a;
+								da = dist_atten*texture2D(lightFunc, vec2(sa, c_spec.a)).r;
 							}
 							else
 							{
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index cc6d080344a..338d289ab0d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -295,7 +295,7 @@ void main()
 	{
 		vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
 	
-		da = texture2D(lightFunc, vec2(da, 0.0)).a;
+		da = texture2D(lightFunc, vec2(da, 0.0)).r;
 		
 		vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
 		float scol = max(scol_ambocc.r, diffuse.a); 
@@ -314,7 +314,7 @@ void main()
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
 			float sa = dot(refnormpersp, vary_light.xyz);
-			vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a;
+			vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).r;
 		
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 0ca28eb03bd..0fbe0308321 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7472,6 +7472,7 @@ void LLPipeline::renderDeferredLighting()
 					//correspond to their axis facing, with bit position 3,2,1 matching
 					//axis facing x,y,z, bit set meaning positive facing, bit clear 
 					//meaning negative facing
+					mDeferredVB->getVertexStrider(vert);
 					v[0].set(c[0]-s,c[1]-s,c[2]-s);  // 0 - 0000 
 					v[1].set(c[0]-s,c[1]-s,c[2]+s);  // 1 - 0001
 					v[2].set(c[0]-s,c[1]+s,c[2]-s);  // 2 - 0010
@@ -7506,6 +7507,7 @@ void LLPipeline::renderDeferredLighting()
 							gDeferredLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
 							//gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
 							gGL.syncMatrices();
+							mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 							glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 								GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 							stop_glerror();
@@ -7562,6 +7564,7 @@ void LLPipeline::renderDeferredLighting()
 					//correspond to their axis facing, with bit position 3,2,1 matching
 					//axis facing x,y,z, bit set meaning positive facing, bit clear 
 					//meaning negative facing
+					mDeferredVB->getVertexStrider(vert);
 					v[0].set(c[0]-s,c[1]-s,c[2]-s);  // 0 - 0000 
 					v[1].set(c[0]-s,c[1]-s,c[2]+s);  // 1 - 0001
 					v[2].set(c[0]-s,c[1]+s,c[2]-s);  // 2 - 0010
@@ -7577,6 +7580,7 @@ void LLPipeline::renderDeferredLighting()
 					gDeferredSpotLightProgram.uniform3fv("color", 1, col.mV);
 					gDeferredSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
 					gGL.syncMatrices();
+					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 					glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 							GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
 				}
@@ -7585,6 +7589,7 @@ void LLPipeline::renderDeferredLighting()
 			}
 
 			//reset mDeferredVB to fullscreen triangle
+			mDeferredVB->getVertexStrider(vert);
 			vert[0].set(-1,1,0);
 			vert[1].set(-1,-3,0);
 			vert[2].set(3,1,0);
@@ -7632,7 +7637,6 @@ void LLPipeline::renderDeferredLighting()
 						gDeferredMultiLightProgram.uniform1f("far_z", far_z);
 						far_z = 0.f;
 						count = 0;
-						
 						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 					}
 				}
-- 
GitLab


From 3115e250ffded1270531fb6bdb3df8b2214fba1a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 22 Sep 2011 00:57:47 -0500
Subject: [PATCH 037/933] SH-2244 Don't use VAO's outside of core profile
 (performance improvement)

---
 indra/llrender/llvertexbuffer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index f822a7babd1..75c7153222f 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1065,7 +1065,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 		createGLBuffer();
 		createGLIndices();
 
-		if (gGLManager.mHasVertexArrayObject && useVBOs())
+		if (gGLManager.mHasVertexArrayObject && useVBOs() && LLRender::sGLCoreProfile)
 		{
 			glGenVertexArrays(1, &mGLArray);
 		}
-- 
GitLab


From a1a71202990957b71ac40d6704816becef307f77 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 22 Sep 2011 12:57:17 -0500
Subject: [PATCH 038/933] SH-2244 fix for glitched fonts

---
 indra/llrender/llfontgl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 54f72d103ea..607473d4166 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -329,7 +329,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 		
 		if (glyph_count >= GLYPH_BATCH_SIZE)
 		{
-			gGL.begin(LLRender::TRIANGLES);
+			gGL.begin(LLRender::QUADS);
 			{
 				gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4);
 			}
-- 
GitLab


From d3f614e2e971fd442660ba6c1645830d3bf0b6cf Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 22 Sep 2011 13:41:26 -0500
Subject: [PATCH 039/933] SH-2244 fix flickering shadows and occlusion culling.

---
 indra/llrender/llvertexbuffer.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 75c7153222f..40a96eb407b 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1989,11 +1989,8 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 		}
 	}
 
-	if (data_mask)
-	{
-		setupClientArrays(data_mask, ref_mask);
-	}
-	
+	setupClientArrays(data_mask, ref_mask);
+		
 	if (mGLIndices)
 	{
 		sGLRenderIndices = mGLIndices;
-- 
GitLab


From b9926e8f57787eb146b06260cc3d0260e34330ce Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 23 Sep 2011 02:29:53 -0500
Subject: [PATCH 040/933] SH-2244 Better VAO support -- still slower than
 non-VAO implementation for some reason

---
 indra/llrender/llrender.cpp                   |   2 +-
 indra/llrender/llvertexbuffer.cpp             | 862 +++++++++---------
 indra/llrender/llvertexbuffer.h               |  19 +-
 indra/newview/app_settings/settings.xml       |   2 +-
 .../shaders/class1/deferred/alphaV.glsl       |   5 +-
 .../shaders/class1/deferred/diffuseV.glsl     |   5 +-
 .../shaders/class1/deferred/emissiveV.glsl    |   5 +-
 .../shaders/class1/deferred/fullbrightV.glsl  |   5 +-
 .../shaders/class1/objects/emissiveV.glsl     |   5 +-
 .../shaders/class2/deferred/alphaV.glsl       |   5 +-
 .../class2/objects/fullbrightShinyV.glsl      |   5 +-
 .../shaders/class2/objects/fullbrightV.glsl   |   5 +-
 .../shaders/class2/objects/shinyV.glsl        |   5 +-
 .../shaders/class2/objects/simpleV.glsl       |   5 +-
 indra/newview/llface.cpp                      |  20 +-
 indra/newview/llspatialpartition.cpp          |   2 +-
 indra/newview/llsprite.cpp                    |   2 +-
 indra/newview/llviewerjointmesh.cpp           |   2 +-
 indra/newview/llviewerjointmesh_sse.cpp       |   2 +-
 indra/newview/llviewerjointmesh_vec.cpp       |   2 +-
 indra/newview/llviewershadermgr.cpp           |   1 +
 indra/newview/llvoavatar.cpp                  |   4 +-
 indra/newview/llvoground.cpp                  |   2 +-
 indra/newview/llvopartgroup.cpp               |   2 +-
 indra/newview/llvosky.cpp                     |   8 +-
 indra/newview/llvosurfacepatch.cpp            |   4 +-
 indra/newview/llvotree.cpp                    |   6 +-
 indra/newview/llvovolume.cpp                  |   8 +-
 indra/newview/llvowater.cpp                   |   2 +-
 indra/newview/llvowlsky.cpp                   |   8 +-
 indra/newview/pipeline.cpp                    |   2 +-
 31 files changed, 508 insertions(+), 504 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index daeb58b279b..685334555a4 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1821,7 +1821,7 @@ void LLRender::flush()
 			mBuffer->getColorStrider(mColorsp, 0, count);
 		}
 		
-		//only flush the part of the 
+		mBuffer->flush();
 		mBuffer->setBuffer(immediate_mask);
 
 		if (mMode == LLRender::QUADS && sGLCoreProfile)
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 40a96eb407b..a48669a3007 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -150,19 +150,18 @@ U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] =
 
 
 //static
-void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
+void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& sLastMask)
 {
 	/*if (LLGLImmediate::sStarted)
 	{
 		llerrs << "Cannot use LLGLImmediate and LLVertexBuffer simultaneously!" << llendl;
 	}*/
 
-	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-
-	if (ref_mask != data_mask)
+	if (sLastMask != data_mask)
 	{
-		llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
-		
+
+		LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
 		U32 mask[] =
 		{
 			MAP_VERTEX,
@@ -174,6 +173,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 			MAP_WEIGHT4,
 			MAP_BINORMAL,
 			MAP_CLOTHWEIGHT,
+			MAP_TEXTURE_INDEX,
 		};
 		
 		U32 type[] =
@@ -187,6 +187,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 			TYPE_WEIGHT4,
 			TYPE_BINORMAL,
 			TYPE_CLOTHWEIGHT,
+			TYPE_TEXTURE_INDEX-1,
 		};
 
 		GLenum array[] =
@@ -200,18 +201,20 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 			0,
 			0,
 			0,
+			0,
 		};
 
 		BOOL error = FALSE;
-		for (U32 i = 0; i < 9; ++i)
+		for (U32 i = 0; i < 10; ++i)
 		{
 			S32 loc = -1;
-			if (shader)
+
+			if (LLGLSLShader::sNoFixedFunction)
 			{
-				loc = shader->getAttribLocation(type[i]);
+				loc = type[i];
 			}
-
-			if (ref_mask & mask[i])
+									
+			if (sLastMask & mask[i])
 			{ //was enabled
 				if (!(data_mask & mask[i]))
 				{ //needs to be disabled
@@ -219,12 +222,12 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 					{
 						glDisableVertexAttribArrayARB(loc);
 					}
-					else if (!shader)
+					else
 					{
 						glDisableClientState(array[i]);
 					}
 				}
-				else if (gDebugGL && !shader && array[i])
+				else if (gDebugGL && !LLGLSLShader::sNoFixedFunction && array[i])
 				{ //needs to be enabled, make sure it was (DEBUG)
 					if (loc < 0 && !glIsEnabled(array[i]))
 					{
@@ -248,12 +251,12 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 					{
 						glEnableVertexAttribArrayARB(loc);
 					}
-					else if (!shader)
+					else
 					{
 						glEnableClientState(array[i]);
 					}
 				}
-				else if (!shader && array[i] && gDebugGL && glIsEnabled(array[i]))
+				else if (!LLGLSLShader::sNoFixedFunction && array[i] && gDebugGL && glIsEnabled(array[i]))
 				{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
 					if (gDebugSession)
 					{
@@ -290,12 +293,13 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 		for (U32 i = 0; i < 3; i++)
 		{
 			S32 loc = -1;
-			if (shader)
+
+			if (LLGLSLShader::sNoFixedFunction)
 			{
-				loc = shader->getAttribLocation(type_tc[i]);
+				loc = type_tc[i];
 			}
 
-			if (ref_mask & map_tc[i])
+			if (sLastMask & map_tc[i])
 			{
 				if (!(data_mask & map_tc[i]))
 				{ //disable
@@ -303,7 +307,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 					{
 						glDisableVertexAttribArrayARB(loc);
 					}
-					else if (!shader)
+					else
 					{
 						glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
 						glDisableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -317,7 +321,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 				{
 					glEnableVertexAttribArrayARB(loc);
 				}
-				else if (!shader)
+				else
 				{
 					glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
 					glEnableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -326,9 +330,9 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 			}
 		}
 
-		if (!shader)
+		if (!LLGLSLShader::sNoFixedFunction)
 		{
-			if (ref_mask & MAP_BINORMAL)
+			if (sLastMask & MAP_BINORMAL)
 			{
 				if (!(data_mask & MAP_BINORMAL))
 				{
@@ -345,7 +349,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& ref_mask)
 			}
 		}
 		
-		ref_mask = data_mask;
+		sLastMask = data_mask;
 	}
 }
 
@@ -367,12 +371,12 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
 
 	if (shader)
 	{
-		S32 loc = shader->getAttribLocation(LLVertexBuffer::TYPE_VERTEX);
+		S32 loc = LLVertexBuffer::TYPE_VERTEX;
 		if (loc > -1)
 		{
 			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, pos[0].mV);
 		}
-		loc = shader->getAttribLocation(LLVertexBuffer::TYPE_NORMAL);
+		loc = LLVertexBuffer::TYPE_NORMAL;
 		if (loc > -1)
 		{
 			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, norm[0].mV);
@@ -404,23 +408,15 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
 	
 	setupClientArrays(mask);
 
-	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-
-	if (shader)
+	if (LLGLSLShader::sNoFixedFunction)
 	{
-		S32 loc = shader->getAttribLocation(LLVertexBuffer::TYPE_VERTEX);
-		if (loc > -1)
-		{
-			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 16, pos);
+		S32 loc = LLVertexBuffer::TYPE_VERTEX;
+		glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 16, pos);
 
-			if (tc)
-			{
-				loc = shader->getAttribLocation(LLVertexBuffer::TYPE_TEXCOORD0);
-				if (loc > -1)
-				{
-					glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, 0, tc);
-				}
-			}
+		if (tc)
+		{
+			loc = LLVertexBuffer::TYPE_TEXCOORD0;
+			glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, 0, tc);
 		}
 	}
 	else
@@ -470,14 +466,35 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 	llassert(mRequestedNumVerts >= 0);
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
 
-	if (mGLIndices != sGLRenderIndices)
+	if (mGLArray)
 	{
-		llerrs << "Wrong index buffer bound." << llendl;
+		if (mGLArray != sGLRenderArray)
+		{
+			llerrs << "Wrong vertex array bound." << llendl;
+		}
 	}
+	else
+	{
+		if (mGLIndices != sGLRenderIndices)
+		{
+			llerrs << "Wrong index buffer bound." << llendl;
+		}
 
-	if (mGLBuffer != sGLRenderBuffer)
+		if (mGLBuffer != sGLRenderBuffer)
+		{
+			llerrs << "Wrong vertex buffer bound." << llendl;
+		}
+	}
+
+	if (gDebugGL && useVBOs())
 	{
-		llerrs << "Wrong vertex buffer bound." << llendl;
+		GLint elem = 0;
+		glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem);
+
+		if (elem != mGLIndices)
+		{
+			llerrs << "Wrong index buffer bound!" << llendl;
+		}
 	}
 
 	if (mode >= LLRender::NUM_MODES)
@@ -508,14 +525,24 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 		llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
 	}
 
-	if (mGLIndices != sGLRenderIndices)
+	if (mGLArray)
 	{
-		llerrs << "Wrong index buffer bound." << llendl;
+		if (mGLArray != sGLRenderArray)
+		{
+			llerrs << "Wrong vertex array bound." << llendl;
+		}
 	}
-
-	if (mGLBuffer != sGLRenderBuffer)
+	else
 	{
-		llerrs << "Wrong vertex buffer bound." << llendl;
+		if (mGLIndices != sGLRenderIndices)
+		{
+			llerrs << "Wrong index buffer bound." << llendl;
+		}
+
+		if (mGLBuffer != sGLRenderBuffer)
+		{
+			llerrs << "Wrong vertex buffer bound." << llendl;
+		}
 	}
 
 	if (mode >= LLRender::NUM_MODES)
@@ -544,9 +571,19 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 		llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl;
 	}
 
-	if (mGLBuffer != sGLRenderBuffer || useVBOs() != sVBOActive)
+	if (mGLArray)
 	{
-		llerrs << "Wrong vertex buffer bound." << llendl;
+		if (mGLArray != sGLRenderArray)
+		{
+			llerrs << "Wrong vertex array bound." << llendl;
+		}
+	}
+	else
+	{
+		if (mGLBuffer != sGLRenderBuffer || useVBOs() != sVBOActive)
+		{
+			llerrs << "Wrong vertex buffer bound." << llendl;
+		}
 	}
 
 	if (mode >= LLRender::NUM_MODES)
@@ -645,7 +682,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 	mUsage(usage),
 	mGLBuffer(0),
 	mGLArray(0),
-	mLastMask(0),
 	mGLIndices(0), 
 	mMappedData(NULL),
 	mMappedIndexData(NULL), 
@@ -686,12 +722,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 		mOffsets[i] = 0;
 	}
 
-	//initialize cached attrib pointers
-	for (U32 i = 0; i < LL_MAX_VERTEX_ATTRIB_LOCATION; i++)
-	{
-		mLastPointer[i] = (void*) 0xFFFFFFFF;
-	}
-
 	mTypeMask = typemask;
 	mSize = 0;
 	mAlignedOffset = 0;
@@ -1065,15 +1095,98 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 		createGLBuffer();
 		createGLIndices();
 
+
 		if (gGLManager.mHasVertexArrayObject && useVBOs() && LLRender::sGLCoreProfile)
 		{
 			glGenVertexArrays(1, &mGLArray);
+			setupVertexArray();
 		}
 	}
 	
 	sAllocatedBytes += getSize() + getIndicesSize();
 }
 
+void LLVertexBuffer::setupVertexArray()
+{
+	bindGLArray();
+
+	U32 attrib_size[] = 
+	{
+		3, //TYPE_VERTEX,
+		3, //TYPE_NORMAL,
+		2, //TYPE_TEXCOORD0,
+		2, //TYPE_TEXCOORD1,
+		2, //TYPE_TEXCOORD2,
+		2, //TYPE_TEXCOORD3,
+		4, //TYPE_COLOR,
+		1, //TYPE_EMISSIVE,
+		3, //TYPE_BINORMAL,
+		1, //TYPE_WEIGHT,
+		4, //TYPE_WEIGHT4,
+		4, //TYPE_CLOTHWEIGHT,
+	};
+
+	U32 attrib_type[] =
+	{
+		GL_FLOAT, //TYPE_VERTEX,
+		GL_FLOAT, //TYPE_NORMAL,
+		GL_FLOAT, //TYPE_TEXCOORD0,
+		GL_FLOAT, //TYPE_TEXCOORD1,
+		GL_FLOAT, //TYPE_TEXCOORD2,
+		GL_FLOAT, //TYPE_TEXCOORD3,
+		GL_UNSIGNED_BYTE, //TYPE_COLOR,
+		GL_UNSIGNED_BYTE, //TYPE_EMISSIVE,
+		GL_FLOAT,   //TYPE_BINORMAL,
+		GL_FLOAT, //TYPE_WEIGHT,
+		GL_FLOAT, //TYPE_WEIGHT4,
+		GL_FLOAT, //TYPE_CLOTHWEIGHT,
+	};
+
+	U32 attrib_normalized[] =
+	{
+		GL_FALSE, //TYPE_VERTEX,
+		GL_FALSE, //TYPE_NORMAL,
+		GL_FALSE, //TYPE_TEXCOORD0,
+		GL_FALSE, //TYPE_TEXCOORD1,
+		GL_FALSE, //TYPE_TEXCOORD2,
+		GL_FALSE, //TYPE_TEXCOORD3,
+		GL_TRUE, //TYPE_COLOR,
+		GL_TRUE, //TYPE_EMISSIVE,
+		GL_FALSE,   //TYPE_BINORMAL,
+		GL_FALSE, //TYPE_WEIGHT,
+		GL_FALSE, //TYPE_WEIGHT4,
+		GL_FALSE, //TYPE_CLOTHWEIGHT,
+	};
+
+	bindGLBuffer(true);
+	bindGLIndices(true);
+
+	for (U32 i = 0; i < TYPE_MAX; ++i)
+	{
+		if (mTypeMask & (1 << i))
+		{
+			glEnableVertexAttribArrayARB(i);
+			glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]); 
+		}
+		else
+		{
+			glDisableVertexAttribArrayARB(i);
+		}
+	}
+
+	if (mTypeMask & MAP_VERTEX)
+	{ //special handling for texture index
+		S32 loc = TYPE_TEXTURE_INDEX-1;
+		glEnableVertexAttribArrayARB(loc);
+		glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, sTypeSize[TYPE_VERTEX], (void*) (mOffsets[TYPE_VERTEX]+12));
+	}
+	else
+	{
+		glDisableVertexAttribArrayARB(TYPE_TEXTURE_INDEX-1);
+	}
+	glBindVertexArray(0);
+}
+
 void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
 {
 	llassert(newnverts >= 0);
@@ -1149,8 +1262,13 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
 
 	if (mResized && useVBOs())
 	{
-		freeClientBuffer() ;
-		setBuffer(0);
+		freeClientBuffer();
+		flush();
+
+		if (mGLArray)
+		{ //if size changed, offsets changed
+			setupVertexArray();
+		}
 	}
 }
 
@@ -1215,6 +1333,7 @@ bool expand_region(LLVertexBuffer::MappedRegion& region, S32 index, S32 count)
 // Map for data access
 U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range)
 {
+	bindGLBuffer(true);
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER);
 	if (mFinal)
 	{
@@ -1265,7 +1384,6 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 		if (!mVertexLocked)
 		{
 			LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES);
-			setBuffer(0, type);
 			mVertexLocked = TRUE;
 			sMappedCount++;
 			stop_glerror();	
@@ -1380,6 +1498,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER);
+	bindGLIndices(true);
 	if (mFinal)
 	{
 		llerrs << "LLVertexBuffer::mapIndexBuffer() called on a finalized buffer." << llendl;
@@ -1427,11 +1546,21 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 		{
 			LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES);
 
-			setBuffer(0, TYPE_INDEX);
 			mIndexLocked = TRUE;
 			sMappedCount++;
 			stop_glerror();	
 
+			if (gDebugGL && useVBOs())
+			{
+				GLint elem = 0;
+				glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem);
+
+				if (elem != mGLIndices)
+				{
+					llerrs << "Wrong index buffer bound!" << llendl;
+				}
+			}
+
 			if(sDisableVBOMapping)
 			{
 				map_range = false;
@@ -1528,19 +1657,20 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 	}
 }
 
-void LLVertexBuffer::unmapBuffer(S32 type)
+void LLVertexBuffer::unmapBuffer()
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER);
-	if (!useVBOs() || type == -2)
+	if (!useVBOs())
 	{
 		return ; //nothing to unmap
 	}
 
 	bool updated_all = false ;
 
-	if (mMappedData && mVertexLocked && type != TYPE_INDEX)
+	if (mMappedData && mVertexLocked)
 	{
-		updated_all = (mIndexLocked && type < 0) ; //both vertex and index buffers done updating
+		bindGLBuffer(true);
+		updated_all = mIndexLocked; //both vertex and index buffers done updating
 
 		if(sDisableVBOMapping)
 		{
@@ -1604,8 +1734,9 @@ void LLVertexBuffer::unmapBuffer(S32 type)
 		sMappedCount--;
 	}
 	
-	if (mMappedIndexData && mIndexLocked && (type < 0 || type == TYPE_INDEX))
+	if (mMappedIndexData && mIndexLocked)
 	{
+		bindGLIndices();
 		if(sDisableVBOMapping)
 		{
 			if (!mMappedIndexRegions.empty())
@@ -1785,16 +1916,131 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 in
 
 //----------------------------------------------------------------------------
 
+bool LLVertexBuffer::bindGLArray()
+{
+	if (mGLArray && sGLRenderArray != mGLArray)
+	{
+		glBindVertexArray(mGLArray);
+		sGLRenderArray = mGLArray;
+		return true;
+	}
+		
+	return false;
+}
+
+bool LLVertexBuffer::bindGLBuffer(bool force_bind)
+{
+	bindGLArray();
+
+	bool ret = false;
+
+	if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))))
+	{
+		/*if (sMapped)
+		{
+			llerrs << "VBO bound while another VBO mapped!" << llendl;
+		}*/
+		glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
+		sGLRenderBuffer = mGLBuffer;
+		sBindCount++;
+		sVBOActive = TRUE;
+
+		if (mGLArray)
+		{
+			llassert(sGLRenderArray == mGLArray);
+			//mCachedRenderBuffer = mGLBuffer;
+		}
+
+		ret = true;
+	}
+
+	if (gDebugGL && useVBOs())
+	{
+		GLint elem = 0;
+		glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &elem);
+
+		if (elem != mGLBuffer)
+		{
+			llerrs << "Wrong vertex buffer bound!" << llendl;
+		}
+	}
+
+	return ret;
+}
+
+bool LLVertexBuffer::bindGLIndices(bool force_bind)
+{
+	bindGLArray();
+
+	bool ret = false;
+	if (useVBOs() && (force_bind || (mGLIndices && (mGLIndices != sGLRenderIndices || !sIBOActive))))
+	{
+		/*if (sMapped)
+		{
+			llerrs << "VBO bound while another VBO mapped!" << llendl;
+		}*/
+		glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
+		sGLRenderIndices = mGLIndices;
+		stop_glerror();
+		sBindCount++;
+		sIBOActive = TRUE;
+		ret = true;
+	}
+
+	if (gDebugGL && useVBOs())
+	{
+		GLint elem = 0;
+		glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem);
+
+		if (elem != mGLIndices)
+		{
+			llerrs << "Wrong index buffer bound!" << llendl;
+		}
+	}
+
+	return ret;
+}
+
+void LLVertexBuffer::flush()
+{
+	if (useVBOs())
+	{
+		if (mResized)
+		{
+			if (mGLBuffer)
+			{
+				stop_glerror();
+				bindGLBuffer(true);
+				glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage);
+				stop_glerror();
+			}
+			if (mGLIndices)
+			{
+				stop_glerror();
+				bindGLIndices(true);
+				glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage);
+				stop_glerror();
+			}
+
+			mEmpty = TRUE;
+			mResized = FALSE;
+		}
+
+		unmapBuffer();
+	}
+}
+
 // Set for rendering
-void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
+void LLVertexBuffer::setBuffer(U32 data_mask)
 {
+	flush();
+
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER);
 	//set up pointers if the data mask is different ...
-	U32& ref_mask = mGLArray ? mLastMask : sLastMask;
-	BOOL setup = (ref_mask != data_mask);
+	BOOL setup = (sLastMask != data_mask);
 
 	if (gDebugGL && data_mask != 0)
-	{
+	{ //make sure data requirements are fulfilled
 		LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
 		if (shader)
 		{
@@ -1823,37 +2069,25 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 
 	if (useVBOs())
 	{
-		if (mGLArray && mGLArray != sGLRenderArray)
+		if (mGLArray)
 		{
-			glBindVertexArray(mGLArray);
-			sGLRenderArray = mGLArray;
+			bindGLArray();
+			setup = FALSE; //do NOT perform pointer setup if using VAO
 		}
-
-		if (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))
+		else
 		{
-			/*if (sMapped)
+			if (bindGLBuffer())
 			{
-				llerrs << "VBO bound while another VBO mapped!" << llendl;
-			}*/
-			glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
-			sBindCount++;
-			sVBOActive = TRUE;
-			setup = TRUE; // ... or the bound buffer changed
-		}
-		if (mGLIndices && (mGLIndices != sGLRenderIndices || !sIBOActive))
-		{
-			/*if (sMapped)
+				setup = TRUE;
+			}
+			if (bindGLIndices())
 			{
-				llerrs << "VBO bound while another VBO mapped!" << llendl;
-			}*/
-			glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
-			stop_glerror();
-			sBindCount++;
-			sIBOActive = TRUE;
+				setup = TRUE;
+			}
 		}
 
 		BOOL error = FALSE;
-		if (gDebugGL)
+		if (gDebugGL && !mGLArray)
 		{
 			GLint buff;
 			glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
@@ -1888,81 +2122,16 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 			}
 		}
 
-		if (mResized)
+		
+	}
+	else
+	{	
+		if (sGLRenderArray)
 		{
-			if (gDebugGL)
-			{
-				GLint buff;
-				glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
-				if ((GLuint)buff != mGLBuffer)
-				{
-					if (gDebugSession)
-					{
-						error = TRUE;
-						gFailLog << "Invalid GL vertex buffer bound: " << std::endl;
-					}
-					else
-					{
-						llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
-					}
-				}
-
-				if (mGLIndices != 0)
-				{
-					glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
-					if ((GLuint)buff != mGLIndices)
-					{
-						if (gDebugSession)
-						{
-							error = TRUE;
-							gFailLog << "Invalid GL index buffer bound: "<< std::endl;
-						}
-						else
-						{
-							llerrs << "Invalid GL index buffer bound: " << buff << llendl;
-						}
-					}
-				}
-			}
-
-			if (mGLBuffer)
-			{
-				stop_glerror();
-				glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage);
-				stop_glerror();
-			}
-			if (mGLIndices)
-			{
-				stop_glerror();
-				glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage);
-				stop_glerror();
-			}
-
-			mEmpty = TRUE;
-			mResized = FALSE;
-
-			if (data_mask != 0)
-			{
-				if (gDebugSession)
-				{
-					error = TRUE;
-					gFailLog << "Buffer set for rendering before being filled after resize." << std::endl;
-				}
-				else
-				{
-					llerrs << "Buffer set for rendering before being filled after resize." << llendl;
-				}
-			}
+			glBindVertexArray(0);
+			sGLRenderArray = 0;
 		}
 
-		if (error)
-		{
-			ll_fail("LLVertexBuffer::mapBuffer failed");
-		}
-		unmapBuffer(type);
-	}
-	else
-	{		
 		if (mGLBuffer)
 		{
 			if (sVBOActive)
@@ -1974,30 +2143,30 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 			}
 			if (sGLRenderBuffer != mGLBuffer)
 			{
+				sGLRenderBuffer = mGLBuffer;
 				setup = TRUE; // ... or a client memory pointer changed
 			}
 		}
-		if (mGLIndices && sIBOActive)
+		if (mGLIndices)
 		{
-			/*if (sMapped)
+			if (sIBOActive)
 			{
-				llerrs << "VBO unbound while potentially mapped!" << llendl;
-			}*/
-			glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
-			sBindCount++;
-			sIBOActive = FALSE;
+				glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+				sBindCount++;
+				sIBOActive = FALSE;
+			}
+			
+			sGLRenderIndices = mGLIndices;
 		}
 	}
 
-	setupClientArrays(data_mask, ref_mask);
-		
-	if (mGLIndices)
+	if (!mGLArray)
 	{
-		sGLRenderIndices = mGLIndices;
+		setupClientArrays(data_mask, sLastMask);
 	}
+			
 	if (mGLBuffer)
 	{
-		sGLRenderBuffer = mGLBuffer;
 		if (data_mask && setup)
 		{
 			setupVertexBuffer(data_mask); // subclass specific setup (virtual function)
@@ -2007,319 +2176,140 @@ void LLVertexBuffer::setBuffer(U32 data_mask, S32 type)
 }
 
 // virtual (default)
-void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
+void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER);
 	stop_glerror();
 	U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
 
-	if ((data_mask & mTypeMask) != data_mask)
+	/*if ((data_mask & mTypeMask) != data_mask)
 	{
 		llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
-	}
-
-	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-
-	//assert that fixed function is allowed OR a shader is currently bound
-	llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
+	}*/
 
-	if (data_mask & MAP_NORMAL)
+	if (LLGLSLShader::sNoFixedFunction)
 	{
-		S32 loc = -1;
-		if (shader)
-		{
-			loc = shader->getAttribLocation(TYPE_NORMAL);
-		}
-		
-		if (loc >= 0)
+		if (data_mask & MAP_NORMAL)
 		{
+			S32 loc = TYPE_NORMAL;
 			void* ptr = (void*)(base + mOffsets[TYPE_NORMAL]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
-		}
-		else if (!shader)
-		{
-			glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
-		}
-	}
-	if (data_mask & MAP_TEXCOORD3)
-	{
-		S32 loc = -1;
-		if (shader)
-		{
-			loc = shader->getAttribLocation(TYPE_TEXCOORD3);
+			glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr);
 		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_TEXCOORD3)
 		{
+			S32 loc = TYPE_TEXCOORD3;
 			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD3]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
-		}
-		else if (!shader)
-		{
-			glClientActiveTextureARB(GL_TEXTURE3_ARB);
-			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
-			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr);
 		}
-	}
-	if (data_mask & MAP_TEXCOORD2)
-	{
-		S32 loc = -1;
-		if (shader)
-		{
-			loc = shader->getAttribLocation(TYPE_TEXCOORD2);
-		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_TEXCOORD2)
 		{
+			S32 loc = TYPE_TEXCOORD2;
 			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD2]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
-		}
-		else if (!shader)
-		{
-			glClientActiveTextureARB(GL_TEXTURE2_ARB);
-			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
-			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr);
 		}
-	}
-	if (data_mask & MAP_TEXCOORD1)
-	{
-		S32 loc = -1;
-		if (shader)
-		{
-			loc = shader->getAttribLocation(TYPE_TEXCOORD1);
-		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_TEXCOORD1)
 		{
+			S32 loc = TYPE_TEXCOORD1;
 			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD1]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
-		}
-		else if (!shader)
-		{
-			glClientActiveTextureARB(GL_TEXTURE1_ARB);
-			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
-			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr);
 		}
-	}
-	if (data_mask & MAP_BINORMAL)
-	{
-		S32 loc = -1;
-		if (shader)
-		{
-			loc = shader->getAttribLocation(TYPE_BINORMAL);
-		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_BINORMAL)
 		{
+			S32 loc = TYPE_BINORMAL;
 			void* ptr = (void*)(base + mOffsets[TYPE_BINORMAL]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
-		}
-		else if (!shader)
-		{
-			glClientActiveTextureARB(GL_TEXTURE2_ARB);
-			glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
-			glClientActiveTextureARB(GL_TEXTURE0_ARB);
+			glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], ptr);
 		}
-	}
-	if (data_mask & MAP_TEXCOORD0)
-	{
-		S32 loc = -1;
-		if (shader)
-		{
-			loc = shader->getAttribLocation(TYPE_TEXCOORD0);
-		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_TEXCOORD0)
 		{
+			S32 loc = TYPE_TEXCOORD0;
 			void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD0]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
+			glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr);
 		}
-		else if (!shader)
+		if (data_mask & MAP_COLOR)
 		{
-			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
+			S32 loc = TYPE_COLOR;
+			void* ptr = (void*)(base + mOffsets[TYPE_COLOR]);
+			glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr);
 		}
-	}
-	if (data_mask & MAP_COLOR)
-	{
-		S32 loc = -1;
-		if (shader)
+		if (data_mask & MAP_EMISSIVE)
 		{
-			loc = shader->getAttribLocation(TYPE_COLOR);
+			S32 loc = TYPE_EMISSIVE;
+			void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]);
+			glVertexAttribPointerARB(loc, 1, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
 		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_WEIGHT)
 		{
-			void* ptr = (void*)(base + mOffsets[TYPE_COLOR]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
+			S32 loc = TYPE_WEIGHT;
+			void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
+			glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
 		}
-		else if (!shader)
+		if (data_mask & MAP_WEIGHT4)
 		{
-			glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
+			S32 loc = TYPE_WEIGHT4;
+			void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
+			glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
 		}
-	}
-	if (data_mask & MAP_EMISSIVE)
-	{
-		S32 loc = -1;
-		if (shader)
+		if (data_mask & MAP_CLOTHWEIGHT)
 		{
-			loc = shader->getAttribLocation(TYPE_EMISSIVE);
+			S32 loc = TYPE_CLOTHWEIGHT;
+			void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
+			glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
 		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_TEXTURE_INDEX)
 		{
-			void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc, 1, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
+			S32 loc = TYPE_TEXTURE_INDEX-1; //hack, texture index attrib location is off by one
+			void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
+			glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
 		}
-	}
-	if (data_mask & MAP_WEIGHT)
+		if (data_mask & MAP_VERTEX)
+		{
+			S32 loc = TYPE_VERTEX;
+			void* ptr = (void*)(base + mOffsets[TYPE_VERTEX]);
+			glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+		}	
+	}	
+	else
 	{
-		S32 loc = -1;
-		if (shader)
+		if (data_mask & MAP_NORMAL)
 		{
-			loc = shader->getAttribLocation(TYPE_WEIGHT);
+			glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
 		}
-
-		if (loc > -1)
+		if (data_mask & MAP_TEXCOORD3)
 		{
-			void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
+			glClientActiveTextureARB(GL_TEXTURE3_ARB);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
 		}
-	}
-
-	if (data_mask & MAP_WEIGHT4)
-	{
-		if (shader)
+		if (data_mask & MAP_TEXCOORD2)
 		{
-			S32 loc = shader->getAttribLocation(TYPE_WEIGHT4);
-			if (loc > -1)
-			{
-				void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
-				if (mLastPointer[loc] != ptr)
-				{
-					glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
-				}
-				if (mGLArray)
-				{
-					mLastPointer[loc] = ptr;
-				}
-			}
+			glClientActiveTextureARB(GL_TEXTURE2_ARB);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
 		}
-	}
-
-	if (data_mask & MAP_CLOTHWEIGHT)
-	{
-		S32 loc = -1;
-		if (shader)
+		if (data_mask & MAP_TEXCOORD1)
 		{
-			loc = shader->getAttribLocation(TYPE_CLOTHWEIGHT);
+			glClientActiveTextureARB(GL_TEXTURE1_ARB);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
 		}
-
-		if (loc > -1)
+		if (data_mask & MAP_BINORMAL)
 		{
-			void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
-			if (mLastPointer[loc] != ptr)
-			{
-				glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
-			}
-			if (mGLArray)
-			{
-				mLastPointer[loc] = ptr;
-			}
+			glClientActiveTextureARB(GL_TEXTURE2_ARB);
+			glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
+			glClientActiveTextureARB(GL_TEXTURE0_ARB);
 		}
-	}
-	if (data_mask & MAP_VERTEX)
-	{
-		S32 loc = -1;
-		if (shader)
+		if (data_mask & MAP_TEXCOORD0)
 		{
-			loc = shader->getAttribLocation(TYPE_VERTEX);
+			glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
 		}
-
-		if (loc >= 0)
+		if (data_mask & MAP_COLOR)
 		{
-			if (data_mask & MAP_TEXTURE_INDEX)
-			{
-				glVertexAttribPointerARB(loc, 4,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
-			}
-			else
-			{
-				glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
-			}
+			glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
 		}
-		else if (!shader)
+		if (data_mask & MAP_VERTEX)
 		{
-			if (data_mask & MAP_TEXTURE_INDEX)
-			{
-				glVertexPointer(4,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
-			}
-			else
-			{
-				glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
-			}
-		}
+			glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+		}	
 	}
 
 	llglassertok();
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 60cfde39f58..eba10dbaa5f 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -139,6 +139,7 @@ class LLVertexBuffer : public LLRefCount
 	// 3 - modify LLVertexBuffer::setupVertexBuffer
 	// 4 - modify LLVertexBuffer::setupClientArray
 	// 5 - modify LLViewerShaderMgr::mReservedAttribs
+	// 6 - update LLVertexBuffer::setupVertexArray
 	enum {
 		TYPE_VERTEX,
 		TYPE_NORMAL,
@@ -154,10 +155,9 @@ class LLVertexBuffer : public LLRefCount
 		TYPE_WEIGHT4,
 		TYPE_CLOTHWEIGHT,
 		TYPE_MAX,
-		TYPE_INDEX,
-		
 		//no actual additional data, but indicates position.w is texture index
 		TYPE_TEXTURE_INDEX,
+		TYPE_INDEX,		
 	};
 	enum {
 		MAP_VERTEX = (1<<TYPE_VERTEX),
@@ -181,10 +181,14 @@ class LLVertexBuffer : public LLRefCount
 
 	virtual ~LLVertexBuffer(); // use unref()
 
-	virtual void setupVertexBuffer(U32 data_mask) const; // pure virtual, called from mapBuffer()
+	virtual void setupVertexBuffer(U32 data_mask); // pure virtual, called from mapBuffer()
+	void setupVertexArray();
 	
 	void	genBuffer();
 	void	genIndices();
+	bool	bindGLBuffer(bool force_bind = false);
+	bool	bindGLIndices(bool force_bind = false);
+	bool	bindGLArray();
 	void	releaseBuffer();
 	void	releaseIndices();
 	void	createGLBuffer();
@@ -194,7 +198,7 @@ class LLVertexBuffer : public LLRefCount
 	void	updateNumVerts(S32 nverts);
 	void	updateNumIndices(S32 nindices); 
 	virtual BOOL	useVBOs() const;
-	void	unmapBuffer(S32 type);
+	void	unmapBuffer();
 	void freeClientBuffer() ;
 	void allocateClientVertexBuffer() ;
 	void allocateClientIndexBuffer() ;
@@ -207,7 +211,8 @@ class LLVertexBuffer : public LLRefCount
 	U8*		mapIndexBuffer(S32 index, S32 count, bool map_range);
 
 	// set for rendering
-	virtual void	setBuffer(U32 data_mask, S32 type = -1); 	// calls  setupVertexBuffer() if data_mask is not 0
+	virtual void	setBuffer(U32 data_mask); 	// calls  setupVertexBuffer() if data_mask is not 0
+	void flush(); //flush pending data to GL memory
 	// allocate buffer
 	void	allocateBuffer(S32 nverts, S32 nindices, bool create);
 	virtual void resizeBuffer(S32 newnverts, S32 newnindices);
@@ -273,9 +278,7 @@ class LLVertexBuffer : public LLRefCount
 	U32		mGLBuffer;		// GL VBO handle
 	U32		mGLIndices;		// GL IBO handle
 	U32		mGLArray;		// GL VAO handle
-	U32		mLastMask;		
-	mutable void*   mLastPointer[LL_MAX_VERTEX_ATTRIB_LOCATION];
-
+	
 	U8*		mMappedData;	// pointer to currently mapped data (NULL if unmapped)
 	U8*		mMappedIndexData;	// pointer to currently mapped indices (NULL if unmapped)
 	BOOL	mVertexLocked;			// if TRUE, vertex buffer is being or has been written to in client memory
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a8a7b165a3c..32d4097ff36 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7681,7 +7681,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
   <key>RenderDebugNormalScale</key>
   <map>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 9920caf7f66..74ee082bed2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -28,7 +28,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
@@ -97,7 +98,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index 36000b86d66..908f3abcd0c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -27,7 +27,8 @@ uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
@@ -43,7 +44,7 @@ void main()
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vary_normal = normalize(normal_matrix * normal);
 
 	vertex_color = diffuse_color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index b3558be6787..50e92c191b4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -27,7 +27,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE float emissive;
 ATTRIBUTE vec2 texcoord0;
 
@@ -48,7 +49,7 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
 	vec4 pos = (modelview_matrix * vert);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index ef9f62da847..ab638991f7b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -28,7 +28,8 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
@@ -49,7 +50,7 @@ void main()
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
 	vec4 pos = (modelview_matrix * vert);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
index 0e05beac678..77b0806bfcd 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -27,7 +27,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE float emissive;
 ATTRIBUTE vec2 texcoord0;
 
@@ -42,7 +43,7 @@ VARYING float fog_depth;
 void main()
 {
 	//transform vertex
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 268e4127a28..6a3777c7c85 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -28,7 +28,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
@@ -96,7 +97,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
index ef97e4f781f..580ef2694fc 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
@@ -36,7 +36,8 @@ uniform vec4 origin;
 
 VARYING float vary_texture_index;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
@@ -50,7 +51,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
index 2fd22cee9da..09dbd0b6cd8 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
@@ -27,7 +27,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
  
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
@@ -44,7 +45,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
index 472ff219e5b..86c592ea575 100644
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
@@ -29,7 +29,8 @@ uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
@@ -51,7 +52,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 		
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
index 144336417e9..8e8f0664b05 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
@@ -28,7 +28,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
-ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float texture_index;
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
@@ -45,7 +46,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = position.w;
+	vary_texture_index = texture_index;
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 7ae11bff94d..d36379b0e75 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1216,7 +1216,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 	
@@ -1441,7 +1441,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 			if (map_range)
 			{
-				mVertexBuffer->setBuffer(0);
+				mVertexBuffer->flush();
 			}
 		}
 		else
@@ -1588,7 +1588,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 			if (map_range)
 			{
-				mVertexBuffer->setBuffer(0);
+				mVertexBuffer->flush();
 			}
 
 			if (do_bump)
@@ -1625,7 +1625,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 				if (map_range)
 				{
-					mVertexBuffer->setBuffer(0);
+					mVertexBuffer->flush();
 				}
 			}
 		}
@@ -1675,7 +1675,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 		
@@ -1695,7 +1695,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 		
@@ -1715,7 +1715,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 	
@@ -1727,7 +1727,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		LLVector4a::memcpyNonAliased16((F32*) weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32));
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 
@@ -1757,7 +1757,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 
@@ -1796,7 +1796,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		if (map_range)
 		{
-			mVertexBuffer->setBuffer(0);
+			mVertexBuffer->flush();
 		}
 	}
 	if (rebuild_tcoord)
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index db5e4a2fb5c..cc92ab45390 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -320,7 +320,7 @@ void LLSpatialGroup::buildOcclusion()
 	}
 	
 	{
-		mOcclusionVerts->setBuffer(0);
+		mOcclusionVerts->flush();
 	}
 
 	clearState(LLSpatialGroup::OCCLUSION_DIRTY);
diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp
index 4bde2dfcab5..c3eb70f850c 100644
--- a/indra/newview/llsprite.cpp
+++ b/indra/newview/llsprite.cpp
@@ -243,7 +243,7 @@ void LLSprite::updateFace(LLFace &face)
 		*indicesp++ = 3 + index_offset;
 	}
 
-	face.getVertexBuffer()->setBuffer(0);
+	face.getVertexBuffer()->flush();
 	face.mCenterAgent = mPosition;
 }
 
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 59835028a17..331eb8b8f4a 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -817,7 +817,7 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh)
 		}
 	}
 
-	buffer->setBuffer(0);
+	buffer->flush();
 }
 
 const U32 UPDATE_GEOMETRY_CALL_MASK			= 0x1FFF; // 8K samples before overflow
diff --git a/indra/newview/llviewerjointmesh_sse.cpp b/indra/newview/llviewerjointmesh_sse.cpp
index 400b49d0460..00ed47e091b 100644
--- a/indra/newview/llviewerjointmesh_sse.cpp
+++ b/indra/newview/llviewerjointmesh_sse.cpp
@@ -101,7 +101,7 @@ void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
 		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
 	}
 
-	buffer->setBuffer(0);
+	buffer->flush();
 }
 
 #else
diff --git a/indra/newview/llviewerjointmesh_vec.cpp b/indra/newview/llviewerjointmesh_vec.cpp
index 6600d01d171..a8713b6f058 100644
--- a/indra/newview/llviewerjointmesh_vec.cpp
+++ b/indra/newview/llviewerjointmesh_vec.cpp
@@ -92,6 +92,6 @@ void LLViewerJointMesh::updateGeometryVectorized(LLFace *face, LLPolyMesh *mesh)
 		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
 	}
 
-	buffer->setBuffer(0);
+	buffer->flush();
 #endif
 }
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index d1d3334fed9..b0d97ee5f63 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -317,6 +317,7 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void)
 		mReservedAttribs.push_back("weight");
 		mReservedAttribs.push_back("weight4");
 		mReservedAttribs.push_back("clothing");
+		mReservedAttribs.push_back("texture_index");
 
 		mAvatarUniforms.push_back("matrixPalette");
 		mAvatarUniforms.push_back("gWindDir");
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 7c6a815defc..2a670275a30 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2142,7 +2142,7 @@ void LLVOAvatar::updateMeshData()
 			}
 
 			stop_glerror();
-			buff->setBuffer(0);
+			buff->flush();
 
 			if(!f_num)
 			{
@@ -4132,7 +4132,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
 			LLVertexBuffer* vb = mDrawable->getFace(0)->getVertexBuffer();
 			if (vb)
 			{
-				vb->setBuffer(0);
+				vb->flush();
 			}
 		}
 	}
diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp
index ce256fdedf4..0060f81ab50 100644
--- a/indra/newview/llvoground.cpp
+++ b/indra/newview/llvoground.cpp
@@ -162,7 +162,7 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable)
 	*(texCoordsp++) = LLVector2(0.f, 1.f);
 	*(texCoordsp++) = LLVector2(0.5f, 0.5f);
 	
-	face->getVertexBuffer()->setBuffer(0);
+	face->getVertexBuffer()->flush();
 	LLPipeline::sCompiles++;
 	return TRUE;
 }
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index a4b0910c926..d7edc94c2f0 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -513,7 +513,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
 		}
 	}
 
-	buffer->setBuffer(0);
+	buffer->flush();
 	mFaceList.clear();
 }
 
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 29ca16ede61..d90c3be6c78 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -1267,7 +1267,7 @@ void LLVOSky::updateDummyVertexBuffer()
 	LLStrider<LLVector3> vertices ;
 	mFace[FACE_DUMMY]->getVertexBuffer()->getVertexStrider(vertices,  0);
 	*vertices = mCameraPosAgent ;
-	mFace[FACE_DUMMY]->getVertexBuffer()->setBuffer(0) ;
+	mFace[FACE_DUMMY]->getVertexBuffer()->flush();
 }
 //----------------------------------
 //end of fake vertex buffer updating
@@ -1351,7 +1351,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
 			*indicesp++ = index_offset + 3;
 			*indicesp++ = index_offset + 2;
 
-			buff->setBuffer(0);
+			buff->flush();
 		}
 	}
 
@@ -1516,7 +1516,7 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, cons
 	*indicesp++ = index_offset + 2;
 	*indicesp++ = index_offset + 3;
 
-	facep->getVertexBuffer()->setBuffer(0);
+	facep->getVertexBuffer()->flush();
 
 	if (is_sun)
 	{
@@ -2030,7 +2030,7 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H,
 		}
 	}
 
-	face->getVertexBuffer()->setBuffer(0);
+	face->getVertexBuffer()->flush();
 }
 
 
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 7e00350926b..bc82b0df130 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -57,7 +57,7 @@ class LLVertexBufferTerrain : public LLVertexBuffer
 	};
 
 	// virtual
-	void setupVertexBuffer(U32 data_mask) const
+	void setupVertexBuffer(U32 data_mask)
 	{	
 		if (LLGLSLShader::sNoFixedFunction)
 		{ //just use default if shaders are in play
@@ -1122,7 +1122,7 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
 		index_offset += facep->getGeomCount();
 	}
 
-	buffer->setBuffer(0);
+	buffer->flush();
 	mFaceList.clear();
 }
 
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 4cef0f5b5be..6486fd24ea4 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -858,7 +858,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
 			slices /= 2; 
 		}
 
-		mReferenceBuffer->setBuffer(0);
+		mReferenceBuffer->flush();
 		llassert(vertex_count == max_vertices);
 		llassert(index_count == max_indices);
 	}
@@ -940,8 +940,8 @@ void LLVOTree::updateMesh()
 
 	genBranchPipeline(vertices, normals, tex_coords, indices, idx_offset, scale_mat, mTrunkLOD, stop_depth, mDepth, mTrunkDepth, 1.0, mTwist, droop, mBranches, alpha);
 	
-	mReferenceBuffer->setBuffer(0);
-	buff->setBuffer(0);
+	mReferenceBuffer->flush();
+	buff->flush();
 }
 
 void LLVOTree::appendMesh(LLStrider<LLVector3>& vertices, 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3b31100305a..c56a62a41b4 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4422,7 +4422,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 		
 		for (std::set<LLVertexBuffer*>::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter)
 		{
-			(*iter)->setBuffer(0);
+			(*iter)->flush();
 		}
 
 		// don't forget alpha
@@ -4430,7 +4430,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 		   !group->mVertexBuffer.isNull() && 
 		   group->mVertexBuffer->isLocked())
 		{
-			group->mVertexBuffer->setBuffer(0);
+			group->mVertexBuffer->flush();
 		}
 
 		//if not all buffers are unmapped
@@ -4446,7 +4446,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 					LLVertexBuffer* buff = face->getVertexBuffer();
 					if (face && buff && buff->isLocked())
 					{
-						buff->setBuffer(0) ;
+						buff->flush();
 					}
 				}
 			} 
@@ -4852,7 +4852,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 			++face_iter;
 		}
 
-		buffer->setBuffer(0);
+		buffer->flush();
 	}
 
 	group->mBufferMap[mask].clear();
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index e70ac0a2e74..75198c465be 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -231,7 +231,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
 		}
 	}
 	
-	buff->setBuffer(0);
+	buff->flush();
 
 	mDrawable->movePartition();
 	LLPipeline::sCompiles++;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index 824cb8a15f0..c26aefb28f7 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -326,7 +326,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
 
 		buildFanBuffer(vertices, texCoords, indices);
 
-		mFanVerts->setBuffer(0);
+		mFanVerts->flush();
 	}
 
 	{
@@ -388,7 +388,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
 			buildStripsBuffer(begin_stack, end_stack,  vertices, texCoords, indices);
 
 			// and unlock the buffer
-			segment->setBuffer(0);
+			segment->flush();
 		}
 	}
 #else
@@ -468,7 +468,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
 		}
 	}
 
-	mStripsVerts->setBuffer(0);
+	mStripsVerts->flush();
 #endif
 
 	updateStarColors();
@@ -826,6 +826,6 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
 		*(colorsp++)    = LLColor4U(mStarColors[vtx]);
 	}
 
-	mStarsVerts->setBuffer(0);
+	mStarsVerts->flush();
 	return TRUE;
 }
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 0fbe0308321..28391bf423f 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6553,7 +6553,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		v[1] = LLVector3(-1,3,0);
 		v[2] = LLVector3(3,-1,0);
 				
-		buff->setBuffer(0);
+		buff->flush();
 
 		LLGLDisable blend(GL_BLEND);
 
-- 
GitLab


From 57620a9da903f3c6fe482627d18c44b6411e6910 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 23 Sep 2011 17:59:05 -0500
Subject: [PATCH 041/933] SH-2244 Vertex buffer cleanup, fix for bad vertices
 in rigged attachments, added "RenderUseVAO" debug setting to control whether
 or not to use VAO's in non-core GL profiles.

---
 indra/llrender/llgl.cpp                 |   1 +
 indra/llrender/llimagegl.cpp            |   5 +-
 indra/llrender/llvertexbuffer.cpp       | 276 ++++++++++--------------
 indra/llrender/llvertexbuffer.h         |  13 +-
 indra/newview/app_settings/settings.xml |  11 +
 indra/newview/lldrawpoolavatar.cpp      |  73 ++++++-
 indra/newview/lldrawpoolavatar.h        |   1 +
 indra/newview/llviewercontrol.cpp       |   1 +
 indra/newview/pipeline.cpp              |   2 +
 9 files changed, 201 insertions(+), 182 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 6875674e792..f546e073205 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -656,6 +656,7 @@ bool LLGLManager::initGL()
 
 	if (mHasDebugOutput && gDebugGL)
 	{ //setup debug output callback
+		glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, GL_TRUE);
 		glDebugMessageCallbackARB((GLDEBUGPROCARB) gl_debug_callback, NULL);
 		glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
 	}
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 4da796dd1e7..12089e5ad3d 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1153,9 +1153,8 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
 			U32 pixel_count = (U32) (width*height);
 			for (U32 i = 0; i < pixel_count; i++)
 			{
-				U8 lum = ((U8*) pixels)[i*2+0];
-				U8 alpha = ((U8*) pixels)[i*2+1];
-
+				U8 lum = ((U8*) pixels)[i];
+				
 				U8* pix = (U8*) &scratch[i];
 				pix[0] = pix[1] = pix[2] = lum;
 				pix[3] = 255;
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index a48669a3007..b2a0f6822d2 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -63,6 +63,7 @@ BOOL LLVertexBuffer::sIBOActive = FALSE;
 U32 LLVertexBuffer::sAllocatedBytes = 0;
 BOOL LLVertexBuffer::sMapped = FALSE;
 BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
+BOOL LLVertexBuffer::sUseVAO = FALSE;
 BOOL LLVertexBuffer::sPreferStreamDraw = FALSE;
 std::vector<U32> LLVertexBuffer::sDeleteList;
 
@@ -134,6 +135,7 @@ S32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] =
 	sizeof(F32),	   // TYPE_WEIGHT,
 	sizeof(LLVector4), // TYPE_WEIGHT4,
 	sizeof(LLVector4), // TYPE_CLOTHWEIGHT,
+	sizeof(LLVector4), // TYPE_TEXTURE_INDEX (actually exists as position.w), no extra data, but stride is 16 bytes
 };
 
 U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] = 
@@ -150,188 +152,135 @@ U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] =
 
 
 //static
-void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& sLastMask)
+void LLVertexBuffer::setupClientArrays(U32 data_mask)
 {
-	/*if (LLGLImmediate::sStarted)
-	{
-		llerrs << "Cannot use LLGLImmediate and LLVertexBuffer simultaneously!" << llendl;
-	}*/
-
 	if (sLastMask != data_mask)
 	{
-
-		LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-
-		U32 mask[] =
-		{
-			MAP_VERTEX,
-			MAP_NORMAL,
-			MAP_TEXCOORD0,
-			MAP_COLOR,
-			MAP_EMISSIVE,
-			MAP_WEIGHT,
-			MAP_WEIGHT4,
-			MAP_BINORMAL,
-			MAP_CLOTHWEIGHT,
-			MAP_TEXTURE_INDEX,
-		};
-		
-		U32 type[] =
-		{
-			TYPE_VERTEX,
-			TYPE_NORMAL,
-			TYPE_TEXCOORD0,
-			TYPE_COLOR,
-			TYPE_EMISSIVE,
-			TYPE_WEIGHT,
-			TYPE_WEIGHT4,
-			TYPE_BINORMAL,
-			TYPE_CLOTHWEIGHT,
-			TYPE_TEXTURE_INDEX-1,
-		};
-
-		GLenum array[] =
-		{
-			GL_VERTEX_ARRAY,
-			GL_NORMAL_ARRAY,
-			GL_TEXTURE_COORD_ARRAY,
-			GL_COLOR_ARRAY,
-			0,
-			0,
-			0,
-			0,
-			0,
-			0,
-		};
-
 		BOOL error = FALSE;
-		for (U32 i = 0; i < 10; ++i)
-		{
-			S32 loc = -1;
 
-			if (LLGLSLShader::sNoFixedFunction)
+		if (LLGLSLShader::sNoFixedFunction)
+		{
+			for (U32 i = 0; i < TYPE_MAX; ++i)
 			{
-				loc = type[i];
-			}
-									
-			if (sLastMask & mask[i])
-			{ //was enabled
-				if (!(data_mask & mask[i]))
-				{ //needs to be disabled
-					if (loc >= 0)
-					{
+				S32 loc = i;
+										
+				U32 mask = 1 << i;
+
+				if (sLastMask & (1 << i))
+				{ //was enabled
+					if (!(data_mask & mask))
+					{ //needs to be disabled
 						glDisableVertexAttribArrayARB(loc);
 					}
-					else
-					{
+				}
+				else 
+				{	//was disabled
+					if (data_mask & mask)
+					{ //needs to be enabled
+						glEnableVertexAttribArrayARB(loc);
+					}
+				}
+			}
+		}
+		else
+		{
+
+			GLenum array[] =
+			{
+				GL_VERTEX_ARRAY,
+				GL_NORMAL_ARRAY,
+				GL_TEXTURE_COORD_ARRAY,
+				GL_COLOR_ARRAY,
+			};
+
+			GLenum mask[] = 
+			{
+				MAP_VERTEX,
+				MAP_NORMAL,
+				MAP_TEXCOORD0,
+				MAP_COLOR
+			};
+
+
+
+			for (U32 i = 0; i < 4; ++i)
+			{
+				if (sLastMask & mask[i])
+				{ //was enabled
+					if (!(data_mask & mask[i]))
+					{ //needs to be disabled
 						glDisableClientState(array[i]);
 					}
+					else if (gDebugGL)
+					{ //needs to be enabled, make sure it was (DEBUG)
+						if (!glIsEnabled(array[i]))
+						{
+							if (gDebugSession)
+							{
+								error = TRUE;
+								gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl;
+							}
+							else
+							{
+								llerrs << "Bad client state! " << array[i] << " disabled." << llendl;
+							}
+						}
+					}
 				}
-				else if (gDebugGL && !LLGLSLShader::sNoFixedFunction && array[i])
-				{ //needs to be enabled, make sure it was (DEBUG)
-					if (loc < 0 && !glIsEnabled(array[i]))
-					{
+				else 
+				{	//was disabled
+					if (data_mask & mask[i])
+					{ //needs to be enabled
+						glEnableClientState(array[i]);
+					}
+					else if (gDebugGL && glIsEnabled(array[i]))
+					{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
 						if (gDebugSession)
 						{
 							error = TRUE;
-							gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl;
+							gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl;
 						}
 						else
 						{
-							llerrs << "Bad client state! " << array[i] << " disabled." << llendl;
+							llerrs << "Bad client state! " << array[i] << " enabled." << llendl;
 						}
 					}
 				}
 			}
-			else 
-			{	//was disabled
-				if (data_mask & mask[i])
-				{ //needs to be enabled
-					if (loc >= 0)
-					{
-						glEnableVertexAttribArrayARB(loc);
-					}
-					else
-					{
-						glEnableClientState(array[i]);
-					}
-				}
-				else if (!LLGLSLShader::sNoFixedFunction && array[i] && gDebugGL && glIsEnabled(array[i]))
-				{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
-					if (gDebugSession)
-					{
-						error = TRUE;
-						gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl;
-					}
-					else
-					{
-						llerrs << "Bad client state! " << array[i] << " enabled." << llendl;
-					}
-				}
-			}
-		}
-
-		if (error)
-		{
-			ll_fail("LLVertexBuffer::setupClientArrays failed");
-		}
-
-		U32 map_tc[] = 
-		{
-			MAP_TEXCOORD1,
-			MAP_TEXCOORD2,
-			MAP_TEXCOORD3
-		};
-
-		U32 type_tc[] = 
-		{
-			TYPE_TEXCOORD1,
-			TYPE_TEXCOORD2,
-			TYPE_TEXCOORD3
-		};
-
-		for (U32 i = 0; i < 3; i++)
-		{
-			S32 loc = -1;
+		
+			U32 map_tc[] = 
+			{
+				MAP_TEXCOORD1,
+				MAP_TEXCOORD2,
+				MAP_TEXCOORD3
+			};
 
-			if (LLGLSLShader::sNoFixedFunction)
+			U32 type_tc[] = 
 			{
-				loc = type_tc[i];
-			}
+				TYPE_TEXCOORD1,
+				TYPE_TEXCOORD2,
+				TYPE_TEXCOORD3
+			};
 
-			if (sLastMask & map_tc[i])
+			for (U32 i = 0; i < 3; i++)
 			{
-				if (!(data_mask & map_tc[i]))
-				{ //disable
-					if (loc >= 0)
-					{
-						glDisableVertexAttribArrayARB(loc);
-					}
-					else
-					{
+				if (sLastMask & map_tc[i])
+				{
+					if (!(data_mask & map_tc[i]))
+					{ //disable
 						glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
 						glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 						glClientActiveTextureARB(GL_TEXTURE0_ARB);
 					}
 				}
-			}
-			else if (data_mask & map_tc[i])
-			{
-				if (loc >= 0)
-				{
-					glEnableVertexAttribArrayARB(loc);
-				}
-				else
+				else if (data_mask & map_tc[i])
 				{
 					glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
 					glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 					glClientActiveTextureARB(GL_TEXTURE0_ARB);
 				}
 			}
-		}
 
-		if (!LLGLSLShader::sNoFixedFunction)
-		{
 			if (sLastMask & MAP_BINORMAL)
 			{
 				if (!(data_mask & MAP_BINORMAL))
@@ -348,7 +297,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask, U32& sLastMask)
 				glClientActiveTextureARB(GL_TEXTURE0_ARB);
 			}
 		}
-		
+				
 		sLastMask = data_mask;
 	}
 }
@@ -734,12 +683,12 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 S32 LLVertexBuffer::calcOffsets(const U32& typemask, S32* offsets, S32 num_vertices)
 {
 	S32 offset = 0;
-	for (S32 i=0; i<TYPE_MAX; i++)
+	for (S32 i=0; i<TYPE_TEXTURE_INDEX; i++)
 	{
 		U32 mask = 1<<i;
 		if (typemask & mask)
 		{
-			if (offsets)
+			if (offsets && LLVertexBuffer::sTypeSize[i])
 			{
 				offsets[i] = offset;
 				offset += LLVertexBuffer::sTypeSize[i]*num_vertices;
@@ -748,6 +697,8 @@ S32 LLVertexBuffer::calcOffsets(const U32& typemask, S32* offsets, S32 num_verti
 		}
 	}
 
+	offsets[TYPE_TEXTURE_INDEX] = offsets[TYPE_VERTEX] + 12;
+	
 	return offset+16;
 }
 
@@ -755,7 +706,7 @@ S32 LLVertexBuffer::calcOffsets(const U32& typemask, S32* offsets, S32 num_verti
 S32 LLVertexBuffer::calcVertexSize(const U32& typemask)
 {
 	S32 size = 0;
-	for (S32 i = 0; i < TYPE_MAX; i++)
+	for (S32 i = 0; i < TYPE_TEXTURE_INDEX; i++)
 	{
 		U32 mask = 1<<i;
 		if (typemask & mask)
@@ -1096,7 +1047,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 		createGLIndices();
 
 
-		if (gGLManager.mHasVertexArrayObject && useVBOs() && LLRender::sGLCoreProfile)
+		if (gGLManager.mHasVertexArrayObject && useVBOs() && (LLRender::sGLCoreProfile || sUseVAO))
 		{
 			glGenVertexArrays(1, &mGLArray);
 			setupVertexArray();
@@ -1124,6 +1075,7 @@ void LLVertexBuffer::setupVertexArray()
 		1, //TYPE_WEIGHT,
 		4, //TYPE_WEIGHT4,
 		4, //TYPE_CLOTHWEIGHT,
+		1, //TYPE_TEXTURE_INDEX
 	};
 
 	U32 attrib_type[] =
@@ -1140,6 +1092,7 @@ void LLVertexBuffer::setupVertexArray()
 		GL_FLOAT, //TYPE_WEIGHT,
 		GL_FLOAT, //TYPE_WEIGHT4,
 		GL_FLOAT, //TYPE_CLOTHWEIGHT,
+		GL_FLOAT, //TYPE_TEXTURE_INDEX
 	};
 
 	U32 attrib_normalized[] =
@@ -1156,6 +1109,7 @@ void LLVertexBuffer::setupVertexArray()
 		GL_FALSE, //TYPE_WEIGHT,
 		GL_FALSE, //TYPE_WEIGHT4,
 		GL_FALSE, //TYPE_CLOTHWEIGHT,
+		GL_FALSE, //TYPE_TEXTURE_INDEX
 	};
 
 	bindGLBuffer(true);
@@ -1174,16 +1128,6 @@ void LLVertexBuffer::setupVertexArray()
 		}
 	}
 
-	if (mTypeMask & MAP_VERTEX)
-	{ //special handling for texture index
-		S32 loc = TYPE_TEXTURE_INDEX-1;
-		glEnableVertexAttribArrayARB(loc);
-		glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, sTypeSize[TYPE_VERTEX], (void*) (mOffsets[TYPE_VERTEX]+12));
-	}
-	else
-	{
-		glDisableVertexAttribArrayARB(TYPE_TEXTURE_INDEX-1);
-	}
 	glBindVertexArray(0);
 }
 
@@ -2162,7 +2106,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 
 	if (!mGLArray)
 	{
-		setupClientArrays(data_mask, sLastMask);
+		setupClientArrays(data_mask);
 	}
 			
 	if (mGLBuffer)
@@ -2257,7 +2201,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 		}
 		if (data_mask & MAP_TEXTURE_INDEX)
 		{
-			S32 loc = TYPE_TEXTURE_INDEX-1; //hack, texture index attrib location is off by one
+			S32 loc = TYPE_TEXTURE_INDEX;
 			void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
 			glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
 		}
@@ -2315,3 +2259,11 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 	llglassertok();
 }
 
+LLVertexBuffer::MappedRegion::MappedRegion(S32 type, S32 index, S32 count)
+: mType(type), mIndex(index), mCount(count)
+{ 
+	llassert(mType == LLVertexBuffer::TYPE_INDEX || 
+			mType < LLVertexBuffer::TYPE_TEXTURE_INDEX);
+}	
+
+
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index eba10dbaa5f..d116a552faf 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -91,9 +91,7 @@ class LLVertexBuffer : public LLRefCount
 		S32 mIndex;
 		S32 mCount;
 		
-		MappedRegion(S32 type, S32 index, S32 count)
-			: mType(type), mIndex(index), mCount(count)
-		{ }	
+		MappedRegion(S32 type, S32 index, S32 count);
 	};
 
 	LLVertexBuffer(const LLVertexBuffer& rhs)
@@ -113,11 +111,12 @@ class LLVertexBuffer : public LLRefCount
 	static LLVBOPool sDynamicIBOPool;
 
 	static BOOL	sUseStreamDraw;
+	static BOOL sUseVAO;
 	static BOOL	sPreferStreamDraw;
 
 	static void initClass(bool use_vbo, bool no_vbo_mapping);
 	static void cleanupClass();
-	static void setupClientArrays(U32 data_mask, U32& ref_mask = LLVertexBuffer::sLastMask);
+	static void setupClientArrays(U32 data_mask);
 	static void drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm);
 	static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp);
 
@@ -141,7 +140,7 @@ class LLVertexBuffer : public LLRefCount
 	// 5 - modify LLViewerShaderMgr::mReservedAttribs
 	// 6 - update LLVertexBuffer::setupVertexArray
 	enum {
-		TYPE_VERTEX,
+		TYPE_VERTEX = 0,
 		TYPE_NORMAL,
 		TYPE_TEXCOORD0,
 		TYPE_TEXCOORD1,
@@ -149,14 +148,12 @@ class LLVertexBuffer : public LLRefCount
 		TYPE_TEXCOORD3,
 		TYPE_COLOR,
 		TYPE_EMISSIVE,
-		// These use VertexAttribPointer and should possibly be made generic
 		TYPE_BINORMAL,
 		TYPE_WEIGHT,
 		TYPE_WEIGHT4,
 		TYPE_CLOTHWEIGHT,
-		TYPE_MAX,
-		//no actual additional data, but indicates position.w is texture index
 		TYPE_TEXTURE_INDEX,
+		TYPE_MAX,
 		TYPE_INDEX,		
 	};
 	enum {
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 32d4097ff36..5201349b174 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9205,6 +9205,17 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>RenderUseVAO</key>
+    <map>
+      <key>Comment</key>
+      <string>Use GL Vertex Array Objects</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>RenderVBOMappingDisable</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index f161790b99d..f4e6bb9b1dc 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1274,9 +1274,11 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 
 	U32 data_mask = face->getRiggedVertexBufferDataMask();
 	
+	S32 num_verts = (vol_face.mNumVertices + 0xF) & ~0xF;
+
 	if (!buffer || 
 		buffer->getTypeMask() != data_mask ||
-		buffer->getRequestedVerts() != vol_face.mNumVertices)
+		buffer->getRequestedVerts() != num_verts)
 	{
 		face->setGeomIndex(0);
 		face->setIndicesIndex(0);
@@ -1310,6 +1312,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 		LLMatrix3 mat_normal(mat3);				
 
 		face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true);
+
+		buffer->flush();
 	}
 
 	if (sShaderLevel <= 0 && face->mLastSkinTime < avatar->getLastSkinTime())
@@ -1441,12 +1445,12 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 			continue;
 		}
 
-		stop_glerror();
+		//stop_glerror();
 
-		const LLVolumeFace& vol_face = volume->getVolumeFace(te);
-		updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face);
+		//const LLVolumeFace& vol_face = volume->getVolumeFace(te);
+		//updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face);
 		
-		stop_glerror();
+		//stop_glerror();
 
 		U32 data_mask = LLFace::getRiggedDataMask(type);
 
@@ -1482,17 +1486,15 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 				data_mask &= ~LLVertexBuffer::MAP_WEIGHT4;
 			}
 
-			buff->setBuffer(data_mask);
-
 			U16 start = face->getGeomStart();
 			U16 end = start + face->getGeomCount()-1;
 			S32 offset = face->getIndicesStart();
 			U32 count = face->getIndicesCount();
 
-			if (glow)
+			/*if (glow)
 			{
 				gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow());
-			}
+			}*/
 
 			gGL.getTexUnit(sDiffuseChannel)->bind(face->getTexture());
 			if (normal_channel > -1)
@@ -1504,12 +1506,14 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 			{
 				gGL.matrixMode(LLRender::MM_TEXTURE);
 				gGL.loadMatrix((F32*) face->mTextureMatrix->mMatrix);
+				buff->setBuffer(data_mask);
 				buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);
 				gGL.loadIdentity();
 				gGL.matrixMode(LLRender::MM_MODELVIEW);
 			}
 			else
 			{
+				buff->setBuffer(data_mask);
 				buff->drawRange(LLRender::TRIANGLES, start, end, count, offset);		
 			}
 		}
@@ -1518,6 +1522,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 
 void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar)
 {
+	updateRiggedVertexBuffers(avatar);
 	renderRigged(avatar, RIGGED_DEFERRED_SIMPLE);
 }
 
@@ -1526,8 +1531,58 @@ void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar)
 	renderRigged(avatar, RIGGED_DEFERRED_BUMP);
 }
 
+void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
+{
+	//update rigged vertex buffers
+	for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type)
+	{
+		for (U32 i = 0; i < mRiggedFace[type].size(); ++i)
+		{
+			LLFace* face = mRiggedFace[type][i];
+			LLDrawable* drawable = face->getDrawable();
+			if (!drawable)
+			{
+				continue;
+			}
+
+			LLVOVolume* vobj = drawable->getVOVolume();
+
+			if (!vobj)
+			{
+				continue;
+			}
+
+			LLVolume* volume = vobj->getVolume();
+			S32 te = face->getTEOffset();
+
+			if (!volume || volume->getNumVolumeFaces() <= te)
+			{
+				continue;
+			}
+
+			LLUUID mesh_id = volume->getParams().getSculptID();
+			if (mesh_id.isNull())
+			{
+				continue;
+			}
+
+			const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj);
+			if (!skin)
+			{
+				continue;
+			}
+
+			stop_glerror();
+
+			const LLVolumeFace& vol_face = volume->getVolumeFace(te);
+			updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face);
+		}
+	}
+}
+
 void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar)
 {
+	updateRiggedVertexBuffers(avatar);
 	renderRigged(avatar, RIGGED_SIMPLE);
 }
 
diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h
index e0326bcfaff..69e30688589 100644
--- a/indra/newview/lldrawpoolavatar.h
+++ b/indra/newview/lldrawpoolavatar.h
@@ -134,6 +134,7 @@ class LLDrawPoolAvatar : public LLFacePool
 									  const LLMeshSkinInfo* skin, 
 									  LLVolume* volume,
 									  const LLVolumeFace& vol_face);
+	void updateRiggedVertexBuffers(LLVOAvatar* avatar);
 
 	void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false);
 	void renderRiggedSimple(LLVOAvatar* avatar);
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index b87ca1eaecd..e2674a8e193 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -660,6 +660,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
 	gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
+	gSavedSettings.getControl("RenderUseVAO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderVBOMappingDisable")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderPreferStreamDraw")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 28391bf423f..8c1bb0f6280 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -379,6 +379,7 @@ void LLPipeline::init()
 	sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
 	sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
 	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO");
+	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseVAO");
 	LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw");
 	sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
 	sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles");
@@ -6061,6 +6062,7 @@ void LLPipeline::resetVertexBuffers()
 	sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
 	sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
 	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO");
+	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseVAO");
 	LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw");
 	LLVertexBuffer::sEnableVBOs = gSavedSettings.getBOOL("RenderVBOEnable");
 	LLVertexBuffer::sDisableVBOMapping = LLVertexBuffer::sEnableVBOs && gSavedSettings.getBOOL("RenderVBOMappingDisable") ;
-- 
GitLab


From 4821a22070c1f68f224ff670096c2bddf25b932a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 23 Sep 2011 18:29:38 -0500
Subject: [PATCH 042/933] SH-2244 Fix for mac build?

---
 indra/llrender/llgl.cpp           | 17 ++++++++++++++---
 indra/llrender/llvertexbuffer.cpp | 12 ++++++++++++
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index f546e073205..4d0dfbf75d3 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -67,6 +67,12 @@ static const std::string HEADLESS_VERSION_STRING("1.0");
 
 std::ofstream gFailLog;
 
+#if GL_ARB_debug_output
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+
 void APIENTRY gl_debug_callback(GLenum source,
                                 GLenum type,
                                 GLuint id,
@@ -82,6 +88,7 @@ void APIENTRY gl_debug_callback(GLenum source,
 	llwarns << "Message: " << message << llendl;
 	llwarns << "-----------------------" << llendl;
 }
+#endif
 
 void ll_init_fail_log(std::string filename)
 {
@@ -127,7 +134,9 @@ std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
 #if (LL_WINDOWS || LL_LINUX || LL_SOLARIS)  && !LL_MESA_HEADLESS
 // ATI prototypes
 
+#if LL_WINDOWS
 PFNGLGETSTRINGIPROC glGetStringi = NULL;
+#endif
 
 // vertex blending prototypes
 PFNGLWEIGHTPOINTERARBPROC			glWeightPointerARB = NULL;
@@ -484,6 +493,7 @@ bool LLGLManager::initGL()
 		LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL;
 	}
 
+#if LL_WINDOWS
 	if (!glGetStringi)
 	{
 		glGetStringi = (PFNGLGETSTRINGIPROC) GLH_EXT_GET_PROC_ADDRESS("glGetStringi");
@@ -501,7 +511,6 @@ bool LLGLManager::initGL()
 			str << (const char*) glGetStringi(GL_EXTENSIONS, i) << " ";
 		}
 		
-#if LL_WINDOWS
 		{
 			PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0;
 			wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
@@ -510,12 +519,12 @@ bool LLGLManager::initGL()
 				str << (const char*) wglGetExtensionsStringARB(wglGetCurrentDC());
 			}
 		}
-#endif
+
 		free(gGLHExts.mSysExts);
 		std::string extensions = str.str();
 		gGLHExts.mSysExts = strdup(extensions.c_str());
-		
 	}
+#endif
 	
 	// Extract video card strings and convert to upper case to
 	// work around driver-to-driver variation in capitalization.
@@ -654,12 +663,14 @@ bool LLGLManager::initGL()
 		glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
 	}
 
+#if LL_WINDOWS
 	if (mHasDebugOutput && gDebugGL)
 	{ //setup debug output callback
 		glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, GL_TRUE);
 		glDebugMessageCallbackARB((GLDEBUGPROCARB) gl_debug_callback, NULL);
 		glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
 	}
+#endif
 
 	//HACK always disable texture multisample, use FXAA instead
 	mHasTextureMultisample = FALSE;
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index b2a0f6822d2..add3decee3a 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -575,7 +575,9 @@ void LLVertexBuffer::unbind()
 {
 	if (sGLRenderArray)
 	{
+#if GL_ARB_vertex_array_object
 		glBindVertexArray(0);
+#endif
 		sGLRenderArray = 0;
 	}
 
@@ -733,7 +735,9 @@ LLVertexBuffer::~LLVertexBuffer()
 
 	if (mGLArray)
 	{
+#if GL_ARB_vertex_array_object
 		glDeleteVertexArrays(1, &mGLArray);
+#endif
 	}
 
 	sCount--;
@@ -1049,7 +1053,9 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 
 		if (gGLManager.mHasVertexArrayObject && useVBOs() && (LLRender::sGLCoreProfile || sUseVAO))
 		{
+#if GL_ARB_vertex_array_object
 			glGenVertexArrays(1, &mGLArray);
+#endif
 			setupVertexArray();
 		}
 	}
@@ -1128,7 +1134,9 @@ void LLVertexBuffer::setupVertexArray()
 		}
 	}
 
+#if GL_ARB_vertex_array_object
 	glBindVertexArray(0);
+#endif
 }
 
 void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
@@ -1864,7 +1872,9 @@ bool LLVertexBuffer::bindGLArray()
 {
 	if (mGLArray && sGLRenderArray != mGLArray)
 	{
+#if GL_ARB_vertex_array_object
 		glBindVertexArray(mGLArray);
+#endif
 		sGLRenderArray = mGLArray;
 		return true;
 	}
@@ -2072,7 +2082,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 	{	
 		if (sGLRenderArray)
 		{
+#if GL_ARB_vertex_array_object
 			glBindVertexArray(0);
+#endif
 			sGLRenderArray = 0;
 		}
 
-- 
GitLab


From 4f2b20a30dff80756a2efdceceb3651cc05f1aee Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 23 Sep 2011 20:47:55 -0500
Subject: [PATCH 043/933] SH-2244 Fix for mac build? (take two)

---
 indra/llrender/llglheaders.h      | 25 +++++++++++++++++++++++++
 indra/llrender/llvertexbuffer.cpp |  9 +--------
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index ede19836518..226e5dd9183 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -914,6 +914,31 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
 #endif /* GL_GLEXT_FUNCTION_POINTERS */
 #endif
 
+#ifndef GL_ARB_texture_rg
+#define GL_RG                             0x8227
+#define GL_RG_INTEGER                     0x8228
+#define GL_R8                             0x8229
+#define GL_R16                            0x822A
+#define GL_RG8                            0x822B
+#define GL_RG16                           0x822C
+#define GL_R16F                           0x822D
+#define GL_R32F                           0x822E
+#define GL_RG16F                          0x822F
+#define GL_RG32F                          0x8230
+#define GL_R8I                            0x8231
+#define GL_R8UI                           0x8232
+#define GL_R16I                           0x8233
+#define GL_R16UI                          0x8234
+#define GL_R32I                           0x8235
+#define GL_R32UI                          0x8236
+#define GL_RG8I                           0x8237
+#define GL_RG8UI                          0x8238
+#define GL_RG16I                          0x8239
+#define GL_RG16UI                         0x823A
+#define GL_RG32I                          0x823B
+#define GL_RG32UI                         0x823C
+#endif
+
 // May be needed for DARWIN...
 // #ifndef GL_ARB_compressed_tex_image
 // #define GL_ARB_compressed_tex_image 1
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index add3decee3a..422f2a06d65 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -255,13 +255,6 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 				MAP_TEXCOORD3
 			};
 
-			U32 type_tc[] = 
-			{
-				TYPE_TEXCOORD1,
-				TYPE_TEXCOORD2,
-				TYPE_TEXCOORD3
-			};
-
 			for (U32 i = 0; i < 3; i++)
 			{
 				if (sLastMask & map_tc[i])
@@ -2221,7 +2214,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 		{
 			S32 loc = TYPE_VERTEX;
 			void* ptr = (void*)(base + mOffsets[TYPE_VERTEX]);
-			glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
+			glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
 		}	
 	}	
 	else
-- 
GitLab


From 2b604adf7bd20bbd78fce38ed44e2eba1ff1cdc8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 23 Sep 2011 23:39:45 -0500
Subject: [PATCH 044/933] SH-2244 Fix for linux build?

---
 indra/llrender/llglheaders.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 226e5dd9183..10aad202e17 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -68,6 +68,12 @@ extern PFNGLUNMAPBUFFERARBPROC		glUnmapBufferARB;
 extern PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB;
 extern PFNGLGETBUFFERPOINTERVARBPROC	glGetBufferPointervARB;
 
+// GL_ARB_vertex_array_object
+extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
+extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
+extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
+extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
+
 // GL_ARB_sync
 extern PFNGLFENCESYNCPROC				glFenceSync;
 extern PFNGLISSYNCPROC					glIsSync;
@@ -310,6 +316,12 @@ extern PFNGLCLIENTACTIVETEXTUREARBPROC	glClientActiveTextureARB;
 extern PFNGLDRAWRANGEELEMENTSPROC 	glDrawRangeElements;
 #endif // LL_LINUX_NV_GL_HEADERS
 
+// GL_ARB_vertex_array_object
+extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
+extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
+extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
+extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
+
 // GL_ARB_vertex_buffer_object
 extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
 extern PFNGLDELETEBUFFERSARBPROC	glDeleteBuffersARB;
-- 
GitLab


From 183fe0d14c48ebeb174567304cea197e7ea443fa Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 24 Sep 2011 03:09:32 -0500
Subject: [PATCH 045/933] SH-2244 Fix for shaders not compiling on pre-GL-3.0
 ATI drivers

---
 indra/llrender/llshadermgr.cpp                                  | 1 +
 .../newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl  | 2 +-
 .../app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl  | 2 +-
 .../shaders/class1/deferred/alphaNonIndexedNoColorF.glsl        | 2 +-
 .../app_settings/shaders/class1/deferred/attachmentShadowF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/avatarShadowF.glsl     | 2 +-
 .../app_settings/shaders/class1/deferred/blurLightF.glsl        | 2 +-
 .../newview/app_settings/shaders/class1/deferred/emissiveF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/fullbrightF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/giF.glsl     | 2 +-
 .../app_settings/shaders/class1/deferred/luminanceF.glsl        | 2 +-
 .../app_settings/shaders/class1/deferred/multiPointLightF.glsl  | 2 +-
 .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl   | 2 +-
 .../app_settings/shaders/class1/deferred/pointLightF.glsl       | 2 +-
 .../app_settings/shaders/class1/deferred/postDeferredF.glsl     | 2 +-
 .../shaders/class1/deferred/postDeferredNoDoFF.glsl             | 2 +-
 .../shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl       | 2 +-
 .../shaders/class1/deferred/postDeferredNoFXAAF.glsl            | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl  | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class1/deferred/spotLightF.glsl        | 2 +-
 .../newview/app_settings/shaders/class1/deferred/sunLightF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/sunLightSSAOF.glsl     | 2 +-
 .../app_settings/shaders/class1/deferred/treeShadowF.glsl       | 2 +-
 .../app_settings/shaders/class1/effects/glowExtractF.glsl       | 2 +-
 .../app_settings/shaders/class1/effects/glowExtractMSF.glsl     | 2 +-
 indra/newview/app_settings/shaders/class1/effects/glowF.glsl    | 2 +-
 .../app_settings/shaders/class1/environment/terrainF.glsl       | 2 +-
 .../app_settings/shaders/class1/environment/terrainWaterF.glsl  | 2 +-
 .../app_settings/shaders/class1/environment/underWaterF.glsl    | 2 +-
 .../newview/app_settings/shaders/class1/environment/waterF.glsl | 2 +-
 .../app_settings/shaders/class1/interface/alphamaskF.glsl       | 2 +-
 .../app_settings/shaders/class1/interface/customalphaF.glsl     | 2 +-
 indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 2 +-
 .../app_settings/shaders/class1/interface/glowcombineF.glsl     | 2 +-
 .../app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 2 +-
 .../app_settings/shaders/class1/interface/highlightF.glsl       | 2 +-
 .../app_settings/shaders/class1/interface/occlusionF.glsl       | 2 +-
 .../shaders/class1/interface/onetexturenocolorF.glsl            | 2 +-
 .../app_settings/shaders/class1/interface/solidcolorF.glsl      | 2 +-
 .../shaders/class1/interface/splattexturerectF.glsl             | 2 +-
 .../app_settings/shaders/class1/interface/twotextureaddF.glsl   | 2 +-
 indra/newview/app_settings/shaders/class1/interface/uiF.glsl    | 2 +-
 indra/newview/app_settings/shaders/class1/lighting/lightF.glsl  | 2 +-
 .../app_settings/shaders/class1/lighting/lightFullbrightF.glsl  | 2 +-
 .../shaders/class1/lighting/lightFullbrightShinyF.glsl          | 2 +-
 .../shaders/class1/lighting/lightFullbrightShinyWaterF.glsl     | 2 +-
 .../shaders/class1/lighting/lightFullbrightWaterF.glsl          | 2 +-
 .../app_settings/shaders/class1/lighting/lightShinyF.glsl       | 2 +-
 .../app_settings/shaders/class1/lighting/lightShinyWaterF.glsl  | 2 +-
 .../app_settings/shaders/class1/lighting/lightWaterF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class1/objects/bumpF.glsl    | 2 +-
 .../newview/app_settings/shaders/class1/objects/impostorF.glsl  | 2 +-
 indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl  | 2 +-
 .../app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl  | 2 +-
 .../shaders/class2/deferred/alphaNonIndexedNoColorF.glsl        | 2 +-
 indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl   | 2 +-
 indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl | 2 +-
 .../app_settings/shaders/class2/deferred/multiSpotLightF.glsl   | 2 +-
 .../app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl | 2 +-
 .../app_settings/shaders/class2/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class2/deferred/softenLightMSF.glsl    | 2 +-
 .../app_settings/shaders/class2/deferred/spotLightF.glsl        | 2 +-
 .../app_settings/shaders/class2/deferred/spotLightMSF.glsl      | 2 +-
 .../newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 2 +-
 .../app_settings/shaders/class2/deferred/sunLightMSF.glsl       | 2 +-
 .../app_settings/shaders/class2/deferred/sunLightSSAOF.glsl     | 2 +-
 .../app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl   | 2 +-
 .../app_settings/shaders/class2/effects/colorFilterF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class2/effects/extractF.glsl | 2 +-
 .../app_settings/shaders/class2/effects/nightVisionF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class2/effects/simpleF.glsl  | 2 +-
 .../app_settings/shaders/class2/environment/terrainF.glsl       | 2 +-
 .../app_settings/shaders/class2/environment/terrainWaterF.glsl  | 2 +-
 .../app_settings/shaders/class2/environment/underWaterF.glsl    | 2 +-
 .../newview/app_settings/shaders/class2/environment/waterF.glsl | 2 +-
 .../app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl   | 2 +-
 .../shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl      | 2 +-
 indra/newview/app_settings/shaders/class2/lighting/lightF.glsl  | 2 +-
 .../shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl      | 2 +-
 .../app_settings/shaders/class2/lighting/lightFullbrightF.glsl  | 2 +-
 .../class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl    | 2 +-
 .../shaders/class2/lighting/lightFullbrightNonIndexedF.glsl     | 2 +-
 .../shaders/class2/lighting/lightFullbrightShinyF.glsl          | 2 +-
 .../class2/lighting/lightFullbrightShinyNonIndexedF.glsl        | 2 +-
 .../shaders/class2/lighting/lightFullbrightShinyWaterF.glsl     | 2 +-
 .../class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl   | 2 +-
 .../shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl | 2 +-
 .../shaders/class2/lighting/lightFullbrightWaterF.glsl          | 2 +-
 .../lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl      | 2 +-
 .../class2/lighting/lightFullbrightWaterNonIndexedF.glsl        | 2 +-
 .../app_settings/shaders/class2/lighting/lightNonIndexedF.glsl  | 2 +-
 .../app_settings/shaders/class2/lighting/lightShinyF.glsl       | 2 +-
 .../shaders/class2/lighting/lightShinyNonIndexedF.glsl          | 2 +-
 .../app_settings/shaders/class2/lighting/lightShinyWaterF.glsl  | 2 +-
 .../shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl     | 2 +-
 .../shaders/class2/lighting/lightWaterAlphaMaskF.glsl           | 2 +-
 .../shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl | 2 +-
 .../app_settings/shaders/class2/lighting/lightWaterF.glsl       | 2 +-
 .../shaders/class2/lighting/lightWaterNonIndexedF.glsl          | 2 +-
 .../newview/app_settings/shaders/class2/windlight/cloudsF.glsl  | 2 +-
 indra/newview/app_settings/shaders/class2/windlight/skyF.glsl   | 2 +-
 .../app_settings/shaders/class3/deferred/giDownsampleF.glsl     | 2 +-
 indra/newview/app_settings/shaders/class3/deferred/giF.glsl     | 2 +-
 .../newview/app_settings/shaders/class3/deferred/giFinalF.glsl  | 2 +-
 .../app_settings/shaders/class3/deferred/luminanceF.glsl        | 2 +-
 .../app_settings/shaders/class3/deferred/postDeferredF.glsl     | 2 +-
 indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl | 2 +-
 .../app_settings/shaders/class3/deferred/softenLightF.glsl      | 2 +-
 112 files changed, 112 insertions(+), 111 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 889b436ac56..17191a2d977 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -561,6 +561,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 			text[count++] = strdup("#version 400\n");
 		}
 
+		text[count++] = strdup("#define DEFINE_GL_FRAGCOLOR 1\n");
 		text[count++] = strdup("#define FXAA_GLSL_130 1\n");
 
 		text[count++] = strdup("#define ATTRIBUTE in\n");
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
index a009d0dd86f..3e4d438ed37 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index c40a62e49cc..4cca2873560 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index 3f6d6a8fd62..86418277775 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index e24734c2dba..c13ea702dba 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index f899ecabe08..402f6816310 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -22,7 +22,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index 4591bb93974..558a88009aa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 1b04be7d9c3..7d3b546d3e6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index fdcce789404..92f78125d84 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 25d5906b77f..84ae2f9f109 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
index 55b816041b4..29ca80ae92d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index f17c64e7514..e014a14ad86 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -25,7 +25,7 @@
  
 uniform sampler2DRect diffuseMap;
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 5f83d06388c..179c721a2fa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 17955f32cdb..d3984276ef7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index b8ed398a811..b673d00d6e2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index c8ee1dac00c..fb574359ac6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index 7f16c323313..066dfba5d92 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
index e3a54625895..c2754347772 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
index 55e07db8794..985f44fb6c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index 0f85a299a5a..84d65d5b3b2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
- #ifndef gl_FragColor
+ #ifdef DEFINE_GL_FRAGCOLOR
  out vec4 gl_FragColor;
  #endif
  
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index a35826ce7d5..71b12326d8b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index 608ac4d3de4..bf75ca262ec 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 0844e659b6b..255796aa274 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 93842e818f4..cc0f4e5b6bf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -26,7 +26,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
index 1114a0f0c44..adc7c5d0058 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
@@ -27,7 +27,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 96f3248e557..fc5959a33c4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 910b8f6c8c1..29ec6e6beef 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index b2d3a135ba8..9a3d7922244 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
index 18b6e503e1a..ec4e2ae4d53 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 8e83e53b788..90bb84323cc 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index 5f12b18398f..f0837dd4cae 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index 0d1d7d6b89c..b84f29423f9 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 4ad1b82e0a1..2e138d35bfa 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 8aa4cb5434a..1512074ddaf 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
index 433ecc9d2aa..4f2767fc970 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
index 765040a27f2..4b481ba834a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
index d89c7b00727..6bcc97ba188 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index 8023545c4ed..f67703b8390 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index 57e9f937686..7136d412ea4 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index ce5409c816e..ecbc30f05ff 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
index 5f91ce5e80e..85f819f4c29 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
index 95b7632521c..fafeb5a7b49 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index 7ba2d07ca4c..f7901227494 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
index b085eb17608..a0bb255cfaa 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
index 9cbdfea2df3..cdb48163dd4 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 0c5479af364..36d6e06fc5f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 7f23c5e78c5..8274a655db6 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index b67203065f1..ec7ec9ae7d5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index d9b7ba0db10..d47d1724a74 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index 0ace495d5ac..bd67e2659eb 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -22,7 +22,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif 
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index fac476e2ce8..0cf5152661e 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index b1ab065712a..761bda487d7 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index 05c9310a37f..6761d353160 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index 27d05baaa71..2908d774432 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
  
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index 664967d36fd..4b85d61aca8 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index 8a4932122fa..e7c81888eb7 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index ab4ed093c80..8d88e93698f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index a9ee534bdfe..0df557f2aad 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 98dd9d4a1ea..331dbc70793 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
index 96e71b46d7d..f75a08779c4 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
index 540c71c5e34..b9c65b168cd 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 7ef26088416..14a683971a4 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
index c2d374d22c3..4037dca91a4 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index c09e3bb6e6e..4543e83d0a8 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index 6d746ebbba7..62a86a3f091 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 93b385cbf55..31bd0c79dab 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
index 1e3257d4a24..af3487fd91f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index efb19848746..7e62012b5da 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -25,7 +25,7 @@
 
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
index 96b6140c0a3..11b3faa4c9e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
@@ -26,7 +26,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 1886178731d..025ff481091 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -24,7 +24,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
index 4a2ba0afc5c..c571db9df28 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
@@ -25,7 +25,7 @@
 #extension GL_ARB_texture_rectangle : enable
 #extension GL_ARB_texture_multisample : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
index 439855910e4..f42497d8bee 100644
--- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
index 786c00f946d..ebf4f28a744 100644
--- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
index 4074540591a..2bfcfad0813 100644
--- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
index 7e8be3c19c8..932bd871526 100644
--- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
index eed8b3cc017..18f6d91804d 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
index c48333aa87e..e5c7ced52c0 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
index 90a7aab62e3..1fdb90f7926 100644
--- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
index 33ffeaefb0f..444c896d388 100644
--- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
index 7325e0fe4ef..6815f7aa85a 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
index 9a9f8fbf75c..2640668d7dc 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
index c2847bbce8a..735f5b38137 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
index 29dbcb2d8c0..92113d9afa6 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
index 5dd8822a686..c3edc0bd708 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
index ccd8fddb997..d1ad3da0096 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
index 14d44de3d52..4e1e664e6b5 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
index 6cb6453f587..c981e9eba25 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
index 8940e1683b2..a4893f03599 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
index 560702c8ce0..c10cde98e0d 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
@@ -22,7 +22,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
index b8b6a22a43c..e9b26087f46 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
@@ -22,7 +22,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
index 748e30b8fb1..32a1c71099b 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
index 5a47f85833e..2547f9e7505 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
index 8430091bf5d..1b5aa614413 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
index fe9f330215e..aa3ef8cdd91 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
index fc880109783..9f1a358b538 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
  
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
index 9f416090aa8..e9c27dbefd5 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
index abc41fc09a8..595ad743650 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
  
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
index 99df846e685..68c727d62c4 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
index d67aeb6655e..f32b9e1958b 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
index ad219d0d2ae..60289cf7f77 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
index 3ec16b16812..d0038ae89bc 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
index 4dddc95afd7..e9537d1e9d5 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif 
 
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
index f89b2dcea20..8b0c25b7053 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index d06e80ec35c..4ab06c6e21f 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
index be9fefcb33a..c9d96b2cf46 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
index af8c05dbebf..832cf461507 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
@@ -24,7 +24,7 @@
  */
  
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
index 39975f82495..ee992f2fe92 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor;
+#ifdef DEFINE_GL_FRAGCOLOR;
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
index 5fbbc0a0cce..3ace57e3cb8 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
index 53bbcc0300e..3057b63ecdc 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
index 6d179426837..c7ccf3a6130 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
@@ -25,7 +25,7 @@
   
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
index 44b36d33070..499a72222d6 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 338d289ab0d..7089c53f1c3 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragColor
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
-- 
GitLab


From 552a02dcbaf5868b5d2164e3bf2a8732f9bce0dd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 24 Sep 2011 13:52:00 -0500
Subject: [PATCH 046/933] SH-2244 Fix for shaders not building on GL < 2.1

---
 indra/llrender/llshadermgr.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 889b436ac56..55c10b43410 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -539,6 +539,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	if (gGLManager.mGLVersion < 2.1f)
 	{
 		text[count++] = strdup("#version 110\n");
+		text[count++] = strdup("#define ATTRIBUTE attribute\n");
+		text[count++] = strdup("#define VARYING varying\n");
 	}
 	else if (gGLManager.mGLVersion < 3.f)
 	{
-- 
GitLab


From 102f600d3ae5427be0e338ae291d2f803436cd32 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 24 Sep 2011 22:56:33 -0500
Subject: [PATCH 047/933] SH-2244 Fix for bump surfaces appearing black when
 L&S disabled

---
 indra/llrender/llrender.cpp         | 1 +
 indra/newview/llviewershadermgr.cpp | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 685334555a4..13e7c6094ca 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1039,6 +1039,7 @@ LLRender::LLRender()
 		mMatIdx[i] = 0;
 		mMatHash[i] = 0;
 		mCurMatHash[i] = 0xFFFFFFFF;
+		mMatrix[i][0].make_identity();
 	}
 
 	mLightHash = 0;
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index b0d97ee5f63..17cce3069e7 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2122,6 +2122,14 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gObjectBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
 		success = gObjectBumpProgram.createShader(NULL, NULL);
+
+		if (success)
+		{ //lldrawpoolbump assumes "texture0" has channel 0 and "texture1" has channel 1
+			gObjectBumpProgram.bind();
+			gObjectBumpProgram.uniform1i("texture0", 0);
+			gObjectBumpProgram.uniform1i("texture1", 1);
+			gObjectBumpProgram.unbind();
+		}
 	}
 	
 	
-- 
GitLab


From f49e7014ca9693d77ff265d3fc668a8b05ddf085 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 24 Sep 2011 23:29:38 -0500
Subject: [PATCH 048/933] SH-2244 Fix for crash when transparent water disabled
 (silently ignore setting when basic shaders enabled)

---
 indra/llui/llui.cpp               | 6 +++---
 indra/newview/lldrawpoolwater.cpp | 7 ++++++-
 indra/newview/llvowater.cpp       | 2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 212672b809e..36f87fc597f 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -534,7 +534,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
 		}
 	}
 
-	gGL.getTexUnit(0)->bind(image);
+	gGL.getTexUnit(0)->bind(image, true);
 
 	gGL.color4fv(color.mV);
 	
@@ -732,7 +732,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
 	LLGLSUIDefault gls_ui;
 
 
-	gGL.getTexUnit(0)->bind(image);
+	gGL.getTexUnit(0)->bind(image, true);
 
 	gGL.color4fv(color.mV);
 
@@ -785,7 +785,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
 
 		LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD);
 		
-		gGL.getTexUnit(0)->bind(image);
+		gGL.getTexUnit(0)->bind(image, true);
 
 		gGL.color4fv(color.mV);
 		
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index c97f92fa6f5..5de0b8c7960 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -167,7 +167,7 @@ void LLDrawPoolWater::render(S32 pass)
 	std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater());
 
 	// See if we are rendering water as opaque or not
-	if (!gSavedSettings.getBOOL("RenderTransparentWater"))
+	if (!gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction)
 	{
 		// render water for low end hardware
 		renderOpaqueLegacyWater();
@@ -332,6 +332,11 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
 {
 	LLVOSky *voskyp = gSky.mVOSkyp;
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gObjectSimpleProgram.bind();
+	}
+
 	stop_glerror();
 
 	// Depth sorting and write to depth buffer
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 75198c465be..7df50ec8150 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -160,7 +160,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
 	static const unsigned int vertices_per_quad = 4;
 	static const unsigned int indices_per_quad = 6;
 
-	const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") ? 16 : 1;
+	const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction ? 16 : 1;
 
 	const S32 num_quads = size * size;
 	face->setSize(vertices_per_quad * num_quads,
-- 
GitLab


From f6744182511d68ccc135174b1999d3e4ae260881 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sun, 25 Sep 2011 00:20:12 -0500
Subject: [PATCH 049/933] SH-2244 Fix for UI blanking out on shader reload
 (stale matrix hash cleanup)

---
 indra/llrender/llglslshader.cpp | 13 ++++++++-----
 indra/llrender/llrender.cpp     |  3 +--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index da4658dc037..674d6dcf7e8 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -76,11 +76,7 @@ hasAlphaMask(false)
 LLGLSLShader::LLGLSLShader()
 	: mProgramObject(0), mActiveTextureChannels(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE)
 {
-	for (U32 i = 0; i < LLRender::NUM_MATRIX_MODES; ++i)
-	{
-		mMatHash[i] = 0xFFFFFFFF;
-	}
-	mLightHash = 0xFFFFFFFF;
+
 }
 
 void LLGLSLShader::unload()
@@ -116,6 +112,13 @@ void LLGLSLShader::unload()
 BOOL LLGLSLShader::createShader(vector<string> * attributes,
 								vector<string> * uniforms)
 {
+	//reloading, reset matrix hash values
+	for (U32 i = 0; i < LLRender::NUM_MATRIX_MODES; ++i)
+	{
+		mMatHash[i] = 0xFFFFFFFF;
+	}
+	mLightHash = 0xFFFFFFFF;
+
 	llassert_always(!mShaderFiles.empty());
 	BOOL success = TRUE;
 
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 13e7c6094ca..613d1599012 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1039,7 +1039,6 @@ LLRender::LLRender()
 		mMatIdx[i] = 0;
 		mMatHash[i] = 0;
 		mCurMatHash[i] = 0xFFFFFFFF;
-		mMatrix[i][0].make_identity();
 	}
 
 	mLightHash = 0;
@@ -1228,7 +1227,7 @@ void LLRender::syncMatrices()
 			syncLightState();
 		}
 	}
-	else
+	else if (!LLGLSLShader::sNoFixedFunction)
 	{
 		for (U32 i = 0; i < 2; ++i)
 		{
-- 
GitLab


From 56191701bcbc0ef1b6872cc6bfac1d18f636fd12 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sun, 25 Sep 2011 02:43:43 -0500
Subject: [PATCH 050/933] SH-2244 Fix for crash when enabling core profile on
 AMD GPUs

---
 indra/llrender/llgl.cpp           | 55 ++++++++++++++++++++++---------
 indra/llrender/llrender.cpp       |  3 +-
 indra/llrender/llvertexbuffer.cpp |  4 ++-
 3 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 4d0dfbf75d3..59c63d84656 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -493,6 +493,8 @@ bool LLGLManager::initGL()
 		LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL;
 	}
 
+	stop_glerror();
+
 #if LL_WINDOWS
 	if (!glGetStringi)
 	{
@@ -508,7 +510,9 @@ bool LLGLManager::initGL()
 		glGetIntegerv(GL_NUM_EXTENSIONS, &count);
 		for (GLint i = 0; i < count; ++i)
 		{
-			str << (const char*) glGetStringi(GL_EXTENSIONS, i) << " ";
+			std::string ext((const char*) glGetStringi(GL_EXTENSIONS, i));
+			str << ext << " ";
+			LL_DEBUGS("GLExtensions") << ext << llendl;
 		}
 		
 		{
@@ -526,6 +530,8 @@ bool LLGLManager::initGL()
 	}
 #endif
 	
+	stop_glerror();
+
 	// Extract video card strings and convert to upper case to
 	// work around driver-to-driver variation in capitalization.
 	mGLVendor = std::string((const char *)glGetString(GL_VENDOR));
@@ -612,8 +618,10 @@ bool LLGLManager::initGL()
 		mGLVendorShort = "MISC";
 	}
 	
+	stop_glerror();
 	// This is called here because it depends on the setting of mIsGF2or4MX, and sets up mHasMultitexture.
 	initExtensions();
+	stop_glerror();
 
 	if (mHasATIMemInfo)
 	{ //ask the gl how much vram is free at startup and attempt to use no more than half of that
@@ -629,7 +637,22 @@ bool LLGLManager::initGL()
 		mVRAM = dedicated_memory/1024;
 	}
 
-	if (mHasMultitexture)
+	stop_glerror();
+
+	stop_glerror();
+
+	if (mHasFragmentShader)
+	{
+		GLint num_tex_image_units;
+		glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &num_tex_image_units);
+		mNumTextureImageUnits = llmin(num_tex_image_units, 32);
+	}
+
+	if (LLRender::sGLCoreProfile)
+	{
+		mNumTextureUnits = mNumTextureImageUnits;
+	}
+	else if (mHasMultitexture)
 	{
 		GLint num_tex_units;		
 		glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &num_tex_units);
@@ -648,12 +671,7 @@ bool LLGLManager::initGL()
 		return false;
 	}
 	
-	if (mHasFragmentShader)
-	{
-		GLint num_tex_image_units;
-		glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &num_tex_image_units);
-		mNumTextureImageUnits = llmin(num_tex_image_units, 32);
-	}
+	stop_glerror();
 
 	if (mHasTextureMultisample)
 	{
@@ -663,6 +681,8 @@ bool LLGLManager::initGL()
 		glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
 	}
 
+	stop_glerror();
+
 #if LL_WINDOWS
 	if (mHasDebugOutput && gDebugGL)
 	{ //setup debug output callback
@@ -672,6 +692,8 @@ bool LLGLManager::initGL()
 	}
 #endif
 
+	stop_glerror();
+
 	//HACK always disable texture multisample, use FXAA instead
 	mHasTextureMultisample = FALSE;
 #if LL_WINDOWS
@@ -685,10 +707,17 @@ bool LLGLManager::initGL()
 	{
 		glGetIntegerv(GL_MAX_SAMPLES, &mMaxSamples);
 	}
+
+	stop_glerror();
 	
 	setToDebugGPU();
 
+	stop_glerror();
+
 	initGLStates();
+
+	stop_glerror();
+
 	return true;
 }
 
@@ -903,10 +932,10 @@ void LLGLManager::initExtensions()
 #if !LL_DARWIN
 	mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts);
 #endif
-	mHasShaderObjects = ExtensionExists("GL_ARB_shader_objects", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts);
+	mHasShaderObjects = ExtensionExists("GL_ARB_shader_objects", gGLHExts.mSysExts) && (LLRender::sGLCoreProfile || ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts));
 	mHasVertexShader = ExtensionExists("GL_ARB_vertex_program", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_vertex_shader", gGLHExts.mSysExts)
-						&& ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts);
-	mHasFragmentShader = ExtensionExists("GL_ARB_fragment_shader", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts);
+		&& (LLRender::sGLCoreProfile || ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts));
+	mHasFragmentShader = ExtensionExists("GL_ARB_fragment_shader", gGLHExts.mSysExts) && (LLRender::sGLCoreProfile || ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts));
 #endif
 
 #if LL_LINUX || LL_SOLARIS
@@ -1338,10 +1367,6 @@ void log_glerror()
 
 void do_assert_glerror()
 {
-	if (LL_UNLIKELY(!gGLManager.mInited))
-	{
-		LL_ERRS("RenderInit") << "GL not initialized" << LL_ENDL;
-	}
 	//  Create or update texture to be used with this data 
 	GLenum error;
 	error = glGetError();
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 613d1599012..8ba164fcc9e 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1052,12 +1052,13 @@ LLRender::~LLRender()
 void LLRender::init()
 {
 	llassert_always(mBuffer.isNull()) ;
-
+	stop_glerror();
 	mBuffer = new LLVertexBuffer(immediate_mask, 0);
 	mBuffer->allocateBuffer(4096, 0, TRUE);
 	mBuffer->getVertexStrider(mVerticesp);
 	mBuffer->getTexCoord0Strider(mTexcoordsp);
 	mBuffer->getColorStrider(mColorsp);
+	stop_glerror();
 }
 
 void LLRender::shutdown()
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 422f2a06d65..1b7b0cdf3e5 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1024,7 +1024,9 @@ void LLVertexBuffer::updateNumIndices(S32 nindices)
 void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER);
-		
+	
+	stop_glerror();
+
 	if (nverts < 0 || nindices < 0 ||
 		nverts > 65536)
 	{
-- 
GitLab


From f3f841bddfb8d54929b911e930aa8babebddd487 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 26 Sep 2011 14:41:21 -0400
Subject: [PATCH 051/933] SH-2425 FIX - customized upload permissions info for
 damballah/staging

---
 indra/newview/llfloatermodelpreview.cpp | 5 +++++
 1 file changed, 5 insertions(+)
 mode change 100644 => 100755 indra/newview/llfloatermodelpreview.cpp

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
old mode 100644
new mode 100755
index e4046b06aa9..77e9b4eeb81
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -496,6 +496,11 @@ BOOL LLFloaterModelPreview::postBuild()
 	{
 		validate_url = "http://secondlife.com/my/account/mesh.php";
 	}
+	else if (current_grid == "damballah")
+	{
+		// Staging grid has its own naming scheme.
+		validate_url = "http://secondlife-staging.com/my/account/mesh.php";
+	}
 	else
 	{
 		validate_url = llformat("http://secondlife.%s.lindenlab.com/my/account/mesh.php",current_grid.c_str());
-- 
GitLab


From bc1dbcb3a041cff43c5e5d38d24aee4f095834c0 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 26 Sep 2011 17:57:00 -0400
Subject: [PATCH 052/933] SH-2501 FIX - spelling fix

---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 2eea286c8bf..6c60b3e0e9b 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -789,7 +789,7 @@
                     <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/> -->
                 </panel>
             
-            <!-- ==== STEP 2: Analyse ==== -->
+            <!-- ==== STEP 2: Analyze ==== -->
             <view_border
               bevel_style="none"
               follows="top|left"
@@ -818,7 +818,7 @@
                       name="method_label"
                       text_color="White"
                       top_pad="0">
-                      Step 2: Analyse
+                      Step 2: Analyze
                     </text>
                     <text
                       follows="top|left"
-- 
GitLab


From 058b79fadd8b134b6f718be2efb395d6d61e0aeb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 26 Sep 2011 17:19:08 -0500
Subject: [PATCH 053/933] SH-2244 Fix for menu backgrounds being invisible on
 login screen when shaders enabled.

---
 indra/newview/llviewerdisplay.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 4f3127805f8..e47ac8680ae 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -124,7 +124,8 @@ void display_startup()
 
 	// Update images?
 	//gImageList.updateImages(0.01f);
-	
+	LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName();
+
 	LLGLSDefault gls_default;
 
 	// Required for HTML update in login screen
-- 
GitLab


From c7a16ef091409f55427f7cf0e9057130b47d2574 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 26 Sep 2011 17:54:38 -0500
Subject: [PATCH 054/933] SH-2244 Fix for crash in LLVertexBuffer::mapBuffer
 (don't use glMapBuffer by default)

---
 indra/newview/app_settings/settings.xml | 2 +-
 indra/newview/featuretable_mac.txt      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5201349b174..7d61250fae1 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9225,7 +9225,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
   <key>RenderUseStreamVBO</key>
   <map>
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 2690e8ec708..36ffa54184e 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -48,9 +48,9 @@ RenderTransparentWater			1	1
 RenderTreeLODFactor				1	1.0
 RenderUseImpostors				1	1
 RenderVBOEnable					1	0
-RenderVBOMappingDisable		1	0
+RenderVBOMappingDisable			1	1
 RenderVolumeLODFactor			1	2.0
-UseStartScreen				1	1
+UseStartScreen					1	1
 UseOcclusion					1	1
 VertexShaderEnable				1	1
 WindLightUseAtmosShaders		1	1
-- 
GitLab


From 54ba56dbe995a3d215f85932c83948145a871ac4 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 26 Sep 2011 18:31:55 -0500
Subject: [PATCH 055/933] SH-2244 changes to run in a core context on AMD
 hardware without generating deprecation or performance warnings

---
 indra/llrender/llgl.cpp                       |  2 +-
 indra/llrender/llimagegl.cpp                  | 12 +++++-
 indra/llrender/llvertexbuffer.cpp             | 17 ++++----
 indra/llrender/llvertexbuffer.h               |  2 +-
 .../shaders/class1/environment/waterFogF.glsl |  7 +++-
 indra/newview/lldrawpoolsky.cpp               |  9 ++--
 indra/newview/lldrawpoolwater.cpp             |  2 +
 indra/newview/lldrawpoolwater.h               |  1 +
 indra/newview/llface.cpp                      |  6 +--
 indra/newview/llviewerdisplay.cpp             |  5 +++
 indra/newview/llvosky.cpp                     | 41 +++++++++++++------
 indra/newview/llwaterparammanager.cpp         |  1 +
 12 files changed, 71 insertions(+), 34 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 59c63d84656..189a460001d 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -650,7 +650,7 @@ bool LLGLManager::initGL()
 
 	if (LLRender::sGLCoreProfile)
 	{
-		mNumTextureUnits = mNumTextureImageUnits;
+		mNumTextureUnits = llmin(mNumTextureImageUnits, MAX_GL_TEXTURE_UNITS);
 	}
 	else if (mHasMultitexture)
 	{
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 12089e5ad3d..cbdb8f83f68 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -725,9 +725,12 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 		}
 		else if (!is_compressed)
 		{
-			if (mAutoGenMips && !LLRender::sGLCoreProfile) //auto-generating mipmaps is deprecated in GL 3.0
+			if (mAutoGenMips)
 			{
-				glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
+				if (!glGenerateMipmap)
+				{
+					glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
+				}
 				stop_glerror();
 				{
 // 					LLFastTimer t2(FTM_TEMP4);
@@ -756,6 +759,11 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 						stop_glerror();
 					}
 				}
+
+				if (glGenerateMipmap)
+				{
+					glGenerateMipmap(LLTexUnit::getInternalType(mBindTarget));
+				}
 			}
 			else
 			{
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 1b7b0cdf3e5..199699449ad 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -34,6 +34,7 @@
 #include "llmemtype.h"
 #include "llrender.h"
 #include "llvector4a.h"
+#include "llshadermgr.h"
 #include "llglslshader.h"
 #include "llmemory.h"
 
@@ -121,6 +122,7 @@ class LLGLSyncFence : public LLGLFence
 
 };
 
+//NOTE: each component must be AT LEAST 4 bytes in size to avoid a performance penalty on AMD hardware
 S32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] =
 {
 	sizeof(LLVector4), // TYPE_VERTEX,
@@ -130,7 +132,7 @@ S32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] =
 	sizeof(LLVector2), // TYPE_TEXCOORD2,
 	sizeof(LLVector2), // TYPE_TEXCOORD3,
 	sizeof(LLColor4U), // TYPE_COLOR,
-	sizeof(U8),		   // TYPE_EMISSIVE
+	sizeof(LLColor4U), // TYPE_EMISSIVE, only alpha is used currently
 	sizeof(LLVector4), // TYPE_BINORMAL,
 	sizeof(F32),	   // TYPE_WEIGHT,
 	sizeof(LLVector4), // TYPE_WEIGHT4,
@@ -1071,7 +1073,7 @@ void LLVertexBuffer::setupVertexArray()
 		2, //TYPE_TEXCOORD2,
 		2, //TYPE_TEXCOORD3,
 		4, //TYPE_COLOR,
-		1, //TYPE_EMISSIVE,
+		4, //TYPE_EMISSIVE,
 		3, //TYPE_BINORMAL,
 		1, //TYPE_WEIGHT,
 		4, //TYPE_WEIGHT4,
@@ -1842,9 +1844,9 @@ bool LLVertexBuffer::getColorStrider(LLStrider<LLColor4U>& strider, S32 index, S
 {
 	return VertexBufferStrider<LLColor4U,TYPE_COLOR>::get(*this, strider, index, count, map_range);
 }
-bool LLVertexBuffer::getEmissiveStrider(LLStrider<U8>& strider, S32 index, S32 count, bool map_range)
+bool LLVertexBuffer::getEmissiveStrider(LLStrider<LLColor4U>& strider, S32 index, S32 count, bool map_range)
 {
-	return VertexBufferStrider<U8,TYPE_EMISSIVE>::get(*this, strider, index, count, map_range);
+	return VertexBufferStrider<LLColor4U,TYPE_EMISSIVE>::get(*this, strider, index, count, map_range);
 }
 bool LLVertexBuffer::getWeightStrider(LLStrider<F32>& strider, S32 index, S32 count, bool map_range)
 {
@@ -1994,18 +1996,17 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 		if (shader)
 		{
 			U32 required_mask = 0;
-			for (U32 i = 0; i < LLVertexBuffer::TYPE_MAX; ++i)
+			for (U32 i = 0; i < LLVertexBuffer::TYPE_TEXTURE_INDEX; ++i)
 			{
 				if (shader->getAttribLocation(i) > -1)
 				{
 					U32 required = 1 << i;
 					if ((data_mask & required) == 0)
 					{
-						llwarns << "Missing attribute: " << i << llendl;
+						llwarns << "Missing attribute: " << LLShaderMgr::instance()->mReservedAttribs[i] << llendl;
 					}
 
 					required_mask |= required;
-
 				}
 			}
 
@@ -2186,7 +2187,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 		{
 			S32 loc = TYPE_EMISSIVE;
 			void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]);
-			glVertexAttribPointerARB(loc, 1, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
+			glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
 		}
 		if (data_mask & MAP_WEIGHT)
 		{
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index d116a552faf..98cab8b1628 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -228,7 +228,7 @@ class LLVertexBuffer : public LLRefCount
 	bool getNormalStrider(LLStrider<LLVector3>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getBinormalStrider(LLStrider<LLVector3>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getColorStrider(LLStrider<LLColor4U>& strider, S32 index=0, S32 count = -1, bool map_range = false);
-	bool getEmissiveStrider(LLStrider<U8>& strider, S32 index=0, S32 count = -1, bool map_range = false);
+	bool getEmissiveStrider(LLStrider<LLColor4U>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getWeightStrider(LLStrider<F32>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getWeight4Strider(LLStrider<LLVector4>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index=0, S32 count = -1, bool map_range = false);
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index e4db326bede..57b3a6d001a 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -26,6 +26,9 @@
 
 VARYING float fog_depth;
 
+uniform vec4 waterFogColor;
+uniform float waterFogEnd;
+
 vec4 applyWaterFog(vec4 color)
 {
 	// GL_EXP2 Fog
@@ -33,9 +36,9 @@ vec4 applyWaterFog(vec4 color)
 	// GL_EXP Fog
 	// float fog = exp(-gl_Fog.density * fog_depth);
 	// GL_LINEAR Fog
-	float fog = (gl_Fog.end - fog_depth) * gl_Fog.scale;
+	float fog = (waterFogEnd - fog_depth) * gl_Fog.scale;
 	fog = clamp(fog, 0.0, 1.0);
-	color.rgb = mix(gl_Fog.color.rgb, color.rgb, fog);
+	color.rgb = mix(waterFogColor.rgb, color.rgb, fog);
 	return color;
 }
 
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp
index 8a3871b6b42..7f7d9f65c60 100644
--- a/indra/newview/lldrawpoolsky.cpp
+++ b/indra/newview/lldrawpoolsky.cpp
@@ -76,13 +76,14 @@ void LLDrawPoolSky::render(S32 pass)
 		return;
 	}
 	
-	// use a shader only underwater
+	// don't render sky under water (background just gets cleared to fog color)
 	if(mVertexShaderLevel > 0 && LLPipeline::sUnderWaterRender)
 	{
-		mShader = &gObjectFullbrightWaterProgram;
-		mShader->bind();
+		return;
 	}
-	else if (LLGLSLShader::sNoFixedFunction)
+
+
+	if (LLGLSLShader::sNoFixedFunction)
 	{ //just use the UI shader (generic single texture no lighting)
 		gOneTextureNoColorProgram.bind();
 	}
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 5de0b8c7960..f6fe96877d2 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -59,6 +59,8 @@ BOOL LLDrawPoolWater::sSkipScreenCopy = FALSE;
 BOOL LLDrawPoolWater::sNeedsReflectionUpdate = TRUE;
 BOOL LLDrawPoolWater::sNeedsDistortionUpdate = TRUE;
 LLColor4 LLDrawPoolWater::sWaterFogColor = LLColor4(0.2f, 0.5f, 0.5f, 0.f);
+F32 LLDrawPoolWater::sWaterFogEnd = 0.f;
+
 LLVector3 LLDrawPoolWater::sLightDir;
 
 LLDrawPoolWater::LLDrawPoolWater() :
diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h
index 99b541ca5a3..aeeba179d6c 100644
--- a/indra/newview/lldrawpoolwater.h
+++ b/indra/newview/lldrawpoolwater.h
@@ -49,6 +49,7 @@ class LLDrawPoolWater: public LLFacePool
 	static LLVector3 sLightDir;
 
 	static LLColor4 sWaterFogColor;
+	static F32 sWaterFogEnd;
 
 	enum
 	{
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index d36379b0e75..36b88ebbd47 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1764,7 +1764,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	if (rebuild_emissive)
 	{
 		LLFastTimer t(FTM_FACE_GEOM_EMISSIVE);
-		LLStrider<U8> emissive;
+		LLStrider<LLColor4U> emissive;
 		mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount, map_range);
 
 		U8 glow = (U8) llclamp((S32) (getTextureEntry()->getGlow()*255), 0, 255);
@@ -1783,8 +1783,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		src.loadua((F32*) vec);
 
 		LLVector4a* dst = (LLVector4a*) emissive.get();
-		S32 num_vecs = num_vertices/16;
-		if (num_vertices%16 > 0)
+		S32 num_vecs = num_vertices/4;
+		if (num_vertices%4 > 0)
 		{
 			++num_vecs;
 		}
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 4f3127805f8..efe93b7f48a 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -865,6 +865,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			else
 			{
 				gPipeline.mScreen.bindTarget();
+				if (LLPipeline::sUnderWaterRender && !gPipeline.canUseWindLightShaders())
+				{
+					const LLColor4 &col = LLDrawPoolWater::sWaterFogColor;
+					glClearColor(col.mV[0], col.mV[1], col.mV[2], 0.f);
+				}
 				gPipeline.mScreen.clear();
 			}
 			
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index d90c3be6c78..e9db37821b1 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -2040,9 +2040,12 @@ void LLVOSky::updateFog(const F32 distance)
 {
 	if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG))
 	{
-		glFogf(GL_FOG_DENSITY, 0);
-		glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV);
-		glFogf(GL_FOG_END, 1000000.f);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glFogf(GL_FOG_DENSITY, 0);
+			glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV);
+			glFogf(GL_FOG_END, 1000000.f);
+		}
 		return;
 	}
 
@@ -2112,7 +2115,10 @@ void LLVOSky::updateFog(const F32 distance)
 	if (camera_height > water_height)
 	{
 		LLColor4 fog(render_fog_color);
-		glFogfv(GL_FOG_COLOR, fog.mV);
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glFogfv(GL_FOG_COLOR, fog.mV);
+		}
 		mGLFogCol = fog;
 
 		if (hide_clip_plane)
@@ -2120,13 +2126,19 @@ void LLVOSky::updateFog(const F32 distance)
 			// For now, set the density to extend to the cull distance.
 			const F32 f_log = 2.14596602628934723963618357029f; // sqrt(fabs(log(0.01f)))
 			fog_density = f_log/fog_distance;
-			glFogi(GL_FOG_MODE, GL_EXP2);
+			if (!LLGLSLShader::sNoFixedFunction)
+			{
+				glFogi(GL_FOG_MODE, GL_EXP2);
+			}
 		}
 		else
 		{
 			const F32 f_log = 4.6051701859880913680359829093687f; // fabs(log(0.01f))
 			fog_density = (f_log)/fog_distance;
-			glFogi(GL_FOG_MODE, GL_EXP);
+			if (!LLGLSLShader::sNoFixedFunction)
+			{
+				glFogi(GL_FOG_MODE, GL_EXP);
+			}
 		}
 	}
 	else
@@ -2146,24 +2158,27 @@ void LLVOSky::updateFog(const F32 distance)
 		fogCol.setAlpha(1);
 
 		// set the gl fog color
-		glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV);
 		mGLFogCol = fogCol;
 
 		// set the density based on what the shaders use
 		fog_density = water_fog_density * gSavedSettings.getF32("WaterGLFogDensityScale");
-		glFogi(GL_FOG_MODE, GL_EXP2);
+
+		if (!LLGLSLShader::sNoFixedFunction)
+		{
+			glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV);
+			glFogi(GL_FOG_MODE, GL_EXP2);
+		}
 	}
 
 	mFogColor = sky_fog_color;
 	mFogColor.setAlpha(1);
-	LLGLSFog gls_fog;
-
-	glFogf(GL_FOG_END, fog_distance*2.2f);
-
-	glFogf(GL_FOG_DENSITY, fog_density);
+	LLDrawPoolWater::sWaterFogEnd = fog_distance*2.2f;
 
 	if (!LLGLSLShader::sNoFixedFunction)
 	{
+		LLGLSFog gls_fog;
+		glFogf(GL_FOG_END, fog_distance*2.2f);
+		glFogf(GL_FOG_DENSITY, fog_density);
 		glHint(GL_FOG_HINT, GL_NICEST);
 	}
 	stop_glerror();
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 1a98d4c6c25..20b34637b8c 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -190,6 +190,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
 		shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV);
 		shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV);
 		shader->uniform4fv("waterFogColor", 1, LLDrawPoolWater::sWaterFogColor.mV);
+		shader->uniform1f("waterFogEnd", LLDrawPoolWater::sWaterFogEnd);
 		shader->uniform4fv("waterPlane", 1, mWaterPlane.mV);
 		shader->uniform1f("waterFogDensity", getFogDensity());
 		shader->uniform1f("waterFogKS", mWaterFogKS);
-- 
GitLab


From 328cf0d1c71efa785b0f1201c27776a3a6d6a041 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 26 Sep 2011 20:00:38 -0500
Subject: [PATCH 056/933] Merge cleanup

---
 indra/newview/lldrawpoolavatar.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 6acc1958895..d9b0b195f5a 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1277,9 +1277,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 	
 	S32 num_verts = (vol_face.mNumVertices + 0xF) & ~0xF;
 	if (buffer.isNull() || 
-
 		buffer->getTypeMask() != data_mask ||
-		buffer->getRequestedVerts() != num_verts)
+		buffer->getRequestedVerts() != num_verts ||
 		buffer->getRequestedIndices() != vol_face.mNumIndices ||
 		(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
 	{
-- 
GitLab


From d0b5a521f21ab8002fb5d9a4d11cee6c2385dbf3 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 27 Sep 2011 14:26:53 -0500
Subject: [PATCH 057/933] SH-2244 Make emissive attribute match actual number
 of components coming in

---
 .../app_settings/shaders/class1/deferred/emissiveV.glsl       | 4 ++--
 .../app_settings/shaders/class1/objects/emissiveSkinnedV.glsl | 4 ++--
 .../app_settings/shaders/class1/objects/emissiveV.glsl        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index 50e92c191b4..7b108e4562e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -29,7 +29,7 @@ uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
 ATTRIBUTE float texture_index;
-ATTRIBUTE float emissive;
+ATTRIBUTE vec4 emissive;
 ATTRIBUTE vec2 texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
@@ -57,7 +57,7 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 	
-	vertex_color = vec4(0,0,0,emissive);
+	vertex_color = emissive;
 
 	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
index bf4c45f18f8..8c38d5df2a7 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -28,7 +28,7 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float emissive;
+ATTRIBUTE vec4 emissive;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
@@ -50,7 +50,7 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	vertex_color = vec4(0,0,0,emissive);
+	vertex_color = emissive;
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
index 77b0806bfcd..35feacb7b12 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -29,7 +29,7 @@ uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
 ATTRIBUTE float texture_index;
-ATTRIBUTE float emissive;
+ATTRIBUTE vec4 emissive;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
@@ -50,7 +50,7 @@ void main()
 	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
-	vertex_color = vec4(0,0,0,emissive);
+	vertex_color = emissive;
 
 	fog_depth = pos.z;
 }
-- 
GitLab


From 8a5c983640ac23f6a588d78c433d2a36ddf4fa70 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 27 Sep 2011 14:55:00 -0500
Subject: [PATCH 058/933] SH-2505 Fix for some objects appearing as blobs of
 busted geometry on vertex buffer update.

---
 indra/newview/pipeline.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 8c1bb0f6280..2bbb2edc1a1 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2752,6 +2752,11 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 			{
 				markVisible(*i, camera);
 			}
+
+			if (!sDelayVBUpdate)
+			{ //rebuild mesh as soon as we know it's visible
+				group->rebuildMesh();
+			}
 		}
 	}
 
@@ -2802,6 +2807,11 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 		{
 			group->setVisible();
 			stateSort(group, camera);
+
+			if (!sDelayVBUpdate)
+			{ //rebuild mesh as soon as we know it's visible
+				group->rebuildMesh();
+			}
 		}
 	}
 	
-- 
GitLab


From 554b14dedac5a51927bad57b475d8f5a571c1add Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 27 Sep 2011 15:56:15 -0500
Subject: [PATCH 059/933] Remove some unused shaders

---
 .../shaders/class2/deferred/edgeMSF.glsl      |  94 -----
 .../class2/deferred/multiSpotLightMSF.glsl    | 265 --------------
 .../class2/deferred/softenLightMSF.glsl       | 339 ------------------
 .../shaders/class2/deferred/spotLightMSF.glsl | 266 --------------
 .../shaders/class2/deferred/sunLightMSF.glsl  | 222 ------------
 .../class2/deferred/sunLightSSAOMSF.glsl      | 260 --------------
 6 files changed, 1446 deletions(-)
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl

diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
deleted file mode 100644
index b9c65b168cd..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
+++ /dev/null
@@ -1,94 +0,0 @@
-/** 
- * @file edgeF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-
-VARYING vec2 vary_fragcoord;
-
-uniform float depth_cutoff;
-uniform float norm_cutoff;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-float getDepth(ivec2 pos_screen, int sample)
-{
-	float z = texelFetch(depthMap, pos_screen, sample).r;
-	z = z*2.0-1.0;
-	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
-	vec4 p = inv_proj*ndc;
-	return p.z/p.w;
-}
-
-void main() 
-{
-	float e = 0;
-	
-	ivec2 itc = ivec2(vary_fragcoord.xy);
-
-	for (int i = 0; i < samples; i++)
-	{	
-		vec3 norm = texelFetch(normalMap, itc, i).xyz;
-		norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-		float depth = getDepth(itc, i);
-	
-		vec2 tc = vary_fragcoord.xy;
-	
-		int sc = 1;
-	
-		vec2 de;
-		de.x = (depth-getDepth(itc+ivec2(sc, sc),i)) + (depth-getDepth(itc+ivec2(-sc, -sc), i));
-		de.y = (depth-getDepth(itc+ivec2(-sc, sc),i)) + (depth-getDepth(itc+ivec2(sc, -sc), i));
-		de /= depth;
-		de *= de;
-		de = step(depth_cutoff, de);
-	
-		vec2 ne;
-		vec3 nexnorm = texelFetch(normalMap, itc+ivec2(-sc,-sc), i).rgb;
-		nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm
-		ne.x = dot(nexnorm, norm);
-		vec3 neynorm = texelFetch(normalMap, itc+ivec2(sc,sc), i).rgb;
-		neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm
-		ne.y = dot(neynorm, norm);
-	
-		ne = 1.0-ne;
-	
-		ne = step(norm_cutoff, ne);
-
-		e += dot(de,de)+dot(ne,ne);
-	}
-
-	e /= samples;
-	
-	gl_FragColor.a = e;
-}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
deleted file mode 100644
index 4037dca91a4..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ /dev/null
@@ -1,265 +0,0 @@
-/** 
- * @file multiSpotLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2DRect lightMap;
-uniform sampler2D noiseMap;
-uniform sampler2D projectionMap;
-
-uniform mat4 proj_mat; //screen space to light space
-uniform float proj_near; //near clip for projection
-uniform vec3 proj_p; //plane projection is emitting from (in screen space)
-uniform vec3 proj_n;
-uniform float proj_focus; //distance from plane to begin blurring
-uniform float proj_lod;  //(number of mips in proj map)
-uniform float proj_range; //range between near clip and far clip plane of projection
-uniform float proj_ambient_lod;
-uniform float proj_ambiance;
-uniform float near_clip;
-uniform float far_clip;
-
-uniform vec3 proj_origin; //origin of projection to be used for angular attenuation
-uniform float sun_wash;
-uniform int proj_shadow_idx;
-uniform float shadow_fade;
-
-VARYING vec4 vary_light;
-
-VARYING vec4 vary_fragcoord;
-uniform vec2 screen_res;
-
-uniform mat4 inv_proj;
-
-vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float det = max(1.0-lod/(proj_lod*0.5), 0.0);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
-	
-	float det = min(lod/(proj_lod*0.5), 1.0);
-	
-	float d = min(dist.x, dist.y);
-	
-	float edge = 0.25*det;
-		
-	ret *= clamp(d/edge, 0.0, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0);
-	
-	return ret;
-}
-
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-	int wght = 0;
-
-	vec3 fcol = vec3(0,0,0);
-
-	vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res;
-	
-	ivec2 itc = ivec2(frag.xy);
-
-	float shadow = 1.0;
-
-	if (proj_shadow_idx >= 0)
-	{
-		vec4 shd = texture2DRect(lightMap, frag);
-		float sh[2];
-		sh[0] = shd.b;
-		sh[1] = shd.a;
-		shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0);
-	}
-		
-	for (int i = 0; i < samples; i++)
-	{
-		vec3 pos = getPosition(itc, i).xyz;
-		vec3 lv = vary_light.xyz-pos.xyz;
-		float dist2 = dot(lv,lv);
-		dist2 /= vary_light.w;
-		if (dist2 <= 1.0)
-		{
-			vec3 norm = texelFetch(normalMap, itc, i).xyz;
-			norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	
-			norm = normalize(norm);
-			float l_dist = -dot(lv, proj_n);
-	
-			vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0));
-			if (proj_tc.z >= 0.0)
-			{
-				proj_tc.xyz /= proj_tc.w;
-	
-				float fa = vertex_color.a+1.0;
-				float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
-				if (dist_atten > 0.0)
-				{
-					lv = proj_origin-pos.xyz;
-					lv = normalize(lv);
-					float da = dot(norm, lv);
-		
-					vec3 col = vec3(0,0,0);
-		
-					vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb;
-		
-					float noise = texture2D(noiseMap, frag.xy/128.0).b;
-					if (proj_tc.z > 0.0 &&
-						proj_tc.x < 1.0 &&
-						proj_tc.y < 1.0 &&
-						proj_tc.x > 0.0 &&
-						proj_tc.y > 0.0)
-					{
-						float lit = 0.0;
-						float amb_da = proj_ambiance;
-		
-						if (da > 0.0)
-						{
-							float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0);
-							float lod = diff * proj_lod;
-			
-							vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
-		
-							vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
-			
-							lit = da * dist_atten * noise;
-			
-							col = lcol*lit*diff_tex*shadow;
-							amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
-						}
-		
-						//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
-						vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
-							
-						amb_da += (da*da*0.5+0.5)*proj_ambiance;
-				
-						amb_da *= dist_atten * noise;
-			
-						amb_da = min(amb_da, 1.0-lit);
-			
-						col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
-					}
-	
-	
-					vec4 spec = texelFetch(specularRect, itc, i);
-					if (spec.a > 0.0)
-					{
-						vec3 ref = reflect(normalize(pos), norm);
-		
-						//project from point pos in direction ref to plane proj_p, proj_n
-						vec3 pdelta = proj_p-pos;
-						float ds = dot(ref, proj_n);
-		
-						if (ds < 0.0)
-						{
-							vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
-			
-							vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
-
-							if (stc.z > 0.0)
-							{
-								stc.xy /= stc.w;
-
-								float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0);
-				
-								stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
-								
-								if (stc.x < 1.0 &&
-									stc.y < 1.0 &&
-									stc.x > 0.0 &&
-									stc.y > 0.0)
-								{
-									vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-									col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
-								}
-							}
-						}
-					}
-
-					fcol += col;
-					wght++;
-				}
-			}
-		}
-	}
-	
-	if (wght <= 0)
-	{
-		discard;
-	}
-
-	gl_FragColor.rgb = fcol/samples;	
-	gl_FragColor.a = 0.0;
-}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
deleted file mode 100644
index 62a86a3f091..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ /dev/null
@@ -1,339 +0,0 @@
-/** 
- * @file softenLightMSF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS normalMap;
-uniform sampler2DRect lightMap;
-uniform sampler2DMS depthMap;
-uniform sampler2D	  noiseMap;
-uniform samplerCube environmentMap;
-uniform sampler2D	  lightFunc;
-uniform vec3 gi_quad;
-
-uniform float blur_size;
-uniform float blur_fidelity;
-
-// Inputs
-uniform vec4 morphFactor;
-uniform vec3 camPosLocal;
-//uniform vec4 camPosWorld;
-uniform vec4 gamma;
-uniform vec4 lightnorm;
-uniform vec4 sunlight_color;
-uniform vec4 ambient;
-uniform vec4 blue_horizon;
-uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 distance_multiplier;
-uniform vec4 max_y;
-uniform vec4 glow;
-uniform float scene_light_strength;
-uniform vec3 env_mat[3];
-uniform vec4 shadow_clip;
-uniform mat3 ssao_effect_mat;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-VARYING vec4 vary_light;
-VARYING vec2 vary_fragcoord;
-
-vec3 vary_PositionEye;
-
-vec3 vary_SunlitColor;
-vec3 vary_AmblitColor;
-vec3 vary_AdditiveColor;
-vec3 vary_AtmosAttenuation;
-
-vec4 getPosition_d(vec2 pos_screen, float depth)
-{
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-vec3 getPositionEye()
-{
-	return vary_PositionEye;
-}
-vec3 getSunlitColor()
-{
-	return vary_SunlitColor;
-}
-vec3 getAmblitColor()
-{
-	return vary_AmblitColor;
-}
-vec3 getAdditiveColor()
-{
-	return vary_AdditiveColor;
-}
-vec3 getAtmosAttenuation()
-{
-	return vary_AtmosAttenuation;
-}
-
-
-void setPositionEye(vec3 v)
-{
-	vary_PositionEye = v;
-}
-
-void setSunlitColor(vec3 v)
-{
-	vary_SunlitColor = v;
-}
-
-void setAmblitColor(vec3 v)
-{
-	vary_AmblitColor = v;
-}
-
-void setAdditiveColor(vec3 v)
-{
-	vary_AdditiveColor = v;
-}
-
-void setAtmosAttenuation(vec3 v)
-{
-	vary_AtmosAttenuation = v;
-}
-
-void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
-
-	vec3 P = inPositionEye;
-	setPositionEye(P);
-	
-	//(TERRAIN) limit altitude
-	if (P.y > max_y.x) P *= (max_y.x / P.y);
-	if (P.y < -max_y.x) P *= (-max_y.x / P.y);
-
-	vec3 tmpLightnorm = lightnorm.xyz;
-
-	vec3 Pn = normalize(P);
-	float Plen = length(P);
-
-	vec4 temp1 = vec4(0);
-	vec3 temp2 = vec3(0);
-	vec4 blue_weight;
-	vec4 haze_weight;
-	vec4 sunlight = sunlight_color;
-	vec4 light_atten;
-
-	//sunlight attenuation effect (hue and brightness) due to atmosphere
-	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
-		//I had thought blue_density and haze_density should have equal weighting,
-		//but attenuation due to haze_density tends to seem too strong
-
-	temp1 = blue_density + vec4(haze_density.r);
-	blue_weight = blue_density / temp1;
-	haze_weight = vec4(haze_density.r) / temp1;
-
-	//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
-	temp2.y = max(0.0, tmpLightnorm.y);
-	temp2.y = 1. / temp2.y;
-	sunlight *= exp( - light_atten * temp2.y);
-
-	// main atmospheric scattering line integral
-	temp2.z = Plen * density_multiplier.x;
-
-	// Transparency (-> temp1)
-	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
-	// compiler gets confused.
-	temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
-
-	//final atmosphere attenuation factor
-	setAtmosAttenuation(temp1.rgb);
-	
-	//compute haze glow
-	//(can use temp2.x as temp because we haven't used it yet)
-	temp2.x = dot(Pn, tmpLightnorm.xyz);
-	temp2.x = 1. - temp2.x;
-		//temp2.x is 0 at the sun and increases away from sun
-	temp2.x = max(temp2.x, .03);	//was glow.y
-		//set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
-	temp2.x *= glow.x;
-		//higher glow.x gives dimmer glow (because next step is 1 / "angle")
-	temp2.x = pow(temp2.x, glow.z);
-		//glow.z should be negative, so we're doing a sort of (1 / "angle") function
-
-	//add "minimum anti-solar illumination"
-	temp2.x += .25;
-	
-	//increase ambient when there are more clouds
-	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
-	
-	/*  decrease value and saturation (that in HSV, not HSL) for occluded areas
-	 * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
-	 * // The following line of code performs the equivalent of:
-	 * float ambAlpha = tmpAmbient.a;
-	 * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis
-	 * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue);
-	 * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha);
-	 */
-	tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
-
-	//haze color
-	setAdditiveColor(
-		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
-	  + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
-		  + tmpAmbient)));
-
-	//brightness of surface both sunlight and ambient
-	setSunlitColor(vec3(sunlight * .5));
-	setAmblitColor(vec3(tmpAmbient * .25));
-	setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1));
-}
-
-vec3 atmosLighting(vec3 light)
-{
-	light *= getAtmosAttenuation().r;
-	light += getAdditiveColor();
-	return (2.0 * light);
-}
-
-vec3 atmosTransport(vec3 light) {
-	light *= getAtmosAttenuation().r;
-	light += getAdditiveColor() * 2.0;
-	return light;
-}
-vec3 atmosGetDiffuseSunlightColor()
-{
-	return getSunlitColor();
-}
-
-vec3 scaleDownLight(vec3 light)
-{
-	return (light / scene_light_strength );
-}
-
-vec3 scaleUpLight(vec3 light)
-{
-	return (light * scene_light_strength);
-}
-
-vec3 atmosAmbient(vec3 light)
-{
-	return getAmblitColor() + light / 2.0;
-}
-
-vec3 atmosAffectDirectionalLight(float lightIntensity)
-{
-	return getSunlitColor() * lightIntensity;
-}
-
-vec3 scaleSoftClip(vec3 light)
-{
-	//soft clip effect:
-	light = 1. - clamp(light, vec3(0.), vec3(1.));
-	light = 1. - pow(light, gamma.xxx);
-
-	return light;
-}
-
-void main() 
-{
-	vec2 tc = vary_fragcoord.xy;
-	ivec2 itc = ivec2(tc);
-
-	vec4 fcol = vec4(0,0,0,0);
-
-	vec2 scol_ambocc = texture2DRect(lightMap, tc).rg;
-	float ambocc = scol_ambocc.g;
-
-	for (int i = 0; i < samples; ++i)
-	{
-		float depth = texelFetch(depthMap, itc.xy, i).r;
-		vec3 pos = getPosition_d(tc, depth).xyz;
-		vec3 norm = texelFetch(normalMap, itc, i).xyz;
-		norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-			
-		float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
-	
-		vec4 diffuse = texelFetch(diffuseRect, itc, i);
-		vec3 col;
-		float bloom = 0.0;
-		if (diffuse.a < 0.9)
-		{
-			vec4 spec = texelFetch(specularRect, itc, i);
-	
-			float amb = 0;
-
-			float scol = max(scol_ambocc.r, diffuse.a); 
-			amb += ambocc;
-
-			calcAtmospherics(pos.xyz, ambocc);
-	
-			col = atmosAmbient(vec3(0));
-			col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
-	
-			col *= diffuse.rgb;
-	
-			if (spec.a > 0.0) // specular reflection
-			{
-				// the old infinite-sky shiny reflection
-				//
-				vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-				float sa = dot(refnormpersp, vary_light.xyz);
-				vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r;
-
-				// add the two types of shiny together
-				vec3 spec_contrib = dumbshiny * spec.rgb;
-				bloom = dot(spec_contrib, spec_contrib);
-				col += spec_contrib;
-			}
-	
-			col = atmosLighting(col);
-			col = scaleSoftClip(col);
-
-			col = mix(col, diffuse.rgb, diffuse.a);
-		}
-		else
-		{
-			col = diffuse.rgb;
-		}
-
-		fcol += vec4(col, bloom);
-	}
-		
-	gl_FragColor = fcol/samples; 
-}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
deleted file mode 100644
index af3487fd91f..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ /dev/null
@@ -1,266 +0,0 @@
-/** 
- * @file multiSpotLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-
-uniform sampler2DMS diffuseRect;
-uniform sampler2DMS specularRect;
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2DRect lightMap;
-uniform sampler2D noiseMap;
-uniform sampler2D projectionMap;
-
-uniform mat4 proj_mat; //screen space to light space
-uniform float proj_near; //near clip for projection
-uniform vec3 proj_p; //plane projection is emitting from (in screen space)
-uniform vec3 proj_n;
-uniform float proj_focus; //distance from plane to begin blurring
-uniform float proj_lod;  //(number of mips in proj map)
-uniform float proj_range; //range between near clip and far clip plane of projection
-uniform float proj_ambient_lod;
-uniform float proj_ambiance;
-uniform float near_clip;
-uniform float far_clip;
-
-uniform vec3 proj_origin; //origin of projection to be used for angular attenuation
-uniform float sun_wash;
-uniform int proj_shadow_idx;
-uniform float shadow_fade;
-
-VARYING vec4 vary_light;
-
-VARYING vec4 vary_fragcoord;
-uniform vec2 screen_res;
-
-uniform mat4 inv_proj;
-
-vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float det = max(1.0-lod/(proj_lod*0.5), 0.0);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
-	
-	float det = min(lod/(proj_lod*0.5), 1.0);
-	
-	float d = min(dist.x, dist.y);
-	
-	float edge = 0.25*det;
-		
-	ret *= clamp(d/edge, 0.0, 1.0);
-	
-	return ret;
-}
-
-vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
-{
-	vec4 ret = texture2DLod(projectionMap, tc, lod);
-	
-	vec2 dist = tc-vec2(0.5);
-	
-	float d = dot(dist,dist);
-		
-	ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0);
-	
-	return ret;
-}
-
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-void main() 
-{
-	vec4 frag = vary_fragcoord;
-	frag.xyz /= frag.w;
-	frag.xyz = frag.xyz*0.5+0.5;
-	frag.xy *= screen_res;
-	ivec2 itc = ivec2(frag.xy);
-	
-	vec3 fcol = vec3(0,0,0);
-	int wght = 0;
-
-	float shadow = 1.0;
-	
-	if (proj_shadow_idx >= 0)
-	{
-		vec4 shd = texture2DRect(lightMap, frag.xy);
-		float sh[2];
-		sh[0] = shd.b;
-		sh[1] = shd.a;
-		shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0);
-	}
-	
-	for (int i = 0; i < samples; i++)
-	{
-		vec3 pos = getPosition(itc, i).xyz;
-		vec3 lv = vary_light.xyz-pos.xyz;
-		float dist2 = dot(lv,lv);
-		dist2 /= vary_light.w;
-		if (dist2 <= 1.0)
-		{
-			vec3 norm = texelFetch(normalMap, itc, i).xyz;
-			norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	
-			norm = normalize(norm);
-			float l_dist = -dot(lv, proj_n);
-	
-			vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0));
-			if (proj_tc.z >= 0.0)
-			{
-				proj_tc.xyz /= proj_tc.w;
-	
-				float fa = vertex_color.a+1.0;
-				float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
-				if (dist_atten > 0.0)
-				{
-					lv = proj_origin-pos.xyz;
-					lv = normalize(lv);
-					float da = dot(norm, lv);
-		
-					vec3 col = vec3(0,0,0);
-		
-					vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb;
-		
-					float noise = texture2D(noiseMap, frag.xy/128.0).b;
-					if (proj_tc.z > 0.0 &&
-						proj_tc.x < 1.0 &&
-						proj_tc.y < 1.0 &&
-						proj_tc.x > 0.0 &&
-						proj_tc.y > 0.0)
-					{
-						float lit = 0.0;
-						float amb_da = proj_ambiance;
-		
-						if (da > 0.0)
-						{
-							float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0);
-							float lod = diff * proj_lod;
-			
-							vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
-		
-							vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
-			
-							lit = da * dist_atten * noise;
-			
-							col = lcol*lit*diff_tex*shadow;
-							amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
-						}
-		
-						//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
-						vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
-							
-						amb_da += (da*da*0.5+0.5)*proj_ambiance;
-				
-						amb_da *= dist_atten * noise;
-			
-						amb_da = min(amb_da, 1.0-lit);
-			
-						col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
-					}
-	
-	
-					vec4 spec = texelFetch(specularRect, itc, i);
-					if (spec.a > 0.0)
-					{
-						vec3 ref = reflect(normalize(pos), norm);
-		
-						//project from point pos in direction ref to plane proj_p, proj_n
-						vec3 pdelta = proj_p-pos;
-						float ds = dot(ref, proj_n);
-		
-						if (ds < 0.0)
-						{
-							vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
-			
-							vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
-
-							if (stc.z > 0.0)
-							{
-								stc.xy /= stc.w;
-
-								float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0);
-				
-								stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
-								
-								if (stc.x < 1.0 &&
-									stc.y < 1.0 &&
-									stc.x > 0.0 &&
-									stc.y > 0.0)
-								{
-									vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
-									col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
-								}
-							}
-						}
-					}
-
-					fcol += col;
-					wght++;
-				}
-			}
-		}
-	}
-	
-	if (wght <= 0)
-	{
-		discard;
-	}
-
-	gl_FragColor.rgb = fcol/wght;	
-	gl_FragColor.a = 0.0;
-}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
deleted file mode 100644
index 11b3faa4c9e..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
+++ /dev/null
@@ -1,222 +0,0 @@
-/** 
- * @file sunLightMSF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-//class 2, shadows, no SSAO
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
-uniform sampler2DShadow shadowMap4;
-uniform sampler2DShadow shadowMap5;
-
-
-// Inputs
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
-uniform float ssao_radius;
-uniform float ssao_max_radius;
-uniform float ssao_factor;
-uniform float ssao_factor_inv;
-
-VARYING vec2 vary_fragcoord;
-VARYING vec4 vary_light;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-uniform vec2 shadow_res;
-uniform vec2 proj_shadow_res;
-
-uniform float shadow_bias;
-uniform float shadow_offset;
-
-uniform float spot_shadow_bias;
-uniform float spot_shadow_offset;
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen.xy, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl)
-{
-	stc.xyz /= stc.w;
-	stc.z += shadow_bias*scl;
-	
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
-	float shadow = cs;
-
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs);
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs);
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs);
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs);
-			
-	return shadow/5.0;
-	
-	//return shadow;
-}
-
-float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
-{
-	stc.xyz /= stc.w;
-	stc.z += spot_shadow_bias*scl;
-	
-	float cs = shadow2D(shadowMap, stc.xyz);
-	float shadow = cs;
-
-	vec2 off = 1.5/proj_shadow_res;
-	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
-				
-	return shadow/5.0;
-	
-	//return shadow;
-}
-
-void main() 
-{
-	vec2 pos_screen = vary_fragcoord.xy;
-	ivec2 itc = ivec2(pos_screen);
-
-	//try doing an unproject here
-	
-	vec4 fcol = vec4(0,0,0,0);
-
-	for (int i = 0; i < samples; i++)
-	{
-		vec4 pos = getPosition(itc, i);
-	
-		vec4 nmap4 = texelFetch(normalMap, itc, i);
-		nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm
-		float displace = nmap4.w;
-		vec3 norm = nmap4.xyz;
-	
-		/*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL
-		{
-			gl_FragColor = vec4(0.0); // doesn't matter
-			return;
-		}*/
-	
-		float shadow = 1.0;
-		float dp_directional_light = max(0.0, dot(norm, vary_light.xyz));
-
-		vec3 shadow_pos = pos.xyz + displace*norm;
-		vec3 offset = vary_light.xyz * (1.0-dp_directional_light);
-	
-		vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);
-	
-		if (spos.z > -shadow_clip.w)
-		{	
-			if (dp_directional_light == 0.0)
-			{
-				// if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup
-				shadow = 0.0;
-			}
-			else
-			{
-				vec4 lpos;
-			
-				if (spos.z < -shadow_clip.z)
-				{
-					lpos = shadow_matrix[3]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap3, lpos, 0.25);
-					shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
-				}
-				else if (spos.z < -shadow_clip.y)
-				{
-					lpos = shadow_matrix[2]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap2, lpos, 0.5);
-				}
-				else if (spos.z < -shadow_clip.x)
-				{
-					lpos = shadow_matrix[1]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap1, lpos, 0.75);
-				}
-				else
-				{
-					lpos = shadow_matrix[0]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap0, lpos, 1.0);
-				}
-		
-				// take the most-shadowed value out of these two:
-				//  * the blurred sun shadow in the light (shadow) map
-				//  * an unblurred dot product between the sun and this norm
-				// the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting
-				shadow = min(shadow, dp_directional_light);
-			
-				//lpos.xy /= lpos.w*32.0;
-				//if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1)
-				//{
-				//	shadow = 0.0;
-				//}
-			
-			}
-		}
-		else
-		{
-			// more distant than the shadow map covers
-			shadow = 1.0;
-		}
-	
-		fcol[0] += shadow;
-		fcol[1] += 1.0;
-
-		spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0);
-	
-		//spotlight shadow 1
-		vec4 lpos = shadow_matrix[4]*spos;
-		fcol[2] += pcfShadow(shadowMap4, lpos, 0.8); 
-	
-		//spotlight shadow 2
-		lpos = shadow_matrix[5]*spos;
-		fcol[3] += pcfShadow(shadowMap5, lpos, 0.8); 
-	}
-
-	gl_FragColor = fcol/samples;
-}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
deleted file mode 100644
index c571db9df28..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
+++ /dev/null
@@ -1,260 +0,0 @@
-/** 
- * @file sunLightSSAOF.glsl
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-//class 2 -- shadows and SSAO
-
-uniform sampler2DMS depthMap;
-uniform sampler2DMS normalMap;
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
-uniform sampler2DShadow shadowMap4;
-uniform sampler2DShadow shadowMap5;
-uniform sampler2D noiseMap;
-
-// Inputs
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
-uniform float ssao_radius;
-uniform float ssao_max_radius;
-uniform float ssao_factor;
-uniform float ssao_factor_inv;
-
-VARYING vec2 vary_fragcoord;
-VARYING vec4 vary_light;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-uniform vec2 shadow_res;
-uniform vec2 proj_shadow_res;
-
-uniform float shadow_bias;
-uniform float shadow_offset;
-
-uniform float spot_shadow_bias;
-uniform float spot_shadow_offset;
-
-vec4 getPosition(ivec2 pos_screen, int sample)
-{
-	float depth = texelFetch(depthMap, pos_screen, sample).r;
-	vec2 sc = vec2(pos_screen.xy)*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-//calculate decreases in ambient lighting when crowded out (SSAO)
-float calcAmbientOcclusion(vec4 pos, vec3 norm, int sample)
-{
-	float ret = 1.0;
-
-	vec2 kern[8];
-	// exponentially (^2) distant occlusion samples spread around origin
-	kern[0] = vec2(-1.0, 0.0) * 0.125*0.125;
-	kern[1] = vec2(1.0, 0.0) * 0.250*0.250;
-	kern[2] = vec2(0.0, 1.0) * 0.375*0.375;
-	kern[3] = vec2(0.0, -1.0) * 0.500*0.500;
-	kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625;
-	kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750;
-	kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875;
-	kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000;
-
-	vec2 pos_screen = vary_fragcoord.xy;
-	vec3 pos_world = pos.xyz;
-	vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy;
-		
-	float angle_hidden = 0.0;
-	int points = 0;
-		
-	float scale = min(ssao_radius / -pos_world.z, ssao_max_radius);
-		
-	// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?)
-	for (int i = 0; i < 8; i++)
-	{
-		ivec2 samppos_screen = ivec2(pos_screen + scale * reflect(kern[i], noise_reflect));
-		vec3 samppos_world = getPosition(samppos_screen, sample).xyz; 
-			
-		vec3 diff = pos_world - samppos_world;
-		float dist2 = dot(diff, diff);
-			
-		// assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area
-		// --> solid angle shrinking by the square of distance
-		//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2
-		//(k should vary inversely with # of samples, but this is taken care of later)
-			
-		angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv);
-			
-		// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" 
-		points = points + int(diff.z > -1.0);
-	}
-		
-	angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0);
-		
-	ret = (1.0 - (float(points != 0) * angle_hidden));
-	
-	return min(ret, 1.0);
-}
-
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl)
-{
-	stc.xyz /= stc.w;
-	stc.z += shadow_bias*scl;
-	
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
-	float shadow = cs;
-
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs);
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs);
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs);
-	shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs);
-			
-	return shadow/5.0;
-	
-	//return shadow;
-}
-
-float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
-{
-	stc.xyz /= stc.w;
-	stc.z += spot_shadow_bias*scl;
-	
-	float cs = shadow2D(shadowMap, stc.xyz);
-	float shadow = cs;
-
-	vec2 off = 1.5/proj_shadow_res;
-	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
-	
-			
-	return shadow/5.0;
-	
-	//return shadow;
-}
-
-void main() 
-{
-	vec2 pos_screen = vary_fragcoord.xy;
-	ivec2 itc = ivec2(pos_screen);
-	vec4 fcol = vec4(0,0,0,0);
-
-	for (int i = 0; i < samples; i++)
-	{
-		vec4 pos = getPosition(itc, i);
-	
-		vec4 nmap4 = texelFetch(normalMap, itc, i);
-		nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm
-		float displace = nmap4.w;
-		vec3 norm = nmap4.xyz;
-	
-		float shadow = 1.0;
-		float dp_directional_light = max(0.0, dot(norm, vary_light.xyz));
-
-		vec3 shadow_pos = pos.xyz + displace*norm;
-		vec3 offset = vary_light.xyz * (1.0-dp_directional_light);
-	
-		vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);
-	
-		if (spos.z > -shadow_clip.w)
-		{	
-			if (dp_directional_light == 0.0)
-			{
-				// if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup
-				shadow = 0.0;
-			}
-			else
-			{
-				vec4 lpos;
-			
-				if (spos.z < -shadow_clip.z)
-				{
-					lpos = shadow_matrix[3]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap3, lpos, 0.25);
-					shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
-				}
-				else if (spos.z < -shadow_clip.y)
-				{
-					lpos = shadow_matrix[2]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap2, lpos, 0.5);
-				}
-				else if (spos.z < -shadow_clip.x)
-				{
-					lpos = shadow_matrix[1]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap1, lpos, 0.75);
-				}
-				else
-				{
-					lpos = shadow_matrix[0]*spos;
-					lpos.xy *= shadow_res;
-					shadow = pcfShadow(shadowMap0, lpos, 1.0);
-				}
-		
-				// take the most-shadowed value out of these two:
-				//  * the blurred sun shadow in the light (shadow) map
-				//  * an unblurred dot product between the sun and this norm
-				// the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting
-				shadow = min(shadow, dp_directional_light);
-			
-			}
-		}
-		else
-		{
-			// more distant than the shadow map covers
-			shadow = 1.0;
-		}
-	
-		
-		fcol[0] += shadow;
-		fcol[1] += calcAmbientOcclusion(pos, norm, i);
-
-		spos.xyz = shadow_pos+offset*spot_shadow_offset;
-	
-		//spotlight shadow 1
-		vec4 lpos = shadow_matrix[4]*spos;
-		fcol[2] += pcfShadow(shadowMap4, lpos, 0.8); 
-	
-		//spotlight shadow 2
-		lpos = shadow_matrix[5]*spos;
-		fcol[3] += pcfShadow(shadowMap5, lpos, 0.8); 
-	}
-		
-	gl_FragColor = fcol / samples;
-}
-- 
GitLab


From 348a70181211b8fe37c569f8b3fb8324cc8c59ea Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 00:41:10 -0500
Subject: [PATCH 060/933] SH-2507 Shave some unused/redundant varying state and
 make the max texture index debug setting rebuild shaders to use no flow
 control when set to 1 or lower

---
 indra/llrender/llglslshader.cpp               |  8 +-
 indra/llrender/llglslshader.h                 |  2 +-
 indra/llrender/llshadermgr.cpp                | 56 ++++++++++---
 indra/newview/app_settings/settings.xml       |  2 +-
 .../shaders/class1/avatar/avatarV.glsl        |  4 +-
 .../class1/deferred/alphaSkinnedV.glsl        |  4 +-
 .../shaders/class1/deferred/alphaV.glsl       | 10 +--
 .../shaders/class1/deferred/avatarAlphaV.glsl |  4 +-
 .../class1/deferred/diffuseNoColorV.glsl      |  2 +-
 .../shaders/class1/deferred/diffuseV.glsl     |  7 +-
 .../shaders/class1/deferred/emissiveV.glsl    | 10 +--
 .../shaders/class1/deferred/fullbrightV.glsl  | 10 +--
 .../shaders/class1/environment/waterFogF.glsl |  2 +-
 .../class1/objects/emissiveSkinnedV.glsl      |  4 +-
 .../shaders/class1/objects/emissiveV.glsl     | 10 +--
 .../class1/objects/fullbrightNoColorV.glsl    |  4 +-
 .../objects/fullbrightShinySkinnedV.glsl      |  4 +-
 .../class1/objects/fullbrightShinyV.glsl      |  4 +-
 .../class1/objects/fullbrightSkinnedV.glsl    |  4 +-
 .../shaders/class1/objects/fullbrightV.glsl   |  4 +-
 .../class1/objects/indexedTextureV.glsl       | 34 ++++++++
 .../class1/objects/nonindexedTextureV.glsl    | 30 +++++++
 .../shaders/class1/objects/previewV.glsl      |  4 +-
 .../shaders/class1/objects/shinyV.glsl        |  4 +-
 .../class1/objects/simpleNoColorV.glsl        |  4 +-
 .../class1/objects/simpleSkinnedV.glsl        |  4 +-
 .../shaders/class1/objects/simpleV.glsl       |  4 +-
 .../shaders/class1/objects/treeV.glsl         |  4 +-
 .../class1/windlight/atmosphericsVarsF.glsl   |  5 +-
 .../class1/windlight/atmosphericsVarsV.glsl   |  7 +-
 .../windlight/atmosphericsVarsWaterF.glsl     | 33 ++++++++
 .../windlight/atmosphericsVarsWaterV.glsl     | 39 +++++++++
 .../shaders/class2/avatar/eyeballV.glsl       |  4 +-
 .../class2/deferred/alphaSkinnedV.glsl        |  4 +-
 .../shaders/class2/deferred/alphaV.glsl       | 10 +--
 .../shaders/class2/deferred/avatarAlphaV.glsl |  4 +-
 .../class2/objects/fullbrightShinyV.glsl      | 10 +--
 .../shaders/class2/objects/fullbrightV.glsl   | 10 +--
 .../shaders/class2/objects/shinyV.glsl        | 11 +--
 .../class2/objects/simpleNonIndexedV.glsl     |  4 +-
 .../shaders/class2/objects/simpleV.glsl       | 10 +--
 .../class2/windlight/atmosphericsVarsF.glsl   | 16 +---
 .../class2/windlight/atmosphericsVarsV.glsl   | 36 +++++----
 .../windlight/atmosphericsVarsWaterF.glsl     | 51 ++++++++++++
 .../windlight/atmosphericsVarsWaterV.glsl     | 81 +++++++++++++++++++
 indra/newview/featuretable.txt                |  1 +
 indra/newview/featuretable_xp.txt             |  1 +
 indra/newview/llviewercontrol.cpp             |  2 +-
 indra/newview/llviewershadermgr.cpp           | 23 +++---
 49 files changed, 443 insertions(+), 162 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 674d6dcf7e8..3b6cc084b19 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -51,6 +51,7 @@ using std::string;
 
 GLhandleARB LLGLSLShader::sCurBoundShader = 0;
 LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL;
+S32 LLGLSLShader::sIndexedTextureChannels = NULL;
 bool LLGLSLShader::sNoFixedFunction = false;
 
 //UI shader -- declared here so llui_libtest will link properly
@@ -125,13 +126,6 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
 	// Create program
 	mProgramObject = glCreateProgramObjectARB();
 	
-#if !LL_DARWIN
-	if (gGLManager.mGLVersion < 3.1f)
-	{ //force indexed texture channels to 1 if GL version is old (performance improvement for drivers with poor branching shader model support)
-		mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
-	}
-#endif // !LL_DARWIN
-
 	//compile new source
 	vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
 	for ( ; fileIter != mShaderFiles.end(); fileIter++ )
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 04dc594d872..beef57796d0 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -69,7 +69,7 @@ class LLGLSLShader
 
 	static GLhandleARB sCurBoundShader;
 	static LLGLSLShader* sCurBoundShaderPtr;
-
+	static S32 sIndexedTextureChannels;
 	static bool sNoFixedFunction;
 
 	void unload();
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 7dde24a437e..16180c68312 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -81,7 +81,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 	// NOTE order of shader object attaching is VERY IMPORTANT!!!
 	if (features->calculatesAtmospherics)
 	{
-		if (!shader->attachObject("windlight/atmosphericsVarsV.glsl"))
+		if (features->hasWaterFog)
+		{
+			if (!shader->attachObject("windlight/atmosphericsVarsWaterV.glsl"))
+			{
+				return FALSE;
+			}
+		}
+		else if (!shader->attachObject("windlight/atmosphericsVarsV.glsl"))
 		{
 			return FALSE;
 		}
@@ -161,7 +168,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 
 	if(features->calculatesAtmospherics)
 	{
-		if (!shader->attachObject("windlight/atmosphericsVarsF.glsl"))
+		if (features->hasWaterFog)
+		{
+			if (!shader->attachObject("windlight/atmosphericsVarsWaterF.glsl"))
+			{
+				return FALSE;
+			}
+		}
+		else if (!shader->attachObject("windlight/atmosphericsVarsF.glsl"))
 		{
 			return FALSE;
 		}
@@ -241,7 +255,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 						return FALSE;
 					}
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 		
@@ -280,7 +294,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 						return FALSE;
 					}
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}		
 	}
@@ -304,7 +318,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				{
 					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 		else if (features->hasWaterFog)
@@ -336,7 +350,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				{
 					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 		
@@ -355,7 +369,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				{
 					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 		
@@ -395,7 +409,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 						return FALSE;
 					}
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 	}
@@ -419,7 +433,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				{
 					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 		
@@ -438,10 +452,26 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				{
 					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
+				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
 	}
+
+	if (features->mIndexedTextureChannels <= 1)
+	{
+		if (!shader->attachObject("objects/nonindexedTextureV.glsl"))
+		{
+			return FALSE;
+		}
+	}
+	else
+	{
+		if (!shader->attachObject("objects/indexedTextureV.glsl"))
+		{
+			return FALSE;
+		}
+	}
+
 	return TRUE;
 }
 
@@ -631,7 +661,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 			text[count++] = strdup(decl.c_str());
 		}
 
-		text[count++] = strdup("VARYING float vary_texture_index;\n");
+		if (texture_index_channels > 1)
+		{
+			text[count++] = strdup("VARYING float vary_texture_index;\n");
+		}
+
 		text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n");
 		text[count++] = strdup("{\n");
 		
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ddc4f4ddd25..727851b4da0 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7796,7 +7796,7 @@
     <key>Type</key>
     <string>U32</string>
     <key>Value</key>
-    <integer>6</integer>
+    <integer>32</integer>
   </map>
     <key>RenderDebugTextureBind</key>
     <map>
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index cf939e2df8e..2901e18db8e 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -31,7 +31,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -59,8 +59,6 @@ void main()
 		
 	gl_Position = projection_matrix * pos;
 	
-	fog_depth = length(pos.xyz);
-
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 15781bc92d7..b09441f7eb9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -49,7 +49,7 @@ VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_pointlight_col;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 uniform float near_clip;
 
@@ -135,7 +135,7 @@ void main()
 	
 	vertex_color = col;
 
-	fog_depth = pos.z;
+	
 	
 	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 74ee082bed2..93b1a114db1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -29,7 +29,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
@@ -50,10 +50,10 @@ VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_position;
 VARYING vec3 vary_light;
 VARYING vec3 vary_pointlight_col;
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -98,7 +98,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
@@ -138,7 +138,7 @@ void main()
 	
 	vertex_color = col;
 
-	fog_depth = pos.z;
+	
 	
 	pos = modelview_projection_matrix * vert;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 12e88ca5dd6..acbc3f7e156 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -48,7 +48,7 @@ VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_pointlight_col;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 uniform float near_clip;
 
@@ -137,7 +137,7 @@ void main()
 	
 	vertex_color = col;
 
-	fog_depth = pos.z;
+	
 	
 	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
index 7ed41cbcb91..9461e3e32e5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -32,7 +32,7 @@ ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec3 vary_normal;
-VARYING float vary_texture_index;
+
 VARYING vec2 vary_texcoord0;
 
 void main()
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index 908f3abcd0c..76d29b1df7d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -28,23 +28,24 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec3 vary_normal;
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+void passTextureIndex();
+
 void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vary_normal = normalize(normal_matrix * normal);
 
 	vertex_color = diffuse_color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index 7b108e4562e..115b04797f8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -28,7 +28,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec4 emissive;
 ATTRIBUTE vec2 texcoord0;
 
@@ -39,17 +39,17 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
 	vec4 pos = (modelview_matrix * vert);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
@@ -59,5 +59,5 @@ void main()
 	
 	vertex_color = emissive;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index ab638991f7b..2e6982d1017 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -29,7 +29,7 @@ uniform mat4 modelview_projection_matrix;
 
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
@@ -40,17 +40,17 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
 	vec4 pos = (modelview_matrix * vert);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
@@ -60,5 +60,5 @@ void main()
 	
 	vertex_color = diffuse_color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index 57b3a6d001a..45bd5c8b424 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -24,7 +24,7 @@
  */
  
 
-VARYING float fog_depth;
+
 
 uniform vec4 waterFogColor;
 uniform float waterFogEnd;
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
index 8c38d5df2a7..8494ffba528 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -33,7 +33,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
@@ -54,5 +54,5 @@ void main()
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
index 35feacb7b12..e984deb0c89 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -28,7 +28,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec4 emissive;
 ATTRIBUTE vec2 texcoord0;
 
@@ -37,13 +37,13 @@ VARYING vec2 vary_texcoord0;
 
 void calcAtmospherics(vec3 inPositionEye);
 
-VARYING float vary_texture_index;
-VARYING float fog_depth;
+
+
 
 void main()
 {
 	//transform vertex
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
@@ -52,5 +52,5 @@ void main()
 
 	vertex_color = emissive;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
index f73760bfd4e..5d6f14230c7 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
@@ -33,7 +33,7 @@ ATTRIBUTE vec3 normal;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -49,5 +49,5 @@ void main()
 
 	vertex_color = vec4(1,1,1,1);
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index 69cd858b4d3..79b552ee1a9 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -35,7 +35,7 @@ ATTRIBUTE vec2 texcoord0;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_texcoord1;
-VARYING float fog_depth;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
@@ -63,5 +63,5 @@ void main()
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 	
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index a8e640018da..8d1bbf350d4 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -37,7 +37,7 @@ ATTRIBUTE vec2 texcoord0;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_texcoord1;
-VARYING float fog_depth;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -59,5 +59,5 @@ void main()
 
 	vertex_color = diffuse_color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index 4de24fd46b0..eff75435a94 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -35,7 +35,7 @@ mat4 getObjectSkinnedTransform();
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void main()
 {
@@ -53,5 +53,5 @@ void main()
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 		
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index 7286e5e2f45..8b20c2a860c 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -33,7 +33,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -50,5 +50,5 @@ void main()
 
 	vertex_color = diffuse_color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
new file mode 100644
index 00000000000..a95c9e0ab9e
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
@@ -0,0 +1,34 @@
+/** 
+ * @file indexedTextureV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+ATTRIBUTE float texture_index;
+
+VARYING float vary_texture_index;
+
+void passTextureIndex()
+{
+	vary_texture_index = texture_index;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl
new file mode 100644
index 00000000000..2839171044c
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl
@@ -0,0 +1,30 @@
+/** 
+ * @file nonindexedTextureV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+void passTextureIndex()
+{
+
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
index 282686a9b07..5dcfa87066f 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -34,7 +34,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -53,5 +53,5 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
 	vertex_color = color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index 86a78b190c1..4ca53a8f302 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -35,7 +35,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec3 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -57,6 +57,6 @@ void main()
 	
 	vary_texcoord0 = (texture_matrix0*vec4(ref,1.0)).xyz;
 	
-	fog_depth = pos.z;
+	
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index 45a493e4f2d..706627e1756 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -34,7 +34,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -53,5 +53,5 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
 	vertex_color = color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index aea0e25e60e..1c6e53b1879 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -33,7 +33,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -61,5 +61,5 @@ void main()
 	
 	gl_Position = projection_matrix*vec4(pos, 1.0);
 	
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index 4b6b2197516..df9111f941c 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -35,7 +35,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -53,6 +53,4 @@ void main()
 
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	vertex_color = color;
-
-	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
index 250d99a9c76..fa01a27ec0a 100644
--- a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
@@ -37,7 +37,7 @@ void calcAtmospherics(vec3 inPositionEye);
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void main()
 {
@@ -56,5 +56,5 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
 	vertex_color = color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
index 2e413601508..8bdae328bde 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
@@ -24,10 +24,7 @@
  */
  
 
-
-VARYING vec3 vary_PositionEye;
-
 vec3 getPositionEye()
 {
-	return vary_PositionEye;
+	return vec3(0,0,0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
index 42f8646f2d0..8ec9ae617ca 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
@@ -25,15 +25,12 @@
  
 
 
-VARYING vec3 vary_PositionEye;
-
-
 vec3 getPositionEye()
 {
-	return vary_PositionEye;
+	return vec3(0,0,0);
 }
 
 void setPositionEye(vec3 v)
 {
-	vary_PositionEye = v;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl
new file mode 100644
index 00000000000..636d4af006f
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl
@@ -0,0 +1,33 @@
+/** 
+ * @file atmosphericVarsWaterF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+
+VARYING vec3 vary_PositionEye;
+
+vec3 getPositionEye()
+{
+	return vary_PositionEye;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl
new file mode 100644
index 00000000000..ef34c5c8538
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl
@@ -0,0 +1,39 @@
+/** 
+ * @file atmosphericVarsWaterV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+ 
+VARYING vec3 vary_PositionEye;
+VARYING float fog_depth;
+
+vec3 getPositionEye()
+{
+	return vary_PositionEye;
+}
+
+void setPositionEye(vec3 v)
+{
+	vary_PositionEye = v;
+	fog_depth = v.z;
+}
diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
index 04d3e2aa1f9..5af9f5c902b 100644
--- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
@@ -35,7 +35,7 @@ ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -56,7 +56,7 @@ void main()
 	vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));
 			
 	vertex_color = color;
-	fog_depth = pos.z;
+	
 
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index ad353eb6247..5a3955ef009 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -50,7 +50,7 @@ VARYING vec3 vary_pointlight_col;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -140,7 +140,7 @@ void main()
 	
 	vertex_color = col;
 
-	fog_depth = pos.z;
+	
 	
 	pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 6a3777c7c85..9540ddd2e84 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -29,7 +29,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
@@ -49,10 +49,10 @@ VARYING vec3 vary_directional;
 VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_position;
 VARYING vec3 vary_pointlight_col;
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -97,7 +97,7 @@ void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz, 1.0);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
@@ -136,7 +136,7 @@ void main()
 	
 	vertex_color = col;
 
-	fog_depth = pos.z;
+	
 	
 	pos = modelview_projection_matrix * vert;
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 091a8651609..63c7a6b13d3 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -48,7 +48,7 @@ VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_pointlight_col;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -139,7 +139,7 @@ void main()
 	
 	vertex_color = col;
 
-	fog_depth = pos.z;
+	
 	vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
index 580ef2694fc..34bd8d445a0 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
@@ -34,10 +34,10 @@ void calcAtmospherics(vec3 inPositionEye);
 
 uniform vec4 origin;
 
-VARYING float vary_texture_index;
+
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
@@ -45,13 +45,13 @@ ATTRIBUTE vec2 texcoord0;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_texcoord1;
-VARYING float fog_depth;
+
 
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
@@ -64,6 +64,4 @@ void main()
 	calcAtmospherics(pos.xyz);
 
 	vertex_color = diffuse_color;
-
-	fog_depth = pos.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
index 09dbd0b6cd8..fc20d3270e2 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
@@ -28,7 +28,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
  
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
@@ -36,16 +36,16 @@ ATTRIBUTE vec4 diffuse_color;
 
 void calcAtmospherics(vec3 inPositionEye);
 
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
@@ -54,5 +54,5 @@ void main()
 
 	vertex_color = diffuse_color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
index 86c592ea575..fdb3453cc58 100644
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
@@ -30,7 +30,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
@@ -43,16 +43,13 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 
 void calcAtmospherics(vec3 inPositionEye);
 
-VARYING float vary_texture_index;
-VARYING float fog_depth;
-
 uniform vec4 origin;
 
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 		
@@ -64,7 +61,5 @@ void main()
 
 	calcAtmospherics(pos.xyz);
 
-	vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));
-
-	fog_depth = pos.z;
+	vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));	
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
index 6799e43b9a3..cb80697d154 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
@@ -35,7 +35,7 @@ ATTRIBUTE vec4 diffuse_color;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
@@ -57,5 +57,5 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	vertex_color = color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
index 8e8f0664b05..37a20383e2c 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
@@ -29,7 +29,7 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE float texture_index;
+void passTextureIndex();
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
@@ -37,16 +37,16 @@ ATTRIBUTE vec4 diffuse_color;
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
 
-VARYING float vary_texture_index;
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
-VARYING float fog_depth;
+
 
 void main()
 {
 	//transform vertex
 	vec4 vert = vec4(position.xyz,1.0);
-	vary_texture_index = texture_index;
+	passTextureIndex();
 	vec4 pos = (modelview_matrix * vert);
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
@@ -60,5 +60,5 @@ void main()
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	vertex_color = color;
 
-	fog_depth = pos.z;
+	
 }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
index 08814b49d85..e8e56e12c1b 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
@@ -24,25 +24,17 @@
  */
  
 
-
-VARYING vec3 vary_PositionEye;
-
 VARYING vec3 vary_SunlitColor;
-VARYING vec3 vary_AmblitColor;
 VARYING vec3 vary_AdditiveColor;
-VARYING vec3 vary_AtmosAttenuation;
+VARYING float vary_AtmosAttenuation;
 
-vec3 getPositionEye()
-{
-	return vary_PositionEye;
-}
 vec3 getSunlitColor()
 {
-	return vary_SunlitColor;
+	return vec3(0,0,0);
 }
 vec3 getAmblitColor()
 {
-	return vary_AmblitColor;
+	return vec3(0,0,0);
 }
 vec3 getAdditiveColor()
 {
@@ -50,5 +42,5 @@ vec3 getAdditiveColor()
 }
 vec3 getAtmosAttenuation()
 {
-	return vary_AtmosAttenuation;
+	return vec3(vary_AtmosAttenuation);
 }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index 514f009adde..01605e5b251 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -24,49 +24,50 @@
  */
  
 
-
-VARYING vec3 vary_PositionEye;
-
-VARYING vec3 vary_SunlitColor;
-VARYING vec3 vary_AmblitColor;
 VARYING vec3 vary_AdditiveColor;
-VARYING vec3 vary_AtmosAttenuation;
+VARYING float vary_AtmosAttenuation;
+
+vec3 atmos_attenuation;
+vec3 sunlit_color;
+vec3 amblit_color;
+vec3 position_eye;
 
-vec3 getPositionEye()
-{
-	return vary_PositionEye;
-}
 vec3 getSunlitColor()
 {
-	return vary_SunlitColor;
+	return sunlit_color;
 }
 vec3 getAmblitColor()
 {
-	return vary_AmblitColor;
+	return amblit_color;
 }
+
 vec3 getAdditiveColor()
 {
 	return vary_AdditiveColor;
 }
 vec3 getAtmosAttenuation()
 {
-	return vary_AtmosAttenuation;
+	return atmos_attenuation;
 }
 
+vec3 getPositionEye()
+{
+	return position_eye;
+}
 
 void setPositionEye(vec3 v)
 {
-	vary_PositionEye = v;
+	position_eye = v;
 }
 
 void setSunlitColor(vec3 v)
 {
-	vary_SunlitColor = v;
+	sunlit_color  = v;
 }
 
 void setAmblitColor(vec3 v)
 {
-	vary_AmblitColor = v;
+	amblit_color = v;
 }
 
 void setAdditiveColor(vec3 v)
@@ -76,5 +77,6 @@ void setAdditiveColor(vec3 v)
 
 void setAtmosAttenuation(vec3 v)
 {
-	vary_AtmosAttenuation = v;
+	atmos_attenuation = v;
+	vary_AtmosAttenuation = v.r;
 }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
new file mode 100644
index 00000000000..23046f990da
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
@@ -0,0 +1,51 @@
+/** 
+ * @file atmosphericVarsWaterF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+VARYING vec3 vary_PositionEye;
+VARYING vec3 vary_SunlitColor;
+VARYING vec3 vary_AdditiveColor;
+VARYING float vary_AtmosAttenuation;
+
+vec3 getSunlitColor()
+{
+	return vec3(0,0,0);
+}
+vec3 getAmblitColor()
+{
+	return vec3(0,0,0);
+}
+vec3 getAdditiveColor()
+{
+	return vary_AdditiveColor;
+}
+vec3 getAtmosAttenuation()
+{
+	return vec3(vary_AtmosAttenuation);
+}
+vec3 getPositionEye()
+{
+	return vary_PositionEye;
+}
+
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
new file mode 100644
index 00000000000..279c4dd9815
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
@@ -0,0 +1,81 @@
+/** 
+ * @file atmosphericVarsWaterV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+VARYING vec3 vary_PositionEye;
+VARYING vec3 vary_AdditiveColor;
+VARYING float vary_AtmosAttenuation;
+
+vec3 atmos_attenuation;
+vec3 sunlit_color;
+vec3 amblit_color;
+
+vec3 getSunlitColor()
+{
+	return sunlit_color;
+}
+vec3 getAmblitColor()
+{
+	return amblit_color;
+}
+
+vec3 getAdditiveColor()
+{
+	return vary_AdditiveColor;
+}
+vec3 getAtmosAttenuation()
+{
+	return atmos_attenuation;
+}
+
+vec3 getPositionEye()
+{
+	return vary_PositionEye;
+}
+
+void setPositionEye(vec3 v)
+{
+	vary_PositionEye = v;
+}
+
+void setSunlitColor(vec3 v)
+{
+	sunlit_color  = v;
+}
+
+void setAmblitColor(vec3 v)
+{
+	amblit_color = v;
+}
+
+void setAdditiveColor(vec3 v)
+{
+	vary_AdditiveColor = v;
+}
+
+void setAtmosAttenuation(vec3 v)
+{
+	atmos_attenuation = v;
+	vary_AtmosAttenuation = v.r;
+}
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index e12c2f7853c..ca66ae989ce 100755
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -292,6 +292,7 @@ RenderVBOEnable				1	0
 
 list OpenGLPre30
 RenderDeferred				0	0
+RenderMaxTextureIndex		1	1
 
 list Intel
 RenderAnisotropic			1	0
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt
index a0245f53690..e855b2c569d 100644
--- a/indra/newview/featuretable_xp.txt
+++ b/indra/newview/featuretable_xp.txt
@@ -290,6 +290,7 @@ RenderVBOEnable				1	0
 
 list OpenGLPre30
 RenderDeferred				0	0
+RenderMaxTextureIndex		1	1
 
 list Intel
 RenderAnisotropic			1	0
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index f521d93e032..563a63287e5 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -594,7 +594,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
 	gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
 	gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
-	gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
+	gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 17cce3069e7..94b7451f0e8 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -444,6 +444,9 @@ void LLViewerShaderMgr::setShaders()
 		return;
 	}
 
+	LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);
+
+
 	if (LLRender::sGLCoreProfile)
 	{ 
 		if (!gSavedSettings.getBOOL("VertexShaderEnable"))
@@ -826,8 +829,8 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 	// (in order of shader function call depth for reference purposes, deepest level first)
 
 	vector< pair<string, S32> > shaders;
-	shaders.reserve(10);
 	shaders.push_back( make_pair( "windlight/atmosphericsVarsV.glsl",		mVertexShaderLevel[SHADER_WINDLIGHT] ) );
+	shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterV.glsl",		mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	shaders.push_back( make_pair( "windlight/atmosphericsHelpersV.glsl",	mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	shaders.push_back( make_pair( "lighting/lightFuncV.glsl",				mVertexShaderLevel[SHADER_LIGHTING] ) );
 	shaders.push_back( make_pair( "lighting/sumLightsV.glsl",				sum_lights_class ) );
@@ -838,6 +841,8 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 	shaders.push_back( make_pair( "windlight/atmosphericsV.glsl",			mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	shaders.push_back( make_pair( "avatar/avatarSkinV.glsl",				1 ) );
 	shaders.push_back( make_pair( "avatar/objectSkinV.glsl",				1 ) );
+	shaders.push_back( make_pair( "objects/indexedTextureV.glsl",			1 ) );
+	shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl",		1 ) );
 
 	// We no longer have to bind the shaders to global glhandles, they are automatically added to a map now.
 	for (U32 i = 0; i < shaders.size(); i++)
@@ -853,8 +858,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 	// (in order of shader function call depth for reference purposes, deepest level first)
 
 	shaders.clear();
-	shaders.reserve(13);
-	S32 ch = gGLManager.mNumTextureImageUnits-1;
+	S32 ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 
 	if (gGLManager.mGLVersion < 3.1f)
 	{ //force to 1 texture index channel for old drivers
@@ -863,6 +867,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 
 	std::vector<S32> index_channels;
 	index_channels.push_back(-1);	 shaders.push_back( make_pair( "windlight/atmosphericsVarsF.glsl",		mVertexShaderLevel[SHADER_WINDLIGHT] ) );
+	index_channels.push_back(-1);	 shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterF.glsl",		mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	index_channels.push_back(-1);	 shaders.push_back( make_pair( "windlight/gammaF.glsl",					mVertexShaderLevel[SHADER_WINDLIGHT]) );
 	index_channels.push_back(-1);	 shaders.push_back( make_pair( "windlight/atmosphericsF.glsl",			mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	index_channels.push_back(-1);	 shaders.push_back( make_pair( "windlight/transportF.glsl",				mVertexShaderLevel[SHADER_WINDLIGHT] ) );	
@@ -1186,7 +1191,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredDiffuseProgram.mShaderFiles.clear();
 		gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER_ARB));
-		gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
+		gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
 		gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredDiffuseProgram.createShader(NULL, NULL);
 	}
@@ -1197,7 +1202,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredDiffuseAlphaMaskProgram.mShaderFiles.clear();
 		gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER_ARB));
-		gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
+		gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
 		gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredDiffuseAlphaMaskProgram.createShader(NULL, NULL);
 	}
@@ -1394,11 +1399,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels
 		if (mVertexShaderLevel[SHADER_DEFERRED] < 1)
 		{
-			gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
+			gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
 		}
 		else
 		{ //shave off some texture units for shadow maps
-			gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits - 6;
+			gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels - 6, 1);
 		}
 			
 		gDeferredAlphaProgram.mShaderFiles.clear();
@@ -1428,7 +1433,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredFullbrightProgram.mFeatures.calculatesAtmospherics = true;
 		gDeferredFullbrightProgram.mFeatures.hasGamma = true;
 		gDeferredFullbrightProgram.mFeatures.hasTransport = true;
-		gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
+		gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
 		gDeferredFullbrightProgram.mShaderFiles.clear();
 		gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));
@@ -1442,7 +1447,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredEmissiveProgram.mFeatures.calculatesAtmospherics = true;
 		gDeferredEmissiveProgram.mFeatures.hasGamma = true;
 		gDeferredEmissiveProgram.mFeatures.hasTransport = true;
-		gDeferredEmissiveProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
+		gDeferredEmissiveProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
 		gDeferredEmissiveProgram.mShaderFiles.clear();
 		gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER_ARB));
-- 
GitLab


From 6dfcb11000f349e24dbd1a9b78efa2ca4f799379 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 01:37:54 -0500
Subject: [PATCH 061/933] SH-2453 Fix for horizontal line when max altitude set
 to 0

---
 .../app_settings/shaders/class1/deferred/softenLightF.glsl    | 4 ----
 .../shaders/class1/objects/nonindexedTextureV.glsl            | 1 +
 .../app_settings/shaders/class2/deferred/softenLightF.glsl    | 4 ----
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 255796aa274..60952ea38ec 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -148,10 +148,6 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 	vec3 P = inPositionEye;
 	setPositionEye(P);
 	
-	//(TERRAIN) limit altitude
-	if (P.y > max_y.x) P *= (max_y.x / P.y);
-	if (P.y < -max_y.x) P *= (-max_y.x / P.y);
-
 	vec3 tmpLightnorm = lightnorm.xyz;
 
 	vec3 Pn = normalize(P);
diff --git a/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl
index 2839171044c..80ea286ac04 100644
--- a/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl
@@ -28,3 +28,4 @@ void passTextureIndex()
 
 }
 
+
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 4543e83d0a8..eb367d4ad6d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -148,10 +148,6 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 	vec3 P = inPositionEye;
 	setPositionEye(P);
 	
-	//(TERRAIN) limit altitude
-	if (P.y > max_y.x) P *= (max_y.x / P.y);
-	if (P.y < -max_y.x) P *= (-max_y.x / P.y);
-
 	vec3 tmpLightnorm = lightnorm.xyz;
 
 	vec3 Pn = normalize(P);
-- 
GitLab


From 4328b30180bd057412de2085c1d758f5e6906d70 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 01:50:28 -0500
Subject: [PATCH 062/933] SH-2450 Potential fix for crash on login with 460M et
 al

---
 indra/newview/llviewershadermgr.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 94b7451f0e8..6af9e464df0 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -32,6 +32,7 @@
 
 #include "llfile.h"
 #include "llviewerwindow.h"
+#include "llwindow.h"
 #include "llviewercontrol.h"
 #include "pipeline.h"
 #include "llworld.h"
@@ -491,6 +492,9 @@ void LLViewerShaderMgr::setShaders()
 	if (gViewerWindow)
 	{
 		gViewerWindow->setCursor(UI_CURSOR_WAIT);
+		//VICIOUS HACK -- some drivers will time out if we don't redraw the window within 2 seconds, and this operation can take awhile
+		//minimizing tells the driver we won't be updating the window for a bit
+		gViewerWindow->getWindow()->minimize();
 	}
 
 	// Lighting
@@ -684,6 +688,7 @@ void LLViewerShaderMgr::setShaders()
 	if (gViewerWindow)
 	{
 		gViewerWindow->setCursor(UI_CURSOR_ARROW);
+		gViewerWindow->getWindow()->restore();
 	}
 	gPipeline.createGLBuffers();
 
-- 
GitLab


From 5ca512fa1f36998440bad5256730c9d22f195037 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 12:38:31 -0500
Subject: [PATCH 063/933] SH-2450 Potential fix for crash on GeForce 4xx when
 allocating LLVertexBuffer data

---
 indra/llrender/llvertexbuffer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 199699449ad..5756ccdcd59 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -560,8 +560,8 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
 	sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
 
 	if(!sPrivatePoolp)
-	{
-		sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
+	{ //disable private pool for now -- lots of memory allocations failing for vertex buffers erroneously
+		//sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
 	}
 }
 
-- 
GitLab


From 69ac0d0aee6e0dc1075a7d18e17e8335cd29e05f Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 28 Sep 2011 14:52:27 -0400
Subject: [PATCH 064/933] Fix for sh-2500

---
 indra/newview/llfloatermodelpreview.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 77e9b4eeb81..527a868db25 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3309,7 +3309,7 @@ void LLModelPreview::rebuildUploadData()
 	F32 max_scale = 0.f;
 
 	//reorder materials to match mBaseModel
-	for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+	for (U32 i = 0; i < LLModel::NUM_LODS-1; i++)
 	{
 		if (mBaseModel.size() == mModel[i].size())
 		{
@@ -5085,7 +5085,7 @@ BOOL LLModelPreview::render()
 		}
 
 		//make sure material lists all match
-		for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+		for (U32 i = 0; i < LLModel::NUM_LODS-1; i++)
 		{
 			if (mBaseModel.size() == mModel[i].size())
 			{
-- 
GitLab


From f657f5a428e47fc9963cc4eb943062216443673f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 15:54:02 -0500
Subject: [PATCH 065/933] SH-2276 Remove some log spam to alleviate stalls on
 login.

---
 indra/llmessage/llassetstorage.cpp     | 30 +++++++++++++-------------
 indra/llui/llnotifications.cpp         |  2 +-
 indra/newview/llviewerassetstorage.cpp |  8 +++----
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 31cdb1219bd..9b86daebe5d 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -149,8 +149,8 @@ void LLAssetInfo::setFromNameValue( const LLNameValue& nv )
 	setName( buf );
 	buf.assign( str, pos2, std::string::npos );
 	setDescription( buf );
-	llinfos << "uuid: " << mUuid << llendl;
-	llinfos << "creator: " << mCreatorID << llendl;
+	LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << llendl;
+	LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << llendl;
 }
 
 ///----------------------------------------------------------------------------
@@ -434,9 +434,9 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse
 // IW - uuid is passed by value to avoid side effects, please don't re-add &    
 void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LLGetAssetCallback callback, void *user_data, BOOL is_priority)
 {
-	lldebugs << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl;
+	LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl;
 
-	llinfos << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
+	LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
 
 	if (user_data)
 	{
@@ -446,7 +446,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
 
 	if (mShutDown)
 	{
-		llinfos << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
+		LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
 
 		if (callback)
 		{
@@ -468,7 +468,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
 	// Try static VFS first.
 	if (findInStaticVFSAndInvokeCallback(uuid,type,callback,user_data))
 	{
-		llinfos << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl;
+		LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl;
 		return;
 	}
 
@@ -486,7 +486,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
 			callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
 		}
 
-		llinfos << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl;
+		LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl;
 	}
 	else
 	{
@@ -520,7 +520,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
 		}
 		if (duplicate)
 		{
-			llinfos << "Adding additional non-duplicate request for asset " << uuid 
+			LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid 
 					<< "." << LLAssetType::lookup(type) << llendl;
 		}
 		
@@ -584,9 +584,9 @@ void LLAssetStorage::downloadCompleteCallback(
 	LLAssetType::EType file_type,
 	void* user_data, LLExtStat ext_status)
 {
-	llinfos << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << llendl;
+	LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << llendl;
 
-	lldebugs << "LLAssetStorage::downloadCompleteCallback() for " << file_id
+	LL_DEBUGS("AssetStorage") << "LLAssetStorage::downloadCompleteCallback() for " << file_id
 		 << "," << LLAssetType::lookup(file_type) << llendl;
 	LLAssetRequest* req = (LLAssetRequest*)user_data;
 	if(!req)
@@ -731,7 +731,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
 			tpvf.setAsset(asset_id, atype);
 			tpvf.setCallback(downloadEstateAssetCompleteCallback, req);
 
-			llinfos << "Starting transfer for " << asset_id << llendl;
+			LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << llendl;
 			LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET);
 			ttcp->requestTransfer(spe, tpvf, 100.f + (is_priority ? 1.f : 0.f));
 		}
@@ -871,7 +871,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
 			tpvf.setAsset(asset_id, atype);
 			tpvf.setCallback(downloadInvItemCompleteCallback, req);
 
-			llinfos << "Starting transfer for inventory asset "
+			LL_DEBUGS("AssetStorage") << "Starting transfer for inventory asset "
 				<< item_id << " owned by " << owner_id << "," << task_id
 				<< llendl;
 			LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET);
@@ -1211,7 +1211,7 @@ bool LLAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt,
 	request_list_t* requests = getRequestList(rt);
 	if (deletePendingRequestImpl(requests, asset_type, asset_id))
 	{
-		llinfos << "Asset " << getRequestName(rt) << " request for "
+		LL_DEBUGS("AssetStorage") << "Asset " << getRequestName(rt) << " request for "
 				<< asset_id << "." << LLAssetType::lookup(asset_type)
 				<< " removed from pending queue." << llendl;
 		return true;
@@ -1307,7 +1307,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
 			user_data == ((LLLegacyAssetRequest *)tmp->mUserData)->mUserData)
 		{
 			// this is a duplicate from the same subsystem - throw it away
-			llinfos << "Discarding duplicate request for UUID " << uuid << llendl;
+			LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << llendl;
 			return;
 		}
 	}
@@ -1490,7 +1490,7 @@ void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::ET
 {
 	if( !metric_recipient )
 	{
-		llinfos << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << llendl;
+		LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << llendl;
 		return;
 	}
 
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index ffe5908a9d7..3fa13d7bb04 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1640,7 +1640,7 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
 	LLNotificationSet::iterator it=mItems.find(target);
 	if (it == mItems.end())
 	{
-		llwarns << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl;
+		LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl;
 		return LLNotificationPtr((LLNotification*)NULL);
 	}
 	else
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index 36c8b42a522..d042f628308 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -116,7 +116,7 @@ void LLViewerAssetStorage::storeAssetData(
 	F64 timeout)
 {
 	LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
-	llinfos << "LLViewerAssetStorage::storeAssetData (legacy) " << tid << ":" << LLAssetType::lookup(asset_type)
+	LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy) " << tid << ":" << LLAssetType::lookup(asset_type)
 			<< " ASSET_ID: " << asset_id << llendl;
 	
 	if (mUpstreamHost.isOk())
@@ -248,9 +248,9 @@ void LLViewerAssetStorage::storeAssetData(
 	}
 	
 	LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
-	llinfos << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl;
+	LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl;
 
-	llinfos << "ASSET_ID: " << asset_id << llendl;
+	LL_DEBUGS("AssetStorage") << "ASSET_ID: " << asset_id << llendl;
 
 	S32 size = 0;
 	LLFILE* fp = LLFile::fopen(filename, "rb");
@@ -369,7 +369,7 @@ void LLViewerAssetStorage::_queueDataRequest(
 			tpvf.setAsset(uuid, atype);
 			tpvf.setCallback(downloadCompleteCallback, req);
 
-			llinfos << "Starting transfer for " << uuid << llendl;
+			LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << llendl;
 			LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET);
 			ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f));
 
-- 
GitLab


From 4dd533a5871fd5bbb0ea084679da9f0a856d41c5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 16:22:20 -0500
Subject: [PATCH 066/933] SH-2276 Update window often during login to avoid
 windows TDR events

---
 indra/newview/llstartup.cpp | 132 +++++++++++++++++++++++++++++++-----
 1 file changed, 116 insertions(+), 16 deletions(-)

diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 11a4c96f144..8876d6fa164 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -733,8 +733,11 @@ bool idle_startup()
 		// this startup phase more than once.
 		if (gLoginMenuBarView == NULL)
 		{
-		initialize_edit_menu();
+			display_startup();
+			initialize_edit_menu();
+			display_startup();
 			init_menus();
+			display_startup();
 		}
 
 		if (show_connect_box)
@@ -743,23 +746,28 @@ bool idle_startup()
 			// NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
 			// show the login view until login_show() is called below.  
 			if (gUserCredential.isNull())                                                                          
-			{                                                                                                      
+			{                                                  
+				display_startup();
 				gUserCredential = gLoginHandler.initializeLoginInfo();                 
+				display_startup();
 			}     
 			if (gHeadlessClient)
 			{
 				LL_WARNS("AppInit") << "Waiting at connection box in headless client.  Did you mean to add autologin params?" << LL_ENDL;
 			}
 			// Make sure the process dialog doesn't hide things
+			display_startup();
 			gViewerWindow->setShowProgress(FALSE);
-
+			display_startup();
 			// Show the login dialog
 			login_show();
+			display_startup();
 			// connect dialog is already shown, so fill in the names
 			if (gUserCredential.notNull())                                                                         
 			{                                                                                                      
 				LLPanelLogin::setFields( gUserCredential, gRememberPassword);                                  
 			}     
+			display_startup();
 			LLPanelLogin::giveFocus();
 
 			LLStartUp::setStartupState( STATE_LOGIN_WAIT );		// Wait for user input
@@ -770,14 +778,19 @@ bool idle_startup()
 			LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
 		}
 
+		display_startup();
 		gViewerWindow->setNormalControlsVisible( FALSE );	
+		display_startup();
 		gLoginMenuBarView->setVisible( TRUE );
+		display_startup();
 		gLoginMenuBarView->setEnabled( TRUE );
+		display_startup();
 		show_debug_menus();
+		display_startup();
 
 		// Hide the splash screen
 		LLSplashScreen::hide();
-
+		display_startup();
 		// Push our window frontmost
 		gViewerWindow->getWindow()->show();
 		display_startup();
@@ -786,7 +799,10 @@ bool idle_startup()
 		// first made visible.
 #ifdef _WIN32
 		MSG msg;
-		while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) );
+		while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) )
+		{
+			display_startup();
+		}
 #endif
 		timeout.reset();
 		return FALSE;
@@ -801,7 +817,7 @@ bool idle_startup()
 
 		// Don't do anything.  Wait for the login view to call the login_callback,
 		// which will push us to the next state.
-
+		display_startup();
 		// Sleep so we don't spin the CPU
 		ms_sleep(1);
 		return FALSE;
@@ -1169,37 +1185,51 @@ bool idle_startup()
 
 		// Finish agent initialization.  (Requires gSavedSettings, builds camera)
 		gAgent.init();
+		display_startup();
 		gAgentCamera.init();
+		display_startup();
 		set_underclothes_menu_options();
+		display_startup();
 
 		// Since we connected, save off the settings so the user doesn't have to
 		// type the name/password again if we crash.
 		gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
 		LLUIColorTable::instance().saveUserSettings();
 
+		display_startup();
+
 		//
 		// Initialize classes w/graphics stuff.
 		//
 		gTextureList.doPrefetchImages();		
+		display_startup();
+
 		LLSurface::initClasses();
+		display_startup();
+
 
 		LLFace::initClass();
+		display_startup();
 
 		LLDrawable::initClass();
+		display_startup();
 
 		// init the shader managers
 		LLPostProcess::initClass();
+		display_startup();
 
 		LLViewerObject::initVOClasses();
+		display_startup();
 
 		// Initialize all our tools.  Must be done after saved settings loaded.
 		// NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton.
 		LLToolMgr::getInstance()->initTools();
+		display_startup();
 
 		// Pre-load floaters, like the world map, that are slow to spawn
 		// due to XML complexity.
 		gViewerWindow->initWorldUI();
-
+		
 		display_startup();
 
 		// This is where we used to initialize gWorldp. Original comment said:
@@ -1207,24 +1237,26 @@ bool idle_startup()
 
 		// User might have overridden far clip
 		LLWorld::getInstance()->setLandFarClip(gAgentCamera.mDrawDistance);
-
+		display_startup();
 		// Before we create the first region, we need to set the agent's mOriginGlobal
 		// This is necessary because creating objects before this is set will result in a
 		// bad mPositionAgent cache.
 
 		gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
+		display_startup();
 
 		LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
+		display_startup();
 
 		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
 		LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
 		
 		regionp->setSeedCapability(gFirstSimSeedCap);
 		LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
-		
+		display_startup();
 		// Set agent's initial region to be the one we just created.
 		gAgent.setRegion(regionp);
-
+		display_startup();
 		// Set agent's initial position, which will be read by LLVOAvatar when the avatar
 		// object is created.  I think this must be done after setting the region.  JC
 		gAgent.setPositionAgent(agent_start_position_region);
@@ -1244,6 +1276,7 @@ bool idle_startup()
 	{
 		LLStartUp::multimediaInit();
 		LLStartUp::setStartupState( STATE_FONT_INIT );
+		display_startup();
 		return FALSE;
 	}
 
@@ -1252,6 +1285,7 @@ bool idle_startup()
 	{
 		LLStartUp::fontInit();
 		LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
+		display_startup();
 		return FALSE;
 	}
 
@@ -1279,6 +1313,7 @@ bool idle_startup()
 				set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
 			}
 		}
+		display_startup();
 		return FALSE;
 	}
 
@@ -1289,7 +1324,9 @@ bool idle_startup()
 	//---------------------------------------------------------------------
 	if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState())
 	{
+		display_startup();
 		update_texture_fetch();
+		display_startup();
 
 		if ( gViewerWindow != NULL)
 		{	// This isn't the first logon attempt, so show the UI
@@ -1297,12 +1334,15 @@ bool idle_startup()
 		}	
 		gLoginMenuBarView->setVisible( FALSE );
 		gLoginMenuBarView->setEnabled( FALSE );
+		display_startup();
 
 		// direct logging to the debug console's line buffer
 		LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
+		display_startup();
 		
 		// set initial visibility of debug console
 		gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
+		display_startup();
 
 		//
 		// Set message handlers
@@ -1311,22 +1351,28 @@ bool idle_startup()
 
 		// register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted
 		register_viewer_callbacks(gMessageSystem);
+		display_startup();
 
 		// Debugging info parameters
 		gMessageSystem->setMaxMessageTime( 0.5f );			// Spam if decoding all msgs takes more than 500 ms
+		display_startup();
 
 		#ifndef	LL_RELEASE_FOR_DOWNLOAD
 			gMessageSystem->setTimeDecodes( TRUE );				// Time the decode of each msg
 			gMessageSystem->setTimeDecodesSpamThreshold( 0.05f );  // Spam if a single msg takes over 50ms to decode
 		#endif
+		display_startup();
 
 		gXferManager->registerCallbacks(gMessageSystem);
+		display_startup();
 
 		LLStartUp::initNameCache();
+		display_startup();
 
 		// update the voice settings *after* gCacheName initialization
 		// so that we can construct voice UI that relies on the name cache
 		LLVoiceClient::getInstance()->updateSettings();
+		display_startup();
 
 		//gCacheName is required for nearby chat history loading
 		//so I just moved nearby history loading a few states further
@@ -1335,12 +1381,14 @@ bool idle_startup()
 			LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 			if (nearby_chat) nearby_chat->loadHistory();
 		}
+		display_startup();
 
 		// *Note: this is where gWorldMap used to be initialized.
 
 		// register null callbacks for audio until the audio system is initialized
 		gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL);
 		gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL);
+		display_startup();
 
 		//reset statistics
 		LLViewerStats::getInstance()->resetStats();
@@ -1370,6 +1418,7 @@ bool idle_startup()
 		LLViewerCamera::getInstance()->setAspect(gViewerWindow->getWorldViewAspectRatio());
 		// Initialize FOV
 		LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle")); 
+		display_startup();
 
 		// Move agent to starting location. The position handed to us by
 		// the space server is in global coordinates, but the agent frame
@@ -1380,6 +1429,7 @@ bool idle_startup()
 		gAgent.resetAxes(gAgentStartLookAt);
 		gAgentCamera.stopCameraAnimation();
 		gAgentCamera.resetCamera();
+		display_startup();
 
 		// Initialize global class data needed for surfaces (i.e. textures)
 		LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
@@ -1392,6 +1442,8 @@ bool idle_startup()
 		LLGLState::checkStates();
 		LLGLState::checkTextureChannels();
 
+		display_startup();
+
 		LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
 		// For all images pre-loaded into viewer cache, decode them.
 		// Need to do this AFTER we init the sky
@@ -1405,6 +1457,8 @@ bool idle_startup()
 		}
 		LLStartUp::setStartupState( STATE_WORLD_WAIT );
 
+		display_startup();
+
 		// JC - Do this as late as possible to increase likelihood Purify
 		// will run.
 		LLMessageSystem* msg = gMessageSystem;
@@ -1432,6 +1486,7 @@ bool idle_startup()
 			NULL);
 
 		timeout.reset();
+		display_startup();
 
 		return FALSE;
 	}
@@ -1450,8 +1505,10 @@ bool idle_startup()
 		LLMessageSystem* msg = gMessageSystem;
 		while (msg->checkAllMessages(gFrameCount, gServicePump))
 		{
+			display_startup();
 		}
 		msg->processAcks();
+		display_startup();
 		return FALSE;
 	}
 
@@ -1462,6 +1519,7 @@ bool idle_startup()
 	{
 		LL_DEBUGS("AppInit") << "Connecting to region..." << LL_ENDL;
 		set_startup_status(0.60f, LLTrans::getString("LoginConnectingToRegion"), gAgent.mMOTD);
+		display_startup();
 		// register with the message system so it knows we're
 		// expecting this message
 		LLMessageSystem* msg = gMessageSystem;
@@ -1477,6 +1535,7 @@ bool idle_startup()
 			msg->newMessageFast(_PREHASH_EconomyDataRequest);
 			gAgent.sendReliableMessage();
 		}
+		display_startup();
 
 		// Create login effect
 		// But not on first login, because you can't see your avatar then
@@ -1491,6 +1550,7 @@ bool idle_startup()
 		LLStartUp::setStartupState( STATE_AGENT_WAIT );		// Go to STATE_AGENT_WAIT
 
 		timeout.reset();
+		display_startup();
 		return FALSE;
 	}
 
@@ -1515,14 +1575,17 @@ bool idle_startup()
 				LL_DEBUGS("AppInit") << "Awaiting AvatarInitComplete, got "
 				<< msg->getMessageName() << LL_ENDL;
 			}
+			display_startup();
 		}
 		msg->processAcks();
 
+		display_startup();
+
 		if (gAgentMovementCompleted)
 		{
 			LLStartUp::setStartupState( STATE_INVENTORY_SEND );
 		}
-
+		display_startup();
 		return FALSE;
 	}
 
@@ -1531,9 +1594,10 @@ bool idle_startup()
 	//---------------------------------------------------------------------
 	if (STATE_INVENTORY_SEND == LLStartUp::getStartupState())
 	{
+		display_startup();
 		// Inform simulator of our language preference
 		LLAgentLanguage::update();
-
+		display_startup();
 		// unpack thin inventory
 		LLSD response = LLLoginInstance::getInstance()->getResponse();
 		//bool dump_buffer = false;
@@ -1548,6 +1612,7 @@ bool idle_startup()
 				gInventory.setLibraryRootFolderID(id.asUUID());
 			}
 		}
+		display_startup();
  		
 		LLSD inv_lib_owner = response["inventory-lib-owner"];
 		if(inv_lib_owner.isDefined())
@@ -1559,6 +1624,7 @@ bool idle_startup()
 				gInventory.setLibraryOwnerID( LLUUID(id.asUUID()));
 			}
 		}
+		display_startup();
 
 		LLSD inv_skel_lib = response["inventory-skel-lib"];
  		if(inv_skel_lib.isDefined() && gInventory.getLibraryOwnerID().notNull())
@@ -1568,6 +1634,7 @@ bool idle_startup()
  				LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL;
  			}
  		}
+		display_startup();
 
 		LLSD inv_skeleton = response["inventory-skeleton"];
  		if(inv_skeleton.isDefined())
@@ -1577,6 +1644,7 @@ bool idle_startup()
  				LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL;
  			}
  		}
+		display_startup();
 
 		LLSD inv_basic = response["inventory-basic"];
  		if(inv_basic.isDefined())
@@ -1614,6 +1682,7 @@ bool idle_startup()
 				list[agent_id] = new LLRelationship(given_rights, has_rights, false);
 			}
 			LLAvatarTracker::instance().addBuddyList(list);
+			display_startup();
  		}
 
 		bool show_hud = false;
@@ -1641,6 +1710,8 @@ bool idle_startup()
 				//}
 			}
 		}
+		display_startup();
+
 		// Either we want to show tutorial because this is the first login
 		// to a Linden Help Island or the user quit with the tutorial
 		// visible.  JC
@@ -1648,22 +1719,26 @@ bool idle_startup()
 		{
 			LLFloaterReg::showInstance("hud", LLSD(), FALSE);
 		}
+		display_startup();
 
 		LLSD event_notifications = response["event_notifications"];
 		if(event_notifications.isDefined())
 		{
 			gEventNotifier.load(event_notifications);
 		}
+		display_startup();
 
 		LLSD classified_categories = response["classified_categories"];
 		if(classified_categories.isDefined())
 		{
 			LLClassifiedInfo::loadCategories(classified_categories);
 		}
+		display_startup();
 
 		// This method MUST be called before gInventory.findCategoryUUIDForType because of 
 		// gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap.
 		gInventory.buildParentChildMap();
+		display_startup();
 
 		//all categories loaded. lets create "My Favorites" category
 		gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
@@ -1677,24 +1752,26 @@ bool idle_startup()
 		LLAvatarTracker::instance().registerCallbacks(msg);
 		llinfos << " Landmark" << llendl;
 		LLLandmark::registerCallbacks(msg);
+		display_startup();
 
 		// request mute list
 		llinfos << "Requesting Mute List" << llendl;
 		LLMuteList::getInstance()->requestFromServer(gAgent.getID());
-
+		display_startup();
 		// Get L$ and ownership credit information
 		llinfos << "Requesting Money Balance" << llendl;
 		LLStatusBar::sendMoneyBalanceRequest();
-
+		display_startup();
 		// request all group information
 		llinfos << "Requesting Agent Data" << llendl;
 		gAgent.sendAgentDataUpdateRequest();
-
+		display_startup();
 		// Create the inventory views
 		llinfos << "Creating Inventory Views" << llendl;
 		LLFloaterReg::getInstance("inventory");
-
+		display_startup();
 		LLStartUp::setStartupState( STATE_MISC );
+		display_startup();
 		return FALSE;
 	}
 
@@ -1743,17 +1820,23 @@ bool idle_startup()
 			gSavedSettings.setBOOL("ShowStartLocation", TRUE);
 		}
 
+		display_startup();
+
 		if (gSavedSettings.getBOOL("HelpFloaterOpen"))
 		{
 			// show default topic
 			LLViewerHelp::instance().showTopic("");
 		}
 
+		display_startup();
+
 		// We're successfully logged in.
 		gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE);
 
 		LLFloaterReg::showInitialVisibleInstances();
 
+		display_startup();
+
 		// based on the comments, we've successfully logged in so we can delete the 'forced'
 		// URL that the updater set in settings.ini (in a mostly paranoid fashion)
 		std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" );
@@ -1767,8 +1850,10 @@ bool idle_startup()
 			LLUIColorTable::instance().saveUserSettings();
 		};
 
+		display_startup();
 		// JC: Initializing audio requests many sounds for download.
 		init_audio();
+		display_startup();
 
 		// JC: Initialize "active" gestures.  This may also trigger
 		// many gesture downloads, if this is the user's first
@@ -1806,6 +1891,7 @@ bool idle_startup()
 			LLGestureMgr::instance().startFetch();
 		}
 		gDisplaySwapBuffers = TRUE;
+		display_startup();
 
 		LLMessageSystem* msg = gMessageSystem;
 		msg->setHandlerFuncFast(_PREHASH_SoundTrigger,				process_sound_trigger);
@@ -1880,8 +1966,10 @@ bool idle_startup()
 			}
 		}
 
+		display_startup();
         //DEV-17797.  get null folder.  Any items found here moved to Lost and Found
         LLInventoryModelBackgroundFetch::instance().findLostItems();
+		display_startup();
 
 		LLStartUp::setStartupState( STATE_PRECACHE );
 		timeout.reset();
@@ -1890,6 +1978,7 @@ bool idle_startup()
 
 	if (STATE_PRECACHE == LLStartUp::getStartupState())
 	{
+		display_startup();
 		F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
 
 		// We now have an inventory skeleton, so if this is a user's first
@@ -1906,6 +1995,8 @@ bool idle_startup()
 			LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
 		}
 
+		display_startup();
+
 		// wait precache-delay and for agent's avatar or a lot longer.
 		if(((timeout_frac > 1.f) && isAgentAvatarValid())
 		   || (timeout_frac > 3.f))
@@ -1947,6 +2038,8 @@ bool idle_startup()
 			return TRUE;
 		}
 		
+		display_startup();
+
 		if (wearables_time > MAX_WEARABLES_TIME)
 		{
 			LLNotificationsUtil::add("ClothingLoading");
@@ -1978,16 +2071,20 @@ bool idle_startup()
 			}
 		}
 
+		display_startup();
 		update_texture_fetch();
+		display_startup();
 		set_startup_status(0.9f + 0.1f * wearables_time / MAX_WEARABLES_TIME,
 						 LLTrans::getString("LoginDownloadingClothing").c_str(),
 						 gAgent.mMOTD.c_str());
+		display_startup();
 		return TRUE;
 	}
 
 	if (STATE_CLEANUP == LLStartUp::getStartupState())
 	{
 		set_startup_status(1.0, "", "");
+		display_startup();
 
 		// Let the map know about the inventory.
 		LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance();
@@ -2003,6 +2100,7 @@ bool idle_startup()
 		//gViewerWindow->revealIntroPanel();
 		gViewerWindow->setStartupComplete(); 
 		gViewerWindow->setProgressCancelButtonVisible(FALSE);
+		display_startup();
 
 		// We're not away from keyboard, even though login might have taken
 		// a while. JC
@@ -2038,6 +2136,7 @@ bool idle_startup()
 		// LLUserAuth::getInstance()->reset();
 
 		LLStartUp::setStartupState( STATE_STARTED );
+		display_startup();
 
 		// Unmute audio if desired and setup volumes.
 		// Unmute audio if desired and setup volumes.
@@ -2062,6 +2161,7 @@ bool idle_startup()
 		LLAgentPicksInfo::getInstance()->requestNumberOfPicks();
 
 		LLIMFloater::initIMFloater();
+		display_startup();
 
 		return TRUE;
 	}
-- 
GitLab


From e43f4dc31b40e588805e06f4c503e0387687a08e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 16:51:12 -0500
Subject: [PATCH 067/933] SH-2276 Add some info around a possible deadlock
 culprit.

---
 indra/newview/llvowlsky.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index c26aefb28f7..14fd0a1eb14 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -349,6 +349,9 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
 
 		mStripsVerts.resize(strips_segments, NULL);
 
+		LLTimer timer;
+		timer.start();
+
 		for (U32 i = 0; i < strips_segments ;++i)
 		{
 			LLVertexBuffer * segment = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
@@ -390,6 +393,8 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
 			// and unlock the buffer
 			segment->flush();
 		}
+	
+		llinfos << "completed in " << llformat("%.2f", timer.getElapsedTimeF32()) << "seconds" << llendl;
 	}
 #else
 	mStripsVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
-- 
GitLab


From 872567c0c1a58272b276303c881585acf9ba9ac0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 16:51:23 -0500
Subject: [PATCH 068/933] SH-2244 Fix for mac build?

---
 indra/llrender/llimagegl.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index cbdb8f83f68..3d3c94ef3e8 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -727,7 +727,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 		{
 			if (mAutoGenMips)
 			{
-				if (!glGenerateMipmap)
+				if (!gGLManager.mHasFramebufferObject)
 				{
 					glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
 				}
@@ -760,7 +760,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 					}
 				}
 
-				if (glGenerateMipmap)
+				if (gGLManager.mHasFramebufferObject)
 				{
 					glGenerateMipmap(LLTexUnit::getInternalType(mBindTarget));
 				}
-- 
GitLab


From b8b0886f3e7a421ad5f90cd5454a39f4d2dac959 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 28 Sep 2011 16:55:41 -0500
Subject: [PATCH 069/933] SH-2507 Fix for linux build

---
 indra/llrender/llglslshader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 3b6cc084b19..ddadf07d73d 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -51,7 +51,7 @@ using std::string;
 
 GLhandleARB LLGLSLShader::sCurBoundShader = 0;
 LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL;
-S32 LLGLSLShader::sIndexedTextureChannels = NULL;
+S32 LLGLSLShader::sIndexedTextureChannels = 0;
 bool LLGLSLShader::sNoFixedFunction = false;
 
 //UI shader -- declared here so llui_libtest will link properly
-- 
GitLab


From 0d75c5f4a68df5850dff9afbca545a51459dc040 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 12:57:13 -0500
Subject: [PATCH 070/933] Pull Nyx's thread local data initialization fix

---
 indra/newview/llappviewer.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 2320d4a0d01..eb5ebbf1e91 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -773,6 +773,9 @@ bool LLAppViewer::init()
 		LLViewerAssetStatsFF::init();
 	}
 
+	// init main thread's local data pool before initializing the threads - Nyx
+	LLThreadLocalData::init();
+
     initThreads();
 	LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ;
 
-- 
GitLab


From 1e9a4924317b8c0c2c8418c8531c9fd1b141b605 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 13:10:38 -0500
Subject: [PATCH 071/933] SH-2276 disable private memory pool management

---
 indra/llrender/llvertexbuffer.cpp       | 4 ++--
 indra/newview/app_settings/settings.xml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 5756ccdcd59..71596d41d3b 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -560,8 +560,8 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
 	sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
 
 	if(!sPrivatePoolp)
-	{ //disable private pool for now -- lots of memory allocations failing for vertex buffers erroneously
-		//sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
+	{ 
+		sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
 	}
 }
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 727851b4da0..890eb0f0ceb 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5655,7 +5655,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
     <key>MemProfiling</key>
     <map>
-- 
GitLab


From 973fefc8d9014f6389b4c3f9633ce398fdf5399e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 16:25:47 -0500
Subject: [PATCH 072/933] SH-2276 enable verbose GL debugging to try and get
 some more info in crash reports

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 890eb0f0ceb..11ac2b695e0 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7763,7 +7763,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
   <key>RenderDebugNormalScale</key>
   <map>
-- 
GitLab


From 7238714634e72dacc4b09c1c4ee98b16fb0c91fe Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 19:32:56 -0500
Subject: [PATCH 073/933] SH-2507 Potential fix for basic shaders causing
 objects to disappear with some drivers (prune shader tree of unused shaders
 while we're at it)

---
 indra/llrender/llrender.cpp                   |   4 +-
 indra/newview/app_settings/settings.xml       |  13 +-
 .../shaders/class1/environment/terrainF.glsl  |  46 ++++--
 .../shaders/class1/environment/terrainV.glsl  |  41 +++---
 .../class1/environment/terrainWaterF.glsl     |  47 ++++--
 .../class1/environment/underWaterF.glsl       |  73 +++++++--
 .../shaders/class1/environment/waterF.glsl    |  80 ++++++----
 .../shaders/class1/environment/waterFogF.glsl |  50 +++++--
 .../shaders/class1/lighting/lightF.glsl       |  12 +-
 .../class1/lighting/lightFullbrightF.glsl     |  17 ++-
 .../lighting/lightFullbrightShinyF.glsl       |  26 +++-
 .../lighting/lightFullbrightShinyWaterF.glsl  |  27 +++-
 .../lighting/lightFullbrightWaterF.glsl       |  14 +-
 .../shaders/class1/lighting/lightShinyF.glsl  |  19 ++-
 .../class1/lighting/lightShinyWaterF.glsl     |  18 ++-
 .../class1/lighting/lightSpecularV.glsl       |  23 +--
 .../shaders/class1/lighting/lightV.glsl       |  19 +--
 .../shaders/class1/lighting/lightWaterF.glsl  |  16 +-
 .../class1/objects/fullbrightShinyV.glsl      |  22 +--
 .../shaders/class1/objects/fullbrightV.glsl   |  20 ++-
 .../shaders/class1/objects/shinyV.glsl        |  33 +++--
 .../shaders/class1/objects/simpleV.glsl       |  24 ++-
 .../windlight/atmosphericsHelpersV.glsl       |   6 +-
 .../shaders/class2/effects/blurF.glsl         |  27 ----
 .../shaders/class2/effects/blurV.glsl         |  27 ----
 .../shaders/class2/effects/colorFilterF.glsl  |  53 -------
 .../shaders/class2/effects/drawQuadV.glsl     |  39 -----
 .../shaders/class2/effects/extractF.glsl      |  44 ------
 .../shaders/class2/effects/nightVisionF.glsl  |  67 ---------
 .../shaders/class2/effects/simpleF.glsl       |  38 -----
 .../shaders/class2/environment/terrainF.glsl  |  64 --------
 .../shaders/class2/environment/terrainV.glsl  |  88 -----------
 .../class2/environment/terrainWaterF.glsl     |  65 --------
 .../class2/environment/underWaterF.glsl       | 110 --------------
 .../shaders/class2/environment/waterF.glsl    | 139 ------------------
 .../shaders/class2/environment/waterFogF.glsl |  74 ----------
 .../class2/lighting/lightAlphaMaskF.glsl      |  54 -------
 .../lighting/lightAlphaMaskNonIndexedF.glsl   |  57 -------
 .../shaders/class2/lighting/lightF.glsl       |  46 ------
 .../lighting/lightFullbrightAlphaMaskF.glsl   |  54 -------
 .../class2/lighting/lightFullbrightF.glsl     |  46 ------
 .../lightFullbrightNonIndexedAlphaMaskF.glsl  |  56 -------
 .../lighting/lightFullbrightNonIndexedF.glsl  |  48 ------
 .../lighting/lightFullbrightShinyF.glsl       |  55 -------
 .../lightFullbrightShinyNonIndexedF.glsl      |  56 -------
 .../lighting/lightFullbrightShinyWaterF.glsl  |  53 -------
 .../lightFullbrightShinyWaterNonIndexedF.glsl |  54 -------
 .../lightFullbrightWaterAlphaMaskF.glsl       |  54 -------
 .../lighting/lightFullbrightWaterF.glsl       |  46 ------
 ...htFullbrightWaterNonIndexedAlphaMaskF.glsl |  54 -------
 .../lightFullbrightWaterNonIndexedF.glsl      |  46 ------
 .../class2/lighting/lightNonIndexedF.glsl     |  48 ------
 .../shaders/class2/lighting/lightShinyF.glsl  |  54 -------
 .../lighting/lightShinyNonIndexedF.glsl       |  55 -------
 .../class2/lighting/lightShinyWaterF.glsl     |  51 -------
 .../lighting/lightShinyWaterNonIndexedF.glsl  |  52 -------
 .../class2/lighting/lightSpecularV.glsl       |  36 -----
 .../shaders/class2/lighting/lightV.glsl       |  36 -----
 .../class2/lighting/lightWaterAlphaMaskF.glsl |  52 -------
 .../lightWaterAlphaMaskNonIndexedF.glsl       |  56 -------
 .../shaders/class2/lighting/lightWaterF.glsl  |  44 ------
 .../lighting/lightWaterNonIndexedF.glsl       |  46 ------
 .../class2/objects/fullbrightShinyV.glsl      |  67 ---------
 .../shaders/class2/objects/fullbrightV.glsl   |  58 --------
 .../shaders/class2/objects/shinyV.glsl        |  65 --------
 .../class2/objects/simpleNonIndexedV.glsl     |  61 --------
 .../shaders/class2/objects/simpleV.glsl       |  64 --------
 indra/newview/llviewercontrol.cpp             |   1 -
 indra/newview/llviewershadermgr.cpp           |  51 +------
 69 files changed, 424 insertions(+), 2737 deletions(-)
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/blurF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/blurV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/extractF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/environment/waterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/objects/simpleV.glsl

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 8ba164fcc9e..bbdd0a7a602 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1,4 +1,4 @@
-/** 
+ /** 
  * @file llrender.cpp
  * @brief LLRender implementation
  *
@@ -1132,6 +1132,8 @@ void LLRender::syncLightState()
 		shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);
 		shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);
 		shader->uniform4fv("light_ambient", 1, mAmbientLightColor.mV);
+		//HACK -- duplicate sunlight color for compatibility with drivers that can't deal with multiple shader objects referencing the same uniform
+		shader->uniform4fv("sunlight_color", 1, diffuse[0].mV);
 	}
 }
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 11ac2b695e0..cd5218c56d1 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3148,17 +3148,6 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>EnableRippleWater</key>
-    <map>
-      <key>Comment</key>
-      <string>Whether to use ripple water shader or not</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>EnableTextureAtlas</key>
     <map>
       <key>Comment</key>
@@ -9296,7 +9285,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
     <key>RenderVBOMappingDisable</key>
     <map>
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index f0837dd4cae..18f6d91804d 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file terrainF.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
@@ -27,22 +27,38 @@
 out vec4 gl_FragColor;
 #endif
 
-uniform sampler2D detail0;
-uniform sampler2D detail1;
-uniform sampler2D alphaRamp;
+VARYING vec4 vertex_color;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
 
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-VARYING vec2 vary_texcoord2;
-VARYING vec2 vary_texcoord3;
+uniform sampler2D detail_0;
+uniform sampler2D detail_1;
+uniform sampler2D detail_2;
+uniform sampler2D detail_3;
+uniform sampler2D alpha_ramp;
 
-void main() 
+vec3 atmosLighting(vec3 light);
+
+vec3 scaleSoftClip(vec3 color);
+
+void main()
 {
-	float a = texture2D(alphaRamp, vary_texcoord1.xy).a;
-	vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb,
-					 texture2D(detail0, vary_texcoord0.xy).rgb,
-					 a);
+	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
+	
+	/// TODO Confirm tex coords and bind them appropriately in vert shader.
+	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
+	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
+	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
+	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
 
-	gl_FragColor.rgb = color;
-	gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).a;
+	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
+	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
+	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
+	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
+	
+	/// Add WL Components
+	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
+	
+	gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);
 }
+
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index d4a62db6841..f183b885d19 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file terrainV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
@@ -25,9 +25,6 @@
 
 uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
-uniform mat4 texture_matrix1;
-uniform mat4 texture_matrix2;
-uniform mat4 texture_matrix3;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
@@ -39,14 +36,12 @@ ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec2 texcoord1;
-ATTRIBUTE vec2 texcoord2;
-ATTRIBUTE vec2 texcoord3;
 
 VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-VARYING vec2 vary_texcoord2;
-VARYING vec2 vary_texcoord3;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+
+void calcAtmospherics(vec3 inPositionEye);
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 
@@ -68,16 +63,26 @@ void main()
 {
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-			
-	vec4 pos = modelview_matrix * vec4(position, 1.0);
+
+	vec4 pos = modelview_matrix * vec4(position.xyz, 1.0);
 	vec3 norm = normalize(normal_matrix * normal);
-	
-	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color);
+
+	calcAtmospherics(pos.xyz);
+
+	/// Potentially better without it for water.
+	pos /= pos.w;
+
+	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
 	
 	vertex_color = color;
+
+	// Transform and pass tex coords
+ 	vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;
 	
-	vary_texcoord0 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,object_plane_s,object_plane_t).xy;
-	vary_texcoord1 = (texture_matrix1*vec4(texcoord1,0,1)).xy;
-	vary_texcoord2 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,object_plane_s,object_plane_t).xy;
-	vary_texcoord3 = (texture_matrix3*vec4(texcoord3,0,1)).xy;
+	vec4 t = vec4(texcoord1,0,1);
+	
+	vary_texcoord0.zw = t.xy;
+	vary_texcoord1.xy = t.xy-vec2(2.0, 0.0);
+	vary_texcoord1.zw = t.xy-vec2(1.0, 0.0);
 }
+
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index b84f29423f9..e5c7ced52c0 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file terrainWaterF.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
@@ -27,24 +27,39 @@
 out vec4 gl_FragColor;
 #endif
 
-// this class1 shader is just a copy of terrainF
+VARYING vec4 vertex_color;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
 
-uniform sampler2D detail0;
-uniform sampler2D detail1;
-uniform sampler2D alphaRamp;
+uniform sampler2D detail_0;
+uniform sampler2D detail_1;
+uniform sampler2D detail_2;
+uniform sampler2D detail_3;
+uniform sampler2D alpha_ramp;
 
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-VARYING vec2 vary_texcoord2;
-VARYING vec2 vary_texcoord3;
+vec3 atmosLighting(vec3 light);
 
-void main() 
+vec4 applyWaterFog(vec4 color);
+
+void main()
 {
-	float a = texture2D(alphaRamp, vary_texcoord1.xy).a;
-	vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb,
-					 texture2D(detail0, vary_texcoord0.xy).rgb,
-					 a);
+	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
+	
+	/// TODO Confirm tex coords and bind them appropriately in vert shader.
+	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
+	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
+	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
+	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
 
-	gl_FragColor.rgb = color;
-	gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).a;
+	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
+	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
+	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
+	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
+	
+	/// Add WL Components
+	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
+	
+	outColor = applyWaterFog(outColor);
+	gl_FragColor = outColor;
 }
+
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 2e138d35bfa..1fdb90f7926 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -30,31 +30,75 @@ out vec4 gl_FragColor;
 uniform sampler2D diffuseMap;
 uniform sampler2D bumpMap;   
 uniform sampler2D screenTex;
+uniform sampler2D refTex;
+uniform sampler2D screenDepth;
 
+uniform vec4 fogCol;
+uniform vec3 lightDir;
+uniform vec3 specular;
+uniform float lightExp;
+uniform vec2 fbScale;
 uniform float refScale;
+uniform float znear;
+uniform float zfar;
+uniform float kd;
+uniform vec4 waterPlane;
+uniform vec3 eyeVec;
 uniform vec4 waterFogColor;
+uniform float waterFogDensity;
+uniform float waterFogKS;
+uniform vec2 screenRes;
 
 //bigWave is (refCoord.w, view.w);
 VARYING vec4 refCoord;
 VARYING vec4 littleWave;
 VARYING vec4 view;
 
-void main() 
+vec4 applyWaterFog(vec4 color, vec3 viewVec)
 {
-	vec4 color;    
+	//normalize view vector
+	vec3 view = normalize(viewVec);
+	float es = -view.z;
+
+	//find intersection point with water plane and eye vector
 	
-	//get bigwave normal
-	vec3 wavef = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0;
-    
-	//get detail normals
-	vec3 dcol = texture2D(bumpMap, littleWave.xy).rgb*0.75;
-	dcol += texture2D(bumpMap, littleWave.zw).rgb*1.25;
-	    
-	//interpolate between big waves and little waves (big waves in deep water)
-	wavef = (wavef+dcol)*0.5;
+	//get eye depth
+	float e0 = max(-waterPlane.w, 0.0);
+	
+	//get object depth
+	float depth = length(viewVec);
+		
+	//get "thickness" of water
+	float l = max(depth, 0.1);
+
+	float kd = waterFogDensity;
+	float ks = waterFogKS;
+	vec4 kc = waterFogColor;
+	
+	float F = 0.98;
+	
+	float t1 = -kd * pow(F, ks * e0);
+	float t2 = kd + ks * es;
+	float t3 = pow(F, t2*l) - 1.0;
+	
+	float L = min(t1/t2*t3, 1.0);
+	
+	float D = pow(0.98, l*kd);
+	//return vec4(1.0, 0.0, 1.0, 1.0);
+	return color * D + kc * L;
+	//depth /= 10.0;
+	//return vec4(depth,depth,depth,0.0);
+}
 
-	//crunch normal to range [-1,1]
-	wavef -= vec3(1,1,1);
+void main() 
+{
+	vec4 color;
+	    
+	//get detail normals
+	vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
+	vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
+	vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;    
+	vec3 wavef = normalize(wave1+wave2+wave3);
 	
 	//figure out distortion vector (ripply)   
 	vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5;
@@ -62,6 +106,5 @@ void main()
 		
 	vec4 fb = texture2D(screenTex, distort);
 	
-	gl_FragColor.rgb = mix(waterFogColor.rgb, fb.rgb, waterFogColor.a * 0.001 + 0.999);
-	gl_FragColor.a = fb.a;
+	gl_FragColor = applyWaterFog(fb,view.xyz);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 1512074ddaf..444c896d388 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -29,16 +29,13 @@ out vec4 gl_FragColor;
 
 vec3 scaleSoftClip(vec3 inColor);
 vec3 atmosTransport(vec3 inColor);
-vec3 applyWaterFog(vec4 inColor);
 
-uniform sampler2D diffuseMap;
 uniform sampler2D bumpMap;   
 uniform sampler2D screenTex;
 uniform sampler2D refTex;
 
 uniform float sunAngle;
 uniform float sunAngle2;
-uniform float scaledAngle;
 uniform vec3 lightDir;
 uniform vec3 specular;
 uniform float lightExp;
@@ -49,7 +46,7 @@ uniform vec3 normScale;
 uniform float fresnelScale;
 uniform float fresnelOffset;
 uniform float blurMultiplier;
-uniform vec4 fogCol;
+
 
 //bigWave is (refCoord.w, view.w);
 VARYING vec4 refCoord;
@@ -58,58 +55,83 @@ VARYING vec4 view;
 
 void main() 
 {
-	vec3 viewVec = view.xyz;
 	vec4 color;
 	
-	float dist = length(viewVec.xy);
+	float dist = length(view.xy);
 	
 	//normalize view vector
-	viewVec = normalize(viewVec);
+	vec3 viewVec = normalize(view.xyz);
 	
 	//get wave normals
-	vec3 wavef = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0;
-
-	//get detail normals
-	vec3 dcol = texture2D(bumpMap, littleWave.xy).rgb*0.75;
-	dcol += texture2D(bumpMap, littleWave.zw).rgb*1.25;
-
-	//interpolate between big waves and little waves (big waves in deep water)
-	wavef = (wavef + dcol) * 0.5;
-	
-	//crunch normal to range [-1,1]
-	wavef -= vec3(1,1,1);
-	wavef = normalize(wavef);
-   
+	vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
+	vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
+	vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;
 	//get base fresnel components	
 	
-	float df = dot(viewVec,wavef) * fresnelScale + fresnelOffset;
+	vec3 df = vec3(
+					dot(viewVec, wave1),
+					dot(viewVec, (wave2 + wave3) * 0.5),
+					dot(viewVec, wave3)
+				 ) * fresnelScale + fresnelOffset;
+	df *= df;
 		    
 	vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5;
 	
 	float dist2 = dist;
 	dist = max(dist, 5.0);
 	
+	float dmod = sqrt(dist);
+	
+	vec2 dmod_scale = vec2(dmod*dmod, dmod);
+	
 	//get reflected color
-	vec2 refdistort = wavef.xy*dot(normScale, vec3(0.333));
-	vec2 refvec = distort+refdistort/dist;
-	vec4 refcol = texture2D(refTex, refvec);
+	vec2 refdistort1 = wave1.xy*normScale.x;
+	vec2 refvec1 = distort+refdistort1/dmod_scale;
+	vec4 refcol1 = texture2D(refTex, refvec1);
+	
+	vec2 refdistort2 = wave2.xy*normScale.y;
+	vec2 refvec2 = distort+refdistort2/dmod_scale;
+	vec4 refcol2 = texture2D(refTex, refvec2);
+	
+	vec2 refdistort3 = wave3.xy*normScale.z;
+	vec2 refvec3 = distort+refdistort3/dmod_scale;
+	vec4 refcol3 = texture2D(refTex, refvec3);
+
+	vec4 refcol = refcol1 + refcol2 + refcol3;
+	float df1 = df.x + df.y + df.z;
+	refcol *= df1 * 0.333;
+	
+	vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5;
+	
+	wavef.z *= max(-viewVec.z, 0.1);
+	wavef = normalize(wavef);
+	
+	float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset;
+	
+	vec2 refdistort4 = wavef.xy*0.125;
+	refdistort4.y -= abs(refdistort4.y);
+	vec2 refvec4 = distort+refdistort4/dmod;
+	float dweight = min(dist2*blurMultiplier, 1.0);
+	vec4 baseCol = texture2D(refTex, refvec4);
+	refcol = mix(baseCol*df2, refcol, dweight);
 
 	//get specular component
 	float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0);
-	
+		
 	//harden specular
-	spec = pow(spec, lightExp);
+	spec = pow(spec, 128.0);
 
 	//figure out distortion vector (ripply)   
-	vec2 distort2 = distort+wavef.xy*refScale/max(dist*df, 1.0);
+	vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0);
 		
 	vec4 fb = texture2D(screenTex, distort2);
 	
 	//mix with reflection
-	color.rgb = mix(mix(fogCol.rgb, fb.rgb, fogCol.a), refcol.rgb, df);
+	// Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug
+	color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999);
 	color.rgb += spec * specular;
 	
-	//color.rgb = applyWaterFog(color);//atmosTransport(color.rgb);
+	color.rgb = atmosTransport(color.rgb);
 	color.rgb = scaleSoftClip(color.rgb);
 	color.a = spec * sunAngle2;
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index 45bd5c8b424..4bdfce9260c 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -25,20 +25,50 @@
  
 
 
-
+uniform vec4 lightnorm;
+uniform vec4 waterPlane;
 uniform vec4 waterFogColor;
-uniform float waterFogEnd;
+uniform float waterFogDensity;
+uniform float waterFogKS;
+
+vec3 getPositionEye();
 
 vec4 applyWaterFog(vec4 color)
 {
-	// GL_EXP2 Fog
-	//float fog = exp(-gl_Fog.density * gl_Fog.density * fog_depth * fog_depth);
-	// GL_EXP Fog
-	// float fog = exp(-gl_Fog.density * fog_depth);
-	// GL_LINEAR Fog
-	float fog = (waterFogEnd - fog_depth) * gl_Fog.scale;
-	fog = clamp(fog, 0.0, 1.0);
-	color.rgb = mix(waterFogColor.rgb, color.rgb, fog);
+	//normalize view vector
+	vec3 view = normalize(getPositionEye());
+	float es = -(dot(view, waterPlane.xyz));
+
+	//find intersection point with water plane and eye vector
+	
+	//get eye depth
+	float e0 = max(-waterPlane.w, 0.0);
+	
+	vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0);
+	
+	//get object depth
+	float depth = length(getPositionEye() - int_v);
+		
+	//get "thickness" of water
+	float l = max(depth, 0.1);
+
+	float kd = waterFogDensity;
+	float ks = waterFogKS;
+	vec4 kc = waterFogColor;
+	
+	float F = 0.98;
+	
+	float t1 = -kd * pow(F, ks * e0);
+	float t2 = kd + ks * es;
+	float t3 = pow(F, t2*l) - 1.0;
+	
+	float L = min(t1/t2*t3, 1.0);
+	
+	float D = pow(0.98, l*kd);
+	
+	color.rgb = color.rgb * D + kc.rgb * L;
+	color.a = kc.a + color.a;
+	
 	return color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 8274a655db6..735f5b38137 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -22,7 +22,7 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
@@ -30,11 +30,17 @@ out vec4 gl_FragColor;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
-uniform sampler2D diffuseMap;
+vec3 atmosLighting(vec3 light);
+vec3 scaleSoftClip(vec3 light);
 
 void default_lighting() 
 {
-	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+	
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index ec7ec9ae7d5..c3edc0bd708 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -22,18 +22,25 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
-
-uniform sampler2D diffuseMap;
-
+VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+vec3 fullbrightAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
 void fullbright_lighting()
 {
-	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+	
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index d47d1724a74..c981e9eba25 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -22,18 +22,34 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
- 
+
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
 #endif
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
-uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
-VARYING vec2 vary_texcoord0;
+vec3 fullbrightShinyAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
 
-void fullbright_shiny_lighting() 
+void fullbright_shiny_lighting()
 {
-	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
+
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	color.a = max(color.a, vertex_color.a);
+
+	gl_FragColor = color;
 }
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index bd67e2659eb..c10cde98e0d 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -21,18 +21,33 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
-
+ 
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
-#endif 
+#endif
 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
-uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
-VARYING vec2 vary_texcoord0;
+vec3 fullbrightShinyAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+vec4 applyWaterFog(vec4 color);
 
-void fullbright_shiny_lighting_water() 
+void fullbright_shiny_lighting_water()
 {
-	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+	color.a = max(color.a, vertex_color.a);
+
+	gl_FragColor = applyWaterFog(color);
 }
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index 0cf5152661e..2547f9e7505 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -27,12 +27,20 @@
 out vec4 gl_FragColor;
 #endif
 
-uniform sampler2D diffuseMap;
-
+VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+vec4 diffuseLookup(vec2 texcoord);
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
 void fullbright_lighting_water()
 {
-	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	gl_FragColor = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index 761bda487d7..e9c27dbefd5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -29,13 +29,26 @@ out vec4 gl_FragColor;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
-uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
-void shiny_lighting() 
+vec3 scaleSoftClip(vec3 light);
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void shiny_lighting()
 {
-	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+	color.a = max(color.a, vertex_color.a);
 	gl_FragColor = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index 6761d353160..68c727d62c4 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -29,13 +29,23 @@ out vec4 gl_FragColor;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
-uniform sampler2D diffuseMap;
 uniform samplerCube environmentMap;
 
-void shiny_lighting_water() 
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void shiny_lighting_water()
 {
-	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
-	gl_FragColor = color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = atmosLighting(color.rgb);
+	color.a = max(color.a, vertex_color.a);
+	gl_FragColor = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
index 265d548ce9a..24bf9b3cee5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl
@@ -1,5 +1,5 @@
 /** 
- * @file lightV.glsl
+ * @file lightSpecularV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -24,26 +24,13 @@
  */
  
 
-uniform vec4 light_position[8];
-uniform vec3 light_diffuse[8];
-uniform vec4 light_ambient;
 
-float calcDirectionalLight(vec3 n, vec3 l);
+// All lights, no specular highlights
+
+vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
 
-// Same as non-specular lighting in lightV.glsl
 vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
 {
-	specularColor.rgb = vec3(0.0, 0.0, 0.0);
-	vec4 col;
-	col.a = color.a;
-
-	col.rgb = baseCol.rgb + light_ambient.rgb;
-
-	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz);
-	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
-
-	col.rgb = min(col.rgb*color.rgb, 1.0);
-
-	return col;	
+	return sumLightsSpecular(pos, norm, color, specularColor, baseCol);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
index b886f977439..8045809b82c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl
@@ -24,24 +24,13 @@
  */
  
 
-uniform vec4 light_position[8];
-uniform vec3 light_diffuse[8];
-uniform vec4 light_ambient;
 
-float calcDirectionalLight(vec3 n, vec3 l);
+// All lights, no specular highlights
+
+vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight);
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
 {
-	vec4 col;
-	col.a = color.a;
-	
-	col.rgb = baseLight.rgb+light_ambient.rgb;  
-	
-	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz);
-	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
-						
-	col.rgb = min(col.rgb*color.rgb, 1.0);
-	
-	return col;	
+	return sumLights(pos, norm, color, baseLight);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index 2908d774432..e9537d1e9d5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -25,16 +25,20 @@
 
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragColor;
-#endif
- 
+#endif 
+
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
-uniform sampler2D diffuseMap;
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
 
-void default_lighting_water() 
+void default_lighting_water()
 {
-	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
-	gl_FragColor = color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+
+	color.rgb = atmosLighting(color.rgb);
+
+	gl_FragColor = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index 8d1bbf350d4..34bd8d445a0 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -29,9 +29,17 @@ uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
+
+void calcAtmospherics(vec3 inPositionEye);
+
+uniform vec4 origin;
+
+
+
 ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
+void passTextureIndex();
 ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
@@ -39,14 +47,13 @@ VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_texcoord1;
 
 
-void calcAtmospherics(vec3 inPositionEye);
-
-uniform vec4 origin;
-
 void main()
 {
 	//transform vertex
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	vec4 vert = vec4(position.xyz,1.0);
+	passTextureIndex();
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	
 	vec3 norm = normalize(normal_matrix * normal);
 	vec3 ref = reflect(pos.xyz, -norm);
@@ -54,10 +61,7 @@ void main()
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
-	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
 	calcAtmospherics(pos.xyz);
 
 	vertex_color = diffuse_color;
-
-	
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index 8b20c2a860c..fc20d3270e2 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -26,26 +26,30 @@
 uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
-
+ 
 ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
+void passTextureIndex();
 ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+
+
+void calcAtmospherics(vec3 inPositionEye);
+
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
 
-void calcAtmospherics(vec3 inPositionEye);
-
 void main()
 {
 	//transform vertex
-	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	vec4 vert = vec4(position.xyz,1.0);
+	passTextureIndex();
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
-
-
 	calcAtmospherics(pos.xyz);
 
 	vertex_color = diffuse_color;
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index 4ca53a8f302..fdb3453cc58 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file shinyV.glsl
  *
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
@@ -25,17 +25,21 @@
 
 uniform mat3 normal_matrix;
 uniform mat4 texture_matrix0;
+uniform mat4 texture_matrix1;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
+void passTextureIndex();
+ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
-VARYING vec3 vary_texcoord0;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
 
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -44,19 +48,18 @@ uniform vec4 origin;
 void main()
 {
 	//transform vertex
-	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	
+	vec4 vert = vec4(position.xyz,1.0);
+	passTextureIndex();
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+		
 	vec3 norm = normalize(normal_matrix * normal);
+	vec3 ref = reflect(pos.xyz, -norm);
+
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
 
 	calcAtmospherics(pos.xyz);
-	
-	vertex_color = diffuse_color;
-	
-	vec3 ref = reflect(pos.xyz, -norm);
-	
-	vary_texcoord0 = (texture_matrix0*vec4(ref,1.0)).xyz;
-	
-	
-}
 
+	vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));	
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index df9111f941c..37a20383e2c 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -29,28 +29,36 @@ uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
+void passTextureIndex();
+ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
 
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-void calcAtmospherics(vec3 inPositionEye);
-
 void main()
 {
 	//transform vertex
-	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-		
+	vec4 vert = vec4(position.xyz,1.0);
+	passTextureIndex();
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
+	
+	
+	
 	vec3 norm = normalize(normal_matrix * normal);
 
 	calcAtmospherics(pos.xyz);
 
 	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
 	vertex_color = color;
+
+	
 }
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index ed0249330ea..89b6a52909a 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-uniform vec3 light_diffuse[8];
+uniform vec4 sunlight_color;
 uniform vec4 light_ambient;
 
 vec3 atmosAmbient(vec3 light)
@@ -33,12 +33,12 @@ vec3 atmosAmbient(vec3 light)
 
 vec3 atmosAffectDirectionalLight(float lightIntensity)
 {
-	return light_diffuse[0].rgb * lightIntensity;
+	return sunlight_color.rgb * lightIntensity;
 }
 
 vec3 atmosGetDiffuseSunlightColor()
 {
-	return light_diffuse[0].rgb;
+	return sunlight_color.rgb;
 }
 
 vec3 scaleDownLight(vec3 light)
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl
deleted file mode 100644
index 01fe4a4e14d..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @file blurf.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-//NOT USED!!!
-
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
deleted file mode 100644
index b92e9b3f030..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @file blurV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
- // NOT USED!!
-
diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
deleted file mode 100644
index f42497d8bee..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file colorFilterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect RenderTexture;
-uniform float brightness;
-uniform float contrast;
-uniform vec3  contrastBase;
-uniform float saturation;
-uniform vec3  lumWeights;
-
-const float gamma = 2.0;
-
-void main(void) 
-{
-	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
-
-	/// Modulate brightness
-	color *= brightness;
-
-	/// Modulate contrast
-	color = mix(contrastBase, color, contrast);
-
-	/// Modulate saturation
-	color = mix(vec3(dot(color, lumWeights)), color, saturation);
-
-	gl_FragColor = vec4(color, 1.0);
-}
diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
deleted file mode 100644
index f03a6076c08..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @file drawQuadV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
-
-
-void main(void)
-{
-	//transform vertex
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	vary_texcoord0 = texcoord0;
-	vary_texcoord1 = texcoord1;
-}
diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
deleted file mode 100644
index ebf4f28a744..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * @file extractF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect RenderTexture;
-uniform float extractLow;
-uniform float extractHigh;
-uniform vec3 lumWeights;
-
-void main(void) 
-{
-	/// Get scene color
-	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
-	
-	/// Extract luminance and scale up by night vision brightness
-	float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights));
-
-	gl_FragColor = vec4(vec3(lum), 1.0);
-}
diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
deleted file mode 100644
index 2bfcfad0813..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * @file nightVisionF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect RenderTexture;
-uniform sampler2D NoiseTexture;
-uniform float brightMult;
-uniform float noiseStrength;
-
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-
-float luminance(vec3 color)
-{
-	/// CALCULATING LUMINANCE (Using NTSC lum weights)
-	/// http://en.wikipedia.org/wiki/Luma_%28video%29
-	return dot(color, vec3(0.299, 0.587, 0.114));
-}
-
-void main(void) 
-{
-	/// Get scene color
-	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
-	
-	/// Extract luminance and scale up by night vision brightness
-	float lum = luminance(color) * brightMult;
-
-	/// Convert into night vision color space
-	/// Newer NVG colors (crisper and more saturated)
-	vec3 outColor = (lum * vec3(0.91, 1.21, 0.9)) + vec3(-0.07, 0.1, -0.12); 
-
-	/// Add noise
-	float noiseValue = texture2D(NoiseTexture, vary_texcoord1.st).r;
-	noiseValue = (noiseValue - 0.5) * noiseStrength;
-
-	/// Older NVG colors (more muted)
-	// vec3 outColor = (lum * vec3(0.82, 0.75, 0.83)) + vec3(0.05, 0.32, -0.11); 
-	
-	outColor += noiseValue;
-
-	gl_FragColor = vec4(outColor, 1.0);
-}
diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
deleted file mode 100644
index 932bd871526..00000000000
--- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @file simpleF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect RenderTexture;
-
-VARYING vec2 vary_texcoord0;
-
-void main(void) 
-{
-	vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st));
-	gl_FragColor = vec4(1.0 - color, 1.0);
-}
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
deleted file mode 100644
index 18f6d91804d..00000000000
--- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * @file terrainF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
-
-uniform sampler2D detail_0;
-uniform sampler2D detail_1;
-uniform sampler2D detail_2;
-uniform sampler2D detail_3;
-uniform sampler2D alpha_ramp;
-
-vec3 atmosLighting(vec3 light);
-
-vec3 scaleSoftClip(vec3 color);
-
-void main()
-{
-	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
-	
-	/// TODO Confirm tex coords and bind them appropriately in vert shader.
-	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
-	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
-	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
-	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
-
-	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
-	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
-	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
-	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
-	
-	/// Add WL Components
-	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
-	
-	gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
deleted file mode 100644
index f183b885d19..00000000000
--- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file terrainV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat3 normal_matrix;
-uniform mat4 texture_matrix0;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
-
-uniform vec4 object_plane_t;
-uniform vec4 object_plane_s;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
-
-VARYING vec4 vertex_color;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
-
-void calcAtmospherics(vec3 inPositionEye);
-
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-
-vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
-{
-	vec4 tcoord;
-	
-	tcoord.x = dot(vpos, tp0);
-	tcoord.y = dot(vpos, tp1);
-	tcoord.z = tc.z;
-	tcoord.w = tc.w;
-	
-	tcoord = mat * tcoord; 
-	
-	return tcoord; 
-}
-
-void main()
-{
-	//transform vertex
-	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-
-	vec4 pos = modelview_matrix * vec4(position.xyz, 1.0);
-	vec3 norm = normalize(normal_matrix * normal);
-
-	calcAtmospherics(pos.xyz);
-
-	/// Potentially better without it for water.
-	pos /= pos.w;
-
-	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
-	
-	vertex_color = color;
-
-	// Transform and pass tex coords
- 	vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;
-	
-	vec4 t = vec4(texcoord1,0,1);
-	
-	vary_texcoord0.zw = t.xy;
-	vary_texcoord1.xy = t.xy-vec2(2.0, 0.0);
-	vary_texcoord1.zw = t.xy-vec2(1.0, 0.0);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
deleted file mode 100644
index e5c7ced52c0..00000000000
--- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file terrainWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
-
-uniform sampler2D detail_0;
-uniform sampler2D detail_1;
-uniform sampler2D detail_2;
-uniform sampler2D detail_3;
-uniform sampler2D alpha_ramp;
-
-vec3 atmosLighting(vec3 light);
-
-vec4 applyWaterFog(vec4 color);
-
-void main()
-{
-	/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
-	
-	/// TODO Confirm tex coords and bind them appropriately in vert shader.
-	vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
-	vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
-	vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
-	vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
-
-	float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
-	float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
-	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
-	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
-	
-	/// Add WL Components
-	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
-	
-	outColor = applyWaterFog(outColor);
-	gl_FragColor = outColor;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
deleted file mode 100644
index 1fdb90f7926..00000000000
--- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * @file underWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2D diffuseMap;
-uniform sampler2D bumpMap;   
-uniform sampler2D screenTex;
-uniform sampler2D refTex;
-uniform sampler2D screenDepth;
-
-uniform vec4 fogCol;
-uniform vec3 lightDir;
-uniform vec3 specular;
-uniform float lightExp;
-uniform vec2 fbScale;
-uniform float refScale;
-uniform float znear;
-uniform float zfar;
-uniform float kd;
-uniform vec4 waterPlane;
-uniform vec3 eyeVec;
-uniform vec4 waterFogColor;
-uniform float waterFogDensity;
-uniform float waterFogKS;
-uniform vec2 screenRes;
-
-//bigWave is (refCoord.w, view.w);
-VARYING vec4 refCoord;
-VARYING vec4 littleWave;
-VARYING vec4 view;
-
-vec4 applyWaterFog(vec4 color, vec3 viewVec)
-{
-	//normalize view vector
-	vec3 view = normalize(viewVec);
-	float es = -view.z;
-
-	//find intersection point with water plane and eye vector
-	
-	//get eye depth
-	float e0 = max(-waterPlane.w, 0.0);
-	
-	//get object depth
-	float depth = length(viewVec);
-		
-	//get "thickness" of water
-	float l = max(depth, 0.1);
-
-	float kd = waterFogDensity;
-	float ks = waterFogKS;
-	vec4 kc = waterFogColor;
-	
-	float F = 0.98;
-	
-	float t1 = -kd * pow(F, ks * e0);
-	float t2 = kd + ks * es;
-	float t3 = pow(F, t2*l) - 1.0;
-	
-	float L = min(t1/t2*t3, 1.0);
-	
-	float D = pow(0.98, l*kd);
-	//return vec4(1.0, 0.0, 1.0, 1.0);
-	return color * D + kc * L;
-	//depth /= 10.0;
-	//return vec4(depth,depth,depth,0.0);
-}
-
-void main() 
-{
-	vec4 color;
-	    
-	//get detail normals
-	vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
-	vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
-	vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;    
-	vec3 wavef = normalize(wave1+wave2+wave3);
-	
-	//figure out distortion vector (ripply)   
-	vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5;
-	distort = distort+wavef.xy*refScale;
-		
-	vec4 fb = texture2D(screenTex, distort);
-	
-	gl_FragColor = applyWaterFog(fb,view.xyz);
-}
diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
deleted file mode 100644
index 444c896d388..00000000000
--- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
+++ /dev/null
@@ -1,139 +0,0 @@
-/** 
- * @file waterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-vec3 scaleSoftClip(vec3 inColor);
-vec3 atmosTransport(vec3 inColor);
-
-uniform sampler2D bumpMap;   
-uniform sampler2D screenTex;
-uniform sampler2D refTex;
-
-uniform float sunAngle;
-uniform float sunAngle2;
-uniform vec3 lightDir;
-uniform vec3 specular;
-uniform float lightExp;
-uniform float refScale;
-uniform float kd;
-uniform vec2 screenRes;
-uniform vec3 normScale;
-uniform float fresnelScale;
-uniform float fresnelOffset;
-uniform float blurMultiplier;
-
-
-//bigWave is (refCoord.w, view.w);
-VARYING vec4 refCoord;
-VARYING vec4 littleWave;
-VARYING vec4 view;
-
-void main() 
-{
-	vec4 color;
-	
-	float dist = length(view.xy);
-	
-	//normalize view vector
-	vec3 viewVec = normalize(view.xyz);
-	
-	//get wave normals
-	vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
-	vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
-	vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;
-	//get base fresnel components	
-	
-	vec3 df = vec3(
-					dot(viewVec, wave1),
-					dot(viewVec, (wave2 + wave3) * 0.5),
-					dot(viewVec, wave3)
-				 ) * fresnelScale + fresnelOffset;
-	df *= df;
-		    
-	vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5;
-	
-	float dist2 = dist;
-	dist = max(dist, 5.0);
-	
-	float dmod = sqrt(dist);
-	
-	vec2 dmod_scale = vec2(dmod*dmod, dmod);
-	
-	//get reflected color
-	vec2 refdistort1 = wave1.xy*normScale.x;
-	vec2 refvec1 = distort+refdistort1/dmod_scale;
-	vec4 refcol1 = texture2D(refTex, refvec1);
-	
-	vec2 refdistort2 = wave2.xy*normScale.y;
-	vec2 refvec2 = distort+refdistort2/dmod_scale;
-	vec4 refcol2 = texture2D(refTex, refvec2);
-	
-	vec2 refdistort3 = wave3.xy*normScale.z;
-	vec2 refvec3 = distort+refdistort3/dmod_scale;
-	vec4 refcol3 = texture2D(refTex, refvec3);
-
-	vec4 refcol = refcol1 + refcol2 + refcol3;
-	float df1 = df.x + df.y + df.z;
-	refcol *= df1 * 0.333;
-	
-	vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5;
-	
-	wavef.z *= max(-viewVec.z, 0.1);
-	wavef = normalize(wavef);
-	
-	float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset;
-	
-	vec2 refdistort4 = wavef.xy*0.125;
-	refdistort4.y -= abs(refdistort4.y);
-	vec2 refvec4 = distort+refdistort4/dmod;
-	float dweight = min(dist2*blurMultiplier, 1.0);
-	vec4 baseCol = texture2D(refTex, refvec4);
-	refcol = mix(baseCol*df2, refcol, dweight);
-
-	//get specular component
-	float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0);
-		
-	//harden specular
-	spec = pow(spec, 128.0);
-
-	//figure out distortion vector (ripply)   
-	vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0);
-		
-	vec4 fb = texture2D(screenTex, distort2);
-	
-	//mix with reflection
-	// Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug
-	color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999);
-	color.rgb += spec * specular;
-	
-	color.rgb = atmosTransport(color.rgb);
-	color.rgb = scaleSoftClip(color.rgb);
-	color.a = spec * sunAngle2;
-
-	gl_FragColor = color;
-}
diff --git a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl
deleted file mode 100644
index 4bdfce9260c..00000000000
--- a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * @file waterFogF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-uniform vec4 lightnorm;
-uniform vec4 waterPlane;
-uniform vec4 waterFogColor;
-uniform float waterFogDensity;
-uniform float waterFogKS;
-
-vec3 getPositionEye();
-
-vec4 applyWaterFog(vec4 color)
-{
-	//normalize view vector
-	vec3 view = normalize(getPositionEye());
-	float es = -(dot(view, waterPlane.xyz));
-
-	//find intersection point with water plane and eye vector
-	
-	//get eye depth
-	float e0 = max(-waterPlane.w, 0.0);
-	
-	vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0);
-	
-	//get object depth
-	float depth = length(getPositionEye() - int_v);
-		
-	//get "thickness" of water
-	float l = max(depth, 0.1);
-
-	float kd = waterFogDensity;
-	float ks = waterFogKS;
-	vec4 kc = waterFogColor;
-	
-	float F = 0.98;
-	
-	float t1 = -kd * pow(F, ks * e0);
-	float t2 = kd + ks * es;
-	float t3 = pow(F, t2*l) - 1.0;
-	
-	float L = min(t1/t2*t3, 1.0);
-	
-	float D = pow(0.98, l*kd);
-	
-	color.rgb = color.rgb * D + kc.rgb * L;
-	color.a = kc.a + color.a;
-	
-	return color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
deleted file mode 100644
index 6815f7aa85a..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl
+++ /dev/null
@@ -1,54 +0,0 @@
-/** 
- * @file lightAlphaMaskF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-vec3 atmosLighting(vec3 light);
-vec3 scaleSoftClip(vec3 light);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void default_lighting() 
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = atmosLighting(color.rgb);
-
-	color.rgb = scaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
deleted file mode 100644
index 2640668d7dc..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl
+++ /dev/null
@@ -1,57 +0,0 @@
-/** 
- * @file lightAlphaMaskNonIndexedF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-
-uniform sampler2D diffuseMap;
-
-vec3 atmosLighting(vec3 light);
-vec3 scaleSoftClip(vec3 light);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void default_lighting() 
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
-
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = atmosLighting(color.rgb);
-
-	color.rgb = scaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
deleted file mode 100644
index 735f5b38137..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl
+++ /dev/null
@@ -1,46 +0,0 @@
-/** 
- * @file lightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-vec3 atmosLighting(vec3 light);
-vec3 scaleSoftClip(vec3 light);
-
-void default_lighting() 
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-	
-	color.rgb = atmosLighting(color.rgb);
-
-	color.rgb = scaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
deleted file mode 100644
index 92113d9afa6..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl
+++ /dev/null
@@ -1,54 +0,0 @@
-/** 
- * @file lightFullbrightAlphaMaskF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void fullbright_lighting()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
deleted file mode 100644
index c3edc0bd708..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl
+++ /dev/null
@@ -1,46 +0,0 @@
-/** 
- * @file lightFullbrightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-void fullbright_lighting()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-	
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
deleted file mode 100644
index d1ad3da0096..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ /dev/null
@@ -1,56 +0,0 @@
-/** 
- * @file lightFullbrightNonIndexedAlphaMaskF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-uniform sampler2D diffuseMap;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void fullbright_lighting()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
-	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
deleted file mode 100644
index 4e1e664e6b5..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl
+++ /dev/null
@@ -1,48 +0,0 @@
-/** 
- * @file lightFullbrightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-uniform sampler2D diffuseMap;
-
-void fullbright_lighting()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
-	
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
deleted file mode 100644
index c981e9eba25..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-/** 
- * @file lightFullbrightShinyF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-
-vec3 fullbrightShinyAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-void fullbright_shiny_lighting()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
-
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
-	color.a = max(color.a, vertex_color.a);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
deleted file mode 100644
index a4893f03599..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl
+++ /dev/null
@@ -1,56 +0,0 @@
-/** 
- * @file lightFullbrightShinyF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-uniform sampler2D diffuseMap;
-
-vec3 fullbrightShinyAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-void fullbright_shiny_lighting()
-{
-	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
-
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
-	color.a = max(color.a, vertex_color.a);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
deleted file mode 100644
index c10cde98e0d..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
+++ /dev/null
@@ -1,53 +0,0 @@
-/** 
- * @file lightFullbrightShinyWaterF.glsl
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-
-vec3 fullbrightShinyAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void fullbright_shiny_lighting_water()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-	color.a = max(color.a, vertex_color.a);
-
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
deleted file mode 100644
index e9b26087f46..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
+++ /dev/null
@@ -1,54 +0,0 @@
-/** 
- * @file lightFullbrightShinyWaterF.glsl
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-uniform sampler2D diffuseMap;
-
-vec3 fullbrightShinyAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void fullbright_shiny_lighting_water()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
-	color.rgb = fullbrightScaleSoftClip(color.rgb);
-	color.a = max(color.a, vertex_color.a);
-
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
deleted file mode 100644
index 32a1c71099b..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ /dev/null
@@ -1,54 +0,0 @@
-/** 
- * @file lightFullbrightWaterAlphaMaskF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-vec4 diffuseLookup(vec2 texcoord);
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void fullbright_lighting_water()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
deleted file mode 100644
index 2547f9e7505..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl
+++ /dev/null
@@ -1,46 +0,0 @@
-/** 
- * @file lightFullbrightWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-vec4 diffuseLookup(vec2 texcoord);
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void fullbright_lighting_water()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
deleted file mode 100644
index 1b5aa614413..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ /dev/null
@@ -1,54 +0,0 @@
-/** 
- * @file lightFullbrightWaterNonIndexedAlphaMaskF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-uniform sampler2D diffuseMap;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void fullbright_lighting_water()
-{
-	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
-
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
deleted file mode 100644
index aa3ef8cdd91..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl
+++ /dev/null
@@ -1,46 +0,0 @@
-/** 
- * @file lightFullbrightWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-uniform sampler2D diffuseMap;
-
-vec3 fullbrightAtmosTransport(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void fullbright_lighting_water()
-{
-	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
-
-	color.rgb = fullbrightAtmosTransport(color.rgb);
-	
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
deleted file mode 100644
index 9f1a358b538..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl
+++ /dev/null
@@ -1,48 +0,0 @@
-/** 
- * @file lightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
- 
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-uniform sampler2D diffuseMap;
-
-vec3 atmosLighting(vec3 light);
-vec3 scaleSoftClip(vec3 light);
-
-void default_lighting() 
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
-	
-	color.rgb = atmosLighting(color.rgb);
-
-	color.rgb = scaleSoftClip(color.rgb);
-
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
deleted file mode 100644
index e9c27dbefd5..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl
+++ /dev/null
@@ -1,54 +0,0 @@
-/** 
- * @file lightShinyF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-
-vec3 scaleSoftClip(vec3 light);
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void shiny_lighting()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = atmosLighting(color.rgb);
-
-	color.rgb = scaleSoftClip(color.rgb);
-	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
deleted file mode 100644
index 595ad743650..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-/** 
- * @file lightShinyF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
- 
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-uniform sampler2D diffuseMap;
-
-vec3 scaleSoftClip(vec3 light);
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void shiny_lighting()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = atmosLighting(color.rgb);
-
-	color.rgb = scaleSoftClip(color.rgb);
-	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
deleted file mode 100644
index 68c727d62c4..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl
+++ /dev/null
@@ -1,51 +0,0 @@
-/** 
- * @file lightShinyWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform samplerCube environmentMap;
-
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void shiny_lighting_water()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = atmosLighting(color.rgb);
-	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
deleted file mode 100644
index f32b9e1958b..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-/** 
- * @file lightShinyWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-uniform sampler2D diffuseMap;
-uniform samplerCube environmentMap;
-
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void shiny_lighting_water()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
-	color.rgb *= vertex_color.rgb;
-	
-	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
-	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
-
-	color.rgb = atmosLighting(color.rgb);
-	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl
deleted file mode 100644
index 24bf9b3cee5..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl
+++ /dev/null
@@ -1,36 +0,0 @@
-/** 
- * @file lightSpecularV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-// All lights, no specular highlights
-
-vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
-
-vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
-{
-	return sumLightsSpecular(pos, norm, color, specularColor, baseCol);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl
deleted file mode 100644
index 8045809b82c..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl
+++ /dev/null
@@ -1,36 +0,0 @@
-/** 
- * @file lightV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-
-// All lights, no specular highlights
-
-vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight);
-
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
-{
-	return sumLights(pos, norm, color, baseLight);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
deleted file mode 100644
index 60289cf7f77..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-/** 
- * @file lightWaterAlphaMaskF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void default_lighting_water()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = atmosLighting(color.rgb);
-
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
deleted file mode 100644
index d0038ae89bc..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ /dev/null
@@ -1,56 +0,0 @@
-/** 
- * @file lightWaterAlphaMaskNonIndexedF.glsl
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform float minimum_alpha;
-uniform float maximum_alpha;
-
-uniform sampler2D diffuseMap;
-
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void default_lighting_water()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
-
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
-	{
-		discard;
-	}
-
-	color.rgb = atmosLighting(color.rgb);
-
-	color = applyWaterFog(color);
-	
-	gl_FragColor = color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
deleted file mode 100644
index e9537d1e9d5..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl
+++ /dev/null
@@ -1,44 +0,0 @@
-/** 
- * @file lightWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif 
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void default_lighting_water()
-{
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
-
-	color.rgb = atmosLighting(color.rgb);
-
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
deleted file mode 100644
index 8b0c25b7053..00000000000
--- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl
+++ /dev/null
@@ -1,46 +0,0 @@
-/** 
- * @file lightWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-uniform sampler2D diffuseMap;
-
-vec3 atmosLighting(vec3 light);
-vec4 applyWaterFog(vec4 color);
-
-void default_lighting_water()
-{
-	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
-
-	color.rgb = atmosLighting(color.rgb);
-
-	gl_FragColor = applyWaterFog(color);
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
deleted file mode 100644
index 34bd8d445a0..00000000000
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * @file fullbrightShinyV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat3 normal_matrix;
-uniform mat4 texture_matrix0;
-uniform mat4 texture_matrix1;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
-
-
-void calcAtmospherics(vec3 inPositionEye);
-
-uniform vec4 origin;
-
-
-
-ATTRIBUTE vec3 position;
-void passTextureIndex();
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-
-void main()
-{
-	//transform vertex
-	vec4 vert = vec4(position.xyz,1.0);
-	passTextureIndex();
-	vec4 pos = (modelview_matrix * vert);
-	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	
-	vec3 norm = normalize(normal_matrix * normal);
-	vec3 ref = reflect(pos.xyz, -norm);
-
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
-
-	calcAtmospherics(pos.xyz);
-
-	vertex_color = diffuse_color;
-}
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
deleted file mode 100644
index fc20d3270e2..00000000000
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file fullbrightV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 texture_matrix0;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
- 
-ATTRIBUTE vec3 position;
-void passTextureIndex();
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-
-
-void calcAtmospherics(vec3 inPositionEye);
-
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-
-void main()
-{
-	//transform vertex
-	vec4 vert = vec4(position.xyz,1.0);
-	passTextureIndex();
-	vec4 pos = (modelview_matrix * vert);
-	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-	
-	calcAtmospherics(pos.xyz);
-
-	vertex_color = diffuse_color;
-
-	
-}
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
deleted file mode 100644
index fdb3453cc58..00000000000
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file shinyV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat3 normal_matrix;
-uniform mat4 texture_matrix0;
-uniform mat4 texture_matrix1;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-void passTextureIndex();
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-
-void calcAtmospherics(vec3 inPositionEye);
-
-uniform vec4 origin;
-
-void main()
-{
-	//transform vertex
-	vec4 vert = vec4(position.xyz,1.0);
-	passTextureIndex();
-	vec4 pos = (modelview_matrix * vert);
-	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-		
-	vec3 norm = normalize(normal_matrix * normal);
-	vec3 ref = reflect(pos.xyz, -norm);
-
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
-
-	calcAtmospherics(pos.xyz);
-
-	vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));	
-}
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
deleted file mode 100644
index cb80697d154..00000000000
--- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl
+++ /dev/null
@@ -1,61 +0,0 @@
-/** 
- * @file simpleNonIndexedV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat3 normal_matrix;
-uniform mat4 texture_matrix0;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-void calcAtmospherics(vec3 inPositionEye);
-
-void main()
-{
-	//transform vertex
-	vec4 vert = vec4(position.xyz,1.0);
-	
-	gl_Position = modelview_projection_matrix*vert;
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
-	
-	vec4 pos = (modelview_matrix * vert);
-	
-	vec3 norm = normalize(normal_matrix * normal);
-
-	calcAtmospherics(pos.xyz);
-
-	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-	vertex_color = color;
-
-	
-}
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
deleted file mode 100644
index 37a20383e2c..00000000000
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ /dev/null
@@ -1,64 +0,0 @@
-/** 
- * @file simpleV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat3 normal_matrix;
-uniform mat4 texture_matrix0;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-void passTextureIndex();
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-void calcAtmospherics(vec3 inPositionEye);
-
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-
-void main()
-{
-	//transform vertex
-	vec4 vert = vec4(position.xyz,1.0);
-	passTextureIndex();
-	vec4 pos = (modelview_matrix * vert);
-	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
-	
-	
-	
-	vec3 norm = normalize(normal_matrix * normal);
-
-	calcAtmospherics(pos.xyz);
-
-	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
-	vertex_color = color;
-
-	
-}
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 563a63287e5..9fb804a74f3 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -608,7 +608,6 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
-	gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 6af9e464df0..8e59a7c32db 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -561,11 +561,7 @@ void LLViewerShaderMgr::setShaders()
 			wl_class = 1;
 		}
 
-		if(!gSavedSettings.getBOOL("EnableRippleWater"))
-		{
-			water_class = 0;
-		}
-
+		
 		// Trigger a full rebuild of the fallback skybox / cubemap if we've toggled windlight shaders
 		if (mVertexShaderLevel[SHADER_WINDLIGHT] != wl_class && gSky.mVOSkyp.notNull())
 		{
@@ -1087,51 +1083,6 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
 		}
 	}
 	
-#if 0
-	// disabling loading of postprocess shaders until we fix
-	// ATI sampler2DRect compatibility.
-	
-	//load Color Filter Shader
-	if (success)
-	{
-		vector<string> shaderUniforms;
-		shaderUniforms.reserve(7);
-		shaderUniforms.push_back("RenderTexture");
-		shaderUniforms.push_back("gamma");
-		shaderUniforms.push_back("brightness");
-		shaderUniforms.push_back("contrast");
-		shaderUniforms.push_back("contrastBase");
-		shaderUniforms.push_back("saturation");
-		shaderUniforms.push_back("lumWeights");
-
-		gPostColorFilterProgram.mName = "Color Filter Shader (Post)";
-		gPostColorFilterProgram.mShaderFiles.clear();
-		gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/colorFilterF.glsl", GL_FRAGMENT_SHADER_ARB));
-		gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
-		gPostColorFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
-		success = gPostColorFilterProgram.createShader(NULL, &shaderUniforms);
-	}
-
-	//load Night Vision Shader
-	if (success)
-	{
-		vector<string> shaderUniforms;
-		shaderUniforms.reserve(5);
-		shaderUniforms.push_back("RenderTexture");
-		shaderUniforms.push_back("NoiseTexture");
-		shaderUniforms.push_back("brightMult");
-		shaderUniforms.push_back("noiseStrength");
-		shaderUniforms.push_back("lumWeights");
-
-		gPostNightVisionProgram.mName = "Night Vision Shader (Post)";
-		gPostNightVisionProgram.mShaderFiles.clear();
-		gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/nightVisionF.glsl", GL_FRAGMENT_SHADER_ARB));
-		gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
-		gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
-		success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms);
-	}
-	#endif
-
 	return success;
 
 }
-- 
GitLab


From 8882d93de40cf3f7771e5ad1bfc6aefd47bd469d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 19:34:27 -0500
Subject: [PATCH 074/933] SH-2507 Potential fix for basic shaders causing
 objects to disappear with some drivers (prune shader tree of unused shaders
 while we're at it)

---
 .../class1/lighting/lightAlphaMaskF.glsl      | 54 ++++++++++++++++
 .../lighting/lightAlphaMaskNonIndexedF.glsl   | 57 +++++++++++++++++
 .../lighting/lightFullbrightAlphaMaskF.glsl   | 54 ++++++++++++++++
 .../lightFullbrightNonIndexedAlphaMaskF.glsl  | 56 +++++++++++++++++
 .../lighting/lightFullbrightNonIndexedF.glsl  | 48 +++++++++++++++
 .../lightFullbrightShinyNonIndexedF.glsl      | 56 +++++++++++++++++
 .../lightFullbrightShinyWaterNonIndexedF.glsl | 54 ++++++++++++++++
 .../lightFullbrightWaterAlphaMaskF.glsl       | 54 ++++++++++++++++
 ...htFullbrightWaterNonIndexedAlphaMaskF.glsl | 54 ++++++++++++++++
 .../lightFullbrightWaterNonIndexedF.glsl      | 46 ++++++++++++++
 .../class1/lighting/lightNonIndexedF.glsl     | 48 +++++++++++++++
 .../lighting/lightShinyNonIndexedF.glsl       | 55 +++++++++++++++++
 .../lighting/lightShinyWaterNonIndexedF.glsl  | 52 ++++++++++++++++
 .../class1/lighting/lightWaterAlphaMaskF.glsl | 52 ++++++++++++++++
 .../lightWaterAlphaMaskNonIndexedF.glsl       | 56 +++++++++++++++++
 .../lighting/lightWaterNonIndexedF.glsl       | 46 ++++++++++++++
 .../class1/objects/indexedTextureF.glsl       | 33 ++++++++++
 .../class1/objects/simpleNonIndexedV.glsl     | 61 +++++++++++++++++++
 18 files changed, 936 insertions(+)
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/indexedTextureF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl

diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
new file mode 100644
index 00000000000..6815f7aa85a
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
@@ -0,0 +1,54 @@
+/** 
+ * @file lightAlphaMaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+vec3 atmosLighting(vec3 light);
+vec3 scaleSoftClip(vec3 light);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void default_lighting() 
+{
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+	
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
new file mode 100644
index 00000000000..2640668d7dc
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -0,0 +1,57 @@
+/** 
+ * @file lightAlphaMaskNonIndexedF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+
+uniform sampler2D diffuseMap;
+
+vec3 atmosLighting(vec3 light);
+vec3 scaleSoftClip(vec3 light);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void default_lighting() 
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
new file mode 100644
index 00000000000..92113d9afa6
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -0,0 +1,54 @@
+/** 
+ * @file lightFullbrightAlphaMaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void fullbright_lighting()
+{
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+	
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
new file mode 100644
index 00000000000..d1ad3da0096
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -0,0 +1,56 @@
+/** 
+ * @file lightFullbrightNonIndexedAlphaMaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
+uniform sampler2D diffuseMap;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void fullbright_lighting()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+	
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
new file mode 100644
index 00000000000..4e1e664e6b5
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
@@ -0,0 +1,48 @@
+/** 
+ * @file lightFullbrightF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
+uniform sampler2D diffuseMap;
+
+void fullbright_lighting()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+	
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
new file mode 100644
index 00000000000..a4893f03599
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
@@ -0,0 +1,56 @@
+/** 
+ * @file lightFullbrightShinyF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+
+uniform samplerCube environmentMap;
+uniform sampler2D diffuseMap;
+
+vec3 fullbrightShinyAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
+void fullbright_shiny_lighting()
+{
+	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
+
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
+	color.a = max(color.a, vertex_color.a);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
new file mode 100644
index 00000000000..e9b26087f46
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
@@ -0,0 +1,54 @@
+/** 
+ * @file lightFullbrightShinyWaterF.glsl
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+
+uniform samplerCube environmentMap;
+uniform sampler2D diffuseMap;
+
+vec3 fullbrightShinyAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void fullbright_shiny_lighting_water()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
+	color.rgb = fullbrightScaleSoftClip(color.rgb);
+	color.a = max(color.a, vertex_color.a);
+
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
new file mode 100644
index 00000000000..32a1c71099b
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -0,0 +1,54 @@
+/** 
+ * @file lightFullbrightWaterAlphaMaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+vec4 diffuseLookup(vec2 texcoord);
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void fullbright_lighting_water()
+{
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
new file mode 100644
index 00000000000..1b5aa614413
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -0,0 +1,54 @@
+/** 
+ * @file lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+uniform sampler2D diffuseMap;
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void fullbright_lighting_water()
+{
+	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
+
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
new file mode 100644
index 00000000000..aa3ef8cdd91
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
@@ -0,0 +1,46 @@
+/** 
+ * @file lightFullbrightWaterF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+uniform sampler2D diffuseMap;
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void fullbright_lighting_water()
+{
+	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
+
+	color.rgb = fullbrightAtmosTransport(color.rgb);
+	
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
new file mode 100644
index 00000000000..9f1a358b538
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
@@ -0,0 +1,48 @@
+/** 
+ * @file lightF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+ 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+uniform sampler2D diffuseMap;
+
+vec3 atmosLighting(vec3 light);
+vec3 scaleSoftClip(vec3 light);
+
+void default_lighting() 
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+	
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
new file mode 100644
index 00000000000..595ad743650
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
@@ -0,0 +1,55 @@
+/** 
+ * @file lightShinyF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+ 
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+
+uniform samplerCube environmentMap;
+uniform sampler2D diffuseMap;
+
+vec3 scaleSoftClip(vec3 light);
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void shiny_lighting()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = atmosLighting(color.rgb);
+
+	color.rgb = scaleSoftClip(color.rgb);
+	color.a = max(color.a, vertex_color.a);
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
new file mode 100644
index 00000000000..f32b9e1958b
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
@@ -0,0 +1,52 @@
+/** 
+ * @file lightShinyWaterF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+
+uniform sampler2D diffuseMap;
+uniform samplerCube environmentMap;
+
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void shiny_lighting_water()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+	color.rgb *= vertex_color.rgb;
+	
+	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
+	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
+
+	color.rgb = atmosLighting(color.rgb);
+	color.a = max(color.a, vertex_color.a);
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
new file mode 100644
index 00000000000..60289cf7f77
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
@@ -0,0 +1,52 @@
+/** 
+ * @file lightWaterAlphaMaskF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void default_lighting_water()
+{
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = atmosLighting(color.rgb);
+
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
new file mode 100644
index 00000000000..d0038ae89bc
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -0,0 +1,56 @@
+/** 
+ * @file lightWaterAlphaMaskNonIndexedF.glsl
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+uniform sampler2D diffuseMap;
+
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+void default_lighting_water()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+
+	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	{
+		discard;
+	}
+
+	color.rgb = atmosLighting(color.rgb);
+
+	color = applyWaterFog(color);
+	
+	gl_FragColor = color;
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
new file mode 100644
index 00000000000..8b0c25b7053
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
@@ -0,0 +1,46 @@
+/** 
+ * @file lightWaterF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+uniform sampler2D diffuseMap;
+
+vec3 atmosLighting(vec3 light);
+vec4 applyWaterFog(vec4 color);
+
+void default_lighting_water()
+{
+	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+
+	color.rgb = atmosLighting(color.rgb);
+
+	gl_FragColor = applyWaterFog(color);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureF.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureF.glsl
new file mode 100644
index 00000000000..254c1d4fc29
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureF.glsl
@@ -0,0 +1,33 @@
+/** 
+ * @file fullbrightF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+ 
+
+
+void main() 
+{
+	fullbright_lighting();
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl
new file mode 100644
index 00000000000..cb80697d154
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl
@@ -0,0 +1,61 @@
+/** 
+ * @file simpleNonIndexedV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
+void main()
+{
+	//transform vertex
+	vec4 vert = vec4(position.xyz,1.0);
+	
+	gl_Position = modelview_projection_matrix*vert;
+	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
+	
+	vec4 pos = (modelview_matrix * vert);
+	
+	vec3 norm = normalize(normal_matrix * normal);
+
+	calcAtmospherics(pos.xyz);
+
+	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+	vertex_color = color;
+
+	
+}
-- 
GitLab


From 97a86da85e2a83441f17208091b4b3b9ce6f6337 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 19:42:34 -0500
Subject: [PATCH 075/933] SH-2416 Make automatic alpha mask detection on by
 default

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index cd5218c56d1..1b781ec3d43 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8605,7 +8605,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
     <key>RenderAutoMaskAlphaDeferred</key>
     <map>
-- 
GitLab


From 754ce2be40ed53e8f925c21879305c9749adeb0d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 20:20:56 -0500
Subject: [PATCH 076/933] SH-2477 Integrate Tofu's FXAA edge threshold tweaks

---
 doc/contributions.txt                                         | 1 +
 .../app_settings/shaders/class1/deferred/postDeferredF.glsl   | 4 ++--
 .../shaders/class1/deferred/postDeferredNoDoFF.glsl           | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index bcdc5a63d21..01dd7a07358 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1097,6 +1097,7 @@ Tofu Buzzard
 	CTS-411
 	STORM-546
 	VWR-24509
+	SH-2477
 Tony Kembia
 Torben Trautman
 TouchaHoney Perhaps
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index fb574359ac6..7588073a9cb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -2217,8 +2217,8 @@ void main()
 										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
 										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
 										0.75,						//fxaaQualitySubpix
-										0.166,						//fxaaQualityEdgeThreshold
-										0.0833,						//fxaaQualityEdgeThresholdMin
+										0.07,						//fxaaQualityEdgeThreshold
+										0.03,						//fxaaQualityEdgeThresholdMin
 										8.0,						//fxaaConsoleEdgeSharpness
 										0.125,						//fxaaConsoleEdgeThreshold
 										0.05,						//fxaaConsoleEdgeThresholdMin
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index 066dfba5d92..1f1057d8f75 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -2102,8 +2102,8 @@ void main()
 										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
 										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
 										0.75,						//fxaaQualitySubpix
-										0.166,						//fxaaQualityEdgeThreshold
-										0.0833,						//fxaaQualityEdgeThresholdMin
+										0.07,						//fxaaQualityEdgeThreshold
+										0.03,						//fxaaQualityEdgeThresholdMin
 										8.0,						//fxaaConsoleEdgeSharpness
 										0.125,						//fxaaConsoleEdgeThreshold
 										0.05,						//fxaaConsoleEdgeThresholdMin
-- 
GitLab


From eadb745c593900ce50d3e081b365a073f21cb421 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 23:03:20 -0500
Subject: [PATCH 077/933] SH-2465 Move FXAA to its own pass independent of DoF
 (also removes the need to reload shaders when toggling FSAA on and off)

---
 .../class1/deferred/postDeferredF.glsl        | 2099 +----------------
 .../class1/deferred/postDeferredNoDoFF.glsl   | 2085 +---------------
 indra/newview/llviewercontrol.cpp             |   16 -
 indra/newview/llviewershadermgr.cpp           |   55 +-
 indra/newview/llviewershadermgr.h             |    1 +
 indra/newview/pipeline.cpp                    |   57 +-
 6 files changed, 67 insertions(+), 4246 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 7588073a9cb..985f44fb6c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -29,2067 +29,11 @@
 out vec4 gl_FragColor;
 #endif
 
-#define FXAA_PC 1
-//#define FXAA_GLSL_130 1
-#define FXAA_QUALITY__PRESET 12
-
-/*============================================================================
-
-
-                    NVIDIA FXAA 3.11 by TIMOTHY LOTTES
-
-
-------------------------------------------------------------------------------
-COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
-------------------------------------------------------------------------------
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
-*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
-OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
-CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
-LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
-OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
-THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-------------------------------------------------------------------------------
-                           INTEGRATION CHECKLIST
-------------------------------------------------------------------------------
-(1.)
-In the shader source, setup defines for the desired configuration.
-When providing multiple shaders (for different presets),
-simply setup the defines differently in multiple files.
-Example,
-
-  #define FXAA_PC 1
-  #define FXAA_HLSL_5 1
-  #define FXAA_QUALITY__PRESET 12
-
-Or,
-
-  #define FXAA_360 1
-  
-Or,
-
-  #define FXAA_PS3 1
-  
-Etc.
-
-(2.)
-Then include this file,
-
-  #include "Fxaa3_11.h"
-
-(3.)
-Then call the FXAA pixel shader from within your desired shader.
-Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
-As for FXAA 3.11 all inputs for all shaders are the same 
-to enable easy porting between platforms.
-
-  return FxaaPixelShader(...);
-
-(4.)
-Insure pass prior to FXAA outputs RGBL (see next section).
-Or use,
-
-  #define FXAA_GREEN_AS_LUMA 1
-
-(5.)
-Setup engine to provide the following constants
-which are used in the FxaaPixelShader() inputs,
-
-  FxaaFloat2 fxaaQualityRcpFrame,
-  FxaaFloat4 fxaaConsoleRcpFrameOpt,
-  FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-  FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-  FxaaFloat fxaaQualitySubpix,
-  FxaaFloat fxaaQualityEdgeThreshold,
-  FxaaFloat fxaaQualityEdgeThresholdMin,
-  FxaaFloat fxaaConsoleEdgeSharpness,
-  FxaaFloat fxaaConsoleEdgeThreshold,
-  FxaaFloat fxaaConsoleEdgeThresholdMin,
-  FxaaFloat4 fxaaConsole360ConstDir
-
-Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
-
-(6.)
-Have FXAA vertex shader run as a full screen triangle,
-and output "pos" and "fxaaConsolePosPos" 
-such that inputs in the pixel shader provide,
-
-  // {xy} = center of pixel
-  FxaaFloat2 pos,
-
-  // {xy__} = upper left of pixel
-  // {__zw} = lower right of pixel
-  FxaaFloat4 fxaaConsolePosPos,
-
-(7.)
-Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
-
-
-------------------------------------------------------------------------------
-                    INTEGRATION - RGBL AND COLORSPACE
-------------------------------------------------------------------------------
-FXAA3 requires RGBL as input unless the following is set, 
-
-  #define FXAA_GREEN_AS_LUMA 1
-
-In which case the engine uses green in place of luma,
-and requires RGB input is in a non-linear colorspace.
-
-RGB should be LDR (low dynamic range).
-Specifically do FXAA after tonemapping.
-
-RGB data as returned by a texture fetch can be non-linear,
-or linear when FXAA_GREEN_AS_LUMA is not set.
-Note an "sRGB format" texture counts as linear,
-because the result of a texture fetch is linear data.
-Regular "RGBA8" textures in the sRGB colorspace are non-linear.
-
-If FXAA_GREEN_AS_LUMA is not set,
-luma must be stored in the alpha channel prior to running FXAA.
-This luma should be in a perceptual space (could be gamma 2.0).
-Example pass before FXAA where output is gamma 2.0 encoded,
-
-  color.rgb = ToneMap(color.rgb); // linear color output
-  color.rgb = sqrt(color.rgb);    // gamma 2.0 color output
-  return color;
-
-To use FXAA,
-
-  color.rgb = ToneMap(color.rgb);  // linear color output
-  color.rgb = sqrt(color.rgb);     // gamma 2.0 color output
-  color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
-  return color;
-
-Another example where output is linear encoded,
-say for instance writing to an sRGB formated render target,
-where the render target does the conversion back to sRGB after blending,
-
-  color.rgb = ToneMap(color.rgb); // linear color output
-  return color;
-
-To use FXAA,
-
-  color.rgb = ToneMap(color.rgb); // linear color output
-  color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
-  return color;
-
-Getting luma correct is required for the algorithm to work correctly.
-
-
-------------------------------------------------------------------------------
-                          BEING LINEARLY CORRECT?
-------------------------------------------------------------------------------
-Applying FXAA to a framebuffer with linear RGB color will look worse.
-This is very counter intuitive, but happends to be true in this case.
-The reason is because dithering artifacts will be more visiable 
-in a linear colorspace.
-
-
-------------------------------------------------------------------------------
-                             COMPLEX INTEGRATION
-------------------------------------------------------------------------------
-Q. What if the engine is blending into RGB before wanting to run FXAA?
-
-A. In the last opaque pass prior to FXAA,
-   have the pass write out luma into alpha.
-   Then blend into RGB only.
-   FXAA should be able to run ok
-   assuming the blending pass did not any add aliasing.
-   This should be the common case for particles and common blending passes.
-
-A. Or use FXAA_GREEN_AS_LUMA.
-
-============================================================================*/
-
-/*============================================================================
-
-                             INTEGRATION KNOBS
-
-============================================================================*/
-//
-// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
-// FXAA_360_OPT is a prototype for the new optimized 360 version.
-//
-// 1 = Use API.
-// 0 = Don't use API.
-//
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PS3
-    #define FXAA_PS3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360
-    #define FXAA_360 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360_OPT
-    #define FXAA_360_OPT 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_PC
-    //
-    // FXAA Quality
-    // The high quality PC algorithm.
-    //
-    #define FXAA_PC 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PC_CONSOLE
-    //
-    // The console algorithm for PC is included
-    // for developers targeting really low spec machines.
-    // Likely better to just run FXAA_PC, and use a really low preset.
-    //
-    #define FXAA_PC_CONSOLE 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_120
-    #define FXAA_GLSL_120 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_130
-    #define FXAA_GLSL_130 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_3
-    #define FXAA_HLSL_3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_4
-    #define FXAA_HLSL_4 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_5
-    #define FXAA_HLSL_5 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_GREEN_AS_LUMA
-    //
-    // For those using non-linear color,
-    // and either not able to get luma in alpha, or not wanting to,
-    // this enables FXAA to run using green as a proxy for luma.
-    // So with this enabled, no need to pack luma in alpha.
-    //
-    // This will turn off AA on anything which lacks some amount of green.
-    // Pure red and blue or combination of only R and B, will get no AA.
-    //
-    // Might want to lower the settings for both,
-    //    fxaaConsoleEdgeThresholdMin
-    //    fxaaQualityEdgeThresholdMin
-    // In order to insure AA does not get turned off on colors 
-    // which contain a minor amount of green.
-    //
-    // 1 = On.
-    // 0 = Off.
-    //
-    #define FXAA_GREEN_AS_LUMA 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_EARLY_EXIT
-    //
-    // Controls algorithm's early exit path.
-    // On PS3 turning this ON adds 2 cycles to the shader.
-    // On 360 turning this OFF adds 10ths of a millisecond to the shader.
-    // Turning this off on console will result in a more blurry image.
-    // So this defaults to on.
-    //
-    // 1 = On.
-    // 0 = Off.
-    //
-    #define FXAA_EARLY_EXIT 1
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_DISCARD
-    //
-    // Only valid for PC OpenGL currently.
-    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
-    //
-    // 1 = Use discard on pixels which don't need AA.
-    //     For APIs which enable concurrent TEX+ROP from same surface.
-    // 0 = Return unchanged color on pixels which don't need AA.
-    //
-    #define FXAA_DISCARD 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_FAST_PIXEL_OFFSET
-    //
-    // Used for GLSL 120 only.
-    //
-    // 1 = GL API supports fast pixel offsets
-    // 0 = do not use fast pixel offsets
-    //
-    #ifdef GL_EXT_gpu_shader4
-        #define FXAA_FAST_PIXEL_OFFSET 1
-    #endif
-    #ifdef GL_NV_gpu_shader5
-        #define FXAA_FAST_PIXEL_OFFSET 1
-    #endif
-    #ifdef GL_ARB_gpu_shader5
-        #define FXAA_FAST_PIXEL_OFFSET 1
-    #endif
-    #ifndef FXAA_FAST_PIXEL_OFFSET
-        #define FXAA_FAST_PIXEL_OFFSET 0
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GATHER4_ALPHA
-    //
-    // 1 = API supports gather4 on alpha channel.
-    // 0 = API does not support gather4 on alpha channel.
-    //
-    #if (FXAA_HLSL_5 == 1)
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifdef GL_ARB_gpu_shader5
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifdef GL_NV_gpu_shader5
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifndef FXAA_GATHER4_ALPHA
-        #define FXAA_GATHER4_ALPHA 0
-    #endif
-#endif
-
-/*============================================================================
-                      FXAA CONSOLE PS3 - TUNING KNOBS
-============================================================================*/
-#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
-    //
-    // Consoles the sharpness of edges on PS3 only.
-    // Non-PS3 tuning is done with shader input.
-    //
-    // Due to the PS3 being ALU bound,
-    // there are only two safe values here: 4 and 8.
-    // These options use the shaders ability to a free *|/ by 2|4|8.
-    //
-    // 8.0 is sharper
-    // 4.0 is softer
-    // 2.0 is really soft (good for vector graphics inputs)
-    //
-    #if 1
-        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
-    #endif
-    #if 0
-        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
-    #endif
-    #if 0
-        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
-    //
-    // Only effects PS3.
-    // Non-PS3 tuning is done with shader input.
-    //
-    // The minimum amount of local contrast required to apply algorithm.
-    // The console setting has a different mapping than the quality setting.
-    //
-    // This only applies when FXAA_EARLY_EXIT is 1.
-    //
-    // Due to the PS3 being ALU bound,
-    // there are only two safe values here: 0.25 and 0.125.
-    // These options use the shaders ability to a free *|/ by 2|4|8.
-    //
-    // 0.125 leaves less aliasing, but is softer
-    // 0.25 leaves more aliasing, and is sharper
-    //
-    #if 1
-        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
-    #else
-        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
-    #endif
-#endif
-
-/*============================================================================
-                        FXAA QUALITY - TUNING KNOBS
-------------------------------------------------------------------------------
-NOTE the other tuning knobs are now in the shader function inputs!
-============================================================================*/
-#ifndef FXAA_QUALITY__PRESET
-    //
-    // Choose the quality preset.
-    // This needs to be compiled into the shader as it effects code.
-    // Best option to include multiple presets is to 
-    // in each shader define the preset, then include this file.
-    // 
-    // OPTIONS
-    // -----------------------------------------------------------------------
-    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
-    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
-    // 39       - no dither, very expensive 
-    //
-    // NOTES
-    // -----------------------------------------------------------------------
-    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
-    // 13 = about same speed as FXAA 3.9 and better than 12
-    // 23 = closest to FXAA 3.9 visually and performance wise
-    //  _ = the lowest digit is directly related to performance
-    // _  = the highest digit is directly related to style
-    // 
-    #define FXAA_QUALITY__PRESET 12
-#endif
-
-
-/*============================================================================
-
-                           FXAA QUALITY - PRESETS
-
-============================================================================*/
-
-/*============================================================================
-                     FXAA QUALITY - MEDIUM DITHER PRESETS
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 10)
-    #define FXAA_QUALITY__PS 3
-    #define FXAA_QUALITY__P0 1.5
-    #define FXAA_QUALITY__P1 3.0
-    #define FXAA_QUALITY__P2 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 11)
-    #define FXAA_QUALITY__PS 4
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 3.0
-    #define FXAA_QUALITY__P3 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 12)
-    #define FXAA_QUALITY__PS 5
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 4.0
-    #define FXAA_QUALITY__P4 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 13)
-    #define FXAA_QUALITY__PS 6
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 4.0
-    #define FXAA_QUALITY__P5 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 14)
-    #define FXAA_QUALITY__PS 7
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 4.0
-    #define FXAA_QUALITY__P6 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 15)
-    #define FXAA_QUALITY__PS 8
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 4.0
-    #define FXAA_QUALITY__P7 12.0
-#endif
-
-/*============================================================================
-                     FXAA QUALITY - LOW DITHER PRESETS
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 20)
-    #define FXAA_QUALITY__PS 3
-    #define FXAA_QUALITY__P0 1.5
-    #define FXAA_QUALITY__P1 2.0
-    #define FXAA_QUALITY__P2 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 21)
-    #define FXAA_QUALITY__PS 4
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 22)
-    #define FXAA_QUALITY__PS 5
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 23)
-    #define FXAA_QUALITY__PS 6
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 24)
-    #define FXAA_QUALITY__PS 7
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 3.0
-    #define FXAA_QUALITY__P6 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 25)
-    #define FXAA_QUALITY__PS 8
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 4.0
-    #define FXAA_QUALITY__P7 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 26)
-    #define FXAA_QUALITY__PS 9
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 4.0
-    #define FXAA_QUALITY__P8 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 27)
-    #define FXAA_QUALITY__PS 10
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 4.0
-    #define FXAA_QUALITY__P9 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 28)
-    #define FXAA_QUALITY__PS 11
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 2.0
-    #define FXAA_QUALITY__P9 4.0
-    #define FXAA_QUALITY__P10 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 29)
-    #define FXAA_QUALITY__PS 12
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 2.0
-    #define FXAA_QUALITY__P9 2.0
-    #define FXAA_QUALITY__P10 4.0
-    #define FXAA_QUALITY__P11 8.0
-#endif
-
-/*============================================================================
-                     FXAA QUALITY - EXTREME QUALITY
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 39)
-    #define FXAA_QUALITY__PS 12
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.0
-    #define FXAA_QUALITY__P2 1.0
-    #define FXAA_QUALITY__P3 1.0
-    #define FXAA_QUALITY__P4 1.0
-    #define FXAA_QUALITY__P5 1.5
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 2.0
-    #define FXAA_QUALITY__P9 2.0
-    #define FXAA_QUALITY__P10 4.0
-    #define FXAA_QUALITY__P11 8.0
-#endif
-
-
-
-/*============================================================================
-
-                                API PORTING
-
-============================================================================*/
-#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
-    #define FxaaBool bool
-    #define FxaaDiscard discard
-    #define FxaaFloat float
-    #define FxaaFloat2 vec2
-    #define FxaaFloat3 vec3
-    #define FxaaFloat4 vec4
-    #define FxaaHalf float
-    #define FxaaHalf2 vec2
-    #define FxaaHalf3 vec3
-    #define FxaaHalf4 vec4
-    #define FxaaInt2 ivec2
-    #define FxaaSat(x) clamp(x, 0.0, 1.0)
-    #define FxaaTex sampler2D
-#else
-    #define FxaaBool bool
-    #define FxaaDiscard clip(-1)
-    #define FxaaFloat float
-    #define FxaaFloat2 float2
-    #define FxaaFloat3 float3
-    #define FxaaFloat4 float4
-    #define FxaaHalf half
-    #define FxaaHalf2 half2
-    #define FxaaHalf3 half3
-    #define FxaaHalf4 half4
-    #define FxaaSat(x) saturate(x)
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_GLSL_120 == 1)
-    // Requires,
-    //  #version 120
-    // And at least,
-    //  #extension GL_EXT_gpu_shader4 : enable
-    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
-    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
-    #if (FXAA_FAST_PIXEL_OFFSET == 1)
-        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
-    #else
-        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
-    #endif
-    #if (FXAA_GATHER4_ALPHA == 1)
-        // use #extension GL_ARB_gpu_shader5 : enable
-        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
-        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
-        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
-        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_GLSL_130 == 1)
-    // Requires "#version 130" or better
-    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
-    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
-    #if (FXAA_GATHER4_ALPHA == 1)
-        // use #extension GL_ARB_gpu_shader5 : enable
-        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
-        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
-        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
-        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
-    #define FxaaInt2 float2
-    #define FxaaTex sampler2D
-    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
-    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_4 == 1)
-    #define FxaaInt2 int2
-    struct FxaaTex { SamplerState smpl; Texture2D tex; };
-    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
-    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_5 == 1)
-    #define FxaaInt2 int2
-    struct FxaaTex { SamplerState smpl; Texture2D tex; };
-    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
-    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
-    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
-    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
-    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
-    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
-#endif
-
-
-/*============================================================================
-                   GREEN AS LUMA OPTION SUPPORT FUNCTION
-============================================================================*/
-#if (FXAA_GREEN_AS_LUMA == 0)
-    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
-#else
-    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
-#endif    
-
-
-
-
-/*============================================================================
-
-                             FXAA3 QUALITY - PC
-
-============================================================================*/
-#if (FXAA_PC == 1)
-/*--------------------------------------------------------------------------*/
-FxaaFloat4 FxaaPixelShader(
-    //
-    // Use noperspective interpolation here (turn off perspective interpolation).
-    // {xy} = center of pixel
-    FxaaFloat2 pos,
-    //
-    // Used only for FXAA Console, and not used on the 360 version.
-    // Use noperspective interpolation here (turn off perspective interpolation).
-    // {xy__} = upper left of pixel
-    // {__zw} = lower right of pixel
-    FxaaFloat4 fxaaConsolePosPos,
-    //
-    // Input color texture.
-    // {rgb_} = color in linear or perceptual color space
-    // if (FXAA_GREEN_AS_LUMA == 0)
-    //     {___a} = luma in perceptual color space (not linear)
-    FxaaTex tex,
-    //
-    // Only used on the optimized 360 version of FXAA Console.
-    // For everything but 360, just use the same input here as for "tex".
-    // For 360, same texture, just alias with a 2nd sampler.
-    // This sampler needs to have an exponent bias of -1.
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    //
-    // Only used on the optimized 360 version of FXAA Console.
-    // For everything but 360, just use the same input here as for "tex".
-    // For 360, same texture, just alias with a 3nd sampler.
-    // This sampler needs to have an exponent bias of -2.
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    //
-    // Only used on FXAA Quality.
-    // This must be from a constant/uniform.
-    // {x_} = 1.0/screenWidthInPixels
-    // {_y} = 1.0/screenHeightInPixels
-    FxaaFloat2 fxaaQualityRcpFrame,
-    //
-    // Only used on FXAA Console.
-    // This must be from a constant/uniform.
-    // This effects sub-pixel AA quality and inversely sharpness.
-    //   Where N ranges between,
-    //     N = 0.50 (default)
-    //     N = 0.33 (sharper)
-    // {x___} = -N/screenWidthInPixels  
-    // {_y__} = -N/screenHeightInPixels
-    // {__z_} =  N/screenWidthInPixels  
-    // {___w} =  N/screenHeightInPixels 
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    //
-    // Only used on FXAA Console.
-    // Not used on 360, but used on PS3 and PC.
-    // This must be from a constant/uniform.
-    // {x___} = -2.0/screenWidthInPixels  
-    // {_y__} = -2.0/screenHeightInPixels
-    // {__z_} =  2.0/screenWidthInPixels  
-    // {___w} =  2.0/screenHeightInPixels 
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    //
-    // Only used on FXAA Console.
-    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
-    // This must be from a constant/uniform.
-    // {x___} =  8.0/screenWidthInPixels  
-    // {_y__} =  8.0/screenHeightInPixels
-    // {__z_} = -4.0/screenWidthInPixels  
-    // {___w} = -4.0/screenHeightInPixels 
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    //
-    // Only used on FXAA Quality.
-    // This used to be the FXAA_QUALITY__SUBPIX define.
-    // It is here now to allow easier tuning.
-    // Choose the amount of sub-pixel aliasing removal.
-    // This can effect sharpness.
-    //   1.00 - upper limit (softer)
-    //   0.75 - default amount of filtering
-    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
-    //   0.25 - almost off
-    //   0.00 - completely off
-    FxaaFloat fxaaQualitySubpix,
-    //
-    // Only used on FXAA Quality.
-    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
-    // It is here now to allow easier tuning.
-    // The minimum amount of local contrast required to apply algorithm.
-    //   0.333 - too little (faster)
-    //   0.250 - low quality
-    //   0.166 - default
-    //   0.125 - high quality 
-    //   0.063 - overkill (slower)
-    FxaaFloat fxaaQualityEdgeThreshold,
-    //
-    // Only used on FXAA Quality.
-    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
-    // It is here now to allow easier tuning.
-    // Trims the algorithm from processing darks.
-    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
-    //   0.0625 - high quality (faster)
-    //   0.0312 - visible limit (slower)
-    // Special notes when using FXAA_GREEN_AS_LUMA,
-    //   Likely want to set this to zero.
-    //   As colors that are mostly not-green
-    //   will appear very dark in the green channel!
-    //   Tune by looking at mostly non-green content,
-    //   then start at zero and increase until aliasing is a problem.
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    // 
-    // Only used on FXAA Console.
-    // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
-    // It is here now to allow easier tuning.
-    // This does not effect PS3, as this needs to be compiled in.
-    //   Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
-    //   Due to the PS3 being ALU bound,
-    //   there are only three safe values here: 2 and 4 and 8.
-    //   These options use the shaders ability to a free *|/ by 2|4|8.
-    // For all other platforms can be a non-power of two.
-    //   8.0 is sharper (default!!!)
-    //   4.0 is softer
-    //   2.0 is really soft (good only for vector graphics inputs)
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    //
-    // Only used on FXAA Console.
-    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
-    // It is here now to allow easier tuning.
-    // This does not effect PS3, as this needs to be compiled in.
-    //   Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
-    //   Due to the PS3 being ALU bound,
-    //   there are only two safe values here: 1/4 and 1/8.
-    //   These options use the shaders ability to a free *|/ by 2|4|8.
-    // The console setting has a different mapping than the quality setting.
-    // Other platforms can use other values.
-    //   0.125 leaves less aliasing, but is softer (default!!!)
-    //   0.25 leaves more aliasing, and is sharper
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    //
-    // Only used on FXAA Console.
-    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
-    // It is here now to allow easier tuning.
-    // Trims the algorithm from processing darks.
-    // The console setting has a different mapping than the quality setting.
-    // This only applies when FXAA_EARLY_EXIT is 1.
-    // This does not apply to PS3, 
-    // PS3 was simplified to avoid more shader instructions.
-    //   0.06 - faster but more aliasing in darks
-    //   0.05 - default
-    //   0.04 - slower and less aliasing in darks
-    // Special notes when using FXAA_GREEN_AS_LUMA,
-    //   Likely want to set this to zero.
-    //   As colors that are mostly not-green
-    //   will appear very dark in the green channel!
-    //   Tune by looking at mostly non-green content,
-    //   then start at zero and increase until aliasing is a problem.
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    //    
-    // Extra constants for 360 FXAA Console only.
-    // Use zeros or anything else for other platforms.
-    // These must be in physical constant registers and NOT immedates.
-    // Immedates will result in compiler un-optimizing.
-    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 posM;
-    posM.x = pos.x;
-    posM.y = pos.y;
-    #if (FXAA_GATHER4_ALPHA == 1)
-        #if (FXAA_DISCARD == 0)
-            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
-            #if (FXAA_GREEN_AS_LUMA == 0)
-                #define lumaM rgbyM.w
-            #else
-                #define lumaM rgbyM.y
-            #endif
-        #endif
-        #if (FXAA_GREEN_AS_LUMA == 0)
-            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
-            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
-        #else
-            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
-            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
-        #endif
-        #if (FXAA_DISCARD == 1)
-            #define lumaM luma4A.w
-        #endif
-        #define lumaE luma4A.z
-        #define lumaS luma4A.x
-        #define lumaSE luma4A.y
-        #define lumaNW luma4B.w
-        #define lumaN luma4B.z
-        #define lumaW luma4B.x
-    #else
-        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
-        #if (FXAA_GREEN_AS_LUMA == 0)
-            #define lumaM rgbyM.w
-        #else
-            #define lumaM rgbyM.y
-        #endif
-        FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
-    #endif
-/*--------------------------------------------------------------------------*/
-    FxaaFloat maxSM = max(lumaS, lumaM);
-    FxaaFloat minSM = min(lumaS, lumaM);
-    FxaaFloat maxESM = max(lumaE, maxSM);
-    FxaaFloat minESM = min(lumaE, minSM);
-    FxaaFloat maxWN = max(lumaN, lumaW);
-    FxaaFloat minWN = min(lumaN, lumaW);
-    FxaaFloat rangeMax = max(maxWN, maxESM);
-    FxaaFloat rangeMin = min(minWN, minESM);
-    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
-    FxaaFloat range = rangeMax - rangeMin;
-    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
-    FxaaBool earlyExit = range < rangeMaxClamped;
-/*--------------------------------------------------------------------------*/
-    if(earlyExit)
-        #if (FXAA_DISCARD == 1)
-            FxaaDiscard;
-        #else
-            return rgbyM;
-        #endif
-/*--------------------------------------------------------------------------*/
-    #if (FXAA_GATHER4_ALPHA == 0)
-        FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
-    #else
-        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
-    #endif
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNS = lumaN + lumaS;
-    FxaaFloat lumaWE = lumaW + lumaE;
-    FxaaFloat subpixRcpRange = 1.0/range;
-    FxaaFloat subpixNSWE = lumaNS + lumaWE;
-    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
-    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNESE = lumaNE + lumaSE;
-    FxaaFloat lumaNWNE = lumaNW + lumaNE;
-    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
-    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNWSW = lumaNW + lumaSW;
-    FxaaFloat lumaSWSE = lumaSW + lumaSE;
-    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
-    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
-    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
-    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
-    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
-    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
-    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
-    FxaaBool horzSpan = edgeHorz >= edgeVert;
-    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
-/*--------------------------------------------------------------------------*/
-    if(!horzSpan) lumaN = lumaW;
-    if(!horzSpan) lumaS = lumaE;
-    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
-    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat gradientN = lumaN - lumaM;
-    FxaaFloat gradientS = lumaS - lumaM;
-    FxaaFloat lumaNN = lumaN + lumaM;
-    FxaaFloat lumaSS = lumaS + lumaM;
-    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
-    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
-    if(pairN) lengthSign = -lengthSign;
-    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 posB;
-    posB.x = posM.x;
-    posB.y = posM.y;
-    FxaaFloat2 offNP;
-    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
-    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
-    if(!horzSpan) posB.x += lengthSign * 0.5;
-    if( horzSpan) posB.y += lengthSign * 0.5;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 posN;
-    posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
-    posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
-    FxaaFloat2 posP;
-    posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
-    posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
-    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
-    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
-    FxaaFloat subpixE = subpixC * subpixC;
-    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
-/*--------------------------------------------------------------------------*/
-    if(!pairN) lumaNN = lumaSS;
-    FxaaFloat gradientScaled = gradient * 1.0/4.0;
-    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
-    FxaaFloat subpixF = subpixD * subpixE;
-    FxaaBool lumaMLTZero = lumaMM < 0.0;
-/*--------------------------------------------------------------------------*/
-    lumaEndN -= lumaNN * 0.5;
-    lumaEndP -= lumaNN * 0.5;
-    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
-    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
-    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
-    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
-    FxaaBool doneNP = (!doneN) || (!doneP);
-    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
-    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
-/*--------------------------------------------------------------------------*/
-    if(doneNP) {
-        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-        doneN = abs(lumaEndN) >= gradientScaled;
-        doneP = abs(lumaEndP) >= gradientScaled;
-        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
-        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
-        doneNP = (!doneN) || (!doneP);
-        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
-        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
-/*--------------------------------------------------------------------------*/
-        #if (FXAA_QUALITY__PS > 3)
-        if(doneNP) {
-            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-            doneN = abs(lumaEndN) >= gradientScaled;
-            doneP = abs(lumaEndP) >= gradientScaled;
-            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
-            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
-            doneNP = (!doneN) || (!doneP);
-            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
-            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
-/*--------------------------------------------------------------------------*/
-            #if (FXAA_QUALITY__PS > 4)
-            if(doneNP) {
-                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                doneN = abs(lumaEndN) >= gradientScaled;
-                doneP = abs(lumaEndP) >= gradientScaled;
-                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
-                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
-                doneNP = (!doneN) || (!doneP);
-                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
-                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
-/*--------------------------------------------------------------------------*/
-                #if (FXAA_QUALITY__PS > 5)
-                if(doneNP) {
-                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                    doneN = abs(lumaEndN) >= gradientScaled;
-                    doneP = abs(lumaEndP) >= gradientScaled;
-                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
-                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
-                    doneNP = (!doneN) || (!doneP);
-                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
-                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
-/*--------------------------------------------------------------------------*/
-                    #if (FXAA_QUALITY__PS > 6)
-                    if(doneNP) {
-                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                        doneN = abs(lumaEndN) >= gradientScaled;
-                        doneP = abs(lumaEndP) >= gradientScaled;
-                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
-                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
-                        doneNP = (!doneN) || (!doneP);
-                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
-                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
-/*--------------------------------------------------------------------------*/
-                        #if (FXAA_QUALITY__PS > 7)
-                        if(doneNP) {
-                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                            doneN = abs(lumaEndN) >= gradientScaled;
-                            doneP = abs(lumaEndP) >= gradientScaled;
-                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
-                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
-                            doneNP = (!doneN) || (!doneP);
-                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
-                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
-/*--------------------------------------------------------------------------*/
-    #if (FXAA_QUALITY__PS > 8)
-    if(doneNP) {
-        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-        doneN = abs(lumaEndN) >= gradientScaled;
-        doneP = abs(lumaEndP) >= gradientScaled;
-        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
-        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
-        doneNP = (!doneN) || (!doneP);
-        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
-        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
-/*--------------------------------------------------------------------------*/
-        #if (FXAA_QUALITY__PS > 9)
-        if(doneNP) {
-            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-            doneN = abs(lumaEndN) >= gradientScaled;
-            doneP = abs(lumaEndP) >= gradientScaled;
-            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
-            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
-            doneNP = (!doneN) || (!doneP);
-            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
-            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
-/*--------------------------------------------------------------------------*/
-            #if (FXAA_QUALITY__PS > 10)
-            if(doneNP) {
-                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                doneN = abs(lumaEndN) >= gradientScaled;
-                doneP = abs(lumaEndP) >= gradientScaled;
-                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
-                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
-                doneNP = (!doneN) || (!doneP);
-                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
-                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
-/*--------------------------------------------------------------------------*/
-                #if (FXAA_QUALITY__PS > 11)
-                if(doneNP) {
-                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                    doneN = abs(lumaEndN) >= gradientScaled;
-                    doneP = abs(lumaEndP) >= gradientScaled;
-                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
-                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
-                    doneNP = (!doneN) || (!doneP);
-                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
-                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
-/*--------------------------------------------------------------------------*/
-                    #if (FXAA_QUALITY__PS > 12)
-                    if(doneNP) {
-                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                        doneN = abs(lumaEndN) >= gradientScaled;
-                        doneP = abs(lumaEndP) >= gradientScaled;
-                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
-                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
-                        doneNP = (!doneN) || (!doneP);
-                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
-                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
-/*--------------------------------------------------------------------------*/
-                    }
-                    #endif
-/*--------------------------------------------------------------------------*/
-                }
-                #endif
-/*--------------------------------------------------------------------------*/
-            }
-            #endif
-/*--------------------------------------------------------------------------*/
-        }
-        #endif
-/*--------------------------------------------------------------------------*/
-    }
-    #endif
-/*--------------------------------------------------------------------------*/
-                        }
-                        #endif
-/*--------------------------------------------------------------------------*/
-                    }
-                    #endif
-/*--------------------------------------------------------------------------*/
-                }
-                #endif
-/*--------------------------------------------------------------------------*/
-            }
-            #endif
-/*--------------------------------------------------------------------------*/
-        }
-        #endif
-/*--------------------------------------------------------------------------*/
-    }
-/*--------------------------------------------------------------------------*/
-    FxaaFloat dstN = posM.x - posN.x;
-    FxaaFloat dstP = posP.x - posM.x;
-    if(!horzSpan) dstN = posM.y - posN.y;
-    if(!horzSpan) dstP = posP.y - posM.y;
-/*--------------------------------------------------------------------------*/
-    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
-    FxaaFloat spanLength = (dstP + dstN);
-    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
-    FxaaFloat spanLengthRcp = 1.0/spanLength;
-/*--------------------------------------------------------------------------*/
-    FxaaBool directionN = dstN < dstP;
-    FxaaFloat dst = min(dstN, dstP);
-    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
-    FxaaFloat subpixG = subpixF * subpixF;
-    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
-    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
-    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
-    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
-    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
-    #if (FXAA_DISCARD == 1)
-        return FxaaTexTop(tex, posM);
-    #else
-        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
-    #endif
-}
-/*==========================================================================*/
-#endif
-
-
-
-
-/*============================================================================
-
-                         FXAA3 CONSOLE - PC VERSION
-                         
-------------------------------------------------------------------------------
-Instead of using this on PC, I'd suggest just using FXAA Quality with
-    #define FXAA_QUALITY__PRESET 10
-Or 
-    #define FXAA_QUALITY__PRESET 20
-Either are higher qualilty and almost as fast as this on modern PC GPUs.
-============================================================================*/
-#if (FXAA_PC_CONSOLE == 1)
-/*--------------------------------------------------------------------------*/
-FxaaFloat4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
-    FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
-    FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
-    FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
-/*--------------------------------------------------------------------------*/
-    FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        FxaaFloat lumaM = rgbyM.w;
-    #else
-        FxaaFloat lumaM = rgbyM.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
-    lumaNe += 1.0/384.0;
-    FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
-    FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
-    FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMinM = min(lumaMin, lumaM);
-    FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
-    FxaaFloat lumaMaxM = max(lumaMax, lumaM);
-    FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
-    FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
-    FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
-    if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 dir;
-    dir.x = dirSwMinusNe + dirSeMinusNw;
-    dir.y = dirSwMinusNe - dirSeMinusNw;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 dir1 = normalize(dir.xy);
-    FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
-    FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
-    FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
-    FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
-    FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
-/*--------------------------------------------------------------------------*/
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
-    #else
-        FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
-    #endif
-    if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
-    return rgbyB; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
-                      FXAA3 CONSOLE - 360 PIXEL SHADER 
-
-------------------------------------------------------------------------------
-This optimized version thanks to suggestions from Andy Luedke.
-Should be fully tex bound in all cases.
-As of the FXAA 3.11 release, I have still not tested this code,
-however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
-And note this is replacing the old unoptimized version.
-If it does not work, please let me know so I can fix it.
-============================================================================*/
-#if (FXAA_360 == 1)
-/*--------------------------------------------------------------------------*/
-[reduceTempRegUsage(4)]
-float4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-    float4 lumaNwNeSwSe;
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        asm { 
-            tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
-        };
-    #else
-        asm { 
-            tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
-        };
-    #endif
-/*--------------------------------------------------------------------------*/
-    lumaNwNeSwSe.y += 1.0/384.0;
-    float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
-    float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
-    float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
-    float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
-/*--------------------------------------------------------------------------*/
-    float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        float lumaMinM = min(lumaMin, rgbyM.w);
-        float lumaMaxM = max(lumaMax, rgbyM.w);
-    #else
-        float lumaMinM = min(lumaMin, rgbyM.y);
-        float lumaMaxM = max(lumaMax, rgbyM.y);
-    #endif        
-    if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
-/*--------------------------------------------------------------------------*/
-    float2 dir;
-    dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
-    dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
-    dir = normalize(dir);
-/*--------------------------------------------------------------------------*/
-    float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
-/*--------------------------------------------------------------------------*/
-    float4 dir2;
-    float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
-    dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
-    dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
-/*--------------------------------------------------------------------------*/
-    float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
-    float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
-    float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
-    float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
-    float4 rgbyA = rgbyN1 + rgbyP1;
-    float4 rgbyB = rgbyN2 + rgbyP2 * 0.5 + rgbyA;
-/*--------------------------------------------------------------------------*/
-    float4 rgbyR = ((rgbyB.w - lumaMax) > 0.0) ? rgbyA : rgbyB;
-    rgbyR = ((rgbyB.w - lumaMin) > 0.0) ? rgbyR : rgbyA;
-    return rgbyR; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
-         FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
-
-==============================================================================
-The code below does not exactly match the assembly.
-I have a feeling that 12 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
-  --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-------------------------------------------------------------------------------
-                             NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
-  0: texpkb h0.w(TRUE), v5.zyxx, #0
-  2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
-  4: texpkb h0.w(TRUE), v5.xwxx, #0
-  6: addh h0.z(TRUE), -h2, h0.w
-  7: texpkb h1.w(TRUE), v5, #0
-  9: addh h0.x(TRUE), h0.z, -h1.w
- 10: addh h3.w(TRUE), h0.z, h1
- 11: texpkb h2.w(TRUE), v5.zwzz, #0
- 13: addh h0.z(TRUE), h3.w, -h2.w
- 14: addh h0.x(TRUE), h2.w, h0
- 15: nrmh h1.xz(TRUE), h0_n
- 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
- 17: maxh h4.w(TRUE), h0, h1
- 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
- 19: movr r1.zw(TRUE), v4.xxxy
- 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
- 22: minh h5.w(TRUE), h0, h1
- 23: texpkb h0(TRUE), r2.xzxx, #0
- 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
- 27: maxh h4.x(TRUE), h2.z, h2.w
- 28: texpkb h1(TRUE), r0.zwzz, #0
- 30: addh_d2 h1(TRUE), h0, h1
- 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 33: texpkb h0(TRUE), r0, #0
- 35: minh h4.z(TRUE), h2, h2.w
- 36: fenct TRUE
- 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 39: texpkb h2(TRUE), r1, #0
- 41: addh_d2 h0(TRUE), h0, h2
- 42: maxh h2.w(TRUE), h4, h4.x
- 43: minh h2.x(TRUE), h5.w, h4.z
- 44: addh_d2 h0(TRUE), h0, h1
- 45: slth h2.x(TRUE), h0.w, h2
- 46: sgth h2.w(TRUE), h0, h2
- 47: movh h0(TRUE), h0
- 48: addx.c0 rc(TRUE), h2, h2.w
- 49: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass |  Unit  |  uOp |  PC:  Op
------+--------+------+-------------------------
-   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |   SCB1 |  add |   2:  ADDh h2.z, h0.--w-, const.--x-;
-     |        |      |
-   2 | SCT0/1 |  mov |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |    TEX |  txl |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |   SCB1 |  add |   6:  ADDh h0.z,-h2, h0.--w-;
-     |        |      |
-   3 | SCT0/1 |  mov |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
-     |    TEX |  txl |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
-     |   SCB0 |  add |   9:  ADDh h0.x, h0.z---,-h1.w---;
-     |   SCB1 |  add |  10:  ADDh h3.w, h0.---z, h1;
-     |        |      |
-   4 | SCT0/1 |  mov |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |    TEX |  txl |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |   SCB0 |  add |  14:  ADDh h0.x, h2.w---, h0;
-     |   SCB1 |  add |  13:  ADDh h0.z, h3.--w-,-h2.--w-;
-     |        |      |
-   5 |   SCT1 |  mov |  15:  NRMh h1.xz, h0;
-     |    SRB |  nrm |  15:  NRMh h1.xz, h0;
-     |   SCB0 |  min |  16:  MINh*8 h0.x, |h1|, |h1.z---|;
-     |   SCB1 |  max |  17:  MAXh h4.w, h0, h1;
-     |        |      |
-   6 |   SCT0 |  div |  18:  DIVx h2.xy, h1.xz--, h0;
-     |   SCT1 |  mov |  19:  MOVr r1.zw, g[TEX0].--xy;
-     |   SCB0 |  mad |  20:  MADr r2.xz,-h1, const.z-w-, r1.z-w-;
-     |   SCB1 |  min |  22:  MINh h5.w, h0, h1;
-     |        |      |
-   7 | SCT0/1 |  mov |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
-     |    TEX |  txl |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
-     |   SCB0 |  max |  27:  MAXh h4.x, h2.z---, h2.w---;
-     |   SCB1 |  mad |  25:  MADr r0.zw, h1.--xz, const, r1;
-     |        |      |
-   8 | SCT0/1 |  mov |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
-     |    TEX |  txl |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
-     | SCB0/1 |  add |  30:  ADDh/2 h1, h0, h1;
-     |        |      |
-   9 |   SCT0 |  mad |  31:  MADr r0.xy,-h2, const.xy--, r1.zw--;
-     |   SCT1 |  mov |  33:  TXLr h0, r0, const.zzzz, TEX0;
-     |    TEX |  txl |  33:  TXLr h0, r0, const.zzzz, TEX0;
-     |   SCB1 |  min |  35:  MINh h4.z, h2, h2.--w-;
-     |        |      |
-  10 |   SCT0 |  mad |  37:  MADr r1.xy, h2, const.xy--, r1.zw--;
-     |   SCT1 |  mov |  39:  TXLr h2, r1, const.zzzz, TEX0;
-     |    TEX |  txl |  39:  TXLr h2, r1, const.zzzz, TEX0;
-     | SCB0/1 |  add |  41:  ADDh/2 h0, h0, h2;
-     |        |      |
-  11 |   SCT0 |  min |  43:  MINh h2.x, h5.w---, h4.z---;
-     |   SCT1 |  max |  42:  MAXh h2.w, h4, h4.---x;
-     | SCB0/1 |  add |  44:  ADDh/2 h0, h0, h1;
-     |        |      |
-  12 |   SCT0 |  set |  45:  SLTh h2.x, h0.w---, h2;
-     |   SCT1 |  set |  46:  SGTh h2.w, h0, h2;
-     | SCB0/1 |  mul |  47:  MOVh h0, h0;
-     |        |      |
-  13 |   SCT0 |  mad |  48:  ADDxc0_s rc, h2, h2.w---;
-     | SCB0/1 |  mul |  49:  MOVh h0(NE0.xxxx), h1;
- 
-Pass   SCT  TEX  SCB
-  1:   0% 100%  25%
-  2:   0% 100%  25%
-  3:   0% 100%  50%
-  4:   0% 100%  50%
-  5:   0%   0%  50%
-  6: 100%   0%  75%
-  7:   0% 100%  75%
-  8:   0% 100% 100%
-  9:   0% 100%  25%
- 10:   0% 100% 100%
- 11:  50%   0% 100%
- 12:  50%   0% 100%
- 13:  25%   0% 100%
-
-MEAN:  17%  61%  67%
-
-Pass   SCT0  SCT1   TEX  SCB0  SCB1
-  1:    0%    0%  100%    0%  100%
-  2:    0%    0%  100%    0%  100%
-  3:    0%    0%  100%  100%  100%
-  4:    0%    0%  100%  100%  100%
-  5:    0%    0%    0%  100%  100%
-  6:  100%  100%    0%  100%  100%
-  7:    0%    0%  100%  100%  100%
-  8:    0%    0%  100%  100%  100%
-  9:    0%    0%  100%    0%  100%
- 10:    0%    0%  100%  100%  100%
- 11:  100%  100%    0%  100%  100%
- 12:  100%  100%    0%  100%  100%
- 13:  100%    0%    0%  100%  100%
-
-MEAN:   30%   23%   61%   76%  100%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 13 cycles, 3 r regs, 923,076,923 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
-/*--------------------------------------------------------------------------*/
-#pragma regcount 7
-#pragma disablepc all
-#pragma option O3
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
-    half4 dir;
-    half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        lumaNe.w += half(1.0/512.0);
-        dir.x = -lumaNe.w;
-        dir.z = -lumaNe.w;
-    #else
-        lumaNe.y += half(1.0/512.0);
-        dir.x = -lumaNe.y;
-        dir.z = -lumaNe.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (2)
-    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x += lumaSw.w;
-        dir.z += lumaSw.w;
-    #else
-        dir.x += lumaSw.y;
-        dir.z += lumaSw.y;
-    #endif        
-/*--------------------------------------------------------------------------*/
-// (3)
-    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x -= lumaNw.w;
-        dir.z += lumaNw.w;
-    #else
-        dir.x -= lumaNw.y;
-        dir.z += lumaNw.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (4)
-    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x += lumaSe.w;
-        dir.z -= lumaSe.w;
-    #else
-        dir.x += lumaSe.y;
-        dir.z -= lumaSe.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (5)
-    half4 dir1_pos;
-    dir1_pos.xy = normalize(dir.xyz).xz;
-    half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (6)
-    half4 dir2_pos;
-    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
-    dir1_pos.zw = pos.xy;
-    dir2_pos.zw = pos.xy;
-    half4 temp1N;
-    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (7)
-    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
-    half4 rgby1;
-    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (8)
-    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
-    rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (9)
-    half4 temp2N;
-    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
-// (10)
-    half4 rgby2;
-    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
-    rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (11)
-    // compilier moves these scalar ops up to other cycles
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
-        half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
-    #else
-        half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
-        half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
-    #endif        
-    rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (12)
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        bool twoTapLt = rgby2.w < lumaMin;
-        bool twoTapGt = rgby2.w > lumaMax;
-    #else
-        bool twoTapLt = rgby2.y < lumaMin;
-        bool twoTapGt = rgby2.y > lumaMax;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (13)
-    if(twoTapLt || twoTapGt) rgby2 = rgby1;
-/*--------------------------------------------------------------------------*/
-    return rgby2; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
-       FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
-
-==============================================================================
-The code mostly matches the assembly.
-I have a feeling that 14 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
- --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
-Will look at fixing this for FXAA 3.12.
-------------------------------------------------------------------------------
-                             NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
-  0: texpkb h0.w(TRUE), v5.zyxx, #0
-  2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
-  4: texpkb h1.w(TRUE), v5.xwxx, #0
-  6: addh h0.x(TRUE), h1.w, -h2.y
-  7: texpkb h2.w(TRUE), v5.zwzz, #0
-  9: minh h4.w(TRUE), h2.y, h2
- 10: maxh h5.x(TRUE), h2.y, h2.w
- 11: texpkb h0.w(TRUE), v5, #0
- 13: addh h3.w(TRUE), -h0, h0.x
- 14: addh h0.x(TRUE), h0.w, h0
- 15: addh h0.z(TRUE), -h2.w, h0.x
- 16: addh h0.x(TRUE), h2.w, h3.w
- 17: minh h5.y(TRUE), h0.w, h1.w
- 18: nrmh h2.xz(TRUE), h0_n
- 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
- 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
- 21: movr r1.zw(TRUE), v4.xxxy
- 22: maxh h2.w(TRUE), h0, h1
- 23: fenct TRUE
- 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 26: texpkb h0(TRUE), r0, #0
- 28: maxh h5.x(TRUE), h2.w, h5
- 29: minh h5.w(TRUE), h5.y, h4
- 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 32: texpkb h2(TRUE), r1, #0
- 34: addh_d2 h2(TRUE), h0, h2
- 35: texpkb h1(TRUE), v4, #0
- 37: maxh h5.y(TRUE), h5.x, h1.w
- 38: minh h4.w(TRUE), h1, h5
- 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 41: texpkb h0(TRUE), r0, #0
- 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
- 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 46: texpkb h3(TRUE), r2, #0
- 48: addh_d2 h0(TRUE), h0, h3
- 49: addh_d2 h3(TRUE), h0, h2
- 50: movh h0(TRUE), h3
- 51: slth h3.x(TRUE), h3.w, h5.w
- 52: sgth h3.w(TRUE), h3, h5.x
- 53: addx.c0 rc(TRUE), h3.x, h3
- 54: slth.c0 rc(TRUE), h5.z, h5
- 55: movh h0(c0.NE.w), h2
- 56: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass |  Unit  |  uOp |  PC:  Op
------+--------+------+-------------------------
-   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |   SCB0 |  add |   2:  ADDh h2.y, h0.-w--, const.-x--;
-     |        |      |
-   2 | SCT0/1 |  mov |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |    TEX |  txl |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |   SCB0 |  add |   6:  ADDh h0.x, h1.w---,-h2.y---;
-     |        |      |
-   3 | SCT0/1 |  mov |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |    TEX |  txl |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |   SCB0 |  max |  10:  MAXh h5.x, h2.y---, h2.w---;
-     |   SCB1 |  min |   9:  MINh h4.w, h2.---y, h2;
-     |        |      |
-   4 | SCT0/1 |  mov |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
-     |    TEX |  txl |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
-     |   SCB0 |  add |  14:  ADDh h0.x, h0.w---, h0;
-     |   SCB1 |  add |  13:  ADDh h3.w,-h0, h0.---x;
-     |        |      |
-   5 |   SCT0 |  mad |  16:  ADDh h0.x, h2.w---, h3.w---;
-     |   SCT1 |  mad |  15:  ADDh h0.z,-h2.--w-, h0.--x-;
-     |   SCB0 |  min |  17:  MINh h5.y, h0.-w--, h1.-w--;
-     |        |      |
-   6 |   SCT1 |  mov |  18:  NRMh h2.xz, h0;
-     |    SRB |  nrm |  18:  NRMh h2.xz, h0;
-     |   SCB1 |  min |  19:  MINh*8 h2.w, |h2.---x|, |h2.---z|;
-     |        |      |
-   7 |   SCT0 |  div |  20:  DIVx h4.xy, h2.xz--, h2.ww--;
-     |   SCT1 |  mov |  21:  MOVr r1.zw, g[TEX0].--xy;
-     |   SCB1 |  max |  22:  MAXh h2.w, h0, h1;
-     |        |      |
-   8 |   SCT0 |  mad |  24:  MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
-     |   SCT1 |  mov |  26:  TXLr h0, r0, const.xxxx, TEX0;
-     |    TEX |  txl |  26:  TXLr h0, r0, const.xxxx, TEX0;
-     |   SCB0 |  max |  28:  MAXh h5.x, h2.w---, h5;
-     |   SCB1 |  min |  29:  MINh h5.w, h5.---y, h4;
-     |        |      |
-   9 |   SCT0 |  mad |  30:  MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
-     |   SCT1 |  mov |  32:  TXLr h2, r1, const.xxxx, TEX0;
-     |    TEX |  txl |  32:  TXLr h2, r1, const.xxxx, TEX0;
-     | SCB0/1 |  add |  34:  ADDh/2 h2, h0, h2;
-     |        |      |
-  10 | SCT0/1 |  mov |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
-     |    TEX |  txl |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
-     |   SCB0 |  max |  37:  MAXh h5.y, h5.-x--, h1.-w--;
-     |   SCB1 |  min |  38:  MINh h4.w, h1, h5;
-     |        |      |
-  11 |   SCT0 |  mad |  39:  MADr r0.xy,-h4, const.xy--, r1.zw--;
-     |   SCT1 |  mov |  41:  TXLr h0, r0, const.zzzz, TEX0;
-     |    TEX |  txl |  41:  TXLr h0, r0, const.zzzz, TEX0;
-     |   SCB0 |  mad |  44:  MADr r2.xy, h4, const.xy--, r1.zw--;
-     |   SCB1 |  add |  43:  ADDh*8 h5.z, h5.--y-,-h4.--w-;
-     |        |      |
-  12 | SCT0/1 |  mov |  46:  TXLr h3, r2, const.xxxx, TEX0;
-     |    TEX |  txl |  46:  TXLr h3, r2, const.xxxx, TEX0;
-     | SCB0/1 |  add |  48:  ADDh/2 h0, h0, h3;
-     |        |      |
-  13 | SCT0/1 |  mad |  49:  ADDh/2 h3, h0, h2;
-     | SCB0/1 |  mul |  50:  MOVh h0, h3;
-     |        |      |
-  14 |   SCT0 |  set |  51:  SLTh h3.x, h3.w---, h5.w---;
-     |   SCT1 |  set |  52:  SGTh h3.w, h3, h5.---x;
-     |   SCB0 |  set |  54:  SLThc0 rc, h5.z---, h5;
-     |   SCB1 |  add |  53:  ADDxc0_s rc, h3.---x, h3;
-     |        |      |
-  15 | SCT0/1 |  mul |  55:  MOVh h0(NE0.wwww), h2;
-     | SCB0/1 |  mul |  56:  MOVh h0(NE0.xxxx), h1;
- 
-Pass   SCT  TEX  SCB
-  1:   0% 100%  25%
-  2:   0% 100%  25%
-  3:   0% 100%  50%
-  4:   0% 100%  50%
-  5:  50%   0%  25%
-  6:   0%   0%  25%
-  7: 100%   0%  25%
-  8:   0% 100%  50%
-  9:   0% 100% 100%
- 10:   0% 100%  50%
- 11:   0% 100%  75%
- 12:   0% 100% 100%
- 13: 100%   0% 100%
- 14:  50%   0%  50%
- 15: 100%   0% 100%
-
-MEAN:  26%  60%  56%
-
-Pass   SCT0  SCT1   TEX  SCB0  SCB1
-  1:    0%    0%  100%  100%    0%
-  2:    0%    0%  100%  100%    0%
-  3:    0%    0%  100%  100%  100%
-  4:    0%    0%  100%  100%  100%
-  5:  100%  100%    0%  100%    0%
-  6:    0%    0%    0%    0%  100%
-  7:  100%  100%    0%    0%  100%
-  8:    0%    0%  100%  100%  100%
-  9:    0%    0%  100%  100%  100%
- 10:    0%    0%  100%  100%  100%
- 11:    0%    0%  100%  100%  100%
- 12:    0%    0%  100%  100%  100%
- 13:  100%  100%    0%  100%  100%
- 14:  100%  100%    0%  100%  100%
- 15:  100%  100%    0%  100%  100%
-
-MEAN:   33%   33%   60%   86%   80%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 15 cycles, 3 r regs, 800,000,000 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
-/*--------------------------------------------------------------------------*/
-#pragma regcount 7
-#pragma disablepc all
-#pragma option O2
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
-    half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaNe = rgbyNe.w + half(1.0/512.0);
-    #else
-        half lumaNe = rgbyNe.y + half(1.0/512.0);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (2)
-    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaSwNegNe = lumaSw.w - lumaNe;
-    #else
-        half lumaSwNegNe = lumaSw.y - lumaNe;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (3)
-    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
-        half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
-    #else
-        half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
-        half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (4)
-    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half dirZ =  lumaNw.w + lumaSwNegNe;
-        half dirX = -lumaNw.w + lumaSwNegNe;
-    #else
-        half dirZ =  lumaNw.y + lumaSwNegNe;
-        half dirX = -lumaNw.y + lumaSwNegNe;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (5)
-    half3 dir;
-    dir.y = 0.0;
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x =  lumaSe.w + dirX;
-        dir.z = -lumaSe.w + dirZ;
-        half lumaMinNeSe = min(lumaNe, lumaSe.w);
-    #else
-        dir.x =  lumaSe.y + dirX;
-        dir.z = -lumaSe.y + dirZ;
-        half lumaMinNeSe = min(lumaNe, lumaSe.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (6)
-    half4 dir1_pos;
-    dir1_pos.xy = normalize(dir).xz;
-    half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (7)
-    half4 dir2_pos;
-    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
-    dir1_pos.zw = pos.xy;
-    dir2_pos.zw = pos.xy;
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMaxNeSe = max(lumaNe, lumaSe.w);
-    #else
-        half lumaMaxNeSe = max(lumaNe, lumaSe.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (8)
-    half4 temp1N;
-    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
-    half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
-    half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
-/*--------------------------------------------------------------------------*/
-// (9)
-    half4 rgby1;
-    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
-    rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (10)
-    half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMaxM = max(lumaMax, rgbyM.w);
-        half lumaMinM = min(lumaMin, rgbyM.w);
-    #else
-        half lumaMaxM = max(lumaMax, rgbyM.y);
-        half lumaMinM = min(lumaMin, rgbyM.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (11)
-    half4 temp2N;
-    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
-    half4 rgby2;
-    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
-/*--------------------------------------------------------------------------*/
-// (12)
-    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
-    rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (13)
-    rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (14)
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        bool twoTapLt = rgby2.w < lumaMin;
-        bool twoTapGt = rgby2.w > lumaMax;
-    #else
-        bool twoTapLt = rgby2.y < lumaMin;
-        bool twoTapGt = rgby2.y > lumaMax;
-    #endif
-    bool earlyExit = lumaRangeM < lumaMax;
-    bool twoTap = twoTapLt || twoTapGt;
-/*--------------------------------------------------------------------------*/
-// (15)
-    if(twoTap) rgby2 = rgby1;
-    if(earlyExit) rgby2 = rgbyM;
-/*--------------------------------------------------------------------------*/
-    return rgby2; }
-/*==========================================================================*/
-#endif
-
-uniform sampler2D diffuseMap;
+uniform sampler2DRect diffuseRect;
+uniform sampler2DRect edgeMap;
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
-
-uniform vec2 tc_scale;
-uniform vec2 rcp_screen_res;
-uniform vec4 rcp_frame_opt;
-uniform vec4 rcp_frame_opt2;
-uniform vec2 screen_res;
+uniform sampler2D bloomMap;
 
 uniform float depth_cutoff;
 uniform float norm_cutoff;
@@ -2099,10 +43,9 @@ uniform float tan_pixel_angle;
 uniform float magnification;
 
 uniform mat4 inv_proj;
+uniform vec2 screen_res;
 
 VARYING vec2 vary_fragcoord;
-VARYING vec2 vary_tc;
-
 
 float getDepth(vec2 pos_screen)
 {
@@ -2135,8 +78,8 @@ void dofSampleNear(inout vec4 diff, inout float w, float cur_sc, vec2 tc)
 	float sc = calc_cof(d);
 	
 	float wg = 0.25;
-	
-	vec4 s = texture2D(diffuseMap, tc*tc_scale/screen_res);
+		
+	vec4 s = texture2DRect(diffuseRect, tc);
 	// de-weight dull areas to make highlights 'pop'
 	wg += s.r+s.g+s.b;
 	
@@ -2156,7 +99,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ve
 	{
 		float wg = 0.25;
 		
-		vec4 s = texture2D(diffuseMap, tc*tc_scale/screen_res);
+		vec4 s = texture2DRect(diffuseRect, tc);
 		// de-weight dull areas to make highlights 'pop'
 		wg += s.r+s.g+s.b;
 	
@@ -2166,6 +109,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ve
 	}
 }
 
+
 void main() 
 {
 	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
@@ -2175,7 +119,7 @@ void main()
 	
 	float depth = getDepth(tc);
 	
-	vec4 diff = texture2D(diffuseMap, vary_fragcoord.xy*tc_scale/screen_res);
+	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
 	{ 
 		float w = 1.0;
@@ -2189,7 +133,6 @@ void main()
 
 		// sample quite uniformly spaced points within a circle, for a circular 'bokeh'		
 		//if (depth < focal_distance)
-		if (sc > 0.5)
 		{
 			while (sc > 0.5)
 			{
@@ -2205,30 +148,10 @@ void main()
 				sc -= 1.0;
 			}
 		}
-		else
-		{
-				diff =			FxaaPixelShader(vary_tc,			//pos
-										vec4(vary_fragcoord.xy, 0, 0), //fxaaConsolePosPos
-										diffuseMap,					//tex
-										diffuseMap,					
-										diffuseMap,
-										rcp_screen_res,				//fxaaQualityRcpFrame
-										vec4(0,0,0,0),				//fxaaConsoleRcpFrameOpt
-										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
-										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
-										0.75,						//fxaaQualitySubpix
-										0.07,						//fxaaQualityEdgeThreshold
-										0.03,						//fxaaQualityEdgeThresholdMin
-										8.0,						//fxaaConsoleEdgeSharpness
-										0.125,						//fxaaConsoleEdgeThreshold
-										0.05,						//fxaaConsoleEdgeThresholdMin
-										vec4(0,0,0,0));				//fxaaConsole360ConstDir
-
-
-		}
 		
 		diff /= w;
 	}
 		
-	gl_FragColor = diff;
+	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
+	gl_FragColor = diff + bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index 1f1057d8f75..c2754347772 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -29,2090 +29,17 @@
 out vec4 gl_FragColor;
 #endif
 
-#define FXAA_PC 1
-//#define FXAA_GLSL_130 1
-#define FXAA_QUALITY__PRESET 12
+uniform sampler2DRect diffuseRect;
+uniform sampler2D bloomMap;
 
-/*============================================================================
-
-
-                    NVIDIA FXAA 3.11 by TIMOTHY LOTTES
-
-
-------------------------------------------------------------------------------
-COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
-------------------------------------------------------------------------------
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
-*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
-OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
-CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
-LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
-OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
-THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-------------------------------------------------------------------------------
-                           INTEGRATION CHECKLIST
-------------------------------------------------------------------------------
-(1.)
-In the shader source, setup defines for the desired configuration.
-When providing multiple shaders (for different presets),
-simply setup the defines differently in multiple files.
-Example,
-
-  #define FXAA_PC 1
-  #define FXAA_HLSL_5 1
-  #define FXAA_QUALITY__PRESET 12
-
-Or,
-
-  #define FXAA_360 1
-  
-Or,
-
-  #define FXAA_PS3 1
-  
-Etc.
-
-(2.)
-Then include this file,
-
-  #include "Fxaa3_11.h"
-
-(3.)
-Then call the FXAA pixel shader from within your desired shader.
-Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
-As for FXAA 3.11 all inputs for all shaders are the same 
-to enable easy porting between platforms.
-
-  return FxaaPixelShader(...);
-
-(4.)
-Insure pass prior to FXAA outputs RGBL (see next section).
-Or use,
-
-  #define FXAA_GREEN_AS_LUMA 1
-
-(5.)
-Setup engine to provide the following constants
-which are used in the FxaaPixelShader() inputs,
-
-  FxaaFloat2 fxaaQualityRcpFrame,
-  FxaaFloat4 fxaaConsoleRcpFrameOpt,
-  FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-  FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-  FxaaFloat fxaaQualitySubpix,
-  FxaaFloat fxaaQualityEdgeThreshold,
-  FxaaFloat fxaaQualityEdgeThresholdMin,
-  FxaaFloat fxaaConsoleEdgeSharpness,
-  FxaaFloat fxaaConsoleEdgeThreshold,
-  FxaaFloat fxaaConsoleEdgeThresholdMin,
-  FxaaFloat4 fxaaConsole360ConstDir
-
-Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
-
-(6.)
-Have FXAA vertex shader run as a full screen triangle,
-and output "pos" and "fxaaConsolePosPos" 
-such that inputs in the pixel shader provide,
-
-  // {xy} = center of pixel
-  FxaaFloat2 pos,
-
-  // {xy__} = upper left of pixel
-  // {__zw} = lower right of pixel
-  FxaaFloat4 fxaaConsolePosPos,
-
-(7.)
-Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
-
-
-------------------------------------------------------------------------------
-                    INTEGRATION - RGBL AND COLORSPACE
-------------------------------------------------------------------------------
-FXAA3 requires RGBL as input unless the following is set, 
-
-  #define FXAA_GREEN_AS_LUMA 1
-
-In which case the engine uses green in place of luma,
-and requires RGB input is in a non-linear colorspace.
-
-RGB should be LDR (low dynamic range).
-Specifically do FXAA after tonemapping.
-
-RGB data as returned by a texture fetch can be non-linear,
-or linear when FXAA_GREEN_AS_LUMA is not set.
-Note an "sRGB format" texture counts as linear,
-because the result of a texture fetch is linear data.
-Regular "RGBA8" textures in the sRGB colorspace are non-linear.
-
-If FXAA_GREEN_AS_LUMA is not set,
-luma must be stored in the alpha channel prior to running FXAA.
-This luma should be in a perceptual space (could be gamma 2.0).
-Example pass before FXAA where output is gamma 2.0 encoded,
-
-  color.rgb = ToneMap(color.rgb); // linear color output
-  color.rgb = sqrt(color.rgb);    // gamma 2.0 color output
-  return color;
-
-To use FXAA,
-
-  color.rgb = ToneMap(color.rgb);  // linear color output
-  color.rgb = sqrt(color.rgb);     // gamma 2.0 color output
-  color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
-  return color;
-
-Another example where output is linear encoded,
-say for instance writing to an sRGB formated render target,
-where the render target does the conversion back to sRGB after blending,
-
-  color.rgb = ToneMap(color.rgb); // linear color output
-  return color;
-
-To use FXAA,
-
-  color.rgb = ToneMap(color.rgb); // linear color output
-  color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
-  return color;
-
-Getting luma correct is required for the algorithm to work correctly.
-
-
-------------------------------------------------------------------------------
-                          BEING LINEARLY CORRECT?
-------------------------------------------------------------------------------
-Applying FXAA to a framebuffer with linear RGB color will look worse.
-This is very counter intuitive, but happends to be true in this case.
-The reason is because dithering artifacts will be more visiable 
-in a linear colorspace.
-
-
-------------------------------------------------------------------------------
-                             COMPLEX INTEGRATION
-------------------------------------------------------------------------------
-Q. What if the engine is blending into RGB before wanting to run FXAA?
-
-A. In the last opaque pass prior to FXAA,
-   have the pass write out luma into alpha.
-   Then blend into RGB only.
-   FXAA should be able to run ok
-   assuming the blending pass did not any add aliasing.
-   This should be the common case for particles and common blending passes.
-
-A. Or use FXAA_GREEN_AS_LUMA.
-
-============================================================================*/
-
-/*============================================================================
-
-                             INTEGRATION KNOBS
-
-============================================================================*/
-//
-// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
-// FXAA_360_OPT is a prototype for the new optimized 360 version.
-//
-// 1 = Use API.
-// 0 = Don't use API.
-//
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PS3
-    #define FXAA_PS3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360
-    #define FXAA_360 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360_OPT
-    #define FXAA_360_OPT 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_PC
-    //
-    // FXAA Quality
-    // The high quality PC algorithm.
-    //
-    #define FXAA_PC 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PC_CONSOLE
-    //
-    // The console algorithm for PC is included
-    // for developers targeting really low spec machines.
-    // Likely better to just run FXAA_PC, and use a really low preset.
-    //
-    #define FXAA_PC_CONSOLE 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_120
-    #define FXAA_GLSL_120 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_130
-    #define FXAA_GLSL_130 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_3
-    #define FXAA_HLSL_3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_4
-    #define FXAA_HLSL_4 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_5
-    #define FXAA_HLSL_5 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_GREEN_AS_LUMA
-    //
-    // For those using non-linear color,
-    // and either not able to get luma in alpha, or not wanting to,
-    // this enables FXAA to run using green as a proxy for luma.
-    // So with this enabled, no need to pack luma in alpha.
-    //
-    // This will turn off AA on anything which lacks some amount of green.
-    // Pure red and blue or combination of only R and B, will get no AA.
-    //
-    // Might want to lower the settings for both,
-    //    fxaaConsoleEdgeThresholdMin
-    //    fxaaQualityEdgeThresholdMin
-    // In order to insure AA does not get turned off on colors 
-    // which contain a minor amount of green.
-    //
-    // 1 = On.
-    // 0 = Off.
-    //
-    #define FXAA_GREEN_AS_LUMA 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_EARLY_EXIT
-    //
-    // Controls algorithm's early exit path.
-    // On PS3 turning this ON adds 2 cycles to the shader.
-    // On 360 turning this OFF adds 10ths of a millisecond to the shader.
-    // Turning this off on console will result in a more blurry image.
-    // So this defaults to on.
-    //
-    // 1 = On.
-    // 0 = Off.
-    //
-    #define FXAA_EARLY_EXIT 1
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_DISCARD
-    //
-    // Only valid for PC OpenGL currently.
-    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
-    //
-    // 1 = Use discard on pixels which don't need AA.
-    //     For APIs which enable concurrent TEX+ROP from same surface.
-    // 0 = Return unchanged color on pixels which don't need AA.
-    //
-    #define FXAA_DISCARD 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_FAST_PIXEL_OFFSET
-    //
-    // Used for GLSL 120 only.
-    //
-    // 1 = GL API supports fast pixel offsets
-    // 0 = do not use fast pixel offsets
-    //
-    #ifdef GL_EXT_gpu_shader4
-        #define FXAA_FAST_PIXEL_OFFSET 1
-    #endif
-    #ifdef GL_NV_gpu_shader5
-        #define FXAA_FAST_PIXEL_OFFSET 1
-    #endif
-    #ifdef GL_ARB_gpu_shader5
-        #define FXAA_FAST_PIXEL_OFFSET 1
-    #endif
-    #ifndef FXAA_FAST_PIXEL_OFFSET
-        #define FXAA_FAST_PIXEL_OFFSET 0
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GATHER4_ALPHA
-    //
-    // 1 = API supports gather4 on alpha channel.
-    // 0 = API does not support gather4 on alpha channel.
-    //
-    #if (FXAA_HLSL_5 == 1)
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifdef GL_ARB_gpu_shader5
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifdef GL_NV_gpu_shader5
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifndef FXAA_GATHER4_ALPHA
-        #define FXAA_GATHER4_ALPHA 0
-    #endif
-#endif
-
-/*============================================================================
-                      FXAA CONSOLE PS3 - TUNING KNOBS
-============================================================================*/
-#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
-    //
-    // Consoles the sharpness of edges on PS3 only.
-    // Non-PS3 tuning is done with shader input.
-    //
-    // Due to the PS3 being ALU bound,
-    // there are only two safe values here: 4 and 8.
-    // These options use the shaders ability to a free *|/ by 2|4|8.
-    //
-    // 8.0 is sharper
-    // 4.0 is softer
-    // 2.0 is really soft (good for vector graphics inputs)
-    //
-    #if 1
-        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
-    #endif
-    #if 0
-        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
-    #endif
-    #if 0
-        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
-    //
-    // Only effects PS3.
-    // Non-PS3 tuning is done with shader input.
-    //
-    // The minimum amount of local contrast required to apply algorithm.
-    // The console setting has a different mapping than the quality setting.
-    //
-    // This only applies when FXAA_EARLY_EXIT is 1.
-    //
-    // Due to the PS3 being ALU bound,
-    // there are only two safe values here: 0.25 and 0.125.
-    // These options use the shaders ability to a free *|/ by 2|4|8.
-    //
-    // 0.125 leaves less aliasing, but is softer
-    // 0.25 leaves more aliasing, and is sharper
-    //
-    #if 1
-        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
-    #else
-        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
-    #endif
-#endif
-
-/*============================================================================
-                        FXAA QUALITY - TUNING KNOBS
-------------------------------------------------------------------------------
-NOTE the other tuning knobs are now in the shader function inputs!
-============================================================================*/
-#ifndef FXAA_QUALITY__PRESET
-    //
-    // Choose the quality preset.
-    // This needs to be compiled into the shader as it effects code.
-    // Best option to include multiple presets is to 
-    // in each shader define the preset, then include this file.
-    // 
-    // OPTIONS
-    // -----------------------------------------------------------------------
-    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
-    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
-    // 39       - no dither, very expensive 
-    //
-    // NOTES
-    // -----------------------------------------------------------------------
-    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
-    // 13 = about same speed as FXAA 3.9 and better than 12
-    // 23 = closest to FXAA 3.9 visually and performance wise
-    //  _ = the lowest digit is directly related to performance
-    // _  = the highest digit is directly related to style
-    // 
-    #define FXAA_QUALITY__PRESET 12
-#endif
-
-
-/*============================================================================
-
-                           FXAA QUALITY - PRESETS
-
-============================================================================*/
-
-/*============================================================================
-                     FXAA QUALITY - MEDIUM DITHER PRESETS
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 10)
-    #define FXAA_QUALITY__PS 3
-    #define FXAA_QUALITY__P0 1.5
-    #define FXAA_QUALITY__P1 3.0
-    #define FXAA_QUALITY__P2 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 11)
-    #define FXAA_QUALITY__PS 4
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 3.0
-    #define FXAA_QUALITY__P3 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 12)
-    #define FXAA_QUALITY__PS 5
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 4.0
-    #define FXAA_QUALITY__P4 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 13)
-    #define FXAA_QUALITY__PS 6
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 4.0
-    #define FXAA_QUALITY__P5 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 14)
-    #define FXAA_QUALITY__PS 7
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 4.0
-    #define FXAA_QUALITY__P6 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 15)
-    #define FXAA_QUALITY__PS 8
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 4.0
-    #define FXAA_QUALITY__P7 12.0
-#endif
-
-/*============================================================================
-                     FXAA QUALITY - LOW DITHER PRESETS
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 20)
-    #define FXAA_QUALITY__PS 3
-    #define FXAA_QUALITY__P0 1.5
-    #define FXAA_QUALITY__P1 2.0
-    #define FXAA_QUALITY__P2 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 21)
-    #define FXAA_QUALITY__PS 4
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 22)
-    #define FXAA_QUALITY__PS 5
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 23)
-    #define FXAA_QUALITY__PS 6
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 24)
-    #define FXAA_QUALITY__PS 7
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 3.0
-    #define FXAA_QUALITY__P6 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 25)
-    #define FXAA_QUALITY__PS 8
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 4.0
-    #define FXAA_QUALITY__P7 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 26)
-    #define FXAA_QUALITY__PS 9
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 4.0
-    #define FXAA_QUALITY__P8 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 27)
-    #define FXAA_QUALITY__PS 10
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 4.0
-    #define FXAA_QUALITY__P9 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 28)
-    #define FXAA_QUALITY__PS 11
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 2.0
-    #define FXAA_QUALITY__P9 4.0
-    #define FXAA_QUALITY__P10 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 29)
-    #define FXAA_QUALITY__PS 12
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.5
-    #define FXAA_QUALITY__P2 2.0
-    #define FXAA_QUALITY__P3 2.0
-    #define FXAA_QUALITY__P4 2.0
-    #define FXAA_QUALITY__P5 2.0
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 2.0
-    #define FXAA_QUALITY__P9 2.0
-    #define FXAA_QUALITY__P10 4.0
-    #define FXAA_QUALITY__P11 8.0
-#endif
-
-/*============================================================================
-                     FXAA QUALITY - EXTREME QUALITY
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 39)
-    #define FXAA_QUALITY__PS 12
-    #define FXAA_QUALITY__P0 1.0
-    #define FXAA_QUALITY__P1 1.0
-    #define FXAA_QUALITY__P2 1.0
-    #define FXAA_QUALITY__P3 1.0
-    #define FXAA_QUALITY__P4 1.0
-    #define FXAA_QUALITY__P5 1.5
-    #define FXAA_QUALITY__P6 2.0
-    #define FXAA_QUALITY__P7 2.0
-    #define FXAA_QUALITY__P8 2.0
-    #define FXAA_QUALITY__P9 2.0
-    #define FXAA_QUALITY__P10 4.0
-    #define FXAA_QUALITY__P11 8.0
-#endif
-
-
-
-/*============================================================================
-
-                                API PORTING
-
-============================================================================*/
-#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
-    #define FxaaBool bool
-    #define FxaaDiscard discard
-    #define FxaaFloat float
-    #define FxaaFloat2 vec2
-    #define FxaaFloat3 vec3
-    #define FxaaFloat4 vec4
-    #define FxaaHalf float
-    #define FxaaHalf2 vec2
-    #define FxaaHalf3 vec3
-    #define FxaaHalf4 vec4
-    #define FxaaInt2 ivec2
-    #define FxaaSat(x) clamp(x, 0.0, 1.0)
-    #define FxaaTex sampler2D
-#else
-    #define FxaaBool bool
-    #define FxaaDiscard clip(-1)
-    #define FxaaFloat float
-    #define FxaaFloat2 float2
-    #define FxaaFloat3 float3
-    #define FxaaFloat4 float4
-    #define FxaaHalf half
-    #define FxaaHalf2 half2
-    #define FxaaHalf3 half3
-    #define FxaaHalf4 half4
-    #define FxaaSat(x) saturate(x)
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_GLSL_120 == 1)
-    // Requires,
-    //  #version 120
-    // And at least,
-    //  #extension GL_EXT_gpu_shader4 : enable
-    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
-    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
-    #if (FXAA_FAST_PIXEL_OFFSET == 1)
-        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
-    #else
-        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
-    #endif
-    #if (FXAA_GATHER4_ALPHA == 1)
-        // use #extension GL_ARB_gpu_shader5 : enable
-        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
-        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
-        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
-        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_GLSL_130 == 1)
-    // Requires "#version 130" or better
-    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
-    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
-    #if (FXAA_GATHER4_ALPHA == 1)
-        // use #extension GL_ARB_gpu_shader5 : enable
-        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
-        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
-        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
-        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
-    #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
-    #define FxaaInt2 float2
-    #define FxaaTex sampler2D
-    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
-    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_4 == 1)
-    #define FxaaInt2 int2
-    struct FxaaTex { SamplerState smpl; Texture2D tex; };
-    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
-    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_5 == 1)
-    #define FxaaInt2 int2
-    struct FxaaTex { SamplerState smpl; Texture2D tex; };
-    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
-    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
-    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
-    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
-    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
-    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
-#endif
-
-
-/*============================================================================
-                   GREEN AS LUMA OPTION SUPPORT FUNCTION
-============================================================================*/
-#if (FXAA_GREEN_AS_LUMA == 0)
-    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
-#else
-    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
-#endif    
-
-
-
-
-/*============================================================================
-
-                             FXAA3 QUALITY - PC
-
-============================================================================*/
-#if (FXAA_PC == 1)
-/*--------------------------------------------------------------------------*/
-FxaaFloat4 FxaaPixelShader(
-    //
-    // Use noperspective interpolation here (turn off perspective interpolation).
-    // {xy} = center of pixel
-    FxaaFloat2 pos,
-    //
-    // Used only for FXAA Console, and not used on the 360 version.
-    // Use noperspective interpolation here (turn off perspective interpolation).
-    // {xy__} = upper left of pixel
-    // {__zw} = lower right of pixel
-    FxaaFloat4 fxaaConsolePosPos,
-    //
-    // Input color texture.
-    // {rgb_} = color in linear or perceptual color space
-    // if (FXAA_GREEN_AS_LUMA == 0)
-    //     {___a} = luma in perceptual color space (not linear)
-    FxaaTex tex,
-    //
-    // Only used on the optimized 360 version of FXAA Console.
-    // For everything but 360, just use the same input here as for "tex".
-    // For 360, same texture, just alias with a 2nd sampler.
-    // This sampler needs to have an exponent bias of -1.
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    //
-    // Only used on the optimized 360 version of FXAA Console.
-    // For everything but 360, just use the same input here as for "tex".
-    // For 360, same texture, just alias with a 3nd sampler.
-    // This sampler needs to have an exponent bias of -2.
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    //
-    // Only used on FXAA Quality.
-    // This must be from a constant/uniform.
-    // {x_} = 1.0/screenWidthInPixels
-    // {_y} = 1.0/screenHeightInPixels
-    FxaaFloat2 fxaaQualityRcpFrame,
-    //
-    // Only used on FXAA Console.
-    // This must be from a constant/uniform.
-    // This effects sub-pixel AA quality and inversely sharpness.
-    //   Where N ranges between,
-    //     N = 0.50 (default)
-    //     N = 0.33 (sharper)
-    // {x___} = -N/screenWidthInPixels  
-    // {_y__} = -N/screenHeightInPixels
-    // {__z_} =  N/screenWidthInPixels  
-    // {___w} =  N/screenHeightInPixels 
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    //
-    // Only used on FXAA Console.
-    // Not used on 360, but used on PS3 and PC.
-    // This must be from a constant/uniform.
-    // {x___} = -2.0/screenWidthInPixels  
-    // {_y__} = -2.0/screenHeightInPixels
-    // {__z_} =  2.0/screenWidthInPixels  
-    // {___w} =  2.0/screenHeightInPixels 
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    //
-    // Only used on FXAA Console.
-    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
-    // This must be from a constant/uniform.
-    // {x___} =  8.0/screenWidthInPixels  
-    // {_y__} =  8.0/screenHeightInPixels
-    // {__z_} = -4.0/screenWidthInPixels  
-    // {___w} = -4.0/screenHeightInPixels 
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    //
-    // Only used on FXAA Quality.
-    // This used to be the FXAA_QUALITY__SUBPIX define.
-    // It is here now to allow easier tuning.
-    // Choose the amount of sub-pixel aliasing removal.
-    // This can effect sharpness.
-    //   1.00 - upper limit (softer)
-    //   0.75 - default amount of filtering
-    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
-    //   0.25 - almost off
-    //   0.00 - completely off
-    FxaaFloat fxaaQualitySubpix,
-    //
-    // Only used on FXAA Quality.
-    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
-    // It is here now to allow easier tuning.
-    // The minimum amount of local contrast required to apply algorithm.
-    //   0.333 - too little (faster)
-    //   0.250 - low quality
-    //   0.166 - default
-    //   0.125 - high quality 
-    //   0.063 - overkill (slower)
-    FxaaFloat fxaaQualityEdgeThreshold,
-    //
-    // Only used on FXAA Quality.
-    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
-    // It is here now to allow easier tuning.
-    // Trims the algorithm from processing darks.
-    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
-    //   0.0625 - high quality (faster)
-    //   0.0312 - visible limit (slower)
-    // Special notes when using FXAA_GREEN_AS_LUMA,
-    //   Likely want to set this to zero.
-    //   As colors that are mostly not-green
-    //   will appear very dark in the green channel!
-    //   Tune by looking at mostly non-green content,
-    //   then start at zero and increase until aliasing is a problem.
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    // 
-    // Only used on FXAA Console.
-    // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
-    // It is here now to allow easier tuning.
-    // This does not effect PS3, as this needs to be compiled in.
-    //   Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
-    //   Due to the PS3 being ALU bound,
-    //   there are only three safe values here: 2 and 4 and 8.
-    //   These options use the shaders ability to a free *|/ by 2|4|8.
-    // For all other platforms can be a non-power of two.
-    //   8.0 is sharper (default!!!)
-    //   4.0 is softer
-    //   2.0 is really soft (good only for vector graphics inputs)
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    //
-    // Only used on FXAA Console.
-    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
-    // It is here now to allow easier tuning.
-    // This does not effect PS3, as this needs to be compiled in.
-    //   Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
-    //   Due to the PS3 being ALU bound,
-    //   there are only two safe values here: 1/4 and 1/8.
-    //   These options use the shaders ability to a free *|/ by 2|4|8.
-    // The console setting has a different mapping than the quality setting.
-    // Other platforms can use other values.
-    //   0.125 leaves less aliasing, but is softer (default!!!)
-    //   0.25 leaves more aliasing, and is sharper
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    //
-    // Only used on FXAA Console.
-    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
-    // It is here now to allow easier tuning.
-    // Trims the algorithm from processing darks.
-    // The console setting has a different mapping than the quality setting.
-    // This only applies when FXAA_EARLY_EXIT is 1.
-    // This does not apply to PS3, 
-    // PS3 was simplified to avoid more shader instructions.
-    //   0.06 - faster but more aliasing in darks
-    //   0.05 - default
-    //   0.04 - slower and less aliasing in darks
-    // Special notes when using FXAA_GREEN_AS_LUMA,
-    //   Likely want to set this to zero.
-    //   As colors that are mostly not-green
-    //   will appear very dark in the green channel!
-    //   Tune by looking at mostly non-green content,
-    //   then start at zero and increase until aliasing is a problem.
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    //    
-    // Extra constants for 360 FXAA Console only.
-    // Use zeros or anything else for other platforms.
-    // These must be in physical constant registers and NOT immedates.
-    // Immedates will result in compiler un-optimizing.
-    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 posM;
-    posM.x = pos.x;
-    posM.y = pos.y;
-    #if (FXAA_GATHER4_ALPHA == 1)
-        #if (FXAA_DISCARD == 0)
-            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
-            #if (FXAA_GREEN_AS_LUMA == 0)
-                #define lumaM rgbyM.w
-            #else
-                #define lumaM rgbyM.y
-            #endif
-        #endif
-        #if (FXAA_GREEN_AS_LUMA == 0)
-            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
-            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
-        #else
-            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
-            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
-        #endif
-        #if (FXAA_DISCARD == 1)
-            #define lumaM luma4A.w
-        #endif
-        #define lumaE luma4A.z
-        #define lumaS luma4A.x
-        #define lumaSE luma4A.y
-        #define lumaNW luma4B.w
-        #define lumaN luma4B.z
-        #define lumaW luma4B.x
-    #else
-        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
-        #if (FXAA_GREEN_AS_LUMA == 0)
-            #define lumaM rgbyM.w
-        #else
-            #define lumaM rgbyM.y
-        #endif
-        FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
-    #endif
-/*--------------------------------------------------------------------------*/
-    FxaaFloat maxSM = max(lumaS, lumaM);
-    FxaaFloat minSM = min(lumaS, lumaM);
-    FxaaFloat maxESM = max(lumaE, maxSM);
-    FxaaFloat minESM = min(lumaE, minSM);
-    FxaaFloat maxWN = max(lumaN, lumaW);
-    FxaaFloat minWN = min(lumaN, lumaW);
-    FxaaFloat rangeMax = max(maxWN, maxESM);
-    FxaaFloat rangeMin = min(minWN, minESM);
-    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
-    FxaaFloat range = rangeMax - rangeMin;
-    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
-    FxaaBool earlyExit = range < rangeMaxClamped;
-/*--------------------------------------------------------------------------*/
-    if(earlyExit)
-        #if (FXAA_DISCARD == 1)
-            FxaaDiscard;
-        #else
-            return rgbyM;
-        #endif
-/*--------------------------------------------------------------------------*/
-    #if (FXAA_GATHER4_ALPHA == 0)
-        FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
-    #else
-        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
-        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
-    #endif
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNS = lumaN + lumaS;
-    FxaaFloat lumaWE = lumaW + lumaE;
-    FxaaFloat subpixRcpRange = 1.0/range;
-    FxaaFloat subpixNSWE = lumaNS + lumaWE;
-    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
-    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNESE = lumaNE + lumaSE;
-    FxaaFloat lumaNWNE = lumaNW + lumaNE;
-    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
-    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNWSW = lumaNW + lumaSW;
-    FxaaFloat lumaSWSE = lumaSW + lumaSE;
-    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
-    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
-    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
-    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
-    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
-    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
-    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
-    FxaaBool horzSpan = edgeHorz >= edgeVert;
-    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
-/*--------------------------------------------------------------------------*/
-    if(!horzSpan) lumaN = lumaW;
-    if(!horzSpan) lumaS = lumaE;
-    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
-    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat gradientN = lumaN - lumaM;
-    FxaaFloat gradientS = lumaS - lumaM;
-    FxaaFloat lumaNN = lumaN + lumaM;
-    FxaaFloat lumaSS = lumaS + lumaM;
-    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
-    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
-    if(pairN) lengthSign = -lengthSign;
-    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 posB;
-    posB.x = posM.x;
-    posB.y = posM.y;
-    FxaaFloat2 offNP;
-    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
-    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
-    if(!horzSpan) posB.x += lengthSign * 0.5;
-    if( horzSpan) posB.y += lengthSign * 0.5;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 posN;
-    posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
-    posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
-    FxaaFloat2 posP;
-    posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
-    posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
-    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
-    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
-    FxaaFloat subpixE = subpixC * subpixC;
-    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
-/*--------------------------------------------------------------------------*/
-    if(!pairN) lumaNN = lumaSS;
-    FxaaFloat gradientScaled = gradient * 1.0/4.0;
-    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
-    FxaaFloat subpixF = subpixD * subpixE;
-    FxaaBool lumaMLTZero = lumaMM < 0.0;
-/*--------------------------------------------------------------------------*/
-    lumaEndN -= lumaNN * 0.5;
-    lumaEndP -= lumaNN * 0.5;
-    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
-    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
-    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
-    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
-    FxaaBool doneNP = (!doneN) || (!doneP);
-    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
-    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
-/*--------------------------------------------------------------------------*/
-    if(doneNP) {
-        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-        doneN = abs(lumaEndN) >= gradientScaled;
-        doneP = abs(lumaEndP) >= gradientScaled;
-        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
-        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
-        doneNP = (!doneN) || (!doneP);
-        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
-        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
-/*--------------------------------------------------------------------------*/
-        #if (FXAA_QUALITY__PS > 3)
-        if(doneNP) {
-            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-            doneN = abs(lumaEndN) >= gradientScaled;
-            doneP = abs(lumaEndP) >= gradientScaled;
-            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
-            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
-            doneNP = (!doneN) || (!doneP);
-            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
-            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
-/*--------------------------------------------------------------------------*/
-            #if (FXAA_QUALITY__PS > 4)
-            if(doneNP) {
-                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                doneN = abs(lumaEndN) >= gradientScaled;
-                doneP = abs(lumaEndP) >= gradientScaled;
-                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
-                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
-                doneNP = (!doneN) || (!doneP);
-                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
-                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
-/*--------------------------------------------------------------------------*/
-                #if (FXAA_QUALITY__PS > 5)
-                if(doneNP) {
-                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                    doneN = abs(lumaEndN) >= gradientScaled;
-                    doneP = abs(lumaEndP) >= gradientScaled;
-                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
-                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
-                    doneNP = (!doneN) || (!doneP);
-                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
-                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
-/*--------------------------------------------------------------------------*/
-                    #if (FXAA_QUALITY__PS > 6)
-                    if(doneNP) {
-                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                        doneN = abs(lumaEndN) >= gradientScaled;
-                        doneP = abs(lumaEndP) >= gradientScaled;
-                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
-                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
-                        doneNP = (!doneN) || (!doneP);
-                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
-                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
-/*--------------------------------------------------------------------------*/
-                        #if (FXAA_QUALITY__PS > 7)
-                        if(doneNP) {
-                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                            doneN = abs(lumaEndN) >= gradientScaled;
-                            doneP = abs(lumaEndP) >= gradientScaled;
-                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
-                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
-                            doneNP = (!doneN) || (!doneP);
-                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
-                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
-/*--------------------------------------------------------------------------*/
-    #if (FXAA_QUALITY__PS > 8)
-    if(doneNP) {
-        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-        doneN = abs(lumaEndN) >= gradientScaled;
-        doneP = abs(lumaEndP) >= gradientScaled;
-        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
-        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
-        doneNP = (!doneN) || (!doneP);
-        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
-        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
-/*--------------------------------------------------------------------------*/
-        #if (FXAA_QUALITY__PS > 9)
-        if(doneNP) {
-            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-            doneN = abs(lumaEndN) >= gradientScaled;
-            doneP = abs(lumaEndP) >= gradientScaled;
-            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
-            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
-            doneNP = (!doneN) || (!doneP);
-            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
-            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
-/*--------------------------------------------------------------------------*/
-            #if (FXAA_QUALITY__PS > 10)
-            if(doneNP) {
-                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                doneN = abs(lumaEndN) >= gradientScaled;
-                doneP = abs(lumaEndP) >= gradientScaled;
-                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
-                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
-                doneNP = (!doneN) || (!doneP);
-                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
-                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
-/*--------------------------------------------------------------------------*/
-                #if (FXAA_QUALITY__PS > 11)
-                if(doneNP) {
-                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                    doneN = abs(lumaEndN) >= gradientScaled;
-                    doneP = abs(lumaEndP) >= gradientScaled;
-                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
-                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
-                    doneNP = (!doneN) || (!doneP);
-                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
-                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
-/*--------------------------------------------------------------------------*/
-                    #if (FXAA_QUALITY__PS > 12)
-                    if(doneNP) {
-                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
-                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
-                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
-                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
-                        doneN = abs(lumaEndN) >= gradientScaled;
-                        doneP = abs(lumaEndP) >= gradientScaled;
-                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
-                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
-                        doneNP = (!doneN) || (!doneP);
-                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
-                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
-/*--------------------------------------------------------------------------*/
-                    }
-                    #endif
-/*--------------------------------------------------------------------------*/
-                }
-                #endif
-/*--------------------------------------------------------------------------*/
-            }
-            #endif
-/*--------------------------------------------------------------------------*/
-        }
-        #endif
-/*--------------------------------------------------------------------------*/
-    }
-    #endif
-/*--------------------------------------------------------------------------*/
-                        }
-                        #endif
-/*--------------------------------------------------------------------------*/
-                    }
-                    #endif
-/*--------------------------------------------------------------------------*/
-                }
-                #endif
-/*--------------------------------------------------------------------------*/
-            }
-            #endif
-/*--------------------------------------------------------------------------*/
-        }
-        #endif
-/*--------------------------------------------------------------------------*/
-    }
-/*--------------------------------------------------------------------------*/
-    FxaaFloat dstN = posM.x - posN.x;
-    FxaaFloat dstP = posP.x - posM.x;
-    if(!horzSpan) dstN = posM.y - posN.y;
-    if(!horzSpan) dstP = posP.y - posM.y;
-/*--------------------------------------------------------------------------*/
-    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
-    FxaaFloat spanLength = (dstP + dstN);
-    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
-    FxaaFloat spanLengthRcp = 1.0/spanLength;
-/*--------------------------------------------------------------------------*/
-    FxaaBool directionN = dstN < dstP;
-    FxaaFloat dst = min(dstN, dstP);
-    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
-    FxaaFloat subpixG = subpixF * subpixF;
-    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
-    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
-    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
-    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
-    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
-    #if (FXAA_DISCARD == 1)
-        return FxaaTexTop(tex, posM);
-    #else
-        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
-    #endif
-}
-/*==========================================================================*/
-#endif
-
-
-
-
-/*============================================================================
-
-                         FXAA3 CONSOLE - PC VERSION
-                         
-------------------------------------------------------------------------------
-Instead of using this on PC, I'd suggest just using FXAA Quality with
-    #define FXAA_QUALITY__PRESET 10
-Or 
-    #define FXAA_QUALITY__PRESET 20
-Either are higher qualilty and almost as fast as this on modern PC GPUs.
-============================================================================*/
-#if (FXAA_PC_CONSOLE == 1)
-/*--------------------------------------------------------------------------*/
-FxaaFloat4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
-    FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
-    FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
-    FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
-/*--------------------------------------------------------------------------*/
-    FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        FxaaFloat lumaM = rgbyM.w;
-    #else
-        FxaaFloat lumaM = rgbyM.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
-    lumaNe += 1.0/384.0;
-    FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
-    FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
-    FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat lumaMinM = min(lumaMin, lumaM);
-    FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
-    FxaaFloat lumaMaxM = max(lumaMax, lumaM);
-    FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
-    FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
-    FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
-    if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 dir;
-    dir.x = dirSwMinusNe + dirSeMinusNw;
-    dir.y = dirSwMinusNe - dirSeMinusNw;
-/*--------------------------------------------------------------------------*/
-    FxaaFloat2 dir1 = normalize(dir.xy);
-    FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
-    FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
-    FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
-    FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
-/*--------------------------------------------------------------------------*/
-    FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
-    FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
-/*--------------------------------------------------------------------------*/
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
-    #else
-        FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
-    #endif
-    if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
-    return rgbyB; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
-                      FXAA3 CONSOLE - 360 PIXEL SHADER 
-
-------------------------------------------------------------------------------
-This optimized version thanks to suggestions from Andy Luedke.
-Should be fully tex bound in all cases.
-As of the FXAA 3.11 release, I have still not tested this code,
-however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
-And note this is replacing the old unoptimized version.
-If it does not work, please let me know so I can fix it.
-============================================================================*/
-#if (FXAA_360 == 1)
-/*--------------------------------------------------------------------------*/
-[reduceTempRegUsage(4)]
-float4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-    float4 lumaNwNeSwSe;
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        asm { 
-            tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
-        };
-    #else
-        asm { 
-            tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
-            tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
-        };
-    #endif
-/*--------------------------------------------------------------------------*/
-    lumaNwNeSwSe.y += 1.0/384.0;
-    float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
-    float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
-    float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
-    float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
-/*--------------------------------------------------------------------------*/
-    float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        float lumaMinM = min(lumaMin, rgbyM.w);
-        float lumaMaxM = max(lumaMax, rgbyM.w);
-    #else
-        float lumaMinM = min(lumaMin, rgbyM.y);
-        float lumaMaxM = max(lumaMax, rgbyM.y);
-    #endif        
-    if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
-/*--------------------------------------------------------------------------*/
-    float2 dir;
-    dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
-    dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
-    dir = normalize(dir);
-/*--------------------------------------------------------------------------*/
-    float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
-/*--------------------------------------------------------------------------*/
-    float4 dir2;
-    float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
-    dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
-    dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
-/*--------------------------------------------------------------------------*/
-    float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
-    float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
-    float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
-    float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
-    float4 rgbyA = rgbyN1 + rgbyP1;
-    float4 rgbyB = rgbyN2 + rgbyP2 * 0.5 + rgbyA;
-/*--------------------------------------------------------------------------*/
-    float4 rgbyR = ((rgbyB.w - lumaMax) > 0.0) ? rgbyA : rgbyB;
-    rgbyR = ((rgbyB.w - lumaMin) > 0.0) ? rgbyR : rgbyA;
-    return rgbyR; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
-         FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
-
-==============================================================================
-The code below does not exactly match the assembly.
-I have a feeling that 12 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
-  --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-------------------------------------------------------------------------------
-                             NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
-  0: texpkb h0.w(TRUE), v5.zyxx, #0
-  2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
-  4: texpkb h0.w(TRUE), v5.xwxx, #0
-  6: addh h0.z(TRUE), -h2, h0.w
-  7: texpkb h1.w(TRUE), v5, #0
-  9: addh h0.x(TRUE), h0.z, -h1.w
- 10: addh h3.w(TRUE), h0.z, h1
- 11: texpkb h2.w(TRUE), v5.zwzz, #0
- 13: addh h0.z(TRUE), h3.w, -h2.w
- 14: addh h0.x(TRUE), h2.w, h0
- 15: nrmh h1.xz(TRUE), h0_n
- 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
- 17: maxh h4.w(TRUE), h0, h1
- 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
- 19: movr r1.zw(TRUE), v4.xxxy
- 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
- 22: minh h5.w(TRUE), h0, h1
- 23: texpkb h0(TRUE), r2.xzxx, #0
- 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
- 27: maxh h4.x(TRUE), h2.z, h2.w
- 28: texpkb h1(TRUE), r0.zwzz, #0
- 30: addh_d2 h1(TRUE), h0, h1
- 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 33: texpkb h0(TRUE), r0, #0
- 35: minh h4.z(TRUE), h2, h2.w
- 36: fenct TRUE
- 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 39: texpkb h2(TRUE), r1, #0
- 41: addh_d2 h0(TRUE), h0, h2
- 42: maxh h2.w(TRUE), h4, h4.x
- 43: minh h2.x(TRUE), h5.w, h4.z
- 44: addh_d2 h0(TRUE), h0, h1
- 45: slth h2.x(TRUE), h0.w, h2
- 46: sgth h2.w(TRUE), h0, h2
- 47: movh h0(TRUE), h0
- 48: addx.c0 rc(TRUE), h2, h2.w
- 49: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass |  Unit  |  uOp |  PC:  Op
------+--------+------+-------------------------
-   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |   SCB1 |  add |   2:  ADDh h2.z, h0.--w-, const.--x-;
-     |        |      |
-   2 | SCT0/1 |  mov |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |    TEX |  txl |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |   SCB1 |  add |   6:  ADDh h0.z,-h2, h0.--w-;
-     |        |      |
-   3 | SCT0/1 |  mov |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
-     |    TEX |  txl |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
-     |   SCB0 |  add |   9:  ADDh h0.x, h0.z---,-h1.w---;
-     |   SCB1 |  add |  10:  ADDh h3.w, h0.---z, h1;
-     |        |      |
-   4 | SCT0/1 |  mov |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |    TEX |  txl |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |   SCB0 |  add |  14:  ADDh h0.x, h2.w---, h0;
-     |   SCB1 |  add |  13:  ADDh h0.z, h3.--w-,-h2.--w-;
-     |        |      |
-   5 |   SCT1 |  mov |  15:  NRMh h1.xz, h0;
-     |    SRB |  nrm |  15:  NRMh h1.xz, h0;
-     |   SCB0 |  min |  16:  MINh*8 h0.x, |h1|, |h1.z---|;
-     |   SCB1 |  max |  17:  MAXh h4.w, h0, h1;
-     |        |      |
-   6 |   SCT0 |  div |  18:  DIVx h2.xy, h1.xz--, h0;
-     |   SCT1 |  mov |  19:  MOVr r1.zw, g[TEX0].--xy;
-     |   SCB0 |  mad |  20:  MADr r2.xz,-h1, const.z-w-, r1.z-w-;
-     |   SCB1 |  min |  22:  MINh h5.w, h0, h1;
-     |        |      |
-   7 | SCT0/1 |  mov |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
-     |    TEX |  txl |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
-     |   SCB0 |  max |  27:  MAXh h4.x, h2.z---, h2.w---;
-     |   SCB1 |  mad |  25:  MADr r0.zw, h1.--xz, const, r1;
-     |        |      |
-   8 | SCT0/1 |  mov |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
-     |    TEX |  txl |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
-     | SCB0/1 |  add |  30:  ADDh/2 h1, h0, h1;
-     |        |      |
-   9 |   SCT0 |  mad |  31:  MADr r0.xy,-h2, const.xy--, r1.zw--;
-     |   SCT1 |  mov |  33:  TXLr h0, r0, const.zzzz, TEX0;
-     |    TEX |  txl |  33:  TXLr h0, r0, const.zzzz, TEX0;
-     |   SCB1 |  min |  35:  MINh h4.z, h2, h2.--w-;
-     |        |      |
-  10 |   SCT0 |  mad |  37:  MADr r1.xy, h2, const.xy--, r1.zw--;
-     |   SCT1 |  mov |  39:  TXLr h2, r1, const.zzzz, TEX0;
-     |    TEX |  txl |  39:  TXLr h2, r1, const.zzzz, TEX0;
-     | SCB0/1 |  add |  41:  ADDh/2 h0, h0, h2;
-     |        |      |
-  11 |   SCT0 |  min |  43:  MINh h2.x, h5.w---, h4.z---;
-     |   SCT1 |  max |  42:  MAXh h2.w, h4, h4.---x;
-     | SCB0/1 |  add |  44:  ADDh/2 h0, h0, h1;
-     |        |      |
-  12 |   SCT0 |  set |  45:  SLTh h2.x, h0.w---, h2;
-     |   SCT1 |  set |  46:  SGTh h2.w, h0, h2;
-     | SCB0/1 |  mul |  47:  MOVh h0, h0;
-     |        |      |
-  13 |   SCT0 |  mad |  48:  ADDxc0_s rc, h2, h2.w---;
-     | SCB0/1 |  mul |  49:  MOVh h0(NE0.xxxx), h1;
- 
-Pass   SCT  TEX  SCB
-  1:   0% 100%  25%
-  2:   0% 100%  25%
-  3:   0% 100%  50%
-  4:   0% 100%  50%
-  5:   0%   0%  50%
-  6: 100%   0%  75%
-  7:   0% 100%  75%
-  8:   0% 100% 100%
-  9:   0% 100%  25%
- 10:   0% 100% 100%
- 11:  50%   0% 100%
- 12:  50%   0% 100%
- 13:  25%   0% 100%
-
-MEAN:  17%  61%  67%
-
-Pass   SCT0  SCT1   TEX  SCB0  SCB1
-  1:    0%    0%  100%    0%  100%
-  2:    0%    0%  100%    0%  100%
-  3:    0%    0%  100%  100%  100%
-  4:    0%    0%  100%  100%  100%
-  5:    0%    0%    0%  100%  100%
-  6:  100%  100%    0%  100%  100%
-  7:    0%    0%  100%  100%  100%
-  8:    0%    0%  100%  100%  100%
-  9:    0%    0%  100%    0%  100%
- 10:    0%    0%  100%  100%  100%
- 11:  100%  100%    0%  100%  100%
- 12:  100%  100%    0%  100%  100%
- 13:  100%    0%    0%  100%  100%
-
-MEAN:   30%   23%   61%   76%  100%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 13 cycles, 3 r regs, 923,076,923 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
-/*--------------------------------------------------------------------------*/
-#pragma regcount 7
-#pragma disablepc all
-#pragma option O3
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
-    half4 dir;
-    half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        lumaNe.w += half(1.0/512.0);
-        dir.x = -lumaNe.w;
-        dir.z = -lumaNe.w;
-    #else
-        lumaNe.y += half(1.0/512.0);
-        dir.x = -lumaNe.y;
-        dir.z = -lumaNe.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (2)
-    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x += lumaSw.w;
-        dir.z += lumaSw.w;
-    #else
-        dir.x += lumaSw.y;
-        dir.z += lumaSw.y;
-    #endif        
-/*--------------------------------------------------------------------------*/
-// (3)
-    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x -= lumaNw.w;
-        dir.z += lumaNw.w;
-    #else
-        dir.x -= lumaNw.y;
-        dir.z += lumaNw.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (4)
-    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x += lumaSe.w;
-        dir.z -= lumaSe.w;
-    #else
-        dir.x += lumaSe.y;
-        dir.z -= lumaSe.y;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (5)
-    half4 dir1_pos;
-    dir1_pos.xy = normalize(dir.xyz).xz;
-    half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (6)
-    half4 dir2_pos;
-    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
-    dir1_pos.zw = pos.xy;
-    dir2_pos.zw = pos.xy;
-    half4 temp1N;
-    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (7)
-    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
-    half4 rgby1;
-    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (8)
-    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
-    rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (9)
-    half4 temp2N;
-    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
-// (10)
-    half4 rgby2;
-    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
-    rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (11)
-    // compilier moves these scalar ops up to other cycles
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
-        half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
-    #else
-        half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
-        half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
-    #endif        
-    rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (12)
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        bool twoTapLt = rgby2.w < lumaMin;
-        bool twoTapGt = rgby2.w > lumaMax;
-    #else
-        bool twoTapLt = rgby2.y < lumaMin;
-        bool twoTapGt = rgby2.y > lumaMax;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (13)
-    if(twoTapLt || twoTapGt) rgby2 = rgby1;
-/*--------------------------------------------------------------------------*/
-    return rgby2; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
-       FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
-
-==============================================================================
-The code mostly matches the assembly.
-I have a feeling that 14 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
- --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
-Will look at fixing this for FXAA 3.12.
-------------------------------------------------------------------------------
-                             NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
-  0: texpkb h0.w(TRUE), v5.zyxx, #0
-  2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
-  4: texpkb h1.w(TRUE), v5.xwxx, #0
-  6: addh h0.x(TRUE), h1.w, -h2.y
-  7: texpkb h2.w(TRUE), v5.zwzz, #0
-  9: minh h4.w(TRUE), h2.y, h2
- 10: maxh h5.x(TRUE), h2.y, h2.w
- 11: texpkb h0.w(TRUE), v5, #0
- 13: addh h3.w(TRUE), -h0, h0.x
- 14: addh h0.x(TRUE), h0.w, h0
- 15: addh h0.z(TRUE), -h2.w, h0.x
- 16: addh h0.x(TRUE), h2.w, h3.w
- 17: minh h5.y(TRUE), h0.w, h1.w
- 18: nrmh h2.xz(TRUE), h0_n
- 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
- 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
- 21: movr r1.zw(TRUE), v4.xxxy
- 22: maxh h2.w(TRUE), h0, h1
- 23: fenct TRUE
- 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 26: texpkb h0(TRUE), r0, #0
- 28: maxh h5.x(TRUE), h2.w, h5
- 29: minh h5.w(TRUE), h5.y, h4
- 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 32: texpkb h2(TRUE), r1, #0
- 34: addh_d2 h2(TRUE), h0, h2
- 35: texpkb h1(TRUE), v4, #0
- 37: maxh h5.y(TRUE), h5.x, h1.w
- 38: minh h4.w(TRUE), h1, h5
- 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 41: texpkb h0(TRUE), r0, #0
- 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
- 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 46: texpkb h3(TRUE), r2, #0
- 48: addh_d2 h0(TRUE), h0, h3
- 49: addh_d2 h3(TRUE), h0, h2
- 50: movh h0(TRUE), h3
- 51: slth h3.x(TRUE), h3.w, h5.w
- 52: sgth h3.w(TRUE), h3, h5.x
- 53: addx.c0 rc(TRUE), h3.x, h3
- 54: slth.c0 rc(TRUE), h5.z, h5
- 55: movh h0(c0.NE.w), h2
- 56: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass |  Unit  |  uOp |  PC:  Op
------+--------+------+-------------------------
-   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
-     |   SCB0 |  add |   2:  ADDh h2.y, h0.-w--, const.-x--;
-     |        |      |
-   2 | SCT0/1 |  mov |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |    TEX |  txl |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
-     |   SCB0 |  add |   6:  ADDh h0.x, h1.w---,-h2.y---;
-     |        |      |
-   3 | SCT0/1 |  mov |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |    TEX |  txl |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
-     |   SCB0 |  max |  10:  MAXh h5.x, h2.y---, h2.w---;
-     |   SCB1 |  min |   9:  MINh h4.w, h2.---y, h2;
-     |        |      |
-   4 | SCT0/1 |  mov |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
-     |    TEX |  txl |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
-     |   SCB0 |  add |  14:  ADDh h0.x, h0.w---, h0;
-     |   SCB1 |  add |  13:  ADDh h3.w,-h0, h0.---x;
-     |        |      |
-   5 |   SCT0 |  mad |  16:  ADDh h0.x, h2.w---, h3.w---;
-     |   SCT1 |  mad |  15:  ADDh h0.z,-h2.--w-, h0.--x-;
-     |   SCB0 |  min |  17:  MINh h5.y, h0.-w--, h1.-w--;
-     |        |      |
-   6 |   SCT1 |  mov |  18:  NRMh h2.xz, h0;
-     |    SRB |  nrm |  18:  NRMh h2.xz, h0;
-     |   SCB1 |  min |  19:  MINh*8 h2.w, |h2.---x|, |h2.---z|;
-     |        |      |
-   7 |   SCT0 |  div |  20:  DIVx h4.xy, h2.xz--, h2.ww--;
-     |   SCT1 |  mov |  21:  MOVr r1.zw, g[TEX0].--xy;
-     |   SCB1 |  max |  22:  MAXh h2.w, h0, h1;
-     |        |      |
-   8 |   SCT0 |  mad |  24:  MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
-     |   SCT1 |  mov |  26:  TXLr h0, r0, const.xxxx, TEX0;
-     |    TEX |  txl |  26:  TXLr h0, r0, const.xxxx, TEX0;
-     |   SCB0 |  max |  28:  MAXh h5.x, h2.w---, h5;
-     |   SCB1 |  min |  29:  MINh h5.w, h5.---y, h4;
-     |        |      |
-   9 |   SCT0 |  mad |  30:  MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
-     |   SCT1 |  mov |  32:  TXLr h2, r1, const.xxxx, TEX0;
-     |    TEX |  txl |  32:  TXLr h2, r1, const.xxxx, TEX0;
-     | SCB0/1 |  add |  34:  ADDh/2 h2, h0, h2;
-     |        |      |
-  10 | SCT0/1 |  mov |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
-     |    TEX |  txl |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
-     |   SCB0 |  max |  37:  MAXh h5.y, h5.-x--, h1.-w--;
-     |   SCB1 |  min |  38:  MINh h4.w, h1, h5;
-     |        |      |
-  11 |   SCT0 |  mad |  39:  MADr r0.xy,-h4, const.xy--, r1.zw--;
-     |   SCT1 |  mov |  41:  TXLr h0, r0, const.zzzz, TEX0;
-     |    TEX |  txl |  41:  TXLr h0, r0, const.zzzz, TEX0;
-     |   SCB0 |  mad |  44:  MADr r2.xy, h4, const.xy--, r1.zw--;
-     |   SCB1 |  add |  43:  ADDh*8 h5.z, h5.--y-,-h4.--w-;
-     |        |      |
-  12 | SCT0/1 |  mov |  46:  TXLr h3, r2, const.xxxx, TEX0;
-     |    TEX |  txl |  46:  TXLr h3, r2, const.xxxx, TEX0;
-     | SCB0/1 |  add |  48:  ADDh/2 h0, h0, h3;
-     |        |      |
-  13 | SCT0/1 |  mad |  49:  ADDh/2 h3, h0, h2;
-     | SCB0/1 |  mul |  50:  MOVh h0, h3;
-     |        |      |
-  14 |   SCT0 |  set |  51:  SLTh h3.x, h3.w---, h5.w---;
-     |   SCT1 |  set |  52:  SGTh h3.w, h3, h5.---x;
-     |   SCB0 |  set |  54:  SLThc0 rc, h5.z---, h5;
-     |   SCB1 |  add |  53:  ADDxc0_s rc, h3.---x, h3;
-     |        |      |
-  15 | SCT0/1 |  mul |  55:  MOVh h0(NE0.wwww), h2;
-     | SCB0/1 |  mul |  56:  MOVh h0(NE0.xxxx), h1;
- 
-Pass   SCT  TEX  SCB
-  1:   0% 100%  25%
-  2:   0% 100%  25%
-  3:   0% 100%  50%
-  4:   0% 100%  50%
-  5:  50%   0%  25%
-  6:   0%   0%  25%
-  7: 100%   0%  25%
-  8:   0% 100%  50%
-  9:   0% 100% 100%
- 10:   0% 100%  50%
- 11:   0% 100%  75%
- 12:   0% 100% 100%
- 13: 100%   0% 100%
- 14:  50%   0%  50%
- 15: 100%   0% 100%
-
-MEAN:  26%  60%  56%
-
-Pass   SCT0  SCT1   TEX  SCB0  SCB1
-  1:    0%    0%  100%  100%    0%
-  2:    0%    0%  100%  100%    0%
-  3:    0%    0%  100%  100%  100%
-  4:    0%    0%  100%  100%  100%
-  5:  100%  100%    0%  100%    0%
-  6:    0%    0%    0%    0%  100%
-  7:  100%  100%    0%    0%  100%
-  8:    0%    0%  100%  100%  100%
-  9:    0%    0%  100%  100%  100%
- 10:    0%    0%  100%  100%  100%
- 11:    0%    0%  100%  100%  100%
- 12:    0%    0%  100%  100%  100%
- 13:  100%  100%    0%  100%  100%
- 14:  100%  100%    0%  100%  100%
- 15:  100%  100%    0%  100%  100%
-
-MEAN:   33%   33%   60%   86%   80%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 15 cycles, 3 r regs, 800,000,000 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
-/*--------------------------------------------------------------------------*/
-#pragma regcount 7
-#pragma disablepc all
-#pragma option O2
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
-    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
-    FxaaFloat2 pos,
-    FxaaFloat4 fxaaConsolePosPos,
-    FxaaTex tex,
-    FxaaTex fxaaConsole360TexExpBiasNegOne,
-    FxaaTex fxaaConsole360TexExpBiasNegTwo,
-    FxaaFloat2 fxaaQualityRcpFrame,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt,
-    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
-    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
-    FxaaFloat fxaaQualitySubpix,
-    FxaaFloat fxaaQualityEdgeThreshold,
-    FxaaFloat fxaaQualityEdgeThresholdMin,
-    FxaaFloat fxaaConsoleEdgeSharpness,
-    FxaaFloat fxaaConsoleEdgeThreshold,
-    FxaaFloat fxaaConsoleEdgeThresholdMin,
-    FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
-    half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaNe = rgbyNe.w + half(1.0/512.0);
-    #else
-        half lumaNe = rgbyNe.y + half(1.0/512.0);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (2)
-    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaSwNegNe = lumaSw.w - lumaNe;
-    #else
-        half lumaSwNegNe = lumaSw.y - lumaNe;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (3)
-    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
-        half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
-    #else
-        half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
-        half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (4)
-    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half dirZ =  lumaNw.w + lumaSwNegNe;
-        half dirX = -lumaNw.w + lumaSwNegNe;
-    #else
-        half dirZ =  lumaNw.y + lumaSwNegNe;
-        half dirX = -lumaNw.y + lumaSwNegNe;
-    #endif
-/*--------------------------------------------------------------------------*/
-// (5)
-    half3 dir;
-    dir.y = 0.0;
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        dir.x =  lumaSe.w + dirX;
-        dir.z = -lumaSe.w + dirZ;
-        half lumaMinNeSe = min(lumaNe, lumaSe.w);
-    #else
-        dir.x =  lumaSe.y + dirX;
-        dir.z = -lumaSe.y + dirZ;
-        half lumaMinNeSe = min(lumaNe, lumaSe.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (6)
-    half4 dir1_pos;
-    dir1_pos.xy = normalize(dir).xz;
-    half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (7)
-    half4 dir2_pos;
-    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
-    dir1_pos.zw = pos.xy;
-    dir2_pos.zw = pos.xy;
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMaxNeSe = max(lumaNe, lumaSe.w);
-    #else
-        half lumaMaxNeSe = max(lumaNe, lumaSe.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (8)
-    half4 temp1N;
-    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
-    half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
-    half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
-/*--------------------------------------------------------------------------*/
-// (9)
-    half4 rgby1;
-    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
-    rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (10)
-    half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        half lumaMaxM = max(lumaMax, rgbyM.w);
-        half lumaMinM = min(lumaMin, rgbyM.w);
-    #else
-        half lumaMaxM = max(lumaMax, rgbyM.y);
-        half lumaMinM = min(lumaMin, rgbyM.y);
-    #endif
-/*--------------------------------------------------------------------------*/
-// (11)
-    half4 temp2N;
-    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
-    half4 rgby2;
-    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
-    half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
-/*--------------------------------------------------------------------------*/
-// (12)
-    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
-    rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (13)
-    rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (14)
-    #if (FXAA_GREEN_AS_LUMA == 0)
-        bool twoTapLt = rgby2.w < lumaMin;
-        bool twoTapGt = rgby2.w > lumaMax;
-    #else
-        bool twoTapLt = rgby2.y < lumaMin;
-        bool twoTapGt = rgby2.y > lumaMax;
-    #endif
-    bool earlyExit = lumaRangeM < lumaMax;
-    bool twoTap = twoTapLt || twoTapGt;
-/*--------------------------------------------------------------------------*/
-// (15)
-    if(twoTap) rgby2 = rgby1;
-    if(earlyExit) rgby2 = rgbyM;
-/*--------------------------------------------------------------------------*/
-    return rgby2; }
-/*==========================================================================*/
-#endif
-
-uniform sampler2D diffuseMap;
-
-uniform vec2 rcp_screen_res;
-uniform vec4 rcp_frame_opt;
-uniform vec4 rcp_frame_opt2;
 uniform vec2 screen_res;
 VARYING vec2 vary_fragcoord;
-VARYING vec2 vary_tc;
 
 void main() 
 {
-	vec4 diff =			FxaaPixelShader(vary_tc,			//pos
-										vec4(vary_fragcoord.xy, 0, 0), //fxaaConsolePosPos
-										diffuseMap,					//tex
-										diffuseMap,					
-										diffuseMap,
-										rcp_screen_res,				//fxaaQualityRcpFrame
-										vec4(0,0,0,0),				//fxaaConsoleRcpFrameOpt
-										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
-										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
-										0.75,						//fxaaQualitySubpix
-										0.07,						//fxaaQualityEdgeThreshold
-										0.03,						//fxaaQualityEdgeThresholdMin
-										8.0,						//fxaaConsoleEdgeSharpness
-										0.125,						//fxaaConsoleEdgeThreshold
-										0.05,						//fxaaConsoleEdgeThresholdMin
-										vec4(0,0,0,0));				//fxaaConsole360ConstDir
-
-
-
-	//diff = texture2D(diffuseMap, vary_tc);
-	
-	gl_FragColor = diff;
+	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
+	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
+	gl_FragColor = diff + bloom;
 }
+
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 9fb804a74f3..d22e5f0af29 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -187,21 +187,6 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue)
 	return true;
 }
 
-static bool handleFSAASamplesChanged(const LLSD& newvalue)
-{
-	if (gPipeline.isInit())
-	{
-		gPipeline.releaseGLBuffers();
-		gPipeline.createGLBuffers();
-
-		if (LLPipeline::sRenderDeferred)
-		{
-			LLViewerShaderMgr::instance()->setShaders();
-		}
-	}
-	return true;
-}
-
 static bool handleAnisotropicChanged(const LLSD& newvalue)
 {
 	LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean();
@@ -603,7 +588,6 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
-	gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleFSAASamplesChanged, _2));
 	gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2));
 	gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 8e59a7c32db..48d4471bdf2 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -187,6 +187,7 @@ LLGLSLShader			gDeferredGIProgram;
 LLGLSLShader			gDeferredGIFinalProgram;
 LLGLSLShader			gDeferredPostGIProgram;
 LLGLSLShader			gDeferredPostProgram;
+LLGLSLShader			gFXAAProgram;
 LLGLSLShader			gDeferredPostNoDoFProgram;
 LLGLSLShader			gDeferredWLSkyProgram;
 LLGLSLShader			gDeferredWLCloudProgram;
@@ -275,6 +276,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gDeferredPostGIProgram);
 	mShaderList.push_back(&gDeferredEdgeProgram);
 	mShaderList.push_back(&gDeferredPostProgram);
+	mShaderList.push_back(&gFXAAProgram);
 	mShaderList.push_back(&gDeferredGIProgram);
 	mShaderList.push_back(&gDeferredGIFinalProgram);
 	mShaderList.push_back(&gDeferredWaterProgram);
@@ -463,7 +465,6 @@ void LLViewerShaderMgr::setShaders()
 
 
 	//setup preprocessor definitions
-	LLShaderMgr::instance()->mDefinitions["samples"] = llformat("%d", gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples")));
 	LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits);
 
 	reentrance = true;
@@ -1032,9 +1033,6 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
 {
 	BOOL success = TRUE;
 
-	U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples"));
-	bool multisample = samples > 1 && LLPipeline::sRenderDeferred && gGLManager.mHasTextureMultisample;
-
 	if (mVertexShaderLevel[SHADER_EFFECT] == 0)
 	{
 		gGlowProgram.unload();
@@ -1060,21 +1058,10 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
 	
 	if (success)
 	{
-		std::string fragment;
-
-		if (multisample)
-		{
-			fragment = "effects/glowExtractMSF.glsl";
-		}
-		else
-		{
-			fragment = "effects/glowExtractF.glsl";
-		}
-
 		gGlowExtractProgram.mName = "Glow Extract Shader (Post)";
 		gGlowExtractProgram.mShaderFiles.clear();
 		gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB));
-		gGlowExtractProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
 		success = gGlowExtractProgram.createShader(NULL, &mGlowExtractUniforms);
 		if (!success)
@@ -1124,6 +1111,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredPostGIProgram.unload();		
 		gDeferredEdgeProgram.unload();		
 		gDeferredPostProgram.unload();		
+		gFXAAProgram.unload();
 		gLuminanceGatherProgram.unload();
 		gDeferredGIProgram.unload();
 		gDeferredGIFinalProgram.unload();
@@ -1138,9 +1126,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 
 	BOOL success = TRUE;
 
-	U32 samples = gSavedSettings.getU32("RenderFSAASamples");
-	bool multisample = samples > 1;
-
 	if (success)
 	{
 		gDeferredDiffuseProgram.mName = "Deferred Diffuse Shader";
@@ -1524,40 +1509,30 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 
 	if (success)
 	{
-		std::string fragment;
-		if (multisample)
-		{
-			fragment = "deferred/postDeferredF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/postDeferredNoFXAAF.glsl";
-		}
+		gFXAAProgram.mName = "FXAA Shader";
+		gFXAAProgram.mShaderFiles.clear();
+		gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/fxaaF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gFXAAProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		success = gFXAAProgram.createShader(NULL, NULL);
+	}
 
+	if (success)
+	{
 		gDeferredPostProgram.mName = "Deferred Post Shader";
 		gDeferredPostProgram.mShaderFiles.clear();
 		gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredPostProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredPostProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredPostProgram.createShader(NULL, NULL);
 	}
 
 	if (success)
 	{
-		std::string fragment;
-		if (multisample)
-		{
-			fragment = "deferred/postDeferredNoDoFF.glsl";
-		}
-		else
-		{
-			fragment = "deferred/postDeferredNoDoFNoFXAAF.glsl";
-		}
-
 		gDeferredPostNoDoFProgram.mName = "Deferred Post Shader";
 		gDeferredPostNoDoFProgram.mShaderFiles.clear();
 		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDOFF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredPostNoDoFProgram.createShader(NULL, NULL);
 	}
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 9988d1d4f73..aeb8553fa18 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -392,6 +392,7 @@ extern LLGLSLShader			gDeferredShadowProgram;
 extern LLGLSLShader			gDeferredShadowAlphaMaskProgram;
 extern LLGLSLShader			gDeferredPostGIProgram;
 extern LLGLSLShader			gDeferredPostProgram;
+extern LLGLSLShader			gFXAAProgram;
 extern LLGLSLShader			gDeferredPostNoDoFProgram;
 extern LLGLSLShader			gDeferredAvatarShadowProgram;
 extern LLGLSLShader			gDeferredAttachmentShadowProgram;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 2bbb2edc1a1..db9675650af 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6358,8 +6358,39 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			gGL.vertex2f(3,-1);
 			gGL.end();
 
+			gGL.flush();
+
 			gGlowCombineFXAAProgram.unbind();
 			mFXAABuffer.flush();
+
+			mScreen.bindTarget();
+			LLGLSLShader* shader = &gFXAAProgram;
+			shader->bind();
+
+			S32 channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
+			if (channel > -1)
+			{
+				mFXAABuffer.bindTexture(0, channel);
+				gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
+			}
+
+			
+			F32 scale_x = (F32) width/mFXAABuffer.getWidth();
+			F32 scale_y = (F32) height/mFXAABuffer.getHeight();
+			shader->uniform2f("tc_scale", scale_x, scale_y);
+			shader->uniform2f("rcp_screen_res", 1.f/width*scale_x, 1.f/height*scale_y);
+			shader->uniform4f("rcp_frame_opt", -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
+			shader->uniform4f("rcp_frame_opt2", -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
+
+			gGL.begin(LLRender::TRIANGLE_STRIP);
+			gGL.vertex2f(-1,-1);
+			gGL.vertex2f(-1,3);
+			gGL.vertex2f(3,-1);
+			gGL.end();
+
+			gGL.flush();
+			mScreen.flush();
+			shader->unbind();
 		}
 
 		gViewerWindow->setup3DViewport();
@@ -6382,13 +6413,6 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		S32 width = mScreen.getWidth();
 		S32 height = mScreen.getHeight();
 		
-		F32 scale_x = (F32) width/mFXAABuffer.getWidth();
-		F32 scale_y = (F32) height/mFXAABuffer.getHeight();
-		shader->uniform2f("tc_scale", scale_x, scale_y);
-		shader->uniform2f("rcp_screen_res", 1.f/width*scale_x, 1.f/height*scale_y);
-		shader->uniform4f("rcp_frame_opt", -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
-		shader->uniform4f("rcp_frame_opt2", -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
-
 		if (dof_enabled)
 		{
 			//depth of field focal plane calculations
@@ -6501,24 +6525,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			shader->uniform1f("magnification", magnification);
 		}
 
-		if (multisample)
-		{
-			S32 channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
-			if (channel > -1)
-			{
-				mFXAABuffer.bindTexture(0, channel);
-				gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-			}
-		}
-		else
+		S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+		if (channel > -1)
 		{
-			S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
-			if (channel > -1)
-			{
-				mScreen.bindTexture(0, channel);
-			}
+			mScreen.bindTexture(0, channel);
 		}
-
 	
 		gGL.begin(LLRender::TRIANGLE_STRIP);
 		gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-- 
GitLab


From 22d52ab5833850c88a3b143123aef2142b836c70 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 23:04:10 -0500
Subject: [PATCH 078/933] SH-2465 Move FXAA to its own pass independent of DoF
 (also removes the need to reload shaders when toggling FSAA on and off)

---
 .../shaders/class1/deferred/fxaaF.glsl        | 2118 +++++++++++++++++
 .../deferred/postDeferredNoDoFNoFXAAF.glsl    |   45 -
 .../class1/deferred/postDeferredNoFXAAF.glsl  |  157 --
 .../class1/effects/glowExtractMSF.glsl        |   60 -
 4 files changed, 2118 insertions(+), 262 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl

diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
new file mode 100644
index 00000000000..5af94064526
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
@@ -0,0 +1,2118 @@
+/** 
+ * @file fxaaF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+#extension GL_ARB_texture_rectangle : enable
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+#define FXAA_PC 1
+//#define FXAA_GLSL_130 1
+#define FXAA_QUALITY__PRESET 12
+
+/*============================================================================
+
+
+                    NVIDIA FXAA 3.11 by TIMOTHY LOTTES
+
+
+------------------------------------------------------------------------------
+COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
+------------------------------------------------------------------------------
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
+OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
+CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
+LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
+OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
+THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+------------------------------------------------------------------------------
+                           INTEGRATION CHECKLIST
+------------------------------------------------------------------------------
+(1.)
+In the shader source, setup defines for the desired configuration.
+When providing multiple shaders (for different presets),
+simply setup the defines differently in multiple files.
+Example,
+
+  #define FXAA_PC 1
+  #define FXAA_HLSL_5 1
+  #define FXAA_QUALITY__PRESET 12
+
+Or,
+
+  #define FXAA_360 1
+  
+Or,
+
+  #define FXAA_PS3 1
+  
+Etc.
+
+(2.)
+Then include this file,
+
+  #include "Fxaa3_11.h"
+
+(3.)
+Then call the FXAA pixel shader from within your desired shader.
+Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
+As for FXAA 3.11 all inputs for all shaders are the same 
+to enable easy porting between platforms.
+
+  return FxaaPixelShader(...);
+
+(4.)
+Insure pass prior to FXAA outputs RGBL (see next section).
+Or use,
+
+  #define FXAA_GREEN_AS_LUMA 1
+
+(5.)
+Setup engine to provide the following constants
+which are used in the FxaaPixelShader() inputs,
+
+  FxaaFloat2 fxaaQualityRcpFrame,
+  FxaaFloat4 fxaaConsoleRcpFrameOpt,
+  FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+  FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+  FxaaFloat fxaaQualitySubpix,
+  FxaaFloat fxaaQualityEdgeThreshold,
+  FxaaFloat fxaaQualityEdgeThresholdMin,
+  FxaaFloat fxaaConsoleEdgeSharpness,
+  FxaaFloat fxaaConsoleEdgeThreshold,
+  FxaaFloat fxaaConsoleEdgeThresholdMin,
+  FxaaFloat4 fxaaConsole360ConstDir
+
+Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
+
+(6.)
+Have FXAA vertex shader run as a full screen triangle,
+and output "pos" and "fxaaConsolePosPos" 
+such that inputs in the pixel shader provide,
+
+  // {xy} = center of pixel
+  FxaaFloat2 pos,
+
+  // {xy__} = upper left of pixel
+  // {__zw} = lower right of pixel
+  FxaaFloat4 fxaaConsolePosPos,
+
+(7.)
+Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
+
+
+------------------------------------------------------------------------------
+                    INTEGRATION - RGBL AND COLORSPACE
+------------------------------------------------------------------------------
+FXAA3 requires RGBL as input unless the following is set, 
+
+  #define FXAA_GREEN_AS_LUMA 1
+
+In which case the engine uses green in place of luma,
+and requires RGB input is in a non-linear colorspace.
+
+RGB should be LDR (low dynamic range).
+Specifically do FXAA after tonemapping.
+
+RGB data as returned by a texture fetch can be non-linear,
+or linear when FXAA_GREEN_AS_LUMA is not set.
+Note an "sRGB format" texture counts as linear,
+because the result of a texture fetch is linear data.
+Regular "RGBA8" textures in the sRGB colorspace are non-linear.
+
+If FXAA_GREEN_AS_LUMA is not set,
+luma must be stored in the alpha channel prior to running FXAA.
+This luma should be in a perceptual space (could be gamma 2.0).
+Example pass before FXAA where output is gamma 2.0 encoded,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  color.rgb = sqrt(color.rgb);    // gamma 2.0 color output
+  return color;
+
+To use FXAA,
+
+  color.rgb = ToneMap(color.rgb);  // linear color output
+  color.rgb = sqrt(color.rgb);     // gamma 2.0 color output
+  color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
+  return color;
+
+Another example where output is linear encoded,
+say for instance writing to an sRGB formated render target,
+where the render target does the conversion back to sRGB after blending,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  return color;
+
+To use FXAA,
+
+  color.rgb = ToneMap(color.rgb); // linear color output
+  color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
+  return color;
+
+Getting luma correct is required for the algorithm to work correctly.
+
+
+------------------------------------------------------------------------------
+                          BEING LINEARLY CORRECT?
+------------------------------------------------------------------------------
+Applying FXAA to a framebuffer with linear RGB color will look worse.
+This is very counter intuitive, but happends to be true in this case.
+The reason is because dithering artifacts will be more visiable 
+in a linear colorspace.
+
+
+------------------------------------------------------------------------------
+                             COMPLEX INTEGRATION
+------------------------------------------------------------------------------
+Q. What if the engine is blending into RGB before wanting to run FXAA?
+
+A. In the last opaque pass prior to FXAA,
+   have the pass write out luma into alpha.
+   Then blend into RGB only.
+   FXAA should be able to run ok
+   assuming the blending pass did not any add aliasing.
+   This should be the common case for particles and common blending passes.
+
+A. Or use FXAA_GREEN_AS_LUMA.
+
+============================================================================*/
+
+/*============================================================================
+
+                             INTEGRATION KNOBS
+
+============================================================================*/
+//
+// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
+// FXAA_360_OPT is a prototype for the new optimized 360 version.
+//
+// 1 = Use API.
+// 0 = Don't use API.
+//
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_PS3
+    #define FXAA_PS3 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_360
+    #define FXAA_360 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_360_OPT
+    #define FXAA_360_OPT 0
+#endif
+/*==========================================================================*/
+#ifndef FXAA_PC
+    //
+    // FXAA Quality
+    // The high quality PC algorithm.
+    //
+    #define FXAA_PC 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_PC_CONSOLE
+    //
+    // The console algorithm for PC is included
+    // for developers targeting really low spec machines.
+    // Likely better to just run FXAA_PC, and use a really low preset.
+    //
+    #define FXAA_PC_CONSOLE 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GLSL_120
+    #define FXAA_GLSL_120 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GLSL_130
+    #define FXAA_GLSL_130 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_3
+    #define FXAA_HLSL_3 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_4
+    #define FXAA_HLSL_4 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_HLSL_5
+    #define FXAA_HLSL_5 0
+#endif
+/*==========================================================================*/
+#ifndef FXAA_GREEN_AS_LUMA
+    //
+    // For those using non-linear color,
+    // and either not able to get luma in alpha, or not wanting to,
+    // this enables FXAA to run using green as a proxy for luma.
+    // So with this enabled, no need to pack luma in alpha.
+    //
+    // This will turn off AA on anything which lacks some amount of green.
+    // Pure red and blue or combination of only R and B, will get no AA.
+    //
+    // Might want to lower the settings for both,
+    //    fxaaConsoleEdgeThresholdMin
+    //    fxaaQualityEdgeThresholdMin
+    // In order to insure AA does not get turned off on colors 
+    // which contain a minor amount of green.
+    //
+    // 1 = On.
+    // 0 = Off.
+    //
+    #define FXAA_GREEN_AS_LUMA 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_EARLY_EXIT
+    //
+    // Controls algorithm's early exit path.
+    // On PS3 turning this ON adds 2 cycles to the shader.
+    // On 360 turning this OFF adds 10ths of a millisecond to the shader.
+    // Turning this off on console will result in a more blurry image.
+    // So this defaults to on.
+    //
+    // 1 = On.
+    // 0 = Off.
+    //
+    #define FXAA_EARLY_EXIT 1
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_DISCARD
+    //
+    // Only valid for PC OpenGL currently.
+    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
+    //
+    // 1 = Use discard on pixels which don't need AA.
+    //     For APIs which enable concurrent TEX+ROP from same surface.
+    // 0 = Return unchanged color on pixels which don't need AA.
+    //
+    #define FXAA_DISCARD 0
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_FAST_PIXEL_OFFSET
+    //
+    // Used for GLSL 120 only.
+    //
+    // 1 = GL API supports fast pixel offsets
+    // 0 = do not use fast pixel offsets
+    //
+    #ifdef GL_EXT_gpu_shader4
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifdef GL_NV_gpu_shader5
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifdef GL_ARB_gpu_shader5
+        #define FXAA_FAST_PIXEL_OFFSET 1
+    #endif
+    #ifndef FXAA_FAST_PIXEL_OFFSET
+        #define FXAA_FAST_PIXEL_OFFSET 0
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_GATHER4_ALPHA
+    //
+    // 1 = API supports gather4 on alpha channel.
+    // 0 = API does not support gather4 on alpha channel.
+    //
+    #if (FXAA_HLSL_5 == 1)
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifdef GL_ARB_gpu_shader5
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifdef GL_NV_gpu_shader5
+        #define FXAA_GATHER4_ALPHA 1
+    #endif
+    #ifndef FXAA_GATHER4_ALPHA
+        #define FXAA_GATHER4_ALPHA 0
+    #endif
+#endif
+
+/*============================================================================
+                      FXAA CONSOLE PS3 - TUNING KNOBS
+============================================================================*/
+#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
+    //
+    // Consoles the sharpness of edges on PS3 only.
+    // Non-PS3 tuning is done with shader input.
+    //
+    // Due to the PS3 being ALU bound,
+    // there are only two safe values here: 4 and 8.
+    // These options use the shaders ability to a free *|/ by 2|4|8.
+    //
+    // 8.0 is sharper
+    // 4.0 is softer
+    // 2.0 is really soft (good for vector graphics inputs)
+    //
+    #if 1
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
+    #endif
+    #if 0
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
+    #endif
+    #if 0
+        #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
+    //
+    // Only effects PS3.
+    // Non-PS3 tuning is done with shader input.
+    //
+    // The minimum amount of local contrast required to apply algorithm.
+    // The console setting has a different mapping than the quality setting.
+    //
+    // This only applies when FXAA_EARLY_EXIT is 1.
+    //
+    // Due to the PS3 being ALU bound,
+    // there are only two safe values here: 0.25 and 0.125.
+    // These options use the shaders ability to a free *|/ by 2|4|8.
+    //
+    // 0.125 leaves less aliasing, but is softer
+    // 0.25 leaves more aliasing, and is sharper
+    //
+    #if 1
+        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
+    #else
+        #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
+    #endif
+#endif
+
+/*============================================================================
+                        FXAA QUALITY - TUNING KNOBS
+------------------------------------------------------------------------------
+NOTE the other tuning knobs are now in the shader function inputs!
+============================================================================*/
+#ifndef FXAA_QUALITY__PRESET
+    //
+    // Choose the quality preset.
+    // This needs to be compiled into the shader as it effects code.
+    // Best option to include multiple presets is to 
+    // in each shader define the preset, then include this file.
+    // 
+    // OPTIONS
+    // -----------------------------------------------------------------------
+    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
+    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
+    // 39       - no dither, very expensive 
+    //
+    // NOTES
+    // -----------------------------------------------------------------------
+    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
+    // 13 = about same speed as FXAA 3.9 and better than 12
+    // 23 = closest to FXAA 3.9 visually and performance wise
+    //  _ = the lowest digit is directly related to performance
+    // _  = the highest digit is directly related to style
+    // 
+    #define FXAA_QUALITY__PRESET 12
+#endif
+
+
+/*============================================================================
+
+                           FXAA QUALITY - PRESETS
+
+============================================================================*/
+
+/*============================================================================
+                     FXAA QUALITY - MEDIUM DITHER PRESETS
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 10)
+    #define FXAA_QUALITY__PS 3
+    #define FXAA_QUALITY__P0 1.5
+    #define FXAA_QUALITY__P1 3.0
+    #define FXAA_QUALITY__P2 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 11)
+    #define FXAA_QUALITY__PS 4
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 3.0
+    #define FXAA_QUALITY__P3 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 12)
+    #define FXAA_QUALITY__PS 5
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 4.0
+    #define FXAA_QUALITY__P4 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 13)
+    #define FXAA_QUALITY__PS 6
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 4.0
+    #define FXAA_QUALITY__P5 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 14)
+    #define FXAA_QUALITY__PS 7
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 4.0
+    #define FXAA_QUALITY__P6 12.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 15)
+    #define FXAA_QUALITY__PS 8
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 4.0
+    #define FXAA_QUALITY__P7 12.0
+#endif
+
+/*============================================================================
+                     FXAA QUALITY - LOW DITHER PRESETS
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 20)
+    #define FXAA_QUALITY__PS 3
+    #define FXAA_QUALITY__P0 1.5
+    #define FXAA_QUALITY__P1 2.0
+    #define FXAA_QUALITY__P2 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 21)
+    #define FXAA_QUALITY__PS 4
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 22)
+    #define FXAA_QUALITY__PS 5
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 23)
+    #define FXAA_QUALITY__PS 6
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 24)
+    #define FXAA_QUALITY__PS 7
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 3.0
+    #define FXAA_QUALITY__P6 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 25)
+    #define FXAA_QUALITY__PS 8
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 4.0
+    #define FXAA_QUALITY__P7 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 26)
+    #define FXAA_QUALITY__PS 9
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 4.0
+    #define FXAA_QUALITY__P8 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 27)
+    #define FXAA_QUALITY__PS 10
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 4.0
+    #define FXAA_QUALITY__P9 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 28)
+    #define FXAA_QUALITY__PS 11
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 4.0
+    #define FXAA_QUALITY__P10 8.0
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_QUALITY__PRESET == 29)
+    #define FXAA_QUALITY__PS 12
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.5
+    #define FXAA_QUALITY__P2 2.0
+    #define FXAA_QUALITY__P3 2.0
+    #define FXAA_QUALITY__P4 2.0
+    #define FXAA_QUALITY__P5 2.0
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 2.0
+    #define FXAA_QUALITY__P10 4.0
+    #define FXAA_QUALITY__P11 8.0
+#endif
+
+/*============================================================================
+                     FXAA QUALITY - EXTREME QUALITY
+============================================================================*/
+#if (FXAA_QUALITY__PRESET == 39)
+    #define FXAA_QUALITY__PS 12
+    #define FXAA_QUALITY__P0 1.0
+    #define FXAA_QUALITY__P1 1.0
+    #define FXAA_QUALITY__P2 1.0
+    #define FXAA_QUALITY__P3 1.0
+    #define FXAA_QUALITY__P4 1.0
+    #define FXAA_QUALITY__P5 1.5
+    #define FXAA_QUALITY__P6 2.0
+    #define FXAA_QUALITY__P7 2.0
+    #define FXAA_QUALITY__P8 2.0
+    #define FXAA_QUALITY__P9 2.0
+    #define FXAA_QUALITY__P10 4.0
+    #define FXAA_QUALITY__P11 8.0
+#endif
+
+
+
+/*============================================================================
+
+                                API PORTING
+
+============================================================================*/
+#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
+    #define FxaaBool bool
+    #define FxaaDiscard discard
+    #define FxaaFloat float
+    #define FxaaFloat2 vec2
+    #define FxaaFloat3 vec3
+    #define FxaaFloat4 vec4
+    #define FxaaHalf float
+    #define FxaaHalf2 vec2
+    #define FxaaHalf3 vec3
+    #define FxaaHalf4 vec4
+    #define FxaaInt2 ivec2
+    #define FxaaSat(x) clamp(x, 0.0, 1.0)
+    #define FxaaTex sampler2D
+#else
+    #define FxaaBool bool
+    #define FxaaDiscard clip(-1)
+    #define FxaaFloat float
+    #define FxaaFloat2 float2
+    #define FxaaFloat3 float3
+    #define FxaaFloat4 float4
+    #define FxaaHalf half
+    #define FxaaHalf2 half2
+    #define FxaaHalf3 half3
+    #define FxaaHalf4 half4
+    #define FxaaSat(x) saturate(x)
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_GLSL_120 == 1)
+    // Requires,
+    //  #version 120
+    // And at least,
+    //  #extension GL_EXT_gpu_shader4 : enable
+    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
+    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
+    #if (FXAA_FAST_PIXEL_OFFSET == 1)
+        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
+    #else
+        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
+    #endif
+    #if (FXAA_GATHER4_ALPHA == 1)
+        // use #extension GL_ARB_gpu_shader5 : enable
+        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
+        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
+        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
+        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_GLSL_130 == 1)
+    // Requires "#version 130" or better
+    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
+    #if (FXAA_GATHER4_ALPHA == 1)
+        // use #extension GL_ARB_gpu_shader5 : enable
+        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
+        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
+        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
+        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
+    #endif
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
+    #define FxaaInt2 float2
+    #define FxaaTex sampler2D
+    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
+    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_4 == 1)
+    #define FxaaInt2 int2
+    struct FxaaTex { SamplerState smpl; Texture2D tex; };
+    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
+#endif
+/*--------------------------------------------------------------------------*/
+#if (FXAA_HLSL_5 == 1)
+    #define FxaaInt2 int2
+    struct FxaaTex { SamplerState smpl; Texture2D tex; };
+    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
+    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
+    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
+    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
+    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
+    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
+#endif
+
+
+/*============================================================================
+                   GREEN AS LUMA OPTION SUPPORT FUNCTION
+============================================================================*/
+#if (FXAA_GREEN_AS_LUMA == 0)
+    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
+#else
+    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
+#endif    
+
+
+
+
+/*============================================================================
+
+                             FXAA3 QUALITY - PC
+
+============================================================================*/
+#if (FXAA_PC == 1)
+/*--------------------------------------------------------------------------*/
+FxaaFloat4 FxaaPixelShader(
+    //
+    // Use noperspective interpolation here (turn off perspective interpolation).
+    // {xy} = center of pixel
+    FxaaFloat2 pos,
+    //
+    // Used only for FXAA Console, and not used on the 360 version.
+    // Use noperspective interpolation here (turn off perspective interpolation).
+    // {xy__} = upper left of pixel
+    // {__zw} = lower right of pixel
+    FxaaFloat4 fxaaConsolePosPos,
+    //
+    // Input color texture.
+    // {rgb_} = color in linear or perceptual color space
+    // if (FXAA_GREEN_AS_LUMA == 0)
+    //     {___a} = luma in perceptual color space (not linear)
+    FxaaTex tex,
+    //
+    // Only used on the optimized 360 version of FXAA Console.
+    // For everything but 360, just use the same input here as for "tex".
+    // For 360, same texture, just alias with a 2nd sampler.
+    // This sampler needs to have an exponent bias of -1.
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    //
+    // Only used on the optimized 360 version of FXAA Console.
+    // For everything but 360, just use the same input here as for "tex".
+    // For 360, same texture, just alias with a 3nd sampler.
+    // This sampler needs to have an exponent bias of -2.
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    //
+    // Only used on FXAA Quality.
+    // This must be from a constant/uniform.
+    // {x_} = 1.0/screenWidthInPixels
+    // {_y} = 1.0/screenHeightInPixels
+    FxaaFloat2 fxaaQualityRcpFrame,
+    //
+    // Only used on FXAA Console.
+    // This must be from a constant/uniform.
+    // This effects sub-pixel AA quality and inversely sharpness.
+    //   Where N ranges between,
+    //     N = 0.50 (default)
+    //     N = 0.33 (sharper)
+    // {x___} = -N/screenWidthInPixels  
+    // {_y__} = -N/screenHeightInPixels
+    // {__z_} =  N/screenWidthInPixels  
+    // {___w} =  N/screenHeightInPixels 
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    //
+    // Only used on FXAA Console.
+    // Not used on 360, but used on PS3 and PC.
+    // This must be from a constant/uniform.
+    // {x___} = -2.0/screenWidthInPixels  
+    // {_y__} = -2.0/screenHeightInPixels
+    // {__z_} =  2.0/screenWidthInPixels  
+    // {___w} =  2.0/screenHeightInPixels 
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    //
+    // Only used on FXAA Console.
+    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
+    // This must be from a constant/uniform.
+    // {x___} =  8.0/screenWidthInPixels  
+    // {_y__} =  8.0/screenHeightInPixels
+    // {__z_} = -4.0/screenWidthInPixels  
+    // {___w} = -4.0/screenHeightInPixels 
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__SUBPIX define.
+    // It is here now to allow easier tuning.
+    // Choose the amount of sub-pixel aliasing removal.
+    // This can effect sharpness.
+    //   1.00 - upper limit (softer)
+    //   0.75 - default amount of filtering
+    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
+    //   0.25 - almost off
+    //   0.00 - completely off
+    FxaaFloat fxaaQualitySubpix,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
+    // It is here now to allow easier tuning.
+    // The minimum amount of local contrast required to apply algorithm.
+    //   0.333 - too little (faster)
+    //   0.250 - low quality
+    //   0.166 - default
+    //   0.125 - high quality 
+    //   0.063 - overkill (slower)
+    FxaaFloat fxaaQualityEdgeThreshold,
+    //
+    // Only used on FXAA Quality.
+    // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
+    // It is here now to allow easier tuning.
+    // Trims the algorithm from processing darks.
+    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
+    //   0.0625 - high quality (faster)
+    //   0.0312 - visible limit (slower)
+    // Special notes when using FXAA_GREEN_AS_LUMA,
+    //   Likely want to set this to zero.
+    //   As colors that are mostly not-green
+    //   will appear very dark in the green channel!
+    //   Tune by looking at mostly non-green content,
+    //   then start at zero and increase until aliasing is a problem.
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    // 
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
+    // It is here now to allow easier tuning.
+    // This does not effect PS3, as this needs to be compiled in.
+    //   Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
+    //   Due to the PS3 being ALU bound,
+    //   there are only three safe values here: 2 and 4 and 8.
+    //   These options use the shaders ability to a free *|/ by 2|4|8.
+    // For all other platforms can be a non-power of two.
+    //   8.0 is sharper (default!!!)
+    //   4.0 is softer
+    //   2.0 is really soft (good only for vector graphics inputs)
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    //
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
+    // It is here now to allow easier tuning.
+    // This does not effect PS3, as this needs to be compiled in.
+    //   Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
+    //   Due to the PS3 being ALU bound,
+    //   there are only two safe values here: 1/4 and 1/8.
+    //   These options use the shaders ability to a free *|/ by 2|4|8.
+    // The console setting has a different mapping than the quality setting.
+    // Other platforms can use other values.
+    //   0.125 leaves less aliasing, but is softer (default!!!)
+    //   0.25 leaves more aliasing, and is sharper
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    //
+    // Only used on FXAA Console.
+    // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
+    // It is here now to allow easier tuning.
+    // Trims the algorithm from processing darks.
+    // The console setting has a different mapping than the quality setting.
+    // This only applies when FXAA_EARLY_EXIT is 1.
+    // This does not apply to PS3, 
+    // PS3 was simplified to avoid more shader instructions.
+    //   0.06 - faster but more aliasing in darks
+    //   0.05 - default
+    //   0.04 - slower and less aliasing in darks
+    // Special notes when using FXAA_GREEN_AS_LUMA,
+    //   Likely want to set this to zero.
+    //   As colors that are mostly not-green
+    //   will appear very dark in the green channel!
+    //   Tune by looking at mostly non-green content,
+    //   then start at zero and increase until aliasing is a problem.
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    //    
+    // Extra constants for 360 FXAA Console only.
+    // Use zeros or anything else for other platforms.
+    // These must be in physical constant registers and NOT immedates.
+    // Immedates will result in compiler un-optimizing.
+    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posM;
+    posM.x = pos.x;
+    posM.y = pos.y;
+    #if (FXAA_GATHER4_ALPHA == 1)
+        #if (FXAA_DISCARD == 0)
+            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
+            #if (FXAA_GREEN_AS_LUMA == 0)
+                #define lumaM rgbyM.w
+            #else
+                #define lumaM rgbyM.y
+            #endif
+        #endif
+        #if (FXAA_GREEN_AS_LUMA == 0)
+            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
+            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
+        #else
+            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
+            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
+        #endif
+        #if (FXAA_DISCARD == 1)
+            #define lumaM luma4A.w
+        #endif
+        #define lumaE luma4A.z
+        #define lumaS luma4A.x
+        #define lumaSE luma4A.y
+        #define lumaNW luma4B.w
+        #define lumaN luma4B.z
+        #define lumaW luma4B.x
+    #else
+        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
+        #if (FXAA_GREEN_AS_LUMA == 0)
+            #define lumaM rgbyM.w
+        #else
+            #define lumaM rgbyM.y
+        #endif
+        FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat maxSM = max(lumaS, lumaM);
+    FxaaFloat minSM = min(lumaS, lumaM);
+    FxaaFloat maxESM = max(lumaE, maxSM);
+    FxaaFloat minESM = min(lumaE, minSM);
+    FxaaFloat maxWN = max(lumaN, lumaW);
+    FxaaFloat minWN = min(lumaN, lumaW);
+    FxaaFloat rangeMax = max(maxWN, maxESM);
+    FxaaFloat rangeMin = min(minWN, minESM);
+    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
+    FxaaFloat range = rangeMax - rangeMin;
+    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
+    FxaaBool earlyExit = range < rangeMaxClamped;
+/*--------------------------------------------------------------------------*/
+    if(earlyExit)
+        #if (FXAA_DISCARD == 1)
+            FxaaDiscard;
+        #else
+            return rgbyM;
+        #endif
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_GATHER4_ALPHA == 0)
+        FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
+    #else
+        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
+        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNS = lumaN + lumaS;
+    FxaaFloat lumaWE = lumaW + lumaE;
+    FxaaFloat subpixRcpRange = 1.0/range;
+    FxaaFloat subpixNSWE = lumaNS + lumaWE;
+    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
+    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNESE = lumaNE + lumaSE;
+    FxaaFloat lumaNWNE = lumaNW + lumaNE;
+    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
+    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNWSW = lumaNW + lumaSW;
+    FxaaFloat lumaSWSE = lumaSW + lumaSE;
+    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
+    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
+    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
+    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
+    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
+    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
+    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
+    FxaaBool horzSpan = edgeHorz >= edgeVert;
+    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
+/*--------------------------------------------------------------------------*/
+    if(!horzSpan) lumaN = lumaW;
+    if(!horzSpan) lumaS = lumaE;
+    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
+    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat gradientN = lumaN - lumaM;
+    FxaaFloat gradientS = lumaS - lumaM;
+    FxaaFloat lumaNN = lumaN + lumaM;
+    FxaaFloat lumaSS = lumaS + lumaM;
+    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
+    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
+    if(pairN) lengthSign = -lengthSign;
+    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posB;
+    posB.x = posM.x;
+    posB.y = posM.y;
+    FxaaFloat2 offNP;
+    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
+    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
+    if(!horzSpan) posB.x += lengthSign * 0.5;
+    if( horzSpan) posB.y += lengthSign * 0.5;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 posN;
+    posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
+    posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
+    FxaaFloat2 posP;
+    posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
+    posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
+    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
+    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
+    FxaaFloat subpixE = subpixC * subpixC;
+    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
+/*--------------------------------------------------------------------------*/
+    if(!pairN) lumaNN = lumaSS;
+    FxaaFloat gradientScaled = gradient * 1.0/4.0;
+    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
+    FxaaFloat subpixF = subpixD * subpixE;
+    FxaaBool lumaMLTZero = lumaMM < 0.0;
+/*--------------------------------------------------------------------------*/
+    lumaEndN -= lumaNN * 0.5;
+    lumaEndP -= lumaNN * 0.5;
+    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
+    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
+    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
+    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
+    FxaaBool doneNP = (!doneN) || (!doneP);
+    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
+    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
+/*--------------------------------------------------------------------------*/
+    if(doneNP) {
+        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+        doneN = abs(lumaEndN) >= gradientScaled;
+        doneP = abs(lumaEndP) >= gradientScaled;
+        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
+        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
+        doneNP = (!doneN) || (!doneP);
+        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
+        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
+/*--------------------------------------------------------------------------*/
+        #if (FXAA_QUALITY__PS > 3)
+        if(doneNP) {
+            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+            doneN = abs(lumaEndN) >= gradientScaled;
+            doneP = abs(lumaEndP) >= gradientScaled;
+            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
+            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
+            doneNP = (!doneN) || (!doneP);
+            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
+            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
+/*--------------------------------------------------------------------------*/
+            #if (FXAA_QUALITY__PS > 4)
+            if(doneNP) {
+                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                doneN = abs(lumaEndN) >= gradientScaled;
+                doneP = abs(lumaEndP) >= gradientScaled;
+                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
+                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
+                doneNP = (!doneN) || (!doneP);
+                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
+                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
+/*--------------------------------------------------------------------------*/
+                #if (FXAA_QUALITY__PS > 5)
+                if(doneNP) {
+                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                    doneN = abs(lumaEndN) >= gradientScaled;
+                    doneP = abs(lumaEndP) >= gradientScaled;
+                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
+                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
+                    doneNP = (!doneN) || (!doneP);
+                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
+                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
+/*--------------------------------------------------------------------------*/
+                    #if (FXAA_QUALITY__PS > 6)
+                    if(doneNP) {
+                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                        doneN = abs(lumaEndN) >= gradientScaled;
+                        doneP = abs(lumaEndP) >= gradientScaled;
+                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
+                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
+                        doneNP = (!doneN) || (!doneP);
+                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
+                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
+/*--------------------------------------------------------------------------*/
+                        #if (FXAA_QUALITY__PS > 7)
+                        if(doneNP) {
+                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                            doneN = abs(lumaEndN) >= gradientScaled;
+                            doneP = abs(lumaEndP) >= gradientScaled;
+                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
+                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
+                            doneNP = (!doneN) || (!doneP);
+                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
+                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_QUALITY__PS > 8)
+    if(doneNP) {
+        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+        doneN = abs(lumaEndN) >= gradientScaled;
+        doneP = abs(lumaEndP) >= gradientScaled;
+        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
+        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
+        doneNP = (!doneN) || (!doneP);
+        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
+        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
+/*--------------------------------------------------------------------------*/
+        #if (FXAA_QUALITY__PS > 9)
+        if(doneNP) {
+            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+            doneN = abs(lumaEndN) >= gradientScaled;
+            doneP = abs(lumaEndP) >= gradientScaled;
+            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
+            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
+            doneNP = (!doneN) || (!doneP);
+            if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
+            if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
+/*--------------------------------------------------------------------------*/
+            #if (FXAA_QUALITY__PS > 10)
+            if(doneNP) {
+                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                doneN = abs(lumaEndN) >= gradientScaled;
+                doneP = abs(lumaEndP) >= gradientScaled;
+                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
+                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
+                doneNP = (!doneN) || (!doneP);
+                if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
+                if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
+/*--------------------------------------------------------------------------*/
+                #if (FXAA_QUALITY__PS > 11)
+                if(doneNP) {
+                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                    doneN = abs(lumaEndN) >= gradientScaled;
+                    doneP = abs(lumaEndP) >= gradientScaled;
+                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
+                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
+                    doneNP = (!doneN) || (!doneP);
+                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
+                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
+/*--------------------------------------------------------------------------*/
+                    #if (FXAA_QUALITY__PS > 12)
+                    if(doneNP) {
+                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
+                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
+                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
+                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
+                        doneN = abs(lumaEndN) >= gradientScaled;
+                        doneP = abs(lumaEndP) >= gradientScaled;
+                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
+                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
+                        doneNP = (!doneN) || (!doneP);
+                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
+                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
+/*--------------------------------------------------------------------------*/
+                    }
+                    #endif
+/*--------------------------------------------------------------------------*/
+                }
+                #endif
+/*--------------------------------------------------------------------------*/
+            }
+            #endif
+/*--------------------------------------------------------------------------*/
+        }
+        #endif
+/*--------------------------------------------------------------------------*/
+    }
+    #endif
+/*--------------------------------------------------------------------------*/
+                        }
+                        #endif
+/*--------------------------------------------------------------------------*/
+                    }
+                    #endif
+/*--------------------------------------------------------------------------*/
+                }
+                #endif
+/*--------------------------------------------------------------------------*/
+            }
+            #endif
+/*--------------------------------------------------------------------------*/
+        }
+        #endif
+/*--------------------------------------------------------------------------*/
+    }
+/*--------------------------------------------------------------------------*/
+    FxaaFloat dstN = posM.x - posN.x;
+    FxaaFloat dstP = posP.x - posM.x;
+    if(!horzSpan) dstN = posM.y - posN.y;
+    if(!horzSpan) dstP = posP.y - posM.y;
+/*--------------------------------------------------------------------------*/
+    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
+    FxaaFloat spanLength = (dstP + dstN);
+    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
+    FxaaFloat spanLengthRcp = 1.0/spanLength;
+/*--------------------------------------------------------------------------*/
+    FxaaBool directionN = dstN < dstP;
+    FxaaFloat dst = min(dstN, dstP);
+    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
+    FxaaFloat subpixG = subpixF * subpixF;
+    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
+    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
+    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
+    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
+    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
+    #if (FXAA_DISCARD == 1)
+        return FxaaTexTop(tex, posM);
+    #else
+        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
+    #endif
+}
+/*==========================================================================*/
+#endif
+
+
+
+
+/*============================================================================
+
+                         FXAA3 CONSOLE - PC VERSION
+                         
+------------------------------------------------------------------------------
+Instead of using this on PC, I'd suggest just using FXAA Quality with
+    #define FXAA_QUALITY__PRESET 10
+Or 
+    #define FXAA_QUALITY__PRESET 20
+Either are higher qualilty and almost as fast as this on modern PC GPUs.
+============================================================================*/
+#if (FXAA_PC_CONSOLE == 1)
+/*--------------------------------------------------------------------------*/
+FxaaFloat4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
+    FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
+    FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
+    FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        FxaaFloat lumaM = rgbyM.w;
+    #else
+        FxaaFloat lumaM = rgbyM.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
+    lumaNe += 1.0/384.0;
+    FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
+    FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
+    FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat lumaMinM = min(lumaMin, lumaM);
+    FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
+    FxaaFloat lumaMaxM = max(lumaMax, lumaM);
+    FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
+    FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
+    FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
+    if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 dir;
+    dir.x = dirSwMinusNe + dirSeMinusNw;
+    dir.y = dirSwMinusNe - dirSeMinusNw;
+/*--------------------------------------------------------------------------*/
+    FxaaFloat2 dir1 = normalize(dir.xy);
+    FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
+    FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
+    FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
+    FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
+/*--------------------------------------------------------------------------*/
+    FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
+    FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
+/*--------------------------------------------------------------------------*/
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
+    #else
+        FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
+    #endif
+    if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
+    return rgbyB; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+                      FXAA3 CONSOLE - 360 PIXEL SHADER 
+
+------------------------------------------------------------------------------
+This optimized version thanks to suggestions from Andy Luedke.
+Should be fully tex bound in all cases.
+As of the FXAA 3.11 release, I have still not tested this code,
+however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
+And note this is replacing the old unoptimized version.
+If it does not work, please let me know so I can fix it.
+============================================================================*/
+#if (FXAA_360 == 1)
+/*--------------------------------------------------------------------------*/
+[reduceTempRegUsage(4)]
+float4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+    float4 lumaNwNeSwSe;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        asm { 
+            tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
+        };
+    #else
+        asm { 
+            tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX =  0.5, OffsetY = -0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY =  0.5, UseComputedLOD=false
+            tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX =  0.5, OffsetY =  0.5, UseComputedLOD=false
+        };
+    #endif
+/*--------------------------------------------------------------------------*/
+    lumaNwNeSwSe.y += 1.0/384.0;
+    float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
+    float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
+    float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
+    float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
+/*--------------------------------------------------------------------------*/
+    float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        float lumaMinM = min(lumaMin, rgbyM.w);
+        float lumaMaxM = max(lumaMax, rgbyM.w);
+    #else
+        float lumaMinM = min(lumaMin, rgbyM.y);
+        float lumaMaxM = max(lumaMax, rgbyM.y);
+    #endif        
+    if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
+/*--------------------------------------------------------------------------*/
+    float2 dir;
+    dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
+    dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
+    dir = normalize(dir);
+/*--------------------------------------------------------------------------*/
+    float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
+/*--------------------------------------------------------------------------*/
+    float4 dir2;
+    float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
+    dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
+    dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
+/*--------------------------------------------------------------------------*/
+    float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
+    float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
+    float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
+    float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
+/*--------------------------------------------------------------------------*/
+    float4 rgbyA = rgbyN1 + rgbyP1;
+    float4 rgbyB = rgbyN2 + rgbyP2 * 0.5 + rgbyA;
+/*--------------------------------------------------------------------------*/
+    float4 rgbyR = ((rgbyB.w - lumaMax) > 0.0) ? rgbyA : rgbyB;
+    rgbyR = ((rgbyB.w - lumaMin) > 0.0) ? rgbyR : rgbyA;
+    return rgbyR; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+         FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
+
+==============================================================================
+The code below does not exactly match the assembly.
+I have a feeling that 12 cycles is possible, but was not able to get there.
+Might have to increase register count to get full performance.
+Note this shader does not use perspective interpolation.
+
+Use the following cgc options,
+
+  --fenable-bx2 --fastmath --fastprecision --nofloatbindings
+
+------------------------------------------------------------------------------
+                             NVSHADERPERF OUTPUT
+------------------------------------------------------------------------------
+For reference and to aid in debug, output of NVShaderPerf should match this,
+
+Shader to schedule:
+  0: texpkb h0.w(TRUE), v5.zyxx, #0
+  2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
+  4: texpkb h0.w(TRUE), v5.xwxx, #0
+  6: addh h0.z(TRUE), -h2, h0.w
+  7: texpkb h1.w(TRUE), v5, #0
+  9: addh h0.x(TRUE), h0.z, -h1.w
+ 10: addh h3.w(TRUE), h0.z, h1
+ 11: texpkb h2.w(TRUE), v5.zwzz, #0
+ 13: addh h0.z(TRUE), h3.w, -h2.w
+ 14: addh h0.x(TRUE), h2.w, h0
+ 15: nrmh h1.xz(TRUE), h0_n
+ 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
+ 17: maxh h4.w(TRUE), h0, h1
+ 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
+ 19: movr r1.zw(TRUE), v4.xxxy
+ 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
+ 22: minh h5.w(TRUE), h0, h1
+ 23: texpkb h0(TRUE), r2.xzxx, #0
+ 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
+ 27: maxh h4.x(TRUE), h2.z, h2.w
+ 28: texpkb h1(TRUE), r0.zwzz, #0
+ 30: addh_d2 h1(TRUE), h0, h1
+ 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 33: texpkb h0(TRUE), r0, #0
+ 35: minh h4.z(TRUE), h2, h2.w
+ 36: fenct TRUE
+ 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 39: texpkb h2(TRUE), r1, #0
+ 41: addh_d2 h0(TRUE), h0, h2
+ 42: maxh h2.w(TRUE), h4, h4.x
+ 43: minh h2.x(TRUE), h5.w, h4.z
+ 44: addh_d2 h0(TRUE), h0, h1
+ 45: slth h2.x(TRUE), h0.w, h2
+ 46: sgth h2.w(TRUE), h0, h2
+ 47: movh h0(TRUE), h0
+ 48: addx.c0 rc(TRUE), h2, h2.w
+ 49: movh h0(c0.NE.x), h1
+
+IPU0 ------ Simplified schedule: --------
+Pass |  Unit  |  uOp |  PC:  Op
+-----+--------+------+-------------------------
+   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |   SCB1 |  add |   2:  ADDh h2.z, h0.--w-, const.--x-;
+     |        |      |
+   2 | SCT0/1 |  mov |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |    TEX |  txl |   4:  TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |   SCB1 |  add |   6:  ADDh h0.z,-h2, h0.--w-;
+     |        |      |
+   3 | SCT0/1 |  mov |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
+     |    TEX |  txl |   7:  TXLr h1.w, g[TEX1], const.xxxx, TEX0;
+     |   SCB0 |  add |   9:  ADDh h0.x, h0.z---,-h1.w---;
+     |   SCB1 |  add |  10:  ADDh h3.w, h0.---z, h1;
+     |        |      |
+   4 | SCT0/1 |  mov |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |  11:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |   SCB0 |  add |  14:  ADDh h0.x, h2.w---, h0;
+     |   SCB1 |  add |  13:  ADDh h0.z, h3.--w-,-h2.--w-;
+     |        |      |
+   5 |   SCT1 |  mov |  15:  NRMh h1.xz, h0;
+     |    SRB |  nrm |  15:  NRMh h1.xz, h0;
+     |   SCB0 |  min |  16:  MINh*8 h0.x, |h1|, |h1.z---|;
+     |   SCB1 |  max |  17:  MAXh h4.w, h0, h1;
+     |        |      |
+   6 |   SCT0 |  div |  18:  DIVx h2.xy, h1.xz--, h0;
+     |   SCT1 |  mov |  19:  MOVr r1.zw, g[TEX0].--xy;
+     |   SCB0 |  mad |  20:  MADr r2.xz,-h1, const.z-w-, r1.z-w-;
+     |   SCB1 |  min |  22:  MINh h5.w, h0, h1;
+     |        |      |
+   7 | SCT0/1 |  mov |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
+     |    TEX |  txl |  23:  TXLr h0, r2.xzxx, const.xxxx, TEX0;
+     |   SCB0 |  max |  27:  MAXh h4.x, h2.z---, h2.w---;
+     |   SCB1 |  mad |  25:  MADr r0.zw, h1.--xz, const, r1;
+     |        |      |
+   8 | SCT0/1 |  mov |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |  28:  TXLr h1, r0.zwzz, const.xxxx, TEX0;
+     | SCB0/1 |  add |  30:  ADDh/2 h1, h0, h1;
+     |        |      |
+   9 |   SCT0 |  mad |  31:  MADr r0.xy,-h2, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  33:  TXLr h0, r0, const.zzzz, TEX0;
+     |    TEX |  txl |  33:  TXLr h0, r0, const.zzzz, TEX0;
+     |   SCB1 |  min |  35:  MINh h4.z, h2, h2.--w-;
+     |        |      |
+  10 |   SCT0 |  mad |  37:  MADr r1.xy, h2, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  39:  TXLr h2, r1, const.zzzz, TEX0;
+     |    TEX |  txl |  39:  TXLr h2, r1, const.zzzz, TEX0;
+     | SCB0/1 |  add |  41:  ADDh/2 h0, h0, h2;
+     |        |      |
+  11 |   SCT0 |  min |  43:  MINh h2.x, h5.w---, h4.z---;
+     |   SCT1 |  max |  42:  MAXh h2.w, h4, h4.---x;
+     | SCB0/1 |  add |  44:  ADDh/2 h0, h0, h1;
+     |        |      |
+  12 |   SCT0 |  set |  45:  SLTh h2.x, h0.w---, h2;
+     |   SCT1 |  set |  46:  SGTh h2.w, h0, h2;
+     | SCB0/1 |  mul |  47:  MOVh h0, h0;
+     |        |      |
+  13 |   SCT0 |  mad |  48:  ADDxc0_s rc, h2, h2.w---;
+     | SCB0/1 |  mul |  49:  MOVh h0(NE0.xxxx), h1;
+ 
+Pass   SCT  TEX  SCB
+  1:   0% 100%  25%
+  2:   0% 100%  25%
+  3:   0% 100%  50%
+  4:   0% 100%  50%
+  5:   0%   0%  50%
+  6: 100%   0%  75%
+  7:   0% 100%  75%
+  8:   0% 100% 100%
+  9:   0% 100%  25%
+ 10:   0% 100% 100%
+ 11:  50%   0% 100%
+ 12:  50%   0% 100%
+ 13:  25%   0% 100%
+
+MEAN:  17%  61%  67%
+
+Pass   SCT0  SCT1   TEX  SCB0  SCB1
+  1:    0%    0%  100%    0%  100%
+  2:    0%    0%  100%    0%  100%
+  3:    0%    0%  100%  100%  100%
+  4:    0%    0%  100%  100%  100%
+  5:    0%    0%    0%  100%  100%
+  6:  100%  100%    0%  100%  100%
+  7:    0%    0%  100%  100%  100%
+  8:    0%    0%  100%  100%  100%
+  9:    0%    0%  100%    0%  100%
+ 10:    0%    0%  100%  100%  100%
+ 11:  100%  100%    0%  100%  100%
+ 12:  100%  100%    0%  100%  100%
+ 13:  100%    0%    0%  100%  100%
+
+MEAN:   30%   23%   61%   76%  100%
+Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
+Results 13 cycles, 3 r regs, 923,076,923 pixels/s
+============================================================================*/
+#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
+/*--------------------------------------------------------------------------*/
+#pragma regcount 7
+#pragma disablepc all
+#pragma option O3
+#pragma option OutColorPrec=fp16
+#pragma texformat default RGBA8
+/*==========================================================================*/
+half4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+// (1)
+    half4 dir;
+    half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        lumaNe.w += half(1.0/512.0);
+        dir.x = -lumaNe.w;
+        dir.z = -lumaNe.w;
+    #else
+        lumaNe.y += half(1.0/512.0);
+        dir.x = -lumaNe.y;
+        dir.z = -lumaNe.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (2)
+    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x += lumaSw.w;
+        dir.z += lumaSw.w;
+    #else
+        dir.x += lumaSw.y;
+        dir.z += lumaSw.y;
+    #endif        
+/*--------------------------------------------------------------------------*/
+// (3)
+    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x -= lumaNw.w;
+        dir.z += lumaNw.w;
+    #else
+        dir.x -= lumaNw.y;
+        dir.z += lumaNw.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (4)
+    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x += lumaSe.w;
+        dir.z -= lumaSe.w;
+    #else
+        dir.x += lumaSe.y;
+        dir.z -= lumaSe.y;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (5)
+    half4 dir1_pos;
+    dir1_pos.xy = normalize(dir.xyz).xz;
+    half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
+/*--------------------------------------------------------------------------*/
+// (6)
+    half4 dir2_pos;
+    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
+    dir1_pos.zw = pos.xy;
+    dir2_pos.zw = pos.xy;
+    half4 temp1N;
+    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+/*--------------------------------------------------------------------------*/
+// (7)
+    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
+    half4 rgby1;
+    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+/*--------------------------------------------------------------------------*/
+// (8)
+    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
+    rgby1 = (temp1N + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (9)
+    half4 temp2N;
+    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
+/*--------------------------------------------------------------------------*/
+// (10)
+    half4 rgby2;
+    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
+    rgby2 = (temp2N + rgby2) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (11)
+    // compilier moves these scalar ops up to other cycles
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
+        half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
+    #else
+        half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
+        half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
+    #endif        
+    rgby2 = (rgby2 + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (12)
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        bool twoTapLt = rgby2.w < lumaMin;
+        bool twoTapGt = rgby2.w > lumaMax;
+    #else
+        bool twoTapLt = rgby2.y < lumaMin;
+        bool twoTapGt = rgby2.y > lumaMax;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (13)
+    if(twoTapLt || twoTapGt) rgby2 = rgby1;
+/*--------------------------------------------------------------------------*/
+    return rgby2; }
+/*==========================================================================*/
+#endif
+
+
+
+/*============================================================================
+
+       FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
+
+==============================================================================
+The code mostly matches the assembly.
+I have a feeling that 14 cycles is possible, but was not able to get there.
+Might have to increase register count to get full performance.
+Note this shader does not use perspective interpolation.
+
+Use the following cgc options,
+
+ --fenable-bx2 --fastmath --fastprecision --nofloatbindings
+
+Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
+Will look at fixing this for FXAA 3.12.
+------------------------------------------------------------------------------
+                             NVSHADERPERF OUTPUT
+------------------------------------------------------------------------------
+For reference and to aid in debug, output of NVShaderPerf should match this,
+
+Shader to schedule:
+  0: texpkb h0.w(TRUE), v5.zyxx, #0
+  2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
+  4: texpkb h1.w(TRUE), v5.xwxx, #0
+  6: addh h0.x(TRUE), h1.w, -h2.y
+  7: texpkb h2.w(TRUE), v5.zwzz, #0
+  9: minh h4.w(TRUE), h2.y, h2
+ 10: maxh h5.x(TRUE), h2.y, h2.w
+ 11: texpkb h0.w(TRUE), v5, #0
+ 13: addh h3.w(TRUE), -h0, h0.x
+ 14: addh h0.x(TRUE), h0.w, h0
+ 15: addh h0.z(TRUE), -h2.w, h0.x
+ 16: addh h0.x(TRUE), h2.w, h3.w
+ 17: minh h5.y(TRUE), h0.w, h1.w
+ 18: nrmh h2.xz(TRUE), h0_n
+ 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
+ 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
+ 21: movr r1.zw(TRUE), v4.xxxy
+ 22: maxh h2.w(TRUE), h0, h1
+ 23: fenct TRUE
+ 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
+ 26: texpkb h0(TRUE), r0, #0
+ 28: maxh h5.x(TRUE), h2.w, h5
+ 29: minh h5.w(TRUE), h5.y, h4
+ 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
+ 32: texpkb h2(TRUE), r1, #0
+ 34: addh_d2 h2(TRUE), h0, h2
+ 35: texpkb h1(TRUE), v4, #0
+ 37: maxh h5.y(TRUE), h5.x, h1.w
+ 38: minh h4.w(TRUE), h1, h5
+ 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 41: texpkb h0(TRUE), r0, #0
+ 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
+ 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
+ 46: texpkb h3(TRUE), r2, #0
+ 48: addh_d2 h0(TRUE), h0, h3
+ 49: addh_d2 h3(TRUE), h0, h2
+ 50: movh h0(TRUE), h3
+ 51: slth h3.x(TRUE), h3.w, h5.w
+ 52: sgth h3.w(TRUE), h3, h5.x
+ 53: addx.c0 rc(TRUE), h3.x, h3
+ 54: slth.c0 rc(TRUE), h5.z, h5
+ 55: movh h0(c0.NE.w), h2
+ 56: movh h0(c0.NE.x), h1
+
+IPU0 ------ Simplified schedule: --------
+Pass |  Unit  |  uOp |  PC:  Op
+-----+--------+------+-------------------------
+   1 | SCT0/1 |  mov |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |    TEX |  txl |   0:  TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
+     |   SCB0 |  add |   2:  ADDh h2.y, h0.-w--, const.-x--;
+     |        |      |
+   2 | SCT0/1 |  mov |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |    TEX |  txl |   4:  TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
+     |   SCB0 |  add |   6:  ADDh h0.x, h1.w---,-h2.y---;
+     |        |      |
+   3 | SCT0/1 |  mov |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |    TEX |  txl |   7:  TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
+     |   SCB0 |  max |  10:  MAXh h5.x, h2.y---, h2.w---;
+     |   SCB1 |  min |   9:  MINh h4.w, h2.---y, h2;
+     |        |      |
+   4 | SCT0/1 |  mov |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
+     |    TEX |  txl |  11:  TXLr h0.w, g[TEX1], const.xxxx, TEX0;
+     |   SCB0 |  add |  14:  ADDh h0.x, h0.w---, h0;
+     |   SCB1 |  add |  13:  ADDh h3.w,-h0, h0.---x;
+     |        |      |
+   5 |   SCT0 |  mad |  16:  ADDh h0.x, h2.w---, h3.w---;
+     |   SCT1 |  mad |  15:  ADDh h0.z,-h2.--w-, h0.--x-;
+     |   SCB0 |  min |  17:  MINh h5.y, h0.-w--, h1.-w--;
+     |        |      |
+   6 |   SCT1 |  mov |  18:  NRMh h2.xz, h0;
+     |    SRB |  nrm |  18:  NRMh h2.xz, h0;
+     |   SCB1 |  min |  19:  MINh*8 h2.w, |h2.---x|, |h2.---z|;
+     |        |      |
+   7 |   SCT0 |  div |  20:  DIVx h4.xy, h2.xz--, h2.ww--;
+     |   SCT1 |  mov |  21:  MOVr r1.zw, g[TEX0].--xy;
+     |   SCB1 |  max |  22:  MAXh h2.w, h0, h1;
+     |        |      |
+   8 |   SCT0 |  mad |  24:  MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
+     |   SCT1 |  mov |  26:  TXLr h0, r0, const.xxxx, TEX0;
+     |    TEX |  txl |  26:  TXLr h0, r0, const.xxxx, TEX0;
+     |   SCB0 |  max |  28:  MAXh h5.x, h2.w---, h5;
+     |   SCB1 |  min |  29:  MINh h5.w, h5.---y, h4;
+     |        |      |
+   9 |   SCT0 |  mad |  30:  MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
+     |   SCT1 |  mov |  32:  TXLr h2, r1, const.xxxx, TEX0;
+     |    TEX |  txl |  32:  TXLr h2, r1, const.xxxx, TEX0;
+     | SCB0/1 |  add |  34:  ADDh/2 h2, h0, h2;
+     |        |      |
+  10 | SCT0/1 |  mov |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
+     |    TEX |  txl |  35:  TXLr h1, g[TEX0], const.xxxx, TEX0;
+     |   SCB0 |  max |  37:  MAXh h5.y, h5.-x--, h1.-w--;
+     |   SCB1 |  min |  38:  MINh h4.w, h1, h5;
+     |        |      |
+  11 |   SCT0 |  mad |  39:  MADr r0.xy,-h4, const.xy--, r1.zw--;
+     |   SCT1 |  mov |  41:  TXLr h0, r0, const.zzzz, TEX0;
+     |    TEX |  txl |  41:  TXLr h0, r0, const.zzzz, TEX0;
+     |   SCB0 |  mad |  44:  MADr r2.xy, h4, const.xy--, r1.zw--;
+     |   SCB1 |  add |  43:  ADDh*8 h5.z, h5.--y-,-h4.--w-;
+     |        |      |
+  12 | SCT0/1 |  mov |  46:  TXLr h3, r2, const.xxxx, TEX0;
+     |    TEX |  txl |  46:  TXLr h3, r2, const.xxxx, TEX0;
+     | SCB0/1 |  add |  48:  ADDh/2 h0, h0, h3;
+     |        |      |
+  13 | SCT0/1 |  mad |  49:  ADDh/2 h3, h0, h2;
+     | SCB0/1 |  mul |  50:  MOVh h0, h3;
+     |        |      |
+  14 |   SCT0 |  set |  51:  SLTh h3.x, h3.w---, h5.w---;
+     |   SCT1 |  set |  52:  SGTh h3.w, h3, h5.---x;
+     |   SCB0 |  set |  54:  SLThc0 rc, h5.z---, h5;
+     |   SCB1 |  add |  53:  ADDxc0_s rc, h3.---x, h3;
+     |        |      |
+  15 | SCT0/1 |  mul |  55:  MOVh h0(NE0.wwww), h2;
+     | SCB0/1 |  mul |  56:  MOVh h0(NE0.xxxx), h1;
+ 
+Pass   SCT  TEX  SCB
+  1:   0% 100%  25%
+  2:   0% 100%  25%
+  3:   0% 100%  50%
+  4:   0% 100%  50%
+  5:  50%   0%  25%
+  6:   0%   0%  25%
+  7: 100%   0%  25%
+  8:   0% 100%  50%
+  9:   0% 100% 100%
+ 10:   0% 100%  50%
+ 11:   0% 100%  75%
+ 12:   0% 100% 100%
+ 13: 100%   0% 100%
+ 14:  50%   0%  50%
+ 15: 100%   0% 100%
+
+MEAN:  26%  60%  56%
+
+Pass   SCT0  SCT1   TEX  SCB0  SCB1
+  1:    0%    0%  100%  100%    0%
+  2:    0%    0%  100%  100%    0%
+  3:    0%    0%  100%  100%  100%
+  4:    0%    0%  100%  100%  100%
+  5:  100%  100%    0%  100%    0%
+  6:    0%    0%    0%    0%  100%
+  7:  100%  100%    0%    0%  100%
+  8:    0%    0%  100%  100%  100%
+  9:    0%    0%  100%  100%  100%
+ 10:    0%    0%  100%  100%  100%
+ 11:    0%    0%  100%  100%  100%
+ 12:    0%    0%  100%  100%  100%
+ 13:  100%  100%    0%  100%  100%
+ 14:  100%  100%    0%  100%  100%
+ 15:  100%  100%    0%  100%  100%
+
+MEAN:   33%   33%   60%   86%   80%
+Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
+Results 15 cycles, 3 r regs, 800,000,000 pixels/s
+============================================================================*/
+#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
+/*--------------------------------------------------------------------------*/
+#pragma regcount 7
+#pragma disablepc all
+#pragma option O2
+#pragma option OutColorPrec=fp16
+#pragma texformat default RGBA8
+/*==========================================================================*/
+half4 FxaaPixelShader(
+    // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
+    FxaaFloat2 pos,
+    FxaaFloat4 fxaaConsolePosPos,
+    FxaaTex tex,
+    FxaaTex fxaaConsole360TexExpBiasNegOne,
+    FxaaTex fxaaConsole360TexExpBiasNegTwo,
+    FxaaFloat2 fxaaQualityRcpFrame,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt,
+    FxaaFloat4 fxaaConsoleRcpFrameOpt2,
+    FxaaFloat4 fxaaConsole360RcpFrameOpt2,
+    FxaaFloat fxaaQualitySubpix,
+    FxaaFloat fxaaQualityEdgeThreshold,
+    FxaaFloat fxaaQualityEdgeThresholdMin,
+    FxaaFloat fxaaConsoleEdgeSharpness,
+    FxaaFloat fxaaConsoleEdgeThreshold,
+    FxaaFloat fxaaConsoleEdgeThresholdMin,
+    FxaaFloat4 fxaaConsole360ConstDir
+) {
+/*--------------------------------------------------------------------------*/
+// (1)
+    half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaNe = rgbyNe.w + half(1.0/512.0);
+    #else
+        half lumaNe = rgbyNe.y + half(1.0/512.0);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (2)
+    half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaSwNegNe = lumaSw.w - lumaNe;
+    #else
+        half lumaSwNegNe = lumaSw.y - lumaNe;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (3)
+    half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
+        half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
+    #else
+        half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
+        half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (4)
+    half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half dirZ =  lumaNw.w + lumaSwNegNe;
+        half dirX = -lumaNw.w + lumaSwNegNe;
+    #else
+        half dirZ =  lumaNw.y + lumaSwNegNe;
+        half dirX = -lumaNw.y + lumaSwNegNe;
+    #endif
+/*--------------------------------------------------------------------------*/
+// (5)
+    half3 dir;
+    dir.y = 0.0;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        dir.x =  lumaSe.w + dirX;
+        dir.z = -lumaSe.w + dirZ;
+        half lumaMinNeSe = min(lumaNe, lumaSe.w);
+    #else
+        dir.x =  lumaSe.y + dirX;
+        dir.z = -lumaSe.y + dirZ;
+        half lumaMinNeSe = min(lumaNe, lumaSe.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (6)
+    half4 dir1_pos;
+    dir1_pos.xy = normalize(dir).xz;
+    half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
+/*--------------------------------------------------------------------------*/
+// (7)
+    half4 dir2_pos;
+    dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
+    dir1_pos.zw = pos.xy;
+    dir2_pos.zw = pos.xy;
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxNeSe = max(lumaNe, lumaSe.w);
+    #else
+        half lumaMaxNeSe = max(lumaNe, lumaSe.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (8)
+    half4 temp1N;
+    temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+    temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
+    half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
+    half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
+/*--------------------------------------------------------------------------*/
+// (9)
+    half4 rgby1;
+    rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
+    rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
+    rgby1 = (temp1N + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (10)
+    half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        half lumaMaxM = max(lumaMax, rgbyM.w);
+        half lumaMinM = min(lumaMin, rgbyM.w);
+    #else
+        half lumaMaxM = max(lumaMax, rgbyM.y);
+        half lumaMinM = min(lumaMin, rgbyM.y);
+    #endif
+/*--------------------------------------------------------------------------*/
+// (11)
+    half4 temp2N;
+    temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
+    half4 rgby2;
+    rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
+    half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
+/*--------------------------------------------------------------------------*/
+// (12)
+    rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
+    rgby2 = (temp2N + rgby2) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (13)
+    rgby2 = (rgby2 + rgby1) * 0.5;
+/*--------------------------------------------------------------------------*/
+// (14)
+    #if (FXAA_GREEN_AS_LUMA == 0)
+        bool twoTapLt = rgby2.w < lumaMin;
+        bool twoTapGt = rgby2.w > lumaMax;
+    #else
+        bool twoTapLt = rgby2.y < lumaMin;
+        bool twoTapGt = rgby2.y > lumaMax;
+    #endif
+    bool earlyExit = lumaRangeM < lumaMax;
+    bool twoTap = twoTapLt || twoTapGt;
+/*--------------------------------------------------------------------------*/
+// (15)
+    if(twoTap) rgby2 = rgby1;
+    if(earlyExit) rgby2 = rgbyM;
+/*--------------------------------------------------------------------------*/
+    return rgby2; }
+/*==========================================================================*/
+#endif
+
+uniform sampler2D diffuseMap;
+
+uniform vec2 rcp_screen_res;
+uniform vec4 rcp_frame_opt;
+uniform vec4 rcp_frame_opt2;
+uniform vec2 screen_res;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
+
+void main() 
+{
+	vec4 diff =			FxaaPixelShader(vary_tc,			//pos
+										vec4(vary_fragcoord.xy, 0, 0), //fxaaConsolePosPos
+										diffuseMap,					//tex
+										diffuseMap,					
+										diffuseMap,
+										rcp_screen_res,				//fxaaQualityRcpFrame
+										vec4(0,0,0,0),				//fxaaConsoleRcpFrameOpt
+										rcp_frame_opt,				//fxaaConsoleRcpFrameOpt2
+										rcp_frame_opt2,				//fxaaConsole360RcpFrameOpt2
+										0.75,						//fxaaQualitySubpix
+										0.07,						//fxaaQualityEdgeThreshold
+										0.03,						//fxaaQualityEdgeThresholdMin
+										8.0,						//fxaaConsoleEdgeSharpness
+										0.125,						//fxaaConsoleEdgeThreshold
+										0.05,						//fxaaConsoleEdgeThresholdMin
+										vec4(0,0,0,0));				//fxaaConsole360ConstDir
+
+
+
+	//diff = texture2D(diffuseMap, vary_tc);
+	
+	gl_FragColor = diff;
+	
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
deleted file mode 100644
index c2754347772..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
+++ /dev/null
@@ -1,45 +0,0 @@
-/** 
- * @file postDeferredNoDoFF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect diffuseRect;
-uniform sampler2D bloomMap;
-
-uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
-
-void main() 
-{
-	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
-	
-	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor = diff + bloom;
-}
-
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
deleted file mode 100644
index 985f44fb6c9..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
+++ /dev/null
@@ -1,157 +0,0 @@
-/** 
- * @file postDeferredF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect diffuseRect;
-uniform sampler2DRect edgeMap;
-uniform sampler2DRect depthMap;
-uniform sampler2DRect normalMap;
-uniform sampler2D bloomMap;
-
-uniform float depth_cutoff;
-uniform float norm_cutoff;
-uniform float focal_distance;
-uniform float blur_constant;
-uniform float tan_pixel_angle;
-uniform float magnification;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-VARYING vec2 vary_fragcoord;
-
-float getDepth(vec2 pos_screen)
-{
-	float z = texture2DRect(depthMap, pos_screen.xy).r;
-	z = z*2.0-1.0;
-	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
-	vec4 p = inv_proj*ndc;
-	return p.z/p.w;
-}
-
-float calc_cof(float depth)
-{
-	float sc = abs(depth-focal_distance)/-depth*blur_constant;
-		
-	sc /= magnification;
-	
-	// tan_pixel_angle = pixel_length/-depth;
-	float pixel_length =  tan_pixel_angle*-focal_distance;
-	
-	sc = sc/pixel_length;
-	sc *= 1.414;
-	
-	return sc;
-}
-
-void dofSampleNear(inout vec4 diff, inout float w, float cur_sc, vec2 tc)
-{
-	float d = getDepth(tc);
-	
-	float sc = calc_cof(d);
-	
-	float wg = 0.25;
-		
-	vec4 s = texture2DRect(diffuseRect, tc);
-	// de-weight dull areas to make highlights 'pop'
-	wg += s.r+s.g+s.b;
-	
-	diff += wg*s;
-	
-	w += wg;
-}
-
-void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, vec2 tc)
-{
-	float d = getDepth(tc);
-	
-	float sc = calc_cof(d);
-	
-	if (sc > min_sc //sampled pixel is more "out of focus" than current sample radius
-	   || d < cur_depth) //sampled pixel is further away than current pixel
-	{
-		float wg = 0.25;
-		
-		vec4 s = texture2DRect(diffuseRect, tc);
-		// de-weight dull areas to make highlights 'pop'
-		wg += s.r+s.g+s.b;
-	
-		diff += wg*s;
-		
-		w += wg;
-	}
-}
-
-
-void main() 
-{
-	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-		
-	vec2 tc = vary_fragcoord.xy;
-	
-	float depth = getDepth(tc);
-	
-	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
-	
-	{ 
-		float w = 1.0;
-		
-		float sc = calc_cof(depth);
-		sc = min(abs(sc), 10.0);
-		
-		float fd = depth*0.5f;
-		
-		float PI = 3.14159265358979323846264;
-
-		// sample quite uniformly spaced points within a circle, for a circular 'bokeh'		
-		//if (depth < focal_distance)
-		{
-			while (sc > 0.5)
-			{
-				int its = int(max(1.0,(sc*3.7)));
-				for (int i=0; i<its; ++i)
-				{
-					float ang = sc+i*2*PI/its; // sc is added for rotary perturbance
-					float samp_x = sc*sin(ang);
-					float samp_y = sc*cos(ang);
-					// you could test sample coords against an interesting non-circular aperture shape here, if desired.
-					dofSample(diff, w, sc, depth, vary_fragcoord.xy + vec2(samp_x,samp_y));
-				}
-				sc -= 1.0;
-			}
-		}
-		
-		diff /= w;
-	}
-		
-	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor = diff + bloom;
-}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
deleted file mode 100644
index ec4e2ae4d53..00000000000
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
+++ /dev/null
@@ -1,60 +0,0 @@
-/** 
- * @file glowExtractF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DMS diffuseMap;
-uniform float minLuminance;
-uniform float maxExtractAlpha;
-uniform vec3 lumWeights;
-uniform vec3 warmthWeights;
-uniform float warmthAmount;
-
-VARYING vec2 vary_texcoord0;
-
-void main()
-{
-	ivec2 itc = ivec2(vary_texcoord0.xy);
-	vec4 fcol = vec4(0,0,0,0);
-
-	for (int i = 0; i < samples; i++)
-	{
-		vec4 col = texelFetch(diffuseMap, itc, i);	
-
-		/// CALCULATING LUMINANCE (Using NTSC lum weights)
-		/// http://en.wikipedia.org/wiki/Luma_%28video%29
-		float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
-		float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) ); 
-	
-		fcol += vec4(col.rgb, max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha));
-	}
-
-	gl_FragColor = fcol/samples;
-}
-- 
GitLab


From ccf751e78ee551648e4ae29f2e7c0e7288cd7168 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 29 Sep 2011 23:28:51 -0500
Subject: [PATCH 079/933] SH-2370 Fix for alpha masked objects not getting
 highlighted when highlight transparent enabled.

---
 indra/newview/lldrawpoolalpha.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index a5032d007f2..230c4e2638d 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -333,6 +333,10 @@ void LLDrawPoolAlpha::render(S32 pass)
 		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ;
 		renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX |
 							LLVertexBuffer::MAP_TEXCOORD0);
+
+		pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
+		pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
+
 		if(shaders) 
 		{
 			gHighlightProgram.unbind();
-- 
GitLab


From 3f96ec1bc9098986f1ed811120ab3793a29ae235 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 30 Sep 2011 00:05:42 -0500
Subject: [PATCH 080/933] SH-2244 Fix for performance warning on AMD cards

---
 indra/newview/llspatialpartition.cpp | 4 ++--
 indra/newview/pipeline.cpp           | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 61d061520f0..8e22a9be2ce 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -214,7 +214,7 @@ typedef enum
 //contact Runitai Linden for a copy of the SL object used to write this table
 //basically, you give the table a bitmask of the look-at vector to a node and it
 //gives you a triangle fan index array
-static U8 sOcclusionIndices[] =
+static U16 sOcclusionIndices[] =
 {
 	 //000
 		b111, b110, b010, b011, b001, b101, b100, b110,
@@ -251,7 +251,7 @@ U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center)
 
 	S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
 	
-	return sOcclusionIndices+cypher*8;
+	return (U8*) (sOcclusionIndices+cypher*8);
 }
 
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index db9675650af..3fa281368ca 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7532,7 +7532,7 @@ void LLPipeline::renderDeferredLighting()
 							gGL.syncMatrices();
 							mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 							glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
-								GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
+								GL_UNSIGNED_SHORT, get_box_fan_indices_ptr(camera, center));
 							stop_glerror();
 						}
 					}
@@ -7605,7 +7605,7 @@ void LLPipeline::renderDeferredLighting()
 					gGL.syncMatrices();
 					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 					glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
-							GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center));
+							GL_UNSIGNED_SHORT, get_box_fan_indices_ptr(camera, center));
 				}
 				gDeferredSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
 				unbindDeferredShader(gDeferredSpotLightProgram);
-- 
GitLab


From d698086da46b430f409e5e26e193061e770f187d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 30 Sep 2011 01:10:26 -0500
Subject: [PATCH 081/933] Fix for linux build

---
 indra/newview/pipeline.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index db9675650af..7718a165322 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6410,9 +6410,6 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		LLGLDisable blend(GL_BLEND);
 		bindDeferredShader(*shader);
 
-		S32 width = mScreen.getWidth();
-		S32 height = mScreen.getHeight();
-		
 		if (dof_enabled)
 		{
 			//depth of field focal plane calculations
-- 
GitLab


From f558d86578b6ce77e63710d9133b45c5737d1164 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 30 Sep 2011 01:11:26 -0500
Subject: [PATCH 082/933] SH-2244 Don't use multisample texture (ever), and
 don't use GL_DEPTH_COMPONENT32 (use GL_DEPTH_COMPONENT24)

---
 indra/llrender/llrendertarget.cpp | 43 +++----------------------------
 1 file changed, 3 insertions(+), 40 deletions(-)

diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 8c0d3592df9..1a80688dfcc 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -84,20 +84,8 @@ bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo
 	mStencil = stencil;
 	mUsage = usage;
 	mUseDepth = depth;
-	mSamples = samples;
 
-	mSamples = gGLManager.getNumFBOFSAASamples(mSamples);
-	
-	if (mSamples > 1 && gGLManager.mHasTextureMultisample)
-	{
-		mUsage = LLTexUnit::TT_MULTISAMPLE_TEXTURE;
-		//no support for multisampled stencil targets yet
-		mStencil = false;
-	}
-	else
-	{
-		mSamples = 0;
-	}
+	mSamples = 0;
 
 	if ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
 	{
@@ -157,21 +145,6 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
 	stop_glerror();
 
 
-#ifdef GL_ARB_texture_multisample
-	if (mSamples > 1)
-	{
-		clear_glerror();
-		glTexImage2DMultisample(LLTexUnit::getInternalType(mUsage), mSamples, color_fmt, mResX, mResY, GL_TRUE);
-		if (glGetError() != GL_NO_ERROR)
-		{
-			llwarns << "Could not allocate multisample color buffer for render target." << llendl;
-			return false;
-		}
-	}
-	else
-#else
-	llassert_always(mSamples <= 1);
-#endif
 	{
 		clear_glerror();
 		LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
@@ -253,21 +226,11 @@ bool LLRenderTarget::allocateDepth()
 		if (mSamples == 0)
 		{
 			U32 internal_type = LLTexUnit::getInternalType(mUsage);
-			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-			stop_glerror();
-			clear_glerror();
-			LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT32, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
-		}
-#ifdef GL_ARB_texture_multisample
-		else
-		{
 			stop_glerror();
 			clear_glerror();
-			glTexImage2DMultisample(LLTexUnit::getInternalType(mUsage), mSamples, GL_DEPTH_COMPONENT32, mResX, mResY, GL_TRUE);
+			LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 		}
-#else
-		llassert_always(mSamples <= 1);
-#endif
 	}
 
 	if (glGetError() != GL_NO_ERROR)
-- 
GitLab


From ce81ecd0b2d7b0e6b79a9de8a9c54c5b0364430b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 30 Sep 2011 12:51:48 -0500
Subject: [PATCH 083/933] SH-2240 Fix for typo preventing deferred rendering
 from working on linux/osx

---
 indra/newview/llviewershadermgr.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 48d4471bdf2..d3f5ebcf1cb 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1532,7 +1532,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredPostNoDoFProgram.mName = "Deferred Post Shader";
 		gDeferredPostNoDoFProgram.mShaderFiles.clear();
 		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
-		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDOFF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredPostNoDoFProgram.createShader(NULL, NULL);
 	}
-- 
GitLab


From 93e3d9e2ec0cc06cbc378ffcf23e66ed569db5f3 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 30 Sep 2011 15:40:27 -0400
Subject: [PATCH 084/933] Fix for sh-2483

---
 indra/newview/llfloatermodelpreview.cpp                     | 6 ++++++
 indra/newview/llfloatermodelpreview.h                       | 3 ++-
 .../newview/skins/default/xui/en/floater_model_preview.xml  | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 527a868db25..213127046d9 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -749,6 +749,11 @@ void LLFloaterModelPreview::draw()
 
 	if (!mModelPreview->mLoading)
 	{
+		if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_MATERIALS )
+		{
+			childSetTextArg("status", "[STATUS]", getString("status_material_mismatch"));
+		}
+		else
 		if ( mModelPreview->getLoadState() > LLModelLoader::ERROR_PARSING )
 		{		
 			childSetTextArg("status", "[STATUS]", getString(LLModel::getStatusString(mModelPreview->getLoadState() - LLModelLoader::ERROR_PARSING)));
@@ -3321,6 +3326,7 @@ void LLModelPreview::rebuildUploadData()
 				
 				if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) )
 				{
+					setLoadState( LLModelLoader::ERROR_MATERIALS );
 					mFMP->childDisable( "calculate_btn" );
 				}
 			}
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 47de99ce25d..64324854a55 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -70,7 +70,8 @@ class LLModelLoader : public LLThread
 		GENERATING_VERTEX_BUFFERS,
 		GENERATING_LOD,
 		DONE,
-		ERROR_PARSING //basically loading failed
+		ERROR_PARSING, //basically loading failed
+		ERROR_MATERIALS,
 	} eLoadState;
 
 	U32 mState;
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 6c60b3e0e9b..5e0d66b9b97 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -6,6 +6,7 @@
 
   <string name="status_idle"></string>
   <string name="status_parse_error">Error: Dae parsing issue - see log for details.</string>
+  <string name="status_material_mismatch">Error: Material of model is not a subset of reference model.</string>
   <string name="status_reading_file">Loading...</string>
   <string name="status_generating_meshes">Generating Meshes...</string>
   <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
-- 
GitLab


From 784fed2ebb3efd8e4da132c291aaf16cdb931b98 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 30 Sep 2011 16:15:33 -0500
Subject: [PATCH 085/933] SH-2465 Fix for redundant addition of bloom when FXAA
 enabled

---
 indra/newview/pipeline.cpp | 246 ++++++++++++++++++++-----------------
 1 file changed, 131 insertions(+), 115 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c517c9f6026..5f010624a89 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6334,7 +6334,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 	if (LLPipeline::sRenderDeferred)
 	{
-		bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater();
+		bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater() &&
+							!LLToolMgr::getInstance()->inBuildMode() &&
+							gSavedSettings.getBOOL("RenderDepthOfField");
+
 		bool multisample = gSavedSettings.getU32("RenderFSAASamples") > 1;
 
 		if (multisample)
@@ -6363,7 +6366,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			gGlowCombineFXAAProgram.unbind();
 			mFXAABuffer.flush();
 
-			mScreen.bindTarget();
+			if (dof_enabled)
+			{ //if depth of field is not enabled, this is the final pass (draw to window)
+				mScreen.bindTarget();
+			}
 			LLGLSLShader* shader = &gFXAAProgram;
 			shader->bind();
 
@@ -6389,158 +6395,168 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			gGL.end();
 
 			gGL.flush();
-			mScreen.flush();
+			if (dof_enabled)
+			{
+				mScreen.flush();
+			}
 			shader->unbind();
 		}
 
 		gViewerWindow->setup3DViewport();
 				
-		LLGLSLShader* shader = &gDeferredPostProgram;
-		if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
+		if (dof_enabled || !multisample)
 		{
-			shader = &gDeferredGIFinalProgram;
-			dof_enabled = false;
-		}
-		else if (!dof_enabled || LLToolMgr::getInstance()->inBuildMode() || !gSavedSettings.getBOOL("RenderDepthOfField"))
-		{ //squish focal length when in build mode (or if DoF is disabled) so DoF doesn't make editing objects difficult
-			shader = &gDeferredPostNoDoFProgram;
-			dof_enabled = false;
-		}
+			LLGLSLShader* shader = &gDeferredPostProgram;
+			if (!dof_enabled)
+			{ 
+				shader = &gDeferredPostNoDoFProgram;
+			}
 				
-		LLGLDisable blend(GL_BLEND);
-		bindDeferredShader(*shader);
+			LLGLDisable blend(GL_BLEND);
+			bindDeferredShader(*shader);
 
-		if (dof_enabled)
-		{
-			//depth of field focal plane calculations
+			if (dof_enabled)
+			{
+				//depth of field focal plane calculations
 
-			static F32 current_distance = 16.f;
-			static F32 start_distance = 16.f;
-			static F32 transition_time = 1.f;
+				static F32 current_distance = 16.f;
+				static F32 start_distance = 16.f;
+				static F32 transition_time = 1.f;
 
-			LLVector3 focus_point;
+				LLVector3 focus_point;
 
-			LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject();
-			if (obj && obj->mDrawable && obj->isSelected())
-			{ //focus on selected media object
-				S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace();
-				if (obj && obj->mDrawable)
-				{
-					LLFace* face = obj->mDrawable->getFace(face_idx);
-					if (face)
+				LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject();
+				if (obj && obj->mDrawable && obj->isSelected())
+				{ //focus on selected media object
+					S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace();
+					if (obj && obj->mDrawable)
 					{
-						focus_point = face->getPositionAgent();
+						LLFace* face = obj->mDrawable->getFace(face_idx);
+						if (face)
+						{
+							focus_point = face->getPositionAgent();
+						}
 					}
 				}
-			}
 		
-			if (focus_point.isExactlyZero())
-			{
-				if (LLViewerJoystick::getInstance()->getOverrideCamera())
-				{ //focus on point under cursor
-					focus_point = gDebugRaycastIntersection;
-				}
-				else if (gAgentCamera.cameraMouselook())
-				{ //focus on point under mouselook crosshairs
-					gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE,
-												  NULL,
-												  &focus_point);
-				}
-				else
+				if (focus_point.isExactlyZero())
 				{
-					LLViewerObject* obj = gAgentCamera.getFocusObject();
-					if (obj)
-					{ //focus on alt-zoom target
-						focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
+					if (LLViewerJoystick::getInstance()->getOverrideCamera())
+					{ //focus on point under cursor
+						focus_point = gDebugRaycastIntersection;
+					}
+					else if (gAgentCamera.cameraMouselook())
+					{ //focus on point under mouselook crosshairs
+						gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE,
+													  NULL,
+													  &focus_point);
 					}
 					else
-					{ //focus on your avatar
-						focus_point = gAgent.getPositionAgent();
+					{
+						LLViewerObject* obj = gAgentCamera.getFocusObject();
+						if (obj)
+						{ //focus on alt-zoom target
+							focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
+						}
+						else
+						{ //focus on your avatar
+							focus_point = gAgent.getPositionAgent();
+						}
 					}
 				}
-			}
 
-			LLVector3 eye = LLViewerCamera::getInstance()->getOrigin();
-			F32 target_distance = 16.f;
-			if (!focus_point.isExactlyZero())
-			{
-				target_distance = LLViewerCamera::getInstance()->getAtAxis() * (focus_point-eye);
-			}
+				LLVector3 eye = LLViewerCamera::getInstance()->getOrigin();
+				F32 target_distance = 16.f;
+				if (!focus_point.isExactlyZero())
+				{
+					target_distance = LLViewerCamera::getInstance()->getAtAxis() * (focus_point-eye);
+				}
 
-			if (transition_time >= 1.f &&
-				fabsf(current_distance-target_distance)/current_distance > 0.01f)
-			{ //large shift happened, interpolate smoothly to new target distance
-				transition_time = 0.f;
-				start_distance = current_distance;
-			}
-			else if (transition_time < 1.f)
-			{ //currently in a transition, continue interpolating
-				transition_time += 1.f/gSavedSettings.getF32("CameraFocusTransitionTime")*gFrameIntervalSeconds;
-				transition_time = llmin(transition_time, 1.f);
+				if (transition_time >= 1.f &&
+					fabsf(current_distance-target_distance)/current_distance > 0.01f)
+				{ //large shift happened, interpolate smoothly to new target distance
+					transition_time = 0.f;
+					start_distance = current_distance;
+				}
+				else if (transition_time < 1.f)
+				{ //currently in a transition, continue interpolating
+					transition_time += 1.f/gSavedSettings.getF32("CameraFocusTransitionTime")*gFrameIntervalSeconds;
+					transition_time = llmin(transition_time, 1.f);
 
-				F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f;
-				current_distance = start_distance + (target_distance-start_distance)*t;
-			}
-			else
-			{ //small or no change, just snap to target distance
-				current_distance = target_distance;
-			}
+					F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f;
+					current_distance = start_distance + (target_distance-start_distance)*t;
+				}
+				else
+				{ //small or no change, just snap to target distance
+					current_distance = target_distance;
+				}
 
-			//convert to mm
-			F32 subject_distance = current_distance*1000.f;
-			F32 fnumber = gSavedSettings.getF32("CameraFNumber");
-			F32 default_focal_length = gSavedSettings.getF32("CameraFocalLength");
+				//convert to mm
+				F32 subject_distance = current_distance*1000.f;
+				F32 fnumber = gSavedSettings.getF32("CameraFNumber");
+				F32 default_focal_length = gSavedSettings.getF32("CameraFocalLength");
 
-			F32 fov = LLViewerCamera::getInstance()->getView();
+				F32 fov = LLViewerCamera::getInstance()->getView();
 		
-			const F32 default_fov = gSavedSettings.getF32("CameraFieldOfView") * F_PI/180.f;
-			//const F32 default_aspect_ratio = gSavedSettings.getF32("CameraAspectRatio");
+				const F32 default_fov = gSavedSettings.getF32("CameraFieldOfView") * F_PI/180.f;
+				//const F32 default_aspect_ratio = gSavedSettings.getF32("CameraAspectRatio");
 		
-			//F32 aspect_ratio = (F32) mScreen.getWidth()/(F32)mScreen.getHeight();
+				//F32 aspect_ratio = (F32) mScreen.getWidth()/(F32)mScreen.getHeight();
 		
-			F32 dv = 2.f*default_focal_length * tanf(default_fov/2.f);
-			//F32 dh = 2.f*default_focal_length * tanf(default_fov*default_aspect_ratio/2.f);
+				F32 dv = 2.f*default_focal_length * tanf(default_fov/2.f);
+				//F32 dh = 2.f*default_focal_length * tanf(default_fov*default_aspect_ratio/2.f);
 
-			F32 focal_length = dv/(2*tanf(fov/2.f));
+				F32 focal_length = dv/(2*tanf(fov/2.f));
 		 
-			//F32 tan_pixel_angle = tanf(LLDrawable::sCurPixelAngle);
+				//F32 tan_pixel_angle = tanf(LLDrawable::sCurPixelAngle);
 	
-			// from wikipedia -- c = |s2-s1|/s2 * f^2/(N(S1-f))
-			// where	 N = fnumber
-			//			 s2 = dot distance
-			//			 s1 = subject distance
-			//			 f = focal length
-			//	
+				// from wikipedia -- c = |s2-s1|/s2 * f^2/(N(S1-f))
+				// where	 N = fnumber
+				//			 s2 = dot distance
+				//			 s1 = subject distance
+				//			 f = focal length
+				//	
 
-			F32 blur_constant = focal_length*focal_length/(fnumber*(subject_distance-focal_length));
-			blur_constant /= 1000.f; //convert to meters for shader
-			F32 magnification = focal_length/(subject_distance-focal_length);
+				F32 blur_constant = focal_length*focal_length/(fnumber*(subject_distance-focal_length));
+				blur_constant /= 1000.f; //convert to meters for shader
+				F32 magnification = focal_length/(subject_distance-focal_length);
 
-			shader->uniform1f("focal_distance", -subject_distance/1000.f);
-			shader->uniform1f("blur_constant", blur_constant);
-			shader->uniform1f("tan_pixel_angle", tanf(1.f/LLDrawable::sCurPixelAngle));
-			shader->uniform1f("magnification", magnification);
-		}
+				shader->uniform1f("focal_distance", -subject_distance/1000.f);
+				shader->uniform1f("blur_constant", blur_constant);
+				shader->uniform1f("tan_pixel_angle", tanf(1.f/LLDrawable::sCurPixelAngle));
+				shader->uniform1f("magnification", magnification);
+			}
+
+			S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+			if (channel > -1)
+			{
+				mScreen.bindTexture(0, channel);
+			}
+
+			if (multisample)
+			{ //bloom has already been added, bind black
+				channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_BLOOM);
+				if (channel > -1)
+				{
+					gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
+				}
+			}
 
-		S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
-		if (channel > -1)
-		{
-			mScreen.bindTexture(0, channel);
-		}
 	
-		gGL.begin(LLRender::TRIANGLE_STRIP);
-		gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-		gGL.vertex2f(-1,-1);
+			gGL.begin(LLRender::TRIANGLE_STRIP);
+			gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+			gGL.vertex2f(-1,-1);
 		
-		gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-		gGL.vertex2f(-1,3);
+			gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+			gGL.vertex2f(-1,3);
 		
-		gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-		gGL.vertex2f(3,-1);
+			gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+			gGL.vertex2f(3,-1);
 		
-		gGL.end();
+			gGL.end();
 
-		unbindDeferredShader(*shader);
+			unbindDeferredShader(*shader);
+		}
 	}
 	else
 	{
-- 
GitLab


From ac37656aa5ff545c90fadfd5b585cb823ad68b0d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sun, 2 Oct 2011 02:12:21 -0500
Subject: [PATCH 086/933] SH-2276 Fix for failed assertions reported from
 debug-enabled viewers.  Also, remove "Basic Shaders" as a user settable
 option (shaders are always on if GL version >= 2.0, always off otherwise)

---
 indra/llrender/llgl.cpp                            |  2 +-
 indra/llrender/llrendertarget.cpp                  |  2 +-
 indra/llrender/llvertexbuffer.cpp                  | 14 +++++++++++---
 indra/newview/llfloaterpreference.cpp              | 13 +++----------
 indra/newview/llviewershadermgr.cpp                |  6 ++----
 .../default/xui/en/panel_preferences_graphics1.xml | 14 --------------
 6 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 189a460001d..245e8c7beff 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -686,7 +686,7 @@ bool LLGLManager::initGL()
 #if LL_WINDOWS
 	if (mHasDebugOutput && gDebugGL)
 	{ //setup debug output callback
-		glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, GL_TRUE);
+		//glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, GL_TRUE);
 		glDebugMessageCallbackARB((GLDEBUGPROCARB) gl_debug_callback, NULL);
 		glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
 	}
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 1a80688dfcc..cd3a7f21e47 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -308,8 +308,8 @@ void LLRenderTarget::release()
 		glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
 		if (mStencil)
 		{ //attached as a renderbuffer
-			glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
 			glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
+			glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
 			mStencil = false;
 		}
 		else
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 71596d41d3b..7f2337a224b 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -574,6 +574,8 @@ void LLVertexBuffer::unbind()
 		glBindVertexArray(0);
 #endif
 		sGLRenderArray = 0;
+		sGLRenderIndices = 0;
+		sIBOActive = FALSE;
 	}
 
 	if (sVBOActive)
@@ -1131,9 +1133,7 @@ void LLVertexBuffer::setupVertexArray()
 		}
 	}
 
-#if GL_ARB_vertex_array_object
-	glBindVertexArray(0);
-#endif
+	unbind();
 }
 
 void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
@@ -1873,6 +1873,12 @@ bool LLVertexBuffer::bindGLArray()
 		glBindVertexArray(mGLArray);
 #endif
 		sGLRenderArray = mGLArray;
+
+		if (mGLIndices)
+		{
+			sGLRenderIndices = mGLIndices;
+			sIBOActive = TRUE;
+		}
 		return true;
 	}
 		
@@ -2082,6 +2088,8 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 			glBindVertexArray(0);
 #endif
 			sGLRenderArray = 0;
+			sGLRenderIndices = 0;
+			sIBOActive = FALSE;
 		}
 
 		if (mGLBuffer)
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 9630d7b29f0..5c36d2e1314 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1034,14 +1034,11 @@ void LLFloaterPreference::refreshEnabledState()
 	}
 	
 	// Vertex Shaders
-	// Global Shader Enable
-	LLCheckBoxCtrl* ctrl_shader_enable   = getChild<LLCheckBoxCtrl>("BasicShaders");
 	// radio set for terrain detail mode
 	LLRadioGroup*   mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio");   // can be linked with control var
 	
-	ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
-	
-	BOOL shaders = ctrl_shader_enable->get();
+	BOOL shaders = gGLManager.mGLVersion >= 2.f;
+
 	if (shaders)
 	{
 		mRadioTerrainDetail->setValue(1);
@@ -1057,7 +1054,7 @@ void LLFloaterPreference::refreshEnabledState()
 	
 	// *HACK just checks to see if we can use shaders... 
 	// maybe some cards that use shaders, but don't support windlight
-	ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
+	ctrl_wind_light->setEnabled(shaders);
 
 	//Deferred/SSAO/Shadows
 	LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@@ -1095,7 +1092,6 @@ void LLFloaterPreference::disableUnavailableSettings()
 	LLComboBox* ctrl_reflections   = getChild<LLComboBox>("Reflections");
 	LLCheckBoxCtrl* ctrl_avatar_vp     = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
 	LLCheckBoxCtrl* ctrl_avatar_cloth  = getChild<LLCheckBoxCtrl>("AvatarCloth");
-	LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
 	LLCheckBoxCtrl* ctrl_wind_light    = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
 	LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
 	LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@@ -1106,9 +1102,6 @@ void LLFloaterPreference::disableUnavailableSettings()
 	// if vertex shaders off, disable all shader related products
 	if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
 	{
-		ctrl_shader_enable->setEnabled(FALSE);
-		ctrl_shader_enable->setValue(FALSE);
-		
 		ctrl_wind_light->setEnabled(FALSE);
 		ctrl_wind_light->setValue(FALSE);
 		
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index d3f5ebcf1cb..17d2a043015 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -450,8 +450,8 @@ void LLViewerShaderMgr::setShaders()
 	LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);
 
 
-	if (LLRender::sGLCoreProfile)
-	{ 
+	if (LLRender::sGLCoreProfile || gGLManager.mGLVersion >= 2.f)
+	{  //ALWAYS use shaders where available
 		if (!gSavedSettings.getBOOL("VertexShaderEnable"))
 		{ //vertex shaders MUST be enabled to use core profile
 			gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
@@ -1122,8 +1122,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		return TRUE;
 	}
 
-	mVertexShaderLevel[SHADER_AVATAR] = 1;
-
 	BOOL success = TRUE;
 
 	if (success)
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index f7666bdc4ca..c25c1f23f51 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -204,20 +204,6 @@
 		name="LocalLights"
 		 top_pad="1"
 		 width="256" />
-		  <check_box
-		 control_name="VertexShaderEnable"
-		 height="16"
-		 initial_value="true"
-		 label="Basic shaders"
-		 layout="topleft"
-		 left_delta="0"
-		 name="BasicShaders"
-		 tool_tip="Disabling this option may prevent some graphics card drivers from crashing"
-		 top_pad="1"
-		 width="315">
-			<check_box.commit_callback
-		     function="Pref.VertexShaderEnable" />
-		</check_box>
 		<check_box
 		 control_name="WindLightUseAtmosShaders"
 		 height="16"
-- 
GitLab


From c4aa8c50daf7c4eea3509057a7ca74b083682779 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 4 Oct 2011 02:31:54 -0500
Subject: [PATCH 087/933] SH-2447, SH-2525, SH-2276 Strip out defunct global
 illumination code, add accounting for how much memory is taken up by
 LLRenderTarget, fix crash on login in bindGLIndices (work around driver bug
 that doesn't respect VAO state WRT to index buffers), remove some unused
 render targets, remove some unused shaders, make it possible to run a
 fullscreen session

---
 indra/llrender/llgl.cpp                       |   9 +-
 indra/llrender/llrendertarget.cpp             |  73 +-
 indra/llrender/llrendertarget.h               |   2 +-
 indra/llrender/llvertexbuffer.cpp             |  57 +-
 indra/newview/app_settings/settings.xml       | 252 +------
 .../shaders/class2/deferred/edgeF.glsl        |  82 ---
 .../shaders/class2/deferred/edgeV.glsl        |  39 -
 .../class3/deferred/giDownsampleF.glsl        | 107 ---
 .../class3/deferred/giDownsampleV.glsl        |  39 -
 .../shaders/class3/deferred/giF.glsl          | 213 ------
 .../shaders/class3/deferred/giFinalF.glsl     |  47 --
 .../shaders/class3/deferred/giFinalV.glsl     |  40 --
 .../shaders/class3/deferred/giV.glsl          |  49 --
 .../shaders/class3/deferred/luminanceF.glsl   |  41 --
 .../shaders/class3/deferred/luminanceV.glsl   |  45 --
 .../class3/deferred/postDeferredF.glsl        | 101 ---
 .../class3/deferred/postDeferredV.glsl        |  39 -
 .../shaders/class3/deferred/postgiF.glsl      |  91 ---
 .../shaders/class3/deferred/postgiV.glsl      |  39 -
 .../shaders/class3/deferred/softenLightF.glsl | 337 ---------
 .../shaders/class3/deferred/softenLightV.glsl |  44 --
 .../shaders/class3/deferred/treeF.glsl        |  44 --
 indra/newview/llappviewer.cpp                 |   4 +-
 indra/newview/lltextureview.cpp               |   3 +-
 indra/newview/llviewercontrol.cpp             |   1 -
 indra/newview/llviewerjointmesh.cpp           |   4 +-
 indra/newview/llviewershadermgr.cpp           |  97 +--
 indra/newview/llviewershadermgr.h             |  21 -
 indra/newview/pipeline.cpp                    | 672 +-----------------
 indra/newview/pipeline.h                      |   8 +-
 .../skins/default/xui/en/menu_viewer.xml      |  13 -
 31 files changed, 127 insertions(+), 2486 deletions(-)
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/giF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/giV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class3/deferred/treeF.glsl

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 245e8c7beff..8ad75384f22 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -81,7 +81,14 @@ void APIENTRY gl_debug_callback(GLenum source,
                                 const GLchar* message,
                                 GLvoid* userParam)
 {
-	llwarns << "----- GL ERROR --------" << llendl;
+	if (severity == GL_DEBUG_SEVERITY_HIGH_ARB)
+	{
+		llwarns << "----- GL ERROR --------" << llendl;
+	}
+	else
+	{
+		llwarns << "----- GL WARNING -------" << llendl;
+	}
 	llwarns << "Type: " << std::hex << type << llendl;
 	llwarns << "ID: " << std::hex << id << llendl;
 	llwarns << "Severity: " << std::hex << severity << llendl;
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index cd3a7f21e47..1aa12614ea1 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -31,8 +31,7 @@
 #include "llgl.h"
 
 LLRenderTarget* LLRenderTarget::sBoundTarget = NULL;
-
-
+U32 LLRenderTarget::sBytesAllocated = 0;
 
 void check_framebuffer_status()
 {
@@ -62,8 +61,7 @@ LLRenderTarget::LLRenderTarget() :
 	mStencil(0),
 	mUseDepth(false),
 	mRenderDepth(false),
-	mUsage(LLTexUnit::TT_TEXTURE),
-	mSamples(0)
+	mUsage(LLTexUnit::TT_TEXTURE)
 {
 }
 
@@ -85,8 +83,6 @@ bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo
 	mUsage = usage;
 	mUseDepth = depth;
 
-	mSamples = 0;
-
 	if ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
 	{
 		if (depth)
@@ -155,32 +151,32 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
 		}
 	}
 	
+	sBytesAllocated += mResX*mResY*4;
+
 	stop_glerror();
 
-	if (mSamples == 0)
-	{ 
-		if (offset == 0)
-		{ //use bilinear filtering on single texture render targets that aren't multisampled
-			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-			stop_glerror();
-		}
-		else
-		{ //don't filter data attachments
-			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-			stop_glerror();
-		}
+	
+	if (offset == 0)
+	{ //use bilinear filtering on single texture render targets that aren't multisampled
+		gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
+		stop_glerror();
+	}
+	else
+	{ //don't filter data attachments
+		gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+		stop_glerror();
+	}
 
-		if (mUsage != LLTexUnit::TT_RECT_TEXTURE)
-		{
-			gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_MIRROR);
-			stop_glerror();
-		}
-		else
-		{
-			// ATI doesn't support mirrored repeat for rectangular textures.
-			gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
-			stop_glerror();
-		}
+	if (mUsage != LLTexUnit::TT_RECT_TEXTURE)
+	{
+		gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_MIRROR);
+		stop_glerror();
+	}
+	else
+	{
+		// ATI doesn't support mirrored repeat for rectangular textures.
+		gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
+		stop_glerror();
 	}
 		
 	if (mFBO)
@@ -223,16 +219,16 @@ bool LLRenderTarget::allocateDepth()
 	{
 		LLImageGL::generateTextures(1, &mDepth);
 		gGL.getTexUnit(0)->bindManual(mUsage, mDepth);
-		if (mSamples == 0)
-		{
-			U32 internal_type = LLTexUnit::getInternalType(mUsage);
-			stop_glerror();
-			clear_glerror();
-			LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
-			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-		}
+		
+		U32 internal_type = LLTexUnit::getInternalType(mUsage);
+		stop_glerror();
+		clear_glerror();
+		LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+		gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
+	sBytesAllocated += mResX*mResY*4;
+
 	if (glGetError() != GL_NO_ERROR)
 	{
 		llwarns << "Unable to allocate depth buffer for render target." << llendl;
@@ -302,6 +298,8 @@ void LLRenderTarget::release()
 			stop_glerror();
 		}
 		mDepth = 0;
+
+		sBytesAllocated -= mResX*mResY*4;
 	}
 	else if (mUseDepth && mFBO)
 	{ //detach shared depth buffer
@@ -327,6 +325,7 @@ void LLRenderTarget::release()
 
 	if (mTex.size() > 0)
 	{
+		sBytesAllocated -= mResX*mResY*4*mTex.size();
 		LLImageGL::deleteTextures(mTex.size(), &mTex[0], true);
 		mTex.clear();
 	}
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index dea1de12d80..2735ab21c56 100644
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -64,6 +64,7 @@ class LLRenderTarget
 public:
 	//whether or not to use FBO implementation
 	static bool sUseFBO; 
+	static U32 sBytesAllocated;
 
 	LLRenderTarget();
 	~LLRenderTarget();
@@ -147,7 +148,6 @@ class LLRenderTarget
 	bool mUseDepth;
 	bool mRenderDepth;
 	LLTexUnit::eTextureType mUsage;
-	U32 mSamples;
 	
 	static LLRenderTarget* sBoundTarget;
 };
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 7f2337a224b..c3e1a486b31 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -430,7 +430,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 		}
 	}
 
-	if (gDebugGL && useVBOs())
+	if (gDebugGL && !mGLArray && useVBOs())
 	{
 		GLint elem = 0;
 		glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem);
@@ -1049,6 +1049,8 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 		createGLBuffer();
 		createGLIndices();
 
+		//actually allocate space for the vertex buffer if using VBO mapping
+		flush();
 
 		if (gGLManager.mHasVertexArrayObject && useVBOs() && (LLRender::sGLCoreProfile || sUseVAO))
 		{
@@ -1064,7 +1066,15 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 
 void LLVertexBuffer::setupVertexArray()
 {
-	bindGLArray();
+	if (!mGLArray)
+	{
+		return;
+	}
+
+#if GL_ARB_vertex_array_object
+	glBindVertexArray(mGLArray);
+#endif
+	sGLRenderArray = mGLArray;
 
 	U32 attrib_size[] = 
 	{
@@ -1362,6 +1372,18 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 					else
 					{
 #ifdef GL_ARB_map_buffer_range
+
+						if (gDebugGL)
+						{
+							GLint size = 0;
+							glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size);
+
+							if (size < mSize)
+							{
+								llerrs << "Invalid buffer size." << llendl;
+							}
+						}
+
 						src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, 
 							GL_MAP_WRITE_BIT | 
 							GL_MAP_FLUSH_EXPLICIT_BIT);
@@ -1874,11 +1896,10 @@ bool LLVertexBuffer::bindGLArray()
 #endif
 		sGLRenderArray = mGLArray;
 
-		if (mGLIndices)
-		{
-			sGLRenderIndices = mGLIndices;
-			sIBOActive = TRUE;
-		}
+		//really shouldn't be necessary, but some drivers don't properly restore the
+		//state of GL_ELEMENT_ARRAY_BUFFER_BINDING
+		bindGLIndices();
+		
 		return true;
 	}
 		
@@ -1911,17 +1932,6 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
 		ret = true;
 	}
 
-	if (gDebugGL && useVBOs())
-	{
-		GLint elem = 0;
-		glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &elem);
-
-		if (elem != mGLBuffer)
-		{
-			llerrs << "Wrong vertex buffer bound!" << llendl;
-		}
-	}
-
 	return ret;
 }
 
@@ -1944,17 +1954,6 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind)
 		ret = true;
 	}
 
-	if (gDebugGL && useVBOs())
-	{
-		GLint elem = 0;
-		glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem);
-
-		if (elem != mGLIndices)
-		{
-			llerrs << "Wrong index buffer bound!" << llendl;
-		}
-	}
-
 	return ret;
 }
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c71973ad583..e457c568e20 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5644,7 +5644,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
     <key>MemProfiling</key>
     <map>
@@ -7857,151 +7857,7 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
-
-  <key>RenderGIRange</key>
-  <map>
-    <key>Comment</key>
-    <string>Distance to cut off GI effect.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>96</real>
-  </map>
-
-  <key>RenderGILuminance</key>
-  <map>
-    <key>Comment</key>
-    <string>Luminance factor of global illumination contribution.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.075</real>
-  </map>
   
-  <key>RenderGIBrightness</key>
-  <map>
-    <key>Comment</key>
-    <string>Brightness factor of global illumination contribution.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.3</real>
-  </map>
-
-  <key>RenderGINoise</key>
-  <map>
-    <key>Comment</key>
-    <string>Noise of position sampling for GI photon mapping.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.7</real>
-  </map>
-
-  <key>RenderGIAttenuation</key>
-  <map>
-    <key>Comment</key>
-    <string>Distance attenuation factor for indirect lighting.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.1</real>
-  </map>
-
-  <key>RenderGIBlurBrightness</key>
-  <map>
-    <key>Comment</key>
-    <string>Brightness factor of global illumination blur effect.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>1.025</real>
-  </map>
-
-  <key>RenderGIBlurEdgeWeight</key>
-  <map>
-    <key>Comment</key>
-    <string>Edge weight for GI soften filter (sharpness).</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.8</real>
-  </map>
-
-  <key>RenderGIBlurIncrement</key>
-  <map>
-    <key>Comment</key>
-    <string>Increment of scale for each pass of global illumination blur effect.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.8</real>
-  </map>
-
-  <key>RenderLuminanceScale</key>
-  <map>
-    <key>Comment</key>
-    <string>Luminance value scalar for darkening effect.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>1.0</real>
-  </map>
-
-  <key>RenderSunLuminanceScale</key>
-  <map>
-    <key>Comment</key>
-    <string>Sun Luminance value scalar for darkening effect.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>1.0</real>
-  </map>
-
-  <key>RenderSunLuminanceOffset</key>
-  <map>
-    <key>Comment</key>
-    <string>Sun Luminance value offset for darkening effect.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0</real>
-  </map>
-
-  <key>RenderLuminanceDetail</key>
-  <map>
-    <key>Comment</key>
-    <string>Mipmap level to use for luminance</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>16.0</real>
-   </map>
-
   <key>RenderMinimumLODTriangleCount</key>
   <map>
     <key>Comment</key>
@@ -8322,18 +8178,6 @@
     <integer>0</integer>
   </map>
 
-  <key>RenderDeferredGI</key>
-  <map>
-    <key>Comment</key>
-    <string>Enable GI in deferred renderer.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>0</integer>
-  </map>
-
   <key>RenderDeferredSun</key>
   <map>
     <key>Comment</key>
@@ -8477,92 +8321,6 @@
     <real>0</real>
   </map>
 
-  <key>RenderGIAmbiance</key>
-  <map>
-    <key>Comment</key>
-    <string>Ambiance factor of global illumination contribution.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.5</real>
-  </map>
-
-  <key>RenderGIMinRenderSize</key>
-  <map>
-    <key>Comment</key>
-    <string>Minimum size of objects to put into GI source map.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.5</real>
-  </map>
-
-  <key>RenderGIBlurColorCurve</key>
-  <map>
-    <key>Comment</key>
-    <string>Color curve for GI softening kernel</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Vector3</string>
-    <key>Value</key>
-    <array>
-      <real>1.0</real>
-      <real>0.6</real>
-      <real>0.02</real>
-    </array>
-  </map>
-
-  <key>RenderGIBlurPasses</key>
-  <map>
-    <key>Comment</key>
-    <string>Scale of GI softening kernel.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>U32</string>
-    <key>Value</key>
-    <real>4</real>
-  </map>
-
-  <key>RenderGIBlurSize</key>
-  <map>
-    <key>Comment</key>
-    <string>Scale of GI softening kernel.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>4.0</real>
-  </map>
-  <key>RenderGIBlurSamples</key>
-  <map>
-    <key>Comment</key>
-    <string>Number of samples to take for each pass of GI blur (value range 1-16).  Actual number of samples is value * 2 - 1.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>U32</string>
-    <key>Value</key>
-    <real>16</real>
-  </map>
-  <key>RenderGIBlurDistFactor</key>
-  <map>
-    <key>Comment</key>
-    <string>Distance scaler for GI blur.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.0</real>
-  </map>
-
   <key>RenderDynamicLOD</key>
     <map>
       <key>Comment</key>
@@ -9306,7 +9064,9 @@
     <integer>1</integer>
     <key>Type</key>
     <string>Boolean</string>
-    <key>Value</key>
+    <key>Va
+    
+    lue</key>
     <integer>1</integer>
   </map>
 	<key>RenderPreferStreamDraw</key>
@@ -12884,10 +12644,10 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>WindowFullScreen</key>
+    <key>FullScreen</key>
     <map>
       <key>Comment</key>
-      <string>SL viewer window full screen</string>
+      <string>run a fullscreen session</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
deleted file mode 100644
index f75a08779c4..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
+++ /dev/null
@@ -1,82 +0,0 @@
-/** 
- * @file edgeF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect depthMap;
-uniform sampler2DRect normalMap;
-
-VARYING vec2 vary_fragcoord;
-
-uniform float depth_cutoff;
-uniform float norm_cutoff;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-float getDepth(vec2 pos_screen)
-{
-	float z = texture2DRect(depthMap, pos_screen.xy).r;
-	z = z*2.0-1.0;
-	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
-	vec4 p = inv_proj*ndc;
-	return p.z/p.w;
-}
-
-void main() 
-{
-	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	float depth = getDepth(vary_fragcoord.xy);
-	
-	vec2 tc = vary_fragcoord.xy;
-	
-	float sc = 0.75;
-	
-	vec2 de;
-	de.x = (depth-getDepth(tc+vec2(sc, sc))) + (depth-getDepth(tc+vec2(-sc, -sc)));
-	de.y = (depth-getDepth(tc+vec2(-sc, sc))) + (depth-getDepth(tc+vec2(sc, -sc)));
-	de /= depth;
-	de *= de;
-	de = step(depth_cutoff, de);
-	
-	vec2 ne;
-	vec3 nexnorm = texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb;
-	nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm
-	ne.x = dot(nexnorm, norm);
-	vec3 neynorm = texture2DRect(normalMap, tc+vec2(sc,sc)).rgb;
-	neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm
-	ne.y = dot(neynorm, norm);
-	
-	ne = 1.0-ne;
-	
-	ne = step(norm_cutoff, ne);
-	
-	gl_FragColor.a = dot(de,de)+dot(ne,ne);
-}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
deleted file mode 100644
index 69c6acc07a2..00000000000
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
+++ /dev/null
@@ -1,39 +0,0 @@
-/** 
- * @file edgeV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-
-VARYING vec2 vary_fragcoord;
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
deleted file mode 100644
index 832cf461507..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
+++ /dev/null
@@ -1,107 +0,0 @@
-/** 
- * @file giDownsampleF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect giLightMap;
-
-uniform vec2 kern[32];
-uniform float dist_factor;
-uniform float blur_size;
-uniform vec2 delta;
-uniform int kern_length;
-uniform float kern_scale;
-uniform vec3 blur_quad;
-
-VARYING vec2 vary_fragcoord;
-
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-vec4 getPosition(vec2 pos_screen)
-{
-	float depth = texture2DRect(depthMap, pos_screen.xy).a;
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-float getDepth(vec2 pos_screen)
-{
-	float z = texture2DRect(depthMap, pos_screen.xy).a;
-	z = z*2.0-1.0;
-	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
-	vec4 p = inv_proj*ndc;
-	return p.z/p.w;
-}
-
-void main() 
-{
-	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	float depth = getDepth(vary_fragcoord.xy);
-		
-	vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb;
-	vec2 dlt = kern_scale * delta/(vec2(1.0,1.0)+norm.xy*norm.xy);
-	dlt /= clamp(-depth*blur_quad.x, 1.0, 3.0);
-	float defined_weight = kern[0].x;
-	vec3 col = ccol*kern[0].x;
-	
-	for (int i = 0; i < kern_length; i++)
-	{
-		vec2 tc = vary_fragcoord.xy + kern[i].y*dlt;
-		vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz;
-		sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm
-		
-		float d = dot(norm.xyz, sampNorm);
-		
-		if (d > 0.5)
-		{
-			float sampdepth = getDepth(tc.xy);
-			sampdepth -= depth;
-			if (sampdepth*sampdepth < blur_quad.z)
-			{
-	    		col += texture2DRect(giLightMap, tc).rgb*kern[i].x;
-				defined_weight += kern[i].x;
-			}
-		}
-	}
-
-	col /= defined_weight;
-	
-	//col = ccol;
-	
-	col = col*blur_quad.y;
-	
-	gl_FragColor.xyz = col;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
deleted file mode 100644
index 380d5207c30..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
+++ /dev/null
@@ -1,39 +0,0 @@
-/** 
- * @file postgiV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-
-VARYING vec2 vary_fragcoord;
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 	
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
deleted file mode 100644
index ee992f2fe92..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl
+++ /dev/null
@@ -1,213 +0,0 @@
-/** 
- * @file giF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR;
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect depthMap;
-uniform sampler2DRect normalMap;
-uniform sampler2DRect lightMap;
-uniform sampler2DRect specularRect;
-
-uniform sampler2D noiseMap;
-
-uniform sampler2D		diffuseGIMap;
-uniform sampler2D		specularGIMap;
-uniform sampler2D		normalGIMap;
-uniform sampler2D		depthGIMap;
-
-uniform sampler2D		lightFunc;
-
-// Inputs
-VARYING vec2 vary_fragcoord;
-
-uniform vec2 screen_res;
-
-uniform vec4 sunlight_color;
-
-uniform mat4 inv_proj;
-uniform mat4 gi_mat;  //gPipeline.mGIMatrix - eye space to sun space
-uniform mat4 gi_mat_proj; //gPipeline.mGIMatrixProj - eye space to projected sun space
-uniform mat4 gi_norm_mat; //gPipeline.mGINormalMatrix - eye space normal to sun space normal matrix
-uniform mat4 gi_inv_proj; //gPipeline.mGIInvProj - projected sun space to sun space
-uniform float gi_sample_width;
-uniform float gi_noise;
-uniform float gi_attenuation;
-uniform float gi_range;
-
-vec4 getPosition(vec2 pos_screen)
-{
-	float depth = texture2DRect(depthMap, pos_screen.xy).a;
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-vec4 getGIPosition(vec2 gi_tc)
-{
-	float depth = texture2D(depthGIMap, gi_tc).a;
-	vec2 sc = gi_tc*2.0;
-	sc -= vec2(1.0, 1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = gi_inv_proj*ndc;
-	pos.xyz /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-vec3 giAmbient(vec3 pos, vec3 norm)
-{
-	vec4 gi_c = gi_mat_proj * vec4(pos, 1.0);
-	gi_c.xyz /= gi_c.w;
-
-	vec4 gi_pos = gi_mat*vec4(pos,1.0);
-	vec3 gi_norm = (gi_norm_mat*vec4(norm,1.0)).xyz;
-	gi_norm = normalize(gi_norm);
-	
-	vec4 c_spec = texture2DRect(specularRect, vary_fragcoord.xy);
-	vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).rgb;
-	gi_pos.xyz += nz.x*gi_noise*gi_norm.xyz;
-	vec2 tcx = gi_norm.xy;
-	vec2 tcy = gi_norm.yx;
-	
-	vec4 eye_pos = gi_mat*vec4(0,0,0,1.0);
-	
-	vec3 eye_dir = normalize(gi_pos.xyz-eye_pos.xyz);
-	vec3 eye_ref = reflect(eye_dir, gi_norm);
-	
-	float da = 0.0; //texture2DRect(lightMap, vary_fragcoord.xy).r*0.5;
-	vec3 fdiff = vec3(da);
-	float fda = da;
-	
-	vec3 rcol = vec3(0,0,0);
-	
-	float fsa = 0.0;
-	
-
-	for (int i = -1; i <= 1; i += 2 )
-	{
-		for (int j = -1; j <= 1; j+= 2)
-		{
-			vec2 tc = vec2(i, j)*0.75+gi_norm.xy*nz.z;
-			tc += nz.xy*2.0;
-			tc *= gi_sample_width*0.25;
-			tc += gi_c.xy;
-			
-			vec3 lnorm = -(texture2D(normalGIMap, tc.xy).xyz*2.0-1.0);
-			vec3 lpos = getGIPosition(tc.xy).xyz;
-							
-			vec3 at = lpos-gi_pos.xyz;
-			float dist = length(at);
-			float dist_atten = clamp(1.0/(gi_attenuation*dist), 0.0, 1.0);
-			
-						
-			if (dist_atten > 0.01)
-			{ //possible contribution of indirect light to this surface
-				vec3 ldir = at;
-				
-				float ld = -dot(ldir, lnorm);
-				
-				if (ld < 0.0)
-				{  					
-					float ang_atten = dot(ldir, gi_norm);
-				
-					if (ang_atten > 0.0)
-					{  
-						vec4 spec = texture2D(specularGIMap, tc.xy);
-						at = normalize(at);
-						vec3 diff;		
-						
-						float da = 0.0;
-												
-						//contribution from indirect source to visible pixel
-						vec3 ha = at;
-						ha.z -= 1.0;
-						ha = normalize(ha);
-						if (spec.a > 0.0)
-						{
-							float sa = dot(ha,lnorm);
-							da = texture2D(lightFunc, vec2(sa, spec.a)).r;
-						}
-						else
-						{
-							da = -lnorm.z;
-						}
-						
-						diff = texture2D(diffuseGIMap, tc.xy).rgb+spec.rgb*spec.a*2.0;
-												
-						if (da > 0.0)
-						{ //contribution from visible pixel to eye
-							vec3 ha = normalize(at-eye_dir);
-							if (c_spec.a > 0.0)
-							{
-								float sa = dot(ha, gi_norm);
-								da = dist_atten*texture2D(lightFunc, vec2(sa, c_spec.a)).r;
-							}
-							else
-							{
-								da = dist_atten*dot(gi_norm, normalize(ldir));
-							}
-							fda += da;
-							fdiff += da*(c_spec.rgb*c_spec.a*2.0+vec3(1,1,1))*diff.rgb;
-						}
-					}
-				}
-			}
-		}
-	}
-
-	fdiff *= sunlight_color.rgb;
-	
-	vec3 ret = fda*fdiff;
-	
-	return clamp(ret,vec3(0.0), vec3(1.0));
-}
-
-void main() 
-{
-	vec2 pos_screen = vary_fragcoord.xy;
-	vec4 pos = getPosition(pos_screen);
-	
-	float rad = gi_range*0.5;
-	
-	vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	float dist = max(length(pos.xyz)-rad, 0.0);
-	
-	float da = clamp(1.0-dist/rad, 0.0, 1.0);
-	
-	vec3 ambient = da > 0.0 ? giAmbient(pos.xyz, norm) : vec3(0);
-	
-		
-	gl_FragColor.xyz = mix(vec3(0), ambient, da);
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
deleted file mode 100644
index 3ace57e3cb8..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl
+++ /dev/null
@@ -1,47 +0,0 @@
-/** 
- * @file giFinalF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect diffuseRect;
-uniform sampler2D	  bloomMap;
-uniform sampler2DRect edgeMap;
-
-uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
-
-
-void main() 
-{
-	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
-	
-	gl_FragColor = bloom + diff;
-	//gl_FragColor.rgb = vec3(texture2DRect(edgeMap, vary_fragcoord.xy).a);
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
deleted file mode 100644
index 60eca06d356..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
+++ /dev/null
@@ -1,40 +0,0 @@
-/** 
- * @file giFinalV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-
-
-VARYING vec2 vary_fragcoord;
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos;
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
deleted file mode 100644
index 8272dbf31bb..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
+++ /dev/null
@@ -1,49 +0,0 @@
-/** 
- * @file giV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
-
-
-VARYING vec2 vary_fragcoord;
-VARYING vec4 vertex_color;
-
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 
-	
-	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = vec4(texcoord0,0,1);
-	tex.w = 1.0;
-
-	vertex_color = diffuse_color;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
deleted file mode 100644
index 3057b63ecdc..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl
+++ /dev/null
@@ -1,41 +0,0 @@
-/** 
- * @file luminanceF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect lightMap;
-uniform sampler2DRect diffuseRect;
-
-VARYING vec2 vary_fragcoord;
-void main() 
-{
-	float i = texture2DRect(lightMap, vary_fragcoord.xy).r;
-	gl_FragColor.rgb = vec3(i);
-	gl_FragColor.a = 1.0;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
deleted file mode 100644
index 062875e72ff..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
+++ /dev/null
@@ -1,45 +0,0 @@
-/** 
- * @file giV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-VARYING vec2 vary_fragcoord;
-VARYING vec4 vertex_color;
-
-uniform vec2 screen_res;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 
-	
-	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-
-	vertex_color = diffuse_color;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
deleted file mode 100644
index c7ccf3a6130..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl
+++ /dev/null
@@ -1,101 +0,0 @@
-/** 
- * @file postDeferredF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-  
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect diffuseRect;
-uniform sampler2DRect specularRect;
-
-uniform sampler2DRect localLightMap;
-uniform sampler2DRect sunLightMap;
-uniform sampler2DRect giLightMap;
-uniform sampler2DRect edgeMap;
-
-uniform sampler2D	  luminanceMap;
-
-uniform sampler2DRect lightMap;
-
-uniform sampler2D	  lightFunc;
-uniform sampler2D	  noiseMap;
-
-uniform float sun_lum_scale;
-uniform float sun_lum_offset;
-uniform float lum_scale;
-uniform float lum_lod;
-uniform vec4 ambient;
-uniform float gi_brightness;
-uniform float gi_luminance;
-
-uniform vec4 sunlight_color;
-
-uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
-
-void main() 
-{
-	vec2 tc = vary_fragcoord.xy;
-	vec4 lcol = texture2DLod(luminanceMap, vec2(0.5, 0.5), lum_lod);
-	
-	vec3 gi_col = texture2DRect(giLightMap, vary_fragcoord.xy).rgb;
-	vec4 sun_col =	texture2DRect(sunLightMap, vary_fragcoord.xy);
-	vec3 local_col = texture2DRect(localLightMap, vary_fragcoord.xy).rgb;
-	
-	float scol = texture2DRect(lightMap, vary_fragcoord.xy).r;
-			
-	vec3 diff = texture2DRect(diffuseRect, vary_fragcoord.xy).rgb;
-	vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
-	
-	gi_col = gi_col*(diff.rgb+spec.rgb*spec.a);
-
-	float lum = 1.0-clamp(pow(lcol.r, gi_brightness)+sun_lum_offset, 0.0, 1.0);
-	
-	lum *= sun_lum_scale;
-	
-	sun_col *= 1.0+(lum*lum_scale*scol);
-					  
-	vec4 col;
-	col.rgb = gi_col+sun_col.rgb+local_col;
-	
-	col.a = sun_col.a;
-	
-	vec3 bcol = vec3(0,0,0);
-	float tweight = 0.0;
-	for (int i = 0; i < 16; i++)
-	{
-		float weight = (float(i)+1.0)/2.0;
-		bcol += texture2DLod(luminanceMap, vary_fragcoord.xy/screen_res, weight).rgb*weight*weight*weight;
-		tweight += weight*weight;
-	}
-	
-	bcol /= tweight;
-	bcol *= gi_luminance;
-	col.rgb += bcol*lum;
-	
-	gl_FragColor = col;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
deleted file mode 100644
index 0049d8ea78c..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
+++ /dev/null
@@ -1,39 +0,0 @@
-/** 
- * @file postDeferredV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-
-VARYING vec2 vary_fragcoord;
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
deleted file mode 100644
index 499a72222d6..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl
+++ /dev/null
@@ -1,91 +0,0 @@
-/** 
- * @file postgiF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect depthMap;
-uniform sampler2DRect normalMap;
-uniform sampler2DRect giLightMap;
-uniform sampler2D	noiseMap;
-uniform sampler2D	giMip;
-uniform sampler2DRect edgeMap;
-
-
-uniform vec2 delta;
-uniform float kern_scale;
-uniform float gi_edge_weight;
-uniform float gi_blur_brightness;
-
-VARYING vec2 vary_fragcoord;
-
-void main() 
-{
-	vec2 dlt = kern_scale*delta;
-	float defined_weight = 0.0; 
-	vec3 col = vec3(0.0); 
-	
-	float e = 1.0;
-	
-	for (int i = 1; i < 8; i++)
-	{
-		vec2 tc = vary_fragcoord.xy + float(i) * dlt;
-		
-		e = max(e, 0.0);
-		float wght = e;
-		
-	   	col += texture2DRect(giLightMap, tc).rgb*wght;
-		defined_weight += wght;
-				
-		e *= e;
-		e -=(texture2DRect(edgeMap, tc.xy-dlt*0.25).a+
-			texture2DRect(edgeMap, tc.xy+dlt*0.25).a)*gi_edge_weight;
-	}
-
-	e = 1.0;
-	
-	for (int i = 1; i < 8; i++)
-	{
-		vec2 tc = vary_fragcoord.xy - float(i) * dlt;
-		
-		e = max(e,0.0);
-		float wght = e;
-		
-	   	col += texture2DRect(giLightMap, tc).rgb*wght;
-		defined_weight += wght;
-	
-		e *= e;
-		e -= (texture2DRect(edgeMap, tc.xy-dlt*0.25).a+
-			texture2DRect(edgeMap, tc.xy+dlt*0.25).a)*gi_edge_weight;
-		
-	}
-	
-	col /= max(defined_weight, 0.01);
-
-	gl_FragColor.rgb = col * gi_blur_brightness;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
deleted file mode 100644
index 6d590c8051d..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
+++ /dev/null
@@ -1,39 +0,0 @@
-/** 
- * @file postgiV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-
-VARYING vec2 vary_fragcoord;
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
deleted file mode 100644
index 7089c53f1c3..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ /dev/null
@@ -1,337 +0,0 @@
-/** 
- * @file softenLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
- 
-#extension GL_ARB_texture_rectangle : enable
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif
-
-uniform sampler2DRect diffuseRect;
-uniform sampler2DRect specularRect;
-uniform sampler2DRect normalMap;
-uniform sampler2DRect lightMap;
-uniform sampler2D	  noiseMap;
-uniform samplerCube environmentMap;
-uniform sampler2D	  lightFunc;
-uniform vec3 gi_quad;
-
-uniform float blur_size;
-uniform float blur_fidelity;
-
-// Inputs
-uniform vec4 morphFactor;
-uniform vec3 camPosLocal;
-//uniform vec4 camPosWorld;
-uniform vec4 gamma;
-uniform vec4 lightnorm;
-uniform vec4 sunlight_color;
-uniform vec4 ambient;
-uniform vec4 blue_horizon;
-uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 distance_multiplier;
-uniform vec4 max_y;
-uniform vec4 glow;
-uniform float scene_light_strength;
-uniform vec3 env_mat[3];
-uniform vec4 shadow_clip;
-uniform mat3 ssao_effect_mat;
-
-uniform sampler2DRect depthMap;
-uniform mat4 inv_proj;
-uniform vec2 screen_res;
-
-VARYING vec4 vary_light;
-VARYING vec2 vary_fragcoord;
-
-vec3 vary_PositionEye;
-
-vec3 vary_SunlitColor;
-vec3 vary_AmblitColor;
-vec3 vary_AdditiveColor;
-vec3 vary_AtmosAttenuation;
-uniform float gi_ambiance;
-
-vec4 getPosition_d(vec2 pos_screen, float depth)
-{
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
-vec4 getPosition(vec2 pos_screen)
-{ //get position in screen space (world units) given window coordinate and depth map
-	float depth = texture2DRect(depthMap, pos_screen.xy).a;
-	return getPosition_d(pos_screen, depth);
-}
-
-vec3 getPositionEye()
-{
-	return vary_PositionEye;
-}
-vec3 getSunlitColor()
-{
-	return vary_SunlitColor;
-}
-vec3 getAmblitColor()
-{
-	return vary_AmblitColor;
-}
-vec3 getAdditiveColor()
-{
-	return vary_AdditiveColor;
-}
-vec3 getAtmosAttenuation()
-{
-	return vary_AtmosAttenuation;
-}
-
-
-void setPositionEye(vec3 v)
-{
-	vary_PositionEye = v;
-}
-
-void setSunlitColor(vec3 v)
-{
-	vary_SunlitColor = v;
-}
-
-void setAmblitColor(vec3 v)
-{
-	vary_AmblitColor = v;
-}
-
-void setAdditiveColor(vec3 v)
-{
-	vary_AdditiveColor = v;
-}
-
-void setAtmosAttenuation(vec3 v)
-{
-	vary_AtmosAttenuation = v;
-}
-
-void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
-
-	vec3 P = inPositionEye;
-	setPositionEye(P);
-	
-	//(TERRAIN) limit altitude
-	if (P.y > max_y.x) P *= (max_y.x / P.y);
-	if (P.y < -max_y.x) P *= (-max_y.x / P.y);
-
-	vec3 tmpLightnorm = lightnorm.xyz;
-
-	vec3 Pn = normalize(P);
-	float Plen = length(P);
-
-	vec4 temp1 = vec4(0);
-	vec3 temp2 = vec3(0);
-	vec4 blue_weight;
-	vec4 haze_weight;
-	vec4 sunlight = sunlight_color;
-	vec4 light_atten;
-
-	//sunlight attenuation effect (hue and brightness) due to atmosphere
-	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
-		//I had thought blue_density and haze_density should have equal weighting,
-		//but attenuation due to haze_density tends to seem too strong
-
-	temp1 = blue_density + vec4(haze_density.r);
-	blue_weight = blue_density / temp1;
-	haze_weight = vec4(haze_density.r) / temp1;
-
-	//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
-	temp2.y = max(0.0, tmpLightnorm.y);
-	temp2.y = 1. / temp2.y;
-	sunlight *= exp( - light_atten * temp2.y);
-
-	// main atmospheric scattering line integral
-	temp2.z = Plen * density_multiplier.x;
-
-	// Transparency (-> temp1)
-	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
-	// compiler gets confused.
-	temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
-
-	//final atmosphere attenuation factor
-	setAtmosAttenuation(temp1.rgb);
-	
-	//compute haze glow
-	//(can use temp2.x as temp because we haven't used it yet)
-	temp2.x = dot(Pn, tmpLightnorm.xyz);
-	temp2.x = 1. - temp2.x;
-		//temp2.x is 0 at the sun and increases away from sun
-	temp2.x = max(temp2.x, .03);	//was glow.y
-		//set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
-	temp2.x *= glow.x;
-		//higher glow.x gives dimmer glow (because next step is 1 / "angle")
-	temp2.x = pow(temp2.x, glow.z);
-		//glow.z should be negative, so we're doing a sort of (1 / "angle") function
-
-	//add "minimum anti-solar illumination"
-	temp2.x += .25;
-	
-	//increase ambient when there are more clouds
-	vec4 tmpAmbient = ambient*gi_ambiance + (vec4(1.) - ambient*gi_ambiance) * cloud_shadow.x * 0.5;
-	
-	/*  decrease value and saturation (that in HSV, not HSL) for occluded areas
-	 * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
-	 * // The following line of code performs the equivalent of:
-	 * float ambAlpha = tmpAmbient.a;
-	 * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis
-	 * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue);
-	 * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha);
-	 */
-	tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
-
-	//haze color
-	setAdditiveColor(
-		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
-	  + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
-		  + tmpAmbient)));
-
-	//brightness of surface both sunlight and ambient
-	setSunlitColor(vec3(sunlight * .5));
-	setAmblitColor(vec3(tmpAmbient * .25));
-	setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1));
-}
-
-vec3 atmosLighting(vec3 light)
-{
-	light *= getAtmosAttenuation().r;
-	light += getAdditiveColor();
-	return (2.0 * light);
-}
-
-vec3 atmosTransport(vec3 light) {
-	light *= getAtmosAttenuation().r;
-	light += getAdditiveColor() * 2.0;
-	return light;
-}
-vec3 atmosGetDiffuseSunlightColor()
-{
-	return getSunlitColor();
-}
-
-vec3 scaleDownLight(vec3 light)
-{
-	return (light / scene_light_strength );
-}
-
-vec3 scaleUpLight(vec3 light)
-{
-	return (light * scene_light_strength);
-}
-
-vec3 atmosAmbient(vec3 light)
-{
-	return getAmblitColor() + light / 2.0;
-}
-
-vec3 atmosAffectDirectionalLight(float lightIntensity)
-{
-	return getSunlitColor() * lightIntensity;
-}
-
-vec3 scaleSoftClip(vec3 light)
-{
-	//soft clip effect:
-	light = 1. - clamp(light, vec3(0.), vec3(1.));
-	light = 1. - pow(light, gamma.xxx);
-
-	return light;
-}
-
-void main() 
-{
-	vec2 tc = vary_fragcoord.xy;
-	float depth = texture2DRect(depthMap, tc.xy).a;
-	vec3 pos = getPosition_d(tc, depth).xyz;
-	vec3 norm = texture2DRect(normalMap, tc).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
-	
-	float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
-	
-	vec4 diffuse = texture2DRect(diffuseRect, tc);
-	vec3 col;
-	float bloom = 0.0;
-
-	if (diffuse.a < 0.9)
-	{
-		vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
-	
-		da = texture2D(lightFunc, vec2(da, 0.0)).r;
-		
-		vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
-		float scol = max(scol_ambocc.r, diffuse.a); 
-		float ambocc = scol_ambocc.g;
-	
-		calcAtmospherics(pos.xyz, ambocc);
-	
-		col = atmosAmbient(vec3(0));
-		col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
-	
-		col *= diffuse.rgb;
-	
-		if (spec.a > 0.0) // specular reflection
-		{
-			// the old infinite-sky shiny reflection
-			//
-			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-			float sa = dot(refnormpersp, vary_light.xyz);
-			vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).r;
-		
-			// add the two types of shiny together
-			vec3 spec_contrib = dumbshiny * spec.rgb;
-			bloom = dot(spec_contrib, spec_contrib);
-			col += spec_contrib;		
-		}
-	
-		col = atmosLighting(col);
-		col = scaleSoftClip(col);
-
-		col = mix(col, diffuse.rgb, diffuse.a);
-	}
-	else
-	{
-		col = diffuse.rgb;
-	}
-		
-	gl_FragColor.rgb = col;
-	gl_FragColor.a = bloom;
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
deleted file mode 100644
index 682508aaf38..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
+++ /dev/null
@@ -1,44 +0,0 @@
-/** 
- * @file softenLightF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-
-uniform vec2 screen_res;
-
-VARYING vec4 vary_light;
-VARYING vec2 vary_fragcoord;
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 	
-	
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-		
-	vary_light = vec4(texcoord0,0,1);
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
deleted file mode 100644
index 4d4b5b190a0..00000000000
--- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl
+++ /dev/null
@@ -1,44 +0,0 @@
-/** 
- * @file treeF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef gl_FragData
-out vec4 gl_FragData[3];
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-uniform sampler2D diffuseMap;
-
-VARYING vec3 vary_normal;
-
-void main() 
-{
-	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
-	gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005);
-	gl_FragData[1] = vec4(0,0,0,0);
-	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
-}
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index fcb256fbfcc..c45e2ce270a 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -590,7 +590,7 @@ static void settings_modify()
 	gSavedSettings.setBOOL("VectorizeSkin", FALSE);
 
 	// disable fullscreen mode, unsupported
-	gSavedSettings.setBOOL("WindowFullScreen", FALSE);
+	//gSavedSettings.setBOOL("WindowFullScreen", FALSE);
 #endif
 }
 
@@ -2946,7 +2946,7 @@ bool LLAppViewer::initWindow()
 		VIEWER_WINDOW_CLASSNAME,
 		gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"),
 		gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"),
-		gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth);
+		gSavedSettings.getBOOL("FullScreen"), ignorePixelDepth);
 
 	LL_INFOS("AppInit") << "gViewerwindow created." << LL_ENDL;
 
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 6effa77ced9..1c89766b267 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -527,11 +527,12 @@ void LLGLTexMemBar::draw()
 	LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6,
 											 text_color, LLFontGL::LEFT, LLFontGL::TOP);
 
-	text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d",
+	text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d",
 					total_mem,
 					max_total_mem,
 					bound_mem,
 					max_bound_mem,
+					LLRenderTarget::sBytesAllocated/(1024*1024),
 					LLImageRaw::sGlobalRawMemory >> 20,	discard_bias,
 					cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded, total_http_requests);
 	//, cache_entries, cache_max_entries
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index d22e5f0af29..5b178f82d8f 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -622,7 +622,6 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleRenderDeferredChanged, _2));
 	gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
-	gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderPerformanceTest")->getSignal()->connect(boost::bind(&handleRenderPerfTestChanged, _2));
 	gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2));
 	gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2));
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 331eb8b8f4a..3e20abecb7d 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -706,9 +706,9 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
 
 		if (num_verts)
 		{
-			face->getGeometryAvatar(verticesp, normalsp, tex_coordsp, vertex_weightsp, clothing_weightsp);
 			face->getVertexBuffer()->getIndexStrider(indicesp);
-
+			face->getGeometryAvatar(verticesp, normalsp, tex_coordsp, vertex_weightsp, clothing_weightsp);
+			
 			verticesp += mMesh->mFaceVertexOffset;
 			normalsp += mMesh->mFaceVertexOffset;
 			
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 17d2a043015..764c247f012 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -152,7 +152,6 @@ LLGLSLShader			gPostNightVisionProgram;
 
 // Deferred rendering shaders
 LLGLSLShader			gDeferredImpostorProgram;
-LLGLSLShader			gDeferredEdgeProgram;
 LLGLSLShader			gDeferredWaterProgram;
 LLGLSLShader			gDeferredDiffuseProgram;
 LLGLSLShader			gDeferredDiffuseAlphaMaskProgram;
@@ -183,16 +182,12 @@ LLGLSLShader			gDeferredAlphaProgram;
 LLGLSLShader			gDeferredAvatarEyesProgram;
 LLGLSLShader			gDeferredFullbrightProgram;
 LLGLSLShader			gDeferredEmissiveProgram;
-LLGLSLShader			gDeferredGIProgram;
-LLGLSLShader			gDeferredGIFinalProgram;
-LLGLSLShader			gDeferredPostGIProgram;
 LLGLSLShader			gDeferredPostProgram;
 LLGLSLShader			gFXAAProgram;
 LLGLSLShader			gDeferredPostNoDoFProgram;
 LLGLSLShader			gDeferredWLSkyProgram;
 LLGLSLShader			gDeferredWLCloudProgram;
 LLGLSLShader			gDeferredStarProgram;
-LLGLSLShader			gLuminanceGatherProgram;
 
 LLViewerShaderMgr::LLViewerShaderMgr() :
 	mVertexShaderLevel(SHADER_COUNT, 0),
@@ -273,12 +268,8 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gDeferredFullbrightProgram);
 	mShaderList.push_back(&gDeferredEmissiveProgram);
 	mShaderList.push_back(&gDeferredAvatarEyesProgram);
-	mShaderList.push_back(&gDeferredPostGIProgram);
-	mShaderList.push_back(&gDeferredEdgeProgram);
 	mShaderList.push_back(&gDeferredPostProgram);
 	mShaderList.push_back(&gFXAAProgram);
-	mShaderList.push_back(&gDeferredGIProgram);
-	mShaderList.push_back(&gDeferredGIFinalProgram);
 	mShaderList.push_back(&gDeferredWaterProgram);
 	mShaderList.push_back(&gDeferredAvatarAlphaProgram);
 	mShaderList.push_back(&gDeferredWLSkyProgram);
@@ -368,24 +359,8 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void)
 		mReservedUniforms.push_back("noiseMap");
 		mReservedUniforms.push_back("lightFunc");
 		mReservedUniforms.push_back("lightMap");
-		mReservedUniforms.push_back("luminanceMap");
-		mReservedUniforms.push_back("giLightMap");
-		mReservedUniforms.push_back("giMip");
-		mReservedUniforms.push_back("edgeMap");
 		mReservedUniforms.push_back("bloomMap");
-		mReservedUniforms.push_back("sunLightMap");
-		mReservedUniforms.push_back("localLightMap");
 		mReservedUniforms.push_back("projectionMap");
-		mReservedUniforms.push_back("diffuseGIMap");
-		mReservedUniforms.push_back("specularGIMap");
-		mReservedUniforms.push_back("normalGIMap");
-		mReservedUniforms.push_back("minpGIMap");
-		mReservedUniforms.push_back("maxpGIMap");
-		mReservedUniforms.push_back("depthGIMap");
-		mReservedUniforms.push_back("lastDiffuseGIMap");
-		mReservedUniforms.push_back("lastNormalGIMap");
-		mReservedUniforms.push_back("lastMinpGIMap");
-		mReservedUniforms.push_back("lastMaxpGIMap");
 
 		mWLUniforms.push_back("camPosLocal");
 
@@ -531,15 +506,8 @@ void LLViewerShaderMgr::setShaders()
 			gSavedSettings.getBOOL("WindLightUseAtmosShaders"))
 		{
 			if (gSavedSettings.getS32("RenderShadowDetail") > 0)
-			{
-				if (gSavedSettings.getBOOL("RenderDeferredGI"))
-				{ //shadows + gi
-					deferred_class = 3;
-				}
-				else
-				{ //shadows
-					deferred_class = 2;
-				}
+			{ //shadows
+				deferred_class = 2;
 			}
 			else
 			{ //no shadows
@@ -1108,13 +1076,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredFullbrightProgram.unload();
 		gDeferredEmissiveProgram.unload();
 		gDeferredAvatarEyesProgram.unload();
-		gDeferredPostGIProgram.unload();		
-		gDeferredEdgeProgram.unload();		
 		gDeferredPostProgram.unload();		
 		gFXAAProgram.unload();
-		gLuminanceGatherProgram.unload();
-		gDeferredGIProgram.unload();
-		gDeferredGIFinalProgram.unload();
 		gDeferredWaterProgram.unload();
 		gDeferredWLSkyProgram.unload();
 		gDeferredWLCloudProgram.unload();
@@ -1569,62 +1532,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		success = gDeferredStarProgram.createShader(NULL, &mWLUniforms);
 	}
 
-	if (mVertexShaderLevel[SHADER_DEFERRED] > 1)
-	{
-		if (success)
-		{
-			gDeferredEdgeProgram.mName = "Deferred Edge Shader";
-			gDeferredEdgeProgram.mShaderFiles.clear();
-			gDeferredEdgeProgram.mShaderFiles.push_back(make_pair("deferred/edgeV.glsl", GL_VERTEX_SHADER_ARB));
-			gDeferredEdgeProgram.mShaderFiles.push_back(make_pair("deferred/edgeF.glsl", GL_FRAGMENT_SHADER_ARB));
-			gDeferredEdgeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-			success = gDeferredEdgeProgram.createShader(NULL, NULL);
-		}
-	}
-
-	if (mVertexShaderLevel[SHADER_DEFERRED] > 2)
-	{
-		if (success)
-		{
-			gDeferredPostGIProgram.mName = "Deferred Post GI Shader";
-			gDeferredPostGIProgram.mShaderFiles.clear();
-			gDeferredPostGIProgram.mShaderFiles.push_back(make_pair("deferred/postgiV.glsl", GL_VERTEX_SHADER_ARB));
-			gDeferredPostGIProgram.mShaderFiles.push_back(make_pair("deferred/postgiF.glsl", GL_FRAGMENT_SHADER_ARB));
-			gDeferredPostGIProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-			success = gDeferredPostGIProgram.createShader(NULL, NULL);
-		}
-
-		if (success)
-		{
-			gDeferredGIProgram.mName = "Deferred GI Shader";
-			gDeferredGIProgram.mShaderFiles.clear();
-			gDeferredGIProgram.mShaderFiles.push_back(make_pair("deferred/giV.glsl", GL_VERTEX_SHADER_ARB));
-			gDeferredGIProgram.mShaderFiles.push_back(make_pair("deferred/giF.glsl", GL_FRAGMENT_SHADER_ARB));
-			gDeferredGIProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-			success = gDeferredGIProgram.createShader(NULL, NULL);
-		}
-
-		if (success)
-		{
-			gDeferredGIFinalProgram.mName = "Deferred GI Final Shader";
-			gDeferredGIFinalProgram.mShaderFiles.clear();
-			gDeferredGIFinalProgram.mShaderFiles.push_back(make_pair("deferred/giFinalV.glsl", GL_VERTEX_SHADER_ARB));
-			gDeferredGIFinalProgram.mShaderFiles.push_back(make_pair("deferred/giFinalF.glsl", GL_FRAGMENT_SHADER_ARB));
-			gDeferredGIFinalProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-			success = gDeferredGIFinalProgram.createShader(NULL, NULL);
-		}
-
-		if (success)
-		{
-			gLuminanceGatherProgram.mName = "Luminance Gather Shader";
-			gLuminanceGatherProgram.mShaderFiles.clear();
-			gLuminanceGatherProgram.mShaderFiles.push_back(make_pair("deferred/luminanceV.glsl", GL_VERTEX_SHADER_ARB));
-			gLuminanceGatherProgram.mShaderFiles.push_back(make_pair("deferred/luminanceF.glsl", GL_FRAGMENT_SHADER_ARB));
-			gLuminanceGatherProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
-			success = gLuminanceGatherProgram.createShader(NULL, NULL);
-		}
-	}
-
 	return success;
 }
 
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index aeb8553fa18..74708c94a7c 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -111,24 +111,8 @@ class LLViewerShaderMgr: public LLShaderMgr
 		DEFERRED_NOISE,
 		DEFERRED_LIGHTFUNC,
 		DEFERRED_LIGHT,
-		DEFERRED_LUMINANCE,
-		DEFERRED_GI_LIGHT,
-		DEFERRED_GI_MIP,
-		DEFERRED_EDGE,
 		DEFERRED_BLOOM,
-		DEFERRED_SUN_LIGHT,
-		DEFERRED_LOCAL_LIGHT,
 		DEFERRED_PROJECTION,
-		DEFERRED_GI_DIFFUSE,
-		DEFERRED_GI_SPECULAR,
-		DEFERRED_GI_NORMAL,
-		DEFERRED_GI_MIN_POS,
-		DEFERRED_GI_MAX_POS,
-		DEFERRED_GI_DEPTH,
-		DEFERRED_GI_LAST_DIFFUSE,
-		DEFERRED_GI_LAST_NORMAL,
-		DEFERRED_GI_LAST_MIN_POS,
-		DEFERRED_GI_LAST_MAX_POS,
 		END_RESERVED_UNIFORMS
 	} eGLSLReservedUniforms;
 
@@ -364,7 +348,6 @@ extern LLGLSLShader			gPostNightVisionProgram;
 
 // Deferred rendering shaders
 extern LLGLSLShader			gDeferredImpostorProgram;
-extern LLGLSLShader			gDeferredEdgeProgram;
 extern LLGLSLShader			gDeferredWaterProgram;
 extern LLGLSLShader			gDeferredDiffuseProgram;
 extern LLGLSLShader			gDeferredDiffuseAlphaMaskProgram;
@@ -383,14 +366,11 @@ extern LLGLSLShader			gDeferredMultiLightProgram;
 extern LLGLSLShader			gDeferredSpotLightProgram;
 extern LLGLSLShader			gDeferredMultiSpotLightProgram;
 extern LLGLSLShader			gDeferredSunProgram;
-extern LLGLSLShader			gDeferredGIProgram;
-extern LLGLSLShader			gDeferredGIFinalProgram;
 extern LLGLSLShader			gDeferredBlurLightProgram;
 extern LLGLSLShader			gDeferredAvatarProgram;
 extern LLGLSLShader			gDeferredSoftenProgram;
 extern LLGLSLShader			gDeferredShadowProgram;
 extern LLGLSLShader			gDeferredShadowAlphaMaskProgram;
-extern LLGLSLShader			gDeferredPostGIProgram;
 extern LLGLSLShader			gDeferredPostProgram;
 extern LLGLSLShader			gFXAAProgram;
 extern LLGLSLShader			gDeferredPostNoDoFProgram;
@@ -404,7 +384,6 @@ extern LLGLSLShader			gDeferredAvatarAlphaProgram;
 extern LLGLSLShader			gDeferredWLSkyProgram;
 extern LLGLSLShader			gDeferredWLCloudProgram;
 extern LLGLSLShader			gDeferredStarProgram;
-extern LLGLSLShader			gLuminanceGatherProgram;
 
 
 #endif
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5f010624a89..e672f7c4f19 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -661,8 +661,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 	{
 		S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
 		BOOL ssao = gSavedSettings.getBOOL("RenderDeferredSSAO");
-		bool gi = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED);
-
+		
 		//allocate deferred rendering color buffers
 		if (!mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
 		if (!mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
@@ -678,68 +677,22 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 			mFXAABuffer.release();
 		}
 		
-#if LL_DARWIN
-		// As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
-		if (!mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
-#else
-		if (!mEdgeMap.allocate(resX, resY, LLRender::sGLCoreProfile ? GL_RGBA : GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
-#endif
-
 		if (shadow_detail > 0 || ssao)
-		{ //only need mDeferredLight[0] for shadows OR ssao
-			if (!mDeferredLight[0].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
+		{ //only need mDeferredLight for shadows OR ssao
+			if (!mDeferredLight.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
 		}
 		else
 		{
-			mDeferredLight[0].release();
-		}
-
-		if (ssao)
-		{ //only need mDeferredLight[1] for ssao
-			if (!mDeferredLight[1].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false)) return false;
-		}
-		else
-		{
-			mDeferredLight[1].release();
-		}
-
-		if (gi)
-		{ //only need mDeferredLight[2] and mGIMapPost for gi
-			if (!mDeferredLight[2].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false)) return false;
-			for (U32 i = 0; i < 2; i++)
-			{
-#if LL_DARWIN
-				// As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
-				if (!mGIMapPost[i].allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false;
-#else
-				if (!mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false;
-#endif
-			}
-		}
-		else
-		{
-			mDeferredLight[2].release();
-		
-			for (U32 i = 0; i < 2; i++)
-			{
-				mGIMapPost[i].release();
-			}
+			mDeferredLight.release();
 		}
 
 		F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale");
 
-#if LL_DARWIN
-		U32 shadow_fmt = 0;
-#else
-		//HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug)
-		U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0;
-#endif
-
 		if (shadow_detail > 0)
 		{ //allocate 4 sun shadow maps
 			for (U32 i = 0; i < 4; i++)
 			{
-				if (!mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false;
+				if (!mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false;
 			}
 		}
 		else
@@ -757,7 +710,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		{ //allocate two spot shadow maps
 			for (U32 i = 4; i < 6; i++)
 			{
-				if (!mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE)) return false;
+				if (!mShadow[i].allocate(width, height, 0, TRUE, FALSE)) return false;
 			}
 		}
 		else
@@ -767,21 +720,11 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 				mShadow[i].release();
 			}
 		}
-
-		width = nhpo2(resX)/2;
-		height = nhpo2(resY)/2;
-		if (!mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE)) return false;
 	}
 	else
 	{
-		for (U32 i = 0; i < 3; i++)
-		{ 
-			mDeferredLight[i].release();
-		}
-		for (U32 i = 0; i < 2; i++)
-		{
-			mGIMapPost[i].release();
-		}
+		mDeferredLight.release();
+				
 		for (U32 i = 0; i < 6; i++)
 		{
 			mShadow[i].release();
@@ -790,9 +733,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		mScreen.release();
 		mDeferredScreen.release(); //make sure to release any render targets that share a depth buffer with mDeferredScreen first
 		mDeferredDepth.release();
-		mEdgeMap.release();
-		mLuminanceMap.release();
-		
+						
 		if (!mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;		
 	}
 	
@@ -876,18 +817,10 @@ void LLPipeline::releaseScreenBuffers()
 	mPhysicsDisplay.release();
 	mDeferredScreen.release();
 	mDeferredDepth.release();
-	for (U32 i = 0; i < 3; i++)
-	{
-		mDeferredLight[i].release();
-	}
-
-	mEdgeMap.release();
-	mGIMap.release();
-	mGIMapPost[0].release();
-	mGIMapPost[1].release();
-	mHighlight.release();
-	mLuminanceMap.release();
+	mDeferredLight.release();
 	
+	mHighlight.release();
+		
 	for (U32 i = 0; i < 6; i++)
 	{
 		mShadow[i].release();
@@ -1008,12 +941,6 @@ void LLPipeline::createGLBuffers()
 
 			delete [] lg;
 		}
-
-		if (gSavedSettings.getBOOL("RenderDeferredGI"))
-		{
-			mGIMap.allocate(512,512,GL_RGBA, TRUE, FALSE);
-			addDeferredAttachments(mGIMap);
-		}
 	}
 
 	gBumpImageList.restoreGL();
@@ -6689,7 +6616,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred");
 
-void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRenderTarget* gi_source, LLRenderTarget* last_gi_post, U32 noise_map)
+void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 noise_map)
 {
 	LLFastTimer t(FTM_BIND_DEFERRED);
 
@@ -6721,124 +6648,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	if (gi_source)
-	{
-		BOOL has_gi = FALSE;
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_DIFFUSE);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			gi_source->bindTexture(0, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_SPECULAR);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			gi_source->bindTexture(1, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_NORMAL);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			gi_source->bindTexture(2, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_MIN_POS);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			gi_source->bindTexture(1, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_MAX_POS);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			gi_source->bindTexture(3, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_DIFFUSE);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			last_gi_post->bindTexture(0, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_NORMAL);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			last_gi_post->bindTexture(2, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MAX_POS);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			last_gi_post->bindTexture(1, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MIN_POS);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			last_gi_post->bindTexture(3, channel);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-		}
-		
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_DEPTH);
-		if (channel > -1)
-		{
-			has_gi = TRUE;
-			gGL.getTexUnit(channel)->bind(gi_source, TRUE);
-			gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-			stop_glerror();
-			
-			glTexParameteri(LLTexUnit::getInternalType(mGIMap.getUsage()), GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);		
-			glTexParameteri(LLTexUnit::getInternalType(mGIMap.getUsage()), GL_DEPTH_TEXTURE_MODE_ARB, GL_ALPHA);		
-
-			stop_glerror();
-		}
-
-		if (has_gi)
-		{
-			F32 range_x = llmin(mGIRange.mV[0], 1.f);
-			F32 range_y = llmin(mGIRange.mV[1], 1.f);
-
-			LLVector2 scale(range_x,range_y);
-
-			LLVector2 kern[25];
-
-			for (S32 i = 0; i < 5; ++i)
-			{
-				for (S32 j = 0; j < 5; ++j)
-				{
-					S32 idx = i*5+j;
-					kern[idx].mV[0] = (i-2)*0.5f;
-					kern[idx].mV[1] = (j-2)*0.5f;
-					kern[idx].scaleVec(scale);
-				}
-			}
-
-			shader.uniform2fv("gi_kern", 25, (F32*) kern);
-			shader.uniformMatrix4fv("gi_mat", 1, FALSE, mGIMatrix.m);
-			shader.uniformMatrix4fv("gi_mat_proj", 1, FALSE, mGIMatrixProj.m);
-			shader.uniformMatrix4fv("gi_inv_proj", 1, FALSE, mGIInvProj.m);
-			shader.uniformMatrix4fv("gi_norm_mat", 1, FALSE, mGINormalMatrix.m);
-		}
-	}
-	stop_glerror();
-
 	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, mDeferredDepth.getUsage());
 	if (channel > -1)
 	{
@@ -6875,55 +6684,26 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen
 
 	stop_glerror();
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight[light_index].getUsage());
+	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage());
 	if (channel > -1)
 	{
-		mDeferredLight[light_index].bindTexture(0, channel);
+		if (light_index > 0)
+		{
+			mScreen.bindTexture(0, channel);
+		}
+		else
+		{
+			mDeferredLight.bindTexture(0, channel);
+		}
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LUMINANCE);
-	if (channel > -1)
-	{
-		gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, mLuminanceMap.getTexture(), true);
-		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR);
-	}
-
 	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_BLOOM);
 	if (channel > -1)
 	{
 		mGlow[1].bindTexture(0, channel);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LIGHT, LLTexUnit::TT_RECT_TEXTURE);
-	if (channel > -1)
-	{
-		gi_source->bindTexture(0, channel);
-		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-	}
-
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_EDGE, LLTexUnit::TT_RECT_TEXTURE);
-	if (channel > -1)
-	{
-		mEdgeMap.bindTexture(0, channel);
-		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-	}
-
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SUN_LIGHT, LLTexUnit::TT_RECT_TEXTURE);
-	if (channel > -1)
-	{
-		mDeferredLight[1].bindTexture(0, channel);
-		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-	}
-
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LOCAL_LIGHT, LLTexUnit::TT_RECT_TEXTURE);
-	if (channel > -1)
-	{
-		mDeferredLight[2].bindTexture(0, channel);
-		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-	}
-
-
 	stop_glerror();
 
 	for (U32 i = 0; i < 4; i++)
@@ -7032,20 +6812,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen
 	shader.uniform1f ("spot_shadow_offset", gSavedSettings.getF32("RenderSpotShadowOffset"));
 	shader.uniform1f("spot_shadow_bias", gSavedSettings.getF32("RenderSpotShadowBias"));	
 
-	shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale"));
-	shader.uniform1f("sun_lum_scale", gSavedSettings.getF32("RenderSunLuminanceScale"));
-	shader.uniform1f("sun_lum_offset", gSavedSettings.getF32("RenderSunLuminanceOffset"));
 	shader.uniform3fv("sun_dir", 1, mTransformedSunDir.mV);
-	shader.uniform1f("lum_lod", gSavedSettings.getF32("RenderLuminanceDetail"));
-	shader.uniform1f("gi_range", gSavedSettings.getF32("RenderGIRange"));
-	shader.uniform1f("gi_brightness", gSavedSettings.getF32("RenderGIBrightness"));
-	shader.uniform1f("gi_luminance", gSavedSettings.getF32("RenderGILuminance"));
-	shader.uniform1f("gi_edge_weight", gSavedSettings.getF32("RenderGIBlurEdgeWeight"));
-	shader.uniform1f("gi_blur_brightness", gSavedSettings.getF32("RenderGIBlurBrightness"));
-	shader.uniform1f("gi_sample_width", mGILightRadius);
-	shader.uniform1f("gi_noise", gSavedSettings.getF32("RenderGINoise"));
-	shader.uniform1f("gi_attenuation", gSavedSettings.getF32("RenderGIAttenuation"));
-	shader.uniform1f("gi_ambiance", gSavedSettings.getF32("RenderGIAmbiance"));
 	shader.uniform2f("shadow_res", mShadow[0].getWidth(), mShadow[0].getHeight());
 	shader.uniform2f("proj_shadow_res", mShadow[4].getWidth(), mShadow[4].getHeight());
 	shader.uniform1f("depth_cutoff", gSavedSettings.getF32("RenderEdgeDepthCutoff"));
@@ -7137,13 +6904,13 @@ void LLPipeline::renderDeferredLighting()
 
 		if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0)
 		{
-			mDeferredLight[0].bindTarget();
+			mDeferredLight.bindTarget();
 			{ //paint shadow/SSAO light map (direct lighting lightmap)
 				LLFastTimer ftm(FTM_SUN_SHADOW);
 				bindDeferredShader(gDeferredSunProgram, 0);
 				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 				glClearColor(1,1,1,1);
-				mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT);
+				mDeferredLight.clear(GL_COLOR_BUFFER_BIT);
 				glClearColor(0,0,0,0);
 
 				glh::matrix4f inv_trans = glh_get_current_modelview().inverse().transpose();
@@ -7166,7 +6933,7 @@ void LLPipeline::renderDeferredLighting()
 				}
 
 				gDeferredSunProgram.uniform3fv("offset", slice, offset);
-				gDeferredSunProgram.uniform2f("screenRes", mDeferredLight[0].getWidth(), mDeferredLight[0].getHeight());
+				gDeferredSunProgram.uniform2f("screenRes", mDeferredLight.getWidth(), mDeferredLight.getHeight());
 				
 				{
 					LLGLDisable blend(GL_BLEND);
@@ -7178,125 +6945,16 @@ void LLPipeline::renderDeferredLighting()
 				
 				unbindDeferredShader(gDeferredSunProgram);
 			}
-			mDeferredLight[0].flush();
+			mDeferredLight.flush();
 		}
 		
-		{ //global illumination specific block (still experimental)
-			if (gSavedSettings.getBOOL("RenderDeferredBlurLight") &&
-			    gSavedSettings.getBOOL("RenderDeferredGI"))
-			{
-				LLFastTimer ftm(FTM_EDGE_DETECTION);
-				//generate edge map
-				LLGLDisable blend(GL_BLEND);
-				LLGLDisable test(GL_ALPHA_TEST);
-				LLGLDepthTest depth(GL_FALSE);
-				LLGLDisable stencil(GL_STENCIL_TEST);
-
-				{
-					gDeferredEdgeProgram.bind();
-					mEdgeMap.bindTarget();
-					bindDeferredShader(gDeferredEdgeProgram);
-					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
-					unbindDeferredShader(gDeferredEdgeProgram);
-					mEdgeMap.flush();
-				}
-			}
-
-			if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
-			{
-				{ //get luminance map from previous frame's light map
-					LLGLEnable blend(GL_BLEND);
-					LLGLDisable test(GL_ALPHA_TEST);
-					LLGLDepthTest depth(GL_FALSE);
-					LLGLDisable stencil(GL_STENCIL_TEST);
-
-					//static F32 fade = 1.f;
-
-					{
-						gGL.setSceneBlendType(LLRender::BT_ALPHA);
-						gLuminanceGatherProgram.bind();
-						gLuminanceGatherProgram.uniform2f("screen_res", mDeferredLight[0].getWidth(), mDeferredLight[0].getHeight());
-						mLuminanceMap.bindTarget();
-						bindDeferredShader(gLuminanceGatherProgram);
-						mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
-						unbindDeferredShader(gLuminanceGatherProgram);
-						mLuminanceMap.flush();
-						gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLuminanceMap.getTexture(), true);
-						gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR);
-						glGenerateMipmap(GL_TEXTURE_2D);
-					}
-				}
-
-				{ //paint noisy GI map (bounce lighting lightmap)
-					LLFastTimer ftm(FTM_GI_TRACE);
-					LLGLDisable blend(GL_BLEND);
-					LLGLDepthTest depth(GL_FALSE);
-					LLGLDisable test(GL_ALPHA_TEST);
-
-					mGIMapPost[0].bindTarget();
-
-					bindDeferredShader(gDeferredGIProgram, 0, &mGIMap, 0, mTrueNoiseMap);
-					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
-					unbindDeferredShader(gDeferredGIProgram);
-					mGIMapPost[0].flush();
-				}
-
-				U32 pass_count = 0;
-				if (gSavedSettings.getBOOL("RenderDeferredBlurLight"))
-				{
-					pass_count = llclamp(gSavedSettings.getU32("RenderGIBlurPasses"), (U32) 1, (U32) 128);
-				}
-
-				for (U32 i = 0; i < pass_count; ++i)
-				{ //gather/soften indirect lighting map
-					LLFastTimer ftm(FTM_GI_GATHER);
-					bindDeferredShader(gDeferredPostGIProgram, 0, &mGIMapPost[0], NULL, mTrueNoiseMap);
-					F32 blur_size = gSavedSettings.getF32("RenderGIBlurSize")/((F32) i * gSavedSettings.getF32("RenderGIBlurIncrement")+1.f);
-					gDeferredPostGIProgram.uniform2f("delta", 1.f, 0.f);
-					gDeferredPostGIProgram.uniform1f("kern_scale", blur_size);
-					gDeferredPostGIProgram.uniform1f("gi_blur_brightness", gSavedSettings.getF32("RenderGIBlurBrightness"));
-				
-					mGIMapPost[1].bindTarget();
-					{
-						LLGLDisable blend(GL_BLEND);
-						LLGLDepthTest depth(GL_FALSE);
-						stop_glerror();
-						mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
-						stop_glerror();
-					}
-					
-					mGIMapPost[1].flush();
-					unbindDeferredShader(gDeferredPostGIProgram);
-					bindDeferredShader(gDeferredPostGIProgram, 0, &mGIMapPost[1], NULL, mTrueNoiseMap);
-					mGIMapPost[0].bindTarget();
-
-					gDeferredPostGIProgram.uniform2f("delta", 0.f, 1.f);
-
-					{
-						LLGLDisable blend(GL_BLEND);
-						LLGLDepthTest depth(GL_FALSE);
-						stop_glerror();
-						mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
-						stop_glerror();
-					}
-					mGIMapPost[0].flush();
-					unbindDeferredShader(gDeferredPostGIProgram);
-				}
-			}
-		}
-
 		if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
 		{ //soften direct lighting lightmap
 			LLFastTimer ftm(FTM_SOFTEN_SHADOW);
 			//blur lightmap
-			mDeferredLight[1].bindTarget();
+			mScreen.bindTarget();
 			glClearColor(1,1,1,1);
-			mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT);
+			mScreen.clear(GL_COLOR_BUFFER_BIT);
 			glClearColor(0,0,0,0);
 			
 			bindDeferredShader(gDeferredBlurLightProgram);
@@ -7332,12 +6990,12 @@ void LLPipeline::renderDeferredLighting()
 				stop_glerror();
 			}
 			
-			mDeferredLight[1].flush();
+			mScreen.flush();
 			unbindDeferredShader(gDeferredBlurLightProgram);
 
 			bindDeferredShader(gDeferredBlurLightProgram, 1);
 			mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-			mDeferredLight[0].bindTarget();
+			mDeferredLight.bindTarget();
 
 			gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f);
 
@@ -7348,7 +7006,7 @@ void LLPipeline::renderDeferredLighting()
 				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 				stop_glerror();
 			}
-			mDeferredLight[0].flush();
+			mDeferredLight.flush();
 			unbindDeferredShader(gDeferredBlurLightProgram);
 		}
 
@@ -7364,25 +7022,15 @@ void LLPipeline::renderDeferredLighting()
 		//mScreen.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(),
 		//					0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST);
 
-		if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
-		{
-			mDeferredLight[1].bindTarget();
-			// clear color buffer here (GI) - zeroing alpha (glow) is important or it will accumulate against sky
-			glClearColor(0,0,0,0);
-			mScreen.clear(GL_COLOR_BUFFER_BIT);
-		}
-		else
-		{
-			mScreen.bindTarget();
-			// clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky
-			glClearColor(0,0,0,0);
-			mScreen.clear(GL_COLOR_BUFFER_BIT);
-		}
-
+		mScreen.bindTarget();
+		// clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky
+		glClearColor(0,0,0,0);
+		mScreen.clear(GL_COLOR_BUFFER_BIT);
+		
 		if (gSavedSettings.getBOOL("RenderDeferredAtmospheric"))
 		{ //apply sunlight contribution 
 			LLFastTimer ftm(FTM_ATMOSPHERICS);
-			bindDeferredShader(gDeferredSoftenProgram, 0, &mGIMapPost[0]);	
+			bindDeferredShader(gDeferredSoftenProgram);	
 			{
 				LLGLDepthTest depth(GL_FALSE);
 				LLGLDisable blend(GL_BLEND);
@@ -7426,13 +7074,6 @@ void LLPipeline::renderDeferredLighting()
 
 		BOOL render_local = gSavedSettings.getBOOL("RenderLocalLights");
 				
-		if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
-		{
-			mDeferredLight[1].flush();
-			mDeferredLight[2].bindTarget();
-			mDeferredLight[2].clear(GL_COLOR_BUFFER_BIT);
-		}
-
 		if (render_local)
 		{
 			gGL.setSceneBlendType(LLRender::BT_ADD);
@@ -7723,47 +7364,6 @@ void LLPipeline::renderDeferredLighting()
 		}
 
 		gGL.setColorMask(true, true);
-
-		if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2)
-		{
-			mDeferredLight[2].flush();
-
-			mScreen.bindTarget();
-			mScreen.clear(GL_COLOR_BUFFER_BIT);
-		
-			gGL.setSceneBlendType(LLRender::BT_ALPHA);
-
-			{ //mix various light maps (local, sun, gi)
-				LLFastTimer ftm(FTM_POST);
-				LLGLDisable blend(GL_BLEND);
-				LLGLDisable test(GL_ALPHA_TEST);
-				LLGLDepthTest depth(GL_FALSE);
-				LLGLDisable stencil(GL_STENCIL_TEST);
-			
-				bindDeferredShader(gDeferredPostProgram, 0, &mGIMapPost[0]);
-
-				gDeferredPostProgram.bind();
-				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-				LLVertexBuffer::unbind();
-
-//				glVertexPointer(2, GL_FLOAT, 0, vert);
-				gGL.diffuseColor3f(1,1,1);
-
-				gGL.pushMatrix();
-				gGL.loadIdentity();
-				gGL.matrixMode(LLRender::MM_PROJECTION);
-				gGL.pushMatrix();
-				gGL.loadIdentity();
-
-				mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
-				
-				gGL.popMatrix();
-				gGL.matrixMode(LLRender::MM_MODELVIEW);
-				gGL.popMatrix();
-
-				unbindDeferredShader(gDeferredPostProgram);
-			}
-		}
 	}
 
 	{ //render non-deferred geometry (alpha, fullbright, glow)
@@ -7963,25 +7563,9 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader)
 	shader.disableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage());
 	shader.disableTexture(LLViewerShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage());
 	shader.disableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, mDeferredScreen.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight[0].getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LIGHT, LLTexUnit::TT_RECT_TEXTURE);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_EDGE, mEdgeMap.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_SUN_LIGHT, mDeferredLight[1].getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_LOCAL_LIGHT, mDeferredLight[2].getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_LUMINANCE);
+	shader.disableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage());
 	shader.disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_MIP);
 	shader.disableTexture(LLViewerShaderMgr::DEFERRED_BLOOM);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_NORMAL);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_DIFFUSE);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_SPECULAR);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_DEPTH);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_MIN_POS);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_MAX_POS);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_NORMAL);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_DIFFUSE);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MIN_POS);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MAX_POS);
 
 	for (U32 i = 0; i < 4; i++)
 	{
@@ -8631,184 +8215,6 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector
 	return TRUE;
 }
 
-void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<LLVector3>& vpc)
-{
-	if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) < 3)
-	{
-		return;
-	}
-
-	LLVector3 up;
-
-	//LLGLEnable depth_clamp(GL_DEPTH_CLAMP_NV);
-
-	if (lightDir.mV[2] > 0.5f)
-	{
-		up = LLVector3(1,0,0);
-	}
-	else
-	{
-		up = LLVector3(0, 0, 1);
-	}
-
-	
-	F32 gi_range = gSavedSettings.getF32("RenderGIRange");
-
-	U32 res = mGIMap.getWidth();
-
-	F32 atten = llmax(gSavedSettings.getF32("RenderGIAttenuation"), 0.001f);
-
-	//set radius to range at which distance attenuation of incoming photons is near 0
-
-	F32 lrad = sqrtf(1.f/(atten*0.01f));
-
-	F32 lrange = lrad+gi_range*0.5f;
-
-	LLVector3 pad(lrange,lrange,lrange);
-
-	glh::matrix4f view = look(LLVector3(128.f,128.f,128.f), lightDir, up);
-
-	LLVector3 cp = camera.getOrigin()+camera.getAtAxis()*(gi_range*0.5f);
-
-	glh::vec3f scp(cp.mV);
-	view.mult_matrix_vec(scp);
-	cp.setVec(scp.v);
-
-	F32 pix_width = lrange/(res*0.5f);
-
-	//move cp to the nearest pix_width
-	for (U32 i = 0; i < 3; i++)
-	{
-		cp.mV[i] = llround(cp.mV[i], pix_width);
-	}
-	
-	LLVector3 min = cp-pad;
-	LLVector3 max = cp+pad;
-	
-	//set mGIRange to range in tc space[0,1] that covers texture block of intersecting lights around a point
-	mGIRange.mV[0] = (max.mV[0]-min.mV[0])/res;
-	mGIRange.mV[1] = (max.mV[1]-min.mV[1])/res;
-	mGILightRadius = lrad/lrange*0.5f;
-
-	glh::matrix4f proj = gl_ortho(min.mV[0], max.mV[0],
-								min.mV[1], max.mV[1],
-								-max.mV[2], -min.mV[2]);
-
-	LLCamera sun_cam = camera;
-
-	glh::matrix4f eye_view = glh_get_current_modelview();
-	
-	//get eye space to camera space matrix
-	mGIMatrix = view*eye_view.inverse();
-	mGINormalMatrix = mGIMatrix.inverse().transpose();
-	mGIInvProj = proj.inverse();
-	mGIMatrixProj = proj*mGIMatrix;
-
-	//translate and scale to [0,1]
-	glh::matrix4f trans(.5f, 0.f, 0.f, .5f,
-						0.f, 0.5f, 0.f, 0.5f,
-						0.f, 0.f, 0.5f, 0.5f,
-						0.f, 0.f, 0.f, 1.f);
-
-	mGIMatrixProj = trans*mGIMatrixProj;
-
-	glh_set_current_modelview(view);
-	glh_set_current_projection(proj);
-
-	LLViewerCamera::updateFrustumPlanes(sun_cam, TRUE, FALSE, TRUE);
-
-	sun_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR);
-	static LLCullResult result;
-
-	pushRenderTypeMask();
-
-	andRenderTypeMask(LLPipeline::RENDER_TYPE_SIMPLE,
-								 LLPipeline::RENDER_TYPE_FULLBRIGHT,
-								 LLPipeline::RENDER_TYPE_BUMP,
-								 LLPipeline::RENDER_TYPE_VOLUME,
-								 LLPipeline::RENDER_TYPE_TREE, 
-								 LLPipeline::RENDER_TYPE_TERRAIN,
-								 LLPipeline::RENDER_TYPE_WATER,
-								 LLPipeline::RENDER_TYPE_VOIDWATER,
-								 LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW,
-								 LLPipeline::RENDER_TYPE_AVATAR,
-								 LLPipeline::RENDER_TYPE_PASS_SIMPLE,
-								 LLPipeline::RENDER_TYPE_PASS_BUMP,
-								 LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT,
-								 LLPipeline::RENDER_TYPE_PASS_SHINY,
-								 END_RENDER_TYPES);
-
-
-	
-	S32 occlude = LLPipeline::sUseOcclusion;
-	//LLPipeline::sUseOcclusion = 0;
-	LLPipeline::sShadowRender = TRUE;
-	
-	//only render large objects into GI map
-	sMinRenderSize = gSavedSettings.getF32("RenderGIMinRenderSize");
-	
-	LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_GI_SOURCE;
-	mGIMap.bindTarget();
-	
-	F64 last_modelview[16];
-	F64 last_projection[16];
-	for (U32 i = 0; i < 16; i++)
-	{
-		last_modelview[i] = gGLLastModelView[i];
-		last_projection[i] = gGLLastProjection[i];
-		gGLLastModelView[i] = mGIModelview.m[i];
-		gGLLastProjection[i] = mGIProjection.m[i];
-	}
-
-	sun_cam.setOrigin(0.f, 0.f, 0.f);
-	updateCull(sun_cam, result);
-	stateSort(sun_cam, result);
-	
-	for (U32 i = 0; i < 16; i++)
-	{
-		gGLLastModelView[i] = last_modelview[i];
-		gGLLastProjection[i] = last_projection[i];
-	}
-
-	mGIProjection = proj;
-	mGIModelview = view;
-
-	LLGLEnable cull(GL_CULL_FACE);
-
-	//generate GI map
-	gGL.matrixMode(LLRender::MM_PROJECTION);
-	gGL.pushMatrix();
-	gGL.loadMatrix(proj.m);
-	gGL.matrixMode(LLRender::MM_MODELVIEW);
-	gGL.pushMatrix();
-	gGL.loadMatrix(view.m);
-
-	stop_glerror();
-	gGLLastMatrix = NULL;
-
-	mGIMap.clear();
-
-	{
-		//LLGLEnable enable(GL_DEPTH_CLAMP_NV);
-		renderGeomDeferred(camera);
-	}
-
-	mGIMap.flush();
-	
-	gGL.matrixMode(LLRender::MM_PROJECTION);
-	gGL.popMatrix();
-	gGL.matrixMode(LLRender::MM_MODELVIEW);
-	gGL.popMatrix();
-	gGLLastMatrix = NULL;
-
-	LLPipeline::sUseOcclusion = occlude;
-	LLPipeline::sShadowRender = FALSE;
-	sMinRenderSize = 0.f;
-
-	popRenderTypeMask();
-
-}
-
 void LLPipeline::renderHighlight(const LLViewerObject* obj, F32 fade)
 {
 	if (obj && obj->getVolume())
@@ -9010,8 +8416,6 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 			return;
 		}
 
-		generateGI(camera, lightDir, fp);
-
 		//get good split distances for frustum
 		for (U32 i = 0; i < fp.size(); ++i)
 		{
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 02898aff1f2..d24bab747b4 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -248,7 +248,7 @@ class LLPipeline
 	void renderGeomDeferred(LLCamera& camera);
 	void renderGeomPostDeferred(LLCamera& camera);
 	void renderGeomShadow(LLCamera& camera);
-	void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, LLRenderTarget* gi_source = NULL, LLRenderTarget* last_gi_post = NULL, U32 noise_map = 0xFFFFFFFF);
+	void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, U32 noise_map = 0xFFFFFFFF);
 	void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep);
 
 	void unbindDeferredShader(LLGLSLShader& shader);
@@ -262,7 +262,6 @@ class LLPipeline
 
 
 	void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, BOOL use_shader = TRUE, BOOL use_occlusion = TRUE);
-	void generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<LLVector3>& vpc);
 	void renderHighlights();
 	void renderDebug();
 	void renderPhysicsDisplay();
@@ -534,10 +533,7 @@ class LLPipeline
 	LLRenderTarget			mFXAABuffer;
 	LLRenderTarget			mEdgeMap;
 	LLRenderTarget			mDeferredDepth;
-	LLRenderTarget			mDeferredLight[3];
-	LLRenderTarget			mGIMap;
-	LLRenderTarget			mGIMapPost[2];
-	LLRenderTarget			mLuminanceMap;
+	LLRenderTarget			mDeferredLight;
 	LLRenderTarget			mHighlight;
 	LLRenderTarget			mPhysicsDisplay;
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 16f48f3a4ee..45d6d85937e 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2549,19 +2549,6 @@
             <menu_item_check.on_enable
                  function="Advanced.EnableRenderDeferredOptions" />
           </menu_item_check>
-          <menu_item_check
-                   label="   Global Illumination (experimental)"
-                   name="Global Illumination">
-            <menu_item_check.on_check
-             function="CheckControl"
-             parameter="RenderDeferredGI" />
-            <menu_item_check.on_click
-             function="ToggleControl"
-             parameter="RenderDeferredGI" />
-            <menu_item_check.on_enable
-                 function="Advanced.EnableRenderDeferredOptions" />
-          </menu_item_check>
-
           <menu_item_separator />
 
           <menu_item_check
-- 
GitLab


From ae0cd901f8917f1cacc4c402e5a51a06632a076b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 4 Oct 2011 17:25:55 -0500
Subject: [PATCH 088/933] SH-2428 Make GCC 4.4 happy by using LLVector4a
 striders with LLAlphaObject subclasses -- also vectorize particle VBO updates

---
 indra/llrender/llvertexbuffer.cpp |   4 +
 indra/llrender/llvertexbuffer.h   |   1 +
 indra/newview/CMakeLists.txt      |   2 -
 indra/newview/llviewerobject.h    |   4 +-
 indra/newview/llvograss.cpp       |  22 ++-
 indra/newview/llvograss.h         |   2 +-
 indra/newview/llvopartgroup.cpp   |  94 +++++++----
 indra/newview/llvopartgroup.h     |   2 +-
 indra/newview/llvotextbubble.cpp  | 272 ------------------------------
 indra/newview/llvotextbubble.h    |  66 --------
 10 files changed, 83 insertions(+), 386 deletions(-)
 delete mode 100644 indra/newview/llvotextbubble.cpp
 delete mode 100644 indra/newview/llvotextbubble.h

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index c3e1a486b31..4484a880cc1 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1841,6 +1841,10 @@ bool LLVertexBuffer::getVertexStrider(LLStrider<LLVector3>& strider, S32 index,
 {
 	return VertexBufferStrider<LLVector3,TYPE_VERTEX>::get(*this, strider, index, count, map_range);
 }
+bool LLVertexBuffer::getVertexStrider(LLStrider<LLVector4a>& strider, S32 index, S32 count, bool map_range)
+{
+	return VertexBufferStrider<LLVector4a,TYPE_VERTEX>::get(*this, strider, index, count, map_range);
+}
 bool LLVertexBuffer::getIndexStrider(LLStrider<U16>& strider, S32 index, S32 count, bool map_range)
 {
 	return VertexBufferStrider<U16,TYPE_INDEX>::get(*this, strider, index, count, map_range);
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 98cab8b1628..b50c409c494 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -222,6 +222,7 @@ class LLVertexBuffer : public LLRefCount
 	//   setVertsNorms(verts, norms);
 	//   vb->unmapBuffer();
 	bool getVertexStrider(LLStrider<LLVector3>& strider, S32 index=0, S32 count = -1, bool map_range = false);
+	bool getVertexStrider(LLStrider<LLVector4a>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getIndexStrider(LLStrider<U16>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getTexCoord0Strider(LLStrider<LLVector2>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	bool getTexCoord1Strider(LLStrider<LLVector2>& strider, S32 index=0, S32 count = -1, bool map_range = false);
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index fe80a47ca45..0381609cbdd 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -588,7 +588,6 @@ set(viewer_SOURCE_FILES
     llvopartgroup.cpp
     llvosky.cpp
     llvosurfacepatch.cpp
-    llvotextbubble.cpp
     llvotree.cpp
     llvovolume.cpp
     llvowater.cpp
@@ -1145,7 +1144,6 @@ set(viewer_HEADER_FILES
     llvopartgroup.h
     llvosky.h
     llvosurfacepatch.h
-    llvotextbubble.h
     llvotree.h
     llvotreenew.h
     llvovolume.h
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 53e951e483f..a77725c1ca1 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file llviewerobject.h
  * @brief Description of LLViewerObject class, which is the base class for most objects in the viewer.
  *
@@ -811,7 +811,7 @@ class LLAlphaObject : public LLViewerObject
 
 	virtual F32 getPartSize(S32 idx);
 	virtual void getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
+								LLStrider<LLVector4a>& verticesp,
 								LLStrider<LLVector3>& normalsp, 
 								LLStrider<LLVector2>& texcoordsp,
 								LLStrider<LLColor4U>& colorsp, 
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index 32822e11816..8a79d564d3a 100644
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -464,7 +464,7 @@ void LLVOGrass::plantBlades()
 }
 
 void LLVOGrass::getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
+								LLStrider<LLVector4a>& verticesp,
 								LLStrider<LLVector3>& normalsp, 
 								LLStrider<LLVector2>& texcoordsp,
 								LLStrider<LLColor4U>& colorsp, 
@@ -516,21 +516,24 @@ void LLVOGrass::getGeometry(S32 idx,
 		position.mV[0]  = mPosition.mV[VX] + x + xf;
 		position.mV[1]  = mPosition.mV[VY] + y + yf;
 		position.mV[2]  = mRegionp->getLand().resolveHeightRegion(position);
-		*verticesp++    = v1 = position + mRegionp->getOriginAgent();
-		*verticesp++    = v1;
+		v1 = position + mRegionp->getOriginAgent();
+		(*verticesp++).load3(v1.mV);
+		(*verticesp++).load3(v1.mV);
 
 
 		position.mV[0] += dzx;
 		position.mV[1] += dzy;
 		position.mV[2] += blade_height;
-		*verticesp++    = v2 = position + mRegionp->getOriginAgent();
-		*verticesp++    = v2;
+		v2 = position + mRegionp->getOriginAgent();
+		(*verticesp++).load3(v2.mV);
+		(*verticesp++).load3(v2.mV);
 
 		position.mV[0]  = mPosition.mV[VX] + x - xf;
 		position.mV[1]  = mPosition.mV[VY] + y - xf;
 		position.mV[2]  = mRegionp->getLand().resolveHeightRegion(position);
-		*verticesp++    = v3 = position + mRegionp->getOriginAgent();
-		*verticesp++    = v3;
+		v3 = position + mRegionp->getOriginAgent();
+		(*verticesp++).load3(v3.mV);
+		(*verticesp++).load3(v3.mV);
 
 		LLVector3 normal1 = (v1-v2) % (v2-v3);
 		normal1.mV[VZ] = 0.75f;
@@ -541,8 +544,9 @@ void LLVOGrass::getGeometry(S32 idx,
 		position.mV[0] += dzx;
 		position.mV[1] += dzy;
 		position.mV[2] += blade_height;
-		*verticesp++    = v1 = position + mRegionp->getOriginAgent();
-		*verticesp++    = v1;
+		v1 = position + mRegionp->getOriginAgent();
+		(*verticesp++).load3(v1.mV);
+		(*verticesp++).load3(v1.mV);
 
 		*(normalsp++)   = normal1;
 		*(normalsp++)   = normal2;
diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h
index c262fdcc798..00a59facf74 100644
--- a/indra/newview/llvograss.h
+++ b/indra/newview/llvograss.h
@@ -59,7 +59,7 @@ class LLVOGrass : public LLAlphaObject
 	/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
 	/*virtual*/ BOOL		updateGeometry(LLDrawable *drawable);
 	/*virtual*/ void		getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
+								LLStrider<LLVector4a>& verticesp,
 								LLStrider<LLVector3>& normalsp, 
 								LLStrider<LLVector2>& texcoordsp,
 								LLStrider<LLColor4U>& colorsp, 
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index d7edc94c2f0..5c10a80b073 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -274,7 +274,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
 }
 
 void LLVOPartGroup::getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
+								LLStrider<LLVector4a>& verticesp,
 								LLStrider<LLVector3>& normalsp, 
 								LLStrider<LLVector2>& texcoordsp,
 								LLStrider<LLColor4U>& colorsp, 
@@ -290,37 +290,54 @@ void LLVOPartGroup::getGeometry(S32 idx,
 	U32 vert_offset = mDrawable->getFace(idx)->getGeomIndex();
 
 	
-	LLVector3 part_pos_agent(part.mPosAgent);
-	LLVector3 camera_agent = getCameraPosition(); 
-	LLVector3 at = part_pos_agent - camera_agent;
-	LLVector3 up;
-	LLVector3 right;
-
-	right = at % LLVector3(0.f, 0.f, 1.f);
-	right.normalize();
-	up = right % at;
-	up.normalize();
+	LLVector4a part_pos_agent;
+	part_pos_agent.load3(part.mPosAgent.mV);
+	LLVector4a camera_agent;
+	camera_agent.load3(getCameraPosition().mV); 
+	LLVector4a at;
+	at.setSub(part_pos_agent, camera_agent);
+	LLVector4a up(0, 0, 1);
+	LLVector4a right;
+
+	right.setCross3(at, up);
+	right.normalize3fast();
+	up.setCross3(right, at);
+	up.normalize3fast();
 
 	if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK)
 	{
-		LLVector3 normvel = part.mVelocity;
-		normvel.normalize();
+		LLVector4a normvel;
+		normvel.load3(part.mVelocity.mV);
+		normvel.normalize3fast();
 		LLVector2 up_fracs;
-		up_fracs.mV[0] = normvel*right;
-		up_fracs.mV[1] = normvel*up;
+		up_fracs.mV[0] = normvel.dot3(right).getF32();
+		up_fracs.mV[1] = normvel.dot3(up).getF32();
 		up_fracs.normalize();
-		LLVector3 new_up;
-		LLVector3 new_right;
-		new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up;
-		new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up;
+		LLVector4a new_up;
+		LLVector4a new_right;
+
+		//new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up;
+		LLVector4a t = right;
+		t.mul(up_fracs.mV[0]);
+		new_up = up;
+		new_up.mul(up_fracs.mV[1]);
+		new_up.add(t);
+
+		//new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up;
+		t = right;
+		t.mul(up_fracs.mV[1]);
+		new_right = up;
+		new_right.mul(up_fracs.mV[0]);
+		t.sub(new_right);
+
 		up = new_up;
-		right = new_right;
-		up.normalize();
-		right.normalize();
+		right = t;
+		up.normalize3fast();
+		right.normalize3fast();
 	}
 
-	right *= 0.5f*part.mScale.mV[0];
-	up *= 0.5f*part.mScale.mV[1];
+	right.mul(0.5f*part.mScale.mV[0]);
+	up.mul(0.5f*part.mScale.mV[1]);
 
 
 	LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis();
@@ -329,14 +346,25 @@ void LLVOPartGroup::getGeometry(S32 idx,
 	// this works because there is actually a 4th float stored after the vertex position which is used as a texture index
 	// also, somebody please VECTORIZE THIS
 
-	verticesp->mV[3] = 0.f;
-	*verticesp++ = part_pos_agent + up - right;
-	verticesp->mV[3] = 0.f;
-	*verticesp++ = part_pos_agent - up - right;
-	verticesp->mV[3] = 0.f;
-	*verticesp++ = part_pos_agent + up + right;
-	verticesp->mV[3] = 0.f;
-	*verticesp++ = part_pos_agent - up + right;
+	LLVector4a ppapu;
+	LLVector4a ppamu;
+
+	ppapu.setAdd(part_pos_agent, up);
+	ppamu.setSub(part_pos_agent, up);
+
+	verticesp->setSub(ppapu, right);
+	(*verticesp++).getF32ptr()[3] = 0.f;
+	verticesp->setSub(ppamu, right);
+	(*verticesp++).getF32ptr()[3] = 0.f;
+	verticesp->setAdd(ppapu, right);
+	(*verticesp++).getF32ptr()[3] = 0.f;
+	verticesp->setAdd(ppamu, right);
+	(*verticesp++).getF32ptr()[3] = 0.f;
+
+	//*verticesp++ = part_pos_agent + up - right;
+	//*verticesp++ = part_pos_agent - up - right;
+	//*verticesp++ = part_pos_agent + up + right;
+	//*verticesp++ = part_pos_agent - up + right;
 
 	*colorsp++ = part.mColor;
 	*colorsp++ = part.mColor;
@@ -453,7 +481,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
 	LLVertexBuffer* buffer = group->mVertexBuffer;
 
 	LLStrider<U16> indicesp;
-	LLStrider<LLVector3> verticesp;
+	LLStrider<LLVector4a> verticesp;
 	LLStrider<LLVector3> normalsp;
 	LLStrider<LLVector2> texcoordsp;
 	LLStrider<LLColor4U> colorsp;
diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h
index 4db893b4ef7..e58fed86d96 100644
--- a/indra/newview/llvopartgroup.h
+++ b/indra/newview/llvopartgroup.h
@@ -60,7 +60,7 @@ class LLVOPartGroup : public LLAlphaObject
 	/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
 	/*virtual*/ BOOL        updateGeometry(LLDrawable *drawable);
 				void		getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
+								LLStrider<LLVector4a>& verticesp,
 								LLStrider<LLVector3>& normalsp, 
 								LLStrider<LLVector2>& texcoordsp,
 								LLStrider<LLColor4U>& colorsp, 
diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp
deleted file mode 100644
index a92172fe230..00000000000
--- a/indra/newview/llvotextbubble.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/** 
- * @file llvotextbubble.cpp
- * @brief Viewer-object text bubble.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llvotextbubble.h"
-
-#include "imageids.h"
-#include "llviewercontrol.h"
-#include "llprimitive.h"
-#include "llrendersphere.h"
-
-#include "llbox.h"
-#include "lldrawable.h"
-#include "llface.h"
-#include "llviewertexturelist.h"
-#include "llvolume.h"
-#include "pipeline.h"
-#include "llvector4a.h"
-#include "llviewerregion.h"
-
-LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
-:	LLAlphaObject(id, pcode, regionp)
-{
-	setScale(LLVector3(1.5f, 1.5f, 0.25f));
-	mbCanSelect = FALSE;
-	mLOD = MIN_LOD;
-	mVolumeChanged = TRUE;
-	setVelocity(LLVector3(0.f, 0.f, 0.75f));
-	LLVolumeParams volume_params;
-	volume_params.setType(LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE);
-	volume_params.setBeginAndEndS(0.f, 1.f);
-	volume_params.setBeginAndEndT(0.f, 1.f);
-	volume_params.setRatio(0.25f, 0.25f);
-	volume_params.setShear(0.f, 0.f);
-	setVolume(volume_params, 0);
-	mColor = LLColor4(1.0f, 0.0f, 0.0f, 1.f);
-	S32 i;
-	for (i = 0; i < getNumTEs(); i++)
-	{
-		setTEColor(i, mColor);
-		setTETexture(i, LLUUID(IMG_DEFAULT));
-	}
-}
-
-
-LLVOTextBubble::~LLVOTextBubble()
-{
-}
-
-
-BOOL LLVOTextBubble::isActive() const
-{
-	return TRUE;
-}
-
-BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld	&world, const F64 &time)
-{
-	static LLFastTimer::DeclareTimer ftm("Text Bubble");
-	LLFastTimer t(ftm);
-
-	F32 dt = mUpdateTimer.getElapsedTimeF32();
-	// Die after a few seconds.
-	if (dt > 1.5f)
-	{
-		return FALSE;
-	}
-
-	LLViewerObject::idleUpdate(agent, world, time);
-
-	setScale(0.5f * (1.f+dt) * LLVector3(1.5f, 1.5f, 0.5f));
-
-	F32 alpha = 0.35f*dt;
-
-	LLColor4 color = mColor;
-	color.mV[VALPHA] -= alpha;
-	if (color.mV[VALPHA] <= 0.05f)
-	{
-		return FALSE;
-	}
-	S32 i;
-	for (i = 0; i < getNumTEs(); i++)
-	{
-		setTEColor(i, color);
-		setTEFullbright(i, TRUE);
-	}
-
-	gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
-	return TRUE;
-}
-
-
-void LLVOTextBubble::updateTextures()
-{
-	// Update the image levels of all textures...
-
-	for (U32 i = 0; i < getNumTEs(); i++)
-	{
-		const LLTextureEntry *te = getTE(i);
-		F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT);
-		texel_area_ratio = llclamp(texel_area_ratio, .125f, 16.f);
-		LLViewerTexture *imagep = getTEImage(i);
-		if (imagep)
-		{
-			imagep->addTextureStats(mPixelArea / texel_area_ratio);
-		}
-	}
-}
-
-
-LLDrawable *LLVOTextBubble::createDrawable(LLPipeline *pipeline)
-{
-	pipeline->allocDrawable(this);
-	mDrawable->setLit(FALSE);
-	mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
-	
-	for (U32 i = 0; i < getNumTEs(); i++)
-	{
-		LLViewerTexture *imagep;
-		const LLTextureEntry *texture_entry = getTE(i);
-		imagep = LLViewerTextureManager::getFetchedTexture(texture_entry->getID());
-
-		mDrawable->addFace((LLFacePool*) NULL, imagep);
-	}
-
-	return mDrawable;
-}
-
-// virtual
-BOOL LLVOTextBubble::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume)
-{
-	if (LLPrimitive::setVolume(volume_params, mLOD))
-	{
-		if (mDrawable)
-		{
-			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
-			mVolumeChanged = TRUE;
-		}
-		return TRUE;
-	}
-	return FALSE;
-}
-
-
-BOOL LLVOTextBubble::updateLOD()
-{
-	return FALSE;
-}
-
-BOOL LLVOTextBubble::updateGeometry(LLDrawable *drawable)
-{
- 	if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_VOLUME)))
-		return TRUE;
-	
-	if (mVolumeChanged)
-	{
-		LLVolumeParams volume_params = getVolume()->getParams();
-		setVolume(volume_params, 0);
-
-		LLPipeline::sCompiles++;
-
-		drawable->setNumFaces(getVolume()->getNumFaces(), drawable->getFace(0)->getPool(), getTEImage(0));
-	}
-
-	LLMatrix4 identity4;
-	LLMatrix3 identity3;
-	for (S32 i = 0; i < drawable->getNumFaces(); i++)
-	{
-		LLFace *face = drawable->getFace(i);
-		face->setTEOffset(i);
-		face->setTexture(LLViewerFetchedTexture::sSmokeImagep);
-		face->setState(LLFace::FULLBRIGHT);
-	}
-
-	mVolumeChanged = FALSE;
-
-	mDrawable->movePartition();
-	return TRUE;
-}
-
-void LLVOTextBubble::updateFaceSize(S32 idx)
-{
-	LLFace* face = mDrawable->getFace(idx);
-	
-	if (idx == 0 || idx == 2)
-	{
-		face->setSize(0,0);
-	}
-	else
-	{
-		const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
-		face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
-	}
-}
-
-void LLVOTextBubble::getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
-								LLStrider<LLVector3>& normalsp, 
-								LLStrider<LLVector2>& texcoordsp,
-								LLStrider<LLColor4U>& colorsp, 
-								LLStrider<U16>& indicesp) 
-{
-	if (idx == 0 || idx == 2)
-	{
-		return;
-	}
-
-	const LLVolumeFace& face = getVolume()->getVolumeFace(idx);
-	
-	LLVector4a pos;
-	pos.load3(getPositionAgent().mV);
-
-	LLVector4a scale;
-	scale.load3(getScale().mV);
-
-	LLColor4U color = LLColor4U(getTE(idx)->getColor());
-	U32 offset = mDrawable->getFace(idx)->getGeomIndex();
-	
-	LLVector4a* dst_pos = (LLVector4a*) verticesp.get();
-	LLVector4a* src_pos = (LLVector4a*) face.mPositions;
-	
-	LLVector4a* dst_norm = (LLVector4a*) normalsp.get();
-	LLVector4a* src_norm  = (LLVector4a*) face.mNormals;
-	
-	LLVector2* dst_tc = (LLVector2*) texcoordsp.get();
-	LLVector2* src_tc = (LLVector2*) face.mTexCoords;
-
-	LLVector4a::memcpyNonAliased16((F32*) dst_norm, (F32*) src_norm, face.mNumVertices*4*sizeof(F32));
-	LLVector4a::memcpyNonAliased16((F32*) dst_tc, (F32*) src_tc, face.mNumVertices*2*sizeof(F32));
-	
-	
-	for (U32 i = 0; i < face.mNumVertices; i++)
-	{
-		LLVector4a t;
-		t.setMul(src_pos[i], scale);
-		dst_pos[i].setAdd(t, pos);
-		*colorsp++ = color;
-	}
-	
-	for (U32 i = 0; i < face.mNumIndices; i++)
-	{
-		*indicesp++ = face.mIndices[i] + offset;
-	}
-}
-
-U32 LLVOTextBubble::getPartitionType() const
-{ 
-	return LLViewerRegion::PARTITION_PARTICLE; 
-}
diff --git a/indra/newview/llvotextbubble.h b/indra/newview/llvotextbubble.h
deleted file mode 100644
index 9c39929711b..00000000000
--- a/indra/newview/llvotextbubble.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/** 
- * @file llvotextbubble.h
- * @brief Description of LLVORock class, which a derivation of LLViewerObject
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLVOTEXTBUBBLE_H
-#define LL_LLVOTEXTBUBBLE_H
-
-#include "llviewerobject.h"
-#include "llframetimer.h"
-
-class LLVOTextBubble : public LLAlphaObject
-{
-public:
-	LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
-
-	/*virtual*/ BOOL    isActive() const; // Whether this object needs to do an idleUpdate.
-	/*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
-
-	/*virtual*/ void updateTextures();
-	/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
-	/*virtual*/ BOOL		updateGeometry(LLDrawable *drawable);
-	/*virtual*/ BOOL		updateLOD();
-	/*virtual*/ void		updateFaceSize(S32 idx);
-	
-	/*virtual*/ void		getGeometry(S32 idx,
-								LLStrider<LLVector3>& verticesp,
-								LLStrider<LLVector3>& normalsp, 
-								LLStrider<LLVector2>& texcoordsp,
-								LLStrider<LLColor4U>& colorsp, 
-								LLStrider<U16>& indicesp);
-
-	virtual U32 getPartitionType() const;
-
-	LLColor4 mColor;
-	S32 mLOD;
-	BOOL mVolumeChanged;
-
-protected:
-	~LLVOTextBubble();
-	BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false);
-	LLFrameTimer mUpdateTimer;
-};
-
-#endif // LL_VO_TEXT_BUBBLE
-- 
GitLab


From 425b10601da5f0e0df265489d8d427afbd506332 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 4 Oct 2011 18:11:11 -0500
Subject: [PATCH 089/933] SH-2459 Default to 2x antialiasing instead of 4x/8x

---
 indra/newview/featuretable.txt       | 4 ++--
 indra/newview/featuretable_linux.txt | 4 ++--
 indra/newview/featuretable_mac.txt   | 4 ++--
 indra/newview/featuretable_xp.txt    | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index ca66ae989ce..9379d336d06 100755
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -155,7 +155,7 @@ WLSkyDetail					1	48
 RenderDeferred				1	0
 RenderDeferredSSAO			1	0
 RenderShadowDetail			1	0
-RenderFSAASamples			1	4
+RenderFSAASamples			1	2
 
 //
 // Ultra graphics (REALLY PURTY!)
@@ -184,7 +184,7 @@ WLSkyDetail					1	128
 RenderDeferred				1	1
 RenderDeferredSSAO			1	1
 RenderShadowDetail			1	2
-RenderFSAASamples			1	8
+RenderFSAASamples			1	2
 
 
 //
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index 6e962f3c567..18efcf5665e 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -153,7 +153,7 @@ WLSkyDetail					1	48
 RenderDeferred				1	0
 RenderDeferredSSAO			1	0
 RenderShadowDetail			1	0
-RenderFSAASamples			1	4
+RenderFSAASamples			1	2
 
 //
 // Ultra graphics (REALLY PURTY!)
@@ -183,7 +183,7 @@ WLSkyDetail					1	128
 RenderDeferred				1	1
 RenderDeferredSSAO			1	1
 RenderShadowDetail			1	2
-RenderFSAASamples			1	8
+RenderFSAASamples			1	2
 
 //
 // Class Unknown Hardware (unknown)
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 36ffa54184e..c37e4e93ee9 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -155,7 +155,7 @@ WLSkyDetail					1	48
 RenderDeferred				1	0
 RenderDeferredSSAO			1	0
 RenderShadowDetail			1	2
-RenderFSAASamples			1	4
+RenderFSAASamples			1	2
 
 //
 // Ultra graphics (REALLY PURTY!)
@@ -185,7 +185,7 @@ WLSkyDetail					1	128
 RenderDeferred				1	0
 RenderDeferredSSAO			1	0
 RenderShadowDetail			1	2
-RenderFSAASamples			1	8
+RenderFSAASamples			1	2
 
 //
 // Class Unknown Hardware (unknown)
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt
index e855b2c569d..fffd30c0d8f 100644
--- a/indra/newview/featuretable_xp.txt
+++ b/indra/newview/featuretable_xp.txt
@@ -155,7 +155,7 @@ WLSkyDetail					1	48
 RenderDeferred				1	0
 RenderDeferredSSAO			1	0
 RenderShadowDetail			1	2
-RenderFSAASamples			1	4
+RenderFSAASamples			1	2
 
 //
 // Ultra graphics (REALLY PURTY!)
@@ -185,7 +185,7 @@ WLSkyDetail					1	128
 RenderDeferred				1	0
 RenderDeferredSSAO			1	0
 RenderShadowDetail			1	2
-RenderFSAASamples			1	8
+RenderFSAASamples			1	2
 
 //
 // Class Unknown Hardware (unknown)
-- 
GitLab


From 210120f9068e8f5696abab55f9fced307e021d22 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 5 Oct 2011 00:49:03 -0500
Subject: [PATCH 090/933] SH-2240 Fix for projectors being double sided when
 shadows disabled

---
 .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index d3984276ef7..2196d14895b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -149,7 +149,7 @@ void main()
 	vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0));
 	if (proj_tc.z < 0.0)
 	{
-		//discard;
+		discard;
 	}
 	
 	proj_tc.xyz /= proj_tc.w;
@@ -158,7 +158,7 @@ void main()
 	float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
 	if (dist_atten <= 0.0)
 	{
-		//discard;
+		discard;
 	}
 	
 	lv = proj_origin-pos.xyz;
-- 
GitLab


From eb809e373d2f12fd1a282401eb2ac4fbaf209f85 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 5 Oct 2011 01:03:42 -0500
Subject: [PATCH 091/933] SH-2481 Potential fix for viewer detecting incorrect
 amount of vram available when using certain video cards.

---
 indra/llrender/llgl.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 8ad75384f22..c0d15fe6f36 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -630,6 +630,8 @@ bool LLGLManager::initGL()
 	initExtensions();
 	stop_glerror();
 
+	S32 old_vram = mVRAM;
+
 	if (mHasATIMemInfo)
 	{ //ask the gl how much vram is free at startup and attempt to use no more than half of that
 		S32 meminfo[4];
@@ -644,6 +646,11 @@ bool LLGLManager::initGL()
 		mVRAM = dedicated_memory/1024;
 	}
 
+	if (mVRAM < 256)
+	{ //something likely went wrong using the above extensions, fall back to old method
+		mVRAM = old_vram;
+	}
+
 	stop_glerror();
 
 	stop_glerror();
-- 
GitLab


From 967479f9039dc358b9419be7f117162f7d90609c Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 5 Oct 2011 15:12:02 -0500
Subject: [PATCH 092/933] SH-2031 Fix for stall in image update -- don't use
 the CPU to convert a height map into a normal map -- use the GPU instead via
 a shader.  Also, WTF glFinish?

---
 indra/llwindow/llwindowwin32.cpp              |   1 -
 .../shaders/class1/deferred/normgenF.glsl     |  56 ++++++
 .../shaders/class1/deferred/normgenV.glsl     |  36 ++++
 indra/newview/lldrawpoolbump.cpp              | 176 +++++++++++++-----
 indra/newview/llviewerdisplay.cpp             |  35 +++-
 indra/newview/llviewershadermgr.cpp           |  14 ++
 indra/newview/llviewershadermgr.h             |   2 +-
 indra/newview/llviewertexturelist.cpp         |  66 ++++---
 8 files changed, 305 insertions(+), 81 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index e4e5256ae70..bac23279cc1 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2925,7 +2925,6 @@ BOOL LLWindowWin32::resetDisplayResolution()
 
 void LLWindowWin32::swapBuffers()
 {
-	glFinish();
 	SwapBuffers(mhDC);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
new file mode 100644
index 00000000000..879942d8faa
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
@@ -0,0 +1,56 @@
+/** 
+ * @file normgenF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+#extension GL_ARB_texture_rectangle : enable
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform sampler2D alphaMap;
+
+VARYING vec2 vary_texcoord0;
+
+uniform float stepX;
+uniform float stepY;
+uniform float norm_scale;
+
+void main()
+{
+	float alpha = texture2D(alphaMap, vary_texcoord0).a;
+
+	vec3 right = vec3(norm_scale, 0, (texture2D(alphaMap, vary_texcoord0+vec2(stepX, 0)).a-alpha)*255);
+	vec3 left = vec3(-norm_scale, 0, (texture2D(alphaMap, vary_texcoord0-vec2(stepX, 0)).a-alpha)*255);
+	vec3 up = vec3(0, -norm_scale, (texture2D(alphaMap, vary_texcoord0-vec2(0, stepY)).a-alpha)*255);
+	vec3 down = vec3(0, norm_scale, (texture2D(alphaMap, vary_texcoord0+vec2(0, stepY)).a-alpha)*255);
+	
+	vec3 norm = cross(right, down) + cross(down, left) + cross(left,up) + cross(up, right);
+	
+	norm = normalize(norm);
+	norm *= 0.5;
+	norm += 0.5;	
+	
+	gl_FragColor = vec4(norm, alpha);
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl
new file mode 100644
index 00000000000..9bceae05b71
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl
@@ -0,0 +1,36 @@
+/** 
+ * @file normgenV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+ 
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_texcoord0;
+
+void main()
+{
+	gl_Position = vec4(position.x*2.0-1.0, position.y*2.0-1.0, -1.0, 1.0); 
+	vary_texcoord0 = texcoord0;
+}
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 501bd889704..be12eb800f1 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1088,6 +1088,8 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
 }
 
 
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_STANDARD_LOADED("Bump Standard Callback");
+
 // static
 void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
 {
@@ -1110,14 +1112,24 @@ void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerFetchedTextu
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_BUMP_GEN_NORMAL("Generate Normal Map");
+static LLFastTimer::DeclareTimer FTM_BUMP_CREATE_TEXTURE("Create GL Normal Map");
+
 void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
 {
 	if (success && LLPipeline::sRenderDeferred)
 	{
+		LLFastTimer t(FTM_BUMP_SOURCE_STANDARD_LOADED);
 		LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4);
-		generateNormalMapFromAlpha(src, nrm_image);
+		{
+			LLFastTimer t(FTM_BUMP_GEN_NORMAL);
+			generateNormalMapFromAlpha(src, nrm_image);
+		}
 		src_vi->setExplicitFormat(GL_RGBA, GL_RGBA);
-		src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image);
+		{
+			LLFastTimer t(FTM_BUMP_CREATE_TEXTURE);
+			src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image);
+		}
 	}
 }
 
@@ -1176,24 +1188,39 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr
 	}
 }
 
+
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_LOADED("Bump Source Loaded");
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_ENTRIES_UPDATE("Entries Update");
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_MIN_MAX("Min/Max");
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_RGB2LUM("RGB to Luminance");
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_RESCALE("Rescale");
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_GEN_NORMAL("Generate Normal");
+static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_CREATE("Create");
+
 // static
 void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code )
 {
 	if( success )
 	{
+		LLFastTimer t(FTM_BUMP_SOURCE_LOADED);
+
+
 		bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries );
 		bump_image_map_t::iterator iter = entries_list.find(source_asset_id);
 
-		if (iter == entries_list.end() ||
-			iter->second.isNull() ||
-                        iter->second->getWidth() != src->getWidth() ||
-                        iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
-		{ //make sure an entry exists for this image
-			LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
-			raw->clear(0x77, 0x77, 0xFF, 0xFF);
-
-			entries_list[src_vi->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
-			iter = entries_list.find(src_vi->getID());
+		{
+			LLFastTimer t(FTM_BUMP_SOURCE_ENTRIES_UPDATE);
+			if (iter == entries_list.end() ||
+				iter->second.isNull() ||
+							iter->second->getWidth() != src->getWidth() ||
+							iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
+			{ //make sure an entry exists for this image
+				LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
+				raw->clear(0x77, 0x77, 0xFF, 0xFF);
+
+				entries_list[src_vi->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
+				iter = entries_list.find(src_vi->getID());
+			}
 		}
 
 		//if (iter->second->getWidth() != src->getWidth() ||
@@ -1224,50 +1251,56 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 			{
 			case 1:
 			case 2:
-				if( src_data_size == dst_data_size * src_components )
 				{
-					for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components )
+					LLFastTimer t(FTM_BUMP_SOURCE_MIN_MAX);
+					if( src_data_size == dst_data_size * src_components )
 					{
-						dst_data[i] = src_data[j];
-						if( dst_data[i] < minimum )
+						for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components )
 						{
-							minimum = dst_data[i];
-						}
-						if( dst_data[i] > maximum )
-						{
-							maximum = dst_data[i];
+							dst_data[i] = src_data[j];
+							if( dst_data[i] < minimum )
+							{
+								minimum = dst_data[i];
+							}
+							if( dst_data[i] > maximum )
+							{
+								maximum = dst_data[i];
+							}
 						}
 					}
-				}
-				else
-				{
-					llassert(0);
-					dst_image->clear();
+					else
+					{
+						llassert(0);
+						dst_image->clear();
+					}
 				}
 				break;
 			case 3:
 			case 4:
-				if( src_data_size == dst_data_size * src_components )
 				{
-					for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components )
+					LLFastTimer t(FTM_BUMP_SOURCE_RGB2LUM);
+					if( src_data_size == dst_data_size * src_components )
 					{
-						// RGB to luminance
-						dst_data[i] = (R_WEIGHT * src_data[j] + G_WEIGHT * src_data[j+1] + B_WEIGHT * src_data[j+2]) >> FIXED_PT;
-						//llassert( dst_data[i] <= 255 );true because it's 8bit
-						if( dst_data[i] < minimum )
-						{
-							minimum = dst_data[i];
-						}
-						if( dst_data[i] > maximum )
+						for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components )
 						{
-							maximum = dst_data[i];
+							// RGB to luminance
+							dst_data[i] = (R_WEIGHT * src_data[j] + G_WEIGHT * src_data[j+1] + B_WEIGHT * src_data[j+2]) >> FIXED_PT;
+							//llassert( dst_data[i] <= 255 );true because it's 8bit
+							if( dst_data[i] < minimum )
+							{
+								minimum = dst_data[i];
+							}
+							if( dst_data[i] > maximum )
+							{
+								maximum = dst_data[i];
+							}
 						}
 					}
-				}
-				else
-				{
-					llassert(0);
-					dst_image->clear();
+					else
+					{
+						llassert(0);
+						dst_image->clear();
+					}
 				}
 				break;
 			default:
@@ -1278,6 +1311,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 
 			if( maximum > minimum )
 			{
+				LLFastTimer t(FTM_BUMP_SOURCE_RESCALE);
 				U8 bias_and_scale_lut[256];
 				F32 twice_one_over_range = 2.f / (maximum - minimum);
 				S32 i;
@@ -1311,17 +1345,63 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 			// accidentally releases it.
 			LLPointer<LLViewerTexture> bump = LLViewerTextureManager::getLocalTexture( TRUE );
 			
+			
 			if (!LLPipeline::sRenderDeferred)
 			{
+				LLFastTimer t(FTM_BUMP_SOURCE_CREATE);
 				bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
 				bump->createGLTexture(0, dst_image);
 			}
-			else
-			{
-				LLPointer<LLImageRaw> nrm_image = new LLImageRaw(dst_image->getWidth(), dst_image->getHeight(), 4);
-				generateNormalMapFromAlpha(dst_image, nrm_image);
-				bump->setExplicitFormat(GL_RGBA, GL_RGBA);
-				bump->createGLTexture(0, nrm_image);
+			else 
+			{ //convert to normal map
+				{
+					LLFastTimer t(FTM_BUMP_SOURCE_CREATE);
+					bump->setExplicitFormat(GL_RGBA8, GL_ALPHA);
+					bump->createGLTexture(0, dst_image);
+				}
+
+				{
+					LLFastTimer t(FTM_BUMP_SOURCE_GEN_NORMAL);
+					gPipeline.mScreen.bindTarget();
+					LLGLDepthTest depth(GL_FALSE);
+					LLGLDisable cull(GL_CULL_FACE);
+					LLGLDisable blend(GL_BLEND);
+					gGL.setColorMask(TRUE, TRUE);
+					gNormalMapGenProgram.bind();
+					gNormalMapGenProgram.uniform1f("norm_scale", gSavedSettings.getF32("RenderNormalMapScale"));
+					gNormalMapGenProgram.uniform1f("stepX", 1.f/bump->getWidth());
+					gNormalMapGenProgram.uniform1f("stepY", 1.f/bump->getHeight());
+
+					LLVector2 v((F32) bump->getWidth()/gPipeline.mScreen.getWidth(),
+								(F32) bump->getHeight()/gPipeline.mScreen.getHeight());
+
+					gGL.getTexUnit(0)->bind(bump);
+					
+					gGL.begin(LLRender::TRIANGLE_STRIP);
+
+					gGL.texCoord2f(0, 0);
+					gGL.vertex2f(0, 0);
+					gGL.texCoord2f(0, 1);
+					gGL.vertex2f(0, v.mV[1]);
+					gGL.texCoord2f(1, 0);
+					gGL.vertex2f(v.mV[0], 0);
+					gGL.texCoord2f(1, 1);
+					gGL.vertex2f(v.mV[0], v.mV[1]);
+
+					gGL.end();
+
+					gGL.flush();
+
+					glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, bump->getWidth(), bump->getHeight());
+
+					glGenerateMipmap(GL_TEXTURE_2D);
+
+					gPipeline.mScreen.flush();
+
+					gNormalMapGenProgram.unbind();
+										
+					//generateNormalMapFromAlpha(dst_image, nrm_image);
+				}
 			}
 		
 			iter->second = bump; // derefs (and deletes) old image
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 20c90710529..85ef12b32bd 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -213,6 +213,10 @@ static LLFastTimer::DeclareTimer FTM_RENDER("Render", true);
 static LLFastTimer::DeclareTimer FTM_UPDATE_SKY("Update Sky");
 static LLFastTimer::DeclareTimer FTM_UPDATE_TEXTURES("Update Textures");
 static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE("Update Images");
+static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_CLASS("Class");
+static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_BUMP("Bump");
+static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_LIST("List");
+static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_DELETE("Delete");
 
 // Paint the display!
 void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
@@ -743,18 +747,31 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			LLMemType mt_iu(LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE);
 			LLFastTimer t(FTM_IMAGE_UPDATE);
 			
-			LLViewerTexture::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(),
-										LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean());
+			{
+				LLFastTimer t(FTM_IMAGE_UPDATE_CLASS);
+				LLViewerTexture::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(),
+											LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean());
+			}
 
-			gBumpImageList.updateImages();  // must be called before gTextureList version so that it's textures are thrown out first.
+			
+			{
+				LLFastTimer t(FTM_IMAGE_UPDATE_BUMP);
+				gBumpImageList.updateImages();  // must be called before gTextureList version so that it's textures are thrown out first.
+			}
 
-			F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time
-			max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame)
-			gTextureList.updateImages(max_image_decode_time);
+			{
+				LLFastTimer t(FTM_IMAGE_UPDATE_LIST);
+				F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time
+				max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame)
+				gTextureList.updateImages(max_image_decode_time);
+			}
 
-			//remove dead textures from GL
-			LLImageGL::deleteDeadTextures();
-			stop_glerror();
+			{
+				LLFastTimer t(FTM_IMAGE_UPDATE_DELETE);
+				//remove dead textures from GL
+				LLImageGL::deleteDeadTextures();
+				stop_glerror();
+			}
 		}
 
 		LLGLState::checkStates();
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 764c247f012..ac489e0caf5 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -188,6 +188,7 @@ LLGLSLShader			gDeferredPostNoDoFProgram;
 LLGLSLShader			gDeferredWLSkyProgram;
 LLGLSLShader			gDeferredWLCloudProgram;
 LLGLSLShader			gDeferredStarProgram;
+LLGLSLShader			gNormalMapGenProgram;
 
 LLViewerShaderMgr::LLViewerShaderMgr() :
 	mVertexShaderLevel(SHADER_COUNT, 0),
@@ -275,6 +276,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gDeferredWLSkyProgram);
 	mShaderList.push_back(&gDeferredWLCloudProgram);
 	mShaderList.push_back(&gDeferredStarProgram);
+	mShaderList.push_back(&gNormalMapGenProgram);
 }
 
 LLViewerShaderMgr::~LLViewerShaderMgr()
@@ -1082,6 +1084,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredWLSkyProgram.unload();
 		gDeferredWLCloudProgram.unload();
 		gDeferredStarProgram.unload();
+		gNormalMapGenProgram.unload();
 		return TRUE;
 	}
 
@@ -1532,6 +1535,17 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		success = gDeferredStarProgram.createShader(NULL, &mWLUniforms);
 	}
 
+	if (success)
+	{
+		gNormalMapGenProgram.mName = "Normal Map Generation Program";
+		gNormalMapGenProgram.mShaderFiles.clear();
+		gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenV.glsl", GL_VERTEX_SHADER_ARB));
+		gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gNormalMapGenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		gNormalMapGenProgram.mShaderGroup = LLGLSLShader::SG_SKY;
+		success = gNormalMapGenProgram.createShader(NULL, NULL);
+	}
+
 	return success;
 }
 
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 74708c94a7c..5bcdf11be5b 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -384,6 +384,6 @@ extern LLGLSLShader			gDeferredAvatarAlphaProgram;
 extern LLGLSLShader			gDeferredWLSkyProgram;
 extern LLGLSLShader			gDeferredWLCloudProgram;
 extern LLGLSLShader			gDeferredStarProgram;
-
+extern LLGLSLShader			gNormalMapGenProgram;
 
 #endif
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 30ef8b8a292..487cdafd8f1 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -586,6 +586,11 @@ void LLViewerTextureList::dirtyImage(LLViewerFetchedTexture *image)
 
 ////////////////////////////////////////////////////////////////////////////
 static LLFastTimer::DeclareTimer FTM_IMAGE_MARK_DIRTY("Dirty Images");
+static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_PRIORITIES("Prioritize");
+static LLFastTimer::DeclareTimer FTM_IMAGE_CALLBACKS("Callbacks");
+static LLFastTimer::DeclareTimer FTM_IMAGE_FETCH("Fetch");
+static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create");
+static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats");
 
 void LLViewerTextureList::updateImages(F32 max_time)
 {
@@ -597,14 +602,25 @@ void LLViewerTextureList::updateImages(F32 max_time)
 	LLViewerStats::getInstance()->mGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes));
 	LLViewerStats::getInstance()->mRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory));
 	LLViewerStats::getInstance()->mFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory));
-	
-	updateImagesDecodePriorities();
+
+
+	{
+		LLFastTimer t(FTM_IMAGE_UPDATE_PRIORITIES);
+		updateImagesDecodePriorities();
+	}
 
 	F32 total_max_time = max_time;
-	max_time -= updateImagesFetchTextures(max_time);
+
+	{
+		LLFastTimer t(FTM_IMAGE_FETCH);
+		max_time -= updateImagesFetchTextures(max_time);
+	}
 	
-	max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time
-	max_time -= updateImagesCreateTextures(max_time);
+	{
+		LLFastTimer t(FTM_IMAGE_CREATE);
+		max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time
+		max_time -= updateImagesCreateTextures(max_time);
+	}
 	
 	if (!mDirtyTextureList.empty())
 	{
@@ -612,24 +628,32 @@ void LLViewerTextureList::updateImages(F32 max_time)
 		gPipeline.dirtyPoolObjectTextures(mDirtyTextureList);
 		mDirtyTextureList.clear();
 	}
-	bool didone = false;
-	for (image_list_t::iterator iter = mCallbackList.begin();
-		iter != mCallbackList.end(); )
+
 	{
-		//trigger loaded callbacks on local textures immediately
-		LLViewerFetchedTexture* image = *iter++;
-		if (!image->getUrl().empty())
+		LLFastTimer t(FTM_IMAGE_CALLBACKS);
+		bool didone = false;
+		for (image_list_t::iterator iter = mCallbackList.begin();
+			iter != mCallbackList.end(); )
 		{
-			// Do stuff to handle callbacks, update priorities, etc.
-			didone = image->doLoadedCallbacks();
-		}
-		else if (!didone)
-		{
-			// Do stuff to handle callbacks, update priorities, etc.
-			didone = image->doLoadedCallbacks();
+			//trigger loaded callbacks on local textures immediately
+			LLViewerFetchedTexture* image = *iter++;
+			if (!image->getUrl().empty())
+			{
+				// Do stuff to handle callbacks, update priorities, etc.
+				didone = image->doLoadedCallbacks();
+			}
+			else if (!didone)
+			{
+				// Do stuff to handle callbacks, update priorities, etc.
+				didone = image->doLoadedCallbacks();
+			}
 		}
 	}
-	updateImagesUpdateStats();
+
+	{
+		LLFastTimer t(FTM_IMAGE_STATS);
+		updateImagesUpdateStats();
+	}
 }
 
 void LLViewerTextureList::updateImagesDecodePriorities()
@@ -747,7 +771,6 @@ void LLViewerTextureList::updateImagesDecodePriorities()
  return type_from_host;
  }
  */
-static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create Images");
 
 F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
 {
@@ -757,8 +780,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
 	// Create GL textures for all textures that need them (images which have been
 	// decoded, but haven't been pushed into GL).
 	//
-	LLFastTimer t(FTM_IMAGE_CREATE);
-	
+		
 	LLTimer create_timer;
 	image_list_t::iterator enditer = mCreateTextureList.begin();
 	for (image_list_t::iterator iter = mCreateTextureList.begin();
-- 
GitLab


From 2b51a7a60942b1efc99cee43489ef2f92fa7a188 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 5 Oct 2011 17:57:13 -0500
Subject: [PATCH 093/933] SH-2454 Fix for head attachments not casting shadows
 when in mouselook mode.

---
 indra/newview/llspatialpartition.cpp |  4 ++++
 indra/newview/pipeline.cpp           | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 8e22a9be2ce..65a78d90484 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1613,6 +1613,8 @@ void LLSpatialGroup::checkOcclusion()
 static LLFastTimer::DeclareTimer FTM_PUSH_OCCLUSION_VERTS("Push Occlusion");
 static LLFastTimer::DeclareTimer FTM_SET_OCCLUSION_STATE("Occlusion State");
 static LLFastTimer::DeclareTimer FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_ALLOCATE("Allocate");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_BUILD("Build");
 
 void LLSpatialGroup::doOcclusion(LLCamera* camera)
 {
@@ -1636,11 +1638,13 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 
 					if (!mOcclusionQuery[LLViewerCamera::sCurCameraID])
 					{
+						LLFastTimer t(FTM_OCCLUSION_ALLOCATE);
 						mOcclusionQuery[LLViewerCamera::sCurCameraID] = sQueryPool.allocate();
 					}
 
 					if (mOcclusionVerts.isNull() || isState(LLSpatialGroup::OCCLUSION_DIRTY))
 					{
+						LLFastTimer t(FTM_OCCLUSION_BUILD);
 						buildOcclusion();
 					}
 					
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e672f7c4f19..83f98632246 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8300,6 +8300,17 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 		return;
 	}
 
+	BOOL skip_avatar_update = FALSE;
+	if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
+	{
+		skip_avatar_update = TRUE;
+	}
+
+	if (!skip_avatar_update)
+	{
+		gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON);
+	}
+
 	F64 last_modelview[16];
 	F64 last_projection[16];
 	for (U32 i = 0; i < 16; i++)
@@ -8413,6 +8424,12 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 				mShadowFrustPoints[3].clear();
 			}
 			popRenderTypeMask();
+
+			if (!skip_avatar_update)
+			{
+				gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
+			}
+
 			return;
 		}
 
@@ -9001,6 +9018,11 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	}
 
 	popRenderTypeMask();
+
+	if (!skip_avatar_update)
+	{
+		gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
+	}
 }
 
 void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture)
-- 
GitLab


From e76eaa8b2a1f49e45d009379aaf36f8e62b6273a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 6 Oct 2011 13:48:10 -0500
Subject: [PATCH 094/933] Fix for busted settings.xml (thanks TankMaster
 Finesmith)

---
 indra/newview/app_settings/settings.xml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 110e3e3d04b..e7ff584b385 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9075,9 +9075,7 @@
     <integer>1</integer>
     <key>Type</key>
     <string>Boolean</string>
-    <key>Va
-    
-    lue</key>
+    <key>Value</key>
     <integer>1</integer>
   </map>
 	<key>RenderPreferStreamDraw</key>
-- 
GitLab


From 40fe25632c62ab6a8bbb817149c159295b365d59 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 6 Oct 2011 15:00:14 -0500
Subject: [PATCH 095/933] SH-2553 Fix for glitches when rendering HUD
 attachments.

---
 indra/llrender/llrender.cpp       | 3 +++
 indra/llrender/llrendersphere.cpp | 1 +
 indra/newview/llviewerdisplay.cpp | 7 ++++++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index bbdd0a7a602..942ad875668 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1347,6 +1347,7 @@ void LLRender::popMatrix()
 
 void LLRender::loadMatrix(const GLfloat* m)
 {
+	flush();
 	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].set_value((GLfloat*) m);
 	mMatHash[mMatrixMode]++;
 }
@@ -1396,6 +1397,8 @@ void LLRender::multMatrix(const GLdouble* dm)
 
 void LLRender::loadIdentity()
 {
+	flush();
+
 	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
 	mMatHash[mMatrixMode]++;
 }
diff --git a/indra/llrender/llrendersphere.cpp b/indra/llrender/llrendersphere.cpp
index e7e07a1ab22..26bfe036e88 100644
--- a/indra/llrender/llrendersphere.cpp
+++ b/indra/llrender/llrendersphere.cpp
@@ -40,6 +40,7 @@ LLRenderSphere gSphere;
 void LLRenderSphere::render()
 {
 	renderGGL();
+	gGL.flush();
 }
 
 inline LLVector3 polar_to_cart(F32 latitude, F32 longitude)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 835f16d0864..7220f2a20fd 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1359,7 +1359,12 @@ void render_ui_3d()
 	}
 
 	stop_glerror();
-		
+	
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	gViewerWindow->renderSelections(FALSE, FALSE, TRUE); // Non HUD call in render_hud_elements
 	stop_glerror();
 }
-- 
GitLab


From a90ea46804d1fdb60d44178140b12e341c715178 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 6 Oct 2011 15:34:28 -0500
Subject: [PATCH 096/933] SH-2240 Fix for beacons not rendering (or crashing
 when rendered)

---
 indra/newview/llglsandbox.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 8c872283bdf..844d7ba41c8 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -777,6 +777,11 @@ void LLViewerObjectList::renderObjectBeacons()
 
 	LLGLSUIDefault gls_ui;
 
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		gUIProgram.bind();
+	}
+
 	{
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
-- 
GitLab


From fba8afd7b27ebc362af7b26b1f1fb2917deae920 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 6 Oct 2011 16:43:19 -0500
Subject: [PATCH 097/933] SH-2454 Fix for attachments casting shadows/showing
 up in water when "show me in mouselook" is disabled

---
 indra/newview/pipeline.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 83f98632246..d28bb1f64e9 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7612,11 +7612,11 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 	if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
 	{
 		BOOL skip_avatar_update = FALSE;
-		if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
+		if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
 		{
 			skip_avatar_update = TRUE;
 		}
-
+		
 		if (!skip_avatar_update)
 		{
 			gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON);
@@ -8301,7 +8301,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	}
 
 	BOOL skip_avatar_update = FALSE;
-	if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
+	if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
 	{
 		skip_avatar_update = TRUE;
 	}
-- 
GitLab


From f2fc69c65650bf5db4f0ea098be7bd5fe37f224d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 6 Oct 2011 17:31:59 -0500
Subject: [PATCH 098/933] SH-2240 Fix for crash when rendering beacons and
 Debug GL enabled -- flush every 128 beacons to keep from hitting the end of
 the immediate mode wrapper buffer.

---
 indra/newview/llglsandbox.cpp | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 844d7ba41c8..3f773effcb1 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -789,6 +789,8 @@ void LLViewerObjectList::renderObjectBeacons()
 		// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
 		
 		BOOL flush = FALSE;
+		S32 flush_me = 128;
+
 		for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
 		{
 			const LLDebugBeacon &debug_beacon = *iter;
@@ -818,6 +820,14 @@ void LLViewerObjectList::renderObjectBeacons()
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 2.f,thisline.mV[VZ]);
 
 			draw_line_cube(0.10f, thisline);
+
+			if (--flush_me <= 0)
+			{
+				flush_me = 128;
+				gGL.end();
+				gGL.flush();
+				gGL.begin(LLRender::LINES);
+			}
 		}
 		gGL.end();
 	}
@@ -830,6 +840,8 @@ void LLViewerObjectList::renderObjectBeacons()
 		// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
 		
 		BOOL flush = FALSE;
+		S32 flush_me = 128;
+
 		for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
 		{
 			const LLDebugBeacon &debug_beacon = *iter;
@@ -858,6 +870,14 @@ void LLViewerObjectList::renderObjectBeacons()
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 0.5f,thisline.mV[VZ]);
 
 			draw_line_cube(0.10f, thisline);
+
+			if (--flush_me <= 0)
+			{
+				flush_me = 128;
+				gGL.end();
+				gGL.flush();
+				gGL.begin(LLRender::LINES);
+			}
 		}
 		
 		gGL.end();
-- 
GitLab


From c834bdd05a134d6b3442a31f351a94f21965d4e9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 6 Oct 2011 17:54:06 -0500
Subject: [PATCH 099/933] SH-2240 Better fix for beacon rendering -- let
 LLRender take care of optimization around joining chunks of line segments
 together into one draw call

---
 indra/newview/llglsandbox.cpp | 41 +++++------------------------------
 1 file changed, 6 insertions(+), 35 deletions(-)

diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 3f773effcb1..ac87da2d71c 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -788,9 +788,6 @@ void LLViewerObjectList::renderObjectBeacons()
 		S32 last_line_width = -1;
 		// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
 		
-		BOOL flush = FALSE;
-		S32 flush_me = 128;
-
 		for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
 		{
 			const LLDebugBeacon &debug_beacon = *iter;
@@ -799,18 +796,14 @@ void LLViewerObjectList::renderObjectBeacons()
 			S32 line_width = debug_beacon.mLineWidth;
 			if (line_width != last_line_width)
 			{
-				if (flush)
-				{
-					gGL.end();
-				}
-				flush = TRUE;
 				gGL.flush();
 				glLineWidth( (F32)line_width );
 				last_line_width = line_width;
-				gGL.begin(LLRender::LINES);
 			}
 
 			const LLVector3 &thisline = debug_beacon.mPositionAgent;
+		
+			gGL.begin(LLRender::LINES);
 			gGL.color4fv(color.mV);
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 50.f);
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 50.f);
@@ -820,16 +813,9 @@ void LLViewerObjectList::renderObjectBeacons()
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 2.f,thisline.mV[VZ]);
 
 			draw_line_cube(0.10f, thisline);
-
-			if (--flush_me <= 0)
-			{
-				flush_me = 128;
-				gGL.end();
-				gGL.flush();
-				gGL.begin(LLRender::LINES);
-			}
+			
+			gGL.end();
 		}
-		gGL.end();
 	}
 
 	{
@@ -839,9 +825,6 @@ void LLViewerObjectList::renderObjectBeacons()
 		S32 last_line_width = -1;
 		// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
 		
-		BOOL flush = FALSE;
-		S32 flush_me = 128;
-
 		for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
 		{
 			const LLDebugBeacon &debug_beacon = *iter;
@@ -849,18 +832,13 @@ void LLViewerObjectList::renderObjectBeacons()
 			S32 line_width = debug_beacon.mLineWidth;
 			if (line_width != last_line_width)
 			{
-				if (flush)
-				{
-					gGL.end();
-				}
-				flush = TRUE;
 				gGL.flush();
 				glLineWidth( (F32)line_width );
 				last_line_width = line_width;
-				gGL.begin(LLRender::LINES);
 			}
 
 			const LLVector3 &thisline = debug_beacon.mPositionAgent;
+			gGL.begin(LLRender::LINES);
 			gGL.color4fv(debug_beacon.mColor.mV);
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 0.5f);
 			gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 0.5f);
@@ -871,16 +849,9 @@ void LLViewerObjectList::renderObjectBeacons()
 
 			draw_line_cube(0.10f, thisline);
 
-			if (--flush_me <= 0)
-			{
-				flush_me = 128;
-				gGL.end();
-				gGL.flush();
-				gGL.begin(LLRender::LINES);
-			}
+			gGL.end();
 		}
 		
-		gGL.end();
 		gGL.flush();
 		glLineWidth(1.f);
 
-- 
GitLab


From 79912f9d3f0807529183521f69f989f947c1cff1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 7 Oct 2011 03:12:11 -0500
Subject: [PATCH 100/933] SH-2031 Profile guided optimization of matrix ops -
 don't use F64 except where needed (should really factor out calls to
 gluProject) - get rid of sorting by texture in favor of sorting by matrix (no
 sort needed, geometry is already matrix sorted as a result of frustum cull
 tree traversal order) - unroll matrix sync inner loop and cache MVP and
 normal matrices

---
 indra/llrender/llcubemap.cpp     |   6 +-
 indra/llrender/llrender.cpp      | 252 ++++++++++++++++++-------------
 indra/llrender/llrender.h        |  10 +-
 indra/newview/llhudrender.cpp    |  12 +-
 indra/newview/llselectmgr.cpp    |   2 +-
 indra/newview/llviewercamera.cpp |  58 +++++--
 indra/newview/pipeline.cpp       |  28 +---
 indra/newview/pipeline.h         |   2 +-
 8 files changed, 213 insertions(+), 157 deletions(-)

diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index a75f01c7088..45a3b18179a 100644
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -265,9 +265,9 @@ void LLCubeMap::setMatrix(S32 stage)
 		gGL.getTexUnit(stage)->activate();
 	}
 
-	LLVector3 x(LLVector3d(gGLModelView+0));
-	LLVector3 y(LLVector3d(gGLModelView+4));
-	LLVector3 z(LLVector3d(gGLModelView+8));
+	LLVector3 x(gGLModelView+0);
+	LLVector3 y(gGLModelView+4);
+	LLVector3 z(gGLModelView+8);
 
 	LLMatrix3 mat3;
 	mat3.setRows(x,y,z);
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 942ad875668..c5a68590168 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -38,10 +38,10 @@
 LLRender gGL;
 
 // Handy copies of last good GL matrices
-F64	gGLModelView[16];
-F64	gGLLastModelView[16];
-F64 gGLLastProjection[16];
-F64 gGLProjection[16];
+F32	gGLModelView[16];
+F32	gGLLastModelView[16];
+F32 gGLLastProjection[16];
+F32 gGLProjection[16];
 S32	gGLViewport[4];
 
 U32 LLRender::sUICalls = 0;
@@ -1163,41 +1163,41 @@ void LLRender::syncMatrices()
 
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
 
+	static glh::matrix4f cached_mvp;
+	static U32 cached_mvp_mdv_hash = 0xFFFFFFFF;
+	static U32 cached_mvp_proj_hash = 0xFFFFFFFF;
+	
+	static glh::matrix4f cached_normal;
+	static U32 cached_normal_hash = 0xFFFFFFFF;
+
 	if (shader)
 	{
-		
 		llassert(shader);
 
 		bool do_normal = false;
-		bool do_mvp = false;
+		bool do_mvp = false;	
 
-		for (U32 i = 0; i < NUM_MATRIX_MODES; ++i)
-		{
-			if (mMatHash[i] != shader->mMatHash[i])
-			{
-				shader->uniformMatrix4fv(name[i], 1, GL_FALSE, mMatrix[i][mMatIdx[i]].m);
-				shader->mMatHash[i] = mMatHash[i];
+		bool mvp_done = false;
 
-				if (i == MM_MODELVIEW)
-				{
-					do_normal = true;
-					do_mvp = true;
-				}
-				else if (i == MM_PROJECTION)
-				{
-					do_mvp = true;
-				}
-			}
-		}
+		U32 i = MM_MODELVIEW;
+		if (mMatHash[i] != shader->mMatHash[i])
+		{ //update modelview, normal, and MVP
+			glh::matrix4f& mat = mMatrix[i][mMatIdx[i]];
 
-		if (do_normal)
-		{
+			shader->uniformMatrix4fv(name[i], 1, GL_FALSE, mat.m);
+			shader->mMatHash[i] = mMatHash[i];
+
+			//update normal matrix
 			S32 loc = shader->getUniformLocation("normal_matrix");
 			if (loc > -1)
 			{
-				U32 i = MM_MODELVIEW;
+				if (cached_normal_hash != mMatHash[i])
+				{
+					cached_normal = mat.inverse().transpose();
+					cached_normal_hash = mMatHash[i];
+				}
 
-				glh::matrix4f norm = mMatrix[i][mMatIdx[i]].inverse().transpose();
+				glh::matrix4f& norm = cached_normal;
 
 				F32 norm_mat[] = 
 				{
@@ -1208,23 +1208,65 @@ void LLRender::syncMatrices()
 
 				shader->uniformMatrix3fv("normal_matrix", 1, GL_FALSE, norm_mat);
 			}
-		}
 
-		if (do_mvp)
-		{
-			S32 loc = shader->getUniformLocation("modelview_projection_matrix");
+			//update MVP matrix
+			mvp_done = true;
+			loc = shader->getUniformLocation("modelview_projection_matrix");
 			if (loc > -1)
 			{
-				U32 mv = MM_MODELVIEW;
 				U32 proj = MM_PROJECTION;
 
-				glh::matrix4f mvp = mMatrix[mv][mMatIdx[mv]];
-				mvp.mult_left(mMatrix[proj][mMatIdx[proj]]);
-				
-				shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, mvp.m);
+				if (cached_mvp_mdv_hash != mMatHash[i] || cached_mvp_proj_hash != mMatHash[MM_PROJECTION])
+				{
+					cached_mvp = mat;
+					cached_mvp.mult_left(mMatrix[proj][mMatIdx[proj]]);
+					cached_mvp_mdv_hash = mMatHash[i];
+					cached_mvp_proj_hash = mMatHash[MM_PROJECTION];
+				}
+
+				shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, cached_mvp.m);
+			}
+		}
+
+
+		i = MM_PROJECTION;
+		if (mMatHash[i] != shader->mMatHash[i])
+		{ //update projection matrix, normal, and MVP
+			glh::matrix4f& mat = mMatrix[i][mMatIdx[i]];
+
+			shader->uniformMatrix4fv(name[i], 1, GL_FALSE, mat.m);
+			shader->mMatHash[i] = mMatHash[i];
+
+			if (!mvp_done)
+			{
+				//update MVP matrix
+				S32 loc = shader->getUniformLocation("modelview_projection_matrix");
+				if (loc > -1)
+				{
+					if (cached_mvp_mdv_hash != mMatHash[i] || cached_mvp_proj_hash != mMatHash[MM_PROJECTION])
+					{
+						U32 mdv = MM_MODELVIEW;
+						cached_mvp = mat;
+						cached_mvp.mult_right(mMatrix[mdv][mMatIdx[mdv]]);
+						cached_mvp_mdv_hash = mMatHash[MM_MODELVIEW];
+						cached_mvp_proj_hash = mMatHash[MM_PROJECTION];
+					}
+									
+					shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, cached_mvp.m);
+				}
 			}
 		}
 
+		for (i = MM_TEXTURE0; i < NUM_MATRIX_MODES; ++i)
+		{
+			if (mMatHash[i] != shader->mMatHash[i])
+			{
+				shader->uniformMatrix4fv(name[i], 1, GL_FALSE, mMatrix[i][mMatIdx[i]].m);
+				shader->mMatHash[i] = mMatHash[i];
+			}
+		}
+
+
 		if (shader->mFeatures.hasLighting || shader->mFeatures.calculatesLighting)
 		{ //also sync light state
 			syncLightState();
@@ -1261,116 +1303,121 @@ void LLRender::translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 {
 	flush();
 
-	glh::matrix4f trans_mat(1,0,0,x,
-							0,1,0,y,
-							0,0,1,z,
-							0,0,0,1);
+	{
+		glh::matrix4f trans_mat(1,0,0,x,
+								0,1,0,y,
+								0,0,1,z,
+								0,0,0,1);
 	
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(trans_mat);
-	mMatHash[mMatrixMode]++;
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(trans_mat);
+		mMatHash[mMatrixMode]++;
+	}
 }
 
 void LLRender::scalef(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 {
 	flush();
 	
-	glh::matrix4f scale_mat(x,0,0,0,
-							0,y,0,0,
-							0,0,z,0,
-							0,0,0,1);
+	{
+		glh::matrix4f scale_mat(x,0,0,0,
+								0,y,0,0,
+								0,0,z,0,
+								0,0,0,1);
 	
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(scale_mat);
-	mMatHash[mMatrixMode]++;
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(scale_mat);
+		mMatHash[mMatrixMode]++;
+	}
 }
 
 void LLRender::ortho(F32 left, F32 right, F32 bottom, F32 top, F32 zNear, F32 zFar)
 {
 	flush();
 
-	glh::matrix4f ortho_mat(2.f/(right-left),0,0,	-(right+left)/(right-left),
-							0,2.f/(top-bottom),0,	-(top+bottom)/(top-bottom),
-							0,0,-2.f/(zFar-zNear),	-(zFar+zNear)/(zFar-zNear),
-							0,0,0,1);
+	{
+
+		glh::matrix4f ortho_mat(2.f/(right-left),0,0,	-(right+left)/(right-left),
+								0,2.f/(top-bottom),0,	-(top+bottom)/(top-bottom),
+								0,0,-2.f/(zFar-zNear),	-(zFar+zNear)/(zFar-zNear),
+								0,0,0,1);
 	
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(ortho_mat);
-	mMatHash[mMatrixMode]++;
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(ortho_mat);
+		mMatHash[mMatrixMode]++;
+	}
 }
 
 void LLRender::rotatef(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z)
 {
 	flush();
-	
-	F32 r = a * DEG_TO_RAD;
 
-	F32 c = cosf(r);
-	F32 s = sinf(r);
+	{
+		F32 r = a * DEG_TO_RAD;
+
+		F32 c = cosf(r);
+		F32 s = sinf(r);
 
-	F32 ic = 1.f-c;
+		F32 ic = 1.f-c;
 
-	glh::matrix4f rot_mat(x*x*ic+c,		x*y*ic-z*s,		x*z*ic+y*s,		0,
-						  x*y*ic+z*s,	y*y*ic+c,		y*z*ic-x*s,		0,
-						  x*z*ic-y*s,	y*z*ic+x*s,		z*z*ic+c,		0,
-						  0,0,0,1);
+		glh::matrix4f rot_mat(x*x*ic+c,		x*y*ic-z*s,		x*z*ic+y*s,		0,
+							  x*y*ic+z*s,	y*y*ic+c,		y*z*ic-x*s,		0,
+							  x*z*ic-y*s,	y*z*ic+x*s,		z*z*ic+c,		0,
+							  0,0,0,1);
 	
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(rot_mat);
-	mMatHash[mMatrixMode]++;
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(rot_mat);
+		mMatHash[mMatrixMode]++;
+	}
 }
 
 void LLRender::pushMatrix()
 {
 	flush();
 	
-	if (mMatIdx[mMatrixMode] < LL_MATRIX_STACK_DEPTH-1)
 	{
-		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]+1] = mMatrix[mMatrixMode][mMatIdx[mMatrixMode]];
-		++mMatIdx[mMatrixMode];
-	}
-	else
-	{
-		llwarns << "Matrix stack overflow." << llendl;
+		if (mMatIdx[mMatrixMode] < LL_MATRIX_STACK_DEPTH-1)
+		{
+			mMatrix[mMatrixMode][mMatIdx[mMatrixMode]+1] = mMatrix[mMatrixMode][mMatIdx[mMatrixMode]];
+			++mMatIdx[mMatrixMode];
+		}
+		else
+		{
+			llwarns << "Matrix stack overflow." << llendl;
+		}
 	}
 }
 
 void LLRender::popMatrix()
 {
 	flush();
-	if (mMatIdx[mMatrixMode] > 0)
-	{
-		--mMatIdx[mMatrixMode];
-		mMatHash[mMatrixMode]++;
-	}
-	else
 	{
-		llwarns << "Matrix stack underflow." << llendl;
+		if (mMatIdx[mMatrixMode] > 0)
+		{
+			--mMatIdx[mMatrixMode];
+			mMatHash[mMatrixMode]++;
+		}
+		else
+		{
+			llwarns << "Matrix stack underflow." << llendl;
+		}
 	}
 }
 
 void LLRender::loadMatrix(const GLfloat* m)
 {
 	flush();
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].set_value((GLfloat*) m);
-	mMatHash[mMatrixMode]++;
-}
-
-void LLRender::loadMatrix(const GLdouble* dm)
-{
-	F32 m[16];
-	for (U32 i = 0; i < 16; i++)
 	{
-		m[i] = (F32) dm[i];
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].set_value((GLfloat*) m);
+		mMatHash[mMatrixMode]++;
 	}
-
-	loadMatrix(m);
 }
 
 void LLRender::multMatrix(const GLfloat* m)
 {
 	flush();
-
-	glh::matrix4f mat((GLfloat*) m);
+	{
+		glh::matrix4f mat((GLfloat*) m);
 	
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(mat);
-	mMatHash[mMatrixMode]++;
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].mult_right(mat);
+		mMatHash[mMatrixMode]++;
+	}
 }
 
 void LLRender::matrixMode(U32 mode)
@@ -1384,23 +1431,14 @@ void LLRender::matrixMode(U32 mode)
 	mMatrixMode = mode;
 }
 
-void LLRender::multMatrix(const GLdouble* dm)
-{
-	F32 m[16];
-	for (U32 i = 0; i < 16; i++)
-	{
-		m[i] = (F32) dm[i];
-	}
-
-	multMatrix(m);
-}
-
 void LLRender::loadIdentity()
 {
 	flush();
 
-	mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
-	mMatHash[mMatrixMode]++;
+	{
+		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
+		mMatHash[mMatrixMode]++;
+	}
 }
 
 const glh::matrix4f& LLRender::getModelviewMatrix()
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 61e503d3841..7581b9f9086 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -343,10 +343,8 @@ class LLRender
 	void pushMatrix();
 	void popMatrix();
 	void loadMatrix(const GLfloat* m);
-	void loadMatrix(const GLdouble* m);
 	void loadIdentity();
 	void multMatrix(const GLfloat* m);
-	void multMatrix(const GLdouble* m);
 	void matrixMode(U32 mode);	
 
 	const glh::matrix4f& getModelviewMatrix();
@@ -470,10 +468,10 @@ class LLRender
 
 };
 
-extern F64 gGLModelView[16];
-extern F64 gGLLastModelView[16];
-extern F64 gGLLastProjection[16];
-extern F64 gGLProjection[16];
+extern F32 gGLModelView[16];
+extern F32 gGLLastModelView[16];
+extern F32 gGLLastProjection[16];
+extern F32 gGLProjection[16];
 extern S32 gGLViewport[4];
 
 extern LLRender gGL;
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp
index 607f7f7f4b8..122711a86d2 100644
--- a/indra/newview/llhudrender.cpp
+++ b/indra/newview/llhudrender.cpp
@@ -107,8 +107,18 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
 	viewport[1] = world_view_rect.mBottom;
 	viewport[2] = world_view_rect.getWidth();
 	viewport[3] = world_view_rect.getHeight();
+
+	F64 mdlv[16];
+	F64 proj[16];
+
+	for (U32 i = 0; i < 16; i++)
+	{
+		mdlv[i] = (F64) gGLModelView[i];
+		proj[i] = (F64) gGLProjection[i];
+	}
+
 	gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2],
-				gGLModelView, gGLProjection, (GLint*) viewport,
+				mdlv, proj, (GLint*) viewport,
 				&winX, &winY, &winZ);
 		
 	//fonts all render orthographically, set up projection``
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 3a50eeb1c98..2971ee710a0 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -4838,7 +4838,7 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**)
 	LLSelectMgr::getInstance()->highlightObjectAndFamily(objects);
 }
 
-extern LLGLdouble	gGLModelView[16];
+extern F32	gGLModelView[16];
 
 void LLSelectMgr::updateSilhouettes()
 {
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index c0ef4da1ffe..a437a8b3b53 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -218,8 +218,15 @@ void LLViewerCamera::calcProjection(const F32 far_distance) const
 void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zflip, BOOL no_hacks)
 {
 	GLint* viewport = (GLint*) gGLViewport;
-	GLdouble* model = gGLModelView;
-	GLdouble* proj = gGLProjection;
+	F64 model[16];
+	F64 proj[16];
+
+	for (U32 i = 0; i < 16; i++)
+	{
+		model[i] = (F64) gGLModelView[i];
+		proj[i] = (F64) gGLProjection[i];
+	}
+
 	GLdouble objX,objY,objZ;
 
 	LLVector3 frust[8];
@@ -420,7 +427,6 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 	if (!for_selection && mZoomFactor == 1.f)
 	{
 		// Save GL matrices for access elsewhere in code, especially project_world_to_screen
-		//glGetDoublev(GL_MODELVIEW_MATRIX, gGLModelView);
 		for (U32 i = 0; i < 16; i++)
 		{
 			gGLModelView[i] = modelview.m[i];
@@ -428,14 +434,6 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 	}
 
 	updateFrustumPlanes(*this);
-
-	/*if (gSavedSettings.getBOOL("CameraOffset"))
-	{
-		gGL.matrixMode(LLRender::MM_PROJECTION);
-		gGL.translatef(0,0,-50);
-		gGL.rotatef(20.0,1,0,0);
-		gGL.matrixMode(LLRender::MM_MODELVIEW);
-	}*/
 }
 
 
@@ -443,11 +441,20 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
 // screen coordinates to the agent's region.
 void LLViewerCamera::projectScreenToPosAgent(const S32 screen_x, const S32 screen_y, LLVector3* pos_agent) const
 {
-
 	GLdouble x, y, z;
+
+	F64 mdlv[16];
+	F64 proj[16];
+
+	for (U32 i = 0; i < 16; i++)
+	{
+		mdlv[i] = (F64) gGLModelView[i];
+		proj[i] = (F64) gGLProjection[i];
+	}
+
 	gluUnProject(
 		GLdouble(screen_x), GLdouble(screen_y), 0.0,
-		gGLModelView, gGLProjection, (GLint*)gGLViewport,
+		mdlv, proj, (GLint*)gGLViewport,
 		&x,
 		&y,
 		&z );
@@ -484,8 +491,17 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord
 	viewport[2] = world_view_rect.getWidth();
 	viewport[3] = world_view_rect.getHeight();
 
+	F64 mdlv[16];
+	F64 proj[16];
+
+	for (U32 i = 0; i < 16; i++)
+	{
+		mdlv[i] = (F64) gGLModelView[i];
+		proj[i] = (F64) gGLProjection[i];
+	}
+
 	if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ],
-								gGLModelView, gGLProjection, (GLint*)viewport,
+								mdlv, proj, (GLint*)viewport,
 								&x, &y, &z))
 	{
 		// convert screen coordinates to virtual UI coordinates
@@ -587,9 +603,19 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent,
 	viewport[2] = world_view_rect.getWidth();
 	viewport[3] = world_view_rect.getHeight();
 	GLdouble	x, y, z;			// object's window coords, GL-style
+
+	F64 mdlv[16];
+	F64 proj[16];
+
+	for (U32 i = 0; i < 16; i++)
+	{
+		mdlv[i] = (F64) gGLModelView[i];
+		proj[i] = (F64) gGLProjection[i];
+	}
+
 	if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY],
-							  pos_agent.mV[VZ], gGLModelView,
-							  gGLProjection, (GLint*)viewport,
+							  pos_agent.mV[VZ], mdlv,
+							  proj, (GLint*)viewport,
 							  &x, &y, &z))
 	{
 		x /= gViewerWindow->getDisplayScale().mV[VX];
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d28bb1f64e9..42873dbca8b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -201,13 +201,10 @@ U32 nhpo2(U32 v)
 	return r;
 }
 
-glh::matrix4f glh_copy_matrix(GLdouble* src)
+glh::matrix4f glh_copy_matrix(F32* src)
 {
 	glh::matrix4f ret;
-	for (U32 i = 0; i < 16; i++)
-	{
-		ret.m[i] = (F32) src[i];
-	}
+	ret.set_value(src);
 	return ret;
 }
 
@@ -231,7 +228,7 @@ glh::matrix4f glh_get_last_projection()
 	return glh_copy_matrix(gGLLastProjection);
 }
 
-void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst)
+void glh_copy_matrix(const glh::matrix4f& src, F32* dst)
 {
 	for (U32 i = 0; i < 16; i++)
 	{
@@ -3171,19 +3168,6 @@ void LLPipeline::postSort(LLCamera& camera)
 		
 	if (!sShadowRender)
 	{
-		//sort by texture or bump map
-		for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; ++i)
-		{
-			if (i == LLRenderPass::PASS_BUMP)
-			{
-				std::sort(sCull->beginRenderMap(i), sCull->endRenderMap(i), LLDrawInfo::CompareBump());
-			}
-			else 
-			{
-				std::sort(sCull->beginRenderMap(i), sCull->endRenderMap(i), LLDrawInfo::CompareTexturePtrMatrix());
-			}	
-		}
-
 		std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
 	}
 	llpushcallstacks ;
@@ -3503,8 +3487,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 
 	assertInitialized();
 
-	F64 saved_modelview[16];
-	F64 saved_projection[16];
+	F32 saved_modelview[16];
+	F32 saved_projection[16];
 
 	//HACK: preserve/restore matrices around HUD render
 	if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
@@ -6768,7 +6752,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 		{
 			cube_map->enable(channel);
 			cube_map->bind();
-			F64* m = gGLModelView;
+			F32* m = gGLModelView;
 
 			
 			F32 mat[] = { m[0], m[1], m[2],
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index d24bab747b4..86579261caa 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -72,7 +72,7 @@ BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn
 bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0);
 BOOL setup_hud_matrices(); // use whole screen to render hud
 BOOL setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking)
-glh::matrix4f glh_copy_matrix(GLdouble* src);
+glh::matrix4f glh_copy_matrix(F32* src);
 glh::matrix4f glh_get_current_modelview();
 void glh_set_current_modelview(const glh::matrix4f& mat);
 glh::matrix4f glh_get_current_projection();
-- 
GitLab


From 055a881084e7386620a23ae0ecdf7a8c49298742 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 7 Oct 2011 12:48:26 -0500
Subject: [PATCH 101/933] SH-2031 fix for mac/linux build

---
 indra/llrender/llrender.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index c5a68590168..c73701bbcc0 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1174,9 +1174,6 @@ void LLRender::syncMatrices()
 	{
 		llassert(shader);
 
-		bool do_normal = false;
-		bool do_mvp = false;	
-
 		bool mvp_done = false;
 
 		U32 i = MM_MODELVIEW;
-- 
GitLab


From 9cf4a4322b75a4d8fdc618c8f1edbf945c2f25b3 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 7 Oct 2011 16:45:21 -0500
Subject: [PATCH 102/933] SH-2240 No more assertions when rendering debug
 displays.

---
 indra/newview/llspatialpartition.cpp | 100 ++++++++++++++-------------
 indra/newview/llviewerjoint.cpp      |   2 +-
 2 files changed, 52 insertions(+), 50 deletions(-)

diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 65a78d90484..ffb0ce4056d 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -48,6 +48,7 @@
 #include "llvolumemgr.h"
 #include "lltextureatlas.h"
 #include "llglslshader.h"
+#include "llviewershadermgr.h"
 
 static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling");
 static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
@@ -2543,7 +2544,7 @@ void renderOctree(LLSpatialGroup* group)
 			LLGLDepthTest gl_depth(FALSE, FALSE);
 			glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 
-			gGL.color4f(1,0,0,group->mBuilt);
+			gGL.diffuseColor4f(1,0,0,group->mBuilt);
 			gGL.flush();
 			glLineWidth(5.f);
 			drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
@@ -2591,7 +2592,7 @@ void renderOctree(LLSpatialGroup* group)
 				}
 			}
 			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-			gGL.color4f(1,1,1,1);
+			gGL.diffuseColor4f(1,1,1,1);
 		}
 	}
 	else*/
@@ -2607,7 +2608,7 @@ void renderOctree(LLSpatialGroup* group)
 		}
 	}
 
-	gGL.color4fv(col.mV);
+	gGL.diffuseColor4fv(col.mV);
 	LLVector4a fudge;
 	fudge.splat(0.001f);
 	LLVector4a size = group->mObjectBounds[1];
@@ -2624,16 +2625,16 @@ void renderOctree(LLSpatialGroup* group)
 	//if (group->mBuilt <= 0.f)
 	{
 		//draw opaque outline
-		//gGL.color4f(col.mV[0], col.mV[1], col.mV[2], 1.f);
+		//gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], 1.f);
 		//drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
 
-		gGL.color4f(0,1,1,1);
+		gGL.diffuseColor4f(0,1,1,1);
 		drawBoxOutline(group->mBounds[0],group->mBounds[1]);
 		
 		//draw bounding box for draw info
 		/*if (group->mSpatialPartition->mRenderByGroup)
 		{
-			gGL.color4f(1.0f, 0.75f, 0.25f, 0.6f);
+			gGL.diffuseColor4f(1.0f, 0.75f, 0.25f, 0.6f);
 			for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
 			{
 				for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j)
@@ -2652,7 +2653,7 @@ void renderOctree(LLSpatialGroup* group)
 	}
 	
 //	LLSpatialGroup::OctreeNode* node = group->mOctreeNode;
-//	gGL.color4f(0,1,0,1);
+//	gGL.diffuseColor4f(0,1,0,1);
 //	drawBoxOutline(LLVector3(node->getCenter()), LLVector3(node->getSize()));
 }
 
@@ -2665,11 +2666,12 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 
 	BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
 							!group->getData().empty();
+
 	if (render_objects)
 	{
 		LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER);
 		gGL.diffuseColor4f(0, 0.5f, 0, 0.5f);
-		gGL.color4f(0, 0.5f, 0, 0.5f);
+		gGL.diffuseColor4f(0, 0.5f, 0, 0.5f);
 		pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
 	}
 
@@ -2679,7 +2681,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 		if (render_objects)
 		{
 			gGL.diffuseColor4f(0.f, 0.5f, 0.f,1.f);
-			gGL.color4f(0.f, 0.5f, 0.f, 1.f);
+			gGL.diffuseColor4f(0.f, 0.5f, 0.f, 1.f);
 			pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
 		}
 
@@ -2688,7 +2690,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 		if (render_objects)
 		{
 			gGL.diffuseColor4f(0.f, 0.75f, 0.f,0.5f);
-			gGL.color4f(0.f, 0.75f, 0.f, 0.5f);
+			gGL.diffuseColor4f(0.f, 0.75f, 0.f, 0.5f);
 			pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
 		}
 		/*else if (camera && group->mOcclusionVerts.notNull())
@@ -2709,7 +2711,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 
 void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color)
 {
-	gGL.color4fv(color.mV);
+	gGL.diffuseColor4fv(color.mV);
 	gGL.begin(LLRender::LINES);
 	{
 		gGL.vertex3fv((position - LLVector3(size, 0.f, 0.f)).mV);
@@ -2881,17 +2883,17 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
 	{
 		if (drawable->isSpatialBridge())
 		{
-			gGL.color4f(1,0.5f,0,1);
+			gGL.diffuseColor4f(1,0.5f,0,1);
 		}
 		else if (drawable->getVOVolume())
 		{
 			if (drawable->isRoot())
 			{
-				gGL.color4f(1,1,0,1);
+				gGL.diffuseColor4f(1,1,0,1);
 			}
 			else
 			{
-				gGL.color4f(0,1,0,1);
+				gGL.diffuseColor4f(0,1,0,1);
 			}
 		}
 		else if (drawable->getVObj())
@@ -2899,30 +2901,30 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
 			switch (drawable->getVObj()->getPCode())
 			{
 				case LLViewerObject::LL_VO_SURFACE_PATCH:
-						gGL.color4f(0,1,1,1);
+						gGL.diffuseColor4f(0,1,1,1);
 						break;
 				case LLViewerObject::LL_VO_CLOUDS:
 						// no longer used
 						break;
 				case LLViewerObject::LL_VO_PART_GROUP:
 				case LLViewerObject::LL_VO_HUD_PART_GROUP:
-						gGL.color4f(0,0,1,1);
+						gGL.diffuseColor4f(0,0,1,1);
 						break;
 				case LLViewerObject::LL_VO_VOID_WATER:
 				case LLViewerObject::LL_VO_WATER:
-						gGL.color4f(0,0.5f,1,1);
+						gGL.diffuseColor4f(0,0.5f,1,1);
 						break;
 				case LL_PCODE_LEGACY_TREE:
-						gGL.color4f(0,0.5f,0,1);
+						gGL.diffuseColor4f(0,0.5f,0,1);
 						break;
 				default:
-						gGL.color4f(1,0,1,1);
+						gGL.diffuseColor4f(1,0,1,1);
 						break;
 			}
 		}
 		else 
 		{
-			gGL.color4f(1,0,0,1);
+			gGL.diffuseColor4f(1,0,0,1);
 		}
 	}
 
@@ -2996,7 +2998,7 @@ void renderNormals(LLDrawable* drawablep)
 				n.setMul(face.mNormals[j], scale);
 				p.setAdd(face.mPositions[j], n);
 				
-				gGL.color4f(1,1,1,1);
+				gGL.diffuseColor4f(1,1,1,1);
 				gGL.vertex3fv(face.mPositions[j].getF32ptr());
 				gGL.vertex3fv(p.getF32ptr());
 				
@@ -3005,7 +3007,7 @@ void renderNormals(LLDrawable* drawablep)
 					n.setMul(face.mBinormals[j], scale);
 					p.setAdd(face.mPositions[j], n);
 				
-					gGL.color4f(0,1,1,1);
+					gGL.diffuseColor4f(0,1,1,1);
 					gGL.vertex3fv(face.mPositions[j].getF32ptr());
 					gGL.vertex3fv(p.getF32ptr());
 				}	
@@ -3063,7 +3065,7 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLCo
 	}
 	else
 	{
-		gGL.color3f(1,0,1);
+		gGL.diffuseColor3f(1,0,1);
 		drawBoxOutline(center, size);
 	}
 }
@@ -3179,7 +3181,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		}
 		else
 		{	
-			gGL.color3f(1,1,0);
+			gGL.diffuseColor3f(1,1,0);
 			drawBoxOutline(center, size);
 		}
 	}
@@ -3315,7 +3317,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		LLVector3 vscale = volume->getScale()*2.f;
 		scale.set(scale[0]/vscale[0], scale[1]/vscale[1], scale[2]/vscale[2]);
 		
-		gGL.color4fv(color.mV);
+		gGL.diffuseColor4fv(color.mV);
 		drawBox(center, scale);
 	}
 	else if	(type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE)
@@ -3385,7 +3387,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 		}
 		else
 		{
-			gGL.color3f(1,0,1);
+			gGL.diffuseColor3f(1,0,1);
 			drawBoxOutline(center, size);
 			gMeshRepo.buildHull(volume_params, detail);
 		}
@@ -3481,11 +3483,11 @@ void renderTexturePriority(LLDrawable* drawable)
 			F32 t = vsize/sLastMaxTexPriority;
 			
 			LLVector4 col = lerp(cold, hot, t);
-			gGL.color4fv(col.mV);
+			gGL.diffuseColor4fv(col.mV);
 		}
 		//else
 		//{
-		//	gGL.color4f(1,0,1,1);
+		//	gGL.diffuseColor4f(1,0,1,1);
 		//}
 		
 		LLVector4a center;
@@ -3504,7 +3506,7 @@ void renderTexturePriority(LLDrawable* drawable)
 			LLVector4 col = lerp(boost_cold, boost_hot, t);
 			LLGLEnable blend_on(GL_BLEND);
 			gGL.blendFunc(GL_SRC_ALPHA, GL_ONE);
-			gGL.color4fv(col.mV);
+			gGL.diffuseColor4fv(col.mV);
 			drawBox(center, size);
 			gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 		}*/
@@ -3517,7 +3519,7 @@ void renderPoints(LLDrawable* drawablep)
 	if (drawablep->getNumFaces())
 	{
 		gGL.begin(LLRender::POINTS);
-		gGL.color3f(1,1,1);
+		gGL.diffuseColor3f(1,1,1);
 		for (S32 i = 0; i < drawablep->getNumFaces(); i++)
 		{
 			gGL.vertex3fv(drawablep->getFace(i)->mCenterLocal.mV);
@@ -3542,7 +3544,7 @@ void renderBatchSize(LLDrawInfo* params)
 {
 	LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
 	glPolygonOffset(-1.f, 1.f);
-	glColor3ubv((GLubyte*) &(params->mDebugColor));
+	gGL.diffuseColor4ubv((GLubyte*) &(params->mDebugColor));
 	pushVerts(params, LLVertexBuffer::MAP_VERTEX);
 }
 
@@ -3611,11 +3613,11 @@ void renderLights(LLDrawable* drawablep)
 
 		{
 			LLGLDepthTest depth(GL_FALSE, GL_TRUE);
-			gGL.color4f(1,1,1,1);
+			gGL.diffuseColor4f(1,1,1,1);
 			drawBoxOutline(pos, size);
 		}
 
-		gGL.color4f(1,1,0,1);
+		gGL.diffuseColor4f(1,1,0,1);
 		F32 rad = drawablep->getVOVolume()->getLightRadius();
 		drawBoxOutline(pos, LLVector4a(rad));
 	}
@@ -3640,13 +3642,13 @@ class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
 		
 		if (branch->getData().empty())
 		{
-			gGL.color3f(1.f,0.2f,0.f);
+			gGL.diffuseColor3f(1.f,0.2f,0.f);
 			center.set(branch->getCenter().getF32ptr());
 			size.set(branch->getSize().getF32ptr());
 		}
 		else
 		{
-			gGL.color3f(0.75f, 1.f, 0.f);
+			gGL.diffuseColor3f(0.75f, 1.f, 0.f);
 			center.set(vl->mBounds[0].getF32ptr());
 			size.set(vl->mBounds[1].getF32ptr());
 		}
@@ -3659,11 +3661,11 @@ class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
 
 			if (i == 1)
 			{
-				gGL.color4f(0,1,1,0.5f);
+				gGL.diffuseColor4f(0,1,1,0.5f);
 			}
 			else
 			{
-				gGL.color4f(0,0.5f,0.5f, 0.25f);
+				gGL.diffuseColor4f(0,0.5f,0.5f, 0.25f);
 				drawBoxOutline(center, size);
 			}
 			
@@ -3700,7 +3702,7 @@ void renderRaycast(LLDrawable* drawablep)
 	if (drawablep->getNumFaces())
 	{
 		LLGLEnable blend(GL_BLEND);
-		gGL.color4f(0,1,1,0.5f);
+		gGL.diffuseColor4f(0,1,1,0.5f);
 
 		if (drawablep->getVOVolume())
 		{
@@ -3796,11 +3798,11 @@ void renderRaycast(LLDrawable* drawablep)
 			orient.getRotMatrixToParent(rotation);
 			gGL.multMatrix((float*)rotation.mMatrix);
 			
-			gGL.color4f(1,0,0,0.5f);
+			gGL.diffuseColor4f(1,0,0,0.5f);
 			drawBox(LLVector3(0, 0, 0), LLVector3(0.1f, 0.022f, 0.022f));
-			gGL.color4f(0,1,0,0.5f);
+			gGL.diffuseColor4f(0,1,0,0.5f);
 			drawBox(LLVector3(0, 0, 0), LLVector3(0.021f, 0.1f, 0.021f));
-			gGL.color4f(0,0,1,0.5f);
+			gGL.diffuseColor4f(0,0,1,0.5f);
 			drawBox(LLVector3(0, 0, 0), LLVector3(0.02f, 0.02f, 0.1f));
 			gGL.popMatrix();
 
@@ -3815,7 +3817,7 @@ void renderRaycast(LLDrawable* drawablep)
 			size.mul(0.5f);
 
 			LLGLDepthTest depth(GL_FALSE, GL_TRUE);
-			gGL.color4f(0,0.5f,0.5f,1);
+			gGL.diffuseColor4f(0,0.5f,0.5f,1);
 			drawBoxOutline(pos, size);		
 		}
 	}
@@ -3884,7 +3886,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 				stop_glerror();
 				gGLLastMatrix = NULL;
 				gGL.popMatrix();
-				gGL.color4f(1,1,1,1);
+				gGL.diffuseColor4f(1,1,1,1);
 			}
 		}
 	}
@@ -3908,7 +3910,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 		{
 			if (!group->getData().empty())
 			{
-				gGL.color3f(0,0,1);
+				gGL.diffuseColor3f(0,0,1);
 				drawBoxOutline(group->mObjectBounds[0],
 								group->mObjectBounds[1]);
 			}
@@ -3917,7 +3919,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
 		{
 			LLDrawable* drawable = *i;
-						
+					
 			if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
 			{
 				renderBoundingBox(drawable);			
@@ -3932,7 +3934,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 			{
 				if (drawable->isState(LLDrawable::IN_REBUILD_Q2))
 				{
-					gGL.color4f(0.6f, 0.6f, 0.1f, 1.f);
+					gGL.diffuseColor4f(0.6f, 0.6f, 0.1f, 1.f);
 					const LLVector4a* ext = drawable->getSpatialExtents();
 					LLVector4a center;
 					center.setAdd(ext[0], ext[1]);
@@ -4227,7 +4229,7 @@ void LLSpatialPartition::renderDebug()
 	
 	if (LLGLSLShader::sNoFixedFunction)
 	{
-		gUIProgram.bind();
+		gDebugProgram.bind();
 	}
 
 	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
@@ -4261,13 +4263,13 @@ void LLSpatialPartition::renderDebug()
 
 	if (LLGLSLShader::sNoFixedFunction)
 	{
-		gUIProgram.unbind();
+		gDebugProgram.unbind();
 	}
 }
 
 void LLSpatialGroup::drawObjectBox(LLColor4 col)
 {
-	gGL.color4fv(col.mV);
+	gGL.diffuseColor4fv(col.mV);
 	LLVector4a size;
 	size = mObjectBounds[1];
 	size.mul(1.01f);
diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp
index f2e49ff2701..a907f102f87 100644
--- a/indra/newview/llviewerjoint.cpp
+++ b/indra/newview/llviewerjoint.cpp
@@ -543,7 +543,7 @@ void LLViewerJointCollisionVolume::renderCollision()
 	gGL.pushMatrix();
 	gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] );
 
-	gGL.color3f( 0.f, 0.f, 1.f );
+	gGL.diffuseColor3f( 0.f, 0.f, 1.f );
 	
 	gGL.begin(LLRender::LINES);
 	
-- 
GitLab


From cffcb414f57bcdc7de862d791f8f9c1fea91a7fb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 7 Oct 2011 17:44:57 -0500
Subject: [PATCH 103/933] SH-2488 Fix for shiny and alpha not interacting well
 on rigged attachments (and fix for assertion when rendering model import
 preview)

---
 indra/newview/lldrawpoolavatar.cpp      | 13 +++++++++++--
 indra/newview/llfloatermodelpreview.cpp |  9 +++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index d9b0b195f5a..a710bdcdbd2 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1275,10 +1275,9 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 
 	U32 data_mask = face->getRiggedVertexBufferDataMask();
 	
-	S32 num_verts = (vol_face.mNumVertices + 0xF) & ~0xF;
 	if (buffer.isNull() || 
 		buffer->getTypeMask() != data_mask ||
-		buffer->getRequestedVerts() != num_verts ||
+		buffer->getRequestedVerts() != vol_face.mNumVertices ||
 		buffer->getRequestedIndices() != vol_face.mNumIndices ||
 		(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
 	{
@@ -1318,6 +1317,16 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 
 		LLMatrix3 mat_normal(mat3);				
 
+		//let getGeometryVolume know if alpha should override shiny
+		if (face->getFaceColor().mV[3] < 1.f)
+		{
+			face->setPoolType(LLDrawPool::POOL_ALPHA);
+		}
+		else
+		{
+			face->setPoolType(LLDrawPool::POOL_AVATAR);
+		}
+
 		face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true);
 
 		buffer->flush();
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 2a834ea11f9..d9ce72a2c24 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5409,7 +5409,16 @@ BOOL LLModelPreview::render()
 
 			if (joint_positions)
 			{
+				LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+				if (shader)
+				{
+					gDebugProgram.bind();
+				}
 				getPreviewAvatar()->renderCollisionVolumes();
+				if (shader)
+				{
+					shader->bind();
+				}
 			}
 
 			for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
-- 
GitLab


From 3211c6e3089b03d73f2e260be4037304660f834d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 11 Oct 2011 00:26:03 -0500
Subject: [PATCH 104/933] SH-2240 WIP on removing lots of string comparisons
 that were added to deal with exploding amounts of non-built-in GL state

---
 indra/llrender/llglslshader.cpp     |  26 +-
 indra/llrender/llglslshader.h       |   2 +
 indra/llrender/llrender.cpp         |  49 +--
 indra/llrender/llshadermgr.cpp      | 174 +++++++++
 indra/llrender/llshadermgr.h        | 125 +++++++
 indra/newview/llviewercontrol.cpp   |   1 +
 indra/newview/llviewerdisplay.cpp   |   1 +
 indra/newview/llviewershadermgr.cpp |  77 +---
 indra/newview/llviewershadermgr.h   |  45 ---
 indra/newview/llwlparamset.cpp      |   4 +
 indra/newview/pipeline.cpp          | 538 ++++++++++++++++++----------
 indra/newview/pipeline.h            |  74 ++++
 12 files changed, 772 insertions(+), 344 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index ddadf07d73d..bbb62ea3c17 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -320,7 +320,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
 		for (S32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedUniforms.size(); i++)
 		{
 			if ( (mUniform[i] == -1)
-				&& (LLShaderMgr::instance()->mReservedUniforms[i].compare(0, length, name, LLShaderMgr::instance()->mReservedUniforms[i].length()) == 0))
+				&& (LLShaderMgr::instance()->mReservedUniforms[i] == name))
 			{
 				//found it
 				mUniform[i] = location;
@@ -334,7 +334,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
 			for (U32 i = 0; i < uniforms->size(); i++)
 			{
 				if ( (mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] == -1)
-					&& ((*uniforms)[i].compare(0, length, name, (*uniforms)[i].length()) == 0))
+					&& ((*uniforms)[i] == name))
 				{
 					//found it
 					mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] = location;
@@ -762,8 +762,12 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_UNIFORM_LOCATION("Get Uniform Location");
+
 GLint LLGLSLShader::getUniformLocation(const string& uniform)
 {
+	LLFastTimer t(FTM_UNIFORM_LOCATION);
+
 	GLint ret = -1;
 	if (mProgramObject > 0)
 	{
@@ -783,13 +787,19 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform)
 		}
 	}
 
-	/*if (gDebugGL)
+	return ret;
+}
+
+GLint LLGLSLShader::getUniformLocation(U32 index)
+{
+	LLFastTimer t(FTM_UNIFORM_LOCATION);
+
+	GLint ret = -1;
+	if (mProgramObject > 0)
 	{
-		if (ret == -1 && ret != glGetUniformLocationARB(mProgramObject, uniform.c_str()))
-		{
-			llerrs << "Uniform map invalid." << llendl;
-		}
-	}*/
+		llassert(index < mUniform.size());
+		return mUniform[index];
+	}
 
 	return ret;
 }
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index beef57796d0..eb19599ecaa 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -114,6 +114,8 @@ class LLGLSLShader
 	void vertexAttrib4fv(U32 index, GLfloat* v);
 	
 	GLint getUniformLocation(const std::string& uniform);
+	GLint getUniformLocation(U32 index);
+
 	GLint getAttribLocation(U32 attrib);
 	GLint mapUniformTextureChannel(GLint location, GLenum type);
 	
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index c73701bbcc0..afb19fce55a 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -34,6 +34,7 @@
 #include "llimagegl.h"
 #include "llrendertarget.h"
 #include "lltexture.h"
+#include "llshadermgr.h"
 
 LLRender gGL;
 
@@ -1127,13 +1128,13 @@ void LLRender::syncLightState()
 			diffuse[i].set(light->mDiffuse.mV);
 		}
 
-		shader->uniform4fv("light_position", 8, position[0].mV);
-		shader->uniform3fv("light_direction", 8, direction[0].mV);
-		shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);
-		shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);
-		shader->uniform4fv("light_ambient", 1, mAmbientLightColor.mV);
+		shader->uniform4fv(LLShaderMgr::LIGHT_POSITION, 8, position[0].mV);
+		shader->uniform3fv(LLShaderMgr::LIGHT_DIRECTION, 8, direction[0].mV);
+		shader->uniform3fv(LLShaderMgr::LIGHT_ATTENUATION, 8, attenuation[0].mV);
+		shader->uniform3fv(LLShaderMgr::LIGHT_DIFFUSE, 8, diffuse[0].mV);
+		shader->uniform4fv(LLShaderMgr::LIGHT_AMBIENT, 1, mAmbientLightColor.mV);
 		//HACK -- duplicate sunlight color for compatibility with drivers that can't deal with multiple shader objects referencing the same uniform
-		shader->uniform4fv("sunlight_color", 1, diffuse[0].mV);
+		shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, diffuse[0].mV);
 	}
 }
 
@@ -1151,14 +1152,14 @@ void LLRender::syncMatrices()
 		GL_TEXTURE,
 	};
 
-	std::string name[] = 
+	U32 name[] = 
 	{
-		"modelview_matrix",
-		"projection_matrix",
-		"texture_matrix0",
-		"texture_matrix1",
-		"texture_matrix2",
-		"texture_matrix3",
+		LLShaderMgr::MODELVIEW_MATRIX,
+		LLShaderMgr::PROJECTION_MATRIX,
+		LLShaderMgr::TEXTURE_MATRIX0,
+		LLShaderMgr::TEXTURE_MATRIX1,
+		LLShaderMgr::TEXTURE_MATRIX2,
+		LLShaderMgr::TEXTURE_MATRIX3,
 	};
 
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
@@ -1185,7 +1186,7 @@ void LLRender::syncMatrices()
 			shader->mMatHash[i] = mMatHash[i];
 
 			//update normal matrix
-			S32 loc = shader->getUniformLocation("normal_matrix");
+			S32 loc = shader->getUniformLocation(LLShaderMgr::NORMAL_MATRIX);
 			if (loc > -1)
 			{
 				if (cached_normal_hash != mMatHash[i])
@@ -1203,12 +1204,12 @@ void LLRender::syncMatrices()
 					norm.m[8], norm.m[9], norm.m[10] 
 				};
 
-				shader->uniformMatrix3fv("normal_matrix", 1, GL_FALSE, norm_mat);
+				shader->uniformMatrix3fv(LLShaderMgr::NORMAL_MATRIX, 1, GL_FALSE, norm_mat);
 			}
 
 			//update MVP matrix
 			mvp_done = true;
-			loc = shader->getUniformLocation("modelview_projection_matrix");
+			loc = shader->getUniformLocation(LLShaderMgr::MODELVIEW_PROJECTION_MATRIX);
 			if (loc > -1)
 			{
 				U32 proj = MM_PROJECTION;
@@ -1221,7 +1222,7 @@ void LLRender::syncMatrices()
 					cached_mvp_proj_hash = mMatHash[MM_PROJECTION];
 				}
 
-				shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, cached_mvp.m);
+				shader->uniformMatrix4fv(LLShaderMgr::MODELVIEW_PROJECTION_MATRIX, 1, GL_FALSE, cached_mvp.m);
 			}
 		}
 
@@ -1237,7 +1238,7 @@ void LLRender::syncMatrices()
 			if (!mvp_done)
 			{
 				//update MVP matrix
-				S32 loc = shader->getUniformLocation("modelview_projection_matrix");
+				S32 loc = shader->getUniformLocation(LLShaderMgr::MODELVIEW_PROJECTION_MATRIX);
 				if (loc > -1)
 				{
 					if (cached_mvp_mdv_hash != mMatHash[i] || cached_mvp_proj_hash != mMatHash[MM_PROJECTION])
@@ -1249,7 +1250,7 @@ void LLRender::syncMatrices()
 						cached_mvp_proj_hash = mMatHash[MM_PROJECTION];
 					}
 									
-					shader->uniformMatrix4fv("modelview_projection_matrix", 1, GL_FALSE, cached_mvp.m);
+					shader->uniformMatrix4fv(LLShaderMgr::MODELVIEW_PROJECTION_MATRIX, 1, GL_FALSE, cached_mvp.m);
 				}
 			}
 		}
@@ -2176,7 +2177,7 @@ void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
 
 	if (shader)
 	{
-		shader->uniform4f("color", r,g,b,1.f);
+		shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r,g,b,1.f);
 	}
 	else
 	{
@@ -2191,7 +2192,7 @@ void LLRender::diffuseColor3fv(const F32* c)
 
 	if (shader)
 	{
-		shader->uniform4f("color", c[0], c[1], c[2], 1.f);
+		shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, c[0], c[1], c[2], 1.f);
 	}
 	else
 	{
@@ -2206,7 +2207,7 @@ void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
 
 	if (shader)
 	{
-		shader->uniform4f("color", r,g,b,a);
+		shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r,g,b,a);
 	}
 	else
 	{
@@ -2221,7 +2222,7 @@ void LLRender::diffuseColor4fv(const F32* c)
 
 	if (shader)
 	{
-		shader->uniform4fv("color", 1, c);
+		shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, c);
 	}
 	else
 	{
@@ -2236,7 +2237,7 @@ void LLRender::diffuseColor4ubv(const U8* c)
 
 	if (shader)
 	{
-		shader->uniform4f("color", c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f);
+		shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f);
 	}
 	else
 	{
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 16180c68312..0a99c66d09a 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -897,3 +897,177 @@ BOOL LLShaderMgr::validateProgramObject(GLhandleARB obj)
 	return success;
 }
 
+//virtual
+void LLShaderMgr::initAttribsAndUniforms()
+{
+	//MUST match order of enum in LLVertexBuffer.h
+	mReservedAttribs.push_back("position");
+	mReservedAttribs.push_back("normal");
+	mReservedAttribs.push_back("texcoord0");
+	mReservedAttribs.push_back("texcoord1");
+	mReservedAttribs.push_back("texcoord2");
+	mReservedAttribs.push_back("texcoord3");
+	mReservedAttribs.push_back("diffuse_color");
+	mReservedAttribs.push_back("emissive");
+	mReservedAttribs.push_back("binormal");
+	mReservedAttribs.push_back("weight");
+	mReservedAttribs.push_back("weight4");
+	mReservedAttribs.push_back("clothing");
+	mReservedAttribs.push_back("texture_index");
+	
+	//matrix state
+	mReservedUniforms.push_back("modelview_matrix");
+	mReservedUniforms.push_back("projection_matrix");
+	mReservedUniforms.push_back("inv_proj");
+	mReservedUniforms.push_back("modelview_projection_matrix");
+	mReservedUniforms.push_back("normal_matrix");
+	mReservedUniforms.push_back("texture_matrix0");
+	mReservedUniforms.push_back("texture_matrix1");
+	mReservedUniforms.push_back("texture_matrix2");
+	mReservedUniforms.push_back("texture_matrix3");
+	llassert(mReservedUniforms.size() == LLShaderMgr::TEXTURE_MATRIX3+1);
+
+	mReservedUniforms.push_back("viewport");
+
+	mReservedUniforms.push_back("light_position");
+	mReservedUniforms.push_back("light_direction");
+	mReservedUniforms.push_back("light_attenuation");
+	mReservedUniforms.push_back("light_diffuse");
+	mReservedUniforms.push_back("light_ambient");
+	mReservedUniforms.push_back("light_count");
+	mReservedUniforms.push_back("light");
+	mReservedUniforms.push_back("light_col");
+	mReservedUniforms.push_back("far_z");
+
+	llassert(mReservedUniforms.size() == LLShaderMgr::MULTI_LIGHT_FAR_Z+1);
+
+
+	mReservedUniforms.push_back("proj_mat");
+	mReservedUniforms.push_back("proj_near");
+	mReservedUniforms.push_back("proj_p");
+	mReservedUniforms.push_back("proj_n");
+	mReservedUniforms.push_back("proj_origin");
+	mReservedUniforms.push_back("proj_range");
+	mReservedUniforms.push_back("proj_ambiance");
+	mReservedUniforms.push_back("proj_shadow_idx");
+	mReservedUniforms.push_back("shadow_fade");
+	mReservedUniforms.push_back("proj_focus");
+	mReservedUniforms.push_back("proj_lod");
+	mReservedUniforms.push_back("proj_ambient_lod");
+
+	llassert(mReservedUniforms.size() == LLShaderMgr::PROJECTOR_AMBIENT_LOD+1);
+
+	mReservedUniforms.push_back("color");
+	mReservedUniforms.push_back("highlight_color");
+	
+	mReservedUniforms.push_back("diffuseMap");
+	mReservedUniforms.push_back("specularMap");
+	mReservedUniforms.push_back("bumpMap");
+	mReservedUniforms.push_back("environmentMap");
+	mReservedUniforms.push_back("cloude_noise_texture");
+	mReservedUniforms.push_back("fullbright");
+	mReservedUniforms.push_back("lightnorm");
+	mReservedUniforms.push_back("sunlight_color");
+	mReservedUniforms.push_back("ambient");
+	mReservedUniforms.push_back("blue_horizon");
+	mReservedUniforms.push_back("blue_density");
+	mReservedUniforms.push_back("haze_horizon");
+	mReservedUniforms.push_back("haze_density");
+	mReservedUniforms.push_back("cloud_shadow");
+	mReservedUniforms.push_back("density_multiplier");
+	mReservedUniforms.push_back("distance_multiplier");
+	mReservedUniforms.push_back("max_y");
+	mReservedUniforms.push_back("glow");
+	mReservedUniforms.push_back("cloud_color");
+	mReservedUniforms.push_back("cloud_pos_density1");
+	mReservedUniforms.push_back("cloud_pos_density2");
+	mReservedUniforms.push_back("cloud_scale");
+	mReservedUniforms.push_back("gamma");
+	mReservedUniforms.push_back("scene_light_strength");
+
+	llassert(mReservedUniforms.size() == LLShaderMgr::SCENE_LIGHT_STRENGTH+1);
+
+	mReservedUniforms.push_back("center");
+	mReservedUniforms.push_back("size");
+	mReservedUniforms.push_back("falloff");
+
+
+	mReservedUniforms.push_back("minLuminance");
+	mReservedUniforms.push_back("maxExtractAlpha");
+	mReservedUniforms.push_back("lumWeights");
+	mReservedUniforms.push_back("warmthWeights");
+	mReservedUniforms.push_back("warmthAmount");
+	mReservedUniforms.push_back("glowStrength");
+	mReservedUniforms.push_back("glowDelta");
+
+	llassert(mReservedUniforms.size() == LLShaderMgr::GLOW_DELTA+1);
+
+	mReservedUniforms.push_back("shadow_matrix");
+	mReservedUniforms.push_back("env_mat");
+	mReservedUniforms.push_back("shadow_clip");
+	mReservedUniforms.push_back("sun_wash");
+	mReservedUniforms.push_back("shadow_noise");
+	mReservedUniforms.push_back("blur_size");
+	mReservedUniforms.push_back("ssao_radius");
+	mReservedUniforms.push_back("ssao_max_radius");
+	mReservedUniforms.push_back("ssao_factor");
+	mReservedUniforms.push_back("ssao_factor_inv");
+	mReservedUniforms.push_back("ssao_effect_mat");
+	mReservedUniforms.push_back("screen_res");
+	mReservedUniforms.push_back("near_clip");
+	mReservedUniforms.push_back("shadow_offset");
+	mReservedUniforms.push_back("shadow_bias");
+	mReservedUniforms.push_back("spot_shadow_bias");
+	mReservedUniforms.push_back("spot_shadow_offset");
+	mReservedUniforms.push_back("sun_dir");
+	mReservedUniforms.push_back("shadow_res");
+	mReservedUniforms.push_back("proj_shadow_res");
+	mReservedUniforms.push_back("depth_cutoff");
+	mReservedUniforms.push_back("norm_cutoff");
+	
+	llassert(mReservedUniforms.size() == LLShaderMgr::DEFERRED_NORM_CUTOFF+1);
+
+	mReservedUniforms.push_back("tc_scale");
+	mReservedUniforms.push_back("rcp_screen_res");
+	mReservedUniforms.push_back("rcp_frame_opt");
+	mReservedUniforms.push_back("rcp_frame_opt2");
+	
+	mReservedUniforms.push_back("focal_distance");
+	mReservedUniforms.push_back("blur_constant");
+	mReservedUniforms.push_back("tan_pixel_angle");
+	mReservedUniforms.push_back("magnification");
+
+	mReservedUniforms.push_back("depthMap");
+	mReservedUniforms.push_back("shadowMap0");
+	mReservedUniforms.push_back("shadowMap1");
+	mReservedUniforms.push_back("shadowMap2");
+	mReservedUniforms.push_back("shadowMap3");
+	mReservedUniforms.push_back("shadowMap4");
+	mReservedUniforms.push_back("shadowMap5");
+
+	llassert(mReservedUniforms.size() == LLShaderMgr::DEFERRED_SHADOW5+1);
+
+	mReservedUniforms.push_back("normalMap");
+	mReservedUniforms.push_back("positionMap");
+	mReservedUniforms.push_back("diffuseRect");
+	mReservedUniforms.push_back("specularRect");
+	mReservedUniforms.push_back("noiseMap");
+	mReservedUniforms.push_back("lightFunc");
+	mReservedUniforms.push_back("lightMap");
+	mReservedUniforms.push_back("bloomMap");
+	mReservedUniforms.push_back("projectionMap");
+
+	llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS);
+
+	std::set<std::string> dupe_check;
+
+	for (U32 i = 0; i < mReservedUniforms.size(); ++i)
+	{
+		if (dupe_check.find(mReservedUniforms[i]) != dupe_check.end())
+		{
+			llerrs << "Duplicate reserved uniform name found: " << mReservedUniforms[i] << llendl;
+		}
+		dupe_check.insert(mReservedUniforms[i]);
+	}
+}
+
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 2f301038112..9cc2f1bd7f9 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -36,9 +36,134 @@ class LLShaderMgr
 	LLShaderMgr();
 	virtual ~LLShaderMgr();
 
+	typedef enum
+	{
+		MODELVIEW_MATRIX = 0,
+		PROJECTION_MATRIX,
+		INVERSE_PROJECTION_MATRIX,
+		MODELVIEW_PROJECTION_MATRIX,
+		NORMAL_MATRIX,
+		TEXTURE_MATRIX0,
+		TEXTURE_MATRIX1,
+		TEXTURE_MATRIX2,
+		TEXTURE_MATRIX3,
+		VIEWPORT,
+		LIGHT_POSITION,
+		LIGHT_DIRECTION,
+		LIGHT_ATTENUATION,
+		LIGHT_DIFFUSE,
+		LIGHT_AMBIENT,
+		MULTI_LIGHT_COUNT,
+		MULTI_LIGHT,
+		MULTI_LIGHT_COL,
+		MULTI_LIGHT_FAR_Z,
+		PROJECTOR_MATRIX,
+		PROJECTOR_NEAR,
+		PROJECTOR_P,
+		PROJECTOR_N,
+		PROJECTOR_ORIGIN,
+		PROJECTOR_RANGE,
+		PROJECTOR_AMBIANCE,
+		PROJECTOR_SHADOW_INDEX,
+		PROJECTOR_SHADOW_FADE,
+		PROJECTOR_FOCUS,
+		PROJECTOR_LOD,
+		PROJECTOR_AMBIENT_LOD,
+		DIFFUSE_COLOR,
+		HIGHLIGHT_COLOR,
+		DIFFUSE_MAP,
+		SPECULAR_MAP,
+		BUMP_MAP,
+		ENVIRONMENT_MAP,
+		CLOUD_NOISE_MAP,
+		FULLBRIGHT,
+		LIGHTNORM,
+		SUNLIGHT_COLOR,
+		AMBIENT,
+		BLUE_HORIZON,
+		BLUE_DENSITY,
+		HAZE_HORIZON,
+		HAZE_DENSITY,
+		CLOUD_SHADOW,
+		DENSITY_MULTIPLIER,
+		DISTANCE_MULTIPLIER,
+		MAX_Y,
+		GLOW,
+		CLOUD_COLOR,
+		CLOUD_POS_DENSITY1,
+		CLOUD_POS_DENSITY2,
+		CLOUD_SCALE,
+		GAMMA,
+		SCENE_LIGHT_STRENGTH,
+		LIGHT_CENTER,
+		LIGHT_SIZE,
+		LIGHT_FALLOFF,
+
+		GLOW_MIN_LUMINANCE,
+		GLOW_MAX_EXTRACT_ALPHA,
+		GLOW_LUM_WEIGHTS,
+		GLOW_WARMTH_WEIGHTS,
+		GLOW_WARMTH_AMOUNT,
+		GLOW_STRENGTH,
+		GLOW_DELTA,
+
+		DEFERRED_SHADOW_MATRIX,
+		DEFERRED_ENV_MAT,
+		DEFERRED_SHADOW_CLIP,
+		DEFERRED_SUN_WASH,
+		DEFERRED_SHADOW_NOISE,
+		DEFERRED_BLUR_SIZE,
+		DEFERRED_SSAO_RADIUS,
+		DEFERRED_SSAO_MAX_RADIUS,
+		DEFERRED_SSAO_FACTOR,
+		DEFERRED_SSAO_FACTOR_INV,
+		DEFERRED_SSAO_EFFECT_MAT,
+		DEFERRED_SCREEN_RES,
+		DEFERRED_NEAR_CLIP,
+		DEFERRED_SHADOW_OFFSET,
+		DEFERRED_SHADOW_BIAS,
+		DEFERRED_SPOT_SHADOW_BIAS,
+		DEFERRED_SPOT_SHADOW_OFFSET,
+		DEFERRED_SUN_DIR,
+		DEFERRED_SHADOW_RES,
+		DEFERRED_PROJ_SHADOW_RES,
+		DEFERRED_DEPTH_CUTOFF,
+		DEFERRED_NORM_CUTOFF,
+
+		FXAA_TC_SCALE,
+		FXAA_RCP_SCREEN_RES,
+		FXAA_RCP_FRAME_OPT,
+		FXAA_RCP_FRAME_OPT2,
+
+		DOF_FOCAL_DISTANCE,
+		DOF_BLUR_CONSTANT,
+		DOF_TAN_PIXEL_ANGLE,
+		DOF_MAGNIFICATION,
+
+		DEFERRED_DEPTH,
+		DEFERRED_SHADOW0,
+		DEFERRED_SHADOW1,
+		DEFERRED_SHADOW2,
+		DEFERRED_SHADOW3,
+		DEFERRED_SHADOW4,
+		DEFERRED_SHADOW5,
+		DEFERRED_NORMAL,
+		DEFERRED_POSITION,
+		DEFERRED_DIFFUSE,
+		DEFERRED_SPECULAR,
+		DEFERRED_NOISE,
+		DEFERRED_LIGHTFUNC,
+		DEFERRED_LIGHT,
+		DEFERRED_BLOOM,
+		DEFERRED_PROJECTION,
+		END_RESERVED_UNIFORMS
+	} eGLSLReservedUniforms;
+
 	// singleton pattern implementation
 	static LLShaderMgr * instance();
 
+	virtual void initAttribsAndUniforms(void);
+
 	BOOL attachShaderFeatures(LLGLSLShader * shader);
 	void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE);
 	BOOL	linkProgramObject(GLhandleARB obj, BOOL suppress_errors = FALSE);
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 5b178f82d8f..3692da64fc6 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -388,6 +388,7 @@ static bool handleRenderDeferredChanged(const LLSD& newvalue)
 	LLRenderTarget::sUseFBO = newvalue.asBoolean();
 	if (gPipeline.isInit())
 	{
+		LLPipeline::refreshCachedSettings();
 		gPipeline.updateRenderDeferred();
 		gPipeline.releaseGLBuffers();
 		gPipeline.createGLBuffers();
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 7220f2a20fd..1832416a4b8 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -862,6 +862,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//	gGL.popMatrix();
 		//}
 
+		LLPipeline::refreshCachedSettings();
 		LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
 		LLPipeline::refreshRenderDeferred();
 		
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index ac489e0caf5..8bc573135c4 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -195,6 +195,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mMaxAvatarShaderLevel(0)
 {	
 	/// Make sure WL Sky is the first program
+	//ONLY shaders that need WL Param management should be added here
 	mShaderList.push_back(&gWLSkyProgram);
 	mShaderList.push_back(&gWLCloudProgram);
 	mShaderList.push_back(&gAvatarProgram);
@@ -209,16 +210,6 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gObjectFullbrightNoColorWaterProgram);
 	mShaderList.push_back(&gObjectSimpleAlphaMaskProgram);
 	mShaderList.push_back(&gObjectBumpProgram);
-	mShaderList.push_back(&gUIProgram);
-	mShaderList.push_back(&gCustomAlphaProgram);
-	mShaderList.push_back(&gGlowCombineProgram);
-	mShaderList.push_back(&gGlowCombineFXAAProgram);
-	mShaderList.push_back(&gTwoTextureAddProgram);
-	mShaderList.push_back(&gOneTextureNoColorProgram);
-	mShaderList.push_back(&gSolidColorProgram);
-	mShaderList.push_back(&gOcclusionProgram);
-	mShaderList.push_back(&gDebugProgram);
-	mShaderList.push_back(&gAlphaMaskProgram);
 	mShaderList.push_back(&gObjectEmissiveProgram);
 	mShaderList.push_back(&gObjectEmissiveWaterProgram);
 	mShaderList.push_back(&gObjectFullbrightProgram);
@@ -260,23 +251,16 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gObjectShinyNonIndexedWaterProgram);
 	mShaderList.push_back(&gUnderWaterProgram);
 	mShaderList.push_back(&gDeferredSunProgram);
-	mShaderList.push_back(&gDeferredBlurLightProgram);
 	mShaderList.push_back(&gDeferredSoftenProgram);
-	mShaderList.push_back(&gDeferredLightProgram);
-	mShaderList.push_back(&gDeferredMultiLightProgram);
 	mShaderList.push_back(&gDeferredAlphaProgram);
 	mShaderList.push_back(&gDeferredSkinnedAlphaProgram);
 	mShaderList.push_back(&gDeferredFullbrightProgram);
 	mShaderList.push_back(&gDeferredEmissiveProgram);
 	mShaderList.push_back(&gDeferredAvatarEyesProgram);
-	mShaderList.push_back(&gDeferredPostProgram);
-	mShaderList.push_back(&gFXAAProgram);
 	mShaderList.push_back(&gDeferredWaterProgram);
 	mShaderList.push_back(&gDeferredAvatarAlphaProgram);
 	mShaderList.push_back(&gDeferredWLSkyProgram);
 	mShaderList.push_back(&gDeferredWLCloudProgram);
-	mShaderList.push_back(&gDeferredStarProgram);
-	mShaderList.push_back(&gNormalMapGenProgram);
 }
 
 LLViewerShaderMgr::~LLViewerShaderMgr()
@@ -300,70 +284,13 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void)
 {
 	if (mReservedAttribs.empty())
 	{
-		//MUST match order of enum in LLVertexBuffer.h
-		mReservedAttribs.push_back("position");
-		mReservedAttribs.push_back("normal");
-		mReservedAttribs.push_back("texcoord0");
-		mReservedAttribs.push_back("texcoord1");
-		mReservedAttribs.push_back("texcoord2");
-		mReservedAttribs.push_back("texcoord3");
-		mReservedAttribs.push_back("diffuse_color");
-		mReservedAttribs.push_back("emissive");
-		mReservedAttribs.push_back("binormal");
-		mReservedAttribs.push_back("weight");
-		mReservedAttribs.push_back("weight4");
-		mReservedAttribs.push_back("clothing");
-		mReservedAttribs.push_back("texture_index");
+		LLShaderMgr::initAttribsAndUniforms();
 
 		mAvatarUniforms.push_back("matrixPalette");
 		mAvatarUniforms.push_back("gWindDir");
 		mAvatarUniforms.push_back("gSinWaveParams");
 		mAvatarUniforms.push_back("gGravity");
 
-		mReservedUniforms.reserve(24);
-		mReservedUniforms.push_back("diffuseMap");
-		mReservedUniforms.push_back("specularMap");
-		mReservedUniforms.push_back("bumpMap");
-		mReservedUniforms.push_back("environmentMap");
-		mReservedUniforms.push_back("cloude_noise_texture");
-		mReservedUniforms.push_back("fullbright");
-		mReservedUniforms.push_back("lightnorm");
-		mReservedUniforms.push_back("sunlight_color");
-		mReservedUniforms.push_back("ambient");
-		mReservedUniforms.push_back("blue_horizon");
-		mReservedUniforms.push_back("blue_density");
-		mReservedUniforms.push_back("haze_horizon");
-		mReservedUniforms.push_back("haze_density");
-		mReservedUniforms.push_back("cloud_shadow");
-		mReservedUniforms.push_back("density_multiplier");
-		mReservedUniforms.push_back("distance_multiplier");
-		mReservedUniforms.push_back("max_y");
-		mReservedUniforms.push_back("glow");
-		mReservedUniforms.push_back("cloud_color");
-		mReservedUniforms.push_back("cloud_pos_density1");
-		mReservedUniforms.push_back("cloud_pos_density2");
-		mReservedUniforms.push_back("cloud_scale");
-		mReservedUniforms.push_back("gamma");
-		mReservedUniforms.push_back("scene_light_strength");
-
-		mReservedUniforms.push_back("depthMap");
-		mReservedUniforms.push_back("shadowMap0");
-		mReservedUniforms.push_back("shadowMap1");
-		mReservedUniforms.push_back("shadowMap2");
-		mReservedUniforms.push_back("shadowMap3");
-		mReservedUniforms.push_back("shadowMap4");
-		mReservedUniforms.push_back("shadowMap5");
-
-		mReservedUniforms.push_back("normalMap");
-		mReservedUniforms.push_back("positionMap");
-		mReservedUniforms.push_back("diffuseRect");
-		mReservedUniforms.push_back("specularRect");
-		mReservedUniforms.push_back("noiseMap");
-		mReservedUniforms.push_back("lightFunc");
-		mReservedUniforms.push_back("lightMap");
-		mReservedUniforms.push_back("bloomMap");
-		mReservedUniforms.push_back("projectionMap");
-
 		mWLUniforms.push_back("camPosLocal");
 
 		mTerrainUniforms.reserve(5);
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 5bcdf11be5b..01f8c3987cd 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -71,51 +71,6 @@ class LLViewerShaderMgr: public LLShaderMgr
 		SHADER_COUNT
 	};
 
-	typedef enum
-	{
-		DIFFUSE_MAP = 0,
-		SPECULAR_MAP,
-		BUMP_MAP,
-		ENVIRONMENT_MAP,
-		CLOUD_NOISE_MAP,
-		FULLBRIGHT,
-		LIGHTNORM,
-		SUNLIGHT_COLOR,
-		AMBIENT,
-		BLUE_HORIZON,
-		BLUE_DENSITY,
-		HAZE_HORIZON,
-		HAZE_DENSITY,
-		CLOUD_SHADOW,
-		DENSITY_MULTIPLIER,
-		DISTANCE_MULTIPLIER,
-		MAX_Y,
-		GLOW,
-		CLOUD_COLOR,
-		CLOUD_POS_DENSITY1,
-		CLOUD_POS_DENSITY2,
-		CLOUD_SCALE,
-		GAMMA,
-		SCENE_LIGHT_STRENGTH,
-		DEFERRED_DEPTH,
-		DEFERRED_SHADOW0,
-		DEFERRED_SHADOW1,
-		DEFERRED_SHADOW2,
-		DEFERRED_SHADOW3,
-		DEFERRED_SHADOW4,
-		DEFERRED_SHADOW5,
-		DEFERRED_NORMAL,
-		DEFERRED_POSITION,
-		DEFERRED_DIFFUSE,
-		DEFERRED_SPECULAR,
-		DEFERRED_NOISE,
-		DEFERRED_LIGHTFUNC,
-		DEFERRED_LIGHT,
-		DEFERRED_BLOOM,
-		DEFERRED_PROJECTION,
-		END_RESERVED_UNIFORMS
-	} eGLSLReservedUniforms;
-
 	typedef enum
 	{
 		SHINY_ORIGIN = END_RESERVED_UNIFORMS
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 22fba90f65b..4a1db3d26cf 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -69,12 +69,16 @@ LLWLParamSet::LLWLParamSet(void) :
 */
 }
 
+static LLFastTimer::DeclareTimer FTM_WL_PARAM_UPDATE("WL Param Update");
+
 void LLWLParamSet::update(LLGLSLShader * shader) const 
 {	
 	for(LLSD::map_const_iterator i = mParamValues.beginMap();
 		i != mParamValues.endMap();
 		++i)
 	{
+		LLFastTimer t(FTM_WL_PARAM_UPDATE);
+
 		const std::string& param = i->first;
 		
 		if(	param == "star_brightness" || param == "preset_num" || param == "sun_angle" ||
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 42873dbca8b..e4125c8dc86 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -113,6 +113,79 @@
 //#define DEBUG_INDICES
 #endif
 
+//cached settings
+BOOL LLPipeline::RenderAvatarVP;
+BOOL LLPipeline::VertexShaderEnable;
+BOOL LLPipeline::WindLightUseAtmosShaders;
+BOOL LLPipeline::RenderDeferred;
+F32 LLPipeline::RenderDeferredSunWash;
+U32 LLPipeline::RenderFSAASamples;
+U32 LLPipeline::RenderResolutionDivisor;
+BOOL LLPipeline::RenderUIBuffer;
+S32 LLPipeline::RenderShadowDetail;
+BOOL LLPipeline::RenderDeferredSSAO;
+F32 LLPipeline::RenderShadowResolutionScale;
+BOOL LLPipeline::RenderLocalLights;
+BOOL LLPipeline::RenderDelayCreation;
+BOOL LLPipeline::RenderAnimateRes;
+BOOL LLPipeline::FreezeTime;
+S32 LLPipeline::DebugBeaconLineWidth;
+F32 LLPipeline::RenderHighlightBrightness;
+LLColor4 LLPipeline::RenderHighlightColor;
+F32 LLPipeline::RenderHighlightThickness;
+BOOL LLPipeline::RenderSpotLightsInNondeferred;
+LLColor4 LLPipeline::PreviewAmbientColor;
+LLColor4 LLPipeline::PreviewDiffuse0;
+LLColor4 LLPipeline::PreviewSpecular0;
+LLColor4 LLPipeline::PreviewDiffuse1;
+LLColor4 LLPipeline::PreviewSpecular1;
+LLColor4 LLPipeline::PreviewDiffuse2;
+LLColor4 LLPipeline::PreviewSpecular2;
+LLVector3 LLPipeline::PreviewDirection0;
+LLVector3 LLPipeline::PreviewDirection1;
+LLVector3 LLPipeline::PreviewDirection2;
+F32 LLPipeline::RenderGlowMinLuminance;
+F32 LLPipeline::RenderGlowMaxExtractAlpha;
+F32 LLPipeline::RenderGlowWarmthAmount;
+LLVector3 LLPipeline::RenderGlowLumWeights;
+LLVector3 LLPipeline::RenderGlowWarmthWeights;
+S32 LLPipeline::RenderGlowResolutionPow;
+S32 LLPipeline::RenderGlowIterations;
+F32 LLPipeline::RenderGlowWidth;
+F32 LLPipeline::RenderGlowStrength;
+BOOL LLPipeline::RenderDepthOfField;
+F32 LLPipeline::CameraFocusTransitionTime;
+F32 LLPipeline::CameraFNumber;
+F32 LLPipeline::CameraFocalLength;
+F32 LLPipeline::CameraFieldOfView;
+F32 LLPipeline::RenderShadowNoise;
+F32 LLPipeline::RenderShadowBlurSize;
+F32 LLPipeline::RenderSSAOScale;
+U32 LLPipeline::RenderSSAOMaxScale;
+F32 LLPipeline::RenderSSAOFactor;
+LLVector3 LLPipeline::RenderSSAOEffect;
+F32 LLPipeline::RenderShadowOffsetError;
+F32 LLPipeline::RenderShadowBiasError;
+F32 LLPipeline::RenderShadowOffset;
+F32 LLPipeline::RenderShadowBias;
+F32 LLPipeline::RenderSpotShadowOffset;
+F32 LLPipeline::RenderSpotShadowBias;
+F32 LLPipeline::RenderEdgeDepthCutoff;
+F32 LLPipeline::RenderEdgeNormCutoff;
+LLVector3 LLPipeline::RenderShadowGaussian;
+F32 LLPipeline::RenderShadowBlurDistFactor;
+BOOL LLPipeline::RenderDeferredAtmospheric;
+S32 LLPipeline::RenderReflectionDetail;
+F32 LLPipeline::RenderHighlightFadeTime;
+LLVector3 LLPipeline::RenderShadowClipPlanes;
+LLVector3 LLPipeline::RenderShadowOrthoClipPlanes;
+LLVector3 LLPipeline::RenderShadowNearDist;
+F32 LLPipeline::RenderFarClip;
+LLVector3 LLPipeline::RenderShadowSplitExponent;
+F32 LLPipeline::RenderShadowErrorCutoff;
+F32 LLPipeline::RenderShadowFOVCutoff;
+BOOL LLPipeline::CameraOffset;
+
 const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f;
 const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f;
 const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f;
@@ -371,6 +444,8 @@ void LLPipeline::init()
 {
 	LLMemType mt(LLMemType::MTYPE_PIPELINE_INIT);
 
+	refreshCachedSettings();
+
 	gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
 	sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD");
 	sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
@@ -588,7 +663,7 @@ void LLPipeline::allocatePhysicsBuffer()
 
 void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 {
-	U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples"));
+	U32 samples = gGLManager.getNumFBOFSAASamples(RenderFSAASamples);
 
 	//try to allocate screen buffers at requested resolution and samples
 	// - on failure, shrink number of samples and try again
@@ -638,7 +713,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 	mScreenWidth = resX;
 	mScreenHeight = resY;
 	
-	U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor");
+	U32 res_mod = RenderResolutionDivisor;
 
 	if (res_mod > 1 && res_mod < resX && res_mod < resY)
 	{
@@ -646,7 +721,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 		resY /= res_mod;
 	}
 
-	if (gSavedSettings.getBOOL("RenderUIBuffer"))
+	if (RenderUIBuffer)
 	{
 		if (!mUIScreen.allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE))
 		{
@@ -656,8 +731,8 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 
 	if (LLPipeline::sRenderDeferred)
 	{
-		S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
-		BOOL ssao = gSavedSettings.getBOOL("RenderDeferredSSAO");
+		S32 shadow_detail = RenderShadowDetail;
+		BOOL ssao = RenderDeferredSSAO;
 		
 		//allocate deferred rendering color buffers
 		if (!mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
@@ -683,7 +758,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 			mDeferredLight.release();
 		}
 
-		F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale");
+		F32 scale = RenderShadowResolutionScale;
 
 		if (shadow_detail > 0)
 		{ //allocate 4 sun shadow maps
@@ -749,12 +824,12 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 //static
 void LLPipeline::updateRenderDeferred()
 {
-	BOOL deferred = ((gSavedSettings.getBOOL("RenderDeferred") && 
+	BOOL deferred = ((RenderDeferred && 
 					 LLRenderTarget::sUseFBO &&
-					 LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
-					 gSavedSettings.getBOOL("VertexShaderEnable") && 
-					 gSavedSettings.getBOOL("RenderAvatarVP") &&
-					 gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) &&
+					 LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&	 
+					 VertexShaderEnable && 
+					 RenderAvatarVP &&
+					 WindLightUseAtmosShaders) ? TRUE : FALSE) &&
 					!gUseWireframe;
 
 	sRenderDeferred = deferred;	
@@ -770,6 +845,82 @@ void LLPipeline::refreshRenderDeferred()
 	updateRenderDeferred();
 }
 
+//static
+void LLPipeline::refreshCachedSettings()
+{
+	VertexShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable");
+	RenderAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP");
+	WindLightUseAtmosShaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
+	RenderDeferred = gSavedSettings.getBOOL("RenderDeferred");
+	RenderDeferredSunWash = gSavedSettings.getF32("RenderDeferredSunWash");
+	RenderFSAASamples = gSavedSettings.getU32("RenderFSAASamples");
+	RenderResolutionDivisor = gSavedSettings.getU32("RenderResolutionDivisor");
+	RenderUIBuffer = gSavedSettings.getBOOL("RenderUIBuffer");
+	RenderShadowDetail = gSavedSettings.getS32("RenderShadowDetail");
+	RenderDeferredSSAO = gSavedSettings.getBOOL("RenderDeferredSSAO");
+	RenderShadowResolutionScale = gSavedSettings.getF32("RenderShadowResolutionScale");
+	RenderLocalLights = gSavedSettings.getBOOL("RenderLocalLights");
+	RenderDelayCreation = gSavedSettings.getBOOL("RenderDelayCreation");
+	RenderAnimateRes = gSavedSettings.getBOOL("RenderAnimateRes");
+	FreezeTime = gSavedSettings.getBOOL("FreezeTime");
+	DebugBeaconLineWidth = gSavedSettings.getS32("DebugBeaconLineWidth");
+	RenderHighlightBrightness = gSavedSettings.getF32("RenderHighlightBrightness");
+	RenderHighlightColor = gSavedSettings.getColor4("RenderHighlightColor");
+	RenderHighlightThickness = gSavedSettings.getF32("RenderHighlightThickness");
+	RenderSpotLightsInNondeferred = gSavedSettings.getBOOL("RenderSpotLightsInNondeferred");
+	PreviewAmbientColor = gSavedSettings.getColor4("PreviewAmbientColor");
+	PreviewDiffuse0 = gSavedSettings.getColor4("PreviewDiffuse0");
+	PreviewSpecular0 = gSavedSettings.getColor4("PreviewSpecular0");
+	PreviewDiffuse1 = gSavedSettings.getColor4("PreviewDiffuse1");
+	PreviewSpecular1 = gSavedSettings.getColor4("PreviewSpecular1");
+	PreviewDiffuse2 = gSavedSettings.getColor4("PreviewDiffuse2");
+	PreviewSpecular2 = gSavedSettings.getColor4("PreviewSpecular2");
+	PreviewDirection0 = gSavedSettings.getVector3("PreviewDirection0");
+	PreviewDirection1 = gSavedSettings.getVector3("PreviewDirection1");
+	PreviewDirection2 = gSavedSettings.getVector3("PreviewDirection2");
+	RenderGlowMinLuminance = gSavedSettings.getF32("RenderGlowMinLuminance");
+	RenderGlowMaxExtractAlpha = gSavedSettings.getF32("RenderGlowMaxExtractAlpha");
+	RenderGlowWarmthAmount = gSavedSettings.getF32("RenderGlowWarmthAmount");
+	RenderGlowLumWeights = gSavedSettings.getVector3("RenderGlowLumWeights");
+	RenderGlowWarmthWeights = gSavedSettings.getVector3("RenderGlowWarmthWeights");
+	RenderGlowResolutionPow = gSavedSettings.getS32("RenderGlowResolutionPow");
+	RenderGlowIterations = gSavedSettings.getS32("RenderGlowIterations");
+	RenderGlowWidth = gSavedSettings.getF32("RenderGlowWidth");
+	RenderGlowStrength = gSavedSettings.getF32("RenderGlowStrength");
+	RenderDepthOfField = gSavedSettings.getBOOL("RenderDepthOfField");
+	CameraFocusTransitionTime = gSavedSettings.getF32("CameraFocusTransitionTime");
+	CameraFNumber = gSavedSettings.getF32("CameraFNumber");
+	CameraFocalLength = gSavedSettings.getF32("CameraFocalLength");
+	CameraFieldOfView = gSavedSettings.getF32("CameraFieldOfView");
+	RenderShadowNoise = gSavedSettings.getF32("RenderShadowNoise");
+	RenderShadowBlurSize = gSavedSettings.getF32("RenderShadowBlurSize");
+	RenderSSAOScale = gSavedSettings.getF32("RenderSSAOScale");
+	RenderSSAOMaxScale = gSavedSettings.getU32("RenderSSAOMaxScale");
+	RenderSSAOFactor = gSavedSettings.getF32("RenderSSAOFactor");
+	RenderSSAOEffect = gSavedSettings.getVector3("RenderSSAOEffect");
+	RenderShadowOffsetError = gSavedSettings.getF32("RenderShadowOffsetError");
+	RenderShadowBiasError = gSavedSettings.getF32("RenderShadowBiasError");
+	RenderShadowOffset = gSavedSettings.getF32("RenderShadowOffset");
+	RenderShadowBias = gSavedSettings.getF32("RenderShadowBias");
+	RenderSpotShadowOffset = gSavedSettings.getF32("RenderSpotShadowOffset");
+	RenderSpotShadowBias = gSavedSettings.getF32("RenderSpotShadowBias");
+	RenderEdgeDepthCutoff = gSavedSettings.getF32("RenderEdgeDepthCutoff");
+	RenderEdgeNormCutoff = gSavedSettings.getF32("RenderEdgeNormCutoff");
+	RenderShadowGaussian = gSavedSettings.getVector3("RenderShadowGaussian");
+	RenderShadowBlurDistFactor = gSavedSettings.getF32("RenderShadowBlurDistFactor");
+	RenderDeferredAtmospheric = gSavedSettings.getBOOL("RenderDeferredAtmospheric");
+	RenderReflectionDetail = gSavedSettings.getS32("RenderReflectionDetail");
+	RenderHighlightFadeTime = gSavedSettings.getF32("RenderHighlightFadeTime");
+	RenderShadowClipPlanes = gSavedSettings.getVector3("RenderShadowClipPlanes");
+	RenderShadowOrthoClipPlanes = gSavedSettings.getVector3("RenderShadowOrthoClipPlanes");
+	RenderShadowNearDist = gSavedSettings.getVector3("RenderShadowNearDist");
+	RenderFarClip = gSavedSettings.getF32("RenderFarClip");
+	RenderShadowSplitExponent = gSavedSettings.getVector3("RenderShadowSplitExponent");
+	RenderShadowErrorCutoff = gSavedSettings.getF32("RenderShadowErrorCutoff");
+	RenderShadowFOVCutoff = gSavedSettings.getF32("RenderShadowFOVCutoff");
+	CameraOffset = gSavedSettings.getBOOL("CameraOffset");
+}
+
 void LLPipeline::releaseGLBuffers()
 {
 	assertInitialized();
@@ -1041,7 +1192,7 @@ S32 LLPipeline::setLightingDetail(S32 level)
 
 	if (level < 0)
 	{
-		if (gSavedSettings.getBOOL("RenderLocalLights"))
+		if (RenderLocalLights)
 		{
 			level = 1;
 		}
@@ -1362,7 +1513,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
 {
 	LLMemType mt_ao(LLMemType::MTYPE_PIPELINE_ADD_OBJECT);
 
-	if (gSavedSettings.getBOOL("RenderDelayCreation"))
+	if (RenderDelayCreation)
 	{
 		mCreateQ.push_back(vobj);
 	}
@@ -1425,7 +1576,7 @@ void LLPipeline::createObject(LLViewerObject* vobj)
 
 	markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE);
 
-	if (drawablep->getVOVolume() && gSavedSettings.getBOOL("RenderAnimateRes"))
+	if (drawablep->getVOVolume() && RenderAnimateRes)
 	{
 		// fun animated res
 		drawablep->updateXform(TRUE);
@@ -1464,7 +1615,7 @@ void LLPipeline::resetFrameStats()
 //external functions for asynchronous updating
 void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep)
 {
-	if (gSavedSettings.getBOOL("FreezeTime"))
+	if (FreezeTime)
 	{
 		return;
 	}
@@ -1494,7 +1645,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep)
 
 void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep)
 {
-	if (gSavedSettings.getBOOL("FreezeTime"))
+	if (FreezeTime)
 	{
 		return;
 	}
@@ -1551,7 +1702,7 @@ void LLPipeline::updateMove()
 	LLFastTimer t(FTM_UPDATE_MOVE);
 	LLMemType mt_um(LLMemType::MTYPE_PIPELINE_UPDATE_MOVE);
 
-	if (gSavedSettings.getBOOL("FreezeTime"))
+	if (FreezeTime)
 	{
 		return;
 	}
@@ -2911,7 +3062,7 @@ void renderScriptedBeacons(LLDrawable* drawablep)
 	{
 		if (gPipeline.sRenderBeacons)
 		{
-			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
+			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth);
 		}
 
 		if (gPipeline.sRenderHighlight)
@@ -2937,7 +3088,7 @@ void renderScriptedTouchBeacons(LLDrawable* drawablep)
 	{
 		if (gPipeline.sRenderBeacons)
 		{
-			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
+			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth);
 		}
 
 		if (gPipeline.sRenderHighlight)
@@ -2962,7 +3113,7 @@ void renderPhysicalBeacons(LLDrawable* drawablep)
 	{
 		if (gPipeline.sRenderBeacons)
 		{
-			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
+			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth);
 		}
 
 		if (gPipeline.sRenderHighlight)
@@ -2998,7 +3149,7 @@ void renderMOAPBeacons(LLDrawable* drawablep)
 	{
 		if (gPipeline.sRenderBeacons)
 		{
-			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 1.f, 1.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
+			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 1.f, 1.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth);
 		}
 
 		if (gPipeline.sRenderHighlight)
@@ -3023,7 +3174,7 @@ void renderParticleBeacons(LLDrawable* drawablep)
 		if (gPipeline.sRenderBeacons)
 		{
 			LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f);
-			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
+			gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth);
 		}
 
 		if (gPipeline.sRenderHighlight)
@@ -3216,7 +3367,7 @@ void LLPipeline::postSort(LLCamera& camera)
 				if (gPipeline.sRenderBeacons)
 				{
 					//pos += LLVector3(0.f, 0.f, 0.2f);
-					gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
+					gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), DebugBeaconLineWidth);
 				}
 			}
 			// now deal with highlights for all those seeable sound sources
@@ -3281,7 +3432,7 @@ void render_hud_elements()
 
 	if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
 	{
-		LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
+		LLGLEnable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
 		gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d()
 	
 		// Draw the tracking overlays
@@ -3368,9 +3519,9 @@ void LLPipeline::renderHighlights()
 
 		gGL.begin(LLRender::TRIANGLES);
 				
-		F32 scale = gSavedSettings.getF32("RenderHighlightBrightness");
-		LLColor4 color = gSavedSettings.getColor4("RenderHighlightColor");
-		F32 thickness = gSavedSettings.getF32("RenderHighlightThickness");
+		F32 scale = RenderHighlightBrightness;
+		LLColor4 color = RenderHighlightColor;
+		F32 thickness = RenderHighlightThickness;
 
 		for (S32 pass = 0; pass < 2; ++pass)
 		{
@@ -3425,7 +3576,7 @@ void LLPipeline::renderHighlights()
 	if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
 	{
 		gHighlightProgram.bind();
-		gHighlightProgram.uniform4f("highlight_color",1,1,1,0.5f);
+		gHighlightProgram.uniform4f(LLShaderMgr::HIGHLIGHT_COLOR,1,1,1,0.5f);
 	}
 	
 	if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
@@ -3457,7 +3608,7 @@ void LLPipeline::renderHighlights()
 		color.setVec(1.f, 0.f, 0.f, 0.5f);
 		if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
 		{
-			gHighlightProgram.uniform4f("highlight_color",1,0,0,0.5f);
+			gHighlightProgram.uniform4f(LLShaderMgr::HIGHLIGHT_COLOR,1,0,0,0.5f);
 		}
 		int count = mHighlightFaces.size();
 		for (S32 i = 0; i < count; i++)
@@ -3530,7 +3681,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	LLGLSPipeline gls_pipeline;
-	LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
+	LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
 
 	LLGLState gls_color_material(GL_COLOR_MATERIAL, mLightingDetail < 2);
 				
@@ -3755,7 +3906,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 		}
 	}
 
-	LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
+	LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
 
 	LLVertexBuffer::unbind();
 
@@ -3836,7 +3987,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 
 	LLGLEnable cull(GL_CULL_FACE);
 
-	LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
+	LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
 
 	calcNearbyLights(camera);
 	setupHWLights(NULL);
@@ -5051,8 +5202,9 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
 				light_state->setQuadraticAttenuation(0.f);
 			}
 			
+
 			if (light->isLightSpotlight() // directional (spot-)light
-			    && (LLPipeline::sRenderDeferred || gSavedSettings.getBOOL("RenderSpotLightsInNondeferred"))) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on
+			    && (LLPipeline::sRenderDeferred || RenderSpotLightsInNondeferred)) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on
 			{
 				LLVector3 spotparams = light->getSpotLightParams();
 				LLQuaternion quat = light->getRenderRotation();
@@ -5233,19 +5385,19 @@ void LLPipeline::enableLightsPreview()
 		glEnable(GL_LIGHTING);
 	}
 
-	LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor");
+	LLColor4 ambient = PreviewAmbientColor;
 	gGL.setAmbientLightColor(ambient);
 
-	LLColor4 diffuse0 = gSavedSettings.getColor4("PreviewDiffuse0");
-	LLColor4 specular0 = gSavedSettings.getColor4("PreviewSpecular0");
-	LLColor4 diffuse1 = gSavedSettings.getColor4("PreviewDiffuse1");
-	LLColor4 specular1 = gSavedSettings.getColor4("PreviewSpecular1");
-	LLColor4 diffuse2 = gSavedSettings.getColor4("PreviewDiffuse2");
-	LLColor4 specular2 = gSavedSettings.getColor4("PreviewSpecular2");
+	LLColor4 diffuse0 = PreviewDiffuse0;
+	LLColor4 specular0 = PreviewSpecular0;
+	LLColor4 diffuse1 = PreviewDiffuse1;
+	LLColor4 specular1 = PreviewSpecular1;
+	LLColor4 diffuse2 = PreviewDiffuse2;
+	LLColor4 specular2 = PreviewSpecular2;
 
-	LLVector3 dir0 = gSavedSettings.getVector3("PreviewDirection0");
-	LLVector3 dir1 = gSavedSettings.getVector3("PreviewDirection1");
-	LLVector3 dir2 = gSavedSettings.getVector3("PreviewDirection2");
+	LLVector3 dir0 = PreviewDirection0;
+	LLVector3 dir1 = PreviewDirection1;
+	LLVector3 dir2 = PreviewDirection2;
 
 	dir0.normVec();
 	dir1.normVec();
@@ -6085,7 +6237,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 	}
 
-	U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor");
+	U32 res_mod = RenderResolutionDivisor;
 
 	LLVector2 tc1(0,0);
 	LLVector2 tc2((F32) gViewerWindow->getWorldViewWidthRaw()*2,
@@ -6124,16 +6276,18 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		}
 		
 		gGlowExtractProgram.bind();
-		F32 minLum = llmax(gSavedSettings.getF32("RenderGlowMinLuminance"), 0.0f);
-		F32 maxAlpha = gSavedSettings.getF32("RenderGlowMaxExtractAlpha");		
-		F32 warmthAmount = gSavedSettings.getF32("RenderGlowWarmthAmount");	
-		LLVector3 lumWeights = gSavedSettings.getVector3("RenderGlowLumWeights");
-		LLVector3 warmthWeights = gSavedSettings.getVector3("RenderGlowWarmthWeights");
-		gGlowExtractProgram.uniform1f("minLuminance", minLum);
-		gGlowExtractProgram.uniform1f("maxExtractAlpha", maxAlpha);
-		gGlowExtractProgram.uniform3f("lumWeights", lumWeights.mV[0], lumWeights.mV[1], lumWeights.mV[2]);
-		gGlowExtractProgram.uniform3f("warmthWeights", warmthWeights.mV[0], warmthWeights.mV[1], warmthWeights.mV[2]);
-		gGlowExtractProgram.uniform1f("warmthAmount", warmthAmount);
+		F32 minLum = llmax((F32) RenderGlowMinLuminance, 0.0f);
+		F32 maxAlpha = RenderGlowMaxExtractAlpha;		
+		F32 warmthAmount = RenderGlowWarmthAmount;	
+		LLVector3 lumWeights = RenderGlowLumWeights;
+		LLVector3 warmthWeights = RenderGlowWarmthWeights;
+
+
+		gGlowExtractProgram.uniform1f(LLShaderMgr::GLOW_MIN_LUMINANCE, minLum);
+		gGlowExtractProgram.uniform1f(LLShaderMgr::GLOW_MAX_EXTRACT_ALPHA, maxAlpha);
+		gGlowExtractProgram.uniform3f(LLShaderMgr::GLOW_LUM_WEIGHTS, lumWeights.mV[0], lumWeights.mV[1], lumWeights.mV[2]);
+		gGlowExtractProgram.uniform3f(LLShaderMgr::GLOW_WARMTH_WEIGHTS, warmthWeights.mV[0], warmthWeights.mV[1], warmthWeights.mV[2]);
+		gGlowExtractProgram.uniform1f(LLShaderMgr::GLOW_WARMTH_AMOUNT, warmthAmount);
 		LLGLEnable blend_on(GL_BLEND);
 		LLGLEnable test(GL_ALPHA_TEST);
 		
@@ -6164,22 +6318,22 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	tc2.setVec(2,2);
 
 	// power of two between 1 and 1024
-	U32 glowResPow = gSavedSettings.getS32("RenderGlowResolutionPow");
+	U32 glowResPow = RenderGlowResolutionPow;
 	const U32 glow_res = llmax(1, 
 		llmin(1024, 1 << glowResPow));
 
-	S32 kernel = gSavedSettings.getS32("RenderGlowIterations")*2;
-	F32 delta = gSavedSettings.getF32("RenderGlowWidth") / glow_res;
+	S32 kernel = RenderGlowIterations*2;
+	F32 delta = RenderGlowWidth / glow_res;
 	// Use half the glow width if we have the res set to less than 9 so that it looks
 	// almost the same in either case.
 	if (glowResPow < 9)
 	{
 		delta *= 0.5f;
 	}
-	F32 strength = gSavedSettings.getF32("RenderGlowStrength");
+	F32 strength = RenderGlowStrength;
 
 	gGlowProgram.bind();
-	gGlowProgram.uniform1f("glowStrength", strength);
+	gGlowProgram.uniform1f(LLShaderMgr::GLOW_STRENGTH, strength);
 
 	for (S32 i = 0; i < kernel; i++)
 	{
@@ -6200,11 +6354,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 		if (i%2 == 0)
 		{
-			gGlowProgram.uniform2f("glowDelta", delta, 0);
+			gGlowProgram.uniform2f(LLShaderMgr::GLOW_DELTA, delta, 0);
 		}
 		else
 		{
-			gGlowProgram.uniform2f("glowDelta", 0, delta);
+			gGlowProgram.uniform2f(LLShaderMgr::GLOW_DELTA, 0, delta);
 		}
 
 		gGL.begin(LLRender::TRIANGLE_STRIP);
@@ -6245,11 +6399,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 	if (LLPipeline::sRenderDeferred)
 	{
+
 		bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater() &&
 							!LLToolMgr::getInstance()->inBuildMode() &&
-							gSavedSettings.getBOOL("RenderDepthOfField");
+							RenderDepthOfField;
+
 
-		bool multisample = gSavedSettings.getU32("RenderFSAASamples") > 1;
+		bool multisample = RenderFSAASamples > 1;
 
 		if (multisample)
 		{
@@ -6261,7 +6417,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			glViewport(0, 0, width, height);
 
 			gGlowCombineFXAAProgram.bind();
-			gGlowCombineFXAAProgram.uniform2f("screen_res", width, height);
+			gGlowCombineFXAAProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, width, height);
 
 			gGL.getTexUnit(0)->bind(&mGlow[1]);
 			gGL.getTexUnit(1)->bind(&mScreen);
@@ -6284,7 +6440,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			LLGLSLShader* shader = &gFXAAProgram;
 			shader->bind();
 
-			S32 channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
+			S32 channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
 			if (channel > -1)
 			{
 				mFXAABuffer.bindTexture(0, channel);
@@ -6294,10 +6450,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			
 			F32 scale_x = (F32) width/mFXAABuffer.getWidth();
 			F32 scale_y = (F32) height/mFXAABuffer.getHeight();
-			shader->uniform2f("tc_scale", scale_x, scale_y);
-			shader->uniform2f("rcp_screen_res", 1.f/width*scale_x, 1.f/height*scale_y);
-			shader->uniform4f("rcp_frame_opt", -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
-			shader->uniform4f("rcp_frame_opt2", -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
+			shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y);
+			shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f/width*scale_x, 1.f/height*scale_y);
+			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
+			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
 
 			gGL.begin(LLRender::TRIANGLE_STRIP);
 			gGL.vertex2f(-1,-1);
@@ -6391,7 +6547,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				}
 				else if (transition_time < 1.f)
 				{ //currently in a transition, continue interpolating
-					transition_time += 1.f/gSavedSettings.getF32("CameraFocusTransitionTime")*gFrameIntervalSeconds;
+					transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds;
 					transition_time = llmin(transition_time, 1.f);
 
 					F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f;
@@ -6404,12 +6560,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 				//convert to mm
 				F32 subject_distance = current_distance*1000.f;
-				F32 fnumber = gSavedSettings.getF32("CameraFNumber");
-				F32 default_focal_length = gSavedSettings.getF32("CameraFocalLength");
+				F32 fnumber = CameraFNumber;
+				F32 default_focal_length = CameraFocalLength;
 
 				F32 fov = LLViewerCamera::getInstance()->getView();
 		
-				const F32 default_fov = gSavedSettings.getF32("CameraFieldOfView") * F_PI/180.f;
+				const F32 default_fov = CameraFieldOfView * F_PI/180.f;
 				//const F32 default_aspect_ratio = gSavedSettings.getF32("CameraAspectRatio");
 		
 				//F32 aspect_ratio = (F32) mScreen.getWidth()/(F32)mScreen.getHeight();
@@ -6432,13 +6588,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				blur_constant /= 1000.f; //convert to meters for shader
 				F32 magnification = focal_length/(subject_distance-focal_length);
 
-				shader->uniform1f("focal_distance", -subject_distance/1000.f);
-				shader->uniform1f("blur_constant", blur_constant);
-				shader->uniform1f("tan_pixel_angle", tanf(1.f/LLDrawable::sCurPixelAngle));
-				shader->uniform1f("magnification", magnification);
+				shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f);
+				shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
+				shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
+				shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
 			}
 
-			S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+			S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
 			if (channel > -1)
 			{
 				mScreen.bindTexture(0, channel);
@@ -6446,7 +6602,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 			if (multisample)
 			{ //bloom has already been added, bind black
-				channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_BLOOM);
+				channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
 				if (channel > -1)
 				{
 					gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
@@ -6519,7 +6675,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		gGL.getTexUnit(0)->bind(&mGlow[1]);
 		gGL.getTexUnit(1)->bind(&mScreen);
 		
-		LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
+		LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
 		
 		buff->setBuffer(mask);
 		buff->drawArrays(LLRender::TRIANGLE_STRIP, 0, 3);
@@ -6611,28 +6767,28 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 
 	shader.bind();
 	S32 channel = 0;
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage());
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage());
 	if (channel > -1)
 	{
 		mDeferredScreen.bindTexture(0,channel);
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage());
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage());
 	if (channel > -1)
 	{
 		mDeferredScreen.bindTexture(1, channel);
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage());
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage());
 	if (channel > -1)
 	{
 		mDeferredScreen.bindTexture(2, channel);
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, mDeferredDepth.getUsage());
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_DEPTH, mDeferredDepth.getUsage());
 	if (channel > -1)
 	{
 		gGL.getTexUnit(channel)->bind(&mDeferredDepth, TRUE);
@@ -6646,21 +6802,21 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 		glh::matrix4f projection = glh_get_current_projection();
 		glh::matrix4f inv_proj = projection.inverse();
 		
-		shader.uniformMatrix4fv("inv_proj", 1, FALSE, inv_proj.m);
-		shader.uniform4f("viewport", (F32) gGLViewport[0],
+		shader.uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m);
+		shader.uniform4f(LLShaderMgr::VIEWPORT, (F32) gGLViewport[0],
 									(F32) gGLViewport[1],
 									(F32) gGLViewport[2],
 									(F32) gGLViewport[3]);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_NOISE);
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_NOISE);
 	if (channel > -1)
 	{
 		gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, noise_map);
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LIGHTFUNC);
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_LIGHTFUNC);
 	if (channel > -1)
 	{
 		gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc);
@@ -6668,7 +6824,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 
 	stop_glerror();
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage());
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage());
 	if (channel > -1)
 	{
 		if (light_index > 0)
@@ -6682,7 +6838,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 		gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 	}
 
-	channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_BLOOM);
+	channel = shader.enableTexture(LLShaderMgr::DEFERRED_BLOOM);
 	if (channel > -1)
 	{
 		mGlow[1].bindTexture(0, channel);
@@ -6692,7 +6848,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 
 	for (U32 i = 0; i < 4; i++)
 	{
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE);
+		channel = shader.enableTexture(LLShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE);
 		stop_glerror();
 		if (channel > -1)
 		{
@@ -6710,7 +6866,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 
 	for (U32 i = 4; i < 6; i++)
 	{
-		channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i);
+		channel = shader.enableTexture(LLShaderMgr::DEFERRED_SHADOW0+i);
 		stop_glerror();
 		if (channel > -1)
 		{
@@ -6739,12 +6895,11 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 		mat[i+80] = mSunShadowMatrix[5].m[i];
 	}
 
-	shader.uniformMatrix4fv("shadow_matrix[0]", 6, FALSE, mat);
-	shader.uniformMatrix4fv("shadow_matrix", 6, FALSE, mat);
+	shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_SHADOW_MATRIX, 6, FALSE, mat);
 
 	stop_glerror();
 
-	channel = shader.enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
+	channel = shader.enableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
 	if (channel > -1)
 	{
 		LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;
@@ -6759,24 +6914,23 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 						  m[4], m[5], m[6],
 						  m[8], m[9], m[10] };
 		
-			shader.uniform3fv("env_mat[0]", 3, mat);
-			shader.uniform3fv("env_mat", 3, mat);
+			shader.uniform3fv(LLShaderMgr::DEFERRED_ENV_MAT, 3, mat);
 		}
 	}
 
-	shader.uniform4fv("shadow_clip", 1, mSunClipPlanes.mV);
-	shader.uniform1f("sun_wash", gSavedSettings.getF32("RenderDeferredSunWash"));
-	shader.uniform1f("shadow_noise", gSavedSettings.getF32("RenderShadowNoise"));
-	shader.uniform1f("blur_size", gSavedSettings.getF32("RenderShadowBlurSize"));
+	shader.uniform4fv(LLShaderMgr::DEFERRED_SHADOW_CLIP, 1, mSunClipPlanes.mV);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SUN_WASH, RenderDeferredSunWash);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SHADOW_NOISE, RenderShadowNoise);
+	shader.uniform1f(LLShaderMgr::DEFERRED_BLUR_SIZE, RenderShadowBlurSize);
 
-	shader.uniform1f("ssao_radius", gSavedSettings.getF32("RenderSSAOScale"));
-	shader.uniform1f("ssao_max_radius", gSavedSettings.getU32("RenderSSAOMaxScale"));
+	shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_RADIUS, RenderSSAOScale);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_MAX_RADIUS, RenderSSAOMaxScale);
 
-	F32 ssao_factor = gSavedSettings.getF32("RenderSSAOFactor");
-	shader.uniform1f("ssao_factor", ssao_factor);
-	shader.uniform1f("ssao_factor_inv", 1.0/ssao_factor);
+	F32 ssao_factor = RenderSSAOFactor;
+	shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR, ssao_factor);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR_INV, 1.0/ssao_factor);
 
-	LLVector3 ssao_effect = gSavedSettings.getVector3("RenderSSAOEffect");
+	LLVector3 ssao_effect = RenderSSAOEffect;
 	F32 matrix_diag = (ssao_effect[0] + 2.0*ssao_effect[1])/3.0;
 	F32 matrix_nondiag = (ssao_effect[0] - ssao_effect[1])/3.0;
 	// This matrix scales (proj of color onto <1/rt(3),1/rt(3),1/rt(3)>) by
@@ -6784,23 +6938,23 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 	F32 ssao_effect_mat[] = {	matrix_diag, matrix_nondiag, matrix_nondiag,
 								matrix_nondiag, matrix_diag, matrix_nondiag,
 								matrix_nondiag, matrix_nondiag, matrix_diag};
-	shader.uniformMatrix3fv("ssao_effect_mat", 1, GL_FALSE, ssao_effect_mat);
-
-	F32 shadow_offset_error = 1.f + gSavedSettings.getF32("RenderShadowOffsetError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]);
-	F32 shadow_bias_error = 1.f + gSavedSettings.getF32("RenderShadowBiasError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]);
-
-	shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
-	shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f);
-	shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")*shadow_offset_error);
-	shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")*shadow_bias_error);
-	shader.uniform1f ("spot_shadow_offset", gSavedSettings.getF32("RenderSpotShadowOffset"));
-	shader.uniform1f("spot_shadow_bias", gSavedSettings.getF32("RenderSpotShadowBias"));	
-
-	shader.uniform3fv("sun_dir", 1, mTransformedSunDir.mV);
-	shader.uniform2f("shadow_res", mShadow[0].getWidth(), mShadow[0].getHeight());
-	shader.uniform2f("proj_shadow_res", mShadow[4].getWidth(), mShadow[4].getHeight());
-	shader.uniform1f("depth_cutoff", gSavedSettings.getF32("RenderEdgeDepthCutoff"));
-	shader.uniform1f("norm_cutoff", gSavedSettings.getF32("RenderEdgeNormCutoff"));
+	shader.uniformMatrix3fv(LLShaderMgr::DEFERRED_SSAO_EFFECT_MAT, 1, GL_FALSE, ssao_effect_mat);
+
+	F32 shadow_offset_error = 1.f + RenderShadowOffsetError * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]);
+	F32 shadow_bias_error = 1.f + RenderShadowBiasError * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]);
+
+	shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
+	shader.uniform1f(LLShaderMgr::DEFERRED_NEAR_CLIP, LLViewerCamera::getInstance()->getNear()*2.f);
+	shader.uniform1f (LLShaderMgr::DEFERRED_SHADOW_OFFSET, RenderShadowOffset*shadow_offset_error);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SHADOW_BIAS, RenderShadowBias*shadow_bias_error);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SPOT_SHADOW_OFFSET, RenderSpotShadowOffset);
+	shader.uniform1f(LLShaderMgr::DEFERRED_SPOT_SHADOW_BIAS, RenderSpotShadowBias);	
+
+	shader.uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, mTransformedSunDir.mV);
+	shader.uniform2f(LLShaderMgr::DEFERRED_SHADOW_RES, mShadow[0].getWidth(), mShadow[0].getHeight());
+	shader.uniform2f(LLShaderMgr::DEFERRED_PROJ_SHADOW_RES, mShadow[4].getWidth(), mShadow[4].getHeight());
+	shader.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff);
+	shader.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff);
 	
 
 	if (shader.getUniformLocation("norm_mat") >= 0)
@@ -6839,7 +6993,7 @@ void LLPipeline::renderDeferredLighting()
 							0, 0, mDeferredDepth.getWidth(), mDeferredDepth.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);	
 		}
 
-		LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0);
+		LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
 
 		if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
 		{
@@ -6886,7 +7040,7 @@ void LLPipeline::renderDeferredLighting()
 		gGL.pushMatrix();
 		gGL.loadIdentity();
 
-		if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0)
+		if (RenderDeferredSSAO || RenderShadowDetail > 0)
 		{
 			mDeferredLight.bindTarget();
 			{ //paint shadow/SSAO light map (direct lighting lightmap)
@@ -6932,7 +7086,7 @@ void LLPipeline::renderDeferredLighting()
 			mDeferredLight.flush();
 		}
 		
-		if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
+		if (RenderDeferredSSAO)
 		{ //soften direct lighting lightmap
 			LLFastTimer ftm(FTM_SOFTEN_SHADOW);
 			//blur lightmap
@@ -6943,10 +7097,10 @@ void LLPipeline::renderDeferredLighting()
 			
 			bindDeferredShader(gDeferredBlurLightProgram);
 			mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-			LLVector3 go = gSavedSettings.getVector3("RenderShadowGaussian");
+			LLVector3 go = RenderShadowGaussian;
 			const U32 kern_length = 4;
-			F32 blur_size = gSavedSettings.getF32("RenderShadowBlurSize");
-			F32 dist_factor = gSavedSettings.getF32("RenderShadowBlurDistFactor");
+			F32 blur_size = RenderShadowBlurSize;
+			F32 dist_factor = RenderShadowBlurDistFactor;
 
 			// sample symmetrically with the middle sample falling exactly on 0.0
 			F32 x = 0.f;
@@ -7011,7 +7165,7 @@ void LLPipeline::renderDeferredLighting()
 		glClearColor(0,0,0,0);
 		mScreen.clear(GL_COLOR_BUFFER_BIT);
 		
-		if (gSavedSettings.getBOOL("RenderDeferredAtmospheric"))
+		if (RenderDeferredAtmospheric)
 		{ //apply sunlight contribution 
 			LLFastTimer ftm(FTM_ATMOSPHERICS);
 			bindDeferredShader(gDeferredSoftenProgram);	
@@ -7056,7 +7210,7 @@ void LLPipeline::renderDeferredLighting()
 			gPipeline.popRenderTypeMask();
 		}
 
-		BOOL render_local = gSavedSettings.getBOOL("RenderLocalLights");
+		BOOL render_local = RenderLocalLights;
 				
 		if (render_local)
 		{
@@ -7162,10 +7316,10 @@ void LLPipeline::renderDeferredLighting()
 							
 							LLFastTimer ftm(FTM_LOCAL_LIGHTS);
 							//glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
-							gDeferredLightProgram.uniform3fv("center", 1, tc.v);
-							gDeferredLightProgram.uniform1f("size", s*s);
-							gDeferredLightProgram.uniform3fv("color", 1, col.mV);
-							gDeferredLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
+							gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v);
+							gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s);
+							gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
+							gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
 							//gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
 							gGL.syncMatrices();
 							mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
@@ -7197,7 +7351,7 @@ void LLPipeline::renderDeferredLighting()
 
 				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 
-				gDeferredSpotLightProgram.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
+				gDeferredSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION);
 
 				for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter)
 				{
@@ -7236,16 +7390,16 @@ void LLPipeline::renderDeferredLighting()
 					v[6].set(c[0]+s,c[1]+s,c[2]-s); // 6 - 0110
 					v[7].set(c[0]+s,c[1]+s,c[2]+s); // 7 - 0111
 					
-					gDeferredSpotLightProgram.uniform3fv("center", 1, tc.v);
-					gDeferredSpotLightProgram.uniform1f("size", s*s);
-					gDeferredSpotLightProgram.uniform3fv("color", 1, col.mV);
-					gDeferredSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
+					gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v);
+					gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s);
+					gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
+					gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
 					gGL.syncMatrices();
 					mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 					glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
 							GL_UNSIGNED_SHORT, get_box_fan_indices_ptr(camera, center));
 				}
-				gDeferredSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
+				gDeferredSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION);
 				unbindDeferredShader(gDeferredSpotLightProgram);
 			}
 
@@ -7292,12 +7446,12 @@ void LLPipeline::renderDeferredLighting()
 					count++;
 					if (count == max_count || fullscreen_lights.empty())
 					{
-						gDeferredMultiLightProgram.uniform1i("light_count", count);
-						gDeferredMultiLightProgram.uniform4fv("light", count, (GLfloat*) light);
-						gDeferredMultiLightProgram.uniform4fv("light_col", count, (GLfloat*) col);
-						gDeferredMultiLightProgram.uniform1f("far_z", far_z);
+						gDeferredMultiLightProgram.uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count);
+						gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light);
+						gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col);
+						gDeferredMultiLightProgram.uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z);
 						far_z = 0.f;
-						count = 0;
+						count = 0; 
 						mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 					}
 				}
@@ -7306,7 +7460,7 @@ void LLPipeline::renderDeferredLighting()
 
 				bindDeferredShader(gDeferredMultiSpotLightProgram);
 
-				gDeferredMultiSpotLightProgram.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
+				gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION);
 
 				mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 
@@ -7331,14 +7485,14 @@ void LLPipeline::renderDeferredLighting()
 					LLColor3 col = volume->getLightColor();
 					col *= volume->getLightIntensity();
 
-					gDeferredMultiSpotLightProgram.uniform3fv("center", 1, tc.v);
-					gDeferredMultiSpotLightProgram.uniform1f("size", s*s);
-					gDeferredMultiSpotLightProgram.uniform3fv("color", 1, col.mV);
-					gDeferredMultiSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f);
+					gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v);
+					gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s);
+					gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
+					gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
 					mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
 				}
 
-				gDeferredMultiSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
+				gDeferredMultiSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION);
 				unbindDeferredShader(gDeferredMultiSpotLightProgram);
 
 				gGL.popMatrix();
@@ -7463,13 +7617,13 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
 	F32 proj_range = far_clip - near_clip;
 	glh::matrix4f light_proj = gl_perspective(fovy, aspect, near_clip, far_clip);
 	screen_to_light = trans * light_proj * screen_to_light;
-	shader.uniformMatrix4fv("proj_mat", 1, FALSE, screen_to_light.m);
-	shader.uniform1f("proj_near", near_clip);
-	shader.uniform3fv("proj_p", 1, p1.v);
-	shader.uniform3fv("proj_n", 1, n.v);
-	shader.uniform3fv("proj_origin", 1, screen_origin.v);
-	shader.uniform1f("proj_range", proj_range);
-	shader.uniform1f("proj_ambiance", params.mV[2]);
+	shader.uniformMatrix4fv(LLShaderMgr::PROJECTOR_MATRIX, 1, FALSE, screen_to_light.m);
+	shader.uniform1f(LLShaderMgr::PROJECTOR_NEAR, near_clip);
+	shader.uniform3fv(LLShaderMgr::PROJECTOR_P, 1, p1.v);
+	shader.uniform3fv(LLShaderMgr::PROJECTOR_N, 1, n.v);
+	shader.uniform3fv(LLShaderMgr::PROJECTOR_ORIGIN, 1, screen_origin.v);
+	shader.uniform1f(LLShaderMgr::PROJECTOR_RANGE, proj_range);
+	shader.uniform1f(LLShaderMgr::PROJECTOR_AMBIANCE, params.mV[2]);
 	S32 s_idx = -1;
 
 	for (U32 i = 0; i < 2; i++)
@@ -7480,15 +7634,15 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
 		}
 	}
 
-	shader.uniform1i("proj_shadow_idx", s_idx);
+	shader.uniform1i(LLShaderMgr::PROJECTOR_SHADOW_INDEX, s_idx);
 
 	if (s_idx >= 0)
 	{
-		shader.uniform1f("shadow_fade", 1.f-mSpotLightFade[s_idx]);
+		shader.uniform1f(LLShaderMgr::PROJECTOR_SHADOW_FADE, 1.f-mSpotLightFade[s_idx]);
 	}
 	else
 	{
-		shader.uniform1f("shadow_fade", 1.f);
+		shader.uniform1f(LLShaderMgr::PROJECTOR_SHADOW_FADE, 1.f);
 	}
 
 	{
@@ -7522,7 +7676,7 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
 		img = LLViewerFetchedTexture::sWhiteImagep;
 	}
 
-	S32 channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
+	S32 channel = shader.enableTexture(LLShaderMgr::DEFERRED_PROJECTION);
 
 	if (channel > -1)
 	{
@@ -7532,9 +7686,9 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
 
 			F32 lod_range = logf(img->getWidth())/logf(2.f);
 
-			shader.uniform1f("proj_focus", focus);
-			shader.uniform1f("proj_lod", lod_range);
-			shader.uniform1f("proj_ambient_lod", llclamp((proj_range-focus)/proj_range*lod_range, 0.f, 1.f));
+			shader.uniform1f(LLShaderMgr::PROJECTOR_FOCUS, focus);
+			shader.uniform1f(LLShaderMgr::PROJECTOR_LOD, lod_range);
+			shader.uniform1f(LLShaderMgr::PROJECTOR_AMBIENT_LOD, llclamp((proj_range-focus)/proj_range*lod_range, 0.f, 1.f));
 		}
 	}
 		
@@ -7543,17 +7697,17 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
 void LLPipeline::unbindDeferredShader(LLGLSLShader &shader)
 {
 	stop_glerror();
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, mDeferredScreen.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage());
-	shader.disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_BLOOM);
+	shader.disableTexture(LLShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage());
+	shader.disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage());
+	shader.disableTexture(LLShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage());
+	shader.disableTexture(LLShaderMgr::DEFERRED_DEPTH, mDeferredScreen.getUsage());
+	shader.disableTexture(LLShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage());
+	shader.disableTexture(LLShaderMgr::DIFFUSE_MAP);
+	shader.disableTexture(LLShaderMgr::DEFERRED_BLOOM);
 
 	for (U32 i = 0; i < 4; i++)
 	{
-		if (shader.disableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE) > -1)
+		if (shader.disableTexture(LLShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE) > -1)
 		{
 			glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);
 		}
@@ -7561,16 +7715,16 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader)
 
 	for (U32 i = 4; i < 6; i++)
 	{
-		if (shader.disableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i) > -1)
+		if (shader.disableTexture(LLShaderMgr::DEFERRED_SHADOW0+i) > -1)
 		{
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);
 		}
 	}
 
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_NOISE);
-	shader.disableTexture(LLViewerShaderMgr::DEFERRED_LIGHTFUNC);
+	shader.disableTexture(LLShaderMgr::DEFERRED_NOISE);
+	shader.disableTexture(LLShaderMgr::DEFERRED_LIGHTFUNC);
 
-	S32 channel = shader.disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
+	S32 channel = shader.disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
 	if (channel > -1)
 	{
 		LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;
@@ -7718,7 +7872,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 					LLPipeline::RENDER_TYPE_CLOUDS,
 					LLPipeline::END_RENDER_TYPES);	
 
-				S32 detail = gSavedSettings.getS32("RenderReflectionDetail");
+				S32 detail = RenderReflectionDetail;
 				if (detail > 0)
 				{ //mask out selected geometry based on reflection detail
 					if (detail < 4)
@@ -7742,7 +7896,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 
 				if (LLDrawPoolWater::sNeedsDistortionUpdate)
 				{
-					if (gSavedSettings.getS32("RenderReflectionDetail") > 0)
+					if (RenderReflectionDetail > 0)
 					{
 						gPipeline.grabReferences(ref_result);
 						LLGLUserClipPlane clip_plane(plane, mat, projection);
@@ -8233,7 +8387,7 @@ void LLPipeline::generateHighlight(LLCamera& camera)
 	
 	if (!mHighlightSet.empty())
 	{
-		F32 transition = gFrameIntervalSeconds/gSavedSettings.getF32("RenderHighlightFadeTime");
+		F32 transition = gFrameIntervalSeconds/RenderHighlightFadeTime;
 
 		LLGLDisable test(GL_ALPHA_TEST);
 		LLGLDepthTest depth(GL_FALSE);
@@ -8279,7 +8433,7 @@ void LLPipeline::generateHighlight(LLCamera& camera)
 
 void LLPipeline::generateSunShadow(LLCamera& camera)
 {
-	if (!sRenderDeferred || gSavedSettings.getS32("RenderShadowDetail") <= 0)
+	if (!sRenderDeferred || RenderShadowDetail <= 0)
 	{
 		return;
 	}
@@ -8337,25 +8491,25 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	glh::matrix4f proj[6];
 	
 	//clip contains parallel split distances for 3 splits
-	LLVector3 clip = gSavedSettings.getVector3("RenderShadowClipPlanes");
+	LLVector3 clip = RenderShadowClipPlanes;
 
 	//F32 slope_threshold = gSavedSettings.getF32("RenderShadowSlopeThreshold");
 
 	//far clip on last split is minimum of camera view distance and 128
 	mSunClipPlanes = LLVector4(clip, clip.mV[2] * clip.mV[2]/clip.mV[1]);
 
-	clip = gSavedSettings.getVector3("RenderShadowOrthoClipPlanes");
+	clip = RenderShadowOrthoClipPlanes;
 	mSunOrthoClipPlanes = LLVector4(clip, clip.mV[2]*clip.mV[2]/clip.mV[1]);
 
 	//currently used for amount to extrude frusta corners for constructing shadow frusta
-	LLVector3 n = gSavedSettings.getVector3("RenderShadowNearDist");
+	LLVector3 n = RenderShadowNearDist;
 	//F32 nearDist[] = { n.mV[0], n.mV[1], n.mV[2], n.mV[2] };
 
 	//put together a universal "near clip" plane for shadow frusta
 	LLPlane shadow_near_clip;
 	{
 		LLVector3 p = gAgent.getPositionAgent();
-		p += mSunDir * gSavedSettings.getF32("RenderFarClip")*2.f;
+		p += mSunDir * RenderFarClip*2.f;
 		shadow_near_clip.setVec(p, mSunDir);
 	}
 
@@ -8442,7 +8596,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 
 		F32 range = far_clip-near_clip;
 
-		LLVector3 split_exp = gSavedSettings.getVector3("RenderShadowSplitExponent");
+		LLVector3 split_exp = RenderShadowSplitExponent;
 
 		F32 da = 1.f-llmax( fabsf(lightDir*up), fabsf(lightDir*camera.getLeftAxis()) );
 		
@@ -8653,7 +8807,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 			mShadowError.mV[j] /= wpf.size();
 			mShadowError.mV[j] /= size.mV[0];
 
-			if (mShadowError.mV[j] > gSavedSettings.getF32("RenderShadowErrorCutoff"))
+			if (mShadowError.mV[j] > RenderShadowErrorCutoff)
 			{ //just use ortho projection
 				mShadowFOV.mV[j] = -1.f;
 				origin.clearVec();
@@ -8696,7 +8850,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 				fovx = acos(fovx);
 				fovz = acos(fovz);
 
-				F32 cutoff = llmin(gSavedSettings.getF32("RenderShadowFOVCutoff"), 1.4f);
+				F32 cutoff = llmin((F32) RenderShadowFOVCutoff, 1.4f);
 				
 				mShadowFOV.mV[j] = fovx;
 				
@@ -8840,7 +8994,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 
 	
 	//hack to disable projector shadows 
-	bool gen_shadow = gSavedSettings.getS32("RenderShadowDetail") > 1;
+	bool gen_shadow = RenderShadowDetail > 1;
 
 	if (gen_shadow)
 	{
@@ -8979,7 +9133,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	}
 
 
-	if (!gSavedSettings.getBOOL("CameraOffset"))
+	if (!CameraOffset)
 	{
 		glh_set_current_modelview(saved_view);
 		glh_set_current_projection(saved_proj);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 86579261caa..584e6e4c231 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -360,6 +360,7 @@ class LLPipeline
 
 	static void updateRenderDeferred();
 	static void refreshRenderDeferred();
+	static void refreshCachedSettings();
 
 	static void throttleNewMemoryAllocation(BOOL disable);
 
@@ -771,6 +772,79 @@ class LLPipeline
 
 	//debug use
 	static U32              sCurRenderPoolType ;
+
+	//cached settings
+	static BOOL WindLightUseAtmosShaders;
+	static BOOL VertexShaderEnable;
+	static BOOL RenderAvatarVP;
+	static BOOL RenderDeferred;
+	static F32 RenderDeferredSunWash;
+	static U32 RenderFSAASamples;
+	static U32 RenderResolutionDivisor;
+	static BOOL RenderUIBuffer;
+	static S32 RenderShadowDetail;
+	static BOOL RenderDeferredSSAO;
+	static F32 RenderShadowResolutionScale;
+	static BOOL RenderLocalLights;
+	static BOOL RenderDelayCreation;
+	static BOOL RenderAnimateRes;
+	static BOOL FreezeTime;
+	static S32 DebugBeaconLineWidth;
+	static F32 RenderHighlightBrightness;
+	static LLColor4 RenderHighlightColor;
+	static F32 RenderHighlightThickness;
+	static BOOL RenderSpotLightsInNondeferred;
+	static LLColor4 PreviewAmbientColor;
+	static LLColor4 PreviewDiffuse0;
+	static LLColor4 PreviewSpecular0;
+	static LLColor4 PreviewDiffuse1;
+	static LLColor4 PreviewSpecular1;
+	static LLColor4 PreviewDiffuse2;
+	static LLColor4 PreviewSpecular2;
+	static LLVector3 PreviewDirection0;
+	static LLVector3 PreviewDirection1;
+	static LLVector3 PreviewDirection2;
+	static F32 RenderGlowMinLuminance;
+	static F32 RenderGlowMaxExtractAlpha;
+	static F32 RenderGlowWarmthAmount;
+	static LLVector3 RenderGlowLumWeights;
+	static LLVector3 RenderGlowWarmthWeights;
+	static S32 RenderGlowResolutionPow;
+	static S32 RenderGlowIterations;
+	static F32 RenderGlowWidth;
+	static F32 RenderGlowStrength;
+	static BOOL RenderDepthOfField;
+	static F32 CameraFocusTransitionTime;
+	static F32 CameraFNumber;
+	static F32 CameraFocalLength;
+	static F32 CameraFieldOfView;
+	static F32 RenderShadowNoise;
+	static F32 RenderShadowBlurSize;
+	static F32 RenderSSAOScale;
+	static U32 RenderSSAOMaxScale;
+	static F32 RenderSSAOFactor;
+	static LLVector3 RenderSSAOEffect;
+	static F32 RenderShadowOffsetError;
+	static F32 RenderShadowBiasError;
+	static F32 RenderShadowOffset;
+	static F32 RenderShadowBias;
+	static F32 RenderSpotShadowOffset;
+	static F32 RenderSpotShadowBias;
+	static F32 RenderEdgeDepthCutoff;
+	static F32 RenderEdgeNormCutoff;
+	static LLVector3 RenderShadowGaussian;
+	static F32 RenderShadowBlurDistFactor;
+	static BOOL RenderDeferredAtmospheric;
+	static S32 RenderReflectionDetail;
+	static F32 RenderHighlightFadeTime;
+	static LLVector3 RenderShadowClipPlanes;
+	static LLVector3 RenderShadowOrthoClipPlanes;
+	static LLVector3 RenderShadowNearDist;
+	static F32 RenderFarClip;
+	static LLVector3 RenderShadowSplitExponent;
+	static F32 RenderShadowErrorCutoff;
+	static F32 RenderShadowFOVCutoff;
+	static BOOL CameraOffset;
 };
 
 void render_bbox(const LLVector3 &min, const LLVector3 &max);
-- 
GitLab


From 2322c57b4dd2b4338eec2ca9db2425eff4bfd6d5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 11 Oct 2011 14:55:33 -0500
Subject: [PATCH 105/933] SH-2545 Fix for transparent water option doing
 nothing when shaders are enabled.

---
 indra/llrender/llglslshader.cpp               |  6 --
 .../shaders/class1/objects/simpleTexGenV.glsl | 77 +++++++++++++++++++
 indra/newview/lldrawpoolwater.cpp             | 46 ++++++++---
 indra/newview/llviewershadermgr.cpp           | 43 ++++++++++-
 indra/newview/llviewershadermgr.h             |  2 +
 indra/newview/llwlparamset.cpp                |  4 +-
 6 files changed, 159 insertions(+), 19 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/objects/simpleTexGenV.glsl

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index bbb62ea3c17..deb022fd75d 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -762,12 +762,8 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
 	}
 }
 
-static LLFastTimer::DeclareTimer FTM_UNIFORM_LOCATION("Get Uniform Location");
-
 GLint LLGLSLShader::getUniformLocation(const string& uniform)
 {
-	LLFastTimer t(FTM_UNIFORM_LOCATION);
-
 	GLint ret = -1;
 	if (mProgramObject > 0)
 	{
@@ -792,8 +788,6 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform)
 
 GLint LLGLSLShader::getUniformLocation(U32 index)
 {
-	LLFastTimer t(FTM_UNIFORM_LOCATION);
-
 	GLint ret = -1;
 	if (mProgramObject > 0)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleTexGenV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleTexGenV.glsl
new file mode 100644
index 00000000000..d4dee78793e
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleTexGenV.glsl
@@ -0,0 +1,77 @@
+/** 
+ * @file simpleV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
+ATTRIBUTE vec3 position;
+void passTextureIndex();
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+
+uniform vec4 color;
+uniform vec4 object_plane_t;
+uniform vec4 object_plane_s;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+void calcAtmospherics(vec3 inPositionEye);
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
+vec4 texgen_object(vec4  vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
+{
+	vec4 tcoord;
+	
+	tcoord.x = dot(vpos, tp0);
+	tcoord.y = dot(vpos, tp1);
+	tcoord.z = tc.z;
+	tcoord.w = tc.w;
+	
+	tcoord = mat * tcoord; 
+	
+	return tcoord; 
+}
+
+void main()
+{
+	//transform vertex
+	vec4 vert = vec4(position.xyz,1.0);
+	passTextureIndex();
+	vec4 pos = (modelview_matrix * vert);
+	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+	vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;
+		
+	vec3 norm = normalize(normal_matrix * normal);
+
+	calcAtmospherics(pos.xyz);
+
+	vec4 color = calcLighting(pos.xyz, norm, color, vec4(0.));
+	vertex_color = color;
+
+	
+}
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index f6fe96877d2..4f6eaa5a5b7 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -169,7 +169,7 @@ void LLDrawPoolWater::render(S32 pass)
 	std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater());
 
 	// See if we are rendering water as opaque or not
-	if (!gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction)
+	if (!gSavedSettings.getBOOL("RenderTransparentWater"))
 	{
 		// render water for low end hardware
 		renderOpaqueLegacyWater();
@@ -334,9 +334,19 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
 {
 	LLVOSky *voskyp = gSky.mVOSkyp;
 
+	LLGLSLShader* shader = NULL;
 	if (LLGLSLShader::sNoFixedFunction)
 	{
-		gObjectSimpleProgram.bind();
+		if (LLPipeline::sUnderWaterRender)
+		{
+			shader = &gObjectSimpleNonIndexedTexGenWaterProgram;
+		}
+		else
+		{
+			shader = &gObjectSimpleNonIndexedTexGenProgram;
+		}
+
+		shader->bind();
 	}
 
 	stop_glerror();
@@ -361,10 +371,13 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
 	gGL.getTexUnit(0)->bind(mOpaqueWaterImagep);
 
 	// Automatically generate texture coords for water texture
-	glEnable(GL_TEXTURE_GEN_S); //texture unit 0
-	glEnable(GL_TEXTURE_GEN_T); //texture unit 0
-	glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
-	glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+	if (!shader)
+	{
+		glEnable(GL_TEXTURE_GEN_S); //texture unit 0
+		glEnable(GL_TEXTURE_GEN_T); //texture unit 0
+		glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+		glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+	}
 
 	// Use the fact that we know all water faces are the same size
 	// to save some computation
@@ -387,8 +400,16 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
 	F32 tp0[4] = { 16.f / 256.f, 0.0f, 0.0f, offset };
 	F32 tp1[4] = { 0.0f, 16.f / 256.f, 0.0f, offset };
 
-	glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0);
-	glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1);
+	if (!shader)
+	{
+		glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0);
+		glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1);
+	}
+	else
+	{
+		shader->uniform4fv("object_plane_s", 1, tp0);
+		shader->uniform4fv("object_plane_t", 1, tp1);
+	}
 
 	gGL.diffuseColor3f(1.f, 1.f, 1.f);
 
@@ -406,9 +427,12 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
 
 	stop_glerror();
 
-	// Reset the settings back to expected values
-	glDisable(GL_TEXTURE_GEN_S); //texture unit 0
-	glDisable(GL_TEXTURE_GEN_T); //texture unit 0
+	if (!shader)
+	{
+		// Reset the settings back to expected values
+		glDisable(GL_TEXTURE_GEN_S); //texture unit 0
+		glDisable(GL_TEXTURE_GEN_T); //texture unit 0
+	}
 
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 8bc573135c4..80727764c1f 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -96,6 +96,8 @@ LLGLSLShader		gObjectFullbrightNoColorProgram;
 LLGLSLShader		gObjectFullbrightNoColorWaterProgram;
 
 LLGLSLShader		gObjectSimpleNonIndexedProgram;
+LLGLSLShader		gObjectSimpleNonIndexedTexGenProgram;
+LLGLSLShader		gObjectSimpleNonIndexedTexGenWaterProgram;
 LLGLSLShader		gObjectSimpleNonIndexedWaterProgram;
 LLGLSLShader		gObjectAlphaMaskNonIndexedProgram;
 LLGLSLShader		gObjectAlphaMaskNonIndexedWaterProgram;
@@ -217,6 +219,8 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gObjectFullbrightShinyProgram);
 	mShaderList.push_back(&gObjectFullbrightShinyWaterProgram);
 	mShaderList.push_back(&gObjectSimpleNonIndexedProgram);
+	mShaderList.push_back(&gObjectSimpleNonIndexedTexGenProgram);
+	mShaderList.push_back(&gObjectSimpleNonIndexedTexGenWaterProgram);
 	mShaderList.push_back(&gObjectSimpleNonIndexedWaterProgram);
 	mShaderList.push_back(&gObjectAlphaMaskNonIndexedProgram);
 	mShaderList.push_back(&gObjectAlphaMaskNonIndexedWaterProgram);
@@ -625,6 +629,8 @@ void LLViewerShaderMgr::unloadShaders()
 	gObjectShinyWaterProgram.unload();
 
 	gObjectSimpleNonIndexedProgram.unload();
+	gObjectSimpleNonIndexedTexGenProgram.unload();
+	gObjectSimpleNonIndexedTexGenWaterProgram.unload();
 	gObjectSimpleNonIndexedWaterProgram.unload();
 	gObjectAlphaMaskNonIndexedProgram.unload();
 	gObjectAlphaMaskNonIndexedWaterProgram.unload();
@@ -1505,7 +1511,8 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		gObjectFullbrightShinyNonIndexedProgram.unload();
 		gObjectFullbrightShinyNonIndexedWaterProgram.unload();
 		gObjectShinyNonIndexedWaterProgram.unload();
-		gObjectSimpleNonIndexedProgram.unload();
+		gObjectSimpleNonIndexedTexGenProgram.unload();
+		gObjectSimpleNonIndexedTexGenWaterProgram.unload();
 		gObjectSimpleNonIndexedWaterProgram.unload();
 		gObjectAlphaMaskNonIndexedProgram.unload();
 		gObjectAlphaMaskNonIndexedWaterProgram.unload();
@@ -1547,6 +1554,23 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gObjectSimpleNonIndexedProgram.createShader(NULL, NULL);
 	}
 	
+	if (success)
+	{
+		gObjectSimpleNonIndexedTexGenProgram.mName = "Non indexed tex-gen Shader";
+		gObjectSimpleNonIndexedTexGenProgram.mFeatures.calculatesLighting = true;
+		gObjectSimpleNonIndexedTexGenProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasGamma = true;
+		gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasAtmospherics = true;
+		gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasLighting = true;
+		gObjectSimpleNonIndexedTexGenProgram.mFeatures.disableTextureIndex = true;
+		gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.clear();
+		gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectSimpleNonIndexedTexGenProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		success = gObjectSimpleNonIndexedTexGenProgram.createShader(NULL, NULL);
+	}
+	
+
 	if (success)
 	{
 		gObjectSimpleNonIndexedWaterProgram.mName = "Non indexed Water Shader";
@@ -1564,6 +1588,23 @@ BOOL LLViewerShaderMgr::loadShadersObject()
 		success = gObjectSimpleNonIndexedWaterProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gObjectSimpleNonIndexedTexGenWaterProgram.mName = "Non indexed tex-gen Water Shader";
+		gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.calculatesLighting = true;
+		gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.calculatesAtmospherics = true;
+		gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasWaterFog = true;
+		gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasAtmospherics = true;
+		gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasLighting = true;
+		gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.disableTextureIndex = true;
+		gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.clear();
+		gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER_ARB));
+		gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gObjectSimpleNonIndexedTexGenWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+		gObjectSimpleNonIndexedTexGenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+		success = gObjectSimpleNonIndexedTexGenWaterProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gObjectAlphaMaskNonIndexedProgram.mName = "Non indexed alpha mask Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 01f8c3987cd..26cef8cb3ef 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -229,6 +229,8 @@ extern LLGLSLShader			gObjectSimpleAlphaMaskProgram;
 extern LLGLSLShader			gObjectSimpleWaterProgram;
 extern LLGLSLShader			gObjectSimpleWaterAlphaMaskProgram;
 extern LLGLSLShader			gObjectSimpleNonIndexedProgram;
+extern LLGLSLShader			gObjectSimpleNonIndexedTexGenProgram;
+extern LLGLSLShader			gObjectSimpleNonIndexedTexGenWaterProgram;
 extern LLGLSLShader			gObjectSimpleNonIndexedWaterProgram;
 extern LLGLSLShader			gObjectAlphaMaskNonIndexedProgram;
 extern LLGLSLShader			gObjectAlphaMaskNonIndexedWaterProgram;
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 4a1db3d26cf..5bb70250310 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -73,11 +73,13 @@ static LLFastTimer::DeclareTimer FTM_WL_PARAM_UPDATE("WL Param Update");
 
 void LLWLParamSet::update(LLGLSLShader * shader) const 
 {	
+	LLFastTimer t(FTM_WL_PARAM_UPDATE);
+
 	for(LLSD::map_const_iterator i = mParamValues.beginMap();
 		i != mParamValues.endMap();
 		++i)
 	{
-		LLFastTimer t(FTM_WL_PARAM_UPDATE);
+		
 
 		const std::string& param = i->first;
 		
-- 
GitLab


From 9a0bb3d871d476d43edc6c7a29f6bedff1c45247 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 11 Oct 2011 15:11:52 -0500
Subject: [PATCH 106/933] SH-2510 Never use shaders if gl version < 2.0

---
 indra/newview/llviewershadermgr.cpp | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 80727764c1f..31ed210ae3a 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -357,6 +357,7 @@ void LLViewerShaderMgr::setShaders()
 
 	LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);
 
+	reentrance = true;
 
 	if (LLRender::sGLCoreProfile || gGLManager.mGLVersion >= 2.f)
 	{  //ALWAYS use shaders where available
@@ -364,19 +365,15 @@ void LLViewerShaderMgr::setShaders()
 		{ //vertex shaders MUST be enabled to use core profile
 			gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
 		}
-		
-		if (!gSavedSettings.getBOOL("RenderTransparentWater"))
-		{ //non-transparent water uses fixed function
-			gSavedSettings.setBOOL("RenderTransparentWater", TRUE);
-		}
 	}
-
-
+	else if (gGLManager.mGLVersion < 2.f)
+	{ //NEVER use shaders on a pre 2.0 context
+		gSavedSettings.setBOOL("VertexShaderEnable", FALSE);
+	}
+	
 	//setup preprocessor definitions
 	LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits);
-
-	reentrance = true;
-
+	
 	// Make sure the compiled shader map is cleared before we recompile shaders.
 	mShaderObjects.clear();
 	
-- 
GitLab


From 6c157557dc50806670dcf7fb5aa14bc5f9678282 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 12 Oct 2011 10:51:10 -0500
Subject: [PATCH 107/933] SH-2510 Potential fix for crash on startup on systems
 that don't have GL_ARB_shader_objects

---
 indra/llrender/llglslshader.cpp   | 9 ++++++---
 indra/newview/featuretable.txt    | 1 +
 indra/newview/featuretable_xp.txt | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index deb022fd75d..d6ab5208c6f 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -435,9 +435,12 @@ void LLGLSLShader::unbind()
 void LLGLSLShader::bindNoShader(void)
 {
 	LLVertexBuffer::unbind();
-	glUseProgramObjectARB(0);
-	sCurBoundShader = 0;
-	sCurBoundShaderPtr = NULL;
+	if (gGLManager.mHasShaderObjects)
+	{
+		glUseProgramObjectARB(0);
+		sCurBoundShader = 0;
+		sCurBoundShaderPtr = NULL;
+	}
 }
 
 S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode)
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 9379d336d06..22d76cb0827 100755
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -65,6 +65,7 @@ RenderShadowDetail			1	2
 WatchdogDisabled				1	1
 RenderUseStreamVBO			1	1
 RenderFSAASamples			1	16
+RenderMaxTextureIndex		1	32
 
 //
 // Low Graphics Settings
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt
index fffd30c0d8f..a8e13ce65c2 100644
--- a/indra/newview/featuretable_xp.txt
+++ b/indra/newview/featuretable_xp.txt
@@ -65,6 +65,7 @@ RenderShadowDetail			1	0
 WatchdogDisabled				1	1
 RenderUseStreamVBO			1	1
 RenderFSAASamples			1	16
+RenderMaxTextureIndex		1	32
 
 //
 // Low Graphics Settings
-- 
GitLab


From 1a499c13c813d4aa9631ffae00b36a053f260747 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 12 Oct 2011 11:06:57 -0500
Subject: [PATCH 108/933] NEVER use glFinish outside shutdownGL

---
 indra/llwindow/llwindowmacosx.cpp | 1 -
 indra/llwindow/llwindowsdl.cpp    | 1 -
 2 files changed, 2 deletions(-)

diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 4dd11541b98..cb2abc5bc04 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1266,7 +1266,6 @@ BOOL LLWindowMacOSX::setSize(const LLCoordScreen size)
 
 void LLWindowMacOSX::swapBuffers()
 {
-	glFinish();
 	aglSwapBuffers(mContext);
 }
 
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index e41aa9820f8..91689f54fdf 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -985,7 +985,6 @@ void LLWindowSDL::swapBuffers()
 {
 	if (mWindow)
 	{	
-		glFinish();
 		SDL_GL_SwapBuffers();
 	}
 }
-- 
GitLab


From 7b6723d1e0158d5dc326266a0332e87f634f9755 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 13 Oct 2011 01:19:45 -0500
Subject: [PATCH 109/933] SH-1650 Mitigate memory fragmentation by holding onto
 and reusing VBOs

---
 indra/llrender/llvertexbuffer.cpp       | 458 ++++++++++--------------
 indra/llrender/llvertexbuffer.h         |  69 ++--
 indra/newview/lldrawpoolavatar.cpp      |   6 +-
 indra/newview/lldrawpooltree.cpp        |   4 +-
 indra/newview/llface.cpp                |  13 +-
 indra/newview/llfloatermodelpreview.cpp |   2 +-
 indra/newview/llspatialpartition.cpp    |  10 +-
 indra/newview/llviewerdisplay.cpp       |   4 -
 indra/newview/llviewerwindow.cpp        |   2 +-
 indra/newview/llvoavatar.cpp            |   4 +-
 indra/newview/llvowlsky.cpp             |   4 +-
 indra/newview/pipeline.cpp              |  26 +-
 12 files changed, 257 insertions(+), 345 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 4484a880cc1..ad99bd1807c 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -38,6 +38,17 @@
 #include "llglslshader.h"
 #include "llmemory.h"
 
+//Next Highest Power Of Two
+//helper function, returns first number > v that is a power of 2, or v if v is already a power of 2
+U32 nhpo2(U32 v)
+{
+	U32 r = 1;
+	while (r < v) {
+		r *= 2;
+	}
+	return r;
+}
+
 
 //============================================================================
 
@@ -46,6 +57,7 @@ LLVBOPool LLVertexBuffer::sStreamVBOPool;
 LLVBOPool LLVertexBuffer::sDynamicVBOPool;
 LLVBOPool LLVertexBuffer::sStreamIBOPool;
 LLVBOPool LLVertexBuffer::sDynamicIBOPool;
+U32 LLVBOPool::sBytesPooled = 0;
 
 LLPrivateMemoryPool* LLVertexBuffer::sPrivatePoolp = NULL ;
 U32 LLVertexBuffer::sBindCount = 0;
@@ -66,7 +78,6 @@ BOOL LLVertexBuffer::sMapped = FALSE;
 BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
 BOOL LLVertexBuffer::sUseVAO = FALSE;
 BOOL LLVertexBuffer::sPreferStreamDraw = FALSE;
-std::vector<U32> LLVertexBuffer::sDeleteList;
 
 const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000;  //1 ms
 
@@ -122,6 +133,107 @@ class LLGLSyncFence : public LLGLFence
 
 };
 
+
+//which power of 2 is i?
+//assumes i is a power of 2 > 0
+U32 wpo2(U32 i)
+{
+	llassert(i > 0);
+	llassert(nhpo2(i) == i);
+
+	U32 r = 0;
+
+	while (i >>= 1) ++r;
+
+	return r;
+}
+
+U8* LLVBOPool::allocate(U32& name, U32 size)
+{
+	llassert(nhpo2(size) == size);
+
+	U32 i = wpo2(size);
+
+	if (mFreeList.size() <= i)
+	{
+		mFreeList.resize(i+1);
+	}
+
+	U8* ret = NULL;
+
+	if (mFreeList[i].empty())
+	{
+		//make a new buffer
+		glGenBuffersARB(1, &name);
+		glBindBufferARB(mType, name);
+		glBufferDataARB(mType, size, 0, mUsage);
+		LLVertexBuffer::sAllocatedBytes += size;
+
+		if (LLVertexBuffer::sDisableVBOMapping)
+		{
+			ret = (U8*) ll_aligned_malloc_16(size);
+		}
+		glBindBufferARB(mType, 0);
+	}
+	else
+	{
+		name = mFreeList[i].front().mGLName;
+		ret = mFreeList[i].front().mClientData;
+
+		sBytesPooled -= size;
+
+		mFreeList[i].pop_front();
+	}
+
+	return ret;
+}
+
+void LLVBOPool::release(U32 name, U8* buffer, U32 size)
+{
+	llassert(nhpo2(size) == size);
+
+	U32 i = wpo2(size);
+
+	llassert(mFreeList.size() > i);
+
+	Record rec;
+	rec.mGLName = name;
+	rec.mClientData = buffer;
+
+	sBytesPooled += size;
+
+	mFreeList[i].push_back(rec);
+}
+
+void LLVBOPool::cleanup()
+{
+	U32 size = 1;
+
+	for (U32 i = 0; i < mFreeList.size(); ++i)
+	{
+		record_list_t& l = mFreeList[i];
+
+		while (!l.empty())
+		{
+			Record& r = l.front();
+
+			glDeleteBuffersARB(1, &r.mGLName);
+
+			if (r.mClientData)
+			{
+				ll_aligned_free_16(r.mClientData);
+			}
+
+			l.pop_front();
+
+			LLVertexBuffer::sAllocatedBytes -= size;
+		}
+
+		size *= 2;
+	}
+}
+
+
 //NOTE: each component must be AT LEAST 4 bytes in size to avoid a performance penalty on AMD hardware
 S32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] =
 {
@@ -374,16 +486,16 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
 
 void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const
 {
-	if (start >= (U32) mRequestedNumVerts ||
-	    end >= (U32) mRequestedNumVerts)
+	if (start >= (U32) mNumVerts ||
+	    end >= (U32) mNumVerts)
 	{
-		llerrs << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mRequestedNumVerts << llendl;
+		llerrs << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << llendl;
 	}
 
-	llassert(mRequestedNumIndices >= 0);
+	llassert(mNumIndices >= 0);
 
-	if (indices_offset >= (U32) mRequestedNumIndices ||
-	    indices_offset + count > (U32) mRequestedNumIndices)
+	if (indices_offset >= (U32) mNumIndices ||
+	    indices_offset + count > (U32) mNumIndices)
 	{
 		llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
 	}
@@ -407,7 +519,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 
 	gGL.syncMatrices();
 
-	llassert(mRequestedNumVerts >= 0);
+	llassert(mNumVerts >= 0);
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
 
 	if (mGLArray)
@@ -462,9 +574,9 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 
 	gGL.syncMatrices();
 
-	llassert(mRequestedNumIndices >= 0);
-	if (indices_offset >= (U32) mRequestedNumIndices ||
-	    indices_offset + count > (U32) mRequestedNumIndices)
+	llassert(mNumIndices >= 0);
+	if (indices_offset >= (U32) mNumIndices ||
+	    indices_offset + count > (U32) mNumIndices)
 	{
 		llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
 	}
@@ -508,9 +620,9 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 	
 	gGL.syncMatrices();
 	
-	llassert(mRequestedNumVerts >= 0);
-	if (first >= (U32) mRequestedNumVerts ||
-	    first + count > (U32) mRequestedNumVerts)
+	llassert(mNumVerts >= 0);
+	if (first >= (U32) mNumVerts ||
+	    first + count > (U32) mNumVerts)
 	{
 		llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl;
 	}
@@ -546,23 +658,22 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
 {
 	sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ;
-	if(sEnableVBOs)
-	{
-		//llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded.
-
-		llinfos << "VBO is enabled." << llendl ;
-	}
-	else
-	{
-		llinfos << "VBO is disabled." << llendl ;
-	}
-
 	sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
 
 	if(!sPrivatePoolp)
 	{ 
 		sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
 	}
+
+	sStreamVBOPool.mType = GL_ARRAY_BUFFER_ARB;
+	sStreamVBOPool.mUsage= GL_STREAM_DRAW_ARB;
+	sStreamIBOPool.mType = GL_ELEMENT_ARRAY_BUFFER_ARB;
+	sStreamIBOPool.mUsage= GL_STREAM_DRAW_ARB;
+
+	sDynamicVBOPool.mType = GL_ARRAY_BUFFER_ARB;
+	sDynamicVBOPool.mUsage= GL_DYNAMIC_DRAW_ARB;
+	sDynamicIBOPool.mType = GL_ELEMENT_ARRAY_BUFFER_ARB;
+	sDynamicIBOPool.mUsage= GL_DYNAMIC_DRAW_ARB;
 }
 
 //static 
@@ -600,7 +711,11 @@ void LLVertexBuffer::cleanupClass()
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_CLEANUP_CLASS);
 	unbind();
-	clientCopy(); // deletes GL buffers
+	
+	sStreamIBOPool.cleanup();
+	sDynamicIBOPool.cleanup();
+	sStreamVBOPool.cleanup();
+	sDynamicVBOPool.cleanup();
 
 	if(sPrivatePoolp)
 	{
@@ -609,15 +724,6 @@ void LLVertexBuffer::cleanupClass()
 	}
 }
 
-void LLVertexBuffer::clientCopy(F64 max_time)
-{
-	if (!sDeleteList.empty())
-	{
-		glDeleteBuffersARB(sDeleteList.size(), (GLuint*) &(sDeleteList[0]));
-		sDeleteList.clear();
-	}
-}
-
 //----------------------------------------------------------------------------
 
 LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
@@ -625,8 +731,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 
 	mNumVerts(0),
 	mNumIndices(0),
-	mRequestedNumVerts(-1),
-	mRequestedNumIndices(-1),
 	mUsage(usage),
 	mGLBuffer(0),
 	mGLArray(0),
@@ -636,10 +740,7 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 	mVertexLocked(FALSE),
 	mIndexLocked(FALSE),
 	mFinal(FALSE),
-	mFilthy(FALSE),
 	mEmpty(TRUE),
-	mResized(FALSE),
-	mDynamicSize(FALSE),
 	mFence(NULL)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR);
@@ -664,6 +765,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 		mUsage = GL_STREAM_DRAW_ARB;
 	}
 
+	if (mUsage && mUsage != GL_STREAM_DRAW_ARB)
+	{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
+		mUsage = GL_DYNAMIC_DRAW_ARB;
+	}
+		
 	//zero out offsets
 	for (U32 i = 0; i < TYPE_MAX; i++)
 	{
@@ -672,6 +778,7 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 
 	mTypeMask = typemask;
 	mSize = 0;
+	mIndicesSize = 0;
 	mAlignedOffset = 0;
 	mAlignedIndexOffset = 0;
 
@@ -775,39 +882,35 @@ void LLVertexBuffer::waitFence() const
 
 //----------------------------------------------------------------------------
 
-void LLVertexBuffer::genBuffer()
+void LLVertexBuffer::genBuffer(U32 size)
 {
+	mSize = nhpo2(size);
+
 	if (mUsage == GL_STREAM_DRAW_ARB)
 	{
-		mGLBuffer = sStreamVBOPool.allocate();
-	}
-	else if (mUsage == GL_DYNAMIC_DRAW_ARB)
-	{
-		mGLBuffer = sDynamicVBOPool.allocate();
+		mMappedData = sStreamVBOPool.allocate(mGLBuffer, mSize);
 	}
 	else
 	{
-		BOOST_STATIC_ASSERT(sizeof(mGLBuffer) == sizeof(GLuint));
-		glGenBuffersARB(1, (GLuint*)&mGLBuffer);
+		mMappedData = sDynamicVBOPool.allocate(mGLBuffer, mSize);
 	}
+	
 	sGLCount++;
 }
 
-void LLVertexBuffer::genIndices()
+void LLVertexBuffer::genIndices(U32 size)
 {
+	mIndicesSize = nhpo2(size);
+
 	if (mUsage == GL_STREAM_DRAW_ARB)
 	{
-		mGLIndices = sStreamIBOPool.allocate();
-	}
-	else if (mUsage == GL_DYNAMIC_DRAW_ARB)
-	{
-		mGLIndices = sDynamicIBOPool.allocate();
+		mMappedIndexData = sStreamIBOPool.allocate(mGLIndices, mIndicesSize);
 	}
 	else
 	{
-		BOOST_STATIC_ASSERT(sizeof(mGLBuffer) == sizeof(GLuint));
-		glGenBuffersARB(1, (GLuint*)&mGLIndices);
+		mMappedIndexData = sDynamicIBOPool.allocate(mGLIndices, mIndicesSize);
 	}
+	
 	sGLCount++;
 }
 
@@ -815,16 +918,16 @@ void LLVertexBuffer::releaseBuffer()
 {
 	if (mUsage == GL_STREAM_DRAW_ARB)
 	{
-		sStreamVBOPool.release(mGLBuffer);
-	}
-	else if (mUsage == GL_DYNAMIC_DRAW_ARB)
-	{
-		sDynamicVBOPool.release(mGLBuffer);
+		sStreamVBOPool.release(mGLBuffer, mMappedData, mSize);
 	}
 	else
 	{
-		sDeleteList.push_back(mGLBuffer);
+		sDynamicVBOPool.release(mGLBuffer, mMappedData, mSize);
 	}
+	
+	mGLBuffer = 0;
+	mMappedData = NULL;
+
 	sGLCount--;
 }
 
@@ -832,24 +935,23 @@ void LLVertexBuffer::releaseIndices()
 {
 	if (mUsage == GL_STREAM_DRAW_ARB)
 	{
-		sStreamIBOPool.release(mGLIndices);
+		sStreamIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize);
 	}
 	else if (mUsage == GL_DYNAMIC_DRAW_ARB)
 	{
-		sDynamicIBOPool.release(mGLIndices);
-	}
-	else
-	{
-		sDeleteList.push_back(mGLIndices);
+		sDynamicIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize);
 	}
+
+	mGLIndices = 0;
+	mMappedIndexData = NULL;
+	
 	sGLCount--;
 }
 
-void LLVertexBuffer::createGLBuffer()
+void LLVertexBuffer::createGLBuffer(U32 size)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_VERTICES);
 	
-	U32 size = getSize();
 	if (mGLBuffer)
 	{
 		destroyGLBuffer();
@@ -864,23 +966,21 @@ void LLVertexBuffer::createGLBuffer()
 
 	if (useVBOs())
 	{
-		mMappedData = NULL;
-		genBuffer();
-		mResized = TRUE;
+		genBuffer(size);
 	}
 	else
 	{
 		static int gl_buffer_idx = 0;
 		mGLBuffer = ++gl_buffer_idx;
 		mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
+		mSize = size;
 	}
 }
 
-void LLVertexBuffer::createGLIndices()
+void LLVertexBuffer::createGLIndices(U32 size)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_INDICES);
-	U32 size = getIndicesSize();
-
+	
 	if (mGLIndices)
 	{
 		destroyGLIndices();
@@ -900,15 +1000,14 @@ void LLVertexBuffer::createGLIndices()
 	{
 		//pad by another 16 bytes for VBO pointer adjustment
 		size += 16;
-		mMappedIndexData = NULL;
-		genIndices();
-		mResized = TRUE;
+		genIndices(size);
 	}
 	else
 	{
 		mMappedIndexData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
 		static int gl_buffer_idx = 0;
 		mGLIndices = ++gl_buffer_idx;
+		mIndicesSize = size;
 	}
 }
 
@@ -919,12 +1018,6 @@ void LLVertexBuffer::destroyGLBuffer()
 	{
 		if (useVBOs())
 		{
-			freeClientBuffer() ;
-
-			if (mMappedData || mMappedIndexData)
-			{
-				llerrs << "Vertex buffer destroyed while mapped!" << llendl;
-			}
 			releaseBuffer();
 		}
 		else
@@ -933,8 +1026,6 @@ void LLVertexBuffer::destroyGLBuffer()
 			mMappedData = NULL;
 			mEmpty = TRUE;
 		}
-
-		sAllocatedBytes -= getSize();
 	}
 	
 	mGLBuffer = 0;
@@ -948,12 +1039,6 @@ void LLVertexBuffer::destroyGLIndices()
 	{
 		if (useVBOs())
 		{
-			freeClientBuffer() ;
-
-			if (mMappedData || mMappedIndexData)
-			{
-				llerrs << "Vertex buffer destroyed while mapped." << llendl;
-			}
 			releaseIndices();
 		}
 		else
@@ -962,8 +1047,6 @@ void LLVertexBuffer::destroyGLIndices()
 			mMappedIndexData = NULL;
 			mEmpty = TRUE;
 		}
-
-		sAllocatedBytes -= getIndicesSize();
 	}
 
 	mGLIndices = 0;
@@ -982,23 +1065,14 @@ void LLVertexBuffer::updateNumVerts(S32 nverts)
 		nverts = 65535;
 	}
 
-	mRequestedNumVerts = nverts;
+	U32 needed_size = calcOffsets(mTypeMask, mOffsets, nverts);
 
-	if (!mDynamicSize)
+	if (needed_size > mSize || needed_size <= mSize/2)
 	{
-		mNumVerts = nverts;
-	}
-	else if (mUsage == GL_STATIC_DRAW_ARB ||
-		nverts > mNumVerts ||
-		nverts < mNumVerts/2)
-	{
-		if (mUsage != GL_STATIC_DRAW_ARB && nverts + nverts/4 <= 65535)
-		{
-			nverts += nverts/4;
-		}
-		mNumVerts = nverts;
+		createGLBuffer(needed_size);
 	}
-	mSize = calcOffsets(mTypeMask, mOffsets, mNumVerts);
+
+	mNumVerts = nverts;
 }
 
 void LLVertexBuffer::updateNumIndices(S32 nindices)
@@ -1007,22 +1081,14 @@ void LLVertexBuffer::updateNumIndices(S32 nindices)
 
 	llassert(nindices >= 0);
 
-	mRequestedNumIndices = nindices;
-	if (!mDynamicSize)
+	U32 needed_size = sizeof(U16) * nindices;
+
+	if (needed_size > mIndicesSize || needed_size <= mIndicesSize/2)
 	{
-		mNumIndices = nindices;
+		createGLIndices(needed_size);
 	}
-	else if (mUsage == GL_STATIC_DRAW_ARB ||
-		nindices > mNumIndices ||
-		nindices < mNumIndices/2)
-	{
-		if (mUsage != GL_STATIC_DRAW_ARB)
-		{
-			nindices += nindices/4;
-		}
 
-		mNumIndices = nindices;
-	}
+	mNumIndices = nindices;
 }
 
 void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
@@ -1040,15 +1106,8 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 	updateNumVerts(nverts);
 	updateNumIndices(nindices);
 	
-	if (mMappedData)
-	{
-		llerrs << "LLVertexBuffer::allocateBuffer() called redundantly." << llendl;
-	}
 	if (create && (nverts || nindices))
 	{
-		createGLBuffer();
-		createGLIndices();
-
 		//actually allocate space for the vertex buffer if using VBO mapping
 		flush();
 
@@ -1060,8 +1119,6 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 			setupVertexArray();
 		}
 	}
-	
-	sAllocatedBytes += getSize() + getIndicesSize();
 }
 
 void LLVertexBuffer::setupVertexArray()
@@ -1151,77 +1208,13 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
 	llassert(newnverts >= 0);
 	llassert(newnindices >= 0);
 
-	mRequestedNumVerts = newnverts;
-	mRequestedNumIndices = newnindices;
-
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_RESIZE_BUFFER);
-	mDynamicSize = TRUE;
-	if (mUsage == GL_STATIC_DRAW_ARB)
-	{ //always delete/allocate static buffers on resize
-		destroyGLBuffer();
-		destroyGLIndices();
-		allocateBuffer(newnverts, newnindices, TRUE);
-		mFinal = FALSE;
-	}
-	else if (newnverts > mNumVerts || newnindices > mNumIndices ||
-			 newnverts < mNumVerts/2 || newnindices < mNumIndices/2)
-	{
-		sAllocatedBytes -= getSize() + getIndicesSize();
-		
-		updateNumVerts(newnverts);		
-		updateNumIndices(newnindices);
-		
-		S32 newsize = getSize();
-		S32 new_index_size = getIndicesSize();
-
-		sAllocatedBytes += newsize + new_index_size;
-
-		if (newsize)
-		{
-			if (!mGLBuffer)
-			{ //no buffer exists, create a new one
-				createGLBuffer();
-			}
-			else
-			{
-				if (!useVBOs())
-				{
-					FREE_MEM(sPrivatePoolp, mMappedData);
-					mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, newsize);
-				}
-				mResized = TRUE;
-			}
-		}
-		else if (mGLBuffer)
-		{
-			destroyGLBuffer();
-		}
-		
-		if (new_index_size)
-		{
-			if (!mGLIndices)
-			{
-				createGLIndices();
-			}
-			else
-			{
-				if (!useVBOs())
-				{
-					FREE_MEM(sPrivatePoolp, mMappedIndexData) ;
-					mMappedIndexData = (U8*)ALLOCATE_MEM(sPrivatePoolp, new_index_size);
-				}
-				mResized = TRUE;
-			}
-		}
-		else if (mGLIndices)
-		{
-			destroyGLIndices();
-		}
-	}
-
-	if (mResized && useVBOs())
+	
+	updateNumVerts(newnverts);		
+	updateNumIndices(newnindices);
+	
+	if (useVBOs())
 	{
-		freeClientBuffer();
 		flush();
 
 		if (mGLArray)
@@ -1244,32 +1237,6 @@ BOOL LLVertexBuffer::useVBOs() const
 }
 
 //----------------------------------------------------------------------------
-void LLVertexBuffer::freeClientBuffer()
-{
-	if(useVBOs() && sDisableVBOMapping && (mMappedData || mMappedIndexData))
-	{
-		FREE_MEM(sPrivatePoolp, mMappedData) ;
-		FREE_MEM(sPrivatePoolp, mMappedIndexData) ;
-		mMappedData = NULL ;
-		mMappedIndexData = NULL ;
-	}
-}
-
-void LLVertexBuffer::allocateClientVertexBuffer()
-{
-	if(!mMappedData)
-	{
-		mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, getSize());
-	}
-}
-
-void LLVertexBuffer::allocateClientIndexBuffer()
-{
-	if(!mMappedIndexData)
-	{
-		mMappedIndexData = (U8*)ALLOCATE_MEM(sPrivatePoolp, getIndicesSize());		
-	}
-}
 
 bool expand_region(LLVertexBuffer::MappedRegion& region, S32 index, S32 count)
 {
@@ -1350,7 +1317,6 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 			if(sDisableVBOMapping)
 			{
 				map_range = false;
-				allocateClientVertexBuffer() ;
 			}
 			else
 			{
@@ -1535,7 +1501,6 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 			if(sDisableVBOMapping)
 			{
 				map_range = false;
-				allocateClientIndexBuffer() ;
 			}
 			else
 			{
@@ -1772,21 +1737,7 @@ void LLVertexBuffer::unmapBuffer()
 
 	if(updated_all)
 	{
-		if(mUsage == GL_STATIC_DRAW_ARB)
-		{
-			//static draw buffers can only be mapped a single time
-			//throw out client data (we won't be using it again)
-			mEmpty = TRUE;
-			mFinal = TRUE;
-			if(sDisableVBOMapping)
-			{
-				freeClientBuffer() ;
-			}
-		}
-		else
-		{
-			mEmpty = FALSE;
-		}
+		mEmpty = FALSE;
 	}
 }
 
@@ -1965,27 +1916,6 @@ void LLVertexBuffer::flush()
 {
 	if (useVBOs())
 	{
-		if (mResized)
-		{
-			if (mGLBuffer)
-			{
-				stop_glerror();
-				bindGLBuffer(true);
-				glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage);
-				stop_glerror();
-			}
-			if (mGLIndices)
-			{
-				stop_glerror();
-				bindGLIndices(true);
-				glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage);
-				stop_glerror();
-			}
-
-			mEmpty = TRUE;
-			mResized = FALSE;
-		}
-
 		unmapBuffer();
 	}
 }
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index b50c409c494..3e6f6a959ae 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -51,24 +51,32 @@
 
 //============================================================================
 // gl name pools for dynamic and streaming buffers
-class LLVBOPool : public LLGLNamePool
+class LLVBOPool
 {
-protected:
-	virtual GLuint allocateName()
-	{
-		GLuint name;
-		stop_glerror();
-		glGenBuffersARB(1, &name);
-		stop_glerror();
-		return name;
-	}
+public:
+	static U32 sBytesPooled;
+
+	U32 mUsage;
+	U32 mType;
 
-	virtual void releaseName(GLuint name)
+	//size MUST be a power of 2
+	U8* allocate(U32& name, U32 size);
+	
+	//size MUST be the size provided to allocate that returned the given name
+	void release(U32 name, U8* buffer, U32 size);
+	
+	//destroy all records in mFreeList
+	void cleanup();
+
+	class Record
 	{
-		stop_glerror();
-		glDeleteBuffersARB(1, &name);
-		stop_glerror();
-	}
+	public:
+		U32 mGLName;
+		U8* mClientData;
+	};
+
+	typedef std::list<Record> record_list_t;
+	std::vector<record_list_t> mFreeList;
 };
 
 class LLGLFence
@@ -120,8 +128,7 @@ class LLVertexBuffer : public LLRefCount
 	static void drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm);
 	static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp);
 
- 	static void clientCopy(F64 max_time = 0.005); //copy data from client to GL
-	static void unbind(); //unbind any bound vertex buffer
+ 	static void unbind(); //unbind any bound vertex buffer
 
 	//get the size of a vertex with the given typemask
 	static S32 calcVertexSize(const U32& typemask);
@@ -181,25 +188,22 @@ class LLVertexBuffer : public LLRefCount
 	virtual void setupVertexBuffer(U32 data_mask); // pure virtual, called from mapBuffer()
 	void setupVertexArray();
 	
-	void	genBuffer();
-	void	genIndices();
+	void	genBuffer(U32 size);
+	void	genIndices(U32 size);
 	bool	bindGLBuffer(bool force_bind = false);
 	bool	bindGLIndices(bool force_bind = false);
 	bool	bindGLArray();
 	void	releaseBuffer();
 	void	releaseIndices();
-	void	createGLBuffer();
-	void	createGLIndices();
+	void	createGLBuffer(U32 size);
+	void	createGLIndices(U32 size);
 	void 	destroyGLBuffer();
 	void 	destroyGLIndices();
 	void	updateNumVerts(S32 nverts);
 	void	updateNumIndices(S32 nindices); 
 	virtual BOOL	useVBOs() const;
 	void	unmapBuffer();
-	void freeClientBuffer() ;
-	void allocateClientVertexBuffer() ;
-	void allocateClientIndexBuffer() ;
-
+		
 public:
 	LLVertexBuffer(U32 typemask, S32 usage);
 	
@@ -239,15 +243,13 @@ class LLVertexBuffer : public LLRefCount
 	BOOL isLocked() const					{ return mVertexLocked || mIndexLocked; }
 	S32 getNumVerts() const					{ return mNumVerts; }
 	S32 getNumIndices() const				{ return mNumIndices; }
-	S32 getRequestedVerts() const			{ return mRequestedNumVerts; }
-	S32 getRequestedIndices() const			{ return mRequestedNumIndices; }
-
+	
 	U8* getIndicesPointer() const			{ return useVBOs() ? (U8*) mAlignedIndexOffset : mMappedIndexData; }
 	U8* getVerticesPointer() const			{ return useVBOs() ? (U8*) mAlignedOffset : mMappedData; }
 	U32 getTypeMask() const					{ return mTypeMask; }
 	bool hasDataType(S32 type) const		{ return ((1 << type) & getTypeMask()); }
 	S32 getSize() const;
-	S32 getIndicesSize() const				{ return mNumIndices * sizeof(U16); }
+	S32 getIndicesSize() const				{ return mIndicesSize; }
 	U8* getMappedData() const				{ return mMappedData; }
 	U8* getMappedIndices() const			{ return mMappedIndexData; }
 	S32 getOffset(S32 type) const			{ return mOffsets[type]; }
@@ -265,12 +267,11 @@ class LLVertexBuffer : public LLRefCount
 protected:	
 	S32		mNumVerts;		// Number of vertices allocated
 	S32		mNumIndices;	// Number of indices allocated
-	S32		mRequestedNumVerts;  // Number of vertices requested
-	S32		mRequestedNumIndices;  // Number of indices requested
-
+	
 	ptrdiff_t mAlignedOffset;
 	ptrdiff_t mAlignedIndexOffset;
 	S32		mSize;
+	S32		mIndicesSize;
 	U32		mTypeMask;
 	S32		mUsage;			// GL usage
 	U32		mGLBuffer;		// GL VBO handle
@@ -282,10 +283,7 @@ class LLVertexBuffer : public LLRefCount
 	BOOL	mVertexLocked;			// if TRUE, vertex buffer is being or has been written to in client memory
 	BOOL	mIndexLocked;			// if TRUE, index buffer is being or has been written to in client memory
 	BOOL	mFinal;			// if TRUE, buffer can not be mapped again
-	BOOL	mFilthy;		// if TRUE, entire buffer must be copied (used to prevent redundant dirty flags)
 	BOOL	mEmpty;			// if TRUE, client buffer is empty (or NULL). Old values have been discarded.	
-	BOOL	mResized;		// if TRUE, client buffer has been resized and GL buffer has not
-	BOOL	mDynamicSize;	// if TRUE, buffer has been resized at least once (and should be padded)
 	S32		mOffsets[TYPE_MAX];
 
 	std::vector<MappedRegion> mMappedVertexRegions;
@@ -305,7 +303,6 @@ class LLVertexBuffer : public LLRefCount
 	static S32 sGLCount;
 	static S32 sMappedCount;
 	static BOOL sMapped;
-	static std::vector<U32> sDeleteList;
 	typedef std::list<LLVertexBuffer*> buffer_list_t;
 		
 	static BOOL sDisableVBOMapping; //disable glMapBufferARB
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index a710bdcdbd2..7290a48a1a5 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1277,8 +1277,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 	
 	if (buffer.isNull() || 
 		buffer->getTypeMask() != data_mask ||
-		buffer->getRequestedVerts() != vol_face.mNumVertices ||
-		buffer->getRequestedIndices() != vol_face.mNumIndices ||
+		buffer->getNumVerts() != vol_face.mNumVertices ||
+		buffer->getNumIndices() != vol_face.mNumIndices ||
 		(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
 	{
 		face->setGeomIndex(0);
@@ -1366,7 +1366,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 		LLMatrix4a bind_shape_matrix;
 		bind_shape_matrix.loadu(skin->mBindShapeMatrix);
 
-		for (U32 j = 0; j < buffer->getRequestedVerts(); ++j)
+		for (U32 j = 0; j < buffer->getNumVerts(); ++j)
 		{
 			LLMatrix4a final_mat;
 			final_mat.clear();
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 3fe5b4d9291..cdf6e1ab523 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -113,8 +113,8 @@ void LLDrawPoolTree::render(S32 pass)
 			if(buff)
 			{
 				buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
-				buff->drawRange(LLRender::TRIANGLES, 0, buff->getRequestedVerts()-1, buff->getRequestedIndices(), 0); 
-				gPipeline.addTrianglesDrawn(buff->getRequestedIndices());
+				buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); 
+				gPipeline.addTrianglesDrawn(buff->getNumIndices());
 			}
 		}
 	}
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 36b88ebbd47..eab3dcfaddb 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -362,8 +362,8 @@ void LLFace::setSize(S32 num_vertices, S32 num_indices, bool align)
 {
 	if (align)
 	{
-		//allocate vertices in blocks of 16 for alignment
-		num_vertices = (num_vertices + 0xF) & ~0xF;
+		//allocate vertices in blocks of 4 for alignment
+		num_vertices = (num_vertices + 0x3) & ~0x3;
 	}
 	
 	if (mGeomCount != num_vertices ||
@@ -1073,6 +1073,11 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	S32 num_vertices = (S32)vf.mNumVertices;
 	S32 num_indices = (S32) vf.mNumIndices;
 	
+	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE))
+	{
+		updateRebuildFlags();
+	}
+
 	bool map_range = gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange;
 
 	if (mVertexBuffer.notNull())
@@ -2055,7 +2060,7 @@ BOOL LLFace::verify(const U32* indices_array) const
 	}
 	
 	// First, check whether the face data fits within the pool's range.
-	if ((mGeomIndex + mGeomCount) > mVertexBuffer->getRequestedVerts())
+	if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
 	{
 		ok = FALSE;
 		llinfos << "Face references invalid vertices!" << llendl;
@@ -2074,7 +2079,7 @@ BOOL LLFace::verify(const U32* indices_array) const
 		llinfos << "Face has bogus indices count" << llendl;
 	}
 	
-	if (mIndicesIndex + mIndicesCount > mVertexBuffer->getRequestedIndices())
+	if (mIndicesIndex + mIndicesCount > mVertexBuffer->getNumIndices())
 	{
 		ok = FALSE;
 		llinfos << "Face references invalid indices!" << llendl;
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index d9ce72a2c24..8f6013f2d9c 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5457,7 +5457,7 @@ BOOL LLModelPreview::render()
 								}
 							}
 
-							for (U32 j = 0; j < buffer->getRequestedVerts(); ++j)
+							for (U32 j = 0; j < buffer->getNumVerts(); ++j)
 							{
 								LLMatrix4 final_mat;
 								final_mat.mMatrix[0][0] = final_mat.mMatrix[1][1] = final_mat.mMatrix[2][2] = final_mat.mMatrix[3][3] = 0.f;
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index ffb0ce4056d..2530f1f0d4b 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2454,7 +2454,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask)
 	if (buffer)
 	{
 		buffer->setBuffer(mask);
-		buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getRequestedVerts()-1, buffer->getRequestedIndices(), 0);
+		buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 	}
 }
 
@@ -2526,7 +2526,7 @@ void renderOctree(LLSpatialGroup* group)
 	//coded by buffer usage and activity
 	gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
 	LLVector4 col;
-	/*if (group->mBuilt > 0.f)
+	if (group->mBuilt > 0.f)
 	{
 		group->mBuilt -= 2.f * gFrameIntervalSeconds;
 		if (group->mBufferUsage == GL_STATIC_DRAW_ARB)
@@ -2595,7 +2595,7 @@ void renderOctree(LLSpatialGroup* group)
 			gGL.diffuseColor4f(1,1,1,1);
 		}
 	}
-	else*/
+	else
 	{
 		if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty() 
 			&& group->mSpatialPartition->mRenderByGroup)
@@ -3442,11 +3442,11 @@ void renderPhysicsShapes(LLSpatialGroup* group)
 
 						buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
 						gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
-						buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0);
+						buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
 									
 						gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
 						glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-						buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0);
+						buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
 					}
 				}
 			}
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 1832416a4b8..e0359cc61de 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -661,10 +661,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		
 		{ 
 			LLMemType mt_ds(LLMemType::MTYPE_DISPLAY_SWAP);
-			{
- 				LLFastTimer ftm(FTM_CLIENT_COPY);
-				LLVertexBuffer::clientCopy(0.016);
-			}
 
 			if (gResizeScreenTexture)
 			{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 2aac43d99ef..f3e9bc711aa 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -532,7 +532,7 @@ class LLDebugText
 			
 			}
 
-			addText(xpos, ypos, llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024)));
+			addText(xpos, ypos, llformat("%d MB Vertex Data (%d MB Pooled)", LLVertexBuffer::sAllocatedBytes/(1024*1024), LLVBOPool::sBytesPooled/(1024*1024)));
 			ypos += y_inc;
 
 			addText(xpos, ypos, llformat("%d Vertex Buffers", LLVertexBuffer::sGLCount));
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 5687ba50648..65069387665 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2117,8 +2117,8 @@ void LLVOAvatar::updateMeshData()
 			}
 			else
 			{
-				if (buff->getRequestedIndices() == num_indices &&
-					buff->getRequestedVerts() == num_vertices)
+				if (buff->getNumIndices() == num_indices &&
+					buff->getNumVerts() == num_vertices)
 				{
 					terse_update = true;
 				}
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index 14fd0a1eb14..f1c5499d847 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -516,9 +516,9 @@ void LLVOWLSky::drawDome(void)
 
 		strips_segment->drawRange(
 			LLRender::TRIANGLE_STRIP, 
-			0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), 
+			0, strips_segment->getNumVerts()-1, strips_segment->getNumIndices(), 
 			0);
-		gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices(), LLRender::TRIANGLE_STRIP);
+		gPipeline.addTrianglesDrawn(strips_segment->getNumIndices(), LLRender::TRIANGLE_STRIP);
 	}
 
 #else
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e4125c8dc86..5035e0197d7 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -264,15 +264,7 @@ std::string gPoolNames[] =
 
 void drawBox(const LLVector3& c, const LLVector3& r);
 void drawBoxOutline(const LLVector3& pos, const LLVector3& size);
-
-U32 nhpo2(U32 v) 
-{
-	U32 r = 1;
-	while (r < v) {
-		r *= 2;
-	}
-	return r;
-}
+U32 nhpo2(U32 v);
 
 glh::matrix4f glh_copy_matrix(F32* src)
 {
@@ -2902,11 +2894,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 			}
 		}
 	}
-	{
-		LLFastTimer ftm(FTM_CLIENT_COPY);
-		LLVertexBuffer::clientCopy();
-	}
-	
+		
 	postSort(camera);	
 }
 
@@ -6122,13 +6110,7 @@ void LLPipeline::resetVertexBuffers()
 		llwarns << "VBO wipe failed." << llendl;
 	}
 
-	if (!LLVertexBuffer::sStreamIBOPool.mNameList.empty() ||
-		!LLVertexBuffer::sStreamVBOPool.mNameList.empty() ||
-		!LLVertexBuffer::sDynamicIBOPool.mNameList.empty() ||
-		!LLVertexBuffer::sDynamicVBOPool.mNameList.empty())
-	{
-		llwarns << "VBO name pool cleanup failed." << llendl;
-	}
+	llassert(LLVertexBuffer::sGLCount == 0);
 
 	LLVertexBuffer::unbind();	
 	
@@ -6142,6 +6124,8 @@ void LLPipeline::resetVertexBuffers()
 	sBakeSunlight = gSavedSettings.getBOOL("RenderBakeSunlight");
 	sNoAlpha = gSavedSettings.getBOOL("RenderNoAlpha");
 	LLPipeline::sTextureBindTest = gSavedSettings.getBOOL("RenderDebugTextureBind");
+
+	LLVertexBuffer::initClass(LLVertexBuffer::sEnableVBOs, LLVertexBuffer::sDisableVBOMapping);
 }
 
 void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture)
-- 
GitLab


From 715c911d4a22ee7533e4db3e6e570ac3acb8108d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 13 Oct 2011 16:32:24 -0500
Subject: [PATCH 110/933] SH-2559 Remove fast timer (could be responsible for
 some crashes).

---
 indra/llcommon/llsdserialize_xml.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp
index bf216d41bf1..97aff3c89ae 100644
--- a/indra/llcommon/llsdserialize_xml.cpp
+++ b/indra/llcommon/llsdserialize_xml.cpp
@@ -354,7 +354,6 @@ static unsigned get_till_eol(std::istream& input, char *buf, unsigned bufsize)
 	return count;
 }
 
-LLFastTimer::DeclareTimer FTM_SD_PARSE_READ_STREAM("LLSD Read Stream");
 S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
 {
 	XML_Status status;
@@ -374,7 +373,7 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
 		{
 			break;
 		}
-		{ LLFastTimer _(FTM_SD_PARSE_READ_STREAM);
+		{ 
 		
 			count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
 			if (!count)
-- 
GitLab


From 06367e6f453b50e768cca377c9829796ac00b771 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 14 Oct 2011 17:43:31 -0500
Subject: [PATCH 111/933] SH-2276 Clean up a shader warning.

---
 .../shaders/class1/lighting/sumLightsSpecularV.glsl         | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
index dcd405716c6..7059ff31aed 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
@@ -36,10 +36,8 @@ uniform vec3 light_diffuse[8];
 
 vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
 {
-	vec4 col;
-	col.a = color.a;
-	
-	
+	vec4 col = vec4(0,0,0, color.a);
+		
 	vec3 view = normalize(pos);
 	
 	/// collect all the specular values from each calcXXXLightSpecular() function
-- 
GitLab


From 9f45495fc31e3f76036d164a43ce167d7cdc9feb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 14 Oct 2011 17:56:17 -0500
Subject: [PATCH 112/933] Fix for crash when toggling shaders.

---
 indra/newview/llviewerdisplay.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index e0359cc61de..3889c895aa5 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -628,6 +628,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			LLPipeline::sUseOcclusion = 3;
 		}*/
 
+		LLPipeline::refreshCachedSettings();
+		LLPipeline::refreshRenderDeferred();
+		
 		LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred");
 		LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred");
 		LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip");
@@ -858,9 +861,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//	gGL.popMatrix();
 		//}
 
-		LLPipeline::refreshCachedSettings();
 		LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
-		LLPipeline::refreshRenderDeferred();
 		
 		LLGLState::checkStates();
 		LLGLState::checkClientArrays();
-- 
GitLab


From b32e6e094d1a6d2843b938448eee22ad1671052c Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sun, 16 Oct 2011 00:58:16 -0500
Subject: [PATCH 113/933] SH-2276 Fix for TDR's on GTX 460 et al -- don't use
 texture units above 16 (workaround for prevalent driver bug)

---
 indra/newview/app_settings/settings.xml | 2 +-
 indra/newview/featuretable.txt          | 3 ++-
 indra/newview/featuretable_linux.txt    | 1 +
 indra/newview/featuretable_mac.txt      | 1 +
 indra/newview/featuretable_xp.txt       | 2 +-
 5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e7ff584b385..6567ad5e043 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7796,7 +7796,7 @@
     <key>Type</key>
     <string>U32</string>
     <key>Value</key>
-    <integer>32</integer>
+    <integer>16</integer>
   </map>
     <key>RenderDebugTextureBind</key>
     <map>
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 22d76cb0827..51065aacbac 100755
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -65,7 +65,8 @@ RenderShadowDetail			1	2
 WatchdogDisabled				1	1
 RenderUseStreamVBO			1	1
 RenderFSAASamples			1	16
-RenderMaxTextureIndex		1	32
+RenderMaxTextureIndex		1	16
+
 
 //
 // Low Graphics Settings
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index 18efcf5665e..2c29c3003ec 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -63,6 +63,7 @@ RenderDeferred				1	1
 RenderDeferredSSAO			1	1
 RenderShadowDetail			1	2
 RenderFSAASamples			1	16
+RenderMaxTextureIndex		1	16
 
 //
 // Low Graphics Settings
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index c37e4e93ee9..e2c35adaf16 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -65,6 +65,7 @@ RenderShadowDetail			1	2
 WatchdogDisabled				1	1
 RenderUseStreamVBO			1	0
 RenderFSAASamples			1	16
+RenderMaxTextureIndex		1	16
 
 //
 // Low Graphics Settings
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt
index a8e13ce65c2..4b6f86665ea 100644
--- a/indra/newview/featuretable_xp.txt
+++ b/indra/newview/featuretable_xp.txt
@@ -65,7 +65,7 @@ RenderShadowDetail			1	0
 WatchdogDisabled				1	1
 RenderUseStreamVBO			1	1
 RenderFSAASamples			1	16
-RenderMaxTextureIndex		1	32
+RenderMaxTextureIndex		1	16
 
 //
 // Low Graphics Settings
-- 
GitLab


From a9aca58eaf847bb38f93a268da3aa024b60b38ba Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 18 Oct 2011 16:14:56 -0500
Subject: [PATCH 114/933] SH-2508 Fix for edit/rotate ring not showing up on
 Radeon X1950 pro

---
 indra/newview/llcylinder.cpp    | 10 +++++-----
 indra/newview/llmaniprotate.cpp |  3 +--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llcylinder.cpp b/indra/newview/llcylinder.cpp
index 2adc071d7ab..f353851a251 100644
--- a/indra/newview/llcylinder.cpp
+++ b/indra/newview/llcylinder.cpp
@@ -53,22 +53,22 @@ void LLCone::render(S32 sides)
 		F32 a = (F32) i/sides * F_PI*2.f;
 		F32 x = cosf(a)*0.5f;
 		F32 y = sinf(a)*0.5f;
-		gGL.vertex3f(x,y,0.f);
+		gGL.vertex3f(x,y,-.5f);
 	}
-	gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, 0.f);
+	gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, -0.5f);
 
 	gGL.end();
 
 	gGL.begin(LLRender::TRIANGLE_FAN);
-	gGL.vertex3f(0.f, 0.f, 1.f);
+	gGL.vertex3f(0.f, 0.f, 0.5f);
 	for (U32 i = 0; i < sides; i++)
 	{
 		F32 a = (F32) i/sides * F_PI*2.f;
 		F32 x = cosf(a)*0.5f;
 		F32 y = sinf(a)*0.5f;
-		gGL.vertex3f(x,y,0.f);
+		gGL.vertex3f(x,y,-0.5f);
 	}
-	gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, 0.f);
+	gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, -0.5f);
 
 	gGL.end();
 }
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index 19798ef7529..04dd2be583f 100644
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -199,8 +199,7 @@ void LLManipRotate::render()
 					gl_circle_2d( 0, 0,  mRadiusMeters, CIRCLE_STEPS, TRUE );
 				}
 				
-				GLdouble plane_eqn[] = { 0, 0, 1, 0 };
-				glClipPlane( GL_CLIP_PLANE0, plane_eqn );
+				gGL.flush();
 			}
 			gGL.popMatrix();
 		}
-- 
GitLab


From c7b13d16190fcf1aacf7f1a54d97670cc4be75b6 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 18 Oct 2011 16:28:00 -0500
Subject: [PATCH 115/933] SH-2480 Anything GeForce 8 or later and anything
 Radeon HD or later should be at least class 2 in order to get all 6 local
 lights available with shaders on.

---
 indra/newview/gpu_table.txt | 96 ++++++++++++++++++-------------------
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index b7d951e0185..5b4f52c7e6b 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -106,18 +106,18 @@ ATI Mobility Radeon 8xxx		.*ATI.*Mobility.*Radeon 8.*					0		1
 ATI Mobility Radeon 9800		.*ATI.*Mobility.*98.*						1		1
 ATI Mobility Radeon 9700		.*ATI.*Mobility.*97.*						1		1
 ATI Mobility Radeon 9600		.*ATI.*Mobility.*96.*						0		1
-ATI Mobility Radeon HD 530v		.*ATI.*Mobility.*HD *530v.*					1		1
+ATI Mobility Radeon HD 530v		.*ATI.*Mobility.*HD *530v.*					2		1
 ATI Mobility Radeon HD 540v		.*ATI.*Mobility.*HD *540v.*					2		1
 ATI Mobility Radeon HD 545v		.*ATI.*Mobility.*HD *545v.*					2		1
 ATI Mobility Radeon HD 550v		.*ATI.*Mobility.*HD *550v.*					2		1
 ATI Mobility Radeon HD 560v		.*ATI.*Mobility.*HD *560v.*					2		1
 ATI Mobility Radeon HD 565v		.*ATI.*Mobility.*HD *565v.*					2		1
-ATI Mobility Radeon HD 2300		.*ATI.*Mobility.*HD *23.*					1		1
-ATI Mobility Radeon HD 2400		.*ATI.*Mobility.*HD *24.*					1		1
+ATI Mobility Radeon HD 2300		.*ATI.*Mobility.*HD *23.*					2		1
+ATI Mobility Radeon HD 2400		.*ATI.*Mobility.*HD *24.*					2		1
 ATI Mobility Radeon HD 2600		.*ATI.*Mobility.*HD *26.*					3		1
 ATI Mobility Radeon HD 2700		.*ATI.*Mobility.*HD *27.*					3		1
-ATI Mobility Radeon HD 3100		.*ATI.*Mobility.*HD *31.*					0		1
-ATI Mobility Radeon HD 3200		.*ATI.*Mobility.*HD *32.*					0		1
+ATI Mobility Radeon HD 3100		.*ATI.*Mobility.*HD *31.*					2		1
+ATI Mobility Radeon HD 3200		.*ATI.*Mobility.*HD *32.*					2		1
 ATI Mobility Radeon HD 3400		.*ATI.*Mobility.*HD *34.*					2		1
 ATI Mobility Radeon HD 3600		.*ATI.*Mobility.*HD *36.*					3		1
 ATI Mobility Radeon HD 3800		.*ATI.*Mobility.*HD *38.*					3		1
@@ -140,23 +140,23 @@ ATI Mobility Radeon HD 6600M	.*ATI.*Mobility.*HD *66.*					3		1
 ATI Mobility Radeon HD 6700M	.*ATI.*Mobility.*HD *67.*					3		1
 ATI Mobility Radeon HD 6800M	.*ATI.*Mobility.*HD *68.*					3		1
 ATI Mobility Radeon HD 6900M	.*ATI.*Mobility.*HD *69.*					3		1
-ATI Radeon HD 2300				.*ATI.*Radeon HD *23..						0		1
-ATI Radeon HD 2400				.*ATI.*Radeon HD *24..						1		1
+ATI Radeon HD 2300				.*ATI.*Radeon HD *23..						2		1
+ATI Radeon HD 2400				.*ATI.*Radeon HD *24..						2		1
 ATI Radeon HD 2600				.*ATI.*Radeon HD *26..						2		1
 ATI Radeon HD 2900				.*ATI.*Radeon HD *29..						3		1
-ATI Radeon HD 3000				.*ATI.*Radeon HD *30..						0		1
-ATI Radeon HD 3100				.*ATI.*Radeon HD *31..						1		1
-ATI Radeon HD 3200				.*ATI.*Radeon HD *32..						1		1
-ATI Radeon HD 3300				.*ATI.*Radeon HD *33..						1		1
-ATI Radeon HD 3400				.*ATI.*Radeon HD *34..						1		1
-ATI Radeon HD 3500				.*ATI.*Radeon HD *35..						1		1
+ATI Radeon HD 3000				.*ATI.*Radeon HD *30..						2		1
+ATI Radeon HD 3100				.*ATI.*Radeon HD *31..						2		1
+ATI Radeon HD 3200				.*ATI.*Radeon HD *32..						2		1
+ATI Radeon HD 3300				.*ATI.*Radeon HD *33..						2		1
+ATI Radeon HD 3400				.*ATI.*Radeon HD *34..						2		1
+ATI Radeon HD 3500				.*ATI.*Radeon HD *35..						2		1
 ATI Radeon HD 3600				.*ATI.*Radeon HD *36..						3		1
 ATI Radeon HD 3700				.*ATI.*Radeon HD *37..						3		1
 ATI Radeon HD 3800				.*ATI.*Radeon HD *38..						3		1
-ATI Radeon HD 4100				.*ATI.*Radeon HD *41..						1		1
-ATI Radeon HD 4200				.*ATI.*Radeon HD *42..						1		1
-ATI Radeon HD 4300				.*ATI.*Radeon HD *43..						1		1
-ATI Radeon HD 4400				.*ATI.*Radeon HD *44..						1		1
+ATI Radeon HD 4100				.*ATI.*Radeon HD *41..						2		1
+ATI Radeon HD 4200				.*ATI.*Radeon HD *42..						2		1
+ATI Radeon HD 4300				.*ATI.*Radeon HD *43..						2		1
+ATI Radeon HD 4400				.*ATI.*Radeon HD *44..						2		1
 ATI Radeon HD 4500				.*ATI.*Radeon HD *45..						3		1
 ATI Radeon HD 4600				.*ATI.*Radeon HD *46..						3		1
 ATI Radeon HD 4700				.*ATI.*Radeon HD *47..						3		1
@@ -290,27 +290,27 @@ Matrox							.*Matrox.*									0		0
 Mesa							.*Mesa.*									0		0
 NVIDIA 205						.*NVIDIA .*GeForce 205.*					2		1
 NVIDIA 210						.*NVIDIA .*GeForce 210.*					2		1
-NVIDIA 310M						.*NVIDIA .*GeForce 310M.*					1		1
+NVIDIA 310M						.*NVIDIA .*GeForce 310M.*					2		1
 NVIDIA 310						.*NVIDIA .*GeForce 310.*					3		1
 NVIDIA 315M						.*NVIDIA .*GeForce 315M.*					2		1
 NVIDIA 315						.*NVIDIA .*GeForce 315.*					3		1
 NVIDIA 320M						.*NVIDIA .*GeForce 320M.*					2		1
-NVIDIA G100M					.*NVIDIA .*100M.*							0		1
-NVIDIA G100						.*NVIDIA .*100.*							0		1
-NVIDIA G102M					.*NVIDIA .*102M.*							0		1
-NVIDIA G103M					.*NVIDIA .*103M.*							0		1
-NVIDIA G105M					.*NVIDIA .*105M.*							0		1
-NVIDIA G 110M					.*NVIDIA .*110M.*							0		1
-NVIDIA G 120M					.*NVIDIA .*120M.*							1		1
-NVIDIA G 200					.*NVIDIA .*200(M)?.*						0		1
-NVIDIA G 205M					.*NVIDIA .*205(M)?.*						0		1
-NVIDIA G 210					.*NVIDIA .*210(M)?.*						1		1
-NVIDIA 305M						.*NVIDIA .*305(M)?.*						1		1
+NVIDIA G100M					.*NVIDIA .*100M.*							2		1
+NVIDIA G100						.*NVIDIA .*100.*							2		1
+NVIDIA G102M					.*NVIDIA .*102M.*							2		1
+NVIDIA G103M					.*NVIDIA .*103M.*							2		1
+NVIDIA G105M					.*NVIDIA .*105M.*							2		1
+NVIDIA G 110M					.*NVIDIA .*110M.*							2		1
+NVIDIA G 120M					.*NVIDIA .*120M.*							2		1
+NVIDIA G 200					.*NVIDIA .*200(M)?.*						2		1
+NVIDIA G 205M					.*NVIDIA .*205(M)?.*						2		1
+NVIDIA G 210					.*NVIDIA .*210(M)?.*						2		1
+NVIDIA 305M						.*NVIDIA .*305(M)?.*						2		1
 NVIDIA G 310M					.*NVIDIA .*310(M)?.*						2		1
 NVIDIA G 315					.*NVIDIA .*315(M)?.*						2		1
 NVIDIA G 320M					.*NVIDIA .*320(M)?.*						2		1
-NVIDIA G 405					.*NVIDIA .*405(M)?.*						1		1
-NVIDIA G 410M					.*NVIDIA .*410(M)?.*						1		1
+NVIDIA G 405					.*NVIDIA .*405(M)?.*						2		1
+NVIDIA G 410M					.*NVIDIA .*410(M)?.*						2		1
 NVIDIA GT 120M					.*NVIDIA .*GT *120(M)?.*					2		1
 NVIDIA GT 120					.*NVIDIA .*GT.*120							2		1
 NVIDIA GT 130M					.*NVIDIA .*GT *130(M)?.*					2		1
@@ -323,9 +323,9 @@ NVIDIA GT 240M					.*NVIDIA .*GT *240(M)?.*					2		1
 NVIDIA GT 250M					.*NVIDIA .*GT *250(M)?.*					2		1
 NVIDIA GT 260M					.*NVIDIA .*GT *260(M)?.*					2		1
 NVIDIA GT 320M					.*NVIDIA .*GT *320(M)?.*					2		1
-NVIDIA GT 325M					.*NVIDIA .*GT *325(M)?.*					0		1
+NVIDIA GT 325M					.*NVIDIA .*GT *325(M)?.*					2		1
 NVIDIA GT 330M					.*NVIDIA .*GT *330(M)?.*					3		1
-NVIDIA GT 335M					.*NVIDIA .*GT *335(M)?.*					1		1
+NVIDIA GT 335M					.*NVIDIA .*GT *335(M)?.*					2		1
 NVIDIA GT 340M					.*NVIDIA .*GT *340(M)?.*					2		1
 NVIDIA GT 415M					.*NVIDIA .*GT *415(M)?.*					2		1
 NVIDIA GT 420M					.*NVIDIA .*GT *420(M)?.*					2		1
@@ -398,27 +398,27 @@ NVIDIA GeForce 7500				.*NVIDIA .*GeForce 75.*						1		1
 NVIDIA GeForce 7600				.*NVIDIA .*GeForce 76.*						2		1
 NVIDIA GeForce 7800				.*NVIDIA .*GeForce 78.*						2		1
 NVIDIA GeForce 7900				.*NVIDIA .*GeForce 79.*						2		1
-NVIDIA GeForce 8100				.*NVIDIA .*GeForce 81.*						1		1
-NVIDIA GeForce 8200M			.*NVIDIA .*GeForce 8200M.*					1		1
-NVIDIA GeForce 8200				.*NVIDIA .*GeForce 82.*						1		1
-NVIDIA GeForce 8300				.*NVIDIA .*GeForce 83.*						1		1
-NVIDIA GeForce 8400M			.*NVIDIA .*GeForce 8400M.*					1		1
-NVIDIA GeForce 8400				.*NVIDIA .*GeForce 84.*						1		1
+NVIDIA GeForce 8100				.*NVIDIA .*GeForce 81.*						2		1
+NVIDIA GeForce 8200M			.*NVIDIA .*GeForce 8200M.*					2		1
+NVIDIA GeForce 8200				.*NVIDIA .*GeForce 82.*						2		1
+NVIDIA GeForce 8300				.*NVIDIA .*GeForce 83.*						2		1
+NVIDIA GeForce 8400M			.*NVIDIA .*GeForce 8400M.*					2		1
+NVIDIA GeForce 8400				.*NVIDIA .*GeForce 84.*						2		1
 NVIDIA GeForce 8500				.*NVIDIA .*GeForce 85.*						3		1
-NVIDIA GeForce 8600M			.*NVIDIA .*GeForce 8600M.*					1		1
+NVIDIA GeForce 8600M			.*NVIDIA .*GeForce 8600M.*					2		1
 NVIDIA GeForce 8600				.*NVIDIA .*GeForce 86.*						3		1
 NVIDIA GeForce 8700M			.*NVIDIA .*GeForce 8700M.*					3		1
 NVIDIA GeForce 8700				.*NVIDIA .*GeForce 87.*						3		1
 NVIDIA GeForce 8800M			.*NVIDIA .*GeForce 8800M.*					3		1
 NVIDIA GeForce 8800				.*NVIDIA .*GeForce 88.*						3		1
-NVIDIA GeForce 9100M			.*NVIDIA .*GeForce 9100M.*					0		1
-NVIDIA GeForce 9100				.*NVIDIA .*GeForce 91.*						0		1
-NVIDIA GeForce 9200M			.*NVIDIA .*GeForce 9200M.*					1		1
-NVIDIA GeForce 9200				.*NVIDIA .*GeForce 92.*						1		1
-NVIDIA GeForce 9300M			.*NVIDIA .*GeForce 9300M.*					1		1
-NVIDIA GeForce 9300				.*NVIDIA .*GeForce 93.*						1		1
-NVIDIA GeForce 9400M			.*NVIDIA .*GeForce 9400M.*					1		1
-NVIDIA GeForce 9400				.*NVIDIA .*GeForce 94.*						1		1
+NVIDIA GeForce 9100M			.*NVIDIA .*GeForce 9100M.*					2		1
+NVIDIA GeForce 9100				.*NVIDIA .*GeForce 91.*						2		1
+NVIDIA GeForce 9200M			.*NVIDIA .*GeForce 9200M.*					2		1
+NVIDIA GeForce 9200				.*NVIDIA .*GeForce 92.*						2		1
+NVIDIA GeForce 9300M			.*NVIDIA .*GeForce 9300M.*					2		1
+NVIDIA GeForce 9300				.*NVIDIA .*GeForce 93.*						2		1
+NVIDIA GeForce 9400M			.*NVIDIA .*GeForce 9400M.*					2		1
+NVIDIA GeForce 9400				.*NVIDIA .*GeForce 94.*						2		1
 NVIDIA GeForce 9500M			.*NVIDIA .*GeForce 9500M.*					2		1
 NVIDIA GeForce 9500				.*NVIDIA .*GeForce 95.*						2		1
 NVIDIA GeForce 9600M			.*NVIDIA .*GeForce 9600M.*					3		1
-- 
GitLab


From fe51889b2914a9f117d5f19d91072716b5913579 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 19 Oct 2011 13:21:17 -0500
Subject: [PATCH 116/933] SH-2276 Force RenderMaxTextureIndex to be <= 16
 regardless of settings

---
 indra/newview/llviewershadermgr.cpp | 3 +++
 indra/newview/llvovolume.cpp        | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 31ed210ae3a..50910e26e59 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -357,6 +357,9 @@ void LLViewerShaderMgr::setShaders()
 
 	LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);
 
+	//NEVER use more than 16 texture channels (work around for prevalent driver bug)
+	LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16);
+
 	reentrance = true;
 
 	if (LLRender::sGLCoreProfile || gGLManager.mGLVersion >= 2.f)
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2fadc795fd9..b75a0a799a2 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4666,6 +4666,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 
 	texture_index_channels = llmin(texture_index_channels, (S32) gSavedSettings.getU32("RenderMaxTextureIndex"));
 	
+	//NEVER use more than 16 texture index channels (workaround for prevalent driver bug)
+	texture_index_channels = llmin(texture_index_channels, 16);
 
 	while (face_iter != faces.end())
 	{
-- 
GitLab


From 37993bbba1f7e245ba1b10c2c2752cb62faa02ef Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 19 Oct 2011 13:22:58 -0500
Subject: [PATCH 117/933] SH-2480 Redo the previous gpu_table change, being a
 little more conservative about which chips get bumped to class 2

---
 indra/newview/gpu_table.txt | 62 ++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index 5b4f52c7e6b..198e7024593 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -106,7 +106,7 @@ ATI Mobility Radeon 8xxx		.*ATI.*Mobility.*Radeon 8.*					0		1
 ATI Mobility Radeon 9800		.*ATI.*Mobility.*98.*						1		1
 ATI Mobility Radeon 9700		.*ATI.*Mobility.*97.*						1		1
 ATI Mobility Radeon 9600		.*ATI.*Mobility.*96.*						0		1
-ATI Mobility Radeon HD 530v		.*ATI.*Mobility.*HD *530v.*					2		1
+ATI Mobility Radeon HD 530v		.*ATI.*Mobility.*HD *530v.*					1		1
 ATI Mobility Radeon HD 540v		.*ATI.*Mobility.*HD *540v.*					2		1
 ATI Mobility Radeon HD 545v		.*ATI.*Mobility.*HD *545v.*					2		1
 ATI Mobility Radeon HD 550v		.*ATI.*Mobility.*HD *550v.*					2		1
@@ -116,8 +116,8 @@ ATI Mobility Radeon HD 2300		.*ATI.*Mobility.*HD *23.*					2		1
 ATI Mobility Radeon HD 2400		.*ATI.*Mobility.*HD *24.*					2		1
 ATI Mobility Radeon HD 2600		.*ATI.*Mobility.*HD *26.*					3		1
 ATI Mobility Radeon HD 2700		.*ATI.*Mobility.*HD *27.*					3		1
-ATI Mobility Radeon HD 3100		.*ATI.*Mobility.*HD *31.*					2		1
-ATI Mobility Radeon HD 3200		.*ATI.*Mobility.*HD *32.*					2		1
+ATI Mobility Radeon HD 3100		.*ATI.*Mobility.*HD *31.*					0		1
+ATI Mobility Radeon HD 3200		.*ATI.*Mobility.*HD *32.*					0		1
 ATI Mobility Radeon HD 3400		.*ATI.*Mobility.*HD *34.*					2		1
 ATI Mobility Radeon HD 3600		.*ATI.*Mobility.*HD *36.*					3		1
 ATI Mobility Radeon HD 3800		.*ATI.*Mobility.*HD *38.*					3		1
@@ -144,17 +144,17 @@ ATI Radeon HD 2300				.*ATI.*Radeon HD *23..						2		1
 ATI Radeon HD 2400				.*ATI.*Radeon HD *24..						2		1
 ATI Radeon HD 2600				.*ATI.*Radeon HD *26..						2		1
 ATI Radeon HD 2900				.*ATI.*Radeon HD *29..						3		1
-ATI Radeon HD 3000				.*ATI.*Radeon HD *30..						2		1
-ATI Radeon HD 3100				.*ATI.*Radeon HD *31..						2		1
-ATI Radeon HD 3200				.*ATI.*Radeon HD *32..						2		1
+ATI Radeon HD 3000				.*ATI.*Radeon HD *30..						0		1
+ATI Radeon HD 3100				.*ATI.*Radeon HD *31..						1		1
+ATI Radeon HD 3200				.*ATI.*Radeon HD *32..						1		1
 ATI Radeon HD 3300				.*ATI.*Radeon HD *33..						2		1
 ATI Radeon HD 3400				.*ATI.*Radeon HD *34..						2		1
 ATI Radeon HD 3500				.*ATI.*Radeon HD *35..						2		1
 ATI Radeon HD 3600				.*ATI.*Radeon HD *36..						3		1
 ATI Radeon HD 3700				.*ATI.*Radeon HD *37..						3		1
 ATI Radeon HD 3800				.*ATI.*Radeon HD *38..						3		1
-ATI Radeon HD 4100				.*ATI.*Radeon HD *41..						2		1
-ATI Radeon HD 4200				.*ATI.*Radeon HD *42..						2		1
+ATI Radeon HD 4100				.*ATI.*Radeon HD *41..						1		1
+ATI Radeon HD 4200				.*ATI.*Radeon HD *42..						1		1
 ATI Radeon HD 4300				.*ATI.*Radeon HD *43..						2		1
 ATI Radeon HD 4400				.*ATI.*Radeon HD *44..						2		1
 ATI Radeon HD 4500				.*ATI.*Radeon HD *45..						3		1
@@ -290,27 +290,27 @@ Matrox							.*Matrox.*									0		0
 Mesa							.*Mesa.*									0		0
 NVIDIA 205						.*NVIDIA .*GeForce 205.*					2		1
 NVIDIA 210						.*NVIDIA .*GeForce 210.*					2		1
-NVIDIA 310M						.*NVIDIA .*GeForce 310M.*					2		1
+NVIDIA 310M						.*NVIDIA .*GeForce 310M.*					1		1
 NVIDIA 310						.*NVIDIA .*GeForce 310.*					3		1
 NVIDIA 315M						.*NVIDIA .*GeForce 315M.*					2		1
 NVIDIA 315						.*NVIDIA .*GeForce 315.*					3		1
 NVIDIA 320M						.*NVIDIA .*GeForce 320M.*					2		1
-NVIDIA G100M					.*NVIDIA .*100M.*							2		1
-NVIDIA G100						.*NVIDIA .*100.*							2		1
-NVIDIA G102M					.*NVIDIA .*102M.*							2		1
-NVIDIA G103M					.*NVIDIA .*103M.*							2		1
-NVIDIA G105M					.*NVIDIA .*105M.*							2		1
-NVIDIA G 110M					.*NVIDIA .*110M.*							2		1
-NVIDIA G 120M					.*NVIDIA .*120M.*							2		1
-NVIDIA G 200					.*NVIDIA .*200(M)?.*						2		1
-NVIDIA G 205M					.*NVIDIA .*205(M)?.*						2		1
-NVIDIA G 210					.*NVIDIA .*210(M)?.*						2		1
-NVIDIA 305M						.*NVIDIA .*305(M)?.*						2		1
+NVIDIA G100M					.*NVIDIA .*100M.*							0		1
+NVIDIA G100						.*NVIDIA .*100.*							0		1
+NVIDIA G102M					.*NVIDIA .*102M.*							0		1
+NVIDIA G103M					.*NVIDIA .*103M.*							0		1
+NVIDIA G105M					.*NVIDIA .*105M.*							0		1
+NVIDIA G 110M					.*NVIDIA .*110M.*							0		1
+NVIDIA G 120M					.*NVIDIA .*120M.*							1		1
+NVIDIA G 200					.*NVIDIA .*200(M)?.*						0		1
+NVIDIA G 205M					.*NVIDIA .*205(M)?.*						0		1
+NVIDIA G 210					.*NVIDIA .*210(M)?.*						1		1
+NVIDIA 305M						.*NVIDIA .*305(M)?.*						1		1
 NVIDIA G 310M					.*NVIDIA .*310(M)?.*						2		1
 NVIDIA G 315					.*NVIDIA .*315(M)?.*						2		1
 NVIDIA G 320M					.*NVIDIA .*320(M)?.*						2		1
-NVIDIA G 405					.*NVIDIA .*405(M)?.*						2		1
-NVIDIA G 410M					.*NVIDIA .*410(M)?.*						2		1
+NVIDIA G 405					.*NVIDIA .*405(M)?.*						1		1
+NVIDIA G 410M					.*NVIDIA .*410(M)?.*						1		1
 NVIDIA GT 120M					.*NVIDIA .*GT *120(M)?.*					2		1
 NVIDIA GT 120					.*NVIDIA .*GT.*120							2		1
 NVIDIA GT 130M					.*NVIDIA .*GT *130(M)?.*					2		1
@@ -323,9 +323,9 @@ NVIDIA GT 240M					.*NVIDIA .*GT *240(M)?.*					2		1
 NVIDIA GT 250M					.*NVIDIA .*GT *250(M)?.*					2		1
 NVIDIA GT 260M					.*NVIDIA .*GT *260(M)?.*					2		1
 NVIDIA GT 320M					.*NVIDIA .*GT *320(M)?.*					2		1
-NVIDIA GT 325M					.*NVIDIA .*GT *325(M)?.*					2		1
+NVIDIA GT 325M					.*NVIDIA .*GT *325(M)?.*					0		1
 NVIDIA GT 330M					.*NVIDIA .*GT *330(M)?.*					3		1
-NVIDIA GT 335M					.*NVIDIA .*GT *335(M)?.*					2		1
+NVIDIA GT 335M					.*NVIDIA .*GT *335(M)?.*					1		1
 NVIDIA GT 340M					.*NVIDIA .*GT *340(M)?.*					2		1
 NVIDIA GT 415M					.*NVIDIA .*GT *415(M)?.*					2		1
 NVIDIA GT 420M					.*NVIDIA .*GT *420(M)?.*					2		1
@@ -398,9 +398,9 @@ NVIDIA GeForce 7500				.*NVIDIA .*GeForce 75.*						1		1
 NVIDIA GeForce 7600				.*NVIDIA .*GeForce 76.*						2		1
 NVIDIA GeForce 7800				.*NVIDIA .*GeForce 78.*						2		1
 NVIDIA GeForce 7900				.*NVIDIA .*GeForce 79.*						2		1
-NVIDIA GeForce 8100				.*NVIDIA .*GeForce 81.*						2		1
-NVIDIA GeForce 8200M			.*NVIDIA .*GeForce 8200M.*					2		1
-NVIDIA GeForce 8200				.*NVIDIA .*GeForce 82.*						2		1
+NVIDIA GeForce 8100				.*NVIDIA .*GeForce 81.*						1		1
+NVIDIA GeForce 8200M			.*NVIDIA .*GeForce 8200M.*					1		1
+NVIDIA GeForce 8200				.*NVIDIA .*GeForce 82.*						1		1
 NVIDIA GeForce 8300				.*NVIDIA .*GeForce 83.*						2		1
 NVIDIA GeForce 8400M			.*NVIDIA .*GeForce 8400M.*					2		1
 NVIDIA GeForce 8400				.*NVIDIA .*GeForce 84.*						2		1
@@ -411,10 +411,10 @@ NVIDIA GeForce 8700M			.*NVIDIA .*GeForce 8700M.*					3		1
 NVIDIA GeForce 8700				.*NVIDIA .*GeForce 87.*						3		1
 NVIDIA GeForce 8800M			.*NVIDIA .*GeForce 8800M.*					3		1
 NVIDIA GeForce 8800				.*NVIDIA .*GeForce 88.*						3		1
-NVIDIA GeForce 9100M			.*NVIDIA .*GeForce 9100M.*					2		1
-NVIDIA GeForce 9100				.*NVIDIA .*GeForce 91.*						2		1
-NVIDIA GeForce 9200M			.*NVIDIA .*GeForce 9200M.*					2		1
-NVIDIA GeForce 9200				.*NVIDIA .*GeForce 92.*						2		1
+NVIDIA GeForce 9100M			.*NVIDIA .*GeForce 9100M.*					0		1
+NVIDIA GeForce 9100				.*NVIDIA .*GeForce 91.*						0		1
+NVIDIA GeForce 9200M			.*NVIDIA .*GeForce 9200M.*					1		1
+NVIDIA GeForce 9200				.*NVIDIA .*GeForce 92.*						1		1
 NVIDIA GeForce 9300M			.*NVIDIA .*GeForce 9300M.*					2		1
 NVIDIA GeForce 9300				.*NVIDIA .*GeForce 93.*						2		1
 NVIDIA GeForce 9400M			.*NVIDIA .*GeForce 9400M.*					2		1
-- 
GitLab


From b17023e3b071f5e49b3a18c28fc8e1bc73c15b73 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 19 Oct 2011 14:18:49 -0500
Subject: [PATCH 118/933] SH-2593 Fix for crash when jumping from "Low" to
 "Ultra" with Debug GL on.

---
 indra/newview/llviewerdisplay.cpp | 19 +++++--------------
 indra/newview/pipeline.cpp        | 12 ++++++++++++
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3889c895aa5..894c409ad65 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -229,6 +229,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		gGL.flush();
 		glClear(GL_COLOR_BUFFER_BIT);
 		gViewerWindow->mWindow->swapBuffers();
+		LLPipeline::refreshCachedSettings();
+		LLPipeline::refreshRenderDeferred();
 		gPipeline.resizeScreenTexture();
 		gResizeScreenTexture = FALSE;
 		gWindowResized = FALSE;
@@ -615,12 +617,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//Increment drawable frame counter
 		LLDrawable::incrementVisible();
 
+		LLPipeline::refreshCachedSettings();
+		LLPipeline::refreshRenderDeferred();
+
 		LLSpatialGroup::sNoDelete = TRUE;
-		LLPipeline::sUseOcclusion = 
-				(!gUseWireframe
-				&& LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") 
-				&& gSavedSettings.getBOOL("UseOcclusion") 
-				&& gGLManager.mHasOcclusionQuery) ? 2 : 0;
 		LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName();
 
 		/*if (LLPipeline::sUseOcclusion && LLPipeline::sRenderDeferred)
@@ -628,15 +628,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			LLPipeline::sUseOcclusion = 3;
 		}*/
 
-		LLPipeline::refreshCachedSettings();
-		LLPipeline::refreshRenderDeferred();
-		
-		LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred");
-		LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred");
-		LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip");
-		LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
-		LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate");
-
 		S32 occlusion = LLPipeline::sUseOcclusion;
 		if (gDepthDirty)
 		{ //depth buffer is invalid, don't overwrite occlusion state
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5035e0197d7..3246ec648ed 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -840,6 +840,18 @@ void LLPipeline::refreshRenderDeferred()
 //static
 void LLPipeline::refreshCachedSettings()
 {
+	LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred");
+	LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred");
+	LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip");
+	LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
+	LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate");
+
+	LLPipeline::sUseOcclusion = 
+			(!gUseWireframe
+			&& LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") 
+			&& gSavedSettings.getBOOL("UseOcclusion") 
+			&& gGLManager.mHasOcclusionQuery) ? 2 : 0;
+	
 	VertexShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable");
 	RenderAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP");
 	WindLightUseAtmosShaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
-- 
GitLab


From 4ec72ed0a61157dd5fcc1bc4cc91054664ee75b5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 19 Oct 2011 16:19:00 -0500
Subject: [PATCH 119/933] Fix for VBO pools not getting cleared appropriately.

---
 indra/llrender/llvertexbuffer.cpp | 1 +
 indra/newview/pipeline.cpp        | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index ad99bd1807c..7f739770103 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -227,6 +227,7 @@ void LLVBOPool::cleanup()
 			l.pop_front();
 
 			LLVertexBuffer::sAllocatedBytes -= size;
+			sBytesPooled -= size;
 		}
 
 		size *= 2;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 3246ec648ed..acd708e800a 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6109,11 +6109,8 @@ void LLPipeline::resetVertexBuffers()
 
 	gSky.resetVertexBuffers();
 
-	if (LLVertexBuffer::sGLCount > 0)
-	{
-		LLVertexBuffer::cleanupClass();
-	}
-
+	LLVertexBuffer::cleanupClass();
+	
 	//delete all name pool caches
 	LLGLNamePool::cleanupPools();
 
-- 
GitLab


From 250ab43e4e70ccd9218d32c5dcbde35599c9735b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 19 Oct 2011 17:41:02 -0500
Subject: [PATCH 120/933] SH-2571 Add shader driven render for low detail
 terrain.

---
 indra/newview/llappviewer.cpp         |  5 +-
 indra/newview/lldrawpoolterrain.cpp   | 69 +++++++++++++++++++--------
 indra/newview/llfloaterpreference.cpp | 12 +----
 3 files changed, 51 insertions(+), 35 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 31a2ff33f26..2ef55e8a497 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -773,10 +773,7 @@ bool LLAppViewer::init()
 		LLViewerAssetStatsFF::init();
 	}
 
-	// init main thread's local data pool before initializing the threads - Nyx
-	LLThreadLocalData::init();
-
-    initThreads();
+	initThreads();
 	LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ;
 
 	// Initialize settings early so that the defaults for ignorable dialogs are
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index d503d935d0d..e14d0c5f9d5 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -122,14 +122,7 @@ U32 LLDrawPoolTerrain::getVertexDataMask()
 void LLDrawPoolTerrain::prerender()
 {
 	mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT);
-	if (mVertexShaderLevel > 0)
-	{
-		sDetailMode = 1;
-	}
-	else
-	{
-		sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
-	}
+	sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
 }
 
 void LLDrawPoolTerrain::beginRenderPass( S32 pass )
@@ -137,9 +130,24 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass )
 	LLFastTimer t(FTM_RENDER_TERRAIN);
 	LLFacePool::beginRenderPass(pass);
 
-	sShader = LLPipeline::sUnderWaterRender ? 
-					&gTerrainWaterProgram :
-					&gTerrainProgram;
+	if (sDetailMode > 0)
+	{
+		sShader = LLPipeline::sUnderWaterRender ? 
+						&gTerrainWaterProgram :
+						&gTerrainProgram;
+	}
+	else
+	{
+		if (LLPipeline::sUnderWaterRender)
+		{
+			sShader = &gObjectSimpleNonIndexedTexGenWaterProgram;
+		}
+		else
+		{
+			sShader = &gObjectSimpleNonIndexedTexGenProgram;
+		}
+	}
+					
 
 	if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0)
 	{
@@ -200,7 +208,15 @@ void LLDrawPoolTerrain::render(S32 pass)
 	if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0)
 	{
 		gPipeline.enableLightsDynamic();
-		renderFullShader();
+
+		if (sDetailMode > 0)
+		{
+			renderFullShader();
+		}
+		else
+		{
+			renderSimple();
+		}
 	}
 	else
 	{
@@ -827,13 +843,21 @@ void LLDrawPoolTerrain::renderSimple()
 	tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f));
 	tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f));
 	
-	glEnable(GL_TEXTURE_GEN_S);
-	glEnable(GL_TEXTURE_GEN_T);
-	glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
-	glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
-	glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
-	glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
-	
+	if (LLGLSLShader::sNoFixedFunction)
+	{
+		sShader->uniform4fv("object_plane_s", 1, tp0.mV);
+		sShader->uniform4fv("object_plane_t", 1, tp1.mV);
+	}
+	else
+	{
+		glEnable(GL_TEXTURE_GEN_S);
+		glEnable(GL_TEXTURE_GEN_T);
+		glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+		glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+		glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
+		glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+	}
+
 	gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
 
 	drawLoop();
@@ -843,8 +867,11 @@ void LLDrawPoolTerrain::renderSimple()
 	
 	gGL.getTexUnit(0)->activate();
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-	glDisable(GL_TEXTURE_GEN_S);
-	glDisable(GL_TEXTURE_GEN_T);
+	if (!LLGLSLShader::sNoFixedFunction)
+	{
+		glDisable(GL_TEXTURE_GEN_S);
+		glDisable(GL_TEXTURE_GEN_T);
+	}
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 7f6d0155e2a..92c4214fdbb 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1039,16 +1039,8 @@ void LLFloaterPreference::refreshEnabledState()
 	
 	BOOL shaders = gGLManager.mGLVersion >= 2.f;
 
-	if (shaders)
-	{
-		mRadioTerrainDetail->setValue(1);
-		mRadioTerrainDetail->setEnabled(FALSE);
-	}
-	else
-	{
-		mRadioTerrainDetail->setEnabled(TRUE);		
-	}
-	
+	mRadioTerrainDetail->setEnabled(TRUE);		
+		
 	// WindLight
 	LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
 	
-- 
GitLab


From 7fef84ca755b3f07eb9841fc1b904b185402317e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 19 Oct 2011 18:06:32 -0500
Subject: [PATCH 121/933] SH-2571 Make low detail terrain stick when choosing
 "low" from preferences.

---
 indra/newview/llviewercontrol.cpp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 5ab28778694..d9210877dd2 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -118,12 +118,6 @@ static bool handleSetShaderChanged(const LLSD& newvalue)
 	gBumpImageList.destroyGL();
 	gBumpImageList.restoreGL();
 
-	// Changing shader also changes the terrain detail to high, reflect that change here
-	if (newvalue.asBoolean())
-	{
-		// shaders enabled, set terrain detail to high
-		gSavedSettings.setS32("RenderTerrainDetail", 1);
-	}
 	// else, leave terrain detail as is
 	LLViewerShaderMgr::instance()->setShaders();
 	return true;
-- 
GitLab


From 1762cc49395d2596ab0788b2a4504abaefbe64db Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 20 Oct 2011 14:20:12 -0500
Subject: [PATCH 122/933] SH-2570 Don't minimize viewer when reloading shaders
 (revert hack that didn't work) and pause shader loading until after all
 feature masks have been applied when switching detail levels

---
 indra/newview/llfeaturemanager.cpp  | 8 +++++++-
 indra/newview/llviewershadermgr.cpp | 6 ++----
 indra/newview/llviewershadermgr.h   | 1 +
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index db9a0424c0d..eb0cdf28c0e 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -51,6 +51,7 @@
 #include "llcontrol.h"
 #include "llboost.h"
 #include "llweb.h"
+#include "llviewershadermgr.h"
 
 #if LL_WINDOWS
 #include "lldxhardware.h"
@@ -662,8 +663,10 @@ void LLFeatureManager::applyFeatures(bool skipFeatures)
 
 void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures)
 {
-	applyBaseMasks();
+	LLViewerShaderMgr::sSkipReload = true;
 
+	applyBaseMasks();
+	
 	switch (level)
 	{
 		case 0:
@@ -684,6 +687,9 @@ void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures)
 	}
 
 	applyFeatures(skipFeatures);
+
+	LLViewerShaderMgr::sSkipReload = false;
+	LLViewerShaderMgr::instance()->setShaders();
 }
 
 void LLFeatureManager::applyBaseMasks()
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 50910e26e59..e50625af600 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -59,6 +59,7 @@ using std::make_pair;
 using std::string;
 
 BOOL				LLViewerShaderMgr::sInitialized = FALSE;
+bool				LLViewerShaderMgr::sSkipReload = false;
 
 LLVector4			gShinyOrigin;
 
@@ -350,7 +351,7 @@ void LLViewerShaderMgr::setShaders()
 	//setShaders might be called redundantly by gSavedSettings, so return on reentrance
 	static bool reentrance = false;
 	
-	if (!gPipeline.mInitialized || !sInitialized || reentrance)
+	if (!gPipeline.mInitialized || !sInitialized || reentrance || sSkipReload)
 	{
 		return;
 	}
@@ -401,9 +402,6 @@ void LLViewerShaderMgr::setShaders()
 	if (gViewerWindow)
 	{
 		gViewerWindow->setCursor(UI_CURSOR_WAIT);
-		//VICIOUS HACK -- some drivers will time out if we don't redraw the window within 2 seconds, and this operation can take awhile
-		//minimizing tells the driver we won't be updating the window for a bit
-		gViewerWindow->getWindow()->minimize();
 	}
 
 	// Lighting
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 26cef8cb3ef..3f670dfb145 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -33,6 +33,7 @@ class LLViewerShaderMgr: public LLShaderMgr
 {
 public:
 	static BOOL sInitialized;
+	static bool sSkipReload;
 
 	LLViewerShaderMgr();
 	/* virtual */ ~LLViewerShaderMgr();
-- 
GitLab


From 4e894bfa316ff4bc2fa64f711b8442b228573f90 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 20 Oct 2011 14:33:36 -0500
Subject: [PATCH 123/933] SH-2600 Fix for busted texture animation on bump
 mapped objects.

---
 indra/newview/app_settings/shaders/class1/objects/bumpV.glsl | 3 +--
 indra/newview/lldrawpoolbump.cpp                             | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index 09ec6ff7925..a7738087dcc 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -24,7 +24,6 @@
  */
 
 uniform mat4 texture_matrix0;
-uniform mat4 texture_matrix1;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
@@ -39,5 +38,5 @@ void main()
 	//transform vertex
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-	vary_texcoord1 = (texture_matrix1 * vec4(texcoord1,0,1)).xy;
+	vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy;
 }
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index be12eb800f1..610d3f9f997 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1453,11 +1453,10 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
 			}
 			else
 			{
-				gGL.getTexUnit(1)->activate();
+				gGL.getTexUnit(0)->activate();
 				gGL.matrixMode(LLRender::MM_TEXTURE);
 				gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
 				gPipeline.mTextureMatrixOps++;
-				gGL.getTexUnit(0)->activate();
 			}
 
 			gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
@@ -1470,7 +1469,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
 		{
 			if (params.mTexture.notNull())
 			{
-				gGL.getTexUnit(diffuse_channel)->bind(params.mTexture) ;
+				gGL.getTexUnit(diffuse_channel)->bind(params.mTexture);
 				params.mTexture->addTextureStats(params.mVSize);		
 			}
 			else
-- 
GitLab


From ae31a6f4a7928e4f1be75451ec7dd16c5283ed5b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 20 Oct 2011 15:14:16 -0500
Subject: [PATCH 124/933] SH-2240 GL 1.2 compatibility pass

---
 indra/newview/lldrawpoolbump.cpp | 16 ++++++++++++++--
 indra/newview/pipeline.cpp       |  1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 610d3f9f997..774ca2e8e7e 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1453,6 +1453,13 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
 			}
 			else
 			{
+				if (!LLGLSLShader::sNoFixedFunction)
+				{
+					gGL.getTexUnit(1)->activate();
+					gGL.matrixMode(LLRender::MM_TEXTURE);
+					gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
+				}
+
 				gGL.getTexUnit(0)->activate();
 				gGL.matrixMode(LLRender::MM_TEXTURE);
 				gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
@@ -1494,9 +1501,14 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
 		}
 		else
 		{
-			gGL.getTexUnit(1)->activate();
-			gGL.loadIdentity();
+			if (!LLGLSLShader::sNoFixedFunction)
+			{
+				gGL.getTexUnit(1)->activate();
+				gGL.matrixMode(LLRender::MM_TEXTURE);
+				gGL.loadIdentity();
+			}
 			gGL.getTexUnit(0)->activate();
+			gGL.matrixMode(LLRender::MM_TEXTURE);
 		}
 		gGL.loadIdentity();
 		gGL.matrixMode(LLRender::MM_MODELVIEW);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index acd708e800a..cef4c649d70 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5090,6 +5090,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
 	// Ambient
 	if (!LLGLSLShader::sNoFixedFunction)
 	{
+		gGL.syncMatrices();
 		LLColor4 ambient = gSky.getTotalAmbientColor();
 		gGL.setAmbientLightColor(ambient);
 	}
-- 
GitLab


From 281b71300d0296f54809948d16c778b6bf08ef19 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 20 Oct 2011 15:14:51 -0500
Subject: [PATCH 125/933] SH-2521 Force terrain to render as simple when GL
 version < 2.0

---
 indra/newview/lldrawpoolterrain.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index e14d0c5f9d5..ce601325c88 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -196,7 +196,7 @@ void LLDrawPoolTerrain::render(S32 pass)
 		return;
 	}
 	// Render simplified land if video card can't do sufficient multitexturing
-	if (!gGLManager.mHasARBEnvCombine || (gGLManager.mNumTextureUnits < 2))
+	if (!LLGLSLShader::sNoFixedFunction || !gGLManager.mHasARBEnvCombine || (gGLManager.mNumTextureUnits < 2))
 	{
 		renderSimple(); // Render without multitexture
 		return;
-- 
GitLab


From 34c01b6b1ff758463dcdff19782e5af668699304 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 20 Oct 2011 18:53:12 -0500
Subject: [PATCH 126/933] SH-2564 Fix for bad frustum culling on visible region
 list

---
 indra/newview/llworld.cpp | 43 +++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 20 deletions(-)

diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index a7ae456f3ce..6f6e0d23347 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -589,22 +589,22 @@ void LLWorld::updateVisibilities()
 {
 	F32 cur_far_clip = LLViewerCamera::getInstance()->getFar();
 
-	LLViewerCamera::getInstance()->setFar(mLandFarClip);
-
-	F32 diagonal_squared = F_SQRT2 * F_SQRT2 * mWidth * mWidth;
-	// Go through the culled list and check for visible regions
+	// Go through the culled list and check for visible regions (region is visible if land is visible)
 	for (region_list_t::iterator iter = mCulledRegionList.begin();
 		 iter != mCulledRegionList.end(); )
 	{
 		region_list_t::iterator curiter = iter++;
 		LLViewerRegion* regionp = *curiter;
-		F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ();
-		F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared);
-		if (!regionp->getLand().hasZData()
-			|| LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius))
+		
+		LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN);
+		if (part)
 		{
-			mCulledRegionList.erase(curiter);
-			mVisibleRegionList.push_back(regionp);
+			LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
+			if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+			{
+				mCulledRegionList.erase(curiter);
+				mVisibleRegionList.push_back(regionp);
+			}
 		}
 	}
 	
@@ -619,17 +619,20 @@ void LLWorld::updateVisibilities()
 			continue;
 		}
 
-		F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ();
-		F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared);
-		if (LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius))
+		LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN);
+		if (part)
 		{
-			regionp->calculateCameraDistance();
-			regionp->getLand().updatePatchVisibilities(gAgent);
-		}
-		else
-		{
-			mVisibleRegionList.erase(curiter);
-			mCulledRegionList.push_back(regionp);
+			LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
+			if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+			{
+				regionp->calculateCameraDistance();
+				regionp->getLand().updatePatchVisibilities(gAgent);
+			}
+			else
+			{
+				mVisibleRegionList.erase(curiter);
+				mCulledRegionList.push_back(regionp);
+			}
 		}
 	}
 
-- 
GitLab


From 84a6a3a9d69cc6c9a0cccdff01f80c82b8543efa Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 20 Oct 2011 19:02:56 -0500
Subject: [PATCH 127/933] SH-2240 Default Debug GL to false in prep for QART

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c5cae63fd44..39cefbf1990 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7763,7 +7763,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
   <key>RenderDebugNormalScale</key>
   <map>
-- 
GitLab


From 973e99622e88714a59056200e74fcbf56bbe6884 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 21 Oct 2011 11:05:49 -0500
Subject: [PATCH 128/933] SH-2240 Make OSX never attempt to use GLSL 1.30 or
 later

---
 indra/llrender/llshadermgr.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 0a99c66d09a..326c938e8e2 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -566,13 +566,20 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	GLcharARB* text[4096];
 	GLuint count = 0;
 
-	if (gGLManager.mGLVersion < 2.1f)
+	F32 version = gGLManager.mGLVersion;
+
+//hack to never use GLSL > 1.20 on OSX
+#if LL_DARWIN
+	version = llmin(version, 2.9f);
+#endif
+
+	if (version < 2.1f)
 	{
 		text[count++] = strdup("#version 110\n");
 		text[count++] = strdup("#define ATTRIBUTE attribute\n");
 		text[count++] = strdup("#define VARYING varying\n");
 	}
-	else if (gGLManager.mGLVersion < 3.f)
+	else if (version < 3.f)
 	{
 		//set version to 1.20
 		text[count++] = strdup("#version 120\n");
@@ -583,7 +590,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	}
 	else
 	{  
-		if (gGLManager.mGLVersion < 4.f)
+		if (version < 4.f)
 		{
 			//set version to 1.30
 			text[count++] = strdup("#version 130\n");
-- 
GitLab


From b0c1d877a18956714b9885291819c692a67c6913 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 21 Oct 2011 12:40:06 -0500
Subject: [PATCH 129/933] SH-2240 Fix for flickering due to artifacting when
 rendering occlusion query geometry

---
 indra/newview/llspatialpartition.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 2530f1f0d4b..7bf4e901c1c 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -322,6 +322,7 @@ void LLSpatialGroup::buildOcclusion()
 	
 	{
 		mOcclusionVerts->flush();
+		LLVertexBuffer::unbind();
 	}
 
 	clearState(LLSpatialGroup::OCCLUSION_DIRTY);
-- 
GitLab


From 004cc9107bd48166d87b239fb506532ac6330ef9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 21 Oct 2011 15:51:49 -0500
Subject: [PATCH 130/933] SH-2240 Fix for OSX GLSL compiler not liking #ifndef
 gl_FragData

---
 .../newview/app_settings/shaders/class1/deferred/avatarF.glsl | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl | 2 +-
 .../newview/app_settings/shaders/class1/deferred/cloudsF.glsl | 2 +-
 .../shaders/class1/deferred/diffuseAlphaMaskF.glsl            | 2 +-
 .../shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl     | 2 +-
 .../shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl     | 2 +-
 .../app_settings/shaders/class1/deferred/diffuseF.glsl        | 2 +-
 .../app_settings/shaders/class1/deferred/diffuseIndexedF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/impostorF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/skyF.glsl  | 2 +-
 .../newview/app_settings/shaders/class1/deferred/starsF.glsl  | 2 +-
 .../app_settings/shaders/class1/deferred/terrainF.glsl        | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/treeF.glsl | 2 +-
 .../newview/app_settings/shaders/class1/deferred/waterF.glsl  | 2 +-
 .../app_settings/shaders/class1/objects/fullbrightF.glsl      | 4 ++--
 15 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index 945a1e71a52..9a3b2e3e8a5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
index 463c61090f1..6cc5f23acaf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index 73e726fe15f..db272cf601e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -24,7 +24,7 @@
  */
  
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index f3351c08bf8..14b79c37fd2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index 7d83b9a72c2..381fba8813e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index a24623d7b5e..b582ba7f9c5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -24,7 +24,7 @@
  */
  
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index a8e5ae4a622..7bde49eb86b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index 9a0e511bef8..75b45111e0e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index a929c0e4f59..5decddebbbd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index dac1ee1294f..96ad0aa93a3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 7986320c38d..03fccd27661 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index 3112a1ea7f8..e014e53d259 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index 06071056ac1..b934bc69919 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index 43cd4c2eed8..4c9ea24a249 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -25,7 +25,7 @@
  
 #extension GL_ARB_texture_rectangle : enable
 
-#ifndef gl_FragData
+#ifdef DEFINE_GL_FRAGCOLOR
 out vec4 gl_FragData[3];
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl
index 0fab5e50010..d2de1980a60 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  * 
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
+ * $/LicenseInfo$F
  */
  
 
@@ -28,6 +28,6 @@
 void fullbright_lighting();
 
 void main() 
-{
+{F
 	fullbright_lighting();
 }
-- 
GitLab


From 7534c4efefec53548cb8e2f232c7269cfa8c9e06 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Sun, 23 Oct 2011 07:53:45 -0400
Subject: [PATCH 131/933] storm-1663: allow wider range of pitch, make range
 the same for sitting and otherwise

---
 indra/newview/llagent.cpp | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f8b204eca0e..37bf8566623 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -1101,20 +1101,11 @@ F32 LLAgent::clampPitchToLimits(F32 angle)
 
 	LLVector3 skyward = getReferenceUpVector();
 
-	F32			look_down_limit;
-	F32			look_up_limit = 10.f * DEG_TO_RAD;
+	const F32 look_down_limit = 179.f * DEG_TO_RAD;;
+	const F32 look_up_limit   =   1.f * DEG_TO_RAD;
 
 	F32 angle_from_skyward = acos( mFrameAgent.getAtAxis() * skyward );
 
-	if (isAgentAvatarValid() && gAgentAvatarp->isSitting())
-	{
-		look_down_limit = 130.f * DEG_TO_RAD;
-	}
-	else
-	{
-		look_down_limit = 170.f * DEG_TO_RAD;
-	}
-
 	// clamp pitch to limits
 	if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit))
 	{
-- 
GitLab


From 1b987d2bf02be4df1635f5d11c01bcb8efb9cfff Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 24 Oct 2011 10:53:17 -0500
Subject: [PATCH 132/933] F ?

---
 .../app_settings/shaders/class1/objects/fullbrightF.glsl        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl
index d2de1980a60..a54c0caf810 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl
@@ -28,6 +28,6 @@
 void fullbright_lighting();
 
 void main() 
-{F
+{
 	fullbright_lighting();
 }
-- 
GitLab


From dfe75ba0ebfe01928d9daba76f6e8b864f770e59 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 24 Oct 2011 12:35:53 -0500
Subject: [PATCH 133/933] SH-2610 Fix for black terrain when bump map is
 visible and shaders are not supported.

---
 indra/newview/lldrawpoolbump.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 774ca2e8e7e..7b9fb2b34bb 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -786,7 +786,7 @@ void LLDrawPoolBump::endBump(U32 pass)
 	{
 		// Disable texture blending on unit 1
 		gGL.getTexUnit(1)->activate();
-		//gGL.getTexUnit(1)->disable();
+		gGL.getTexUnit(1)->disable();
 		gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT);
 
 		// Disable texture blending on unit 0
-- 
GitLab


From 51ba2f5fbc379f58d64f8850cd438cc95d7b89f7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 24 Oct 2011 12:58:51 -0500
Subject: [PATCH 134/933] SH-2240 Fix for crash on enabling shadows when Debug
 GL is enabled

---
 indra/newview/pipeline.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index cef4c649d70..04edc90be92 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -701,6 +701,9 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 
 bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 {
+	refreshCachedSettings();
+	refreshRenderDeferred();
+
 	// remember these dimensions
 	mScreenWidth = resX;
 	mScreenHeight = resY;
@@ -8435,6 +8438,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	BOOL skip_avatar_update = FALSE;
 	if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
 	{
+
 		skip_avatar_update = TRUE;
 	}
 
-- 
GitLab


From f5b10238aff1fe0332ed0253d2fbb07be54acd14 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 24 Oct 2011 13:10:26 -0500
Subject: [PATCH 135/933] SH-2240 Forcibly disable shaders on hardware that's
 specifically flagged as unsupported.

---
 indra/newview/gpu_table.txt        | 2 +-
 indra/newview/llfeaturemanager.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index 198e7024593..bb85551205f 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -367,7 +367,7 @@ NVIDIA GTX 550					.*NVIDIA .*GTX *55.*						3		1
 NVIDIA GTX 560					.*NVIDIA .*GTX *56.*						3		1
 NVIDIA GTX 570					.*NVIDIA .*GTX *57.*						3		1
 NVIDIA GTX 580M					.*NVIDIA .*GTX *580M.*						3		1
-NVIDIA GTX 580					.*NVIDIA .*GTX *58.*						3		1
+NVIDIA GTX 580					.*NVIDIA .*GTX *58.*						3		0
 NVIDIA GTX 590					.*NVIDIA .*GTX *59.*						3		1
 NVIDIA C51						.*NVIDIA .*C51.*							0		1
 NVIDIA G72						.*NVIDIA .*G72.*							1		1
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index eb0cdf28c0e..08f9d267054 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -731,7 +731,7 @@ void LLFeatureManager::applyBaseMasks()
 	{
 		maskFeatures("NoPixelShaders");
 	}
-	if (!gGLManager.mHasVertexShader)
+	if (!gGLManager.mHasVertexShader || !mGPUSupported)
 	{
 		maskFeatures("NoVertexShaders");
 	}
-- 
GitLab


From 7b83f1dfd1daeb4e0b80e1c369e83137682a723c Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 24 Oct 2011 13:11:44 -0500
Subject: [PATCH 136/933] GTX 580 is supported

---
 indra/newview/gpu_table.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index bb85551205f..198e7024593 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -367,7 +367,7 @@ NVIDIA GTX 550					.*NVIDIA .*GTX *55.*						3		1
 NVIDIA GTX 560					.*NVIDIA .*GTX *56.*						3		1
 NVIDIA GTX 570					.*NVIDIA .*GTX *57.*						3		1
 NVIDIA GTX 580M					.*NVIDIA .*GTX *580M.*						3		1
-NVIDIA GTX 580					.*NVIDIA .*GTX *58.*						3		0
+NVIDIA GTX 580					.*NVIDIA .*GTX *58.*						3		1
 NVIDIA GTX 590					.*NVIDIA .*GTX *59.*						3		1
 NVIDIA C51						.*NVIDIA .*C51.*							0		1
 NVIDIA G72						.*NVIDIA .*G72.*							1		1
-- 
GitLab


From 8b78d115c1e7cbe32f336d6d4250d28c8135ade5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 25 Oct 2011 11:23:45 -0500
Subject: [PATCH 137/933] SH-2618 Fix for local lights option being off by one
 click

---
 indra/newview/pipeline.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 04edc90be92..76ad7fd83e6 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1196,6 +1196,7 @@ S32 LLPipeline::getMaxLightingDetail() const
 S32 LLPipeline::setLightingDetail(S32 level)
 {
 	LLMemType mt_ld(LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL);
+	refreshCachedSettings();
 
 	if (level < 0)
 	{
-- 
GitLab


From c54f6cfdc3f44ccb6fee3acd5fa40bd177c67639 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 25 Oct 2011 12:28:12 -0500
Subject: [PATCH 138/933] SH-2622 Make Intel prefer fixed function over shaders
 where possible.

---
 indra/newview/llviewershadermgr.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index e50625af600..619a9078bea 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -363,8 +363,8 @@ void LLViewerShaderMgr::setShaders()
 
 	reentrance = true;
 
-	if (LLRender::sGLCoreProfile || gGLManager.mGLVersion >= 2.f)
-	{  //ALWAYS use shaders where available
+	if (LLRender::sGLCoreProfile || (gGLManager.mGLVersion >= 2.f && !gGLManager.mIsIntel))
+	{  //ALWAYS use shaders where available (except for intel, intel prefers fixed function)
 		if (!gSavedSettings.getBOOL("VertexShaderEnable"))
 		{ //vertex shaders MUST be enabled to use core profile
 			gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
-- 
GitLab


From 7dafa1be79f4e3f454ce022326cb09fa5cabb003 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 25 Oct 2011 15:07:57 -0500
Subject: [PATCH 139/933] SH-2622 Put back "Basic Shaders" toggle ability.

---
 indra/llrender/llgl.cpp                       |  4 +--
 indra/newview/llfloaterpreference.cpp         | 25 +++++++++++++++----
 indra/newview/llviewershadermgr.cpp           |  4 +--
 .../xui/en/panel_preferences_graphics1.xml    | 14 +++++++++++
 4 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index c0d15fe6f36..381f52a37ce 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1767,7 +1767,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
 		error = TRUE;
 	}
 
-	glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
+	/*glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
 	if (active_texture != GL_TEXTURE0_ARB)
 	{
 		llwarns << "Active texture corrupted: " << active_texture << llendl;
@@ -1776,7 +1776,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
 			gFailLog << "Active texture corrupted: " << active_texture << std::endl;
 		}
 		error = TRUE;
-	}
+	}*/
 
 	static const char* label[] =
 	{
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 92c4214fdbb..5fdeb46daaf 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1034,19 +1034,30 @@ void LLFloaterPreference::refreshEnabledState()
 	}
 	
 	// Vertex Shaders
+	// Global Shader Enable
+	LLCheckBoxCtrl* ctrl_shader_enable   = getChild<LLCheckBoxCtrl>("BasicShaders");
 	// radio set for terrain detail mode
 	LLRadioGroup*   mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio");   // can be linked with control var
 	
-	BOOL shaders = gGLManager.mGLVersion >= 2.f;
-
-	mRadioTerrainDetail->setEnabled(TRUE);		
-		
+	ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
+	
+	BOOL shaders = ctrl_shader_enable->get();
+	if (shaders)
+	{
+		mRadioTerrainDetail->setValue(1);
+		mRadioTerrainDetail->setEnabled(FALSE);
+	}
+	else
+	{
+		mRadioTerrainDetail->setEnabled(TRUE);		
+	}
+	
 	// WindLight
 	LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
 	
 	// *HACK just checks to see if we can use shaders... 
 	// maybe some cards that use shaders, but don't support windlight
-	ctrl_wind_light->setEnabled(shaders);
+	ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
 
 	//Deferred/SSAO/Shadows
 	LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@@ -1084,6 +1095,7 @@ void LLFloaterPreference::disableUnavailableSettings()
 	LLComboBox* ctrl_reflections   = getChild<LLComboBox>("Reflections");
 	LLCheckBoxCtrl* ctrl_avatar_vp     = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
 	LLCheckBoxCtrl* ctrl_avatar_cloth  = getChild<LLCheckBoxCtrl>("AvatarCloth");
+	LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
 	LLCheckBoxCtrl* ctrl_wind_light    = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
 	LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
 	LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@@ -1094,6 +1106,9 @@ void LLFloaterPreference::disableUnavailableSettings()
 	// if vertex shaders off, disable all shader related products
 	if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
 	{
+		ctrl_shader_enable->setEnabled(FALSE);
+		ctrl_shader_enable->setValue(FALSE);
+		
 		ctrl_wind_light->setEnabled(FALSE);
 		ctrl_wind_light->setValue(FALSE);
 		
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 619a9078bea..637cba6d6cf 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -363,8 +363,8 @@ void LLViewerShaderMgr::setShaders()
 
 	reentrance = true;
 
-	if (LLRender::sGLCoreProfile || (gGLManager.mGLVersion >= 2.f && !gGLManager.mIsIntel))
-	{  //ALWAYS use shaders where available (except for intel, intel prefers fixed function)
+	if (LLRender::sGLCoreProfile)
+	{  
 		if (!gSavedSettings.getBOOL("VertexShaderEnable"))
 		{ //vertex shaders MUST be enabled to use core profile
 			gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index c25c1f23f51..f7666bdc4ca 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -204,6 +204,20 @@
 		name="LocalLights"
 		 top_pad="1"
 		 width="256" />
+		  <check_box
+		 control_name="VertexShaderEnable"
+		 height="16"
+		 initial_value="true"
+		 label="Basic shaders"
+		 layout="topleft"
+		 left_delta="0"
+		 name="BasicShaders"
+		 tool_tip="Disabling this option may prevent some graphics card drivers from crashing"
+		 top_pad="1"
+		 width="315">
+			<check_box.commit_callback
+		     function="Pref.VertexShaderEnable" />
+		</check_box>
 		<check_box
 		 control_name="WindLightUseAtmosShaders"
 		 height="16"
-- 
GitLab


From db643d1881196c01687b06130f26452cd2e04bac Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 26 Oct 2011 11:21:01 -0400
Subject: [PATCH 140/933] STORM-1653 Group notices sent by muted residents are
 still displayed

---
 doc/contributions.txt             |  1 +
 indra/newview/llviewermessage.cpp | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 66b3237e635..b6f3ffc5fac 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -577,6 +577,7 @@ Jonathan Yap
 	STORM-1574
 	STORM-1579
 	STORM-1639
+	STORM-1653
 Kadah Coba
     STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 74ee918bfec..fe613b3dc9f 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2241,6 +2241,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 	{
         name = LLTrans::getString("Unnamed");
 	}
+
+	// Preserve the unaltered name for use in group notice mute checking.
+	std::string original_name = name;
+
 	// IDEVO convert new-style "Resident" names for display
 	name = clean_name_from_im(name, dialog);
 
@@ -2447,6 +2451,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 				break;
 			}
 
+			// The group notice packet does not have an AgentID.  Try to obtain one from the name cache.
+			// If there is a cache miss and a background fetch has to occur the group notice may
+			// be displayed even though the resident has been muted.
+			std::string legacy_name = gCacheName->buildLegacyName(original_name);
+			LLUUID agent_id;
+			gCacheName->getUUID(legacy_name, agent_id);
+			if (agent_id.notNull() && LLMuteList::getInstance()->isMuted(agent_id))
+			{
+				break;
+			}
+
 			notice_bin_bucket = (struct notice_bucket_full_t*) &binary_bucket[0];
 			U8 has_inventory = notice_bin_bucket->header.has_inventory;
 			U8 asset_type = notice_bin_bucket->header.asset_type;
-- 
GitLab


From da1898d1cb9a1539a897541afebe47ff6f517d30 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 26 Oct 2011 11:19:04 -0500
Subject: [PATCH 141/933] SH-2625 Fix for window size reverting to
 non-maximized whenever shaders are loaded.

---
 indra/llrender/llgl.cpp             | 2 +-
 indra/newview/llviewershadermgr.cpp | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 381f52a37ce..20ca189e7f5 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -553,7 +553,7 @@ bool LLGLManager::initGL()
 		&mDriverVersionVendorString );
 
 	mGLVersion = mDriverVersionMajor + mDriverVersionMinor * .1f;
-	
+
 	// Trailing space necessary to keep "nVidia Corpor_ati_on" cards
 	// from being recognized as ATI.
 	if (mGLVendor.substr(0,4) == "ATI ")
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 637cba6d6cf..cf5327e5f39 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -584,7 +584,6 @@ void LLViewerShaderMgr::setShaders()
 	if (gViewerWindow)
 	{
 		gViewerWindow->setCursor(UI_CURSOR_ARROW);
-		gViewerWindow->getWindow()->restore();
 	}
 	gPipeline.createGLBuffers();
 
-- 
GitLab


From f73fddd5d0c5a398a592dcc058b1feb09964560d Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 26 Oct 2011 14:06:08 -0400
Subject: [PATCH 142/933] STORM-1653 Group notices sent by muted residents are
 still displayed Added warning message if a null is returned from the name to
 id call.

---
 indra/newview/llviewermessage.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index fe613b3dc9f..05303cf3c51 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2451,13 +2451,16 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 				break;
 			}
 
-			// The group notice packet does not have an AgentID.  Try to obtain one from the name cache.
-			// If there is a cache miss and a background fetch has to occur the group notice may
-			// be displayed even though the resident has been muted.
+			// The group notice packet does not have an AgentID.  Obtain one from the name cache.
 			std::string legacy_name = gCacheName->buildLegacyName(original_name);
 			LLUUID agent_id;
 			gCacheName->getUUID(legacy_name, agent_id);
-			if (agent_id.notNull() && LLMuteList::getInstance()->isMuted(agent_id))
+
+			if (agent_id.isNull())
+			{
+				LL_WARNS("Messaging") << "buildLegacyName returned null" << LL_ENDL;			
+			}
+			else if (LLMuteList::getInstance()->isMuted(agent_id))
 			{
 				break;
 			}
-- 
GitLab


From 2d9785d8c747fd2c5c0ad40148fc318596b07f66 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 26 Oct 2011 14:56:49 -0500
Subject: [PATCH 143/933] SH-2546 Don't feed vertex color to terrain vertex
 buffers.

---
 .../shaders/class1/environment/terrainV.glsl  |  3 +--
 indra/newview/lldrawpoolterrain.cpp           |  5 ++--
 indra/newview/lldrawpoolterrain.h             |  3 +--
 indra/newview/llvosurfacepatch.cpp            | 24 +------------------
 indra/newview/llvosurfacepatch.h              |  7 +-----
 5 files changed, 7 insertions(+), 35 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index f183b885d19..d09c5f9247c 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -33,7 +33,6 @@ uniform vec4 object_plane_s;
 
 ATTRIBUTE vec3 position;
 ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 ATTRIBUTE vec2 texcoord1;
 
@@ -72,7 +71,7 @@ void main()
 	/// Potentially better without it for water.
 	pos /= pos.w;
 
-	vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
+	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0));
 	
 	vertex_color = color;
 
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index ce601325c88..d61df9c0485 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -189,6 +189,8 @@ void LLDrawPoolTerrain::render(S32 pass)
 		compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
 	}
 
+	LLOverrideFaceColor override(this, 1.f, 1.f, 1.f, 1.f);
+
 	if (!gGLManager.mHasMultitexture)
 	{
 		// No multitexture, render simple land.
@@ -203,8 +205,7 @@ void LLDrawPoolTerrain::render(S32 pass)
 	}
 
 	LLGLSPipeline gls;
-	LLOverrideFaceColor override(this, 1.f, 1.f, 1.f, 1.f);
-
+	
 	if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0)
 	{
 		gPipeline.enableLightsDynamic();
diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h
index 3056da44d57..283ed87f1ad 100644
--- a/indra/newview/lldrawpoolterrain.h
+++ b/indra/newview/lldrawpoolterrain.h
@@ -40,8 +40,7 @@ class LLDrawPoolTerrain : public LLFacePool
 							LLVertexBuffer::MAP_TEXCOORD0 |
 							LLVertexBuffer::MAP_TEXCOORD1 |
 							LLVertexBuffer::MAP_TEXCOORD2 |
-							LLVertexBuffer::MAP_TEXCOORD3 |
-							LLVertexBuffer::MAP_COLOR
+							LLVertexBuffer::MAP_TEXCOORD3
 	};
 
 	virtual U32 getVertexDataMask();
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index bc82b0df130..01086905382 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -317,7 +317,6 @@ BOOL LLVOSurfacePatch::updateLOD()
 
 void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
 								LLStrider<LLVector3> &normalsp,
-								LLStrider<LLColor4U> &colorsp,
 								LLStrider<LLVector2> &texCoords0p,
 								LLStrider<LLVector2> &texCoords1p,
 								LLStrider<U16> &indicesp)
@@ -329,7 +328,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
 	updateMainGeometry(facep, 
 					verticesp,
 					normalsp,
-					colorsp,
 					texCoords0p,
 					texCoords1p,
 					indicesp,
@@ -337,7 +335,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
 	updateNorthGeometry(facep, 
 						verticesp,
 						normalsp,
-						colorsp,
 						texCoords0p,
 						texCoords1p,
 						indicesp,
@@ -345,7 +342,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
 	updateEastGeometry(facep, 
 						verticesp,
 						normalsp,
-						colorsp,
 						texCoords0p,
 						texCoords1p,
 						indicesp,
@@ -355,7 +351,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
 void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
 										LLStrider<LLVector3> &verticesp,
 										LLStrider<LLVector3> &normalsp,
-										LLStrider<LLColor4U> &colorsp,
 										LLStrider<LLVector2> &texCoords0p,
 										LLStrider<LLVector2> &texCoords1p,
 										LLStrider<U16> &indicesp,
@@ -396,7 +391,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
 				x = i * render_stride;
 				y = j * render_stride;
 				mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
-				*colorsp++ = LLColor4U::white;
 				verticesp++;
 				normalsp++;
 				texCoords0p++;
@@ -461,7 +455,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
 void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 										LLStrider<LLVector3> &verticesp,
 										LLStrider<LLVector3> &normalsp,
-										LLStrider<LLColor4U> &colorsp,
 										LLStrider<LLVector2> &texCoords0p,
 										LLStrider<LLVector2> &texCoords1p,
 										LLStrider<U16> &indicesp,
@@ -499,7 +492,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			y = 16 - render_stride;
 
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
-			*colorsp++ = LLColor4U::white;
 			verticesp++;
 			normalsp++;
 			texCoords0p++;
@@ -515,7 +507,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 			vertex_count++;
@@ -554,7 +545,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 			vertex_count++;
@@ -569,7 +559,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 			vertex_count++;
@@ -613,7 +602,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			y = 16 - render_stride;
 
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
-			*colorsp++ = LLColor4U::white;
 			verticesp++;
 			normalsp++;
 			texCoords0p++;
@@ -630,7 +618,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 			vertex_count++;
@@ -668,7 +655,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 										  LLStrider<LLVector3> &verticesp,
 										  LLStrider<LLVector3> &normalsp,
-										  LLStrider<LLColor4U> &colorsp,
 										  LLStrider<LLVector2> &texCoords0p,
 										  LLStrider<LLVector2> &texCoords1p,
 										  LLStrider<U16> &indicesp,
@@ -702,7 +688,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 		}
@@ -715,7 +700,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 		}
@@ -753,7 +737,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 		}
@@ -766,7 +749,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 		}
@@ -810,7 +792,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 		}
@@ -823,7 +804,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
 			mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
 			verticesp++;
 			normalsp++;
-			*colorsp++ = LLColor4U::white;
 			texCoords0p++;
 			texCoords1p++;
 		}
@@ -1094,14 +1074,12 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
 	LLStrider<LLVector3> normals;
 	LLStrider<LLVector2> texcoords2;
 	LLStrider<LLVector2> texcoords;
-	LLStrider<LLColor4U> colors;
 	LLStrider<U16> indices;
 
 	llassert_always(buffer->getVertexStrider(vertices));
 	llassert_always(buffer->getNormalStrider(normals));
 	llassert_always(buffer->getTexCoord0Strider(texcoords));
 	llassert_always(buffer->getTexCoord1Strider(texcoords2));
-	llassert_always(buffer->getColorStrider(colors));
 	llassert_always(buffer->getIndexStrider(indices));
 
 	U32 indices_index = 0;
@@ -1116,7 +1094,7 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
 		facep->setVertexBuffer(buffer);
 
 		LLVOSurfacePatch* patchp = (LLVOSurfacePatch*) facep->getViewerObject();
-		patchp->getGeometry(vertices, normals, colors, texcoords, texcoords2, indices);
+		patchp->getGeometry(vertices, normals, texcoords, texcoords2, indices);
 
 		indices_index += facep->getIndicesCount();
 		index_offset += facep->getGeomCount();
diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h
index 8e75ff2e6e8..a15878368e4 100644
--- a/indra/newview/llvosurfacepatch.h
+++ b/indra/newview/llvosurfacepatch.h
@@ -44,8 +44,7 @@ class LLVOSurfacePatch : public LLStaticViewerObject
 		VERTEX_DATA_MASK =	(1 << LLVertexBuffer::TYPE_VERTEX) |
 							(1 << LLVertexBuffer::TYPE_NORMAL) |
 							(1 << LLVertexBuffer::TYPE_TEXCOORD0) |
-							(1 << LLVertexBuffer::TYPE_TEXCOORD1) |
-							(1 << LLVertexBuffer::TYPE_COLOR) 
+							(1 << LLVertexBuffer::TYPE_TEXCOORD1)
 	};
 
 	LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
@@ -64,7 +63,6 @@ class LLVOSurfacePatch : public LLStaticViewerObject
 	/*virtual*/ void		updateFaceSize(S32 idx);
 	void getGeometry(LLStrider<LLVector3> &verticesp,
 								LLStrider<LLVector3> &normalsp,
-								LLStrider<LLColor4U> &colorsp,
 								LLStrider<LLVector2> &texCoords0p,
 								LLStrider<LLVector2> &texCoords1p,
 								LLStrider<U16> &indicesp);
@@ -116,7 +114,6 @@ class LLVOSurfacePatch : public LLStaticViewerObject
 	void updateMainGeometry(LLFace *facep,
 					   LLStrider<LLVector3> &verticesp,
 					   LLStrider<LLVector3> &normalsp,
-					   LLStrider<LLColor4U> &colorsp,
 					   LLStrider<LLVector2> &texCoords0p,
 					   LLStrider<LLVector2> &texCoords1p,
 					   LLStrider<U16> &indicesp,
@@ -124,7 +121,6 @@ class LLVOSurfacePatch : public LLStaticViewerObject
 	void updateNorthGeometry(LLFace *facep,
 					   LLStrider<LLVector3> &verticesp,
 					   LLStrider<LLVector3> &normalsp,
-					   LLStrider<LLColor4U> &colorsp,
 					   LLStrider<LLVector2> &texCoords0p,
 					   LLStrider<LLVector2> &texCoords1p,
 					   LLStrider<U16> &indicesp,
@@ -132,7 +128,6 @@ class LLVOSurfacePatch : public LLStaticViewerObject
 	void updateEastGeometry(LLFace *facep,
 					   LLStrider<LLVector3> &verticesp,
 					   LLStrider<LLVector3> &normalsp,
-					   LLStrider<LLColor4U> &colorsp,
 					   LLStrider<LLVector2> &texCoords0p,
 					   LLStrider<LLVector2> &texCoords1p,
 					   LLStrider<U16> &indicesp,
-- 
GitLab


From 735708583fc6e236df3ad6d4c9a5f02b6ec7605a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 26 Oct 2011 15:35:33 -0500
Subject: [PATCH 144/933] SH-2546 Make sure terrain shaders don't attempt to
 use indexed texture rendering.

---
 indra/newview/llviewershadermgr.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index cf5327e5f39..108f008f58c 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -827,6 +827,8 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment()
 		gTerrainProgram.mFeatures.calculatesLighting = true;
 		gTerrainProgram.mFeatures.calculatesAtmospherics = true;
 		gTerrainProgram.mFeatures.hasAtmospherics = true;
+		gTerrainProgram.mFeatures.mIndexedTextureChannels = 0;
+		gTerrainProgram.mFeatures.disableTextureIndex = true;
 		gTerrainProgram.mFeatures.hasGamma = true;
 		gTerrainProgram.mShaderFiles.clear();
 		gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB));
@@ -895,6 +897,8 @@ BOOL LLViewerShaderMgr::loadShadersWater()
 		gTerrainWaterProgram.mFeatures.calculatesAtmospherics = true;
 		gTerrainWaterProgram.mFeatures.hasAtmospherics = true;
 		gTerrainWaterProgram.mFeatures.hasWaterFog = true;
+		gTerrainWaterProgram.mFeatures.mIndexedTextureChannels = 0;
+		gTerrainWaterProgram.mFeatures.disableTextureIndex = true;
 		gTerrainWaterProgram.mShaderFiles.clear();
 		gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB));
 		gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
-- 
GitLab


From 969aa248a4c398dd0608a447f99cf74683d09f65 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 28 Oct 2011 16:26:20 -0500
Subject: [PATCH 145/933] SH-2633 Fix for avatar hair turning white when
 editing appearance

---
 indra/llrender/llrender.cpp                   | 20 +++++++++----------
 .../shaders/class1/avatar/avatarV.glsl        |  5 +++--
 .../shaders/class1/deferred/avatarAlphaV.glsl | 10 ++++++----
 .../class1/objects/simpleNoColorV.glsl        |  6 ++++--
 .../shaders/class2/deferred/avatarAlphaV.glsl |  7 ++++---
 .../class2/windlight/atmosphericsVarsV.glsl   |  4 +++-
 .../shaders/class3/avatar/avatarV.glsl        |  6 ++++--
 7 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index afb19fce55a..97aeae548af 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1142,16 +1142,6 @@ void LLRender::syncMatrices()
 {
 	stop_glerror();
 
-	GLenum mode[] = 
-	{
-		GL_MODELVIEW,
-		GL_PROJECTION,
-		GL_TEXTURE,
-		GL_TEXTURE,
-		GL_TEXTURE,
-		GL_TEXTURE,
-	};
-
 	U32 name[] = 
 	{
 		LLShaderMgr::MODELVIEW_MATRIX,
@@ -1272,6 +1262,16 @@ void LLRender::syncMatrices()
 	}
 	else if (!LLGLSLShader::sNoFixedFunction)
 	{
+		GLenum mode[] = 
+		{
+			GL_MODELVIEW,
+			GL_PROJECTION,
+			GL_TEXTURE,
+			GL_TEXTURE,
+			GL_TEXTURE,
+			GL_TEXTURE,
+		};
+
 		for (U32 i = 0; i < 2; ++i)
 		{
 			if (mMatHash[i] != mCurMatHash[i])
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index 2901e18db8e..19203ab6707 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -32,6 +32,7 @@ ATTRIBUTE vec2 texcoord0;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+uniform vec4 color;
 
 vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
@@ -61,8 +62,8 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
-	vertex_color = color; 
+	vec4 col = calcLighting(pos.xyz, norm, color, vec4(0,0,0,0));
+	vertex_color = col; 
 
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index acbc3f7e156..d7b90978ba4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -52,6 +52,8 @@ VARYING vec2 vary_texcoord0;
 
 uniform float near_clip;
 
+uniform vec4 color;
+
 uniform vec4 light_position[8];
 uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
@@ -123,17 +125,17 @@ void main()
 	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
 	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
-	vary_pointlight_col = col.rgb;
+	vary_pointlight_col = col.rgb*color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb;
-	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
+	vary_ambient = col.rgb*color.rgb;
+	vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
 	
-	col.rgb = min(col.rgb, 1.0);
+	col.rgb = col.rgb * color.rgb;
 	
 	vertex_color = col;
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index 706627e1756..0be52a52af3 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -28,6 +28,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_matrix;
 uniform mat4 modelview_projection_matrix;
 
+uniform vec4 color;
+
 ATTRIBUTE vec3 position;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
@@ -50,8 +52,8 @@ void main()
 
 	calcAtmospherics(pos.xyz);
 
-	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
-	vertex_color = color;
+	vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.));
+	vertex_color = col;
 
 	
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 63c7a6b13d3..9c7a3324179 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -49,6 +49,7 @@ VARYING vec3 vary_pointlight_col;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+uniform vec4 color;
 
 uniform float near_clip;
 uniform float shadow_offset;
@@ -125,17 +126,17 @@ void main()
 	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
 	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
-	vary_pointlight_col = col.rgb;
+	vary_pointlight_col = col.rgb*color.rgb;
 
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_ambient = col.rgb;
+	vary_ambient = col.rgb*color.rgb;
 	vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
 	
-	col.rgb = min(col.rgb, 1.0);
+	col.rgb = col.rgb*color.rgb;
 	
 	vertex_color = col;
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index 01605e5b251..ba2ed6b1cec 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -27,6 +27,7 @@
 VARYING vec3 vary_AdditiveColor;
 VARYING float vary_AtmosAttenuation;
 
+vec3 additive_color;
 vec3 atmos_attenuation;
 vec3 sunlit_color;
 vec3 amblit_color;
@@ -43,7 +44,7 @@ vec3 getAmblitColor()
 
 vec3 getAdditiveColor()
 {
-	return vary_AdditiveColor;
+	return additive_color;
 }
 vec3 getAtmosAttenuation()
 {
@@ -72,6 +73,7 @@ void setAmblitColor(vec3 v)
 
 void setAdditiveColor(vec3 v)
 {
+	additive_color = v;
 	vary_AdditiveColor = v;
 }
 
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index 7fb3cb65529..721054b5adb 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -37,6 +37,8 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getSkinnedTransform();
 void calcAtmospherics(vec3 inPositionEye);
 
+uniform vec4 color;
+
 uniform vec4 gWindDir;		
 uniform vec4 gSinWaveParams; 
 uniform vec4 gGravity;		
@@ -125,8 +127,8 @@ void main()
 
 	calcAtmospherics(pos.xyz);
 	
-	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.0));			
-	vertex_color = color; 
+	vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.0));			
+	vertex_color = col; 
 					
 	gl_Position = projection_matrix * pos;
 }
-- 
GitLab


From 4cdf3961253b49093bf3e2fceda0099cedef4295 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 28 Oct 2011 17:48:24 -0400
Subject: [PATCH 146/933] STORM-591 As a music fan, I want audio to fade in
 gently so my immersion is increased Co-written with Robin Cornelius

---
 doc/contributions.txt                   |   2 +
 indra/newview/app_settings/settings.xml |  22 ++
 indra/newview/lloverlaybar.cpp          | 378 ------------------------
 indra/newview/lloverlaybar.h            |  95 ------
 indra/newview/llpanelnearbymedia.cpp    |  24 +-
 indra/newview/llpanelnearbymedia.h      |   1 -
 indra/newview/llvieweraudio.cpp         | 211 ++++++++++++-
 indra/newview/llvieweraudio.h           |  41 +++
 indra/newview/llviewermedia.cpp         |  22 +-
 indra/newview/llviewerparcelmgr.cpp     |  55 ++--
 10 files changed, 322 insertions(+), 529 deletions(-)
 delete mode 100644 indra/newview/lloverlaybar.cpp
 delete mode 100644 indra/newview/lloverlaybar.h

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 988410701b7..0f7f458a814 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -581,6 +581,7 @@ Jonathan Yap
 	STORM-1639
 	STORM-910
 	STORM-1642
+	STORM-591
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
@@ -913,6 +914,7 @@ Robin Cornelius
 	SNOW-599
 	SNOW-747
 	STORM-422
+	STORM-591
 	STORM-960
 	STORM-1019
 	STORM-1095
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 3c53a9d44c3..c7300cc1bb7 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -192,6 +192,28 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>AudioMusicFadeIn</key>
+    <map>
+      <key>Comment</key>
+      <string>Fade in time in seconds for music streams</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>5.0</real>
+    </map>
+    <key>AudioMusicFadeOut</key>
+    <map>
+      <key>Comment</key>
+      <string>Fade out time in seconds for music streams</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>5.0</real>
+    </map>
     <key>AudioLevelAmbient</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp
deleted file mode 100644
index c2bbec04700..00000000000
--- a/indra/newview/lloverlaybar.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-/** 
- * @file lloverlaybar.cpp
- * @brief LLOverlayBar class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-// Temporary buttons that appear at the bottom of the screen when you
-// are in a mode.
-
-#include "llviewerprecompiledheaders.h"
-
-#include "lloverlaybar.h"
-
-#include "llaudioengine.h"
-#include "llrender.h"
-#include "llagent.h"
-#include "llbutton.h"
-#include "llfocusmgr.h"
-#include "llimview.h"
-#include "llmediaremotectrl.h"
-#include "llparcel.h"
-#include "lltextbox.h"
-#include "llui.h"
-#include "llviewercontrol.h"
-#include "llviewertexturelist.h"
-#include "llviewerjoystick.h"
-#include "llviewermedia.h"
-#include "llviewermenu.h"	// handle_reset_view()
-#include "llviewermedia.h"
-#include "llviewerparcelmedia.h"
-#include "llviewerparcelmgr.h"
-#include "lluictrlfactory.h"
-#include "llviewerwindow.h"
-#include "llvoiceclient.h"
-#include "llvoavatarself.h"
-#include "llvoiceremotectrl.h"
-#include "llmediactrl.h"
-#include "llselectmgr.h"
-
-//
-// Globals
-//
-
-LLOverlayBar *gOverlayBar = NULL;
-
-extern S32 MENU_BAR_HEIGHT;
-
-//
-// Functions
-//
-
-
-
-void* LLOverlayBar::createMediaRemote(void* userdata)
-{
-	LLOverlayBar *self = (LLOverlayBar*)userdata;	
-	self->mMediaRemote =  new LLMediaRemoteCtrl ();
-	return self->mMediaRemote;
-}
-
-void* LLOverlayBar::createVoiceRemote(void* userdata)
-{
-	LLOverlayBar *self = (LLOverlayBar*)userdata;	
-	self->mVoiceRemote = new LLVoiceRemoteCtrl();
-	return self->mVoiceRemote;
-}
-
-LLOverlayBar::LLOverlayBar()
-	:	LLPanel(),
-		mMediaRemote(NULL),
-		mVoiceRemote(NULL),
-		mMusicState(STOPPED)
-{
-	setMouseOpaque(FALSE);
-	setIsChrome(TRUE);
-
-	mBuilt = false;
-
-	mFactoryMap["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this);
-	mFactoryMap["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this);
-	
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml");
-}
-
-BOOL LLOverlayBar::postBuild()
-{
-	childSetAction("Set Not Busy",onClickSetNotBusy,this);
-	childSetAction("Mouselook",onClickMouselook,this);
-	childSetAction("Stand Up",onClickStandUp,this);
- 	childSetAction("Flycam",onClickFlycam,this);
-	childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
-
-	mVoiceRemote->expandOrCollapse();
-	mMediaRemote->expandOrCollapse();
-
-	setFocusRoot(TRUE);
-	mBuilt = true;
-
-	layoutButtons();
-	return TRUE;
-}
-
-LLOverlayBar::~LLOverlayBar()
-{
-	// LLView destructor cleans up children
-}
-
-// virtual
-void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent)
-{
-	LLView::reshape(width, height, called_from_parent);
-
-	if (mBuilt) 
-	{
-		layoutButtons();
-	}
-}
-
-void LLOverlayBar::layoutButtons()
-{
-	LLView* state_buttons_panel = getChildView("state_buttons");
-
-	if (state_buttons_panel->getVisible())
-	{
-		LLViewQuery query;
-		LLWidgetTypeFilter<LLButton> widget_filter;
-		query.addPreFilter(LLEnabledFilter::getInstance());
-		query.addPreFilter(&widget_filter);
-
-		child_list_t button_list = query(state_buttons_panel);
-
-		const S32 MAX_BAR_WIDTH = 600;
-		S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH);
-
-		// calculate button widths
-		const S32 MAX_BUTTON_WIDTH = 150;
-		const S32 STATUS_BAR_PAD = 10;
-		S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_list.size()), 0, MAX_BUTTON_WIDTH);
-		S32 btn_width = segment_width - STATUS_BAR_PAD;
-
-		// Evenly space all buttons, starting from left
-		S32 left = 0;
-		S32 bottom = 1;
-
-		for (child_list_reverse_iter_t child_iter = button_list.rbegin();
-			child_iter != button_list.rend(); ++child_iter)
-		{
-			LLView *view = *child_iter;
-			LLRect r = view->getRect();
-			r.setOriginAndSize(left, bottom, btn_width, r.getHeight());
-			view->setRect(r);
-			left += segment_width;
-		}
-	}
-}
-
-// Per-frame updates of visibility
-void LLOverlayBar::refresh()
-{
-	BOOL buttons_changed = FALSE;
-
-	BOOL im_received = gIMMgr->getIMReceived();
-	LLButton* button = getChild<LLButton>("IM Received");
-	if (button && button->getVisible() != im_received)
-	{
-		button->setVisible(im_received);
-		sendChildToFront(button);
-		moveChildToBackOfTabGroup(button);
-		buttons_changed = TRUE;
-	}
-
-	BOOL busy = gAgent.getBusy();
-	button = getChild<LLButton>("Set Not Busy");
-	if (button && button->getVisible() != busy)
-	{
-		button->setVisible(busy);
-		sendChildToFront(button);
-		moveChildToBackOfTabGroup(button);
-		buttons_changed = TRUE;
-	}
-
-	BOOL flycam = LLViewerJoystick::getInstance()->getOverrideCamera();
-	button = getChild<LLButton>("Flycam");
-	if (button && button->getVisible() != flycam)
-	{
-		button->setVisible(flycam);
-		sendChildToFront(button);
-		moveChildToBackOfTabGroup(button);
-		buttons_changed = TRUE;
-	}		
-
-	BOOL mouselook_grabbed;
-	mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)
-		|| gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX);
-	button = getChild<LLButton>("Mouselook");
-
-	if (button && button->getVisible() != mouselook_grabbed)
-	{
-		button->setVisible(mouselook_grabbed);
-		sendChildToFront(button);
-		moveChildToBackOfTabGroup(button);
-		buttons_changed = TRUE;
-	}
-
-	BOOL sitting = FALSE;
-	if (gAgent.getAvatarObject())
-	{
-		sitting = gAgent.getAvatarObject()->isSitting();
-	}
-	button = getChild<LLButton>("Stand Up");
-
-	if (button && button->getVisible() != sitting)
-	{
-		button->setVisible(sitting);
-		sendChildToFront(button);
-		moveChildToBackOfTabGroup(button);
-		buttons_changed = TRUE;
-	}
-
-
-	moveChildToBackOfTabGroup(mMediaRemote);
-	moveChildToBackOfTabGroup(mVoiceRemote);
-
-	// turn off the whole bar in mouselook
-	if (gAgent.cameraMouselook())
-	{
-		childSetVisible("media_remote_container", FALSE);
-		childSetVisible("voice_remote_container", FALSE);
-		childSetVisible("state_buttons", FALSE);
-	}
-	else
-	{
-		// update "remotes"
-		childSetVisible("media_remote_container", TRUE);
-		childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled());
-		childSetVisible("state_buttons", TRUE);
-	}
-
-	// always let user toggle into and out of chatbar
-	childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
-
-	if (buttons_changed)
-	{
-		layoutButtons();
-	}
-}
-
-//-----------------------------------------------------------------------
-// Static functions
-//-----------------------------------------------------------------------
-
-// static
-void LLOverlayBar::onClickSetNotBusy(void*)
-{
-	gAgent.clearBusy();
-}
-
-
-// static
-void LLOverlayBar::onClickFlycam(void*)
-{
-	LLViewerJoystick::getInstance()->toggleFlycam();
-}
-
-// static
-void LLOverlayBar::onClickResetView(void* data)
-{
-	handle_reset_view();
-}
-
-//static
-void LLOverlayBar::onClickMouselook(void*)
-{
-	gAgent.changeCameraToMouselook();
-}
-
-//static
-void LLOverlayBar::onClickStandUp(void*)
-{
-	LLSelectMgr::getInstance()->deselectAllForStandingUp();
-	gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// static media helpers
-// *TODO: Move this into an audio manager abstraction
-//static
-void LLOverlayBar::mediaStop(void*)
-{
-	if (!gOverlayBar)
-	{
-		// return;
-	}
-	LLViewerParcelMedia::stop();
-}
-//static
-void LLOverlayBar::toggleMediaPlay(void*)
-{
-	if (!gOverlayBar)
-	{
-		// return;
-	}
-
-	
-	if (LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PAUSED)
-	{
-		LLViewerParcelMedia::start();
-	}
-	else if(LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PLAYING)
-	{
-		LLViewerParcelMedia::pause();
-	}
-	else
-	{
-		LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
-		if (parcel)
-		{
-			LLViewerParcelMedia::play(parcel);
-		}
-	}
-}
-
-//static
-void LLOverlayBar::toggleMusicPlay(void*)
-{
-	if (gAudiop->isInternetStreamPlaying() != 1)
-	{
-		if (gAudiop)
-		{
-			LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
-			if ( parcel )
-			{
-				// this doesn't work properly when crossing parcel boundaries - even when the 
-				// stream is stopped, it doesn't return the right thing - commenting out for now.
-	// 			if ( gAudiop->isInternetStreamPlaying() == 0 )
-				{
-					gAudiop->startInternetStream(parcel->getMusicURL());
-				}
-			}
-		}
-	}
-	//else
-	//{
-	//	gOverlayBar->mMusicState = PAUSED; // desired state
-	//	if (gAudiop)
-	//	{
-	//		gAudiop->pauseInternetStream(1);
-	//	}
-	//}
-	else
-	{
-		if (gAudiop)
-		{
-			gAudiop->stopInternetStream();
-		}
-	}
-}
-
diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h
deleted file mode 100644
index b36f5ebb731..00000000000
--- a/indra/newview/lloverlaybar.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/** 
- * @file lloverlaybar.h
- * @brief LLOverlayBar class definition
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLOVERLAYBAR_H
-#define LL_LLOVERLAYBAR_H
-
-#include "llpanel.h"
-
-// "Constants" loaded from settings.xml at start time
-extern S32 STATUS_BAR_HEIGHT;
-
-class LLButton;
-class LLLineEditor;
-class LLMediaRemoteCtrl;
-class LLMessageSystem;
-class LLTextBox;
-class LLTextEditor;
-class LLUICtrl;
-class LLUUID;
-class LLFrameTimer;
-class LLStatGraph;
-class LLSlider;
-class LLVoiceRemoteCtrl;
-
-class LLOverlayBar
-:	public LLPanel
-{
-public:
-	LLOverlayBar();
-	~LLOverlayBar();
-
-	/*virtual*/ void refresh();
-	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
-	/*virtual*/ BOOL postBuild();
-
-	void layoutButtons();
-
-	// helpers for returning desired state
-	BOOL musicPlaying() { return mMusicState == PLAYING; }
-	
-	static void onClickSetNotBusy(void* data);
-	static void onClickMouselook(void* data);
-	static void onClickStandUp(void* data);
-	static void onClickResetView(void* data);
- 	static void onClickFlycam(void* data);
-
-	//static media helper functions
-	static void toggleMediaPlay(void*);
-	static void toggleMusicPlay(void*);
-	static void musicPause(void*);
-	static void musicStop(void*);
-	static void mediaStop(void*);
-
-	static void toggleAudioVolumeFloater(void*);
-
-protected:	
-	static void* createMediaRemote(void* userdata);
-	static void* createVoiceRemote(void* userdata);
-
-	void enableMediaButtons();
-
-protected:
-	LLMediaRemoteCtrl*	mMediaRemote;
-	LLVoiceRemoteCtrl*	mVoiceRemote;
-	bool mBuilt;	// dialog constructed yet?
-	enum { STOPPED=0, PLAYING=1, PAUSED=2 };
-	S32 mMusicState;
-};
-
-extern LLOverlayBar* gOverlayBar;
-
-#endif
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 2bbd15ae117..53fc64f089f 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -52,6 +52,7 @@
 #include "llvovolume.h"
 #include "llstatusbar.h"
 #include "llsdutil.h"
+#include "llvieweraudio.h"
 
 #include "llfloaterreg.h"
 #include "llfloaterpreference.h" // for the gear icon
@@ -808,7 +809,7 @@ bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled)
 	if (row_id == PARCEL_AUDIO_LIST_ITEM_UUID)
 	{
 		if (disabled) onClickParcelAudioStop();
-		else onClickParcelAudioStart();
+		else onClickParcelAudioPlay();
 		return true;
 	}
 	else if (row_id == PARCEL_MEDIA_LIST_ITEM_UUID)
@@ -857,24 +858,11 @@ void LLPanelNearByMedia::onClickParcelMediaPause()
 	LLViewerParcelMedia::pause();
 }
 
-void LLPanelNearByMedia::onClickParcelAudioStart()
-{
-	// User *explicitly* started the internet stream, so keep the stream
-	// playing and updated as they cross to other parcels etc.
-	mParcelAudioAutoStart = true;
-		
-	if (!gAudiop)
-		return;
-	
-	gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL());
-}
-
 void LLPanelNearByMedia::onClickParcelAudioPlay()
 {
 	// User *explicitly* started the internet stream, so keep the stream
 	// playing and updated as they cross to other parcels etc.
 	mParcelAudioAutoStart = true;
-
 	if (!gAudiop)
 		return;
 
@@ -883,8 +871,9 @@ void LLPanelNearByMedia::onClickParcelAudioPlay()
 		// 'false' means unpause
 		gAudiop->pauseInternetStream(false);
 	}
-	else {
-		gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL());
+	else
+	{
+		LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
 	}
 }
 
@@ -894,11 +883,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop()
 	// re-start audio when i.e. they move to another parcel, until
 	// they explicitly start it again.
 	mParcelAudioAutoStart = false;
-
 	if (!gAudiop)
 		return;
 
-	gAudiop->stopInternetStream();
+	LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
 }
 
 void LLPanelNearByMedia::onClickParcelAudioPause()
diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h
index be4d3137435..c3634de9b47 100644
--- a/indra/newview/llpanelnearbymedia.h
+++ b/indra/newview/llpanelnearbymedia.h
@@ -115,7 +115,6 @@ class LLPanelNearByMedia : public LLPanel
 	void onClickParcelMediaPause();
 	void onClickParcelAudioPlay();
 	void onClickParcelAudioStop();
-	void onClickParcelAudioStart();
 	void onClickParcelAudioPause();
 	void onCheckAutoPlay();
 	void onAdvancedButtonClick();	
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index f7fa5690d69..8fd1ca38076 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -37,9 +37,212 @@
 #include "llvoiceclient.h"
 #include "llviewermedia.h"
 #include "llprogressview.h"
+#include "llcallbacklist.h"
 
 /////////////////////////////////////////////////////////
 
+LLViewerAudio::LLViewerAudio() :
+	mDone(true),
+	mFadeState(FADE_IDLE),
+	mFadeTime(),
+    mIdleListnerActive(false)
+{
+}
+
+LLViewerAudio::~LLViewerAudio()
+{
+}
+
+void LLViewerAudio::registerIdleListener()
+{
+	if(mIdleListnerActive==false)
+	{
+		mIdleListnerActive = true;
+		doOnIdleRepeating(boost::bind(boost::bind(&LLViewerAudio::onIdleUpdate, this)));
+	}
+
+}
+
+void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
+{
+	llinfos << "DBG streamURI: " << streamURI << llendl;
+	llinfos << "DBG mNextStreamURI: " << mNextStreamURI << llendl;
+	if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
+	if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;}
+	if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;}
+
+	// Old and new stream are identical
+	if (mNextStreamURI == streamURI)
+	{
+		return;
+	}
+
+	// Record the URI we are going to be switching to	
+	mNextStreamURI = streamURI;
+
+	if (mFadeState == FADE_IDLE)
+	{
+		// If a stream is playing fade it out first
+		if (!gAudiop->getInternetStreamURL().empty())
+		{
+			mFadeState = FADE_OUT;
+llinfos << "DBG new mFadeState: OUT" << llendl;
+		}
+		// Otherwise the new stream can be faded in
+		else
+		{
+			mFadeState = FADE_IN;
+llinfos << "DBG new mFadeState: IN" << llendl;
+
+			gAudiop->startInternetStream(mNextStreamURI);
+			startFading();
+			registerIdleListener();
+			return;
+		}
+	}
+
+	if (mFadeState == FADE_OUT)
+	{
+		startFading();
+		registerIdleListener();
+		return;
+	}
+
+	if (mFadeState == FADE_IN)
+	{
+		registerIdleListener();
+		return;
+	}
+}
+
+// We want onIdleUpdate callback to keep firing whilst we are fading out. Once we have completed the fade
+// out, we switch the stream and start a fade in, and we don't care about idle updates anymore.
+// A return of false from onIdleUpdate means it will be called again next idle update.
+// A return of true means we have finished with it and the callback will be deleted.
+bool LLViewerAudio::onIdleUpdate()
+{
+	if (mDone)
+	{
+		if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
+		if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;}
+		if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;}
+
+		//  This should be a rare or never occurring state.
+		if (mFadeState == FADE_IDLE)
+		{
+			deregisterIdleListener();
+			return true; // Stop calling onIdleUpdate
+		}
+
+		// we have finished the current fade operation
+		if (mFadeState == FADE_OUT)
+		{
+			// Clear URI
+			gAudiop->startInternetStream(LLStringUtil::null);
+			gAudiop->stopInternetStream();
+				
+			if (!mNextStreamURI.empty())
+			{
+				mFadeState = FADE_IN;
+llinfos << "DBG new mFadeState: IN" << llendl;
+				gAudiop->startInternetStream(mNextStreamURI);
+				startFading();
+				return false;
+			}
+			else
+			{
+				mFadeState = FADE_IDLE;
+llinfos << "DBG new mFadeState: IDLE" << llendl;
+				deregisterIdleListener();
+				return true; // Stop calling onIdleUpdate
+			}
+		}
+		else if (mFadeState == FADE_IN)
+		{
+			if (mNextStreamURI != gAudiop->getInternetStreamURL())
+			{
+				mFadeState = FADE_OUT;
+				startFading();
+				return false;
+llinfos << "DBG new mFadeState: OUT" << llendl;
+			}
+			else
+			{
+				mFadeState = FADE_IDLE;
+llinfos << "DBG new mFadeState: IDLE" << llendl;
+				deregisterIdleListener();
+				return true; // Stop calling onIdleUpdate
+			}
+		}
+	}
+
+	return false;
+}
+
+void LLViewerAudio::stopInternetStreamWithAutoFade()
+{
+llinfos << "DBG stopping stream" << llendl;
+	mFadeState = FADE_IDLE;
+llinfos << "DBG new mFadeState: IDLE" << llendl;
+	mNextStreamURI = LLStringUtil::null;
+	mDone = true;
+llinfos << "DBG mDone: true" << llendl;
+
+	gAudiop->startInternetStream(LLStringUtil::null);
+	gAudiop->stopInternetStream();
+}
+
+void LLViewerAudio::startFading()
+{
+llinfos << "DBG startFading" << llendl;
+
+	if(mDone)
+	{
+		// The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not,
+		// rather than check for both states assume a fade in and check for the fade out case.
+		mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeIn"));
+		if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT)
+		{
+			mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeOut"));
+		}
+		stream_fade_timer.reset();
+		stream_fade_timer.setTimerExpirySec(mFadeTime);
+		mDone = false;
+llinfos << "DBG mDone: false" << llendl;
+	}
+}
+
+F32 LLViewerAudio::getFadeVolume()
+{
+	F32 fade_volume = 1.0f;
+
+	if (stream_fade_timer.hasExpired())
+	{
+		mDone = true;
+		// If we have been fading out set volume to 0 until the next fade state occurs to prevent
+		// an audio transient.
+		if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT)
+		{
+			fade_volume = 0.0f;
+		}
+	}
+
+	if (!mDone)
+	{
+		// Calculate how far we are into the fade time
+		fade_volume = stream_fade_timer.getElapsedTimeF32() / mFadeTime;
+		
+		if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT)
+		{
+			// If we are not fading in then we are fading out, so invert the fade
+			// direction; start loud and move towards zero volume.
+			fade_volume = 1.0f - fade_volume;
+		}
+	}
+
+	return fade_volume;
+}
+
 void init_audio() 
 {
 	if (!gAudiop) 
@@ -145,9 +348,11 @@ void audio_update_volume(bool force_update)
 	{		
 		F32 music_volume = gSavedSettings.getF32("AudioLevelMusic");
 		BOOL music_muted = gSavedSettings.getBOOL("MuteMusic");
-		music_volume = mute_volume * master_volume * music_volume;
-		gAudiop->setInternetStreamGain ( music_muted || progress_view_visible ? 0.f : music_volume );
-	
+		F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume();
+llinfos << "DBG fade_volume:" << fade_volume << llendl;
+
+		music_volume = mute_volume * master_volume * music_volume * fade_volume;
+		gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume);
 	}
 
 	// Streaming Media
diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index e5916285fba..316d7b32d2b 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -27,6 +27,10 @@
 #ifndef LL_VIEWERAUDIO_H
 #define LL_VIEWERAUDIO_H
 
+#include "llframetimer.h"
+#include "llthread.h"
+#include "llsingleton.h"
+
 // comment out to turn off wind
 #define kAUDIO_ENABLE_WIND 
 //#define kAUDIO_ENABLE_WATER 1	// comment out to turn off water
@@ -38,4 +42,41 @@ void audio_update_volume(bool force_update = true);
 void audio_update_listener();
 void audio_update_wind(bool force_update = true);
 
+class LLViewerAudio : public LLSingleton<LLViewerAudio>
+{
+public:
+
+	enum EFadeState
+	{
+		FADE_IDLE,
+		FADE_IN,
+		FADE_OUT,
+	};
+
+	LLViewerAudio();
+	virtual ~LLViewerAudio();
+	
+	void startInternetStreamWithAutoFade(std::string streamURI);
+	void stopInternetStreamWithAutoFade();
+	
+	bool LLViewerAudio::onIdleUpdate();
+
+	EFadeState getFadeState() { return mFadeState; }
+	bool isDone() { return mDone; };
+	F32 getFadeVolume();
+
+private:
+
+	bool mDone;
+	F32 mFadeTime;
+	std::string mNextStreamURI;
+	EFadeState mFadeState;
+	LLFrameTimer stream_fade_timer;
+	bool mIdleListnerActive;
+
+	void registerIdleListener();
+	void deregisterIdleListener() { mIdleListnerActive = false; };
+	void startFading();
+};
+
 #endif //LL_VIEWER_H
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 41b4dc01e8d..148bfbf0801 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -66,7 +66,7 @@
 //#include "llfirstuse.h"
 #include "llviewernetwork.h"
 #include "llwindow.h"
-
+#include "llvieweraudio.h"
 
 #include "llfloatermediabrowser.h"	// for handling window close requests and geometry change requests in media browser windows.
 #include "llfloaterwebcontent.h"	// for handling window close requests and geometry change requests in media browser windows.
@@ -967,7 +967,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 		{
 			if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio())
 			{
-				gAudiop->stopInternetStream();
+				LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
 			}
 		}
 		pimpl->setPriority(new_priority);
@@ -1069,13 +1069,24 @@ void LLViewerMedia::setAllMediaEnabled(bool val)
 			gAudiop && 
 			LLViewerMedia::hasParcelAudio())
 		{
-			gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL());
+			if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying())
+			{
+				// 'false' means unpause
+				gAudiop->pauseInternetStream(false);
+			}
+			else
+			{
+				LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
+			}
 		}
 	}
 	else {
 		// This actually unloads the impl, as opposed to "stop"ping the media
 		LLViewerParcelMedia::stop();
-		if (gAudiop) gAudiop->stopInternetStream();
+		if (gAudiop)
+		{
+			LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
+		}
 	}
 }
 
@@ -1488,8 +1499,7 @@ void LLViewerMedia::setOpenIDCookie()
 			new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
 			headers);
 
-		// FUI: No longer perform the user_status query
-		//doOnetimeEarlyHTTPRequests();
+		doOnetimeEarlyHTTPRequests();
 	}
 }
 
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 8db72da1eec..928a84e7eb8 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -67,6 +67,7 @@
 #include "llworld.h"
 #include "roles_constants.h"
 #include "llweb.h"
+#include "llvieweraudio.h"
 
 const F32 PARCEL_COLLISION_DRAW_SECS = 1.f;
 
@@ -1725,7 +1726,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 	}
 	else
 	{
-		// look for music.
+		// Check for video
+		LLViewerParcelMedia::update( parcel );
+
+		// Then check for music.  Do this last, as there may be a delay waiting for
+		// the stream fading thread to finish.
 		if (gAudiop)
 		{
 			if (parcel)
@@ -1736,46 +1741,36 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 				std::string music_url = music_url_raw;
 				LLStringUtil::trim(music_url);
 
-				// On entering a new parcel, stop the last stream if the
-				// new parcel has a different music url.  (Empty URL counts
-				// as different.)
 				const std::string& stream_url = gAudiop->getInternetStreamURL();
 
-				if (music_url.empty() || music_url != stream_url)
+				// If there is a new music URL and it's valid, play it.
+				if (music_url.size() > 12)
 				{
-					// URL is different from one currently playing.
-					gAudiop->stopInternetStream();
-
-					// If there is a new music URL and it's valid, play it.
-					if (music_url.size() > 12)
+					if (music_url.substr(0,7) == "http://")
 					{
-						if (music_url.substr(0,7) == "http://")
-						{
-							optionally_start_music(music_url);
-						}
-						else
-						{
-							llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl;
-							// clears the URL 
-							gAudiop->startInternetStream(LLStringUtil::null); 
-						}
+						optionally_start_music(music_url);
 					}
-					else if (!gAudiop->getInternetStreamURL().empty())
+					else
 					{
-						llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl;
-						gAudiop->startInternetStream(LLStringUtil::null);
+						llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl;
+						// clears the URL 
+						// null value causes fade out
+						LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
 					}
 				}
+				else if (!gAudiop->getInternetStreamURL().empty())
+				{
+					llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl;
+					// null value causes fade out
+					LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
+				}
 			}
 			else
 			{
 				// Public land has no music
-				gAudiop->stopInternetStream();
+				LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
 			}
 		}//if gAudiop
-
-		// now check for video
-		LLViewerParcelMedia::update( parcel );
 	};
 }
 
@@ -1794,7 +1789,11 @@ void optionally_start_music(const std::string& music_url)
 			 gSavedSettings.getBOOL("MediaTentativeAutoPlay")))
 		{
 			llinfos << "Starting parcel music " << music_url << llendl;
-			gAudiop->startInternetStream(music_url);
+			LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(music_url);
+		}
+		else
+		{
+			LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
 		}
 	}
 }
-- 
GitLab


From 5663f41a7a3dafb4650b49ebc0c86140136239cd Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 28 Oct 2011 17:54:42 -0400
Subject: [PATCH 147/933] STORM-591 Fix minor merge error regression

---
 indra/newview/llviewermedia.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 148bfbf0801..a85f70b599c 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1499,7 +1499,8 @@ void LLViewerMedia::setOpenIDCookie()
 			new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
 			headers);
 
-		doOnetimeEarlyHTTPRequests();
+		// FUI: No longer perform the user_status query
+		//doOnetimeEarlyHTTPRequests();
 	}
 }
 
-- 
GitLab


From 526f71053a9fb18e95993343a0fd826023bda683 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sat, 29 Oct 2011 05:01:23 -0400
Subject: [PATCH 148/933] STORM-591 Comment out debugging llinfos lines

---
 indra/newview/llvieweraudio.cpp | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 8fd1ca38076..10ba54356c6 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -65,12 +65,12 @@ void LLViewerAudio::registerIdleListener()
 
 void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 {
-	llinfos << "DBG streamURI: " << streamURI << llendl;
+/*	llinfos << "DBG streamURI: " << streamURI << llendl;
 	llinfos << "DBG mNextStreamURI: " << mNextStreamURI << llendl;
 	if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
 	if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;}
 	if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;}
-
+*/
 	// Old and new stream are identical
 	if (mNextStreamURI == streamURI)
 	{
@@ -86,13 +86,13 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 		if (!gAudiop->getInternetStreamURL().empty())
 		{
 			mFadeState = FADE_OUT;
-llinfos << "DBG new mFadeState: OUT" << llendl;
+//llinfos << "DBG new mFadeState: OUT" << llendl;
 		}
 		// Otherwise the new stream can be faded in
 		else
 		{
 			mFadeState = FADE_IN;
-llinfos << "DBG new mFadeState: IN" << llendl;
+//llinfos << "DBG new mFadeState: IN" << llendl;
 
 			gAudiop->startInternetStream(mNextStreamURI);
 			startFading();
@@ -123,10 +123,10 @@ bool LLViewerAudio::onIdleUpdate()
 {
 	if (mDone)
 	{
-		if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
+/*		if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
 		if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;}
 		if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;}
-
+*/
 		//  This should be a rare or never occurring state.
 		if (mFadeState == FADE_IDLE)
 		{
@@ -144,7 +144,7 @@ bool LLViewerAudio::onIdleUpdate()
 			if (!mNextStreamURI.empty())
 			{
 				mFadeState = FADE_IN;
-llinfos << "DBG new mFadeState: IN" << llendl;
+//llinfos << "DBG new mFadeState: IN" << llendl;
 				gAudiop->startInternetStream(mNextStreamURI);
 				startFading();
 				return false;
@@ -152,7 +152,7 @@ llinfos << "DBG new mFadeState: IN" << llendl;
 			else
 			{
 				mFadeState = FADE_IDLE;
-llinfos << "DBG new mFadeState: IDLE" << llendl;
+//llinfos << "DBG new mFadeState: IDLE" << llendl;
 				deregisterIdleListener();
 				return true; // Stop calling onIdleUpdate
 			}
@@ -164,12 +164,12 @@ llinfos << "DBG new mFadeState: IDLE" << llendl;
 				mFadeState = FADE_OUT;
 				startFading();
 				return false;
-llinfos << "DBG new mFadeState: OUT" << llendl;
+//llinfos << "DBG new mFadeState: OUT" << llendl;
 			}
 			else
 			{
 				mFadeState = FADE_IDLE;
-llinfos << "DBG new mFadeState: IDLE" << llendl;
+//llinfos << "DBG new mFadeState: IDLE" << llendl;
 				deregisterIdleListener();
 				return true; // Stop calling onIdleUpdate
 			}
@@ -181,12 +181,12 @@ llinfos << "DBG new mFadeState: IDLE" << llendl;
 
 void LLViewerAudio::stopInternetStreamWithAutoFade()
 {
-llinfos << "DBG stopping stream" << llendl;
+//llinfos << "DBG stopping stream" << llendl;
 	mFadeState = FADE_IDLE;
-llinfos << "DBG new mFadeState: IDLE" << llendl;
+//llinfos << "DBG new mFadeState: IDLE" << llendl;
 	mNextStreamURI = LLStringUtil::null;
 	mDone = true;
-llinfos << "DBG mDone: true" << llendl;
+//llinfos << "DBG mDone: true" << llendl;
 
 	gAudiop->startInternetStream(LLStringUtil::null);
 	gAudiop->stopInternetStream();
@@ -194,7 +194,7 @@ llinfos << "DBG mDone: true" << llendl;
 
 void LLViewerAudio::startFading()
 {
-llinfos << "DBG startFading" << llendl;
+//llinfos << "DBG startFading" << llendl;
 
 	if(mDone)
 	{
@@ -208,7 +208,7 @@ llinfos << "DBG startFading" << llendl;
 		stream_fade_timer.reset();
 		stream_fade_timer.setTimerExpirySec(mFadeTime);
 		mDone = false;
-llinfos << "DBG mDone: false" << llendl;
+//llinfos << "DBG mDone: false" << llendl;
 	}
 }
 
@@ -349,7 +349,7 @@ void audio_update_volume(bool force_update)
 		F32 music_volume = gSavedSettings.getF32("AudioLevelMusic");
 		BOOL music_muted = gSavedSettings.getBOOL("MuteMusic");
 		F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume();
-llinfos << "DBG fade_volume:" << fade_volume << llendl;
+//llinfos << "DBG fade_volume:" << fade_volume << llendl;
 
 		music_volume = mute_volume * master_volume * music_volume * fade_volume;
 		gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume);
-- 
GitLab


From bc65e929fc32950a42d58931694961263db9c8ed Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 31 Oct 2011 11:29:32 -0500
Subject: [PATCH 149/933] SH-2240 Fix for heap corruption under debugger when
 starting viewer with basic shaders disabled.

---
 indra/llwindow/llwindowwin32.cpp | 39 +++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index bac23279cc1..e46fcea6923 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1381,29 +1381,42 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 
 	mhRC = 0;
 	if (wglCreateContextAttribsARB)
-	{ //attempt to create a non-compatibility profile context
+	{ //attempt to create a specific versioned context
 		S32 attribs[] = 
-		{
+		{ //start at 4.2
 			WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
-			WGL_CONTEXT_MINOR_VERSION_ARB, 0,
+			WGL_CONTEXT_MINOR_VERSION_ARB, 2,
 			WGL_CONTEXT_PROFILE_MASK_ARB,  LLRender::sGLCoreProfile ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
 			WGL_CONTEXT_FLAGS_ARB, gDebugGL ? WGL_CONTEXT_DEBUG_BIT_ARB : 0,
 			0
 		};
 
-		mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
-
-		if (!mhRC)
+		bool done = false;
+		while (!done)
 		{
-			attribs[1] = 3;
-			attribs[3] = 3;
-
 			mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
-		}
 
-		if (mhRC)
-		{ //success, disable fixed function calls
-			LLGLSLShader::sNoFixedFunction = true;
+			if (!mhRC)
+			{
+				if (attribs[3] > 0)
+				{ //decrement minor version
+					attribs[3]--;
+				}
+				else if (attribs[1] > 3)
+				{ //decrement major version and start minor version over at 3
+					attribs[1]--;
+					attribs[3] = 3;
+				}
+				else
+				{ //we reached 3.0 and still failed, bail out
+					done = true;
+				}
+			}
+			else
+			{
+				llinfos << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) << " context." << llendl;
+				done = true;
+			}
 		}
 	}
 
-- 
GitLab


From 5406ebad3e2073a860ced69094bbfb76880ce999 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 31 Oct 2011 17:20:44 -0500
Subject: [PATCH 150/933] SH-2521 Put back "high detail" terrain render when
 basic shaders disabled (still broken).

---
 indra/newview/lldrawpoolterrain.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index d61df9c0485..3e9d30283a6 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -198,7 +198,7 @@ void LLDrawPoolTerrain::render(S32 pass)
 		return;
 	}
 	// Render simplified land if video card can't do sufficient multitexturing
-	if (!LLGLSLShader::sNoFixedFunction || !gGLManager.mHasARBEnvCombine || (gGLManager.mNumTextureUnits < 2))
+	if (!gGLManager.mHasARBEnvCombine || (gGLManager.mNumTextureUnits < 2))
 	{
 		renderSimple(); // Render without multitexture
 		return;
@@ -223,11 +223,16 @@ void LLDrawPoolTerrain::render(S32 pass)
 	{
 		gPipeline.enableLightsStatic();
 
-		if (sDetailMode == 0){
+		if (sDetailMode == 0)
+		{
 			renderSimple();
-		} else if (gGLManager.mNumTextureUnits < 4){
+		} 
+		else if (gGLManager.mNumTextureUnits < 4)
+		{
 			renderFull2TU();
-		} else {
+		} 
+		else 
+		{
 			renderFull4TU();
 		}
 	}
-- 
GitLab


From b403a9da23a2df73a657bfa835a3706a261af2fb Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 31 Oct 2011 15:45:13 -0700
Subject: [PATCH 151/933] Enabling outbox

---
 indra/newview/llinventorybridge.cpp    | 2 +-
 indra/newview/llsidepanelinventory.cpp | 2 +-
 indra/newview/llviewermedia.cpp        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 0e27bd81beb..0e1e6265aa8 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -71,7 +71,7 @@
 #include "llwearablelist.h"
 
 // Marketplace outbox current disabled
-#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	0	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL
+#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
 typedef std::list<two_uuids_t> two_uuids_list_t;
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 91f80355562..03d9f9817d3 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -69,7 +69,7 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
 #define AUTO_EXPAND_INBOX	0
 
 // Temporarily disabling the outbox until we straighten out the API
-#define ENABLE_MERCHANT_OUTBOX_PANEL		0	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+#define ENABLE_MERCHANT_OUTBOX_PANEL		1	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
 
 static const char * const INBOX_BUTTON_NAME = "inbox_btn";
 static const char * const OUTBOX_BUTTON_NAME = "outbox_btn";
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 41b4dc01e8d..d81bed0f124 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1368,7 +1368,7 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom
 
 // This is defined in two files but I don't want to create a dependence between this and llsidepanelinventory
 // just to be able to temporarily disable the outbox.
-#define ENABLE_INVENTORY_DISPLAY_OUTBOX		0	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+#define ENABLE_INVENTORY_DISPLAY_OUTBOX		1	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
 
 class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
 {
-- 
GitLab


From 74fcb62b3dc0084c61cdf611b2b95ab3b03203bd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 1 Nov 2011 12:33:59 -0500
Subject: [PATCH 152/933] SH-2546 Fix for black avatars and terrain on GF Go
 7800 (use vec3 instead of float on varying parameters).

---
 .../shaders/class2/windlight/atmosphericsVarsF.glsl           | 2 +-
 .../shaders/class2/windlight/atmosphericsVarsV.glsl           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
index e8e56e12c1b..765b0927c3a 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
@@ -26,7 +26,7 @@
 
 VARYING vec3 vary_SunlitColor;
 VARYING vec3 vary_AdditiveColor;
-VARYING float vary_AtmosAttenuation;
+VARYING vec3 vary_AtmosAttenuation;
 
 vec3 getSunlitColor()
 {
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index ba2ed6b1cec..99dbee15eed 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -25,7 +25,7 @@
  
 
 VARYING vec3 vary_AdditiveColor;
-VARYING float vary_AtmosAttenuation;
+VARYING vec3 vary_AtmosAttenuation;
 
 vec3 additive_color;
 vec3 atmos_attenuation;
@@ -80,5 +80,5 @@ void setAdditiveColor(vec3 v)
 void setAtmosAttenuation(vec3 v)
 {
 	atmos_attenuation = v;
-	vary_AtmosAttenuation = v.r;
+	vary_AtmosAttenuation = v;
 }
-- 
GitLab


From 108cdf58c2def80cf6c88e35c85b6da1c3709b76 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 1 Nov 2011 12:47:06 -0500
Subject: [PATCH 153/933] SH-2620 Force FXAA shader to off on OSX

---
 indra/newview/pipeline.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 76ad7fd83e6..85a7691eadf 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6405,6 +6405,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 		bool multisample = RenderFSAASamples > 1;
 
+#if LL_DARWIN //force FXAA to off on OSX (SH-2620)
+		multisample = false;
+#endif
+
 		if (multisample)
 		{
 			//bake out texture2D with RGBL for FXAA shader
-- 
GitLab


From b58229a64e2a5c8178f3ac05f944b6cfecc5466b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 1 Nov 2011 14:33:20 -0500
Subject: [PATCH 154/933] SH-1427 Fix for sunlight color getting clobbered for
 non-deferred atmospheric shaders.

---
 indra/llrender/llshadermgr.cpp                                | 2 +-
 .../shaders/class1/windlight/atmosphericsHelpersV.glsl        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 326c938e8e2..810afe210d9 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -974,7 +974,7 @@ void LLShaderMgr::initAttribsAndUniforms()
 	mReservedUniforms.push_back("cloude_noise_texture");
 	mReservedUniforms.push_back("fullbright");
 	mReservedUniforms.push_back("lightnorm");
-	mReservedUniforms.push_back("sunlight_color");
+	mReservedUniforms.push_back("sunlight_color_copy");
 	mReservedUniforms.push_back("ambient");
 	mReservedUniforms.push_back("blue_horizon");
 	mReservedUniforms.push_back("blue_density");
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index 89b6a52909a..4fe0ef9caf8 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -23,7 +23,7 @@
  * $/LicenseInfo$
  */
  
-uniform vec4 sunlight_color;
+uniform vec4 sunlight_color_copy;
 uniform vec4 light_ambient;
 
 vec3 atmosAmbient(vec3 light)
@@ -33,7 +33,7 @@ vec3 atmosAmbient(vec3 light)
 
 vec3 atmosAffectDirectionalLight(float lightIntensity)
 {
-	return sunlight_color.rgb * lightIntensity;
+	return sunlight_color_copy.rgb * lightIntensity;
 }
 
 vec3 atmosGetDiffuseSunlightColor()
-- 
GitLab


From 1bea08335b6c2fa31f414db2fe7316a118b2ec18 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 2 Nov 2011 10:55:12 -0500
Subject: [PATCH 155/933] SH-2648 Fix for flickering shadows on 40% transparent
 objects.

---
 indra/newview/pipeline.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 85a7691eadf..fe29333ab2e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8149,10 +8149,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 	{
 		LLFastTimer ftm(FTM_SHADOW_ALPHA);
 		gDeferredShadowAlphaMaskProgram.bind();
-		gDeferredShadowAlphaMaskProgram.setAlphaRange(0.6f, 1.f);
+		gDeferredShadowAlphaMaskProgram.setAlphaRange(0.598f, 1.f);
 		renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE);
 		gDeferredTreeShadowProgram.bind();
-		gDeferredTreeShadowProgram.setAlphaRange(0.6f, 1.f);
+		gDeferredTreeShadowProgram.setAlphaRange(0.598f, 1.f);
 		renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE);
 	}
 
-- 
GitLab


From 2179e1c1f2f3614678d528fe96640728ce663f2e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 2 Nov 2011 13:13:38 -0500
Subject: [PATCH 156/933] SH-2541 Fix for speckles on avatar on some cards --
 don't use "maximum_alpha" for alpha tests in shaders as it was always being
 set to 1.0 anyway.

---
 indra/llrender/llglslshader.cpp               |  5 ++-
 indra/llrender/llglslshader.h                 |  2 +-
 indra/llrender/llshadermgr.cpp                |  3 ++
 indra/llrender/llshadermgr.h                  |  2 ++
 .../class1/deferred/diffuseAlphaMaskF.glsl    |  3 +-
 .../deferred/diffuseAlphaMaskIndexedF.glsl    |  3 +-
 .../deferred/diffuseAlphaMaskNoColorF.glsl    |  3 +-
 .../shaders/class1/deferred/impostorF.glsl    |  3 +-
 .../class1/deferred/shadowAlphaMaskF.glsl     |  3 +-
 .../shaders/class1/deferred/treeF.glsl        |  3 +-
 .../shaders/class1/deferred/treeShadowF.glsl  |  3 +-
 .../shaders/class1/interface/alphamaskF.glsl  |  3 +-
 .../class1/lighting/lightAlphaMaskF.glsl      |  3 +-
 .../lighting/lightAlphaMaskNonIndexedF.glsl   |  4 +--
 .../lighting/lightFullbrightAlphaMaskF.glsl   |  3 +-
 .../lightFullbrightNonIndexedAlphaMaskF.glsl  |  3 +-
 .../lightFullbrightWaterAlphaMaskF.glsl       |  3 +-
 ...htFullbrightWaterNonIndexedAlphaMaskF.glsl |  3 +-
 .../class1/lighting/lightWaterAlphaMaskF.glsl |  3 +-
 .../lightWaterAlphaMaskNonIndexedF.glsl       |  3 +-
 .../shaders/class1/objects/impostorF.glsl     |  3 +-
 indra/newview/lldrawpoolalpha.cpp             | 16 ++++-----
 indra/newview/lldrawpoolavatar.cpp            | 12 +++----
 indra/newview/lldrawpoolsimple.cpp            |  4 +--
 indra/newview/lldrawpooltree.cpp              |  6 ++--
 indra/newview/lltexlayer.cpp                  | 34 +++++++++----------
 indra/newview/pipeline.cpp                    |  4 +--
 27 files changed, 63 insertions(+), 77 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index d6ab5208c6f..5a6f3d8292c 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -1009,9 +1009,8 @@ void LLGLSLShader::vertexAttrib4fv(U32 index, GLfloat* v)
 	}
 }
 
-void LLGLSLShader::setAlphaRange(F32 minimum, F32 maximum)
+void LLGLSLShader::setMinimumAlpha(F32 minimum)
 {
 	gGL.flush();
-	uniform1f("minimum_alpha", minimum);
-	uniform1f("maximum_alpha", maximum);
+	uniform1f(LLShaderMgr::MINIMUM_ALPHA, minimum);
 }
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index eb19599ecaa..2a6c050eac9 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -108,7 +108,7 @@ class LLGLSLShader
 	void uniformMatrix3fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v);
 	void uniformMatrix4fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v);
 
-	void setAlphaRange(F32 minimum, F32 maximum);
+	void setMinimumAlpha(F32 minimum);
 
 	void vertexAttrib4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
 	void vertexAttrib4fv(U32 index, GLfloat* v);
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 810afe210d9..84dc768983d 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1009,6 +1009,9 @@ void LLShaderMgr::initAttribsAndUniforms()
 
 	llassert(mReservedUniforms.size() == LLShaderMgr::GLOW_DELTA+1);
 
+
+	mReservedUniforms.push_back("minimum_alpha");
+
 	mReservedUniforms.push_back("shadow_matrix");
 	mReservedUniforms.push_back("env_mat");
 	mReservedUniforms.push_back("shadow_clip");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 9cc2f1bd7f9..a5150b3e51c 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -107,6 +107,8 @@ class LLShaderMgr
 		GLOW_STRENGTH,
 		GLOW_DELTA,
 
+		MINIMUM_ALPHA,
+
 		DEFERRED_SHADOW_MATRIX,
 		DEFERRED_ENV_MAT,
 		DEFERRED_SHADOW_CLIP,
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index 14b79c37fd2..e9989a4e489 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragData[3];
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -40,7 +39,7 @@ void main()
 {
 	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
 	
-	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	if (col.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index 381fba8813e..fdf8d72b38f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -30,7 +30,6 @@ out vec4 gl_FragData[3];
 VARYING vec3 vary_normal;
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
@@ -39,7 +38,7 @@ void main()
 {
 	vec4 col = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
-	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	if (col.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index b582ba7f9c5..bb20e2ca476 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -29,7 +29,6 @@ out vec4 gl_FragData[3];
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -40,7 +39,7 @@ void main()
 {
 	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
 	
-	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	if (col.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index 5decddebbbd..a44173a2a4d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragData[3];
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 
 uniform sampler2D diffuseMap;
@@ -41,7 +40,7 @@ void main()
 {
 	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
 
-	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	if (col.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index 71b12326d8b..46d42d2a4ad 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -40,7 +39,7 @@ void main()
 {
 	float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a;
 
-	if (alpha < minimum_alpha || alpha > maximum_alpha)
+	if (alpha < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index b934bc69919..ea98d6884ca 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -34,12 +34,11 @@ VARYING vec3 vary_normal;
 VARYING vec2 vary_texcoord0;
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 void main() 
 {
 	vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
-	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	if (col.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 29ec6e6beef..20d01705358 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -39,7 +38,7 @@ void main()
 {
 	float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a;
 
-	if (alpha < minimum_alpha || alpha > maximum_alpha)
+	if (alpha < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
index 4f2767fc970..d2f5e1987aa 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -30,7 +30,6 @@ out vec4 gl_FragColor;
 uniform sampler2D diffuseMap;
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 VARYING vec2 vary_texcoord0;
 VARYING vec4 vertex_color;
@@ -38,7 +37,7 @@ VARYING vec4 vertex_color;
 void main() 
 {
 	vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
-	if (col.a < minimum_alpha || col.a > maximum_alpha)
+	if (col.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
index 6815f7aa85a..10413bdeb09 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
@@ -40,7 +39,7 @@ void default_lighting()
 {
 	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
index 2640668d7dc..1164e5b0a69 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -28,8 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
-
 
 uniform sampler2D diffuseMap;
 
@@ -43,7 +41,7 @@ void default_lighting()
 {
 	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
index 92113d9afa6..ba99c0ed71e 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
@@ -40,7 +39,7 @@ void fullbright_lighting()
 {
 	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
index d1ad3da0096..276fad4f448 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
@@ -42,7 +41,7 @@ void fullbright_lighting()
 {
 	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
index 32a1c71099b..754b2922d97 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 vec4 diffuseLookup(vec2 texcoord);
 
@@ -42,7 +41,7 @@ void fullbright_lighting_water()
 {
 	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
index 1b5aa614413..f69b907dc75 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -42,7 +41,7 @@ void fullbright_lighting_water()
 {
 	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
 
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
index 60289cf7f77..103dd633c92 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 vec3 atmosLighting(vec3 light);
 vec4 applyWaterFog(vec4 color);
@@ -40,7 +39,7 @@ void default_lighting_water()
 {
 	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
 
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
index d0038ae89bc..bef72752daf 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -42,7 +41,7 @@ void default_lighting_water()
 {
 	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
 
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index e7c81888eb7..3c6e22b2959 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -28,7 +28,6 @@ out vec4 gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
-uniform float maximum_alpha;
 
 uniform sampler2D diffuseMap;
 
@@ -38,7 +37,7 @@ void main()
 {
 	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
 	
-	if (color.a < minimum_alpha || color.a > maximum_alpha)
+	if (color.a < minimum_alpha)
 	{
 		discard;
 	}
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 230c4e2638d..54f937d8fd4 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -90,7 +90,7 @@ void LLDrawPoolAlpha::renderDeferred(S32 pass)
 {
 	LLFastTimer t(FTM_RENDER_GRASS);
 	gDeferredDiffuseAlphaMaskProgram.bind();
-	gDeferredDiffuseAlphaMaskProgram.setAlphaRange(0.33f, 1.f);
+	gDeferredDiffuseAlphaMaskProgram.setMinimumAlpha(0.33f);
 
 	//render alpha masked objects
 	LLRenderPass::pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
@@ -136,7 +136,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass)
 		simple_shader = NULL;
 		fullbright_shader = NULL;
 		gObjectFullbrightAlphaMaskProgram.bind();
-		gObjectFullbrightAlphaMaskProgram.setAlphaRange(0.33f, 1.f);
+		gObjectFullbrightAlphaMaskProgram.setMinimumAlpha(0.33f);
 	}
 
 	deferred_render = TRUE;
@@ -232,14 +232,14 @@ void LLDrawPoolAlpha::render(S32 pass)
 			if (!LLPipeline::sRenderDeferred || !deferred_render)
 			{
 				simple_shader->bind();
-				simple_shader->setAlphaRange(0.33f, 1.f);
+				simple_shader->setMinimumAlpha(0.33f);
 
 				pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
 			}
 			if (fullbright_shader)
 			{
 				fullbright_shader->bind();
-				fullbright_shader->setAlphaRange(0.33f, 1.f);
+				fullbright_shader->setMinimumAlpha(0.33f);
 			}
 			pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
 			//LLGLSLShader::bindNoShader();
@@ -275,16 +275,16 @@ void LLDrawPoolAlpha::render(S32 pass)
 			if (LLPipeline::sImpostorRender)
 			{
 				fullbright_shader->bind();
-				fullbright_shader->setAlphaRange(0.5f, 1.f);
+				fullbright_shader->setMinimumAlpha(0.5f);
 				simple_shader->bind();
-				simple_shader->setAlphaRange(0.5f, 1.f);
+				simple_shader->setMinimumAlpha(0.5f);
 			}				
 			else
 			{
 				fullbright_shader->bind();
-				fullbright_shader->setAlphaRange(0.f, 1.f);
+				fullbright_shader->setMinimumAlpha(0.f);
 				simple_shader->bind();
-				simple_shader->setAlphaRange(0.f, 1.f);
+				simple_shader->setMinimumAlpha(0.f);
 			}
 		}
 		else
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 7290a48a1a5..60313b25a0f 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -576,7 +576,7 @@ void LLDrawPoolAvatar::beginImpostor()
 	if (LLGLSLShader::sNoFixedFunction)
 	{
 		gImpostorProgram.bind();
-		gImpostorProgram.setAlphaRange(0.01f, 1.f);
+		gImpostorProgram.setMinimumAlpha(0.01f);
 	}
 
 	gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
@@ -608,7 +608,7 @@ void LLDrawPoolAvatar::beginRigid()
 		if (sVertexProgram != NULL)
 		{	//eyeballs render with the specular shader
 			sVertexProgram->bind();
-			sVertexProgram->setAlphaRange(0.2f, 1.f);
+			sVertexProgram->setMinimumAlpha(0.2f);
 		}
 	}
 	else
@@ -641,7 +641,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor()
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 
 	sVertexProgram->bind();
-	sVertexProgram->setAlphaRange(0.01f, 1.f);
+	sVertexProgram->setMinimumAlpha(0.01f);
 }
 
 void LLDrawPoolAvatar::endDeferredImpostor()
@@ -659,7 +659,7 @@ void LLDrawPoolAvatar::beginDeferredRigid()
 	sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
 				
 	sVertexProgram->bind();
-	sVertexProgram->setAlphaRange(0.2f, 1.f);
+	sVertexProgram->setMinimumAlpha(0.2f);
 }
 
 void LLDrawPoolAvatar::endDeferredRigid()
@@ -716,7 +716,7 @@ void LLDrawPoolAvatar::beginSkinned()
 
 	if (LLGLSLShader::sNoFixedFunction)
 	{
-		sVertexProgram->setAlphaRange(0.2f, 1.f);
+		sVertexProgram->setMinimumAlpha(0.2f);
 	}
 }
 
@@ -1014,7 +1014,7 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
 	sRenderingSkinned = TRUE;
 
 	sVertexProgram->bind();
-	sVertexProgram->setAlphaRange(0.2f, 1.f);
+	sVertexProgram->setMinimumAlpha(0.2f);
 	
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 	gGL.getTexUnit(0)->activate();
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 80c202d4e2f..6e0ea78af2b 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -269,7 +269,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass)
 	if (mVertexShaderLevel > 0)
 	{
 		simple_shader->bind();
-		simple_shader->setAlphaRange(0.5f, 1.f);
+		simple_shader->setMinimumAlpha(0.5f);
 	}
 	else 
 	{
@@ -325,7 +325,7 @@ void LLDrawPoolGrass::renderDeferred(S32 pass)
 	{
 		LLFastTimer t(FTM_RENDER_GRASS_DEFERRED);
 		gDeferredNonIndexedDiffuseAlphaMaskProgram.bind();
-		gDeferredNonIndexedDiffuseAlphaMaskProgram.setAlphaRange(0.5f, 1.f);
+		gDeferredNonIndexedDiffuseAlphaMaskProgram.setMinimumAlpha(0.5f);
 		//render grass
 		LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask());
 	}			
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index cdf6e1ab523..d198e28c140 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -75,7 +75,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
 	if (gPipeline.canUseVertexShaders())
 	{
 		shader->bind();
-		shader->setAlphaRange(0.5f, 1.f);
+		shader->setMinimumAlpha(0.5f);
 		gGL.diffuseColor4f(1,1,1,1);
 	}
 	else
@@ -144,7 +144,7 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass)
 		
 	shader = &gDeferredTreeProgram;
 	shader->bind();
-	shader->setAlphaRange(0.5f, 1.f);
+	shader->setMinimumAlpha(0.5f);
 }
 
 void LLDrawPoolTree::renderDeferred(S32 pass)
@@ -170,7 +170,7 @@ void LLDrawPoolTree::beginShadowPass(S32 pass)
 					gSavedSettings.getF32("RenderDeferredTreeShadowBias"));
 
 	gDeferredTreeShadowProgram.bind();
-	gDeferredTreeShadowProgram.setAlphaRange(0.5f, 1.f);
+	gDeferredTreeShadowProgram.setMinimumAlpha(0.5f);
 }
 
 void LLDrawPoolTree::renderShadow(S32 pass)
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 9f5cbf6ec88..6f6d5dbf122 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -300,7 +300,7 @@ BOOL LLTexLayerSetBuffer::render()
 	if (use_shaders)
 	{
 		gAlphaMaskProgram.bind();
-		gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+		gAlphaMaskProgram.setMinimumAlpha(0.004f);
 	}
 
 	LLVertexBuffer::unbind();
@@ -947,7 +947,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.0f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.0f);
 		}
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4f( 0.f, 0.f, 0.f, 1.f );
@@ -957,7 +957,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 		gGL.flush();
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.004f);
 		}
 	}
 
@@ -987,7 +987,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.f);
 		}
 
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -999,7 +999,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
 		gGL.flush();
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.004f);
 		}
 	}
 
@@ -1135,7 +1135,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.f);
 		}
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4f( 0.f, 0.f, 0.f, 1.f );
@@ -1145,7 +1145,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
 		gGL.flush();
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.004f);
 		}
 	}
 	
@@ -1717,7 +1717,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 					LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0);
 					if (use_shaders && no_alpha_test)
 					{
-						gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+						gAlphaMaskProgram.setMinimumAlpha(0.f);
 					}
 					
 					LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
@@ -1731,7 +1731,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 					gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 					if (use_shaders && no_alpha_test)
 					{
-						gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+						gAlphaMaskProgram.setMinimumAlpha(0.004f);
 					}
 					
 				}
@@ -1768,14 +1768,14 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
 		LLGLDisable no_alpha(GL_ALPHA_TEST);
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.f);
 		}
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4fv( net_color.mV );
 		gl_rect_2d_simple( width, height );
 		if (use_shaders)
 		{
-			gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+			gAlphaMaskProgram.setMinimumAlpha(0.004f);
 		}
 	}
 
@@ -1874,14 +1874,14 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
 			LLGLSNoAlphaTest gls_no_alpha_test;
 			if (use_shaders)
 			{
-				gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+				gAlphaMaskProgram.setMinimumAlpha(0.f);
 			}
 			gGL.getTexUnit(0)->bind(tex, TRUE);
 			gl_rect_2d_simple_tex( width, height );
 			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 			if (use_shaders)
 			{
-				gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+				gAlphaMaskProgram.setMinimumAlpha(0.004f);
 			}
 		}
 		else
@@ -1899,7 +1899,7 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
 				LLGLSNoAlphaTest gls_no_alpha_test;
 				if (use_shaders)
 				{
-					gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+					gAlphaMaskProgram.setMinimumAlpha(0.f);
 				}
 				gGL.getTexUnit(0)->bind(tex);
 				gl_rect_2d_simple_tex( width, height );
@@ -1907,7 +1907,7 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
 				success = TRUE;
 				if (use_shaders)
 				{
-					gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+					gAlphaMaskProgram.setMinimumAlpha(0.004f);
 				}
 			}
 		}
@@ -1931,7 +1931,7 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 
 	if (use_shaders)
 	{
-		gAlphaMaskProgram.setAlphaRange(0.f, 1.f);
+		gAlphaMaskProgram.setMinimumAlpha(0.f);
 	}
 
 	gGL.setColorMask(false, true);
@@ -2011,7 +2011,7 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 
 	if (use_shaders)
 	{
-		gAlphaMaskProgram.setAlphaRange(0.004f, 1.f);
+		gAlphaMaskProgram.setMinimumAlpha(0.004f);
 	}
 
 	LLGLSUIDefault gls_ui;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 76ddeab2034..152f4728dd3 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8154,10 +8154,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 	{
 		LLFastTimer ftm(FTM_SHADOW_ALPHA);
 		gDeferredShadowAlphaMaskProgram.bind();
-		gDeferredShadowAlphaMaskProgram.setAlphaRange(0.598f, 1.f);
+		gDeferredShadowAlphaMaskProgram.setMinimumAlpha(0.598f);
 		renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE);
 		gDeferredTreeShadowProgram.bind();
-		gDeferredTreeShadowProgram.setAlphaRange(0.598f, 1.f);
+		gDeferredTreeShadowProgram.setMinimumAlpha(0.598f);
 		renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE);
 	}
 
-- 
GitLab


From db8267f95109cccb94cde8b9673df995dddc7a3e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 2 Nov 2011 14:47:01 -0500
Subject: [PATCH 157/933] SH-1427 Fix for shader compilation failure when
 detail set to "mid"

---
 .../shaders/class1/windlight/atmosphericsHelpersV.glsl          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index 4fe0ef9caf8..6ff860362c2 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -38,7 +38,7 @@ vec3 atmosAffectDirectionalLight(float lightIntensity)
 
 vec3 atmosGetDiffuseSunlightColor()
 {
-	return sunlight_color.rgb;
+	return sunlight_color_copy.rgb;
 }
 
 vec3 scaleDownLight(vec3 light)
-- 
GitLab


From 089a9ced0dac0acccb4673432863621a4bd19338 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 3 Nov 2011 08:25:34 -0400
Subject: [PATCH 158/933] STORM-1679 Avatar Draw Weight number is always red

---
 doc/contributions.txt        | 1 +
 indra/newview/llvoavatar.cpp | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index d719f64bafc..c6739dd2a1c 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -582,6 +582,7 @@ Jonathan Yap
 	STORM-1639
 	STORM-910
 	STORM-1642
+	STORM-1679
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index bdab250b49c..163ac2dc700 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -8335,7 +8335,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d
 void LLVOAvatar::idleUpdateRenderCost()
 {
 	static const U32 ARC_BODY_PART_COST = 200;
-	static const U32 ARC_LIMIT = 2048;
+	static const U32 ARC_LIMIT = 40000;
 
 	static std::set<LLUUID> all_textures;
 
-- 
GitLab


From fa5a0a90f451c0be63bda4a6a61350c2edc639d8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 3 Nov 2011 15:00:40 -0500
Subject: [PATCH 159/933] SH-2240 Fix for core profile assertions when Debug GL
 enabled.

---
 indra/llrender/llimagegl.cpp     | 6 +++---
 indra/llwindow/llwindowwin32.cpp | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 3d3c94ef3e8..7d738881518 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1116,7 +1116,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
 	U32* scratch = NULL;
 	if (LLRender::sGLCoreProfile)
 	{
-		if (intformat == GL_ALPHA8 && pixformat == GL_ALPHA && pixtype == GL_UNSIGNED_BYTE) 
+		if (pixformat == GL_ALPHA && pixtype == GL_UNSIGNED_BYTE) 
 		{ //GL_ALPHA is deprecated, convert to RGBA
 			use_scratch = true;
 			scratch = new U32[width*height];
@@ -1133,7 +1133,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
 			intformat = GL_RGBA8;
 		}
 
-		if (intformat == GL_LUMINANCE8_ALPHA8 && pixformat == GL_LUMINANCE_ALPHA && pixtype == GL_UNSIGNED_BYTE) 
+		if (pixformat == GL_LUMINANCE_ALPHA && pixtype == GL_UNSIGNED_BYTE) 
 		{ //GL_LUMINANCE_ALPHA is deprecated, convert to RGBA
 			use_scratch = true;
 			scratch = new U32[width*height];
@@ -1153,7 +1153,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
 			intformat = GL_RGBA8;
 		}
 
-		if (intformat == GL_LUMINANCE8 && pixformat == GL_LUMINANCE && pixtype == GL_UNSIGNED_BYTE) 
+		if (pixformat == GL_LUMINANCE && pixtype == GL_UNSIGNED_BYTE) 
 		{ //GL_LUMINANCE_ALPHA is deprecated, convert to RGB
 			use_scratch = true;
 			scratch = new U32[width*height];
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index e46fcea6923..f7cbc383ebc 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1416,6 +1416,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 			{
 				llinfos << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) << " context." << llendl;
 				done = true;
+
+				if (LLRender::sGLCoreProfile)
+				{
+					LLGLSLShader::sNoFixedFunction = true;
+				}
 			}
 		}
 	}
-- 
GitLab


From e82c0561fa5fa157efec445362b09360346ed382 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 4 Nov 2011 16:14:43 -0500
Subject: [PATCH 160/933] SH-2652 Faster depth of field

---
 indra/llrender/llvertexbuffer.cpp             |  22 +++-
 indra/newview/app_settings/settings.xml       |   2 +-
 .../shaders/class1/deferred/cofF.glsl         |  86 ++++++++++++++
 .../class1/deferred/postDeferredF.glsl        |  76 ++-----------
 indra/newview/llviewershadermgr.cpp           |  12 ++
 indra/newview/llviewershadermgr.h             |   1 +
 indra/newview/pipeline.cpp                    | 107 ++++++++++++++----
 7 files changed, 211 insertions(+), 95 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/cofF.glsl

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 7f739770103..b426421f88e 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -938,7 +938,7 @@ void LLVertexBuffer::releaseIndices()
 	{
 		sStreamIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize);
 	}
-	else if (mUsage == GL_DYNAMIC_DRAW_ARB)
+	else
 	{
 		sDynamicIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize);
 	}
@@ -1122,6 +1122,8 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_SETUP_VERTEX_ARRAY("Setup VAO");
+
 void LLVertexBuffer::setupVertexArray()
 {
 	if (!mGLArray)
@@ -1129,6 +1131,7 @@ void LLVertexBuffer::setupVertexArray()
 		return;
 	}
 
+	LLFastTimer t(FTM_SETUP_VERTEX_ARRAY);
 #if GL_ARB_vertex_array_object
 	glBindVertexArray(mGLArray);
 #endif
@@ -1201,6 +1204,9 @@ void LLVertexBuffer::setupVertexArray()
 		}
 	}
 
+	//draw a dummy triangle to set index array pointer
+	//glDrawElements(GL_TRIANGLES, 0, GL_UNSIGNED_SHORT, NULL);
+
 	unbind();
 }
 
@@ -1843,14 +1849,18 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 in
 
 //----------------------------------------------------------------------------
 
+static LLFastTimer::DeclareTimer FTM_BIND_GL_ARRAY("Bind Array");
 bool LLVertexBuffer::bindGLArray()
 {
 	if (mGLArray && sGLRenderArray != mGLArray)
 	{
+		{
+			LLFastTimer t(FTM_BIND_GL_ARRAY);
 #if GL_ARB_vertex_array_object
-		glBindVertexArray(mGLArray);
+			glBindVertexArray(mGLArray);
 #endif
-		sGLRenderArray = mGLArray;
+			sGLRenderArray = mGLArray;
+		}
 
 		//really shouldn't be necessary, but some drivers don't properly restore the
 		//state of GL_ELEMENT_ARRAY_BUFFER_BINDING
@@ -1862,6 +1872,8 @@ bool LLVertexBuffer::bindGLArray()
 	return false;
 }
 
+static LLFastTimer::DeclareTimer FTM_BIND_GL_BUFFER("Bind Buffer");
+
 bool LLVertexBuffer::bindGLBuffer(bool force_bind)
 {
 	bindGLArray();
@@ -1870,6 +1882,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
 
 	if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))))
 	{
+		LLFastTimer t(FTM_BIND_GL_BUFFER);
 		/*if (sMapped)
 		{
 			llerrs << "VBO bound while another VBO mapped!" << llendl;
@@ -1891,6 +1904,8 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
 	return ret;
 }
 
+static LLFastTimer::DeclareTimer FTM_BIND_GL_INDICES("Bind Indices");
+
 bool LLVertexBuffer::bindGLIndices(bool force_bind)
 {
 	bindGLArray();
@@ -1898,6 +1913,7 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind)
 	bool ret = false;
 	if (useVBOs() && (force_bind || (mGLIndices && (mGLIndices != sGLRenderIndices || !sIBOActive))))
 	{
+		LLFastTimer t(FTM_BIND_GL_INDICES);
 		/*if (sMapped)
 		{
 			llerrs << "VBO bound while another VBO mapped!" << llendl;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 53ba005b8ae..fb73ddf2193 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9054,7 +9054,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
     <key>RenderVBOMappingDisable</key>
     <map>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
new file mode 100644
index 00000000000..81f00f7d0f1
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -0,0 +1,86 @@
+/** 
+ * @file cofF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#extension GL_ARB_texture_rectangle : enable
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform sampler2DRect diffuseRect;
+uniform sampler2DRect depthMap;
+uniform sampler2D bloomMap;
+
+uniform float depth_cutoff;
+uniform float norm_cutoff;
+uniform float focal_distance;
+uniform float blur_constant;
+uniform float tan_pixel_angle;
+uniform float magnification;
+
+uniform mat4 inv_proj;
+uniform vec2 screen_res;
+
+VARYING vec2 vary_fragcoord;
+
+float getDepth(vec2 pos_screen)
+{
+	float z = texture2DRect(depthMap, pos_screen.xy).r;
+	z = z*2.0-1.0;
+	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
+	vec4 p = inv_proj*ndc;
+	return p.z/p.w;
+}
+
+float calc_cof(float depth)
+{
+	float sc = abs(depth-focal_distance)/-depth*blur_constant;
+		
+	sc /= magnification;
+	
+	// tan_pixel_angle = pixel_length/-depth;
+	float pixel_length =  tan_pixel_angle*-focal_distance;
+	
+	sc = sc/pixel_length;
+	sc *= 1.414;
+	
+	return sc;
+}
+
+void main() 
+{
+	vec2 tc = vary_fragcoord.xy;
+	
+	float depth = getDepth(tc);
+	
+	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
+	
+	float sc = calc_cof(depth);
+	sc = min(abs(sc), 10.0);
+	
+	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
+	gl_FragColor.rgb = diff.rgb + bloom.rgb;
+	gl_FragColor.a = sc/10.f;
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 985f44fb6c9..f684e25df8f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -30,13 +30,7 @@ out vec4 gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
-uniform sampler2DRect edgeMap;
-uniform sampler2DRect depthMap;
-uniform sampler2DRect normalMap;
-uniform sampler2D bloomMap;
 
-uniform float depth_cutoff;
-uniform float norm_cutoff;
 uniform float focal_distance;
 uniform float blur_constant;
 uniform float tan_pixel_angle;
@@ -47,59 +41,16 @@ uniform vec2 screen_res;
 
 VARYING vec2 vary_fragcoord;
 
-float getDepth(vec2 pos_screen)
+void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc)
 {
-	float z = texture2DRect(depthMap, pos_screen.xy).r;
-	z = z*2.0-1.0;
-	vec4 ndc = vec4(0.0, 0.0, z, 1.0);
-	vec4 p = inv_proj*ndc;
-	return p.z/p.w;
-}
-
-float calc_cof(float depth)
-{
-	float sc = abs(depth-focal_distance)/-depth*blur_constant;
-		
-	sc /= magnification;
-	
-	// tan_pixel_angle = pixel_length/-depth;
-	float pixel_length =  tan_pixel_angle*-focal_distance;
-	
-	sc = sc/pixel_length;
-	sc *= 1.414;
-	
-	return sc;
-}
-
-void dofSampleNear(inout vec4 diff, inout float w, float cur_sc, vec2 tc)
-{
-	float d = getDepth(tc);
-	
-	float sc = calc_cof(d);
-	
-	float wg = 0.25;
-		
 	vec4 s = texture2DRect(diffuseRect, tc);
-	// de-weight dull areas to make highlights 'pop'
-	wg += s.r+s.g+s.b;
-	
-	diff += wg*s;
-	
-	w += wg;
-}
 
-void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, vec2 tc)
-{
-	float d = getDepth(tc);
-	
-	float sc = calc_cof(d);
-	
-	if (sc > min_sc //sampled pixel is more "out of focus" than current sample radius
-	   || d < cur_depth) //sampled pixel is further away than current pixel
+	float sc = s.a*10.0;
+
+	if (sc > min_sc) //sampled pixel is more "out of focus" than current sample radius
 	{
 		float wg = 0.25;
 		
-		vec4 s = texture2DRect(diffuseRect, tc);
 		// de-weight dull areas to make highlights 'pop'
 		wg += s.r+s.g+s.b;
 	
@@ -109,30 +60,20 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ve
 	}
 }
 
-
 void main() 
 {
-	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
-	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-		
 	vec2 tc = vary_fragcoord.xy;
 	
-	float depth = getDepth(tc);
-	
 	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
 	{ 
 		float w = 1.0;
 		
-		float sc = calc_cof(depth);
-		sc = min(abs(sc), 10.0);
-		
-		float fd = depth*0.5f;
-		
+		float sc = diff.a*10.0;
+				
 		float PI = 3.14159265358979323846264;
 
 		// sample quite uniformly spaced points within a circle, for a circular 'bokeh'		
-		//if (depth < focal_distance)
 		{
 			while (sc > 0.5)
 			{
@@ -143,7 +84,7 @@ void main()
 					float samp_x = sc*sin(ang);
 					float samp_y = sc*cos(ang);
 					// you could test sample coords against an interesting non-circular aperture shape here, if desired.
-					dofSample(diff, w, sc, depth, vary_fragcoord.xy + vec2(samp_x,samp_y));
+					dofSample(diff, w, sc, vary_fragcoord.xy + vec2(samp_x,samp_y));
 				}
 				sc -= 1.0;
 			}
@@ -152,6 +93,5 @@ void main()
 		diff /= w;
 	}
 		
-	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor = diff + bloom;
+	gl_FragColor = diff;
 }
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 108f008f58c..8118d32dc41 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -186,6 +186,7 @@ LLGLSLShader			gDeferredAvatarEyesProgram;
 LLGLSLShader			gDeferredFullbrightProgram;
 LLGLSLShader			gDeferredEmissiveProgram;
 LLGLSLShader			gDeferredPostProgram;
+LLGLSLShader			gDeferredCoFProgram;
 LLGLSLShader			gFXAAProgram;
 LLGLSLShader			gDeferredPostNoDoFProgram;
 LLGLSLShader			gDeferredWLSkyProgram;
@@ -1013,6 +1014,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredEmissiveProgram.unload();
 		gDeferredAvatarEyesProgram.unload();
 		gDeferredPostProgram.unload();		
+		gDeferredCoFProgram.unload();		
 		gFXAAProgram.unload();
 		gDeferredWaterProgram.unload();
 		gDeferredWLSkyProgram.unload();
@@ -1425,6 +1427,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		success = gDeferredPostProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gDeferredCoFProgram.mName = "Deferred CoF Shader";
+		gDeferredCoFProgram.mShaderFiles.clear();
+		gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredCoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		success = gDeferredCoFProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gDeferredPostNoDoFProgram.mName = "Deferred Post Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 3f670dfb145..f746d3f1152 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -330,6 +330,7 @@ extern LLGLSLShader			gDeferredSoftenProgram;
 extern LLGLSLShader			gDeferredShadowProgram;
 extern LLGLSLShader			gDeferredShadowAlphaMaskProgram;
 extern LLGLSLShader			gDeferredPostProgram;
+extern LLGLSLShader			gDeferredCoFProgram;
 extern LLGLSLShader			gFXAAProgram;
 extern LLGLSLShader			gDeferredPostNoDoFProgram;
 extern LLGLSLShader			gDeferredAvatarShadowProgram;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 152f4728dd3..85899b5ad67 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -443,7 +443,7 @@ void LLPipeline::init()
 	sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
 	sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
 	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO");
-	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseVAO");
+	LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO");
 	LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw");
 	sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
 	sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles");
@@ -6136,7 +6136,7 @@ void LLPipeline::resetVertexBuffers()
 	sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
 	sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
 	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO");
-	LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseVAO");
+	LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO");
 	LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw");
 	LLVertexBuffer::sEnableVBOs = gSavedSettings.getBOOL("RenderVBOEnable");
 	LLVertexBuffer::sDisableVBOMapping = LLVertexBuffer::sEnableVBOs && gSavedSettings.getBOOL("RenderVBOMappingDisable") ;
@@ -6487,7 +6487,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			}
 				
 			LLGLDisable blend(GL_BLEND);
-			bindDeferredShader(*shader);
+
 
 			if (dof_enabled)
 			{
@@ -6595,41 +6595,102 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				blur_constant /= 1000.f; //convert to meters for shader
 				F32 magnification = focal_length/(subject_distance-focal_length);
 
+				mDeferredLight.bindTarget();
+				shader = &gDeferredCoFProgram;
+
+				bindDeferredShader(*shader);
+
+				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+				if (channel > -1)
+				{
+					mScreen.bindTexture(0, channel);
+				}
+
+				if (multisample)
+				{ //bloom has already been added, bind black
+					channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
+					if (channel > -1)
+					{
+						gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
+					}
+				}
+				
 				shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f);
 				shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
 				shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
 				shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
-			}
 
-			S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
-			if (channel > -1)
-			{
-				mScreen.bindTexture(0, channel);
-			}
+				gGL.begin(LLRender::TRIANGLE_STRIP);
+				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+				gGL.vertex2f(-1,-1);
+		
+				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+				gGL.vertex2f(-1,3);
+		
+				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+				gGL.vertex2f(3,-1);
+		
+				gGL.end();
+
+				unbindDeferredShader(*shader);
+				mDeferredLight.flush();
 
-			if (multisample)
-			{ //bloom has already been added, bind black
-				channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
+
+				shader = &gDeferredPostProgram;
+				bindDeferredShader(*shader);
+				channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
 				if (channel > -1)
 				{
-					gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
+					mDeferredLight.bindTexture(0, channel);
 				}
+
+				gGL.begin(LLRender::TRIANGLE_STRIP);
+				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+				gGL.vertex2f(-1,-1);
+		
+				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+				gGL.vertex2f(-1,3);
+		
+				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+				gGL.vertex2f(3,-1);
+		
+				gGL.end();
+
+				unbindDeferredShader(*shader);
 			}
+			else
+			{
+				bindDeferredShader(*shader);
 
-	
-			gGL.begin(LLRender::TRIANGLE_STRIP);
-			gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-			gGL.vertex2f(-1,-1);
+				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+				if (channel > -1)
+				{
+					mScreen.bindTexture(0, channel);
+				}
+
+				if (multisample)
+				{ //bloom has already been added, bind black
+					channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
+					if (channel > -1)
+					{
+						gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
+					}
+				}
+				
+				gGL.begin(LLRender::TRIANGLE_STRIP);
+				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+				gGL.vertex2f(-1,-1);
 		
-			gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-			gGL.vertex2f(-1,3);
+				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+				gGL.vertex2f(-1,3);
 		
-			gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-			gGL.vertex2f(3,-1);
+				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+				gGL.vertex2f(3,-1);
 		
-			gGL.end();
+				gGL.end();
 
-			unbindDeferredShader(*shader);
+				unbindDeferredShader(*shader);
+			}
 		}
 	}
 	else
-- 
GitLab


From 8a8e9ccdb67e7e8a492a4fe1505407ebe128ee18 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 4 Nov 2011 16:15:05 -0500
Subject: [PATCH 161/933] SH-2652 Don't allocate 6000+ strings every frame

---
 indra/llplugin/llpluginclassmedia.h  |   2 +-
 indra/llui/lltextbase.cpp            |   6 +-
 indra/llui/lltextbase.h              |   2 +-
 indra/llui/llview.cpp                |   6 +-
 indra/llui/llview.h                  |   2 +-
 indra/llwindow/llmousehandler.h      |   2 +-
 indra/newview/llfolderviewitem.cpp   |   2 +-
 indra/newview/llfolderviewitem.h     |   2 +-
 indra/newview/llspatialpartition.cpp |  40 +++-
 indra/newview/lltool.h               |   2 +-
 indra/newview/llviewermedia.cpp      | 283 +++++++++++++++------------
 indra/newview/llviewermedia.h        |   2 +-
 12 files changed, 212 insertions(+), 139 deletions(-)

diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index 1f548f8cc02..26fff7a6145 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -269,7 +269,7 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 	std::string	getHoverText() const { return mHoverText; };
 	std::string	getHoverLink() const { return mHoverLink; };
 	
-	std::string getMediaName() const { return mMediaName; };
+	const std::string& getMediaName() const { return mMediaName; };
 	std::string getMediaDescription() const { return mMediaDescription; };
 
 	// Crash the plugin.  If you use this outside of a testbed, you will be punished.
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 919364be632..3b768166f12 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2518,7 +2518,11 @@ BOOL LLTextSegment::handleDoubleClick(S32 x, S32 y, MASK mask) { return FALSE; }
 BOOL LLTextSegment::handleHover(S32 x, S32 y, MASK mask) { return FALSE; }
 BOOL LLTextSegment::handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE; }
 BOOL LLTextSegment::handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; }
-std::string	LLTextSegment::getName() const { return ""; }
+const std::string&	LLTextSegment::getName() const 
+{
+	static std::string empty_string("");
+	return empty_string; 
+}
 void LLTextSegment::onMouseCaptureLost() {}
 void LLTextSegment::screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}
 void LLTextSegment::localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {}
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 384d9116fc0..b6996019088 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -84,7 +84,7 @@ class LLTextSegment : public LLRefCount, public LLMouseHandler
 	/*virtual*/ BOOL			handleHover(S32 x, S32 y, MASK mask);
 	/*virtual*/ BOOL			handleScrollWheel(S32 x, S32 y, S32 clicks);
 	/*virtual*/ BOOL			handleToolTip(S32 x, S32 y, MASK mask);
-	/*virtual*/ std::string		getName() const;
+	/*virtual*/ const std::string&	getName() const;
 	/*virtual*/ void			onMouseCaptureLost();
 	/*virtual*/ void			screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const;
 	/*virtual*/ void			localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 1644f53978d..486babb0ab9 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -225,9 +225,11 @@ BOOL LLView::getUseBoundingRect() const
 }
 
 // virtual
-std::string LLView::getName() const
+const std::string& LLView::getName() const
 {
-	return mName.empty() ? std::string("(no name)") : mName;
+	static std::string no_name("(no name)");
+
+	return mName.empty() ? no_name : mName;
 }
 
 void LLView::sendChildToFront(LLView* child)
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 08828e55e6a..ec7f8e385d2 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -431,7 +431,7 @@ class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElem
 	/*virtual*/ BOOL	handleRightMouseUp(S32 x, S32 y, MASK mask);	
 	/*virtual*/ BOOL	handleToolTip(S32 x, S32 y, MASK mask);
 
-	/*virtual*/ std::string	getName() const;
+	/*virtual*/ const std::string& getName() const;
 	/*virtual*/ void	onMouseCaptureLost();
 	/*virtual*/ BOOL	hasMouseCapture();
 	/*virtual*/ void	screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const;
diff --git a/indra/llwindow/llmousehandler.h b/indra/llwindow/llmousehandler.h
index bbbc3d4406b..d825a3424c0 100644
--- a/indra/llwindow/llmousehandler.h
+++ b/indra/llwindow/llmousehandler.h
@@ -65,7 +65,7 @@ class LLMouseHandler
 	virtual BOOL	handleHover(S32 x, S32 y, MASK mask) = 0;
 	virtual BOOL	handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
 	virtual BOOL	handleToolTip(S32 x, S32 y, MASK mask) = 0;
-	virtual std::string getName() const = 0;
+	virtual const std::string& getName() const = 0;
 
 	virtual void	onMouseCaptureLost() = 0;
 
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 622dcfe8ddb..02222e430f3 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -658,7 +658,7 @@ LLViewerInventoryItem * LLFolderViewItem::getInventoryItem(void)
 	return gInventory.getItem(getListener()->getUUID());
 }
 
-std::string LLFolderViewItem::getName( void ) const
+const std::string& LLFolderViewItem::getName( void ) const
 {
 	if(mListener)
 	{
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 676eaf825dc..be71817316e 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -267,7 +267,7 @@ class LLFolderViewItem : public LLView
 
 	// This method returns the actual name of the thing being
 	// viewed. This method will ask the viewed object itself.
-	std::string getName( void ) const;
+	const std::string& getName( void ) const;
 
 	const std::string& getSearchableLabel( void ) const;
 
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 7bf4e901c1c..3fecc338027 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1617,6 +1617,13 @@ static LLFastTimer::DeclareTimer FTM_SET_OCCLUSION_STATE("Occlusion State");
 static LLFastTimer::DeclareTimer FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail");
 static LLFastTimer::DeclareTimer FTM_OCCLUSION_ALLOCATE("Allocate");
 static LLFastTimer::DeclareTimer FTM_OCCLUSION_BUILD("Build");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_BEGIN_QUERY("Begin Query");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_END_QUERY("End Query");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_SET_BUFFER("Set Buffer");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW_WATER("Draw Water");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW("Draw");
+
+
 
 void LLSpatialGroup::doOcclusion(LLCamera* camera)
 {
@@ -1635,6 +1642,19 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 		{
 			if (!isOcclusionState(QUERY_PENDING) || isOcclusionState(DISCARD_QUERY))
 			{
+				bool check = true;
+
+				if (isOcclusionState(QUERY_PENDING))
+				{
+					GLuint available = 0;
+					glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+					if (available == GL_FALSE)
+					{
+						check = false;
+					}
+				}
+
+				if (check)
 				{ //no query pending, or previous query to be discarded
 					LLFastTimer t(FTM_RENDER_OCCLUSION);
 
@@ -1671,12 +1691,21 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 
 					{
 						LLFastTimer t(FTM_PUSH_OCCLUSION_VERTS);
-						glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);					
+						
+						{
+							LLFastTimer t(FTM_OCCLUSION_BEGIN_QUERY);
+							glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);					
+						}
 					
-						mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
+						{
+							LLFastTimer t(FTM_OCCLUSION_SET_BUFFER);
+							mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
+						}
 
 						if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER)
 						{
+							LLFastTimer t(FTM_OCCLUSION_DRAW_WATER);
+
 							LLGLSquashToFarClip squash(glh_get_current_projection(), 1);
 							if (camera->getOrigin().isExactlyZero())
 							{ //origin is invalid, draw entire box
@@ -1690,6 +1719,7 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 						}
 						else
 						{
+							LLFastTimer t(FTM_OCCLUSION_DRAW);
 							if (camera->getOrigin().isExactlyZero())
 							{ //origin is invalid, draw entire box
 								mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
@@ -1701,7 +1731,11 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 							}
 						}
 
-						glEndQueryARB(mode);
+
+						{
+							LLFastTimer t(FTM_OCCLUSION_END_QUERY);
+							glEndQueryARB(mode);
+						}
 					}
 				}
 
diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h
index d3edabb4866..ecc435d8441 100644
--- a/indra/newview/lltool.h
+++ b/indra/newview/lltool.h
@@ -68,7 +68,7 @@ class LLTool
 	virtual void	localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const
 							{ *screen_x = local_x; *screen_y = local_y;	}
 
-	virtual std::string getName() const	{ return mName; }
+	virtual const std::string& getName() const	{ return mName; }
 
 	// New virtual functions
 	virtual LLViewerObject*	getEditingObject()		{ return NULL; }
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 41b4dc01e8d..cb78c40f9aa 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -782,6 +782,12 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi
 }
 
 static LLFastTimer::DeclareTimer FTM_MEDIA_UPDATE("Update Media");
+static LLFastTimer::DeclareTimer FTM_MEDIA_SPARE_IDLE("Spare Idle");
+static LLFastTimer::DeclareTimer FTM_MEDIA_UPDATE_INTEREST("Update/Interest");
+static LLFastTimer::DeclareTimer FTM_MEDIA_SORT("Sort");
+static LLFastTimer::DeclareTimer FTM_MEDIA_SORT2("Sort 2");
+static LLFastTimer::DeclareTimer FTM_MEDIA_MISC("Misc");
+
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // static
@@ -806,21 +812,28 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	impl_list::iterator iter = sViewerMediaImplList.begin();
 	impl_list::iterator end = sViewerMediaImplList.end();
 
-	for(; iter != end;)
 	{
-		LLViewerMediaImpl* pimpl = *iter++;
-		pimpl->update();
-		pimpl->calculateInterest();
+		LLFastTimer t(FTM_MEDIA_UPDATE_INTEREST);
+		for(; iter != end;)
+		{
+			LLViewerMediaImpl* pimpl = *iter++;
+			pimpl->update();
+			pimpl->calculateInterest();
+		}
 	}
 	
 	// Let the spare media source actually launch
 	if(sSpareBrowserMediaSource)
 	{
+		LLFastTimer t(FTM_MEDIA_SPARE_IDLE);
 		sSpareBrowserMediaSource->idle();
 	}
 		
-	// Sort the static instance list using our interest criteria
-	sViewerMediaImplList.sort(priorityComparitor);
+	{
+		LLFastTimer t(FTM_MEDIA_SORT);
+		// Sort the static instance list using our interest criteria
+		sViewerMediaImplList.sort(priorityComparitor);
+	}
 
 	// Go through the list again and adjust according to priority.
 	iter = sViewerMediaImplList.begin();
@@ -848,147 +861,150 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	// max_instances must be set high enough to allow the various instances used in the UI (for the help browser, search, etc.) to be loaded.
 	// If max_normal + max_low is less than max_instances, things will tend to get unloaded instead of being set to slideshow.
 	
-	for(; iter != end; iter++)
 	{
-		LLViewerMediaImpl* pimpl = *iter;
+		LLFastTimer t(FTM_MEDIA_MISC);
+		for(; iter != end; iter++)
+		{
+			LLViewerMediaImpl* pimpl = *iter;
 		
-		LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
+			LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
 
-		if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances))
-		{
-			// Never load muted or failed impls.
-			// Hard limit on the number of instances that will be loaded at one time
-			new_priority = LLPluginClassMedia::PRIORITY_UNLOADED;
-		}
-		else if(!pimpl->getVisible())
-		{
-			new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
-		}
-		else if(pimpl->hasFocus())
-		{
-			new_priority = LLPluginClassMedia::PRIORITY_HIGH;
-			impl_count_interest_normal++;	// count this against the count of "normal" instances for priority purposes
-		}
-		else if(pimpl->getUsedInUI())
-		{
-			new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
-			impl_count_interest_normal++;
-		}
-		else if(pimpl->isParcelMedia())
-		{
-			new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
-			impl_count_interest_normal++;
-		}
-		else
-		{
-			// Look at interest and CPU usage for instances that aren't in any of the above states.
-			
-			// Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture,
-			// turn it down to low instead of normal.  This may downsample for plugins that support it.
-			bool media_is_small = false;
-			F64 approximate_interest = pimpl->getApproximateTextureInterest();
-			if(approximate_interest == 0.0f)
+			if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances))
 			{
-				// this media has no current size, which probably means it's not loaded.
-				media_is_small = true;
+				// Never load muted or failed impls.
+				// Hard limit on the number of instances that will be loaded at one time
+				new_priority = LLPluginClassMedia::PRIORITY_UNLOADED;
 			}
-			else if(pimpl->getInterest() < (approximate_interest / 4))
+			else if(!pimpl->getVisible())
 			{
-				media_is_small = true;
+				new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
 			}
-			
-			if(pimpl->getInterest() == 0.0f)
+			else if(pimpl->hasFocus())
 			{
-				// This media is completely invisible, due to being outside the view frustrum or out of range.
-				new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
+				new_priority = LLPluginClassMedia::PRIORITY_HIGH;
+				impl_count_interest_normal++;	// count this against the count of "normal" instances for priority purposes
 			}
-			else if(check_cpu_usage && (total_cpu > max_cpu))
+			else if(pimpl->getUsedInUI())
 			{
-				// Higher priority plugins have already used up the CPU budget.  Set remaining ones to slideshow priority.
-				new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW;
+				new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
+				impl_count_interest_normal++;
 			}
-			else if((impl_count_interest_normal < (int)max_normal) && !media_is_small)
+			else if(pimpl->isParcelMedia())
 			{
-				// Up to max_normal inworld get normal priority
 				new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
 				impl_count_interest_normal++;
 			}
-			else if (impl_count_interest_low + impl_count_interest_normal < (int)max_low + (int)max_normal)
+			else
 			{
-				// The next max_low inworld get turned down
-				new_priority = LLPluginClassMedia::PRIORITY_LOW;
-				impl_count_interest_low++;
-				
-				// Set the low priority size for downsampling to approximately the size the texture is displayed at.
+				// Look at interest and CPU usage for instances that aren't in any of the above states.
+			
+				// Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture,
+				// turn it down to low instead of normal.  This may downsample for plugins that support it.
+				bool media_is_small = false;
+				F64 approximate_interest = pimpl->getApproximateTextureInterest();
+				if(approximate_interest == 0.0f)
+				{
+					// this media has no current size, which probably means it's not loaded.
+					media_is_small = true;
+				}
+				else if(pimpl->getInterest() < (approximate_interest / 4))
+				{
+					media_is_small = true;
+				}
+			
+				if(pimpl->getInterest() == 0.0f)
 				{
-					F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest());
+					// This media is completely invisible, due to being outside the view frustrum or out of range.
+					new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
+				}
+				else if(check_cpu_usage && (total_cpu > max_cpu))
+				{
+					// Higher priority plugins have already used up the CPU budget.  Set remaining ones to slideshow priority.
+					new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW;
+				}
+				else if((impl_count_interest_normal < (int)max_normal) && !media_is_small)
+				{
+					// Up to max_normal inworld get normal priority
+					new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
+					impl_count_interest_normal++;
+				}
+				else if (impl_count_interest_low + impl_count_interest_normal < (int)max_low + (int)max_normal)
+				{
+					// The next max_low inworld get turned down
+					new_priority = LLPluginClassMedia::PRIORITY_LOW;
+					impl_count_interest_low++;
+				
+					// Set the low priority size for downsampling to approximately the size the texture is displayed at.
+					{
+						F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest());
 					
-					pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension));
+						pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension));
+					}
+				}
+				else
+				{
+					// Any additional impls (up to max_instances) get very infrequent time
+					new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW;
 				}
 			}
-			else
-			{
-				// Any additional impls (up to max_instances) get very infrequent time
-				new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW;
-			}
-		}
 		
-		if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED))
-		{
-			// This is a loadable inworld impl -- the last one in the list in this class defines the lowest loadable interest.
-			lowest_interest_loadable = pimpl;
+			if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED))
+			{
+				// This is a loadable inworld impl -- the last one in the list in this class defines the lowest loadable interest.
+				lowest_interest_loadable = pimpl;
 			
-			impl_count_total++;
-		}
+				impl_count_total++;
+			}
 
-		// Overrides if the window is minimized or we lost focus (taking care
-		// not to accidentally "raise" the priority either)
-		if (!gViewerWindow->getActive() /* viewer window minimized? */ 
-			&& new_priority > LLPluginClassMedia::PRIORITY_HIDDEN)
-		{
-			new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
-		}
-		else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */
-				 && new_priority > LLPluginClassMedia::PRIORITY_LOW)
-		{
-			new_priority = LLPluginClassMedia::PRIORITY_LOW;
-		}
+			// Overrides if the window is minimized or we lost focus (taking care
+			// not to accidentally "raise" the priority either)
+			if (!gViewerWindow->getActive() /* viewer window minimized? */ 
+				&& new_priority > LLPluginClassMedia::PRIORITY_HIDDEN)
+			{
+				new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
+			}
+			else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */
+					 && new_priority > LLPluginClassMedia::PRIORITY_LOW)
+			{
+				new_priority = LLPluginClassMedia::PRIORITY_LOW;
+			}
 		
-		if(!inworld_media_enabled)
-		{
-			// If inworld media is locked out, force all inworld media to stay unloaded.
-			if(!pimpl->getUsedInUI())
+			if(!inworld_media_enabled)
 			{
-				new_priority = LLPluginClassMedia::PRIORITY_UNLOADED;
+				// If inworld media is locked out, force all inworld media to stay unloaded.
+				if(!pimpl->getUsedInUI())
+				{
+					new_priority = LLPluginClassMedia::PRIORITY_UNLOADED;
+				}
 			}
-		}
-		// update the audio stream here as well
-		if( !inworld_audio_enabled)
-		{
-			if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio())
+			// update the audio stream here as well
+			if( !inworld_audio_enabled)
 			{
-				gAudiop->stopInternetStream();
+				if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio())
+				{
+					gAudiop->stopInternetStream();
+				}
 			}
-		}
-		pimpl->setPriority(new_priority);
+			pimpl->setPriority(new_priority);
 		
-		if(pimpl->getUsedInUI())
-		{
-			// Any impls used in the UI should not be in the proximity list.
-			pimpl->mProximity = -1;
-		}
-		else
-		{
-			proximity_order.push_back(pimpl);
-		}
+			if(pimpl->getUsedInUI())
+			{
+				// Any impls used in the UI should not be in the proximity list.
+				pimpl->mProximity = -1;
+			}
+			else
+			{
+				proximity_order.push_back(pimpl);
+			}
 
-		total_cpu += pimpl->getCPUUsage();
+			total_cpu += pimpl->getCPUUsage();
 		
-		if (!pimpl->getUsedInUI() && pimpl->hasMedia())
-		{
-			sAnyMediaShowing = true;
-		}
+			if (!pimpl->getUsedInUI() && pimpl->hasMedia())
+			{
+				sAnyMediaShowing = true;
+			}
 
+		}
 	}
 
 	// Re-calculate this every time.
@@ -1014,6 +1030,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	}
 	else
 	{
+		LLFastTimer t(FTM_MEDIA_SORT2);
 		// Use a distance-based sort for proximity values.  
 		std::stable_sort(proximity_order.begin(), proximity_order.end(), proximity_comparitor);
 	}
@@ -2506,7 +2523,7 @@ void LLViewerMediaImpl::updateJavascriptObject()
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
-std::string LLViewerMediaImpl::getName() const 
+const std::string& LLViewerMediaImpl::getName() const 
 { 
 	if (mMediaSource)
 	{
@@ -2768,8 +2785,14 @@ bool LLViewerMediaImpl::canNavigateBack()
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
+static LLFastTimer::DeclareTimer FTM_MEDIA_DO_UPDATE("Do Update");
+static LLFastTimer::DeclareTimer FTM_MEDIA_GET_DATA("Get Data");
+static LLFastTimer::DeclareTimer FTM_MEDIA_SET_SUBIMAGE("Set Subimage");
+
+
 void LLViewerMediaImpl::update()
 {
+	LLFastTimer t(FTM_MEDIA_DO_UPDATE);
 	if(mMediaSource == NULL)
 	{
 		if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED)
@@ -2869,20 +2892,27 @@ void LLViewerMediaImpl::update()
 			if(width > 0 && height > 0)
 			{
 
-				U8* data = mMediaSource->getBitsData();
+				U8* data = NULL;
+				{
+					LLFastTimer t(FTM_MEDIA_GET_DATA);
+					data = mMediaSource->getBitsData();
+				}
 
 				// Offset the pixels pointer to match x_pos and y_pos
 				data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() );
 				data += ( y_pos * mMediaSource->getTextureDepth() );
 				
-				placeholder_image->setSubImage(
-						data, 
-						mMediaSource->getBitsWidth(), 
-						mMediaSource->getBitsHeight(),
-						x_pos, 
-						y_pos, 
-						width, 
-						height);
+				{
+					LLFastTimer t(FTM_MEDIA_SET_SUBIMAGE);
+					placeholder_image->setSubImage(
+							data, 
+							mMediaSource->getBitsWidth(), 
+							mMediaSource->getBitsHeight(),
+							x_pos, 
+							y_pos, 
+							width, 
+							height);
+				}
 
 			}
 			
@@ -3455,8 +3485,11 @@ BOOL LLViewerMediaImpl::isUpdated()
 	return mIsUpdated ;
 }
 
+static LLFastTimer::DeclareTimer FTM_MEDIA_CALCULATE_INTEREST("Calculate Interest");
+
 void LLViewerMediaImpl::calculateInterest()
 {
+	LLFastTimer t(FTM_MEDIA_CALCULATE_INTEREST);
 	LLViewerMediaTexture* texture = LLViewerTextureManager::findMediaTexture( mTextureId );
 	
 	if(texture != NULL)
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 0b69b8f0c1c..0da26ea3c77 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -317,7 +317,7 @@ class LLViewerMediaImpl
 	/*virtual*/ BOOL	handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; };
 	/*virtual*/ BOOL	handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
 	/*virtual*/ BOOL	handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; };
-	/*virtual*/ std::string getName() const;
+	/*virtual*/ const std::string& getName() const;
 
 	/*virtual*/ void	screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {};
 	/*virtual*/ void	localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {};
-- 
GitLab


From 785dcfe6d496bd44730b6ba0004614b2c6d04c6a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 4 Nov 2011 16:42:00 -0500
Subject: [PATCH 162/933] SH-2652 Even faster depth of field

---
 .../shaders/class1/deferred/dofCombineF.glsl  |  49 +++++++
 .../class1/deferred/postDeferredF.glsl        |   5 -
 indra/newview/llviewershadermgr.cpp           |  12 ++
 indra/newview/llviewershadermgr.h             |   1 +
 indra/newview/pipeline.cpp                    | 120 +++++++++++-------
 5 files changed, 139 insertions(+), 48 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl

diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
new file mode 100644
index 00000000000..de0c70cfe91
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -0,0 +1,49 @@
+/** 
+ * @file dofCombineF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#extension GL_ARB_texture_rectangle : enable
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+uniform sampler2DRect diffuseRect;
+uniform sampler2DRect lightMap;
+
+uniform mat4 inv_proj;
+uniform vec2 screen_res;
+
+VARYING vec2 vary_fragcoord;
+
+void main() 
+{
+	vec2 tc = vary_fragcoord.xy;
+	
+	vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*0.5);
+	
+	vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
+
+	gl_FragColor = mix(diff, dof, diff.a);
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index f684e25df8f..1db638b943e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -31,11 +31,6 @@ out vec4 gl_FragColor;
 
 uniform sampler2DRect diffuseRect;
 
-uniform float focal_distance;
-uniform float blur_constant;
-uniform float tan_pixel_angle;
-uniform float magnification;
-
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 8118d32dc41..32978a0d04d 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -187,6 +187,7 @@ LLGLSLShader			gDeferredFullbrightProgram;
 LLGLSLShader			gDeferredEmissiveProgram;
 LLGLSLShader			gDeferredPostProgram;
 LLGLSLShader			gDeferredCoFProgram;
+LLGLSLShader			gDeferredDoFCombineProgram;
 LLGLSLShader			gFXAAProgram;
 LLGLSLShader			gDeferredPostNoDoFProgram;
 LLGLSLShader			gDeferredWLSkyProgram;
@@ -1015,6 +1016,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarEyesProgram.unload();
 		gDeferredPostProgram.unload();		
 		gDeferredCoFProgram.unload();		
+		gDeferredDoFCombineProgram.unload();
 		gFXAAProgram.unload();
 		gDeferredWaterProgram.unload();
 		gDeferredWLSkyProgram.unload();
@@ -1437,6 +1439,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		success = gDeferredCoFProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gDeferredDoFCombineProgram.mName = "Deferred DoFCombine Shader";
+		gDeferredDoFCombineProgram.mShaderFiles.clear();
+		gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gDeferredDoFCombineProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		success = gDeferredDoFCombineProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gDeferredPostNoDoFProgram.mName = "Deferred Post Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index f746d3f1152..95eb551bf1b 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -331,6 +331,7 @@ extern LLGLSLShader			gDeferredShadowProgram;
 extern LLGLSLShader			gDeferredShadowAlphaMaskProgram;
 extern LLGLSLShader			gDeferredPostProgram;
 extern LLGLSLShader			gDeferredCoFProgram;
+extern LLGLSLShader			gDeferredDoFCombineProgram;
 extern LLGLSLShader			gFXAAProgram;
 extern LLGLSLShader			gDeferredPostNoDoFProgram;
 extern LLGLSLShader			gDeferredAvatarShadowProgram;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 85899b5ad67..8ae7e97f4a0 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6595,68 +6595,102 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				blur_constant /= 1000.f; //convert to meters for shader
 				F32 magnification = focal_length/(subject_distance-focal_length);
 
-				mDeferredLight.bindTarget();
-				shader = &gDeferredCoFProgram;
+				{ //build diffuse+bloom+CoF
+					mDeferredLight.bindTarget();
+					shader = &gDeferredCoFProgram;
 
-				bindDeferredShader(*shader);
-
-				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
-				if (channel > -1)
-				{
-					mScreen.bindTexture(0, channel);
-				}
+					bindDeferredShader(*shader);
 
-				if (multisample)
-				{ //bloom has already been added, bind black
-					channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
+					S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
 					if (channel > -1)
 					{
-						gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
+						mScreen.bindTexture(0, channel);
+					}
+
+					if (multisample)
+					{ //bloom has already been added, bind black
+						channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
+						if (channel > -1)
+						{
+							gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
+						}
 					}
-				}
 				
-				shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f);
-				shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
-				shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
-				shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
+					shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f);
+					shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
+					shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
+					shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
 
-				gGL.begin(LLRender::TRIANGLE_STRIP);
-				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-				gGL.vertex2f(-1,-1);
+					gGL.begin(LLRender::TRIANGLE_STRIP);
+					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+					gGL.vertex2f(-1,-1);
 		
-				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-				gGL.vertex2f(-1,3);
+					gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+					gGL.vertex2f(-1,3);
 		
-				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-				gGL.vertex2f(3,-1);
+					gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+					gGL.vertex2f(3,-1);
 		
-				gGL.end();
+					gGL.end();
 
-				unbindDeferredShader(*shader);
-				mDeferredLight.flush();
+					unbindDeferredShader(*shader);
+					mDeferredLight.flush();
+				}
 
+				{ //perform DoF sampling at half-res (preserve alpha channel)
+					mScreen.bindTarget();
+					glViewport(0,0,mScreen.getWidth()/2, mScreen.getHeight()/2);
+					gGL.setColorMask(true, false);
 
-				shader = &gDeferredPostProgram;
-				bindDeferredShader(*shader);
-				channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
-				if (channel > -1)
-				{
-					mDeferredLight.bindTexture(0, channel);
+					shader = &gDeferredPostProgram;
+					bindDeferredShader(*shader);
+					S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
+					if (channel > -1)
+					{
+						mDeferredLight.bindTexture(0, channel);
+					}
+
+					gGL.begin(LLRender::TRIANGLE_STRIP);
+					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+					gGL.vertex2f(-1,-1);
+		
+					gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+					gGL.vertex2f(-1,3);
+		
+					gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+					gGL.vertex2f(3,-1);
+		
+					gGL.end();
+
+					unbindDeferredShader(*shader);
+					mScreen.flush();
+					gGL.setColorMask(true, true);
 				}
 
-				gGL.begin(LLRender::TRIANGLE_STRIP);
-				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-				gGL.vertex2f(-1,-1);
+				{ //combine result based on alpha
+					shader = &gDeferredDoFCombineProgram;
+					bindDeferredShader(*shader);
+					glViewport(0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
+					S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+					if (channel > -1)
+					{
+						mScreen.bindTexture(0, channel);
+					}
+
+					gGL.begin(LLRender::TRIANGLE_STRIP);
+					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+					gGL.vertex2f(-1,-1);
 		
-				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-				gGL.vertex2f(-1,3);
+					gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+					gGL.vertex2f(-1,3);
 		
-				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-				gGL.vertex2f(3,-1);
+					gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+					gGL.vertex2f(3,-1);
 		
-				gGL.end();
+					gGL.end();
 
-				unbindDeferredShader(*shader);
+					unbindDeferredShader(*shader);
+				}
 			}
 			else
 			{
-- 
GitLab


From 367d6212ae9e18c398c25fe9e11646bfc801fd90 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 4 Nov 2011 17:07:40 -0500
Subject: [PATCH 163/933] SH-2652 Better DoF combine foo

---
 indra/llrender/llshadermgr.cpp                       |  1 +
 indra/llrender/llshadermgr.h                         |  1 +
 indra/newview/app_settings/settings.xml              | 12 ++++++++++++
 .../app_settings/shaders/class1/deferred/cofF.glsl   |  3 ++-
 .../shaders/class1/deferred/dofCombineF.glsl         |  5 ++++-
 .../shaders/class1/deferred/postDeferredF.glsl       |  5 +++--
 indra/newview/pipeline.cpp                           |  9 ++++++++-
 indra/newview/pipeline.h                             |  1 +
 8 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 84dc768983d..b390037a9c0 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1046,6 +1046,7 @@ void LLShaderMgr::initAttribsAndUniforms()
 	mReservedUniforms.push_back("blur_constant");
 	mReservedUniforms.push_back("tan_pixel_angle");
 	mReservedUniforms.push_back("magnification");
+	mReservedUniforms.push_back("max_cof");
 
 	mReservedUniforms.push_back("depthMap");
 	mReservedUniforms.push_back("shadowMap0");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index a5150b3e51c..82ce2dfff25 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -141,6 +141,7 @@ class LLShaderMgr
 		DOF_BLUR_CONSTANT,
 		DOF_TAN_PIXEL_ANGLE,
 		DOF_MAGNIFICATION,
+		DOF_MAX_COF,
 
 		DEFERRED_DEPTH,
 		DEFERRED_SHADOW0,
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index fb73ddf2193..d057323e51d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1392,6 +1392,18 @@
     <real>0.5</real>
   </map>
 
+  <key>CameraMaxCoF</key>
+  <map>
+    <key>Comment</key>
+    <string>Maximum camera circle of confusion for DoF effect</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>10.0</real>
+  </map>
+
   <key>CameraFNumber</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index 81f00f7d0f1..56fa4e693b9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -39,6 +39,7 @@ uniform float focal_distance;
 uniform float blur_constant;
 uniform float tan_pixel_angle;
 uniform float magnification;
+uniform float max_cof;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
@@ -78,7 +79,7 @@ void main()
 	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
 	float sc = calc_cof(depth);
-	sc = min(abs(sc), 10.0);
+	sc = min(abs(sc), max_cof);
 	
 	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
 	gl_FragColor.rgb = diff.rgb + bloom.rgb;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index de0c70cfe91..c639f25fc62 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -35,6 +35,8 @@ uniform sampler2DRect lightMap;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
+uniform float max_cof;
+
 VARYING vec2 vary_fragcoord;
 
 void main() 
@@ -45,5 +47,6 @@ void main()
 	
 	vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
 
-	gl_FragColor = mix(diff, dof, diff.a);
+	float a = min(diff.a * max_cof*0.125, 1.0);
+	gl_FragColor = mix(diff, dof, a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 1db638b943e..629648ddc38 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -33,6 +33,7 @@ uniform sampler2DRect diffuseRect;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
+uniform float max_cof;
 
 VARYING vec2 vary_fragcoord;
 
@@ -40,7 +41,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc)
 {
 	vec4 s = texture2DRect(diffuseRect, tc);
 
-	float sc = s.a*10.0;
+	float sc = s.a*max_cof;
 
 	if (sc > min_sc) //sampled pixel is more "out of focus" than current sample radius
 	{
@@ -64,7 +65,7 @@ void main()
 	{ 
 		float w = 1.0;
 		
-		float sc = diff.a*10.0;
+		float sc = diff.a*max_cof;
 				
 		float PI = 3.14159265358979323846264;
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 8ae7e97f4a0..1fff954b963 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -185,6 +185,7 @@ LLVector3 LLPipeline::RenderShadowSplitExponent;
 F32 LLPipeline::RenderShadowErrorCutoff;
 F32 LLPipeline::RenderShadowFOVCutoff;
 BOOL LLPipeline::CameraOffset;
+F32 LLPipeline::CameraMaxCoF;
 
 const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f;
 const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f;
@@ -926,6 +927,7 @@ void LLPipeline::refreshCachedSettings()
 	RenderShadowErrorCutoff = gSavedSettings.getF32("RenderShadowErrorCutoff");
 	RenderShadowFOVCutoff = gSavedSettings.getF32("RenderShadowFOVCutoff");
 	CameraOffset = gSavedSettings.getBOOL("CameraOffset");
+	CameraMaxCoF = gSavedSettings.getF32("CameraMaxCoF");
 }
 
 void LLPipeline::releaseGLBuffers()
@@ -6461,7 +6463,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 			shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f/width*scale_x, 1.f/height*scale_y);
 			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
 			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
-
+			
 			gGL.begin(LLRender::TRIANGLE_STRIP);
 			gGL.vertex2f(-1,-1);
 			gGL.vertex2f(-1,3);
@@ -6620,6 +6622,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 					shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
 					shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
 					shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
+					shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
 
 					gGL.begin(LLRender::TRIANGLE_STRIP);
 					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
@@ -6650,6 +6653,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 						mDeferredLight.bindTexture(0, channel);
 					}
 
+					shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+
 					gGL.begin(LLRender::TRIANGLE_STRIP);
 					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
 					gGL.vertex2f(-1,-1);
@@ -6677,6 +6682,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 						mScreen.bindTexture(0, channel);
 					}
 
+					shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+
 					gGL.begin(LLRender::TRIANGLE_STRIP);
 					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
 					gGL.vertex2f(-1,-1);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index d6539909776..e607e0aec64 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -845,6 +845,7 @@ class LLPipeline
 	static F32 RenderShadowErrorCutoff;
 	static F32 RenderShadowFOVCutoff;
 	static BOOL CameraOffset;
+	static F32 CameraMaxCoF;
 };
 
 void render_bbox(const LLVector3 &min, const LLVector3 &max);
-- 
GitLab


From 0a43fdd07e3b084ce230086c032ccef79f1df429 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 4 Nov 2011 17:27:33 -0500
Subject: [PATCH 164/933] SH-2652 Even faster DoF -- also fix for screen going
 black when DoF enabled but shadows are not.

---
 .../app_settings/shaders/class1/deferred/postDeferredF.glsl   | 4 ++--
 indra/newview/pipeline.cpp                                    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 629648ddc38..bf029d1db54 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -73,7 +73,7 @@ void main()
 		{
 			while (sc > 0.5)
 			{
-				int its = int(max(1.0,(sc*3.7)));
+				int its = int(max(1.0,(sc*3.7*0.5)));
 				for (int i=0; i<its; ++i)
 				{
 					float ang = sc+i*2*PI/its; // sc is added for rotary perturbance
@@ -82,7 +82,7 @@ void main()
 					// you could test sample coords against an interesting non-circular aperture shape here, if desired.
 					dofSample(diff, w, sc, vary_fragcoord.xy + vec2(samp_x,samp_y));
 				}
-				sc -= 1.0;
+				sc -= 2.0;
 			}
 		}
 		
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 1fff954b963..d524ddd62d4 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -745,8 +745,8 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 			mFXAABuffer.release();
 		}
 		
-		if (shadow_detail > 0 || ssao)
-		{ //only need mDeferredLight for shadows OR ssao
+		if (shadow_detail > 0 || ssao || RenderDepthOfField)
+		{ //only need mDeferredLight for shadows OR ssao OR dof
 			if (!mDeferredLight.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
 		}
 		else
-- 
GitLab


From a6e40e6e02600cb47299dc9903400720786f72f0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 7 Nov 2011 12:34:05 -0600
Subject: [PATCH 165/933] SH-2652 Slightly slower DoF (quality), apply FXAA
 *after* DoF, fix for some render targets not getting allocated when needed.

---
 .../shaders/class1/deferred/dofCombineF.glsl  |   2 +-
 .../class1/deferred/postDeferredF.glsl        |   4 +-
 .../class1/interface/glowcombineFXAAF.glsl    |   7 +-
 indra/newview/llviewercontrol.cpp             |   2 +
 indra/newview/pipeline.cpp                    | 491 +++++++++---------
 5 files changed, 248 insertions(+), 258 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index c639f25fc62..d2903b545cf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -47,6 +47,6 @@ void main()
 	
 	vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
 
-	float a = min(diff.a * max_cof*0.125, 1.0);
+	float a = min(diff.a * max_cof*0.333, 1.0);
 	gl_FragColor = mix(diff, dof, a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index bf029d1db54..629648ddc38 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -73,7 +73,7 @@ void main()
 		{
 			while (sc > 0.5)
 			{
-				int its = int(max(1.0,(sc*3.7*0.5)));
+				int its = int(max(1.0,(sc*3.7)));
 				for (int i=0; i<its; ++i)
 				{
 					float ang = sc+i*2*PI/its; // sc is added for rotary perturbance
@@ -82,7 +82,7 @@ void main()
 					// you could test sample coords against an interesting non-circular aperture shape here, if desired.
 					dofSample(diff, w, sc, vary_fragcoord.xy + vec2(samp_x,samp_y));
 				}
-				sc -= 2.0;
+				sc -= 1.0;
 			}
 		}
 		
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index 7136d412ea4..c66a6e5b481 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -29,17 +29,14 @@
 out vec4 gl_FragColor;
 #endif
 
-uniform sampler2D glowMap;
-uniform sampler2DRect screenMap;
+uniform sampler2DRect diffuseRect;
 
 uniform vec2 screen_res;
 VARYING vec2 vary_tc;
 
 void main() 
 {
-	vec3 col = texture2D(glowMap, vary_tc).rgb +
-					texture2DRect(screenMap, vary_tc*screen_res).rgb;
-
+	vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb;
 	
 	gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
 }
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index d9210877dd2..03d765eaee2 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -574,6 +574,8 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
+	gSavedSettings.getControl("RenderDepthOfField")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
+	gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d524ddd62d4..59e6c3cf07e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -745,8 +745,8 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 			mFXAABuffer.release();
 		}
 		
-		if (shadow_detail > 0 || ssao || RenderDepthOfField)
-		{ //only need mDeferredLight for shadows OR ssao OR dof
+		if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0)
+		{ //only need mDeferredLight for shadows OR ssao OR dof OR fxaa
 			if (!mDeferredLight.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
 		}
 		else
@@ -6416,308 +6416,199 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		multisample = false;
 #endif
 
-		if (multisample)
-		{
-			//bake out texture2D with RGBL for FXAA shader
-			mFXAABuffer.bindTarget();
-			
-			S32 width = mScreen.getWidth();
-			S32 height = mScreen.getHeight();
-			glViewport(0, 0, width, height);
-
-			gGlowCombineFXAAProgram.bind();
-			gGlowCombineFXAAProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, width, height);
-
-			gGL.getTexUnit(0)->bind(&mGlow[1]);
-			gGL.getTexUnit(1)->bind(&mScreen);
-
-			gGL.begin(LLRender::TRIANGLE_STRIP);
-			gGL.vertex2f(-1,-1);
-			gGL.vertex2f(-1,3);
-			gGL.vertex2f(3,-1);
-			gGL.end();
-
-			gGL.flush();
-
-			gGlowCombineFXAAProgram.unbind();
-			mFXAABuffer.flush();
-
-			if (dof_enabled)
-			{ //if depth of field is not enabled, this is the final pass (draw to window)
-				mScreen.bindTarget();
-			}
-			LLGLSLShader* shader = &gFXAAProgram;
-			shader->bind();
-
-			S32 channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
-			if (channel > -1)
-			{
-				mFXAABuffer.bindTexture(0, channel);
-				gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
-			}
-
-			
-			F32 scale_x = (F32) width/mFXAABuffer.getWidth();
-			F32 scale_y = (F32) height/mFXAABuffer.getHeight();
-			shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y);
-			shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f/width*scale_x, 1.f/height*scale_y);
-			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
-			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
-			
-			gGL.begin(LLRender::TRIANGLE_STRIP);
-			gGL.vertex2f(-1,-1);
-			gGL.vertex2f(-1,3);
-			gGL.vertex2f(3,-1);
-			gGL.end();
-
-			gGL.flush();
-			if (dof_enabled)
-			{
-				mScreen.flush();
-			}
-			shader->unbind();
-		}
-
 		gViewerWindow->setup3DViewport();
 				
-		if (dof_enabled || !multisample)
+		if (dof_enabled)
 		{
 			LLGLSLShader* shader = &gDeferredPostProgram;
-			if (!dof_enabled)
-			{ 
-				shader = &gDeferredPostNoDoFProgram;
-			}
-				
 			LLGLDisable blend(GL_BLEND);
 
+			//depth of field focal plane calculations
+			static F32 current_distance = 16.f;
+			static F32 start_distance = 16.f;
+			static F32 transition_time = 1.f;
 
-			if (dof_enabled)
-			{
-				//depth of field focal plane calculations
-
-				static F32 current_distance = 16.f;
-				static F32 start_distance = 16.f;
-				static F32 transition_time = 1.f;
+			LLVector3 focus_point;
 
-				LLVector3 focus_point;
-
-				LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject();
-				if (obj && obj->mDrawable && obj->isSelected())
-				{ //focus on selected media object
-					S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace();
-					if (obj && obj->mDrawable)
+			LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject();
+			if (obj && obj->mDrawable && obj->isSelected())
+			{ //focus on selected media object
+				S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace();
+				if (obj && obj->mDrawable)
+				{
+					LLFace* face = obj->mDrawable->getFace(face_idx);
+					if (face)
 					{
-						LLFace* face = obj->mDrawable->getFace(face_idx);
-						if (face)
-						{
-							focus_point = face->getPositionAgent();
-						}
+						focus_point = face->getPositionAgent();
 					}
 				}
+			}
 		
-				if (focus_point.isExactlyZero())
+			if (focus_point.isExactlyZero())
+			{
+				if (LLViewerJoystick::getInstance()->getOverrideCamera())
+				{ //focus on point under cursor
+					focus_point = gDebugRaycastIntersection;
+				}
+				else if (gAgentCamera.cameraMouselook())
+				{ //focus on point under mouselook crosshairs
+					gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE,
+													NULL,
+													&focus_point);
+				}
+				else
 				{
-					if (LLViewerJoystick::getInstance()->getOverrideCamera())
-					{ //focus on point under cursor
-						focus_point = gDebugRaycastIntersection;
-					}
-					else if (gAgentCamera.cameraMouselook())
-					{ //focus on point under mouselook crosshairs
-						gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE,
-													  NULL,
-													  &focus_point);
+					LLViewerObject* obj = gAgentCamera.getFocusObject();
+					if (obj)
+					{ //focus on alt-zoom target
+						focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
 					}
 					else
-					{
-						LLViewerObject* obj = gAgentCamera.getFocusObject();
-						if (obj)
-						{ //focus on alt-zoom target
-							focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
-						}
-						else
-						{ //focus on your avatar
-							focus_point = gAgent.getPositionAgent();
-						}
+					{ //focus on your avatar
+						focus_point = gAgent.getPositionAgent();
 					}
 				}
+			}
 
-				LLVector3 eye = LLViewerCamera::getInstance()->getOrigin();
-				F32 target_distance = 16.f;
-				if (!focus_point.isExactlyZero())
-				{
-					target_distance = LLViewerCamera::getInstance()->getAtAxis() * (focus_point-eye);
-				}
+			LLVector3 eye = LLViewerCamera::getInstance()->getOrigin();
+			F32 target_distance = 16.f;
+			if (!focus_point.isExactlyZero())
+			{
+				target_distance = LLViewerCamera::getInstance()->getAtAxis() * (focus_point-eye);
+			}
 
-				if (transition_time >= 1.f &&
-					fabsf(current_distance-target_distance)/current_distance > 0.01f)
-				{ //large shift happened, interpolate smoothly to new target distance
-					transition_time = 0.f;
-					start_distance = current_distance;
-				}
-				else if (transition_time < 1.f)
-				{ //currently in a transition, continue interpolating
-					transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds;
-					transition_time = llmin(transition_time, 1.f);
+			if (transition_time >= 1.f &&
+				fabsf(current_distance-target_distance)/current_distance > 0.01f)
+			{ //large shift happened, interpolate smoothly to new target distance
+				transition_time = 0.f;
+				start_distance = current_distance;
+			}
+			else if (transition_time < 1.f)
+			{ //currently in a transition, continue interpolating
+				transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds;
+				transition_time = llmin(transition_time, 1.f);
 
-					F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f;
-					current_distance = start_distance + (target_distance-start_distance)*t;
-				}
-				else
-				{ //small or no change, just snap to target distance
-					current_distance = target_distance;
-				}
+				F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f;
+				current_distance = start_distance + (target_distance-start_distance)*t;
+			}
+			else
+			{ //small or no change, just snap to target distance
+				current_distance = target_distance;
+			}
 
-				//convert to mm
-				F32 subject_distance = current_distance*1000.f;
-				F32 fnumber = CameraFNumber;
-				F32 default_focal_length = CameraFocalLength;
+			//convert to mm
+			F32 subject_distance = current_distance*1000.f;
+			F32 fnumber = CameraFNumber;
+			F32 default_focal_length = CameraFocalLength;
 
-				F32 fov = LLViewerCamera::getInstance()->getView();
+			F32 fov = LLViewerCamera::getInstance()->getView();
 		
-				const F32 default_fov = CameraFieldOfView * F_PI/180.f;
-				//const F32 default_aspect_ratio = gSavedSettings.getF32("CameraAspectRatio");
+			const F32 default_fov = CameraFieldOfView * F_PI/180.f;
+			//const F32 default_aspect_ratio = gSavedSettings.getF32("CameraAspectRatio");
 		
-				//F32 aspect_ratio = (F32) mScreen.getWidth()/(F32)mScreen.getHeight();
+			//F32 aspect_ratio = (F32) mScreen.getWidth()/(F32)mScreen.getHeight();
 		
-				F32 dv = 2.f*default_focal_length * tanf(default_fov/2.f);
-				//F32 dh = 2.f*default_focal_length * tanf(default_fov*default_aspect_ratio/2.f);
+			F32 dv = 2.f*default_focal_length * tanf(default_fov/2.f);
+			//F32 dh = 2.f*default_focal_length * tanf(default_fov*default_aspect_ratio/2.f);
 
-				F32 focal_length = dv/(2*tanf(fov/2.f));
+			F32 focal_length = dv/(2*tanf(fov/2.f));
 		 
-				//F32 tan_pixel_angle = tanf(LLDrawable::sCurPixelAngle);
+			//F32 tan_pixel_angle = tanf(LLDrawable::sCurPixelAngle);
 	
-				// from wikipedia -- c = |s2-s1|/s2 * f^2/(N(S1-f))
-				// where	 N = fnumber
-				//			 s2 = dot distance
-				//			 s1 = subject distance
-				//			 f = focal length
-				//	
-
-				F32 blur_constant = focal_length*focal_length/(fnumber*(subject_distance-focal_length));
-				blur_constant /= 1000.f; //convert to meters for shader
-				F32 magnification = focal_length/(subject_distance-focal_length);
-
-				{ //build diffuse+bloom+CoF
-					mDeferredLight.bindTarget();
-					shader = &gDeferredCoFProgram;
+			// from wikipedia -- c = |s2-s1|/s2 * f^2/(N(S1-f))
+			// where	 N = fnumber
+			//			 s2 = dot distance
+			//			 s1 = subject distance
+			//			 f = focal length
+			//	
 
-					bindDeferredShader(*shader);
+			F32 blur_constant = focal_length*focal_length/(fnumber*(subject_distance-focal_length));
+			blur_constant /= 1000.f; //convert to meters for shader
+			F32 magnification = focal_length/(subject_distance-focal_length);
 
-					S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
-					if (channel > -1)
-					{
-						mScreen.bindTexture(0, channel);
-					}
+			{ //build diffuse+bloom+CoF
+				mDeferredLight.bindTarget();
+				shader = &gDeferredCoFProgram;
 
-					if (multisample)
-					{ //bloom has already been added, bind black
-						channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
-						if (channel > -1)
-						{
-							gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
-						}
-					}
-				
-					shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f);
-					shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
-					shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
-					shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
-					shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
-
-					gGL.begin(LLRender::TRIANGLE_STRIP);
-					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-					gGL.vertex2f(-1,-1);
-		
-					gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-					gGL.vertex2f(-1,3);
-		
-					gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-					gGL.vertex2f(3,-1);
-		
-					gGL.end();
+				bindDeferredShader(*shader);
 
-					unbindDeferredShader(*shader);
-					mDeferredLight.flush();
+				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+				if (channel > -1)
+				{
+					mScreen.bindTexture(0, channel);
 				}
 
-				{ //perform DoF sampling at half-res (preserve alpha channel)
-					mScreen.bindTarget();
-					glViewport(0,0,mScreen.getWidth()/2, mScreen.getHeight()/2);
-					gGL.setColorMask(true, false);
-
-					shader = &gDeferredPostProgram;
-					bindDeferredShader(*shader);
-					S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
-					if (channel > -1)
-					{
-						mDeferredLight.bindTexture(0, channel);
-					}
-
-					shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+				shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f);
+				shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant);
+				shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
+				shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
+				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
 
-					gGL.begin(LLRender::TRIANGLE_STRIP);
-					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-					gGL.vertex2f(-1,-1);
+				gGL.begin(LLRender::TRIANGLE_STRIP);
+				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+				gGL.vertex2f(-1,-1);
 		
-					gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-					gGL.vertex2f(-1,3);
+				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+				gGL.vertex2f(-1,3);
 		
-					gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-					gGL.vertex2f(3,-1);
+				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+				gGL.vertex2f(3,-1);
 		
-					gGL.end();
+				gGL.end();
 
-					unbindDeferredShader(*shader);
-					mScreen.flush();
-					gGL.setColorMask(true, true);
-				}
+				unbindDeferredShader(*shader);
+				mDeferredLight.flush();
+			}
 
-				{ //combine result based on alpha
-					shader = &gDeferredDoFCombineProgram;
-					bindDeferredShader(*shader);
-					glViewport(0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
-					S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
-					if (channel > -1)
-					{
-						mScreen.bindTexture(0, channel);
-					}
+			{ //perform DoF sampling at half-res (preserve alpha channel)
+				mScreen.bindTarget();
+				glViewport(0,0,mScreen.getWidth()/2, mScreen.getHeight()/2);
+				gGL.setColorMask(true, false);
+
+				shader = &gDeferredPostProgram;
+				bindDeferredShader(*shader);
+				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
+				if (channel > -1)
+				{
+					mDeferredLight.bindTexture(0, channel);
+				}
 
-					shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
 
-					gGL.begin(LLRender::TRIANGLE_STRIP);
-					gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-					gGL.vertex2f(-1,-1);
+				gGL.begin(LLRender::TRIANGLE_STRIP);
+				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+				gGL.vertex2f(-1,-1);
 		
-					gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
-					gGL.vertex2f(-1,3);
+				gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+				gGL.vertex2f(-1,3);
 		
-					gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
-					gGL.vertex2f(3,-1);
+				gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+				gGL.vertex2f(3,-1);
 		
-					gGL.end();
+				gGL.end();
 
-					unbindDeferredShader(*shader);
-				}
+				unbindDeferredShader(*shader);
+				mScreen.flush();
+				gGL.setColorMask(true, true);
 			}
-			else
-			{
-				bindDeferredShader(*shader);
+	
+			{ //combine result based on alpha
+				if (multisample)
+				{
+					mDeferredLight.bindTarget();
+				}
 
+				shader = &gDeferredDoFCombineProgram;
+				bindDeferredShader(*shader);
+				glViewport(0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
 				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
 				if (channel > -1)
 				{
 					mScreen.bindTexture(0, channel);
 				}
 
-				if (multisample)
-				{ //bloom has already been added, bind black
-					channel = shader->enableTexture(LLShaderMgr::DEFERRED_BLOOM);
-					if (channel > -1)
-					{
-						gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sBlackImagep);
-					}
-				}
-				
+				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+
 				gGL.begin(LLRender::TRIANGLE_STRIP);
 				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
 				gGL.vertex2f(-1,-1);
@@ -6731,7 +6622,107 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				gGL.end();
 
 				unbindDeferredShader(*shader);
+
+				if (multisample)
+				{
+					mDeferredLight.flush();
+				}
+			}
+		}
+		else
+		{
+			if (multisample)
+			{
+				mDeferredLight.bindTarget();
 			}
+			LLGLSLShader* shader = &gDeferredPostNoDoFProgram;
+			
+			bindDeferredShader(*shader);
+							
+			S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
+			if (channel > -1)
+			{
+				mScreen.bindTexture(0, channel);
+			}
+
+			gGL.begin(LLRender::TRIANGLE_STRIP);
+			gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
+			gGL.vertex2f(-1,-1);
+		
+			gGL.texCoord2f(tc1.mV[0], tc2.mV[1]);
+			gGL.vertex2f(-1,3);
+		
+			gGL.texCoord2f(tc2.mV[0], tc1.mV[1]);
+			gGL.vertex2f(3,-1);
+		
+			gGL.end();
+
+			unbindDeferredShader(*shader);
+
+			if (multisample)
+			{
+				mDeferredLight.flush();
+			}
+		}
+
+		if (multisample)
+		{
+			//bake out texture2D with RGBL for FXAA shader
+			mFXAABuffer.bindTarget();
+			
+			S32 width = mScreen.getWidth();
+			S32 height = mScreen.getHeight();
+			glViewport(0, 0, width, height);
+
+			LLGLSLShader* shader = &gGlowCombineFXAAProgram;
+
+			shader->bind();
+			shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, width, height);
+
+			S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
+			if (channel > -1)
+			{
+				mDeferredLight.bindTexture(0, channel);
+			}
+						
+			gGL.begin(LLRender::TRIANGLE_STRIP);
+			gGL.vertex2f(-1,-1);
+			gGL.vertex2f(-1,3);
+			gGL.vertex2f(3,-1);
+			gGL.end();
+
+			gGL.flush();
+
+			shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage());
+			shader->unbind();
+			
+			mFXAABuffer.flush();
+
+			shader = &gFXAAProgram;
+			shader->bind();
+
+			channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage());
+			if (channel > -1)
+			{
+				mFXAABuffer.bindTexture(0, channel);
+				gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
+			}
+						
+			F32 scale_x = (F32) width/mFXAABuffer.getWidth();
+			F32 scale_y = (F32) height/mFXAABuffer.getHeight();
+			shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y);
+			shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f/width*scale_x, 1.f/height*scale_y);
+			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y);
+			shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y);
+			
+			gGL.begin(LLRender::TRIANGLE_STRIP);
+			gGL.vertex2f(-1,-1);
+			gGL.vertex2f(-1,3);
+			gGL.vertex2f(3,-1);
+			gGL.end();
+
+			gGL.flush();
+			shader->unbind();
 		}
 	}
 	else
-- 
GitLab


From 8c8edbbaeb68d82e1653e92dd7940ba0439777f2 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 7 Nov 2011 13:04:30 -0600
Subject: [PATCH 166/933] SH-2546 Fix for black water under terrain (use vec3
 instead of float for vary_AtmosAttenuation

---
 .../shaders/class1/windlight/atmosphericsVarsWaterV.glsl     | 2 --
 .../shaders/class2/windlight/atmosphericsVarsWaterF.glsl     | 5 ++---
 .../shaders/class2/windlight/atmosphericsVarsWaterV.glsl     | 4 ++--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl
index ef34c5c8538..8afcc20f6d1 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl
@@ -25,7 +25,6 @@
  
  
 VARYING vec3 vary_PositionEye;
-VARYING float fog_depth;
 
 vec3 getPositionEye()
 {
@@ -35,5 +34,4 @@ vec3 getPositionEye()
 void setPositionEye(vec3 v)
 {
 	vary_PositionEye = v;
-	fog_depth = v.z;
 }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
index 23046f990da..163ef264446 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
@@ -24,9 +24,8 @@
  */
  
 VARYING vec3 vary_PositionEye;
-VARYING vec3 vary_SunlitColor;
 VARYING vec3 vary_AdditiveColor;
-VARYING float vary_AtmosAttenuation;
+VARYING vec3 vary_AtmosAttenuation;
 
 vec3 getSunlitColor()
 {
@@ -42,7 +41,7 @@ vec3 getAdditiveColor()
 }
 vec3 getAtmosAttenuation()
 {
-	return vec3(vary_AtmosAttenuation);
+	return vary_AtmosAttenuation;
 }
 vec3 getPositionEye()
 {
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
index 279c4dd9815..553f6752e63 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
@@ -25,7 +25,7 @@
  
 VARYING vec3 vary_PositionEye;
 VARYING vec3 vary_AdditiveColor;
-VARYING float vary_AtmosAttenuation;
+VARYING vec3 vary_AtmosAttenuation;
 
 vec3 atmos_attenuation;
 vec3 sunlit_color;
@@ -77,5 +77,5 @@ void setAdditiveColor(vec3 v)
 void setAtmosAttenuation(vec3 v)
 {
 	atmos_attenuation = v;
-	vary_AtmosAttenuation = v.r;
+	vary_AtmosAttenuation = v;
 }
-- 
GitLab


From 92909dae8011400c50f89d88d712398f03d6db0a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 7 Nov 2011 15:39:32 -0600
Subject: [PATCH 167/933] SH-2652 For for screen going white when enabling
 anti-aliasing.

---
 indra/newview/pipeline.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 59e6c3cf07e..171bd2fa71a 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -656,6 +656,7 @@ void LLPipeline::allocatePhysicsBuffer()
 
 void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 {
+	refreshCachedSettings();
 	U32 samples = gGLManager.getNumFBOFSAASamples(RenderFSAASamples);
 
 	//try to allocate screen buffers at requested resolution and samples
-- 
GitLab


From 1bd09e2e42fbde3f00be2577b719bd172b4c9496 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 7 Nov 2011 16:46:58 -0600
Subject: [PATCH 168/933] SH-2634 Fix for land overlay not showing colors

---
 .../app_settings/shaders/class1/interface/highlightF.glsl     | 4 ++--
 indra/newview/lldrawpoolterrain.cpp                           | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index ecbc30f05ff..574adeb50c4 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -27,12 +27,12 @@
 out vec4 gl_FragColor;
 #endif
 
-uniform vec4 color;
+uniform vec4 highlight_color;
 uniform sampler2D diffuseMap;
 
 VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
+	gl_FragColor = highlight_color*texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 3e9d30283a6..addb18a1d5b 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -244,8 +244,9 @@ void LLDrawPoolTerrain::render(S32 pass)
 		{ //use fullbright shader for highlighting
 			LLGLSLShader* old_shader = sShader;
 			sShader->unbind();
-			sShader = &gObjectFullbrightNonIndexedProgram;
+			sShader = &gHighlightProgram;
 			sShader->bind();
+			sShader->uniform4f(LLShaderMgr::HIGHLIGHT_COLOR, 1,1,1,1);
 			LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
 			glPolygonOffset(-1.0f, -1.0f);
 			renderOwnership();
-- 
GitLab


From 428b74f14bd3763a6209d6a2132a8d7977958902 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 8 Nov 2011 13:11:29 -0600
Subject: [PATCH 169/933] SH-2652 Fix for black bands in high-res normal maps
 (break normal map generation up into tiles to handle the case where a normal
 map is higher resolution than the current window)

---
 indra/newview/lldrawpoolbump.cpp | 60 +++++++++++++++++++++++++-------
 1 file changed, 48 insertions(+), 12 deletions(-)

diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 7b9fb2b34bb..b696b90d847 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1363,6 +1363,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 				{
 					LLFastTimer t(FTM_BUMP_SOURCE_GEN_NORMAL);
 					gPipeline.mScreen.bindTarget();
+					
 					LLGLDepthTest depth(GL_FALSE);
 					LLGLDisable cull(GL_CULL_FACE);
 					LLGLDisable blend(GL_BLEND);
@@ -1377,22 +1378,57 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 
 					gGL.getTexUnit(0)->bind(bump);
 					
-					gGL.begin(LLRender::TRIANGLE_STRIP);
+					S32 width = bump->getWidth();
+					S32 height = bump->getHeight();
+
+					S32 screen_width = gPipeline.mScreen.getWidth();
+					S32 screen_height = gPipeline.mScreen.getHeight();
+
+					glViewport(0, 0, screen_width, screen_height);
+
+					for (S32 left = 0; left < width; left += screen_width)
+					{
+						S32 right = left + screen_width;
+						right = llmin(right, width);
+						
+						F32 left_tc = (F32) left/ width;
+						F32 right_tc = (F32) right/width;
+
+						for (S32 bottom = 0; bottom < height; bottom += screen_height)
+						{
+							S32 top = bottom+screen_height;
+							top = llmin(top, height);
+
+							F32 bottom_tc = (F32) bottom/height;
+							F32 top_tc = (F32)(bottom+screen_height)/height;
+							top_tc = llmin(top_tc, 1.f);
 
-					gGL.texCoord2f(0, 0);
-					gGL.vertex2f(0, 0);
-					gGL.texCoord2f(0, 1);
-					gGL.vertex2f(0, v.mV[1]);
-					gGL.texCoord2f(1, 0);
-					gGL.vertex2f(v.mV[0], 0);
-					gGL.texCoord2f(1, 1);
-					gGL.vertex2f(v.mV[0], v.mV[1]);
+							F32 screen_right = (F32) (right-left)/screen_width;
+							F32 screen_top = (F32) (top-bottom)/screen_height;
 
-					gGL.end();
+							gGL.begin(LLRender::TRIANGLE_STRIP);
+							gGL.texCoord2f(left_tc, bottom_tc);
+							gGL.vertex2f(0, 0);
 
-					gGL.flush();
+							gGL.texCoord2f(left_tc, top_tc);
+							gGL.vertex2f(0, screen_top);
 
-					glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, bump->getWidth(), bump->getHeight());
+							gGL.texCoord2f(right_tc, bottom_tc);
+							gGL.vertex2f(screen_right, 0);
+
+							gGL.texCoord2f(right_tc, top_tc);
+							gGL.vertex2f(screen_right, screen_top);
+
+							gGL.end();
+
+							gGL.flush();
+
+							S32 w = right-left;
+							S32 h = top-bottom;
+
+							glCopyTexSubImage2D(GL_TEXTURE_2D, 0, left, bottom, 0, 0, w, h);
+						}
+					}
 
 					glGenerateMipmap(GL_TEXTURE_2D);
 
-- 
GitLab


From 3aaaae15034b1c0e3099662023bc90d5e447d1ac Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 8 Nov 2011 15:23:56 -0500
Subject: [PATCH 170/933] STORM-591 Audio fading Hopefully fix error in
 llvieweraudio.h that caused mac and linux compile failure

---
 indra/newview/llvieweraudio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index 316d7b32d2b..1663f77f4a7 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -59,7 +59,7 @@ class LLViewerAudio : public LLSingleton<LLViewerAudio>
 	void startInternetStreamWithAutoFade(std::string streamURI);
 	void stopInternetStreamWithAutoFade();
 	
-	bool LLViewerAudio::onIdleUpdate();
+	bool onIdleUpdate();
 
 	EFadeState getFadeState() { return mFadeState; }
 	bool isDone() { return mDone; };
-- 
GitLab


From da092a06cf42902de4f5a042fd0b314b34e4392d Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 8 Nov 2011 14:37:50 -0600
Subject: [PATCH 171/933] SH-2608 Fix for debug beacons not rendering properly.

---
 indra/newview/pipeline.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 171bd2fa71a..49f83fdb0d6 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4250,8 +4250,16 @@ void LLPipeline::renderDebug()
 
 	bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
 
+	
 	if (!hud_only && !mDebugBlips.empty())
 	{ //render debug blips
+		if (LLGLSLShader::sNoFixedFunction)
+		{
+			gUIProgram.bind();
+		}
+
+		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep, true);
+
 		glPointSize(8.f);
 		LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
 
-- 
GitLab


From ef8bdb5d95ebd869279ee4bb0510d54e51ab747f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 8 Nov 2011 15:15:58 -0600
Subject: [PATCH 172/933] SH-2507 Fix for crash when rendering axes
 (develop->render->show axes)

---
 indra/newview/llviewerdisplay.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 86102e9a150..3f0b5bf3fb9 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1341,12 +1341,6 @@ void render_ui_3d()
 
 	// Debugging stuff goes before the UI.
 
-	// Coordinate axes
-	if (gSavedSettings.getBOOL("ShowAxes"))
-	{
-		draw_axes();
-	}
-
 	stop_glerror();
 	
 	if (LLGLSLShader::sNoFixedFunction)
@@ -1354,6 +1348,12 @@ void render_ui_3d()
 		gUIProgram.bind();
 	}
 
+	// Coordinate axes
+	if (gSavedSettings.getBOOL("ShowAxes"))
+	{
+		draw_axes();
+	}
+
 	gViewerWindow->renderSelections(FALSE, FALSE, TRUE); // Non HUD call in render_hud_elements
 	stop_glerror();
 }
-- 
GitLab


From b6858df0dd9fa06ec8fa56c5ba63925a790b4811 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 8 Nov 2011 13:47:08 -0800
Subject: [PATCH 173/933] LLHandle<Derived> is now implicitly convertable to
 LLHandle<Base> and LLHandle<Base> can be downcast to LLHandle<Derived> using
 the LLHandleProvider mixin

---
 indra/llui/llbutton.cpp           |  2 +-
 indra/llui/llfloater.cpp          | 22 ++++------
 indra/llui/llfloater.h            | 11 +----
 indra/llui/llhandle.h             | 67 +++++++++++++++++++------------
 indra/llui/llmenugl.h             |  2 +-
 indra/llui/llpanel.cpp            |  2 -
 indra/llui/llpanel.h              |  3 +-
 indra/llui/lluictrl.cpp           | 11 +++--
 indra/llui/lluictrl.h             |  3 +-
 indra/llui/llview.h               |  9 +++--
 indra/newview/llfloatercamera.cpp |  2 +-
 indra/newview/llnavigationbar.cpp |  2 +-
 indra/newview/lltoast.h           |  4 +-
 13 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 74b8885e1ff..a01dccc7ab5 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -115,7 +115,7 @@ LLButton::Params::Params()
 
 LLButton::LLButton(const LLButton::Params& p)
 :	LLUICtrl(p),
-	LLBadgeOwner(LLView::getHandle()),
+	LLBadgeOwner(getHandle()),
 	mMouseDownFrame(0),
 	mMouseHeldDownCount(0),
 	mBorderEnabled( FALSE ),
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 432397d3e9f..07d2e1ed5f0 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -111,7 +111,6 @@ LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] =
 
 LLMultiFloater* LLFloater::sHostp = NULL;
 BOOL			LLFloater::sQuitting = FALSE; // Flag to prevent storing visibility controls while quitting
-LLFloater::handle_map_t	LLFloater::sFloaterMap;
 
 LLFloaterView* gFloaterView = NULL;
 
@@ -268,7 +267,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 	mMinimizeSignal(NULL)
 //	mNotificationContext(NULL)
 {
-	mHandle.bind(this);
 //	mNotificationContext = new LLFloaterNotificationContext(getHandle());
 
 	// Clicks stop here.
@@ -323,9 +321,6 @@ void LLFloater::initFloater(const Params& p)
 	// Floaters are created in the invisible state	
 	setVisible(FALSE);
 
-	// add self to handle->floater map
-	sFloaterMap[mHandle] = this;
-
 	if (!getParent())
 	{
 		gFloaterView->addChild(this);
@@ -532,8 +527,6 @@ LLFloater::~LLFloater()
 	// correct, non-minimized positions.
 	setMinimized( FALSE );
 
-	sFloaterMap.erase(mHandle);
-
 	delete mDragHandle;
 	for (S32 i = 0; i < 4; i++) 
 	{
@@ -1038,7 +1031,9 @@ BOOL LLFloater::canSnapTo(const LLView* other_view)
 	if (other_view != getParent())
 	{
 		const LLFloater* other_floaterp = dynamic_cast<const LLFloater*>(other_view);		
-		if (other_floaterp && other_floaterp->getSnapTarget() == getHandle() && mDependents.find(other_floaterp->getHandle()) != mDependents.end())
+		if (other_floaterp 
+			&& other_floaterp->getSnapTarget() == getHandle() 
+			&& mDependents.find(other_floaterp->getHandle()) != mDependents.end())
 		{
 			// this is a dependent that is already snapped to us, so don't snap back to it
 			return FALSE;
@@ -1677,18 +1672,17 @@ void LLFloater::onClickHelp( LLFloater* self )
 LLFloater* LLFloater::getClosableFloaterFromFocus()
 {
 	LLFloater* focused_floater = NULL;
-
-	handle_map_iter_t iter;
-	for(iter = sFloaterMap.begin(); iter != sFloaterMap.end(); ++iter)
+	LLInstanceTracker<LLFloater>::instance_iter it = beginInstances();
+	LLInstanceTracker<LLFloater>::instance_iter end_it = endInstances();
+	for (; it != end_it; ++it)
 	{
-		focused_floater = iter->second;
-		if (focused_floater->hasFocus())
+		if (it->hasFocus())
 		{
 			break;
 		}
 	}
 
-	if (iter == sFloaterMap.end())
+	if (it == endInstances())
 	{
 		// nothing found, return
 		return NULL;
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 73e9c9e8310..b24ae1beb9c 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -83,7 +83,7 @@ namespace LLInitParam
 }
 
 
-class LLFloater : public LLPanel
+class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 {
 	friend class LLFloaterView;
 	friend class LLFloaterReg;
@@ -282,7 +282,7 @@ class LLFloater : public LLPanel
 	void			clearSnapTarget() { mSnappedTo.markDead(); }
 	LLHandle<LLFloater>	getSnapTarget() const { return mSnappedTo; }
 
-	LLHandle<LLFloater> getHandle() const { return mHandle; }
+	LLHandle<LLFloater> getHandle() const { return getDerivedHandle<LLFloater>(); }
 	const LLSD& 	getKey() { return mKey; }
 	virtual bool	matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); }
 	
@@ -460,16 +460,9 @@ class LLFloater : public LLPanel
 	typedef void(*click_callback)(LLFloater*);
 	static click_callback sButtonCallbacks[BUTTON_COUNT];
 
-	typedef std::map<LLHandle<LLFloater>, LLFloater*> handle_map_t;
-	typedef std::map<LLHandle<LLFloater>, LLFloater*>::iterator handle_map_iter_t;
-	static handle_map_t	sFloaterMap;
-
 	BOOL			mHasBeenDraggedWhileMinimized;
 	S32				mPreviousMinimizedBottom;
 	S32				mPreviousMinimizedLeft;
-
-//	LLFloaterNotificationContext* mNotificationContext;
-	LLRootHandle<LLFloater>		mHandle;	
 };
 
 
diff --git a/indra/llui/llhandle.h b/indra/llui/llhandle.h
index 8c000eee48c..c8fff72110e 100644
--- a/indra/llui/llhandle.h
+++ b/indra/llui/llhandle.h
@@ -28,17 +28,18 @@
 #define LLHANDLE_H
 
 #include "llpointer.h"
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/utility/enable_if.hpp>
 
-template <typename T>
 class LLTombStone : public LLRefCount
 {
 public:
-	LLTombStone(T* target = NULL) : mTarget(target) {}
+	LLTombStone(void* target = NULL) : mTarget(target) {}
 
-	void setTarget(T* target) { mTarget = target; }
-	T* getTarget() const { return mTarget; }
+	void setTarget(void* target) { mTarget = target; }
+	void* getTarget() const { return mTarget; }
 private:
-	T* mTarget;
+	mutable void* mTarget;
 };
 
 //	LLHandles are used to refer to objects whose lifetime you do not control or influence.  
@@ -53,13 +54,15 @@ class LLTombStone : public LLRefCount
 template <typename T>
 class LLHandle
 {
+	template <typename U> friend class LLHandle;
+	template <typename U> friend class LLHandleProvider;
 public:
 	LLHandle() : mTombStone(getDefaultTombStone()) {}
-	const LLHandle<T>& operator =(const LLHandle<T>& other)  
-	{ 
-		mTombStone = other.mTombStone;
-		return *this; 
-	}
+
+	template<typename U>
+	LLHandle(const LLHandle<U>& other, typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0)
+	: mTombStone(other.mTombStone)
+	{}
 
 	bool isDead() const 
 	{ 
@@ -73,7 +76,7 @@ class LLHandle
 
 	T* get() const
 	{
-		return mTombStone->getTarget();
+		return reinterpret_cast<T*>(mTombStone->getTarget());
 	}
 
 	friend bool operator== (const LLHandle<T>& lhs, const LLHandle<T>& rhs)
@@ -94,12 +97,13 @@ class LLHandle
 	}
 
 protected:
-	LLPointer<LLTombStone<T> > mTombStone;
+	LLPointer<LLTombStone> mTombStone;
 
 private:
-	static LLPointer<LLTombStone<T> >& getDefaultTombStone()
+	typedef T* pointer_t;
+	static LLPointer<LLTombStone>& getDefaultTombStone()
 	{
-		static LLPointer<LLTombStone<T> > sDefaultTombStone = new LLTombStone<T>;
+		static LLPointer<LLTombStone> sDefaultTombStone = new LLTombStone;
 		return sDefaultTombStone;
 	}
 };
@@ -108,23 +112,26 @@ template <typename T>
 class LLRootHandle : public LLHandle<T>
 {
 public:
+	typedef LLRootHandle<T> self_t;
+	typedef LLHandle<T> base_t;
+
 	LLRootHandle(T* object) { bind(object); }
 	LLRootHandle() {};
 	~LLRootHandle() { unbind(); }
 
-	// this is redundant, since a LLRootHandle *is* an LLHandle
-	LLHandle<T> getHandle() { return LLHandle<T>(*this); }
+	// this is redundant, since an LLRootHandle *is* an LLHandle
+	//LLHandle<T> getHandle() { return LLHandle<T>(*this); }
 
 	void bind(T* object) 
 	{ 
 		// unbind existing tombstone
 		if (LLHandle<T>::mTombStone.notNull())
 		{
-			if (LLHandle<T>::mTombStone->getTarget() == object) return;
+			if (LLHandle<T>::mTombStone->getTarget() == (void*)object) return;
 			LLHandle<T>::mTombStone->setTarget(NULL);
 		}
 		// tombstone reference counted, so no paired delete
-		LLHandle<T>::mTombStone = new LLTombStone<T>(object);
+		LLHandle<T>::mTombStone = new LLTombStone((void*)object);
 	}
 
 	void unbind() 
@@ -142,6 +149,15 @@ class LLRootHandle : public LLHandle<T>
 template <typename T>
 class LLHandleProvider
 {
+public:
+	LLHandle<T> getHandle() const
+	{ 
+		// perform lazy binding to avoid small tombstone allocations for handle
+		// providers whose handles are never referenced
+		mHandle.bind(static_cast<T*>(const_cast<LLHandleProvider<T>* >(this))); 
+		return mHandle; 
+	}
+
 protected:
 	typedef LLHandle<T> handle_type_t;
 	LLHandleProvider() 
@@ -149,16 +165,17 @@ class LLHandleProvider
 		// provided here to enforce T deriving from LLHandleProvider<T>
 	} 
 
-	LLHandle<T> getHandle() 
-	{ 
-		// perform lazy binding to avoid small tombstone allocations for handle
-		// providers whose handles are never referenced
-		mHandle.bind(static_cast<T*>(this)); 
-		return mHandle; 
+	template <typename U>
+	typename LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const
+	{
+		LLHandle<U> downcast_handle;
+		downcast_handle.mTombStone = mHandle.mTombStone;
+		return downcast_handle;
 	}
 
+
 private:
-	LLRootHandle<T> mHandle;
+	mutable LLRootHandle<T> mHandle;
 };
 
 #endif
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index bdae899933b..36f3ba34b9b 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -681,7 +681,7 @@ class LLContextMenu
 
 			BOOL	appendContextSubMenu(LLContextMenu *menu);
 
-			LLHandle<LLContextMenu> getHandle() { mHandle.bind(this); return mHandle; }
+			LLHandle<LLContextMenu> getHandle() { return getDerivedHandle<LLContextMenu>(); }
 
 protected:
 	BOOL						mHoveredAnyItem;
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index a45b617c2ec..00318cec6b0 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -122,8 +122,6 @@ LLPanel::LLPanel(const LLPanel::Params& p)
 	{
 		addBorder(p.border);
 	}
-	
-	mPanelHandle.bind(this);
 }
 
 LLPanel::~LLPanel()
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index ab1c87caffe..cd339382263 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -153,7 +153,7 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder
 	
 	void			setCtrlsEnabled(BOOL b);
 
-	LLHandle<LLPanel>	getHandle() const { return mPanelHandle; }
+	LLHandle<LLPanel>	getHandle() const { return getDerivedHandle<LLPanel>(); }
 
 	const LLCallbackMap::map_t& getFactoryMap() const { return mFactoryMap; }
 	
@@ -278,7 +278,6 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder
 	LLViewBorder*	mBorder;
 	LLButton*		mDefaultBtn;
 	LLUIString		mLabel;
-	LLRootHandle<LLPanel> mPanelHandle;
 
 	typedef std::map<std::string, std::string> ui_string_map_t;
 	ui_string_map_t	mUIStrings;
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 2fa260ded1e..b9c843e931c 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -118,7 +118,6 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel)
 	mDoubleClickSignal(NULL),
 	mTransparencyType(TT_DEFAULT)
 {
-	mUICtrlHandle.bind(this);
 }
 
 void LLUICtrl::initFromParams(const Params& p)
@@ -460,7 +459,7 @@ void LLUICtrl::setControlVariable(LLControlVariable* control)
 	if (control)
 	{
 		mControlVariable = control;
-		mControlConnection = mControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("value")));
+		mControlConnection = mControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("value")));
 		setValue(mControlVariable->getValue());
 	}
 }
@@ -491,7 +490,7 @@ void LLUICtrl::setEnabledControlVariable(LLControlVariable* control)
 	if (control)
 	{
 		mEnabledControlVariable = control;
-		mEnabledControlConnection = mEnabledControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("enabled")));
+		mEnabledControlConnection = mEnabledControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("enabled")));
 		setEnabled(mEnabledControlVariable->getValue().asBoolean());
 	}
 }
@@ -506,7 +505,7 @@ void LLUICtrl::setDisabledControlVariable(LLControlVariable* control)
 	if (control)
 	{
 		mDisabledControlVariable = control;
-		mDisabledControlConnection = mDisabledControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("disabled")));
+		mDisabledControlConnection = mDisabledControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("disabled")));
 		setEnabled(!(mDisabledControlVariable->getValue().asBoolean()));
 	}
 }
@@ -521,7 +520,7 @@ void LLUICtrl::setMakeVisibleControlVariable(LLControlVariable* control)
 	if (control)
 	{
 		mMakeVisibleControlVariable = control;
-		mMakeVisibleControlConnection = mMakeVisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("visible")));
+		mMakeVisibleControlConnection = mMakeVisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("visible")));
 		setVisible(mMakeVisibleControlVariable->getValue().asBoolean());
 	}
 }
@@ -536,7 +535,7 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control)
 	if (control)
 	{
 		mMakeInvisibleControlVariable = control;
-		mMakeInvisibleControlConnection = mMakeInvisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("invisible")));
+		mMakeInvisibleControlConnection = mMakeInvisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("invisible")));
 		setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean()));
 	}
 }
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index 3e055a9d062..fb2196bb164 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -223,7 +223,7 @@ class LLUICtrl
 	BOOL	focusLastItem(BOOL prefer_text_fields = FALSE);
 
 	// Non Virtuals
-	LLHandle<LLUICtrl> getUICtrlHandle() const { return mUICtrlHandle; }
+	LLHandle<LLUICtrl> getHandle() const { return getDerivedHandle<LLUICtrl>(); }
 	BOOL			getIsChrome() const;
 	
 	void			setTabStop( BOOL b );
@@ -313,7 +313,6 @@ class LLUICtrl
 	BOOL			mRequestsFront;
 	BOOL			mTabStop;
 	BOOL			mTentative;
-	LLRootHandle<LLUICtrl> mUICtrlHandle;
 
 	ETypeTransparency mTransparencyType;
 
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 08828e55e6a..13f118abecb 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -97,7 +97,11 @@ class LLViewDrawContext
 	static std::vector<LLViewDrawContext*> sDrawContextStack;
 };
 
-class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElement
+class LLView 
+:	public LLMouseHandler,			// handles mouse events
+	public LLFocusableElement,		// handles keyboard events
+	public LLMortician,				// lazy deletion
+	public LLHandleProvider<LLView>	// passes out weak references to self
 {
 public:
 	struct Follows : public LLInitParam::ChoiceBlock<Follows>
@@ -306,8 +310,6 @@ class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElem
 	void			popVisible()				{ setVisible(mLastVisible); }
 	BOOL			getLastVisible()	const	{ return mLastVisible; }
 
-	LLHandle<LLView>	getHandle()				{ mHandle.bind(this); return mHandle; }
-
 	U32			getFollows() const				{ return mReshapeFlags; }
 	BOOL		followsLeft() const				{ return mReshapeFlags & FOLLOWS_LEFT; }
 	BOOL		followsRight() const			{ return mReshapeFlags & FOLLOWS_RIGHT; }
@@ -606,7 +608,6 @@ class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElem
 	BOOL		mIsFocusRoot;
 	BOOL		mUseBoundingRect; // hit test against bounding rectangle that includes all child elements
 
-	LLRootHandle<LLView> mHandle;
 	BOOL		mLastVisible;
 
 	S32			mNextInsertionOrdinal;
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index b33dea4890f..8c2dd73bd94 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -346,7 +346,7 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val)
 	mCurrMode(CAMERA_CTRL_MODE_PAN),
 	mPrevMode(CAMERA_CTRL_MODE_PAN)
 {
-	LLHints::registerHintTarget("view_popup", LLView::getHandle());
+	LLHints::registerHintTarget("view_popup", getHandle());
 	mCommitCallbackRegistrar.add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2));
 }
 
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index fc264db5af9..12428681bd0 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -318,7 +318,7 @@ BOOL LLNavigationBar::postBuild()
 	LLTeleportHistory::getInstance()->setHistoryChangedCallback(
 			boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this));
 
-	LLHints::registerHintTarget("nav_bar", LLView::getHandle());
+	LLHints::registerHintTarget("nav_bar", getHandle());
 
 	return TRUE;
 }
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 242f786bf2e..380c2c391ab 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -196,7 +196,7 @@ class LLToast : public LLModalDialog
 
 	virtual S32	notifyParent(const LLSD& info);
 
-	LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; }
+	LLHandle<LLToast> getHandle() const { return getDerivedHandle<LLToast>(); }
 
 protected:
 	void updateTransparency();
@@ -215,7 +215,7 @@ class LLToast : public LLModalDialog
 	LLUUID				mSessionID;
 	LLNotificationPtr	mNotification;
 
-	LLRootHandle<LLToast>	mHandle;
+	//LLRootHandle<LLToast>	mHandle;
 		
 	LLPanel* mWrapperPanel;
 
-- 
GitLab


From 7e6e3d20f334547d8cea78e8e0b37106efebe028 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 8 Nov 2011 13:48:38 -0800
Subject: [PATCH 174/933] added Lazy modifier to params to support recursion
 ChoiceBlock can now derive from another param block Params with name/value
 support can be assigned directly in C++ code using param = "named_value"

---
 indra/llxuixml/llinitparam.h   | 426 +++++++++++++++++++++++++--------
 indra/llxuixml/llxuiparser.cpp | 258 +++++++++++++++-----
 2 files changed, 524 insertions(+), 160 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 183472450db..169a724bca3 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -51,7 +51,7 @@ namespace LLInitParam
 			return a == b;
 		}
     };
-    
+
 	// boost function types are not comparable
 	template<typename T>
 	struct ParamCompare<T, true>
@@ -74,6 +74,7 @@ namespace LLInitParam
 		static bool equals(const Flag& a, const Flag& b) { return false; }
 	};
 
+
 	// helper functions and classes
 	typedef ptrdiff_t param_handle_t;
 
@@ -82,8 +83,11 @@ namespace LLInitParam
 	template <typename T>
 	class TypeValues
 	{
+	private:
+		struct Inaccessable{};
 	public:
 		typedef std::map<std::string, T> value_name_map_t;
+		typedef Inaccessable name_t;
 
 		void setValueName(const std::string& key) {}
 		std::string getValueName() const { return ""; }
@@ -113,6 +117,7 @@ namespace LLInitParam
 	{
 	public:
 		typedef typename std::map<std::string, T> value_name_map_t;
+		typedef std::string name_t;
 
 		//TODO: cache key by index to save on param block size
 		void setValueName(const std::string& value_name) 
@@ -293,36 +298,7 @@ namespace LLInitParam
 		parser_inspect_func_map_t*	mParserInspectFuncs;
 	};
 
-	class BaseBlock;
-
-	class Param
-	{
-	public:
-		// public to allow choice blocks to clear provided flag on stale choices
-		void setProvided(bool is_provided) { mIsProvided = is_provided; }
-
-	protected:
-		bool anyProvided() const { return mIsProvided; }
-
-		Param(BaseBlock* enclosing_block);
-
-		// store pointer to enclosing block as offset to reduce space and allow for quick copying
-		BaseBlock& enclosingBlock() const
-		{ 
-			const U8* my_addr = reinterpret_cast<const U8*>(this);
-			// get address of enclosing BLOCK class using stored offset to enclosing BaseBlock class
-			return *const_cast<BaseBlock*>
-				(reinterpret_cast<const BaseBlock*>
-					(my_addr - (ptrdiff_t)(S32)mEnclosingBlockOffset));
-		}
-
-	private:
-		friend class BaseBlock;
-
-		U32		mEnclosingBlockOffset:31;
-		U32		mIsProvided:1;
-
-	};
+	class Param;
 
 	// various callbacks and constraints associated with an individual param
 	struct ParamDescriptor
@@ -390,12 +366,91 @@ namespace LLInitParam
 		all_params_list_t				mAllParams;				// all parameters, owns descriptors
 		size_t							mMaxParamOffset;
 		EInitializationState			mInitializationState;	// whether or not static block data has been initialized
-		BaseBlock*						mCurrentBlockPtr;		// pointer to block currently being constructed
+		class BaseBlock*				mCurrentBlockPtr;		// pointer to block currently being constructed
 	};
 
 	class BaseBlock
 	{
 	public:
+		//TODO: implement in terms of owned_ptr
+		template<typename T>
+		class Lazy
+		{
+		public:
+			Lazy()
+				: mPtr(NULL)
+			{}
+
+			~Lazy()
+			{
+				delete mPtr;
+			}
+
+			Lazy(const Lazy& other)
+			{
+				if (other.mPtr)
+				{
+					mPtr = new T(*other.mPtr);
+				}
+				else
+				{
+					mPtr = NULL;
+				}
+			}
+
+			Lazy<T>& operator = (const Lazy<T>& other)
+			{
+				if (other.mPtr)
+				{
+					mPtr = new T(*other.mPtr);
+				}
+				else
+				{
+					mPtr = NULL;
+				}
+				return *this;
+			}
+
+			bool empty() const
+			{
+				return mPtr == NULL;
+			}
+
+			void set(const T& other)
+			{
+				delete mPtr;
+				mPtr = new T(other);
+			}
+
+			const T& get() const
+			{
+				return ensureInstance();
+			}
+
+			T& get()
+			{
+				return ensureInstance();
+			}
+
+		private:
+			// lazily allocate an instance of T
+			T* ensureInstance() const
+			{
+				if (mPtr == NULL)
+				{
+					mPtr = new T();
+				}
+				return mPtr;
+			}
+
+		private:
+			// if you get a compilation error with this, that means you are using a forward declared struct for T
+			// unfortunately, the type traits we rely on don't work with forward declared typed
+			//static const int dummy = sizeof(T);
+
+			mutable T* mPtr;
+		};
+
 		// "Multiple" constraint types, put here in root class to avoid ambiguity during use
 		struct AnyAmount
 		{
@@ -511,6 +566,44 @@ namespace LLInitParam
 		const std::string& getParamName(const BlockDescriptor& block_data, const Param* paramp) const;
 	};
 
+	template<typename T>
+	struct ParamCompare<BaseBlock::Lazy<T>, false >
+	{
+		static bool equals(const BaseBlock::Lazy<T>& a, const BaseBlock::Lazy<T>& b) { return !a.empty() || !b.empty(); }
+	};
+
+		class Param
+	{
+	public:
+		void setProvided(bool is_provided = true)
+		{
+			mIsProvided = is_provided;
+			enclosingBlock().paramChanged(*this, is_provided);
+		}
+	protected:
+
+		bool anyProvided() const { return mIsProvided; }
+
+		Param(BaseBlock* enclosing_block);
+
+		// store pointer to enclosing block as offset to reduce space and allow for quick copying
+		BaseBlock& enclosingBlock() const
+		{ 
+			const U8* my_addr = reinterpret_cast<const U8*>(this);
+			// get address of enclosing BLOCK class using stored offset to enclosing BaseBlock class
+			return *const_cast<BaseBlock*>
+				(reinterpret_cast<const BaseBlock*>
+					(my_addr - (ptrdiff_t)(S32)mEnclosingBlockOffset));
+		}
+
+	private:
+		friend class BaseBlock;
+
+		U32		mEnclosingBlockOffset:31;
+		U32		mIsProvided:1;
+
+	};
+
 	// these templates allow us to distinguish between template parameters
 	// that derive from BaseBlock and those that don't
 	template<typename T, typename Void = void>
@@ -530,6 +623,7 @@ namespace LLInitParam
 	{
 	public:
 		typedef const T&							value_assignment_t;
+		typedef ParamValue<T, NAME_VALUE_LOOKUP, VALUE_IS_BLOCK>	self_t;
 
 		ParamValue(): mValue() {}
 		ParamValue(value_assignment_t other) : mValue(other) {}
@@ -559,6 +653,25 @@ namespace LLInitParam
 			return mValue;
 		}
 
+		void operator ()(const typename NAME_VALUE_LOOKUP::name_t& name)
+		{
+			*this = name;
+		}
+
+		self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
+		{
+			if (NAME_VALUE_LOOKUP::getValueFromName(name, mValue))
+			{
+				setValueName(name);
+			}
+
+			return *this;
+		}
+
+		self_t& operator =(const self_t& other)
+		{
+			mValue = other.mValue;
+		}
 
 	private:
 		T mValue;
@@ -571,17 +684,16 @@ namespace LLInitParam
 	{
 	public:
 		typedef const T&							value_assignment_t;
+		typedef ParamValue<T, NAME_VALUE_LOOKUP, true>	self_t;
 
 		ParamValue() 
 		:	T(),
-			mKeyVersion(0),
 			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	T(other),
-			mKeyVersion(0),
 			mValidatedVersion(-1),
 			mValidated(false)
 		{}
@@ -611,8 +723,25 @@ namespace LLInitParam
 			return *this;
 		}
 
-		S32 			mKeyVersion;
+		void operator ()(const typename NAME_VALUE_LOOKUP::name_t& name)
+		{
+			*this = name;
+		}
 
+		self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
+		{
+			if (NAME_VALUE_LOOKUP::getValueFromName(name, mValue))
+			{
+				setValueName(name);
+			}
+
+			return *this;
+		}
+
+		self_t& operator =(const self_t& other)
+		{
+			*(static_cast<T*>(this)) = other;
+		}
 	protected:
 		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
@@ -671,8 +800,7 @@ namespace LLInitParam
 				if (parser.readValue(typed_param.getValue()))
 				{
 					typed_param.clearValueName();
-					typed_param.setProvided(true);
-					typed_param.enclosingBlock().paramChanged(param, true);
+					typed_param.setProvided();
 					return true;
 				}
 				
@@ -687,8 +815,7 @@ namespace LLInitParam
 						if (name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
 						{
 							typed_param.setValueName(name);
-							typed_param.setProvided(true);
-							typed_param.enclosingBlock().paramChanged(param, true);
+							typed_param.setProvided();
 							return true;
 						}
 
@@ -744,12 +871,22 @@ namespace LLInitParam
 			}
 		}
 
+		self_t& operator =(typename const name_value_lookup_t::name_t& name)
+		{
+			if (name_value_lookup_t::getValueFromName(name, getValue()))
+			{
+				setValueName(name);
+				setProvided();
+			}
+
+			return *this;
+		}
+
 		void set(value_assignment_t val, bool flag_as_provided = true)
 		{
 			setValue(val);
 			param_value_t::clearValueName();
 			setProvided(flag_as_provided);
-			Param::enclosingBlock().paramChanged(*this, flag_as_provided);
 		}
 
 	protected:
@@ -808,8 +945,7 @@ namespace LLInitParam
 			if(typed_param.deserializeBlock(parser, name_stack_range, new_name))
 			{
 				typed_param.clearValueName();
-				typed_param.enclosingBlock().paramChanged(param, true);
-				typed_param.setProvided(true);
+				typed_param.setProvided();
 				return true;
 			}
 
@@ -822,10 +958,8 @@ namespace LLInitParam
 					// try to parse a per type named value
 					if (name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
 					{
-						typed_param.enclosingBlock().paramChanged(param, true);
 						typed_param.setValueName(name);
-						typed_param.setProvided(true);
-						typed_param.mKeyVersion = typed_param.getLastChangeVersion();
+						typed_param.setProvided();
 						return true;
 					}
 
@@ -845,7 +979,7 @@ namespace LLInitParam
 			}
 
 			std::string key = typed_param.getValueName();
-			if (!key.empty() && typed_param.mKeyVersion == typed_param.getLastChangeVersion())
+			if (!key.empty())
 			{
 				if (!parser.writeValue(key, name_stack))
 				{
@@ -888,19 +1022,33 @@ namespace LLInitParam
 			// next call to isProvided() will update provision status based on validity
 			param_value_t::mValidatedVersion = -1;
 			setProvided(flag_as_provided);
-			Param::enclosingBlock().paramChanged(*this, flag_as_provided);
+		}
+
+		self_t& operator =(typename const name_value_lookup_t::name_t& name)
+		{
+			if (name_value_lookup_t::getValueFromName(name, getValue()))
+			{
+				setValueName(name);
+				setProvided();
+			}
+
+			return *this;
 		}
 
 		// propagate changed status up to enclosing block
 		/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
 		{ 
 			param_value_t::paramChanged(changed_param, user_provided);
-			Param::enclosingBlock().paramChanged(*this, user_provided);
 			if (user_provided)
 			{
 				// a child param has been explicitly changed
 				// so *some* aspect of this block is now provided
-				setProvided(true);
+				setProvided();
+				param_value_t::clearValueName();
+			}
+			else
+			{
+				Param::enclosingBlock().paramChanged(*this, user_provided);
 			}
 		}
 
@@ -917,7 +1065,6 @@ namespace LLInitParam
 				{
 					dst_typed_param.clearValueName();
 					dst_typed_param.setProvided(true);
-					dst_typed_param.enclosingBlock().paramChanged(dst_typed_param, true);
 					return true;
 				}
 			}
@@ -1004,7 +1151,7 @@ namespace LLInitParam
 				it != end_it;
 				++it)
 			{
-				std::string key = it->getValue();
+				std::string key = it->getValueName();
 				name_stack.back().second = true;
 
 				if(key.empty())
@@ -1013,7 +1160,7 @@ namespace LLInitParam
 					bool value_written = parser.writeValue(*it, name_stack);
 					if (!value_written)
 					{
-						std::string calculated_key = it->calcValueName(key);
+						std::string calculated_key = it->calcValueName(it->getValue());
 						if (!parser.writeValue(calculated_key, name_stack))
 						{
 							break;
@@ -1043,22 +1190,31 @@ namespace LLInitParam
 		{
 			mValues = val;
 			setProvided(flag_as_provided);
-			Param::enclosingBlock().paramChanged(*this, flag_as_provided);
 		}
 
-		value_t& add()
+		param_value_t& add()
 		{
 			mValues.push_back(param_value_t(value_t()));
-			setProvided(true);
-			Param::enclosingBlock().paramChanged(*this, true);
+			Param::setProvided();
 			return mValues.back();
 		}
 
 		void add(const value_t& item)
 		{
 			mValues.push_back(param_value_t(item));
-			setProvided(true);
-			Param::enclosingBlock().paramChanged(*this, true);
+			setProvided();
+		}
+
+		void add(typename const name_value_lookup_t::name_t& name)
+		{
+			value_t value;
+
+			// try to parse a per type named value
+			if (name_value_lookup_t::getValueFromName(name, value))
+			{
+				add(value);
+				mValues.back().setValueName(name);
+			}
 		}
 
 		// implicit conversion
@@ -1099,8 +1255,7 @@ namespace LLInitParam
 
 			if (src_typed_param.begin() != src_typed_param.end())
 			{
-				dst_typed_param.setProvided(true);
-				dst_typed_param.enclosingBlock().paramChanged(dst_typed_param, true);
+				dst_typed_param.setProvided();
 			}
 			return true;
 		}
@@ -1116,7 +1271,7 @@ namespace LLInitParam
 	public:
 		typedef TypedParam<VALUE_TYPE, NAME_VALUE_LOOKUP, true, true>	self_t;
 		typedef ParamValue<VALUE_TYPE, NAME_VALUE_LOOKUP>				param_value_t;
-		typedef typename std::vector<param_value_t>				container_t;
+		typedef typename std::vector<param_value_t>						container_t;
 		typedef const container_t&										value_assignment_t;
 		typedef VALUE_TYPE												value_t;
 		typedef NAME_VALUE_LOOKUP										name_value_lookup_t;
@@ -1158,8 +1313,7 @@ namespace LLInitParam
 			// attempt to parse block...
 			if(value.deserializeBlock(parser, name_stack_range, new_name))
 			{
-				typed_param.enclosingBlock().paramChanged(param, true);
-				typed_param.setProvided(true);
+				typed_param.setProvided();
 				return true;
 			}
 			else if(name_value_lookup_t::valueNamesExist())
@@ -1172,9 +1326,7 @@ namespace LLInitParam
 					if (name_value_lookup_t::getValueFromName(name, value.getValue()))
 					{
 						typed_param.mValues.back().setValueName(name);
-						typed_param.mValues.back().mKeyVersion = value.getLastChangeVersion();
-						typed_param.enclosingBlock().paramChanged(param, true);
-						typed_param.setProvided(true);
+						typed_param.setProvided();
 						return true;
 					}
 
@@ -1201,7 +1353,7 @@ namespace LLInitParam
 				name_stack.back().second = true;
 
 				std::string key = it->getValueName();
-				if (!key.empty() && it->mKeyVersion == it->getLastChangeVersion())
+				if (!key.empty())
 				{
 					parser.writeValue(key, name_stack);
 				}
@@ -1224,22 +1376,31 @@ namespace LLInitParam
 		{
 			mValues = val;
 			setProvided(flag_as_provided);
-			Param::enclosingBlock().paramChanged(*this, flag_as_provided);
 		}
 
-		value_t& add()
+		param_value_t& add()
 		{
 			mValues.push_back(value_t());
-			setProvided(true);
-			Param::enclosingBlock().paramChanged(*this, true);
+			setProvided();
 			return mValues.back();
 		}
 
 		void add(const value_t& item)
 		{
 			mValues.push_back(item);
-			setProvided(true);
-			Param::enclosingBlock().paramChanged(*this, true);
+			setProvided();
+		}
+
+		void add(typename const name_value_lookup_t::name_t& name)
+		{
+			value_t value;
+
+			// try to parse a per type named value
+			if (name_value_lookup_t::getValueFromName(name, value))
+			{
+				add(value);
+				mValues.back().setValueName(name);
+			}
 		}
 
 		// implicit conversion
@@ -1288,8 +1449,7 @@ namespace LLInitParam
 
 			if (src_typed_param.begin() != src_typed_param.end())
 			{
-				dst_typed_param.setProvided(true);
-				dst_typed_param.enclosingBlock().paramChanged(dst_typed_param, true);
+				dst_typed_param.setProvided();
 			}
 
 			return true;
@@ -1298,24 +1458,25 @@ namespace LLInitParam
 		container_t			mValues;
 	};
 
-	template <typename DERIVED_BLOCK>
-	class ChoiceBlock : public BaseBlock
+	template <typename DERIVED_BLOCK, typename BASE_BLOCK = BaseBlock>
+	class ChoiceBlock : public BASE_BLOCK
 	{
-		typedef ChoiceBlock<DERIVED_BLOCK>	self_t;
-		typedef ChoiceBlock<DERIVED_BLOCK>	enclosing_block_t;
+		typedef ChoiceBlock<DERIVED_BLOCK, BASE_BLOCK>	self_t;
+		typedef ChoiceBlock<DERIVED_BLOCK, BASE_BLOCK>	enclosing_block_t;
+		typedef BASE_BLOCK								base_block_t;
 		
 		LOG_CLASS(self_t);
 	public:
 		// take all provided params from other and apply to self
 		bool overwriteFrom(const self_t& other)
 		{
-			return mergeBlock(selfBlockDescriptor(), other, true);
+			return static_cast<DERIVED_BLOCK*>(this)->mergeBlock(selfBlockDescriptor(), other, true);
 		}
 
 		// take all provided params that are not already provided, and apply to self
 		bool fillFrom(const self_t& other)
 		{
-			return mergeBlock(selfBlockDescriptor(), other, false);
+			return static_cast<DERIVED_BLOCK*>(this)->mergeBlock(selfBlockDescriptor(), other, false);
 		}
 
 		bool mergeBlockParam(bool source_provided, bool dest_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite)
@@ -1333,25 +1494,25 @@ namespace LLInitParam
 		bool mergeBlock(BlockDescriptor& block_data, const self_t& other, bool overwrite)
 		{
 			mCurChoice = other.mCurChoice;
-			return BaseBlock::mergeBlock(selfBlockDescriptor(), other, overwrite);
+			return base_block_t::mergeBlock(selfBlockDescriptor(), other, overwrite);
 		}
 
 		// clear out old choice when param has changed
 		/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
 		{ 
-			param_handle_t changed_param_handle = BaseBlock::getHandleFromParam(&changed_param);
+			param_handle_t changed_param_handle = base_block_t::getHandleFromParam(&changed_param);
 			// if we have a new choice...
 			if (changed_param_handle != mCurChoice)
 			{
 				// clear provided flag on previous choice
-				Param* previous_choice = BaseBlock::getParamFromHandle(mCurChoice);
+				Param* previous_choice = base_block_t::getParamFromHandle(mCurChoice);
 				if (previous_choice) 
 				{
 					previous_choice->setProvided(false);
 				}
 				mCurChoice = changed_param_handle;
 			}
-			BaseBlock::paramChanged(changed_param, user_provided);
+			base_block_t::paramChanged(changed_param, user_provided);
 		}
 
 		virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
@@ -1361,7 +1522,7 @@ namespace LLInitParam
 		ChoiceBlock()
 		:	mCurChoice(0)
 		{
-			BaseBlock::init(selfBlockDescriptor(), BaseBlock::selfBlockDescriptor(), sizeof(DERIVED_BLOCK));
+			BaseBlock::init(selfBlockDescriptor(), base_block_t::selfBlockDescriptor(), sizeof(DERIVED_BLOCK));
 		}
 
 		// Alternatives are mutually exclusive wrt other Alternatives in the same block.  
@@ -1447,7 +1608,7 @@ namespace LLInitParam
 
 		const Param* getCurrentChoice() const
 		{
-			return BaseBlock::getParamFromHandle(mCurChoice);
+			return base_block_t::getParamFromHandle(mCurChoice);
 		}
 	};
 
@@ -1493,6 +1654,9 @@ namespace LLInitParam
 			typedef TypedParam<T, NAME_VALUE_LOOKUP, false, IsBlock<ParamValue<T, NAME_VALUE_LOOKUP> >::value>		super_t;
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
+			using super_t::operator();
+			using super_t::operator=;
+
 			explicit Optional(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1)
 			{
@@ -1510,7 +1674,6 @@ namespace LLInitParam
 				super_t::set(val);
 				return static_cast<DERIVED_BLOCK&>(Param::enclosingBlock());
 			}
-			using super_t::operator();
 		};
 
 		template <typename T, typename NAME_VALUE_LOOKUP = TypeValues<T> >
@@ -1521,6 +1684,9 @@ namespace LLInitParam
 			typedef Mandatory<T, NAME_VALUE_LOOKUP>										self_t;
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
+			using super_t::operator();
+			using super_t::operator=;
+
 			// mandatory parameters require a name to be parseable
 			explicit Mandatory(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, &validate, 1, 1)
@@ -1537,7 +1703,6 @@ namespace LLInitParam
 				super_t::set(val);
 				return static_cast<DERIVED_BLOCK&>(Param::enclosingBlock());
 			}
-			using super_t::operator();
 
 			static bool validate(const Param* p)
 			{
@@ -1693,14 +1858,12 @@ namespace LLInitParam
 
 		ParamValue()
 		:	block_t(),
-			mKeyVersion(0),
 			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	block_t(other),
-			mKeyVersion(0),
 			mValidatedVersion(-1),
 			mValidated(false)
 		{
@@ -1731,11 +1894,82 @@ namespace LLInitParam
 			return *this;
 		}
 
-		S32 			mKeyVersion;
+	protected:
+		mutable S32 	mValidatedVersion;
+		mutable bool 	mValidated; // lazy validation flag
+	};
+
+	template<typename T>
+	class ParamValue <BaseBlock::Lazy<T>,
+					TypeValues<T>,
+					false>
+	{
+	public:
+		typedef ParamValue <BaseBlock::Lazy<T>, TypeValues<T>, false> self_t;
+		typedef const T& value_assignment_t;
+	
+		ParamValue()
+		:	mValue(),
+			mValidatedVersion(-1),
+			mValidated(false)
+		{}
+
+		ParamValue(value_assignment_t other)
+		:	mValue(other),
+			mValidatedVersion(-1),
+			mValidated(false)
+		{}
+
+		void setValue(value_assignment_t val)
+		{
+			mValue.set(val);
+		}
+
+		value_assignment_t getValue() const
+		{
+			return mValue.get();
+		}
+
+		T& getValue()
+		{
+			return mValue.get();
+		}
+
+		operator value_assignment_t() const
+		{
+			return mValue.get();
+		}
+
+		value_assignment_t operator()() const
+		{
+			return mValue.get();
+		}
+
+		bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name)
+		{
+			return mValue.get().deserializeBlock(p, name_stack_range, new_name);
+		}
+
+		void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const
+		{
+			if (mValue.empty()) return;
+			
+			mValue.get().serializeBlock(p, name_stack, diff_block);
+		}
+
+		bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
+		{
+			if (mValue.empty()) return false;
+
+			return mValue.get().inspectBlock(p, name_stack, min_count, max_count);
+		}
 
 	protected:
 		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
+
+	private:
+		BaseBlock::Lazy<T>	mValue;
 	};
 
 	template <>
@@ -1750,14 +1984,12 @@ namespace LLInitParam
 		typedef const LLSD&	value_assignment_t;
 
 		ParamValue()
-		:	mKeyVersion(0),
-			mValidatedVersion(-1),
+		:	mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	mValue(other),
-			mKeyVersion(0),
 			mValidatedVersion(-1),
 			mValidated(false)
 		{}
@@ -1770,7 +2002,6 @@ namespace LLInitParam
 		operator value_assignment_t() const { return mValue; }
 		value_assignment_t operator()() const { return mValue; }
 		
-		S32 			mKeyVersion;
 
 		// block param interface
 		bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name);
@@ -1812,7 +2043,6 @@ namespace LLInitParam
 		CustomParamValue(const T& value = T())
 		:	mValue(value),
 			mValueAge(VALUE_AUTHORITATIVE),
-			mKeyVersion(0),
 			mValidatedVersion(-1),
 			mValidated(false)
 		{}
@@ -1966,8 +2196,6 @@ namespace LLInitParam
 			return getValue();
 		}
 
-		S32 				mKeyVersion;
-
 	protected:
 
 		// use this from within updateValueFromBlock() to set the value without making it authoritative
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 878f9921783..cdf578113ad 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -59,28 +59,26 @@ const char* NO_VALUE_MARKER = "no_value";
 
 const S32 LINE_NUMBER_HERE = 0;
 
-struct MaxOccur : public LLInitParam::ChoiceBlock<MaxOccur>
+struct MaxOccursValues : public LLInitParam::TypeValuesHelper<U32, MaxOccursValues>
 {
-	Alternative<int> count;
-	Alternative<std::string> unbounded;
-
-	MaxOccur()
-	:	unbounded("", "unbounded")
-	{}
+	using TypeValuesHelper<U32, MaxOccursValues>::operator =;
+	typedef std::string name_t;
+	static void declareValues()
+	{
+		declare("unbounded", U32_MAX);
+	}
 };
 
 struct Occurs : public LLInitParam::Block<Occurs>
 {
-	Optional<S32>	minOccurs;
-	Optional<MaxOccur>	maxOccurs;
+	Optional<U32>					minOccurs;
+	Optional<U32, MaxOccursValues>	maxOccurs;
+	Multiple<U32, AnyAmount, MaxOccursValues> foo;
 
 	Occurs()
-	:	minOccurs("minOccurs"),
-		maxOccurs("maxOccurs")
-	{
-		minOccurs = 0;
-		maxOccurs.unbounded.choose();
-	}
+	:	minOccurs("minOccurs", 0),
+		maxOccurs("maxOccurs", U32_MAX)
+	{}
 };
 
 
@@ -103,18 +101,15 @@ namespace LLInitParam
 	};
 }
 
-struct Name : public LLInitParam::Block<Name>
-{
-	Mandatory<std::string> name;
-
-	Name()
-	:	name("name")
-	{}
-};
+struct Element;
+struct Group;
+struct Choice;
+struct Sequence;
+struct Any;
 
 struct Attribute : public LLInitParam::Block<Attribute>
 {
-	Mandatory<Name>			name;
+	Mandatory<std::string>	name;
 	Mandatory<std::string>	type;
 	Mandatory<EUse>			use;
 	
@@ -122,41 +117,170 @@ struct Attribute : public LLInitParam::Block<Attribute>
 	:	name("name"),
 		type("type"),
 		use("use")
+	{}
+};
+
+struct Any : public LLInitParam::Block<Any, Occurs>
+{
+	Optional<std::string> _namespace;
+
+	Any()
+	:	_namespace("namespace")
+	{}
+};
+
+struct All : public LLInitParam::Block<All, Occurs>
+{
+	Multiple<Lazy<Element>> elements;
+
+	All()
+	:	elements("element")
 	{
+		maxOccurs = 1;
 	}
 };
 
-struct ComplexType : public LLInitParam::Block<ComplexType>
+struct Choice : public LLInitParam::ChoiceBlock<Choice, Occurs>
+{
+	Alternative<Lazy<Element>>	element;
+	Alternative<Lazy<Group>>	group;
+	Alternative<Lazy<Choice>>	choice;
+	Alternative<Lazy<Sequence>>	sequence;
+	Alternative<Lazy<Any>>		any;
+
+	Choice()
+	:	element("element"),
+		group("group"),
+		choice("choice"),
+		sequence("sequence"),
+		any("any")
+	{}
+
+};
+
+struct Sequence : public LLInitParam::ChoiceBlock<Sequence, Occurs>
+{
+	Alternative<Lazy<Element>>	element;
+	Alternative<Lazy<Group>>	group;
+	Alternative<Lazy<Choice>>	choice;
+	Alternative<Lazy<Sequence>>	sequence;
+	Alternative<Lazy<Any>>		any;
+};
+
+struct GroupContents : public LLInitParam::ChoiceBlock<GroupContents, Occurs>
 {
-	Multiple<Attribute>			attribute;
-	//Multiple<struct Element>	elements;
-	Optional<bool>				mixed;
+	Alternative<All>		all;
+	Alternative<Choice>		choice;
+	Alternative<Sequence>	sequence;
+
+	GroupContents()
+	:	all("all"),
+		choice("choice"),
+		sequence("sequence")
+	{}
+};
+
+struct Group : public LLInitParam::Block<Group, GroupContents>
+{
+	Optional<std::string>	name,
+							ref;
+
+	Group()
+	:	name("name"),
+		ref("ref")
+	{}
+};
+
+struct Restriction : public LLInitParam::Block<Restriction>
+{
+};
+
+struct Extension : public LLInitParam::Block<Extension>
+{
+};
+
+struct SimpleContent : public LLInitParam::ChoiceBlock<SimpleContent>
+{
+	Alternative<Restriction> restriction;
+	Alternative<Extension> extension;
+
+	SimpleContent()
+	:	restriction("restriction"),
+		extension("extension")
+	{}
+};
+
+struct SimpleType : public LLInitParam::Block<SimpleType>
+{
+	// TODO
+};
+
+struct ComplexContent : public LLInitParam::Block<ComplexContent, SimpleContent>
+{
+	Optional<bool> mixed;
+
+	ComplexContent()
+	:	mixed("mixed", true)
+	{}
+};
+
+struct ComplexTypeContents : public LLInitParam::ChoiceBlock<ComplexTypeContents>
+{
+	Alternative<SimpleContent>	simple_content;
+	Alternative<ComplexContent> complex_content;
+	Alternative<Group>			group;
+	Alternative<All>			all;
+	Alternative<Choice>			choice;
+	Alternative<Sequence>		sequence;
+
+	ComplexTypeContents()
+	:	simple_content("simpleContent"),
+		complex_content("complexContent"),
+		group("group"),
+		all("all"),
+		choice("choice"),
+		sequence("sequence")
+	{}
+};
+
+struct ComplexType : public LLInitParam::Block<ComplexType, ComplexTypeContents>
+{
+	Optional<std::string>			name;
+	Optional<bool>					mixed;
+
+	Multiple<Attribute>				attribute;
+	Multiple<Lazy<Element>>			elements;
 
 	ComplexType()
-	:	attribute("xs:attribute"),
-		//elements("xs:element"),
+	:	name("name"),
+		attribute("xs:attribute"),
+		elements("xs:element"),
 		mixed("mixed")
 	{
-		mixed = true;
 	}
 };
 
-struct Element : public LLInitParam::Block<Element, Occurs>
+struct ElementContents : public LLInitParam::ChoiceBlock<ElementContents, Occurs>
 {
-	Mandatory<ComplexType>	complexType;
-	Mandatory<Name>			name;
+	Alternative<SimpleType>		simpleType;
+	Alternative<ComplexType>	complexType;
 
-	Element()
-	:	complexType("xs:complexType")
+	ElementContents()
+	:	simpleType("simpleType"),
+		complexType("complexType")
 	{}
 };
 
-struct Elements : public LLInitParam::Block<Elements, Occurs>
+struct Element : public LLInitParam::Block<Element, ElementContents>
 {
-	Multiple<Element> elements;
+	Optional<std::string>	name,
+							ref,
+							type;
 
-	Elements()
-	:	elements("xs:element")
+	Element()
+	:	name("xs:name"),
+		ref("xs:ref"),
+		type("xs:type")
 	{}
 };
 
@@ -164,28 +288,32 @@ struct Schema : public LLInitParam::Block<Schema>
 {
 private:
 	Mandatory<std::string>	targetNamespace,
-							xmlns;
+							xmlns,
+							xs;
 
 public:
 	Optional<std::string>	attributeFormDefault,
-							elementFormDefault,
-							xs;
+							elementFormDefault;
 
-	Optional<Elements>		elements;
+	Mandatory<Element>		root_element;
 	
 	void setNameSpace(const std::string& ns) {targetNamespace = ns; xmlns = ns;}
 
-	Schema()
+	Schema(const std::string& ns = LLStringUtil::null)
 	:	attributeFormDefault("attributeFormDefault"),
 		elementFormDefault("elementFormDefault"),
 		xs("xmlns:xs"),
 		targetNamespace("targetNamespace"),
 		xmlns("xmlns"),
-		elements("xs:choice")
+		root_element("xs:element")
 	{
 		attributeFormDefault = "unqualified";
 		elementFormDefault = "qualified";
 		xs = "http://www.w3.org/2001/XMLSchema";
+		if (!ns.empty())
+		{
+			setNameSpace(ns);
+		};
 	}
 
 };
@@ -214,22 +342,30 @@ LLXSDWriter::LLXSDWriter()
 
 void LLXSDWriter::writeXSD(const std::string& type_name, LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const std::string& xml_namespace)
 {
+	Schema schema(xml_namespace);
+
+	schema.root_element.name = type_name;
+	Choice& choice = schema.root_element.complexType.choice;
+
+	choice.minOccurs = 0;
+	choice.maxOccurs = "unbounded";
+
 	mSchemaNode = node;
-	node->setName("xs:schema");
-	node->createChild("attributeFormDefault", true)->setStringValue("unqualified");
-	node->createChild("elementFormDefault", true)->setStringValue("qualified");
-	node->createChild("targetNamespace", true)->setStringValue(xml_namespace);
-	node->createChild("xmlns:xs", true)->setStringValue("http://www.w3.org/2001/XMLSchema");
-	node->createChild("xmlns", true)->setStringValue(xml_namespace);
-
-	node = node->createChild("xs:complexType", false);
-	node->createChild("name", true)->setStringValue(type_name);
-	node->createChild("mixed", true)->setStringValue("true");
-
-	mAttributeNode = node;
-	mElementNode = node->createChild("xs:choice", false);
-	mElementNode->createChild("minOccurs", true)->setStringValue("0");
-	mElementNode->createChild("maxOccurs", true)->setStringValue("unbounded");
+	//node->setName("xs:schema");
+	//node->createChild("attributeFormDefault", true)->setStringValue("unqualified");
+	//node->createChild("elementFormDefault", true)->setStringValue("qualified");
+	//node->createChild("targetNamespace", true)->setStringValue(xml_namespace);
+	//node->createChild("xmlns:xs", true)->setStringValue("http://www.w3.org/2001/XMLSchema");
+	//node->createChild("xmlns", true)->setStringValue(xml_namespace);
+
+	//node = node->createChild("xs:complexType", false);
+	//node->createChild("name", true)->setStringValue(type_name);
+	//node->createChild("mixed", true)->setStringValue("true");
+
+	//mAttributeNode = node;
+	//mElementNode = node->createChild("xs:choice", false);
+	//mElementNode->createChild("minOccurs", true)->setStringValue("0");
+	//mElementNode->createChild("maxOccurs", true)->setStringValue("unbounded");
 	block.inspectBlock(*this);
 
 	// duplicate element choices
-- 
GitLab


From db7924681d629f48f939e7d4cc55d588aa93c344 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 8 Nov 2011 17:46:43 -0600
Subject: [PATCH 175/933] SH-24114 Remove unused vectorization code
 (outdated/unused with SSE2 requirement and llvetor4a et al)

---
 indra/llmath/CMakeLists.txt              |   4 -
 indra/llmath/llv4math.h                  | 141 -------------
 indra/llmath/llv4matrix3.h               | 220 --------------------
 indra/llmath/llv4matrix4.h               | 249 -----------------------
 indra/llmath/llv4vector3.h               |  80 --------
 indra/newview/CMakeLists.txt             |  17 --
 indra/newview/app_settings/settings.xml  |  44 ----
 indra/newview/llappviewer.cpp            |  38 ----
 indra/newview/llviewercontrol.cpp        |  10 -
 indra/newview/llviewerjointmesh.cpp      | 171 +---------------
 indra/newview/llviewerjointmesh.h        |  19 +-
 indra/newview/llviewerjointmesh_sse.cpp  | 114 -----------
 indra/newview/llviewerjointmesh_sse2.cpp | 121 -----------
 indra/newview/llviewerjointmesh_vec.cpp  |  97 ---------
 indra/newview/llviewermenu.cpp           |  21 --
 15 files changed, 6 insertions(+), 1340 deletions(-)
 delete mode 100644 indra/llmath/llv4math.h
 delete mode 100644 indra/llmath/llv4matrix3.h
 delete mode 100644 indra/llmath/llv4matrix4.h
 delete mode 100644 indra/llmath/llv4vector3.h
 delete mode 100644 indra/newview/llviewerjointmesh_sse.cpp
 delete mode 100644 indra/newview/llviewerjointmesh_sse2.cpp
 delete mode 100644 indra/newview/llviewerjointmesh_vec.cpp

diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index cd100cdf9fd..b5e59c1ca35 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -75,10 +75,6 @@ set(llmath_HEADER_FILES
     llvector4a.h
     llvector4a.inl
     llvector4logical.h
-    llv4math.h
-    llv4matrix3.h
-    llv4matrix4.h
-    llv4vector3.h
     llvolume.h
     llvolumemgr.h
     llvolumeoctree.h
diff --git a/indra/llmath/llv4math.h b/indra/llmath/llv4math.h
deleted file mode 100644
index 5f403ba5266..00000000000
--- a/indra/llmath/llv4math.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/** 
- * @file llv4math.h
- * @brief LLV4* class header file - vector processor enabled math
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef	LL_LLV4MATH_H
-#define	LL_LLV4MATH_H
-
-// *NOTE: We do not support SSE acceleration on Windows builds.
-// Our minimum specification for the viewer includes 1 GHz Athlon processors,
-// which covers the Athlon Thunderbird series that does not support SSE.
-//
-// Our header files include statements like this
-//   const F32 HAVOK_TIMESTEP = 1.f / 45.f;
-// This creates "globals" that are included in each .obj file.  If a single
-// .cpp file has SSE code generation turned on (eg, llviewerjointmesh_sse.cpp)
-// these globals will be initialized using SSE instructions.  This causes SL
-// to crash before main() on processors without SSE.  Untangling all these 
-// headers/variables is too much work for the small performance gains of 
-// vectorization.
-//
-// Therefore we only support vectorization on builds where the everything is 
-// built with SSE or Altivec.  See https://jira.secondlife.com/browse/VWR-1610
-// and https://jira.lindenlab.com/browse/SL-47720 for details.
-//
-// Sorry the code is such a mess. JC
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4MATH - GNUC
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#if LL_GNUC && __GNUC__ >= 4 && __SSE__
-
-#define			LL_VECTORIZE					1
-
-#if LL_DARWIN
-
-#include <Accelerate/Accelerate.h>
-#include <xmmintrin.h>
-typedef vFloat	V4F32;
-
-#else
-
-#include <xmmintrin.h>
-typedef float	V4F32							__attribute__((vector_size(16)));
-
-#endif
-
-#endif
-#if LL_GNUC
-
-#define			LL_LLV4MATH_ALIGN_PREFIX
-#define			LL_LLV4MATH_ALIGN_POSTFIX		__attribute__((aligned(16)))
-
-#endif
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4MATH - MSVC
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-// Only vectorize if the entire Windows build uses SSE.
-// _M_IX86_FP is set when SSE code generation is turned on, and I have
-// confirmed this in VS2003, VS2003 SP1, and VS2005. JC
-#if LL_MSVC && _M_IX86_FP
-
-#define			LL_VECTORIZE					1
-
-#include <xmmintrin.h>
-
-typedef __m128	V4F32;
-
-#endif
-#if LL_MSVC
-
-#define			LL_LLV4MATH_ALIGN_PREFIX		__declspec(align(16))
-#define			LL_LLV4MATH_ALIGN_POSTFIX
-
-#endif
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4MATH - default - no vectorization
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#if !LL_VECTORIZE
-
-#define			LL_VECTORIZE					0
-
-struct			V4F32							{ F32 __pad__[4]; };
-
-inline F32 llv4lerp(F32 a, F32 b, F32 w)		{ return ( b - a ) * w + a; }
-
-#endif
-
-#ifndef			LL_LLV4MATH_ALIGN_PREFIX
-#	define			LL_LLV4MATH_ALIGN_PREFIX
-#endif
-#ifndef			LL_LLV4MATH_ALIGN_POSTFIX
-#	define			LL_LLV4MATH_ALIGN_POSTFIX
-#endif
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4MATH
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-
-#define			LLV4_NUM_AXIS					4
-
-class LLV4Vector3;
-class LLV4Matrix3;
-class LLV4Matrix4;
-
-#endif
diff --git a/indra/llmath/llv4matrix3.h b/indra/llmath/llv4matrix3.h
deleted file mode 100644
index 270f5d7dae4..00000000000
--- a/indra/llmath/llv4matrix3.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/** 
- * @file llviewerjointmesh.cpp
- * @brief LLV4* class header file - vector processor enabled math
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLV4MATRIX3_H
-#define LL_LLV4MATRIX3_H
-
-#include "llv4math.h"
-#include "llv4vector3.h"
-#include "m3math.h"			// for operator LLMatrix3()
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix3
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-LL_LLV4MATH_ALIGN_PREFIX
-
-class LLV4Matrix3
-{
-public:
-	union {
-		F32		mMatrix[LLV4_NUM_AXIS][LLV4_NUM_AXIS];
-		V4F32	mV[LLV4_NUM_AXIS];
-	};
-
-	void				lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w);
-	void				multiply(const LLVector3 &a, LLVector3& out) const;
-	void				multiply(const LLVector4 &a, LLV4Vector3& out) const;
-	void				multiply(const LLVector3 &a, LLV4Vector3& out) const;
-
-	const LLV4Matrix3&	transpose();
-	const LLV4Matrix3&	operator=(const LLMatrix3& a);
-
-	operator			LLMatrix3()	const { return (reinterpret_cast<const LLMatrix4*>(const_cast<const F32*>(&mMatrix[0][0])))->getMat3(); }
-
-	friend LLVector3	operator*(const LLVector3& a, const LLV4Matrix3& b);
-}
-
-LL_LLV4MATH_ALIGN_POSTFIX;
-
-
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix3 - SSE
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#if LL_VECTORIZE
-
-inline void LLV4Matrix3::lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w)
-{
-	__m128 vw = _mm_set1_ps(w);
-	mV[VX] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VX], a.mV[VX]), vw), a.mV[VX]); // ( b - a ) * w + a
-	mV[VY] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VY], a.mV[VY]), vw), a.mV[VY]);
-	mV[VZ] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VZ], a.mV[VZ]), vw), a.mV[VZ]);
-}
-
-inline void LLV4Matrix3::multiply(const LLVector3 &a, LLVector3& o) const
-{
-	LLV4Vector3 j;
-	j.v = 				 	_mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
-	j.v = _mm_add_ps(j.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
-	j.v = _mm_add_ps(j.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
-	o.setVec(j.mV);
-}
-
-inline void LLV4Matrix3::multiply(const LLVector4 &a, LLV4Vector3& o) const
-{
-	o.v =					_mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
-	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
-	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
-}
-
-inline void LLV4Matrix3::multiply(const LLVector3 &a, LLV4Vector3& o) const
-{
-	o.v =					_mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
-	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
-	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix3
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#else
-
-inline void LLV4Matrix3::lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w)
-{
-	mMatrix[VX][VX] = llv4lerp(a.mMatrix[VX][VX], b.mMatrix[VX][VX], w);
-	mMatrix[VX][VY] = llv4lerp(a.mMatrix[VX][VY], b.mMatrix[VX][VY], w);
-	mMatrix[VX][VZ] = llv4lerp(a.mMatrix[VX][VZ], b.mMatrix[VX][VZ], w);
-
-	mMatrix[VY][VX] = llv4lerp(a.mMatrix[VY][VX], b.mMatrix[VY][VX], w);
-	mMatrix[VY][VY] = llv4lerp(a.mMatrix[VY][VY], b.mMatrix[VY][VY], w);
-	mMatrix[VY][VZ] = llv4lerp(a.mMatrix[VY][VZ], b.mMatrix[VY][VZ], w);
-
-	mMatrix[VZ][VX] = llv4lerp(a.mMatrix[VZ][VX], b.mMatrix[VZ][VX], w);
-	mMatrix[VZ][VY] = llv4lerp(a.mMatrix[VZ][VY], b.mMatrix[VZ][VY], w);
-	mMatrix[VZ][VZ] = llv4lerp(a.mMatrix[VZ][VZ], b.mMatrix[VZ][VZ], w);
-}
-
-inline void LLV4Matrix3::multiply(const LLVector3 &a, LLVector3& o) const
-{
-	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
-					a.mV[VY] * mMatrix[VY][VX] + 
-					a.mV[VZ] * mMatrix[VZ][VX],
-					 
-					a.mV[VX] * mMatrix[VX][VY] + 
-					a.mV[VY] * mMatrix[VY][VY] + 
-					a.mV[VZ] * mMatrix[VZ][VY],
-					 
-					a.mV[VX] * mMatrix[VX][VZ] + 
-					a.mV[VY] * mMatrix[VY][VZ] + 
-					a.mV[VZ] * mMatrix[VZ][VZ]);
-}
-
-inline void LLV4Matrix3::multiply(const LLVector4 &a, LLV4Vector3& o) const
-{
-	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
-					a.mV[VY] * mMatrix[VY][VX] + 
-					a.mV[VZ] * mMatrix[VZ][VX],
-					 
-					a.mV[VX] * mMatrix[VX][VY] + 
-					a.mV[VY] * mMatrix[VY][VY] + 
-					a.mV[VZ] * mMatrix[VZ][VY],
-					 
-					a.mV[VX] * mMatrix[VX][VZ] + 
-					a.mV[VY] * mMatrix[VY][VZ] + 
-					a.mV[VZ] * mMatrix[VZ][VZ]);
-}
-
-inline void LLV4Matrix3::multiply(const LLVector3 &a, LLV4Vector3& o) const
-{
-	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
-					a.mV[VY] * mMatrix[VY][VX] + 
-					a.mV[VZ] * mMatrix[VZ][VX],
-					 
-					a.mV[VX] * mMatrix[VX][VY] + 
-					a.mV[VY] * mMatrix[VY][VY] + 
-					a.mV[VZ] * mMatrix[VZ][VY],
-					 
-					a.mV[VX] * mMatrix[VX][VZ] + 
-					a.mV[VY] * mMatrix[VY][VZ] + 
-					a.mV[VZ] * mMatrix[VZ][VZ]);
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix3
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#endif
-
-inline const LLV4Matrix3&	LLV4Matrix3::transpose()
-{
-#if LL_VECTORIZE && defined(_MM_TRANSPOSE4_PS)
-	_MM_TRANSPOSE4_PS(mV[VX], mV[VY], mV[VZ], mV[VW]);
-	return *this;
-#else
-	F32 temp;
-	temp = mMatrix[VX][VY]; mMatrix[VX][VY] = mMatrix[VY][VX]; mMatrix[VY][VX] = temp;
-	temp = mMatrix[VX][VZ]; mMatrix[VX][VZ] = mMatrix[VZ][VX]; mMatrix[VZ][VX] = temp;
-	temp = mMatrix[VY][VZ]; mMatrix[VY][VZ] = mMatrix[VZ][VY]; mMatrix[VZ][VY] = temp;
-#endif
-	return *this;
-}
-
-inline const LLV4Matrix3& LLV4Matrix3::operator=(const LLMatrix3& a)
-{
-	memcpy(mMatrix[VX], a.mMatrix[VX], sizeof(F32) * 3 );
-	memcpy(mMatrix[VY], a.mMatrix[VY], sizeof(F32) * 3 );
-	memcpy(mMatrix[VZ], a.mMatrix[VZ], sizeof(F32) * 3 );
-	return *this;
-}
-
-inline LLVector3 operator*(const LLVector3& a, const LLV4Matrix3& b)
-{
-	return LLVector3(
-				a.mV[VX] * b.mMatrix[VX][VX] + 
-				a.mV[VY] * b.mMatrix[VY][VX] + 
-				a.mV[VZ] * b.mMatrix[VZ][VX],
-	
-				a.mV[VX] * b.mMatrix[VX][VY] + 
-				a.mV[VY] * b.mMatrix[VY][VY] + 
-				a.mV[VZ] * b.mMatrix[VZ][VY],
-	
-				a.mV[VX] * b.mMatrix[VX][VZ] + 
-				a.mV[VY] * b.mMatrix[VY][VZ] + 
-				a.mV[VZ] * b.mMatrix[VZ][VZ] );
-}
-
-#endif
diff --git a/indra/llmath/llv4matrix4.h b/indra/llmath/llv4matrix4.h
deleted file mode 100644
index 2eb49d9294e..00000000000
--- a/indra/llmath/llv4matrix4.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/** 
- * @file llviewerjointmesh.cpp
- * @brief LLV4* class header file - vector processor enabled math
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLV4MATRIX4_H
-#define LL_LLV4MATRIX4_H
-
-#include "llv4math.h"
-#include "llv4matrix3.h"	// just for operator LLV4Matrix3()
-#include "llv4vector3.h"
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix4
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-LL_LLV4MATH_ALIGN_PREFIX
-
-class LLV4Matrix4
-{
-public:
-	union {
-		F32		mMatrix[LLV4_NUM_AXIS][LLV4_NUM_AXIS];
-		V4F32	mV[LLV4_NUM_AXIS];
-	};
-
-	void				lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w);
-	void				multiply(const LLVector3 &a, LLVector3& o) const;
-	void				multiply(const LLVector3 &a, LLV4Vector3& o) const;
-
-	const LLV4Matrix4&	transpose();
-	const LLV4Matrix4&  translate(const LLVector3 &vec);
-	const LLV4Matrix4&  translate(const LLV4Vector3 &vec);
-	const LLV4Matrix4&	operator=(const LLMatrix4& a);
-
-	operator			LLMatrix4()	const { return *(reinterpret_cast<const LLMatrix4*>(const_cast<const F32*>(&mMatrix[0][0]))); }
-	operator			LLV4Matrix3()	const { return *(reinterpret_cast<const LLV4Matrix3*>(const_cast<const F32*>(&mMatrix[0][0]))); }
-	
-	friend LLVector3	operator*(const LLVector3 &a, const LLV4Matrix4 &b);
-}
-
-LL_LLV4MATH_ALIGN_POSTFIX;
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix4 - SSE
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#if LL_VECTORIZE
-
-inline void LLV4Matrix4::lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w)
-{
-	__m128 vw = _mm_set1_ps(w);
-	mV[VX] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VX], a.mV[VX]), vw), a.mV[VX]); // ( b - a ) * w + a
-	mV[VY] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VY], a.mV[VY]), vw), a.mV[VY]);
-	mV[VZ] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VZ], a.mV[VZ]), vw), a.mV[VZ]);
-	mV[VW] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VW], a.mV[VW]), vw), a.mV[VW]);
-}
-
-inline void LLV4Matrix4::multiply(const LLVector3 &a, LLVector3& o) const
-{
-	LLV4Vector3 j;
-	j.v = _mm_add_ps(mV[VW], _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX])); // ( ax * vx ) + vw
-	j.v = _mm_add_ps(j.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
-	j.v = _mm_add_ps(j.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
-	o.setVec(j.mV);
-}
-
-inline void LLV4Matrix4::multiply(const LLVector3 &a, LLV4Vector3& o) const
-{
-	o.v = _mm_add_ps(mV[VW], _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX])); // ( ax * vx ) + vw
-	o.v = _mm_add_ps(o.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
-	o.v = _mm_add_ps(o.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
-}
-
-inline const LLV4Matrix4& LLV4Matrix4::translate(const LLV4Vector3 &vec)
-{
-	mV[VW] = _mm_add_ps(mV[VW], vec.v);
-	return (*this);
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix4
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#else
-
-inline void LLV4Matrix4::lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w)
-{
-	mMatrix[VX][VX] = llv4lerp(a.mMatrix[VX][VX], b.mMatrix[VX][VX], w);
-	mMatrix[VX][VY] = llv4lerp(a.mMatrix[VX][VY], b.mMatrix[VX][VY], w);
-	mMatrix[VX][VZ] = llv4lerp(a.mMatrix[VX][VZ], b.mMatrix[VX][VZ], w);
-
-	mMatrix[VY][VX] = llv4lerp(a.mMatrix[VY][VX], b.mMatrix[VY][VX], w);
-	mMatrix[VY][VY] = llv4lerp(a.mMatrix[VY][VY], b.mMatrix[VY][VY], w);
-	mMatrix[VY][VZ] = llv4lerp(a.mMatrix[VY][VZ], b.mMatrix[VY][VZ], w);
-
-	mMatrix[VZ][VX] = llv4lerp(a.mMatrix[VZ][VX], b.mMatrix[VZ][VX], w);
-	mMatrix[VZ][VY] = llv4lerp(a.mMatrix[VZ][VY], b.mMatrix[VZ][VY], w);
-	mMatrix[VZ][VZ] = llv4lerp(a.mMatrix[VZ][VZ], b.mMatrix[VZ][VZ], w);
-
-	mMatrix[VW][VX] = llv4lerp(a.mMatrix[VW][VX], b.mMatrix[VW][VX], w);
-	mMatrix[VW][VY] = llv4lerp(a.mMatrix[VW][VY], b.mMatrix[VW][VY], w);
-	mMatrix[VW][VZ] = llv4lerp(a.mMatrix[VW][VZ], b.mMatrix[VW][VZ], w);
-}
-
-inline void LLV4Matrix4::multiply(const LLVector3 &a, LLVector3& o) const
-{
-	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
-					a.mV[VY] * mMatrix[VY][VX] + 
-					a.mV[VZ] * mMatrix[VZ][VX] +
-					mMatrix[VW][VX],
-					 
-					a.mV[VX] * mMatrix[VX][VY] + 
-					a.mV[VY] * mMatrix[VY][VY] + 
-					a.mV[VZ] * mMatrix[VZ][VY] +
-					mMatrix[VW][VY],
-					 
-					a.mV[VX] * mMatrix[VX][VZ] + 
-					a.mV[VY] * mMatrix[VY][VZ] + 
-					a.mV[VZ] * mMatrix[VZ][VZ] +
-					mMatrix[VW][VZ]);
-}
-
-inline void LLV4Matrix4::multiply(const LLVector3 &a, LLV4Vector3& o) const
-{
-	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
-					a.mV[VY] * mMatrix[VY][VX] + 
-					a.mV[VZ] * mMatrix[VZ][VX] +
-					mMatrix[VW][VX],
-					 
-					a.mV[VX] * mMatrix[VX][VY] + 
-					a.mV[VY] * mMatrix[VY][VY] + 
-					a.mV[VZ] * mMatrix[VZ][VY] +
-					mMatrix[VW][VY],
-					 
-					a.mV[VX] * mMatrix[VX][VZ] + 
-					a.mV[VY] * mMatrix[VY][VZ] + 
-					a.mV[VZ] * mMatrix[VZ][VZ] +
-					mMatrix[VW][VZ]);
-}
-
-inline const LLV4Matrix4& LLV4Matrix4::translate(const LLV4Vector3 &vec)
-{
-	mMatrix[3][0] += vec.mV[0];
-	mMatrix[3][1] += vec.mV[1];
-	mMatrix[3][2] += vec.mV[2];
-	return (*this);
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Matrix4
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-#endif
-
-inline const LLV4Matrix4& LLV4Matrix4::operator=(const LLMatrix4& a)
-{
-	memcpy(mMatrix, a.mMatrix, sizeof(F32) * 16 );
-	return *this;
-}
-
-inline const LLV4Matrix4& LLV4Matrix4::transpose()
-{
-#if LL_VECTORIZE && defined(_MM_TRANSPOSE4_PS)
-	_MM_TRANSPOSE4_PS(mV[VX], mV[VY], mV[VZ], mV[VW]);
-#else
-	LLV4Matrix4 mat;
-	mat.mMatrix[0][0] = mMatrix[0][0];
-	mat.mMatrix[1][0] = mMatrix[0][1];
-	mat.mMatrix[2][0] = mMatrix[0][2];
-	mat.mMatrix[3][0] = mMatrix[0][3];
-
-	mat.mMatrix[0][1] = mMatrix[1][0];
-	mat.mMatrix[1][1] = mMatrix[1][1];
-	mat.mMatrix[2][1] = mMatrix[1][2];
-	mat.mMatrix[3][1] = mMatrix[1][3];
-
-	mat.mMatrix[0][2] = mMatrix[2][0];
-	mat.mMatrix[1][2] = mMatrix[2][1];
-	mat.mMatrix[2][2] = mMatrix[2][2];
-	mat.mMatrix[3][2] = mMatrix[2][3];
-
-	mat.mMatrix[0][3] = mMatrix[3][0];
-	mat.mMatrix[1][3] = mMatrix[3][1];
-	mat.mMatrix[2][3] = mMatrix[3][2];
-	mat.mMatrix[3][3] = mMatrix[3][3];
-
-	*this = mat;
-#endif
-	return *this;
-}
-
-inline const LLV4Matrix4& LLV4Matrix4::translate(const LLVector3 &vec)
-{
-	mMatrix[3][0] += vec.mV[0];
-	mMatrix[3][1] += vec.mV[1];
-	mMatrix[3][2] += vec.mV[2];
-	return (*this);
-}
-
-inline LLVector3 operator*(const LLVector3 &a, const LLV4Matrix4 &b)
-{
-	return LLVector3(a.mV[VX] * b.mMatrix[VX][VX] + 
-					 a.mV[VY] * b.mMatrix[VY][VX] + 
-					 a.mV[VZ] * b.mMatrix[VZ][VX] +
-					 b.mMatrix[VW][VX],
-					 
-					 a.mV[VX] * b.mMatrix[VX][VY] + 
-					 a.mV[VY] * b.mMatrix[VY][VY] + 
-					 a.mV[VZ] * b.mMatrix[VZ][VY] +
-					 b.mMatrix[VW][VY],
-					 
-					 a.mV[VX] * b.mMatrix[VX][VZ] + 
-					 a.mV[VY] * b.mMatrix[VY][VZ] + 
-					 a.mV[VZ] * b.mMatrix[VZ][VZ] +
-					 b.mMatrix[VW][VZ]);
-}
-
-
-#endif
diff --git a/indra/llmath/llv4vector3.h b/indra/llmath/llv4vector3.h
deleted file mode 100644
index a340d53f5ae..00000000000
--- a/indra/llmath/llv4vector3.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/** 
- * @file llviewerjointmesh.cpp
- * @brief LLV4* class header file - vector processor enabled math
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLV4VECTOR3_H
-#define LL_LLV4VECTOR3_H
-
-#include "llv4math.h"
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Vector3
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-LL_LLV4MATH_ALIGN_PREFIX
-
-class LLV4Vector3
-{
-public:
-	union {
-		F32		mV[LLV4_NUM_AXIS];
-		V4F32	v;
-	};
-
-	enum {
-		ALIGNMENT = 16
-		};
-
-	void				setVec(F32 x, F32 y, F32 z);
-	void				setVec(F32 a);
-}
-
-LL_LLV4MATH_ALIGN_POSTFIX;
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLV4Vector3
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-inline void	LLV4Vector3::setVec(F32 x, F32 y, F32 z)
-{
-	mV[VX] = x;
-	mV[VY] = y;
-	mV[VZ] = z;
-}
-
-inline void	LLV4Vector3::setVec(F32 a)
-{
-#if LL_VECTORIZE
-	v = _mm_set1_ps(a);
-#else
-	setVec(a, a, a);
-#endif
-}
-
-#endif
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index fa748043143..0467a93dfe4 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -540,9 +540,6 @@ set(viewer_SOURCE_FILES
     llviewerjoint.cpp
     llviewerjointattachment.cpp
     llviewerjointmesh.cpp
-    llviewerjointmesh_sse.cpp
-    llviewerjointmesh_sse2.cpp
-    llviewerjointmesh_vec.cpp
     llviewerjoystick.cpp
     llviewerkeyboard.cpp
     llviewerlayer.cpp
@@ -624,20 +621,6 @@ set(viewer_SOURCE_FILES
 set(VIEWER_BINARY_NAME "secondlife-bin" CACHE STRING
     "The name of the viewer executable to create.")
 
-if (LINUX)
-  # We can't set these flags for Darwin, because they get passed to
-  # the PPC compiler.  Ugh.
-
-  set_source_files_properties(
-      llviewerjointmesh_sse.cpp
-      PROPERTIES COMPILE_FLAGS "-msse -mfpmath=sse"
-      )
-  set_source_files_properties(
-      llviewerjointmesh_sse2.cpp
-      PROPERTIES COMPILE_FLAGS "-msse2 -mfpmath=sse"
-      )
-endif (LINUX)
-
 set(viewer_HEADER_FILES
     CMakeLists.txt
     ViewerInstall.cmake
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d057323e51d..d07efa6a37d 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12202,50 +12202,6 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>VectorizeEnable</key>
-    <map>
-      <key>Comment</key>
-      <string>Enable general vector operations and data alignment.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>VectorizePerfTest</key>
-    <map>
-      <key>Comment</key>
-      <string>Test SSE/vectorization performance and choose fastest version.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>VectorizeProcessor</key>
-    <map>
-      <key>Comment</key>
-      <string>0=Compiler Default, 1=SSE, 2=SSE2, autodetected</string>
-      <key>Persist</key>
-      <integer>0</integer>
-      <key>Type</key>
-      <string>U32</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>VectorizeSkin</key>
-    <map>
-      <key>Comment</key>
-      <string>Enable vector operations for avatar skinning.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>VelocityInterpolate</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index dfb677dc2c1..bab99e8a54a 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -558,42 +558,6 @@ static void settings_modify()
 	gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession;
 	gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline");
 	gAuditTexture = gSavedSettings.getBOOL("AuditTexture");
-#if LL_VECTORIZE
-	if (gSysCPU.hasAltivec())
-	{
-		gSavedSettings.setBOOL("VectorizeEnable", TRUE );
-		gSavedSettings.setU32("VectorizeProcessor", 0 );
-	}
-	else
-	if (gSysCPU.hasSSE2())
-	{
-		gSavedSettings.setBOOL("VectorizeEnable", TRUE );
-		gSavedSettings.setU32("VectorizeProcessor", 2 );
-	}
-	else
-	if (gSysCPU.hasSSE())
-	{
-		gSavedSettings.setBOOL("VectorizeEnable", TRUE );
-		gSavedSettings.setU32("VectorizeProcessor", 1 );
-	}
-	else
-	{
-		// Don't bother testing or running if CPU doesn't support it. JC
-		gSavedSettings.setBOOL("VectorizePerfTest", FALSE );
-		gSavedSettings.setBOOL("VectorizeEnable", FALSE );
-		gSavedSettings.setU32("VectorizeProcessor", 0 );
-		gSavedSettings.setBOOL("VectorizeSkin", FALSE);
-	}
-#else
-	// This build target doesn't support SSE, don't test/run.
-	gSavedSettings.setBOOL("VectorizePerfTest", FALSE );
-	gSavedSettings.setBOOL("VectorizeEnable", FALSE );
-	gSavedSettings.setU32("VectorizeProcessor", 0 );
-	gSavedSettings.setBOOL("VectorizeSkin", FALSE);
-
-	// disable fullscreen mode, unsupported
-	//gSavedSettings.setBOOL("WindowFullScreen", FALSE);
-#endif
 }
 
 class LLFastTimerLogThread : public LLThread
@@ -877,8 +841,6 @@ bool LLAppViewer::init()
 
 	LLAgent::parseTeleportMessages("teleport_strings.xml");
 
-	LLViewerJointMesh::updateVectorize();
-
 	// load MIME type -> media impl mappings
 	std::string mime_types_name;
 #if LL_DARWIN
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 03d765eaee2..73e4d11d7bc 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -452,12 +452,6 @@ bool handleEffectColorChanged(const LLSD& newvalue)
 	return true;
 }
 
-bool handleVectorizeChanged(const LLSD& newvalue)
-{
-	LLViewerJointMesh::updateVectorize();
-	return true;
-}
-
 bool handleHighResSnapshotChanged(const LLSD& newvalue)
 {
 	// High Res Snapshot active, must uncheck RenderUIInSnapshot
@@ -692,10 +686,6 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _2));
 	gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _2));
 	gSavedSettings.getControl("HighResSnapshot")->getSignal()->connect(boost::bind(handleHighResSnapshotChanged, _2));
-	gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
-	gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
-	gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
-	gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
 	gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
 	gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
 	gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 3e20abecb7d..b18323bed00 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -766,7 +766,7 @@ BOOL LLViewerJointMesh::updateLOD(F32 pixel_area, BOOL activate)
 }
 
 // static
-void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh)
+void LLViewerJointMesh::updateGeometry(LLFace *mFace, LLPolyMesh *mMesh)
 {
 	LLStrider<LLVector3> o_vertices;
 	LLStrider<LLVector3> o_normals;
@@ -832,50 +832,6 @@ static F64 sUpdateGeometryRunAvgOn[10];
 static U32 sUpdateGeometryRunCount			= 0 ;
 static U32 sUpdateGeometryCalls				= 0 ;
 static U32 sUpdateGeometryLastProcessor		= 0 ;
-static BOOL sVectorizePerfTest 				= FALSE;
-static U32 sVectorizeProcessor 				= 0;
-
-//static
-void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh);
-
-//static
-void LLViewerJointMesh::updateVectorize()
-{
-	sVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest");
-	sVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor");
-	BOOL vectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable");
-	BOOL vectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin");
-
-	std::string vp;
-	switch(sVectorizeProcessor)
-	{
-		case 2: vp = "SSE2"; break;					// *TODO: replace the magic #s
-		case 1: vp = "SSE"; break;
-		default: vp = "COMPILER DEFAULT"; break;
-	}
-	LL_INFOS("AppInit") << "Vectorization         : " << ( vectorizeEnable ? "ENABLED" : "DISABLED" ) << LL_ENDL ;
-	LL_INFOS("AppInit") << "Vector Processor      : " << vp << LL_ENDL ;
-	LL_INFOS("AppInit") << "Vectorized Skinning   : " << ( vectorizeSkin ? "ENABLED" : "DISABLED" ) << LL_ENDL ;
-	if(vectorizeEnable && vectorizeSkin)
-	{
-		switch(sVectorizeProcessor)
-		{
-			case 2:
-				sUpdateGeometryFunc = &updateGeometrySSE2;
-				break;
-			case 1:
-				sUpdateGeometryFunc = &updateGeometrySSE;
-				break;
-			default:
-				sUpdateGeometryFunc = &updateGeometryVectorized;
-				break;
-		}
-	}
-	else
-	{
-		sUpdateGeometryFunc = &updateGeometryOriginal;
-	}
-}
 
 void LLViewerJointMesh::updateJointGeometry()
 {
@@ -889,129 +845,8 @@ void LLViewerJointMesh::updateJointGeometry()
 		return;
 	}
 
-	if (!sVectorizePerfTest)
-	{
-		// Once we've measured performance, just run the specified
-		// code version.
-		if(sUpdateGeometryFunc == updateGeometryOriginal)
-			uploadJointMatrices();
-		sUpdateGeometryFunc(mFace, mMesh);
-	}
-	else
-	{
-		// At startup, measure the amount of time in skinning and choose
-		// the fastest one.
-		LLTimer ug_timer ;
-		
-		if (sUpdateGeometryCallPointer)
-		{
-			if(sUpdateGeometryFunc == updateGeometryOriginal)
-				uploadJointMatrices();
-			// call accelerated version for this processor
-			sUpdateGeometryFunc(mFace, mMesh);
-		}
-		else
-		{
-			uploadJointMatrices();
-			updateGeometryOriginal(mFace, mMesh);
-		}
-	
-		sUpdateGeometryElapsedTime += ug_timer.getElapsedTimeF64();
-		++sUpdateGeometryCalls;
-		if(0 != (sUpdateGeometryCalls & UPDATE_GEOMETRY_CALL_OVERFLOW))
-		{
-			F64 time_since_app_start = ug_timer.getElapsedSeconds();
-			if(sUpdateGeometryGlobalTime == 0.0 
-				|| sUpdateGeometryLastProcessor != sVectorizeProcessor)
-			{
-				sUpdateGeometryGlobalTime		= time_since_app_start;
-				sUpdateGeometryElapsedTime		= 0;
-				sUpdateGeometryCalls			= 0;
-				sUpdateGeometryRunCount			= 0;
-				sUpdateGeometryLastProcessor	= sVectorizeProcessor;
-				sUpdateGeometryCallPointer		= false;
-				return;
-			}
-			F64 percent_time_in_function = 
-				( sUpdateGeometryElapsedTime * 100.0 ) / ( time_since_app_start - sUpdateGeometryGlobalTime ) ;
-			sUpdateGeometryGlobalTime = time_since_app_start;
-			if (!sUpdateGeometryCallPointer)
-			{
-				// First set of run data is with vectorization off.
-				sUpdateGeometryCallPointer = true;
-				llinfos << "profile (avg of " << sUpdateGeometryCalls << " samples) = "
-					<< "vectorize off " << percent_time_in_function
-					<< "% of time with "
-					<< (sUpdateGeometryElapsedTime / (F64)sUpdateGeometryCalls)
-					<< " seconds per call "
-					<< llendl;
-				sUpdateGeometryRunAvgOff[sUpdateGeometryRunCount] = percent_time_in_function;
-				sUpdateGeometryElapsedTimeOff += sUpdateGeometryElapsedTime;
-				sUpdateGeometryCalls = 0;
-			}
-			else
-			{
-				// Second set of run data is with vectorization on.
-				sUpdateGeometryCallPointer = false;
-				llinfos << "profile (avg of " << sUpdateGeometryCalls << " samples) = "
-					<< "VEC on " << percent_time_in_function
-					<< "% of time with "
-					<< (sUpdateGeometryElapsedTime / (F64)sUpdateGeometryCalls)
-					<< " seconds per call "
-					<< llendl;
-				sUpdateGeometryRunAvgOn[sUpdateGeometryRunCount] = percent_time_in_function ;
-				sUpdateGeometryElapsedTimeOn += sUpdateGeometryElapsedTime;
-
-				sUpdateGeometryCalls = 0;
-				sUpdateGeometryRunCount++;
-				F64 a = 0.0, b = 0.0;
-				for(U32 i = 0; i<sUpdateGeometryRunCount; i++)
-				{
-					a += sUpdateGeometryRunAvgOff[i];
-					b += sUpdateGeometryRunAvgOn[i];
-				}
-				a /= sUpdateGeometryRunCount;
-				b /= sUpdateGeometryRunCount;
-				F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn;
-				llinfos << "run averages (" << (F64)sUpdateGeometryRunCount
-					<< "/10) vectorize off " << a
-					<< "% : vectorize type " << sVectorizeProcessor
-					<< " " << b
-					<< "% : performance boost " 
-					<< perf_boost * 100.0
-					<< "%"
-					<< llendl ;
-				if(sUpdateGeometryRunCount == 10)
-				{
-					// In case user runs test again, force reset of data on
-					// next run.
-					sUpdateGeometryGlobalTime = 0.0;
-
-					// We have data now on which version is faster.  Switch to that
-					// code and save the data for next run.
-					gSavedSettings.setBOOL("VectorizePerfTest", FALSE);
-
-					if (perf_boost > 0.0)
-					{
-						llinfos << "Vectorization improves avatar skinning performance, "
-							<< "keeping on for future runs."
-							<< llendl;
-						gSavedSettings.setBOOL("VectorizeSkin", TRUE);
-					}
-					else
-					{
-						// SIMD decreases performance, fall back to original code
-						llinfos << "Vectorization decreases avatar skinning performance, "
-							<< "switching back to original code."
-							<< llendl;
-
-						gSavedSettings.setBOOL("VectorizeSkin", FALSE);
-					}
-				}
-			}
-			sUpdateGeometryElapsedTime = 0.0f;
-		}
-	}
+	uploadJointMatrices();
+	updateGeometry(mFace, mMesh);
 }
 
 void LLViewerJointMesh::dump()
diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h
index cab1205d618..0191f0cae8f 100644
--- a/indra/newview/llviewerjointmesh.h
+++ b/indra/newview/llviewerjointmesh.h
@@ -143,23 +143,10 @@ class LLViewerJointMesh : public LLViewerJoint
 
 	/*virtual*/ BOOL isAnimatable() const { return FALSE; }
 	
-	static void updateVectorize(); // Update globals when settings variables change
-	
 private:
-	// Avatar vertex skinning is a significant performance issue on computers
-	// with avatar vertex programs turned off (for example, most Macs).  We
-	// therefore have custom versions that use SIMD instructions.
-	//
-	// These functions require compiler options for SSE2, SSE, or neither, and
-	// hence are contained in separate individual .cpp files.  JC
-	static void updateGeometryOriginal(LLFace* face, LLPolyMesh* mesh);
-	// generic vector code, used for Altivec
-	static void updateGeometryVectorized(LLFace* face, LLPolyMesh* mesh);
-	static void updateGeometrySSE(LLFace* face, LLPolyMesh* mesh);
-	static void updateGeometrySSE2(LLFace* face, LLPolyMesh* mesh);
-
-	// Use a fuction pointer to indicate which version we are running.
-	static void (*sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh);
+
+	//copy mesh into given face's vertex buffer, applying current animation pose
+	static void updateGeometry(LLFace* face, LLPolyMesh* mesh);
 
 private:
 	// Allocate skin data
diff --git a/indra/newview/llviewerjointmesh_sse.cpp b/indra/newview/llviewerjointmesh_sse.cpp
deleted file mode 100644
index 00ed47e091b..00000000000
--- a/indra/newview/llviewerjointmesh_sse.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/** 
- * @file llviewerjointmesh_sse.cpp
- * @brief SSE vectorized joint skinning code, only used when video card does
- * not support avatar vertex programs.
- *
- * *NOTE: Disabled on Windows builds. See llv4math.h for details.
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-//-----------------------------------------------------------------------------
-// Header Files
-//-----------------------------------------------------------------------------
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llviewerjointmesh.h"
-
-// project includes
-#include "llface.h"
-#include "llpolymesh.h"
-
-// library includes
-#include "lldarray.h"
-#include "llv4math.h"		// for LL_VECTORIZE
-#include "llv4matrix3.h"
-#include "llv4matrix4.h"
-#include "v3math.h"
-
-
-#if LL_VECTORIZE
-
-inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j)
-{
-	m.mV[VX] = _mm_loadu_ps(w->mMatrix[VX]);
-	m.mV[VY] = _mm_loadu_ps(w->mMatrix[VY]);
-	m.mV[VZ] = _mm_loadu_ps(w->mMatrix[VZ]);
-	m.mV[VW] = _mm_loadu_ps(w->mMatrix[VW]);
-	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VX]), m.mV[VX])); // ( ax * vx ) + vw
-	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VY]), m.mV[VY]));
-	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VZ]), m.mV[VZ]));
-}
-
-// static
-void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
-{
-	// This cannot be a file-level static because it will be initialized
-	// before main() using SSE code, which will crash on non-SSE processors.
-	static LLV4Matrix4	sJointMat[32];
-	LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData;
-
-	//upload joint pivots/matrices
-	for(S32 j = 0, jend = joint_data.count(); j < jend ; ++j )
-	{
-		matrix_translate(sJointMat[j], joint_data[j]->mWorldMatrix,
-			joint_data[j]->mSkinJoint ?
-				joint_data[j]->mSkinJoint->mRootToJointSkinOffset
-				: joint_data[j+1]->mSkinJoint->mRootToParentJointSkinOffset);
-	}
-
-	F32					weight		= F32_MAX;
-	LLV4Matrix4			blend_mat;
-
-	LLStrider<LLVector3> o_vertices;
-	LLStrider<LLVector3> o_normals;
-
-	LLVertexBuffer *buffer = face->getVertexBuffer();
-	buffer->getVertexStrider(o_vertices,  mesh->mFaceVertexOffset);
-	buffer->getNormalStrider(o_normals,   mesh->mFaceVertexOffset);
-
-	const F32*			weights			= mesh->getWeights();
-	const LLVector3*	coords			= (const LLVector3*)mesh->getCoords();
-	const LLVector3*	normals			= (const LLVector3*)mesh->getNormals();
-	for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index)
-	{
-		if( weight != weights[index])
-		{
-			S32 joint = llfloor(weight = weights[index]);
-			blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint);
-		}
-		blend_mat.multiply(coords[index], o_vertices[index]);
-		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
-	}
-
-	buffer->flush();
-}
-
-#else
-
-void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
-{
-	LLViewerJointMesh::updateGeometryVectorized(face, mesh);
-}
-
-#endif
diff --git a/indra/newview/llviewerjointmesh_sse2.cpp b/indra/newview/llviewerjointmesh_sse2.cpp
deleted file mode 100644
index c2296dd5696..00000000000
--- a/indra/newview/llviewerjointmesh_sse2.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/** 
- * @file llviewerjointmesh_sse2.cpp
- * @brief SSE vectorized joint skinning code, only used when video card does
- * not support avatar vertex programs.
- *
- * *NOTE: Disabled on Windows builds. See llv4math.h for details.
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-// Visual Studio required settings for this file:
-// Precompiled Headers OFF
-// Code Generation: SSE2
-
-//-----------------------------------------------------------------------------
-// Header Files
-//-----------------------------------------------------------------------------
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llviewerjointmesh.h"
-
-// project includes
-#include "llface.h"
-#include "llpolymesh.h"
-
-// library includes
-#include "lldarray.h"
-#include "llstrider.h"
-#include "llv4math.h"		// for LL_VECTORIZE
-#include "llv4matrix3.h"
-#include "llv4matrix4.h"
-#include "m4math.h"
-#include "v3math.h"
-
-
-#if LL_VECTORIZE
-
-
-inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j)
-{
-	m.mV[VX] = _mm_loadu_ps(w->mMatrix[VX]);
-	m.mV[VY] = _mm_loadu_ps(w->mMatrix[VY]);
-	m.mV[VZ] = _mm_loadu_ps(w->mMatrix[VZ]);
-	m.mV[VW] = _mm_loadu_ps(w->mMatrix[VW]);
-	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VX]), m.mV[VX])); // ( ax * vx ) + vw
-	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VY]), m.mV[VY]));
-	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VZ]), m.mV[VZ]));
-}
-
-// static
-void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh)
-{
-	// This cannot be a file-level static because it will be initialized
-	// before main() using SSE code, which will crash on non-SSE processors.
-	static LLV4Matrix4	sJointMat[32];
-	LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData;
-
-	//upload joint pivots/matrices
-	for(S32 j = 0, jend = joint_data.count(); j < jend ; ++j )
-	{
-		matrix_translate(sJointMat[j], joint_data[j]->mWorldMatrix,
-			joint_data[j]->mSkinJoint ?
-				joint_data[j]->mSkinJoint->mRootToJointSkinOffset
-				: joint_data[j+1]->mSkinJoint->mRootToParentJointSkinOffset);
-	}
-
-	F32					weight		= F32_MAX;
-	LLV4Matrix4			blend_mat;
-
-	LLStrider<LLVector3> o_vertices;
-	LLStrider<LLVector3> o_normals;
-
-	LLVertexBuffer *buffer = face->getVertexBuffer();
-	buffer->getVertexStrider(o_vertices,  mesh->mFaceVertexOffset);
-	buffer->getNormalStrider(o_normals,   mesh->mFaceVertexOffset);
-
-	const F32*			weights			= mesh->getWeights();
-	const LLVector3*	coords			= (const LLVector3*)mesh->getCoords();
-	const LLVector3*	normals			= (const LLVector3*)mesh->getNormals();
-	for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index)
-	{
-		if( weight != weights[index])
-		{
-			S32 joint = llfloor(weight = weights[index]);
-			blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint);
-		}
-		blend_mat.multiply(coords[index], o_vertices[index]);
-		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
-	}
-	
-	//setBuffer(0) called in LLVOAvatar::renderSkinned
-}
-
-#else
-
-void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh)
-{
-	LLViewerJointMesh::updateGeometryVectorized(face, mesh);
-}
-
-#endif
diff --git a/indra/newview/llviewerjointmesh_vec.cpp b/indra/newview/llviewerjointmesh_vec.cpp
deleted file mode 100644
index a8713b6f058..00000000000
--- a/indra/newview/llviewerjointmesh_vec.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/** 
- * @file llviewerjointmesh_vec.cpp
- * @brief Compiler-generated vectorized joint skinning code, works well on
- * Altivec processors (PowerPC Mac)
- *
- * *NOTE: See llv4math.h for notes on SSE/Altivec vector code.
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-//-----------------------------------------------------------------------------
-// Header Files
-//-----------------------------------------------------------------------------
-#include "llviewerprecompiledheaders.h"
-
-#include "llviewerjointmesh.h"
-
-#include "llface.h"
-#include "llpolymesh.h"
-#include "llv4math.h"
-#include "llv4matrix3.h"
-#include "llv4matrix4.h"
-
-// Generic vectorized code, uses compiler defaults, works well for Altivec
-// on PowerPC.
-
-// static
-void LLViewerJointMesh::updateGeometryVectorized(LLFace *face, LLPolyMesh *mesh)
-{
-#if 0
-	static LLV4Matrix4	sJointMat[32];
-	LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData;
-	S32 j, joint_num, joint_end = joint_data.count();
-	LLV4Vector3 pivot;
-
-	//upload joint pivots/matrices
-	for(j = joint_num = 0; joint_num < joint_end ; ++joint_num )
-	{
-		LLSkinJoint *sj;
-		const LLMatrix4 *	wm = joint_data[joint_num]->mWorldMatrix;
-		if (NULL == (sj = joint_data[joint_num]->mSkinJoint))
-		{
-				sj = joint_data[++joint_num]->mSkinJoint;
-				((LLV4Matrix3)(sJointMat[j] = *wm)).multiply(sj->mRootToParentJointSkinOffset, pivot);
-				sJointMat[j++].translate(pivot);
-				wm = joint_data[joint_num]->mWorldMatrix;
-		}
-		((LLV4Matrix3)(sJointMat[j] = *wm)).multiply(sj->mRootToJointSkinOffset, pivot);
-		sJointMat[j++].translate(pivot);
-	}
-
-	F32					weight		= F32_MAX;
-	LLV4Matrix4			blend_mat;
-
-	LLStrider<LLVector3> o_vertices;
-	LLStrider<LLVector3> o_normals;
-
-	LLVertexBuffer *buffer = face->mVertexBuffer;
-	buffer->getVertexStrider(o_vertices,  mesh->mFaceVertexOffset);
-	buffer->getNormalStrider(o_normals,   mesh->mFaceVertexOffset);
-
-	const F32*			weights			= mesh->getWeights();
-	const LLVector3*	coords			= mesh->getCoords();
-	const LLVector3*	normals			= mesh->getNormals();
-	for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index)
-	{
-		if( weight != weights[index])
-		{
-			S32 joint = llfloor(weight = weights[index]);
-			blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint);
-		}
-		blend_mat.multiply(coords[index], o_vertices[index]);
-		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
-	}
-
-	buffer->flush();
-#endif
-}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 22d95563d86..9fbc28a5e1f 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1038,26 +1038,6 @@ class LLAdvancedCheckRandomizeFramerate : public view_listener_t
 	}
 };
 
-void run_vectorize_perf_test(void *)
-{
-	gSavedSettings.setBOOL("VectorizePerfTest", TRUE);
-}
-
-
-////////////////////////////////
-// RUN Vectorized Perform Test//
-////////////////////////////////
-
-
-class LLAdvancedVectorizePerfTest : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		run_vectorize_perf_test(NULL);
-		return true;
-	}
-};
-
 ///////////////////////////
 //// PERIODIC SLOW FRAME //
 ///////////////////////////
@@ -8117,7 +8097,6 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate");
 	view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame");
 	view_listener_t::addMenu(new LLAdvancedCheckPeriodicSlowFrame(), "Advanced.CheckPeriodicSlowFrame");
-	view_listener_t::addMenu(new LLAdvancedVectorizePerfTest(), "Advanced.VectorizePerfTest");
 	view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest");
 	view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest");
 	view_listener_t::addMenu(new LLAdvancedHandleAttachedLightParticles(), "Advanced.HandleAttachedLightParticles");
-- 
GitLab


From ec2dfa968177b0a9a016238cc2a2522f08efcfed Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 9 Nov 2011 12:18:17 -0600
Subject: [PATCH 176/933] SH-24114 Remove unused variables

---
 indra/newview/llviewerjointmesh.cpp | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index b18323bed00..76f4e18c27c 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -820,19 +820,6 @@ void LLViewerJointMesh::updateGeometry(LLFace *mFace, LLPolyMesh *mMesh)
 	buffer->flush();
 }
 
-const U32 UPDATE_GEOMETRY_CALL_MASK			= 0x1FFF; // 8K samples before overflow
-const U32 UPDATE_GEOMETRY_CALL_OVERFLOW		= ~UPDATE_GEOMETRY_CALL_MASK;
-static bool sUpdateGeometryCallPointer		= false;
-static F64 sUpdateGeometryGlobalTime		= 0.0 ;
-static F64 sUpdateGeometryElapsedTime		= 0.0 ;
-static F64 sUpdateGeometryElapsedTimeOff	= 0.0 ;
-static F64 sUpdateGeometryElapsedTimeOn		= 0.0 ;
-static F64 sUpdateGeometryRunAvgOff[10];
-static F64 sUpdateGeometryRunAvgOn[10];
-static U32 sUpdateGeometryRunCount			= 0 ;
-static U32 sUpdateGeometryCalls				= 0 ;
-static U32 sUpdateGeometryLastProcessor		= 0 ;
-
 void LLViewerJointMesh::updateJointGeometry()
 {
 	if (!(mValid
-- 
GitLab


From ecadf5131a87a0bb9633a2b3875e16a410a98de5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Nov 2011 10:03:44 -0600
Subject: [PATCH 177/933] SH-2240 Fix for red moon.

---
 indra/newview/lldrawpoolwlsky.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index f2d077030cf..22b06d1aefa 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -267,10 +267,6 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
 
 	if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount())
 	{
-		if (gPipeline.canUseVertexShaders())
-		{
-			gHighlightProgram.bind();
-		}
 		// *NOTE: even though we already bound this texture above for the
 		// stars register combiners, we bind again here for defensive reasons,
 		// since LLImageGL::bind detects that it's a noop, and optimizes it out.
@@ -284,7 +280,14 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
 			
 		color.mV[3] = llclamp(a, 0.f, 1.f);
 		
+		if (gPipeline.canUseVertexShaders())
+		{
+			gHighlightProgram.bind();
+			gHighlightProgram.uniform4fv(LLShaderMgr::HIGHLIGHT_COLOR, 1, color.mV);
+		}
+
 		LLFacePool::LLOverrideFaceColor color_override(this, color);
+		
 		face->renderIndexed();
 
 		if (gPipeline.canUseVertexShaders())
-- 
GitLab


From aa8f3d30704ea43a8fc2f9262a57968277c4db20 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Nov 2011 10:04:44 -0600
Subject: [PATCH 178/933] SH-2644 WIP -- remove debug displays pertaining to
 upload/download queues

---
 indra/newview/llviewerwindow.cpp | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index e3bf6327e7a..55834f5d993 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -737,37 +737,6 @@ class LLDebugText
 			}
 		}				
 
-		//temporary hack to give feedback on mesh upload progress
-		if (!gMeshRepo.mUploads.empty())
-		{
-			for (std::vector<LLMeshUploadThread*>::iterator iter = gMeshRepo.mUploads.begin(); 
-				iter != gMeshRepo.mUploads.end(); ++iter)
-			{
-				LLMeshUploadThread* thread = *iter;
-
-				addText(xpos, ypos, llformat("Mesh Uploads: %d", 
-								thread->mPendingUploads));
-				ypos += y_inc;
-			}
-		}
-
-		if (!gMeshRepo.mPendingRequests.empty() ||
-			!gMeshRepo.mThread->mHeaderReqQ.empty() ||
-			!gMeshRepo.mThread->mLODReqQ.empty())
-		{
-			LLMutexLock lock(gMeshRepo.mThread->mMutex);
-			S32 pending = (S32) gMeshRepo.mPendingRequests.size();
-			S32 header = (S32) gMeshRepo.mThread->mHeaderReqQ.size();
-			S32 lod = (S32) gMeshRepo.mThread->mLODReqQ.size();
-
-			addText(xpos, ypos, llformat ("Mesh Queue - %d pending (%d:%d header | %d:%d LOD)", 
-												pending,
-												LLMeshRepoThread::sActiveHeaderRequests, header,
-												LLMeshRepoThread::sActiveLODRequests, lod));
-
-			ypos += y_inc;
-		}
-		
 		if (gSavedSettings.getBOOL("DebugShowTextureInfo"))
 		{
 			LLViewerObject* objectp = NULL ;
-- 
GitLab


From c8f558f6775d62f03d6caab19668df80e95e8a8b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Nov 2011 11:39:08 -0600
Subject: [PATCH 179/933] SH-2240 Better fix for red moon -- stop special
 casing "highlight_color" as a parameter.

---
 indra/llrender/llshadermgr.cpp                             | 3 +--
 indra/llrender/llshadermgr.h                               | 1 -
 .../app_settings/shaders/class1/interface/highlightF.glsl  | 4 ++--
 indra/newview/lldrawpoolalpha.cpp                          | 3 ++-
 indra/newview/lldrawpoolterrain.cpp                        | 2 +-
 indra/newview/lldrawpoolwlsky.cpp                          | 1 -
 indra/newview/pipeline.cpp                                 | 7 ++-----
 7 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index b390037a9c0..e30ef73686a 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -965,8 +965,7 @@ void LLShaderMgr::initAttribsAndUniforms()
 	llassert(mReservedUniforms.size() == LLShaderMgr::PROJECTOR_AMBIENT_LOD+1);
 
 	mReservedUniforms.push_back("color");
-	mReservedUniforms.push_back("highlight_color");
-	
+		
 	mReservedUniforms.push_back("diffuseMap");
 	mReservedUniforms.push_back("specularMap");
 	mReservedUniforms.push_back("bumpMap");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 82ce2dfff25..6ee95339f2e 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -70,7 +70,6 @@ class LLShaderMgr
 		PROJECTOR_LOD,
 		PROJECTOR_AMBIENT_LOD,
 		DIFFUSE_COLOR,
-		HIGHLIGHT_COLOR,
 		DIFFUSE_MAP,
 		SPECULAR_MAP,
 		BUMP_MAP,
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 574adeb50c4..ecbc30f05ff 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -27,12 +27,12 @@
 out vec4 gl_FragColor;
 #endif
 
-uniform vec4 highlight_color;
+uniform vec4 color;
 uniform sampler2D diffuseMap;
 
 VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	gl_FragColor = highlight_color*texture2D(diffuseMap, vary_texcoord0.xy);
+	gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 54f937d8fd4..ddb7d3ceebd 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -327,8 +327,9 @@ void LLDrawPoolAlpha::render(S32 pass)
 		{
 			gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
 		}
+
 		gGL.diffuseColor4f(1,0,0,1);
-		
+				
 		LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f);
 		gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ;
 		renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX |
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index addb18a1d5b..b8e653c5de8 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -246,7 +246,7 @@ void LLDrawPoolTerrain::render(S32 pass)
 			sShader->unbind();
 			sShader = &gHighlightProgram;
 			sShader->bind();
-			sShader->uniform4f(LLShaderMgr::HIGHLIGHT_COLOR, 1,1,1,1);
+			gGL.diffuseColor4f(1,1,1,1);
 			LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
 			glPolygonOffset(-1.0f, -1.0f);
 			renderOwnership();
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 22b06d1aefa..caf15fe1cbb 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -283,7 +283,6 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
 		if (gPipeline.canUseVertexShaders())
 		{
 			gHighlightProgram.bind();
-			gHighlightProgram.uniform4fv(LLShaderMgr::HIGHLIGHT_COLOR, 1, color.mV);
 		}
 
 		LLFacePool::LLOverrideFaceColor color_override(this, color);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 49f83fdb0d6..3f91c3cddce 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3583,7 +3583,7 @@ void LLPipeline::renderHighlights()
 	if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
 	{
 		gHighlightProgram.bind();
-		gHighlightProgram.uniform4f(LLShaderMgr::HIGHLIGHT_COLOR,1,1,1,0.5f);
+		gGL.diffuseColor4f(1,1,1,0.5f);
 	}
 	
 	if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
@@ -3613,10 +3613,7 @@ void LLPipeline::renderHighlights()
 	{
 		// Paint 'em red!
 		color.setVec(1.f, 0.f, 0.f, 0.5f);
-		if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0))
-		{
-			gHighlightProgram.uniform4f(LLShaderMgr::HIGHLIGHT_COLOR,1,0,0,0.5f);
-		}
+		
 		int count = mHighlightFaces.size();
 		for (S32 i = 0; i < count; i++)
 		{
-- 
GitLab


From 76bd8cee1120ac531d56b9897b135e9c1af1bb16 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Nov 2011 14:48:48 -0600
Subject: [PATCH 180/933] SH-2644 Fix debug display that shows selection
 triangle count and streaming cost

---
 indra/llmath/llvolume.cpp        | 14 ++++++++++++--
 indra/llmath/llvolume.h          |  2 +-
 indra/newview/llselectmgr.cpp    |  4 ++--
 indra/newview/llselectmgr.h      |  2 +-
 indra/newview/llviewerobject.cpp |  4 ++--
 indra/newview/llviewerobject.h   |  4 ++--
 indra/newview/llviewerwindow.cpp | 11 +++++++----
 indra/newview/llvovolume.cpp     |  4 ++--
 indra/newview/llvovolume.h       |  2 +-
 9 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 1a95f9cd463..da0fa329633 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -4305,15 +4305,25 @@ S32 LLVolume::getNumTriangleIndices() const
 }
 
 
-S32 LLVolume::getNumTriangles() const
+S32 LLVolume::getNumTriangles(S32* vcount) const
 {
 	U32 triangle_count = 0;
+	U32 vertex_count = 0;
 
 	for (S32 i = 0; i < getNumVolumeFaces(); ++i)
 	{
-		triangle_count += getVolumeFace(i).mNumIndices/3;
+		const LLVolumeFace& face = getVolumeFace(i);
+		triangle_count += face.mNumIndices/3;
+
+		vertex_count += face.mNumVertices;
 	}
 
+
+	if (vcount)
+	{
+		*vcount = vertex_count;
+	}
+	
 	return triangle_count;
 }
 
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index f0e59a3c005..afd1ec5eed1 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -990,7 +990,7 @@ class LLVolume : public LLRefCount
 	S32 getNumTriangleIndices() const;
 	static void getLoDTriangleCounts(const LLVolumeParams& params, S32* counts);
 
-	S32 getNumTriangles() const;
+	S32 getNumTriangles(S32* vcount = NULL) const;
 
 	void generateSilhouetteVertices(std::vector<LLVector3> &vertices, 
 									std::vector<LLVector3> &normals, 
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 2971ee710a0..830a7778ac5 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6524,7 +6524,7 @@ F32 LLObjectSelection::getSelectedObjectStreamingCost(S32* total_bytes, S32* vis
 	return cost;
 }
 
-U32 LLObjectSelection::getSelectedObjectTriangleCount()
+U32 LLObjectSelection::getSelectedObjectTriangleCount(S32* vcount)
 {
 	U32 count = 0;
 	for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
@@ -6534,7 +6534,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
 		
 		if (object)
 		{
-			count += object->getTriangleCount();
+			count += object->getTriangleCount(vcount);
 		}
 	}
 
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 166616e13e0..87ada5ac6b6 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -286,7 +286,7 @@ class LLObjectSelection : public LLRefCount
 	S32 getSelectedObjectRenderCost();
 	
 	F32 getSelectedObjectStreamingCost(S32* total_bytes = NULL, S32* visible_bytes = NULL);
-	U32 getSelectedObjectTriangleCount();
+	U32 getSelectedObjectTriangleCount(S32* vcount = NULL);
 
 	S32 getTECount();
 	S32 getRootObjectCount();
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index d81e67bfe24..b8772971aa6 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -3219,12 +3219,12 @@ F32 LLViewerObject::getLinksetPhysicsCost()
 	return mLinksetPhysicsCost;
 }
 
-F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes)
+F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const
 {
 	return 0.f;
 }
 
-U32 LLViewerObject::getTriangleCount()
+U32 LLViewerObject::getTriangleCount(S32* vcount) const
 {
 	return 0;
 }
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index a77725c1ca1..c8152e1539d 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -340,8 +340,8 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 	
 	virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE);
 
-	virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL);
-	virtual U32 getTriangleCount();
+	virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
+	virtual U32 getTriangleCount(S32* vcount = NULL) const;
 	virtual U32 getHighLODTriangleCount();
 
 	void setObjectCost(F32 cost);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 55834f5d993..8af83246da6 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -489,6 +489,7 @@ class LLDebugText
 			{
 				F32 cost = 0.f;
 				S32 count = 0;
+				S32 vcount = 0;
 				S32 object_count = 0;
 				S32 total_bytes = 0;
 				S32 visible_bytes = 0;
@@ -510,7 +511,9 @@ class LLDebugText
 								S32 bytes = 0;	
 								S32 visible = 0;
 								cost += object->getStreamingCost(&bytes, &visible);
-								count += object->getTriangleCount();
+								S32 vt = 0;
+								count += object->getTriangleCount(&vt);
+								vcount += vt;
 								total_bytes += bytes;
 								visible_bytes += visible;
 							}
@@ -521,15 +524,15 @@ class LLDebugText
 				{
 					label = "Selection";
 					cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectStreamingCost(&total_bytes, &visible_bytes);
-					count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount();
+					count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount(&vcount);
 					object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
 				}
 					
 				addText(xpos,ypos, llformat("%s streaming cost: %.1f", label, cost));
 				ypos += y_inc;
 
-				addText(xpos, ypos, llformat("    %.3f KTris, %.1f/%.1f KB, %d objects",
-										count/1000.f, visible_bytes/1024.f, total_bytes/1024.f, object_count));
+				addText(xpos, ypos, llformat("    %.3f KTris, %.3f KVerts, %.1f/%.1f KB, %d objects",
+										count/1000.f, vcount/1000.f, visible_bytes/1024.f, total_bytes/1024.f, object_count));
 				ypos += y_inc;
 			
 			}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index b75a0a799a2..827c5b9cb58 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3266,13 +3266,13 @@ void LLVOVolume::updateRenderComplexity()
 	mRenderComplexity_current = 0;
 }
 
-U32 LLVOVolume::getTriangleCount() const
+U32 LLVOVolume::getTriangleCount(S32* vcount) const
 {
 	U32 count = 0;
 	LLVolume* volume = getVolume();
 	if (volume)
 	{
-		count = volume->getNumTriangles();
+		count = volume->getNumTriangles(vcount);
 	}
 
 	return count;
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index b6347526eee..64457975f8a 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -133,7 +133,7 @@ class LLVOVolume : public LLViewerObject
 				U32 	getRenderCost(texture_cost_t &textures) const;
 	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
 
-	/*virtual*/ U32		getTriangleCount() const;
+	/*virtual*/ U32		getTriangleCount(S32* vcount = NULL) const;
 	/*virtual*/ U32		getHighLODTriangleCount();
 	/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, 
 										  S32 face = -1,                        // which face to check, -1 = ALL_SIDES
-- 
GitLab


From df546bfba965ec9ec43b7611bb25b5b5ec8f01b5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Nov 2011 16:12:50 -0600
Subject: [PATCH 181/933] SH-2666 Tweak depth of field optimizations based on
 resident feedback.

---
 indra/llrender/llshadermgr.cpp                |  1 +
 indra/llrender/llshadermgr.h                  |  1 +
 indra/newview/app_settings/settings.xml       | 14 +++++++++++++-
 .../shaders/class1/deferred/cofF.glsl         |  2 +-
 .../shaders/class1/deferred/dofCombineF.glsl  | 19 +++++++++++++++++--
 .../class1/deferred/postDeferredF.glsl        |  1 +
 indra/newview/pipeline.cpp                    |  8 +++++++-
 indra/newview/pipeline.h                      |  1 +
 8 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index e30ef73686a..947c4443d1d 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1046,6 +1046,7 @@ void LLShaderMgr::initAttribsAndUniforms()
 	mReservedUniforms.push_back("tan_pixel_angle");
 	mReservedUniforms.push_back("magnification");
 	mReservedUniforms.push_back("max_cof");
+	mReservedUniforms.push_back("res_scale");
 
 	mReservedUniforms.push_back("depthMap");
 	mReservedUniforms.push_back("shadowMap0");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 6ee95339f2e..950e6c9c2f0 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -141,6 +141,7 @@ class LLShaderMgr
 		DOF_TAN_PIXEL_ANGLE,
 		DOF_MAGNIFICATION,
 		DOF_MAX_COF,
+		DOF_RES_SCALE,
 
 		DEFERRED_DEPTH,
 		DEFERRED_SHADOW0,
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d07efa6a37d..aa08b0783e1 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8017,7 +8017,19 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
-  
+
+  <key>CameraDoFResScale</key>
+  <map>
+    <key>Comment</key>
+    <string>Amount to scale down depth of field resolution.  Valid range is 0.25 (quarter res) to 1.0 (full res)</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>0.7</real>
+  </map>
+
   <key>RenderSpotLightsInNondeferred</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index 56fa4e693b9..88fe3c3dee3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -83,5 +83,5 @@ void main()
 	
 	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
 	gl_FragColor.rgb = diff.rgb + bloom.rgb;
-	gl_FragColor.a = sc/10.f;
+	gl_FragColor.a = sc/max_cof;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index d2903b545cf..21453aefaa9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -36,6 +36,7 @@ uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
 uniform float max_cof;
+uniform float res_scale;
 
 VARYING vec2 vary_fragcoord;
 
@@ -43,10 +44,24 @@ void main()
 {
 	vec2 tc = vary_fragcoord.xy;
 	
-	vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*0.5);
+	vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*res_scale);
 	
 	vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
 
-	float a = min(diff.a * max_cof*0.333, 1.0);
+	float a = min(diff.a * max_cof*res_scale*res_scale, 1.0);
+
+	if (a > 0.25 && a < 0.75)
+	{ //help out the transition a bit
+		float sc = a/res_scale;
+		
+		vec4 col;
+		col = texture2DRect(lightMap, vary_fragcoord.xy+vec2(sc,sc));
+		col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(-sc,sc));
+		col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(sc,-sc));
+		col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(-sc,-sc));
+		
+		diff = mix(diff, col*0.25, a);
+	}
+
 	gl_FragColor = mix(diff, dof, a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 629648ddc38..4603d99c5e5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -34,6 +34,7 @@ uniform sampler2DRect diffuseRect;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 uniform float max_cof;
+uniform float res_scale;
 
 VARYING vec2 vary_fragcoord;
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 3f91c3cddce..da4ffd97ded 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -186,6 +186,7 @@ F32 LLPipeline::RenderShadowErrorCutoff;
 F32 LLPipeline::RenderShadowFOVCutoff;
 BOOL LLPipeline::CameraOffset;
 F32 LLPipeline::CameraMaxCoF;
+F32 LLPipeline::CameraDoFResScale;
 
 const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f;
 const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f;
@@ -929,6 +930,7 @@ void LLPipeline::refreshCachedSettings()
 	RenderShadowFOVCutoff = gSavedSettings.getF32("RenderShadowFOVCutoff");
 	CameraOffset = gSavedSettings.getBOOL("CameraOffset");
 	CameraMaxCoF = gSavedSettings.getF32("CameraMaxCoF");
+	CameraDoFResScale = gSavedSettings.getF32("CameraDoFResScale");
 }
 
 void LLPipeline::releaseGLBuffers()
@@ -6549,6 +6551,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle));
 				shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification);
 				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+				shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
 
 				gGL.begin(LLRender::TRIANGLE_STRIP);
 				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
@@ -6568,7 +6571,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 			{ //perform DoF sampling at half-res (preserve alpha channel)
 				mScreen.bindTarget();
-				glViewport(0,0,mScreen.getWidth()/2, mScreen.getHeight()/2);
+				glViewport(0,0,mScreen.getWidth()*CameraDoFResScale, mScreen.getHeight()*CameraDoFResScale);
 				gGL.setColorMask(true, false);
 
 				shader = &gDeferredPostProgram;
@@ -6580,6 +6583,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				}
 
 				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+				shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
 
 				gGL.begin(LLRender::TRIANGLE_STRIP);
 				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
@@ -6611,9 +6615,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				if (channel > -1)
 				{
 					mScreen.bindTexture(0, channel);
+					gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
 				}
 
 				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
+				shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
 
 				gGL.begin(LLRender::TRIANGLE_STRIP);
 				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index e607e0aec64..8b6532ca257 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -846,6 +846,7 @@ class LLPipeline
 	static F32 RenderShadowFOVCutoff;
 	static BOOL CameraOffset;
 	static F32 CameraMaxCoF;
+	static F32 CameraDoFResScale;
 };
 
 void render_bbox(const LLVector3 &min, const LLVector3 &max);
-- 
GitLab


From e2e154d94ea0684ede8c7c1b70fff555edbd6065 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 10 Nov 2011 16:33:34 -0600
Subject: [PATCH 182/933] SH-2659 Fix for basic shaders having no affect when
 gl version < 2.0

---
 indra/newview/llviewershadermgr.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 32978a0d04d..18ae83e3b6e 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -372,10 +372,6 @@ void LLViewerShaderMgr::setShaders()
 			gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
 		}
 	}
-	else if (gGLManager.mGLVersion < 2.f)
-	{ //NEVER use shaders on a pre 2.0 context
-		gSavedSettings.setBOOL("VertexShaderEnable", FALSE);
-	}
 	
 	//setup preprocessor definitions
 	LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits);
-- 
GitLab


From 4005a820f26d4287bf5c14ec011d4f792c5b82bc Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 11 Nov 2011 01:37:41 +0200
Subject: [PATCH 183/933] EXP-1563 FIXED Negative upload cost displayed on the
 "Save to My Inventory" button.

Update upload cost in the button label when economy data arrives from server.
---
 indra/llinventory/lleconomy.cpp          | 27 ++++++++++++++++++++++++
 indra/llinventory/lleconomy.h            | 16 ++++++++++++++
 indra/newview/llpanelsnapshotoptions.cpp | 16 ++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/indra/llinventory/lleconomy.cpp b/indra/llinventory/lleconomy.cpp
index c6eaa6d3e14..d643ea6ed90 100644
--- a/indra/llinventory/lleconomy.cpp
+++ b/indra/llinventory/lleconomy.cpp
@@ -48,6 +48,31 @@ LLGlobalEconomy::LLGlobalEconomy()
 LLGlobalEconomy::~LLGlobalEconomy()
 { }
 
+void LLGlobalEconomy::addObserver(LLEconomyObserver* observer)
+{
+	mObservers.push_back(observer);
+}
+
+void LLGlobalEconomy::removeObserver(LLEconomyObserver* observer)
+{
+	std::list<LLEconomyObserver*>::iterator it =
+		std::find(mObservers.begin(), mObservers.end(), observer);
+	if (it != mObservers.end())
+	{
+		mObservers.erase(it);
+	}
+}
+
+void LLGlobalEconomy::notifyObservers()
+{
+	for (std::list<LLEconomyObserver*>::iterator it = mObservers.begin();
+		it != mObservers.end();
+		++it)
+	{
+		(*it)->onEconomyDataChange();
+	}
+}
+
 // static
 void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data)
 {
@@ -88,6 +113,8 @@ void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy*
 	econ_data->setTeleportPriceExponent(f);
 	msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i);
 	econ_data->setPriceGroupCreate(i);
+
+	econ_data->notifyObservers();
 }
 
 S32	LLGlobalEconomy::calculateTeleportCost(F32 distance) const
diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h
index cc6643f955e..eb2ecf71ba4 100644
--- a/indra/llinventory/lleconomy.h
+++ b/indra/llinventory/lleconomy.h
@@ -31,6 +31,16 @@
 class LLMessageSystem;
 class LLVector3;
 
+/**
+ * Register an observer to be notified of economy data updates coming from server.
+ */
+class LLEconomyObserver
+{
+public:
+	virtual ~LLEconomyObserver() {}
+	virtual void onEconomyDataChange() = 0;
+};
+
 class LLGlobalEconomy
 {
 public:
@@ -46,6 +56,10 @@ class LLGlobalEconomy
 
 	virtual void print();
 
+	void	addObserver(LLEconomyObserver* observer);
+	void	removeObserver(LLEconomyObserver* observer);
+	void	notifyObservers();
+
 	static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
 
 	S32		calculateTeleportCost(F32 distance) const;
@@ -89,6 +103,8 @@ class LLGlobalEconomy
 	S32		mTeleportMinPrice;
 	F32		mTeleportPriceExponent;
 	S32     mPriceGroupCreate;
+
+	std::list<LLEconomyObserver*> mObservers;
 };
 
 
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index df904b68365..554fabe5b3d 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -37,14 +37,18 @@
  */
 class LLPanelSnapshotOptions
 :	public LLPanel
+,	public LLEconomyObserver
 {
 	LOG_CLASS(LLPanelSnapshotOptions);
 
 public:
 	LLPanelSnapshotOptions();
+	~LLPanelSnapshotOptions();
 	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/ void onEconomyDataChange() { updateUploadCost(); }
 
 private:
+	void updateUploadCost();
 	void openPanel(const std::string& panel_name);
 	void onSaveToProfile();
 	void onSaveToEmail();
@@ -60,10 +64,22 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions()
 	mCommitCallbackRegistrar.add("Snapshot.SaveToEmail",		boost::bind(&LLPanelSnapshotOptions::onSaveToEmail,		this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToInventory",	boost::bind(&LLPanelSnapshotOptions::onSaveToInventory,	this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToComputer",		boost::bind(&LLPanelSnapshotOptions::onSaveToComputer,	this));
+
+	LLGlobalEconomy::Singleton::getInstance()->addObserver(this);
+}
+
+LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
+{
+	LLGlobalEconomy::Singleton::getInstance()->removeObserver(this);
 }
 
 // virtual
 void LLPanelSnapshotOptions::onOpen(const LLSD& key)
+{
+	updateUploadCost();
+}
+
+void LLPanelSnapshotOptions::updateUploadCost()
 {
 	S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
 	getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
-- 
GitLab


From 0c9d8d917a4281e2dea7fa2044e86735caca2aa9 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 10 Nov 2011 16:02:57 -0800
Subject: [PATCH 184/933] fixed build fixed handle downcast not initiating
 handle

---
 indra/llui/llhandle.h                 | 2 +-
 indra/llxuixml/llinitparam.h          | 2 ++
 indra/newview/llfloaterwebcontent.cpp | 4 ++--
 indra/newview/llfloaterwebcontent.h   | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/llui/llhandle.h b/indra/llui/llhandle.h
index c8fff72110e..e6390ee599b 100644
--- a/indra/llui/llhandle.h
+++ b/indra/llui/llhandle.h
@@ -169,7 +169,7 @@ class LLHandleProvider
 	typename LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const
 	{
 		LLHandle<U> downcast_handle;
-		downcast_handle.mTombStone = mHandle.mTombStone;
+		downcast_handle.mTombStone = getHandle().mTombStone;
 		return downcast_handle;
 	}
 
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 169a724bca3..f5f68767367 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -671,6 +671,7 @@ namespace LLInitParam
 		self_t& operator =(const self_t& other)
 		{
 			mValue = other.mValue;
+			return *this;
 		}
 
 	private:
@@ -741,6 +742,7 @@ namespace LLInitParam
 		self_t& operator =(const self_t& other)
 		{
 			*(static_cast<T*>(this)) = other;
+			return *this;
 		}
 	protected:
 		mutable S32 	mValidatedVersion;
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index f410c31f44f..d6db7aa6ad4 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -167,7 +167,7 @@ LLFloater* LLFloaterWebContent::create( Params p)
 //static
 void LLFloaterWebContent::closeRequest(const std::string &uuid)
 {
-	LLFloaterWebContent* floaterp = getInstance(uuid);
+	LLFloaterWebContent* floaterp = instance_tracker_t::getInstance(uuid);
 	if (floaterp)
 	{
 		floaterp->closeFloater(false);
@@ -177,7 +177,7 @@ void LLFloaterWebContent::closeRequest(const std::string &uuid)
 //static
 void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height)
 {
-	LLFloaterWebContent* floaterp = getInstance(uuid);
+	LLFloaterWebContent* floaterp = instance_tracker_t::getInstance(uuid);
 	if (floaterp)
 	{
 		floaterp->geometryChanged(x, y, width, height);
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index 6fc66d1ad8c..9d90306a9c8 100644
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -43,6 +43,7 @@ class LLFloaterWebContent :
 	public LLInstanceTracker<LLFloaterWebContent, std::string>
 {
 public:
+	typedef LLInstanceTracker<LLFloaterWebContent, std::string> instance_tracker_t;
     LOG_CLASS(LLFloaterWebContent);
 
 	struct _Params : public LLInitParam::Block<_Params>
-- 
GitLab


From 7d78c63c05579f72dc6998913245d793a2fbd87c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 10 Nov 2011 17:10:47 -0800
Subject: [PATCH 185/933] EXP-1504 : Allow opening of tab in tab containers
 when drag and dropping things. Added new param to LLButton to handle this
 (off by default). Refactor lltabcontainer code a bit while at it.

---
 indra/llui/llbutton.cpp       | 28 +++++++++++
 indra/llui/llbutton.h         |  7 +++
 indra/llui/lltabcontainer.cpp | 94 +++++++++++------------------------
 3 files changed, 65 insertions(+), 64 deletions(-)

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 74b8885e1ff..be657dbb9bb 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -104,6 +104,7 @@ LLButton::Params::Params()
 	use_draw_context_alpha("use_draw_context_alpha", true),
 	badge("badge"),
 	handle_right_mouse("handle_right_mouse"),
+	click_on_drag_and_drop("click_on_drag_and_drop", false),
 	held_down_delay("held_down_delay"),
 	button_flash_count("button_flash_count"),
 	button_flash_rate("button_flash_rate")
@@ -171,6 +172,7 @@ LLButton::LLButton(const LLButton::Params& p)
 	mHeldDownSignal(NULL),
 	mUseDrawContextAlpha(p.use_draw_context_alpha),
 	mHandleRightMouse(p.handle_right_mouse),
+	mClickOnDragAndDrop(p.click_on_drag_and_drop),		// if true, hovering on button while dragging -> click
 	mButtonFlashCount(p.button_flash_count),
 	mButtonFlashRate(p.button_flash_rate)
 {
@@ -1240,3 +1242,29 @@ BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask)
 	// just treat a double click as a second click
 	return handleMouseDown(x, y, mask);
 }
+
+// virtual
+BOOL LLButton::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string	&tooltip)
+{
+	const F32 CLICK_ON_DAD_DELAY_TIME = 0.5f;
+	if (mClickOnDragAndDrop)
+	{
+		// In that case, though the button doesn't really handles drops, it'll "click" if hovering on it
+		// while dragging something. That allows for instance drilling into tabbed containers.
+		// Note: we use the same timer as mouse down just as convenience and to avoid duplication.
+		if (mMouseDownTimer.getStarted())
+		{
+			if (mMouseDownTimer.getElapsedTimeF32() > CLICK_ON_DAD_DELAY_TIME )
+			{
+				onCommit();
+				mMouseDownTimer.stop();
+			}
+		}
+		else 
+		{
+			mMouseDownTimer.start();
+		}
+	}
+	// The true DaD effect is handled at the View level if any.
+	return LLView::handleDragAndDrop(x,	y, mask, drop, type, cargo_data,  accept, tooltip);
+}
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index deaa0823c61..47aa675c5eb 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -132,6 +132,7 @@ class LLButton
 		Optional<LLBadge::Params>	badge;
 
 		Optional<bool>				handle_right_mouse;
+		Optional<bool>				click_on_drag_and_drop;
 
 		Optional<S32>				button_flash_count;
 		Optional<F32>				button_flash_rate;
@@ -159,6 +160,11 @@ class LLButton
 	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleRightMouseUp(S32 x, S32 y, MASK mask);	
 	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask);
+	virtual BOOL	handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+									  EDragAndDropType cargo_type,
+									  void* cargo_data,
+									  EAcceptance* accept,
+									  std::string& tooltip_msg);
 	virtual void	draw();
 	/*virtual*/ BOOL postBuild();
 
@@ -376,6 +382,7 @@ class LLButton
 	LLFrameTimer				mFlashingTimer;
 
 	bool						mHandleRightMouse;
+	bool						mClickOnDragAndDrop;
 };
 
 // Build time optimization, generate once in .cpp file
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index ad1f3c504da..3b2751248b4 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1025,85 +1025,51 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 	}
 	else
 	{
+		LLButton::Params& p = (mCustomIconCtrlUsed ? custom_btn_params : normal_btn_params);
+		
+		p.rect(btn_rect);
+		p.font(mFont);
+		p.font_halign = mFontHalign;
+		p.label(trimmed_label);
+		p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
+		if (indent)
+		{
+			p.pad_left(indent);
+		}
+		p.pad_bottom( mLabelPadBottom );
+		p.scale_image(true);
+		p.tab_stop(false);
+		p.label_shadow(false);
+		p.follows.flags = FOLLOWS_LEFT;
+		p.click_on_drag_and_drop(true);
+		
 		if (mIsVertical)
 		{
-			LLButton::Params& p = (mCustomIconCtrlUsed)?
-					custom_btn_params:normal_btn_params;
-
 			p.name(std::string("vert tab button"));
-			p.rect(btn_rect);
-			p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
-			p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
-			p.font(mFont);
-			p.label(trimmed_label);
 			p.image_unselected(mMiddleTabParams.tab_left_image_unselected);
 			p.image_selected(mMiddleTabParams.tab_left_image_selected);
-			p.scale_image(true);
-			p.font_halign = mFontHalign;
-			p.pad_bottom( mLabelPadBottom );
-			p.tab_stop(false);
-			p.label_shadow(false);
-			if (indent)
-			{
-				p.pad_left(indent);
-			}
-			
-			
-			if(mCustomIconCtrlUsed)
-			{
-				btn = LLUICtrlFactory::create<LLCustomButtonIconCtrl>(custom_btn_params);
-				
-			}
-			else
-			{
-				btn = LLUICtrlFactory::create<LLButton>(p);
-			}
+			p.follows.flags = p.follows.flags() | FOLLOWS_TOP;
 		}
 		else
 		{
-			LLButton::Params& p = (mCustomIconCtrlUsed)?
-					custom_btn_params:normal_btn_params;
 			p.name(std::string(child->getName()) + " tab");
-			p.rect(btn_rect);
-			p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child));
-			p.font(mFont);
-			p.label(trimmed_label);
 			p.visible(false);
-			p.scale_image(true);
 			p.image_unselected(tab_img);
 			p.image_selected(tab_selected_img);
-			p.tab_stop(false);
-			p.label_shadow(false);
+			p.follows.flags = p.follows.flags() | (getTabPosition() == TOP ? FOLLOWS_TOP : FOLLOWS_BOTTOM);
 			// Try to squeeze in a bit more text
 			p.pad_left( mLabelPadLeft );
 			p.pad_right(2);
-			p.pad_bottom( mLabelPadBottom );
-			p.font_halign = mFontHalign;
-			p.follows.flags = FOLLOWS_LEFT;
-			p.follows.flags = FOLLOWS_LEFT;
-	
-			if (indent)
-			{
-				p.pad_left(indent);
-			}
-
-			if( getTabPosition() == TOP )
-			{
-				p.follows.flags = p.follows.flags() | FOLLOWS_TOP;
-			}
-			else
-			{
-				p.follows.flags = p.follows.flags() | FOLLOWS_BOTTOM;
-			}
-
-			if(mCustomIconCtrlUsed)
-			{
-				btn = LLUICtrlFactory::create<LLCustomButtonIconCtrl>(custom_btn_params);
-			}
-			else
-			{
-				btn = LLUICtrlFactory::create<LLButton>(p);
-			}
+		}
+		
+		// *TODO : It seems wrong not to use p in both cases considering the way p is initialized
+		if (mCustomIconCtrlUsed)
+		{
+			btn = LLUICtrlFactory::create<LLCustomButtonIconCtrl>(custom_btn_params);
+		}
+		else
+		{
+			btn = LLUICtrlFactory::create<LLButton>(p);
 		}
 	}
 	
-- 
GitLab


From 2a19aa93e9ec9a6c59a11231694b1f910cf817ea Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Thu, 10 Nov 2011 19:00:03 -0800
Subject: [PATCH 186/933] Point to improved loading overlay and turn it on
 always

---
 autobuild.xml                                      | 8 ++++----
 indra/media_plugins/webkit/media_plugin_webkit.cpp | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 49031b9f173..1b8a61acad0 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1206,9 +1206,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>7108c2443dbcf4c032305814ce65ebb7</string>
+              <string>c006dd7f1f7a9d4cb9e2bbf311dd1973</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244065/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111028.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244983/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111110.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1230,9 +1230,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>24048a31d7b852774dc3117acbd4a86a</string>
+              <string>8e7bbe2ee0a281fdd9c8af0c8f75d206</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244065/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111028.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244983/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111110.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 13d51099a80..47f8dcd5459 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -382,9 +382,9 @@ class MediaPluginWebKit :
 		
 		//lldebugs << "data url is: " << url.str() << llendl;
 
-		// loading overlay debug screen follows media debugging flag from client for now.
+		// always display loading overlay now
 #if LLQTWEBKIT_API_VERSION >= 16
-		LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, mEnableMediaPluginDebugging);
+		LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, true);
 #else
 		llwarns << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << llendl;
 #endif
-- 
GitLab


From 1d47d3d86380bfe2ae9d42c35843f48d3abe5155 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 11 Nov 2011 14:04:44 +0200
Subject: [PATCH 187/933] EXP-1489 FIXED (Cannot build notifications not being
 shown when chat floater closed with chat log toggled open)

Reason: There is a case when the chat floater is minimized while its visibility = true as well as its chat panel visibility = true. In this case notification won't be shown to the user. It will be shown in chat history which is in minimized floater.
Solution: Check for a floater minimized state.
---
 indra/newview/llnotificationtiphandler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index aa009a76fa4..fb0891c4c5a 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -95,7 +95,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
 			// don't show toast if Nearby Chat is opened
 			LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
 			LLNearbyChatBar* nearby_chat_bar = LLNearbyChatBar::getInstance();
-			if (nearby_chat_bar->getVisible() && nearby_chat->getVisible())
+			if (!nearby_chat_bar->isMinimized() && nearby_chat_bar->getVisible() && nearby_chat->getVisible())
 			{
 				return false;
 			}
-- 
GitLab


From fed2e3d8a8dd310ce752e8fb3c6c012d12254350 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 11 Nov 2011 16:40:22 +0200
Subject: [PATCH 188/933] EXP-1509 FIXED Suppress links in resident name.

Fixed in the following notificatins: Remove friend, Friend Online/Offline,
Friendship Accepted/Declined.
---
 indra/newview/skins/default/xui/da/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/de/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/en/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/es/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/fr/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/it/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/ja/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/pl/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/pt/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/ru/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/tr/notifications.xml | 10 +++++-----
 indra/newview/skins/default/xui/zh/notifications.xml | 10 +++++-----
 12 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml
index 3ccdfc036a7..cf6f1ccdd9f 100644
--- a/indra/newview/skins/default/xui/da/notifications.xml
+++ b/indra/newview/skins/default/xui/da/notifications.xml
@@ -438,7 +438,7 @@ Tilbyd venskab til [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Ønsker du at fjerne [NAME] fra din venneliste?
+		Ønsker du at fjerne &lt;nolink&gt;[NAME]&lt;/nolink&gt; fra din venneliste?
 	</notification>
 	<notification name="ConfirmItemDeleteHasLinks">
 		Mindst en af genstandene har lænkede genstande der peger på den. Hvis du sletter denne genstand, vil lænkninger ikke virke mere.  Det anbefales kraftigt at fjerne lænkninger først.
@@ -1023,10 +1023,10 @@ Henvis til dette fra en hjemmeside for at give andre nem adgang til denne lokati
 		Erstattet manglende tøj/kropsdele med standard.
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] er logget på
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; er logget på
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] er logget af
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; er logget af
 	</notification>
 	<notification name="AddSelfFriend">
 		Selvom du nok er meget sød, kan du ikke tilføje dig selv som ven.
@@ -1404,10 +1404,10 @@ Prøv igen om lidt.
 (Som udgangspunkt, vil du være i stand til at se den andens online status)
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] accepterede dit tilbud om venskab.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; accepterede dit tilbud om venskab.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] afviste dit tilbud om venskab.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; afviste dit tilbud om venskab.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Tilbud om venskab accepteret.
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index fc38608df5f..72e7ec8eb47 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -992,7 +992,7 @@ Sie sind nicht berechtigt, Land für die aktive Gruppe zu kaufen.
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Möchten Sie [NAME] aus Ihrer Freundesliste entfernen?
+		Möchten Sie &lt;nolink&gt;[NAME]&lt;/nolink&gt; aus Ihrer Freundesliste entfernen?
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2134,10 +2134,10 @@ Hierzu wird Ihr Webbrowser geöffnet.
 		Betreff: [SUBJECT], Nachricht: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] ist online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ist online
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] ist offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ist offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Obwohl Sie ein sehr netter Mensch sind, können Sie sich nicht selbst als Freund hinzufügen.
@@ -2532,10 +2532,10 @@ Versuchen Sie es in einigen Minuten erneut.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] hat Ihr Freundschaftsangebot akzeptiert.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; hat Ihr Freundschaftsangebot akzeptiert.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] hat Ihr Freundschaftsangebot abgelehnt.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; hat Ihr Freundschaftsangebot abgelehnt.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Ihr Freundschaftsangebot wurde angeommen.
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e4458f33b17..d925bf8f964 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2369,7 +2369,7 @@ Would you be my friend?
    name="RemoveFromFriends"
    type="alertmodal">
     <tag>friendship</tag>
-Do you want to remove [NAME] from your Friends List?
+Do you want to remove &lt;nolink&gt;[NAME]&lt;/nolink&gt; from your Friends List?
     <tag>confirm</tag>
     <usetemplate
      name="okcancelbuttons"
@@ -5161,7 +5161,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
    name="FriendOnline"
    type="notifytip">
     <tag>friendship</tag>
-[NAME] is Online
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Online
   </notification>
 
   <notification
@@ -5169,7 +5169,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
    name="FriendOffline"
    type="notifytip">
     <tag>friendship</tag>
-[NAME] is Offline
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Offline
   </notification>
 
   <notification
@@ -6171,7 +6171,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    name="FriendshipAccepted"
    type="offer">
     <tag>friendship</tag>
-[NAME] accepted your friendship offer.
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; accepted your friendship offer.
   </notification>
 
   <notification
@@ -6180,7 +6180,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    persist="true"
    type="notify">
     <tag>friendship</tag>
-[NAME] declined your friendship offer.
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; declined your friendship offer.
   </notification>
   
     <notification
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 3fe0072a200..9591b424fce 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -981,7 +981,7 @@ no tienes el permiso de comprar terreno para el grupo que tienes activado actual
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		¿Quieres eliminar a [NAME] de tu lista de amigos?
+		¿Quieres eliminar a &lt;nolink&gt;[NAME]&lt;/nolink&gt; de tu lista de amigos?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2128,10 +2128,10 @@ Al hacerlo se iniciará el navegador web.
 		Asunto: [SUBJECT], Mensaje: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] está conectado
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está conectado
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] está desconectado
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está desconectado
 	</notification>
 	<notification name="AddSelfFriend">
 		Aunque eres muy agradable, no puedes añadirte como amigo a ti mismo.
@@ -2526,10 +2526,10 @@ Por favor, vuelve a intentarlo en unos momentos.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] ha aceptado tu oferta de amistad.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha aceptado tu oferta de amistad.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] ha rehusado tu oferta de amistad.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rehusado tu oferta de amistad.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Aceptado el ofrecimiento de amistad.
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index 31c29029b56..18b9063c008 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -980,7 +980,7 @@ Proposer à [NAME] de devenir votre ami(e) ?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Voulez-vous supprimer [NAME] de votre liste d&apos;amis ?
+		Voulez-vous supprimer &lt;nolink&gt;[NAME]&lt;/nolink&gt; de votre liste d&apos;amis ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2119,10 +2119,10 @@ Cette opération lancera votre navigateur Web.
 		Sujet : [SUBJECT], Message : [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] est en ligne
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; est en ligne
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] est hors ligne
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; est hors ligne
 	</notification>
 	<notification name="AddSelfFriend">
 		Même si vous êtes extrêmement sympathique, vous ne pouvez pas devenir ami avec vous-même.
@@ -2518,10 +2518,10 @@ Veuillez réessayer dans quelques minutes.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] a accepté votre amitié.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; a accepté votre amitié.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] a refusé votre amitié.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; a refusé votre amitié.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Amitié acceptée.
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index e19b84912a5..2db0892cd6e 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -978,7 +978,7 @@ Offri l&apos;amicizia a [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Vuoi rimuovere [NAME] dalla lista dei tuoi amici?
+		Vuoi rimuovere &lt;nolink&gt;[NAME]&lt;/nolink&gt; dalla lista dei tuoi amici?
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2125,10 +2125,10 @@ Verrà avviato il browser Web.
 		Oggetto: [SUBJECT], Messaggio: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] è Online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è Online
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] è Offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è Offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Anche se sei molto simpatico, non puoi aggiungere te stesso all&apos;elenco degli amici.
@@ -2520,10 +2520,10 @@ Riprova tra qualche istante.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] ha accettato la tua offerta di amicizia.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha accettato la tua offerta di amicizia.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] ha rifiutato la tua offerta di amicizia.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rifiutato la tua offerta di amicizia.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Offerta di amicizia accettata.
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 85f09b45009..7dfa6d2f7a8 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1010,7 +1010,7 @@ L$ は返金されません。
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		フレンドリストから [NAME] を削除しますか?
+		フレンドリストから &lt;nolink&gt;[NAME]&lt;/nolink&gt; を削除しますか?
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2167,10 +2167,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		件名: [SUBJECT]、メッセージ: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] はオンライン中です
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオンライン中です
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] はオフライン中です
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオフライン中です
 	</notification>
 	<notification name="AddSelfFriend">
 		残念ながら自分自身をフレンド登録することはできません。
@@ -2567,10 +2567,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME]は、フレンド登録を受け入れました。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt;は、フレンド登録を受け入れました。
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME]は、フレンド登録を断りました。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt;は、フレンド登録を断りました。
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		フレンドの登録依頼が承認されました。
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index 7d3225ea317..e1fb6dd3f14 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -946,7 +946,7 @@ Zaproponować znajomość [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Czy chcesz usunąć [NAME] z listy znajomych?
+		Czy chcesz usunąć &lt;nolink&gt;[NAME]&lt;/nolink&gt; z listy znajomych?
 		<usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2078,10 +2078,10 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t
 		Temat: [SUBJECT], Treść: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] jest w Second Life
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; jest w Second Life
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] opuszcza Second Life
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; opuszcza Second Life
 	</notification>
 	<notification name="AddSelfFriend">
 		Nie możesz dodać siebie do listy znajomych.
@@ -2458,10 +2458,10 @@ Spróbuj ponowanie za kilka minut.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		Twoja propozycja znajomości została przyjęta przez [NAME].
+		Twoja propozycja znajomości została przyjęta przez &lt;nolink&gt;[NAME]&lt;/nolink&gt;.
 	</notification>
 	<notification name="FriendshipDeclined">
-		Twoja propozycja znajomości została odrzucona przez [NAME].
+		Twoja propozycja znajomości została odrzucona przez &lt;nolink&gt;[NAME]&lt;/nolink&gt;.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Propozycja znajomości została zaakceptowana.
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 4bd9f86e0f9..d3547beeb36 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -973,7 +973,7 @@ Oferecer amizade para [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Remover [NAME] da sua lista de amigos?
+		Remover &lt;nolink&gt;[NAME]&lt;/nolink&gt; da sua lista de amigos?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Remover"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2109,10 +2109,10 @@ Isso abrirá o seu navegador.
 		Assunto: [SUBJECT], Mensagem: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] está online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está online
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] está offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Você é o máximo! Mesmo assim, não dá para adicionar a si mesmo(a) como amigo(a).
@@ -2501,10 +2501,10 @@ Cada um pode ver o status do outro (definição padrão).
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] aceitou seu convite de amizade.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; aceitou seu convite de amizade.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] recusou seu convite de amizade
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; recusou seu convite de amizade
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Oferta de amizada aceita.
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index 87ae9d06dd2..97b65a15eb5 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -979,7 +979,7 @@
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Удалить жителя [NAME] из вашего списка друзей?
+		Удалить жителя &lt;nolink&gt;[NAME]&lt;/nolink&gt; из вашего списка друзей?
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2119,10 +2119,10 @@ http://secondlife.com/download.
 		Раздел: [SUBJECT], сообщение: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] в сети
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; в сети
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] не в сети
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; не в сети
 	</notification>
 	<notification name="AddSelfFriend">
 		Вы лучше всех, но нельзя добавить в друзья себя самого.
@@ -2518,10 +2518,10 @@ http://secondlife.com/download.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] принял(а) ваше предложение дружить.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; принял(а) ваше предложение дружить.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] отклонил(а) ваше предложение дружить.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; отклонил(а) ваше предложение дружить.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Предложение дружить принято.
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index a268c103a6e..0d360bbf5f5 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -979,7 +979,7 @@ Etkin grubunuz adına arazi satın almak için gerekli izne sahip değilsiniz.
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		[NAME] adlı kişiyi Arkadaş Listenizden çıkarmak istiyor musunuz?
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; adlı kişiyi Arkadaş Listenizden çıkarmak istiyor musunuz?
 		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2119,10 +2119,10 @@ Bu adımda web tarayıcınızın başlatılacağına dikkat edin.
 		Konu: [SUBJECT], Ä°leti: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] Çevrimiçi
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; Çevrimiçi
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] Çevrimdışı
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; Çevrimdışı
 	</notification>
 	<notification name="AddSelfFriend">
 		Çok iyi biri olduğunuza eminiz fakat kendinizi arkadaş olarak ekleyemezsiniz.
@@ -2518,10 +2518,10 @@ Lütfen biraz sonra tekrar deneyin.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] arkadaşlık teklifinizi kabul etti.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; arkadaşlık teklifinizi kabul etti.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] arkadaşlık teklifinizi reddetti.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; arkadaşlık teklifinizi reddetti.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Arkadaşlık teklifi kabul edildi.
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index 2d309a2af0b..17ff6288a5f 100644
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -966,7 +966,7 @@ Offer friendship to [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Do you want to remove [NAME] from your Friends List?
+		Do you want to remove &lt;nolink&gt;[NAME]&lt;/nolink&gt; from your Friends List?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2109,10 +2109,10 @@ Link to this from a web page to give others easy access to this location, or try
 		Topic: [SUBJECT], Message: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] 上線
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; 上線
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] 離線
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; 離線
 	</notification>
 	<notification name="AddSelfFriend">
 		Although you&apos;re very nice, you can&apos;t add yourself as a friend.
@@ -2491,10 +2491,10 @@ Please try again in a few moments.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] accepted your friendship offer.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; accepted your friendship offer.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] 謝絕你的交友邀請。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; 謝絕你的交友邀請。
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		交友邀請被接受。
-- 
GitLab


From 9a3c8513187b90140c80204a0a2b659ae024069f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 11 Nov 2011 17:17:44 +0200
Subject: [PATCH 189/933] EXP-1564 FIXED The Advanced Options button now
 changes its icon when the Advanced Options panel is expanded.

By the way, fixed the button position.
---
 indra/newview/llfloatersnapshot.cpp                     | 2 +-
 indra/newview/skins/default/xui/en/floater_snapshot.xml | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 48e6cca6236..bca913c4bb0 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1251,7 +1251,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 
 	// Show/hide advanced options.
 	LLPanel* advanced_options_panel = floaterp->getChild<LLPanel>("advanced_options_panel");
-	floaterp->getChild<LLButton>("advanced_options_btn")->setToggleState(advanced);
+	floaterp->getChild<LLButton>("advanced_options_btn")->setImageOverlay(advanced ? "TabIcon_Open_Off" : "TabIcon_Close_Off");
 	if (advanced != advanced_options_panel->getVisible())
 	{
 		S32 panel_width = advanced_options_panel->getRect().getWidth();
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index d7a1510c1c0..07d5819c457 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -98,9 +98,8 @@
      follows="left|top"
      height="23"
      image_overlay="TabIcon_Close_Off"
-     is_toggle="true"
      layout="topleft"
-     left="240"
+     left="236"
      name="advanced_options_btn"
      tool_tip="Advanced options"
      top_delta="0"
-- 
GitLab


From 57b8da6b4926435f92f0a8568c6ac725774bbbd2 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 11 Nov 2011 12:22:48 -0500
Subject: [PATCH 190/933] STORM-591 Remove dead line of code to fix mac/linux
 compile error.

---
 indra/newview/llviewerparcelmgr.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 928a84e7eb8..ada89cc7aa7 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1741,8 +1741,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 				std::string music_url = music_url_raw;
 				LLStringUtil::trim(music_url);
 
-				const std::string& stream_url = gAudiop->getInternetStreamURL();
-
 				// If there is a new music URL and it's valid, play it.
 				if (music_url.size() > 12)
 				{
-- 
GitLab


From 93e3617e8b409a7517f04b3607080f11274a5fd9 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 11 Nov 2011 12:29:25 -0500
Subject: [PATCH 191/933] STORM-1679 Adjusted ARC_LIMIT to 20,000 per updated
 instructions from Nyx.

---
 indra/newview/llvoavatar.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 163ac2dc700..6af800f1d7d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -8335,7 +8335,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d
 void LLVOAvatar::idleUpdateRenderCost()
 {
 	static const U32 ARC_BODY_PART_COST = 200;
-	static const U32 ARC_LIMIT = 40000;
+	static const U32 ARC_LIMIT = 20000;
 
 	static std::set<LLUUID> all_textures;
 
-- 
GitLab


From 4afb450225d83fef55bfee2f63290dcfbc3cfbec Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 11 Nov 2011 09:31:07 -0800
Subject: [PATCH 192/933] EXP-1504 : Move the tab opening stuff to
 lltabcontainer and out of llbutton. Added an xui param to allow drill through
 tabs. Set that param for build panel only.

---
 indra/llui/llbutton.cpp                       | 29 ------
 indra/llui/llbutton.h                         |  7 --
 indra/llui/lltabcontainer.cpp                 | 93 +++++++++++--------
 indra/llui/lltabcontainer.h                   |  6 ++
 .../skins/default/xui/en/floater_tools.xml    |  1 +
 5 files changed, 62 insertions(+), 74 deletions(-)

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index be657dbb9bb..f9e2ad8554d 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -104,7 +104,6 @@ LLButton::Params::Params()
 	use_draw_context_alpha("use_draw_context_alpha", true),
 	badge("badge"),
 	handle_right_mouse("handle_right_mouse"),
-	click_on_drag_and_drop("click_on_drag_and_drop", false),
 	held_down_delay("held_down_delay"),
 	button_flash_count("button_flash_count"),
 	button_flash_rate("button_flash_rate")
@@ -172,7 +171,6 @@ LLButton::LLButton(const LLButton::Params& p)
 	mHeldDownSignal(NULL),
 	mUseDrawContextAlpha(p.use_draw_context_alpha),
 	mHandleRightMouse(p.handle_right_mouse),
-	mClickOnDragAndDrop(p.click_on_drag_and_drop),		// if true, hovering on button while dragging -> click
 	mButtonFlashCount(p.button_flash_count),
 	mButtonFlashRate(p.button_flash_rate)
 {
@@ -1236,35 +1234,8 @@ void LLButton::resetMouseDownTimer()
 	mMouseDownTimer.reset();
 }
 
-
 BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask)
 {
 	// just treat a double click as a second click
 	return handleMouseDown(x, y, mask);
 }
-
-// virtual
-BOOL LLButton::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string	&tooltip)
-{
-	const F32 CLICK_ON_DAD_DELAY_TIME = 0.5f;
-	if (mClickOnDragAndDrop)
-	{
-		// In that case, though the button doesn't really handles drops, it'll "click" if hovering on it
-		// while dragging something. That allows for instance drilling into tabbed containers.
-		// Note: we use the same timer as mouse down just as convenience and to avoid duplication.
-		if (mMouseDownTimer.getStarted())
-		{
-			if (mMouseDownTimer.getElapsedTimeF32() > CLICK_ON_DAD_DELAY_TIME )
-			{
-				onCommit();
-				mMouseDownTimer.stop();
-			}
-		}
-		else 
-		{
-			mMouseDownTimer.start();
-		}
-	}
-	// The true DaD effect is handled at the View level if any.
-	return LLView::handleDragAndDrop(x,	y, mask, drop, type, cargo_data,  accept, tooltip);
-}
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index 47aa675c5eb..deaa0823c61 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -132,7 +132,6 @@ class LLButton
 		Optional<LLBadge::Params>	badge;
 
 		Optional<bool>				handle_right_mouse;
-		Optional<bool>				click_on_drag_and_drop;
 
 		Optional<S32>				button_flash_count;
 		Optional<F32>				button_flash_rate;
@@ -160,11 +159,6 @@ class LLButton
 	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleRightMouseUp(S32 x, S32 y, MASK mask);	
 	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask);
-	virtual BOOL	handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
-									  EDragAndDropType cargo_type,
-									  void* cargo_data,
-									  EAcceptance* accept,
-									  std::string& tooltip_msg);
 	virtual void	draw();
 	/*virtual*/ BOOL postBuild();
 
@@ -382,7 +376,6 @@ class LLButton
 	LLFrameTimer				mFlashingTimer;
 
 	bool						mHandleRightMouse;
-	bool						mClickOnDragAndDrop;
 };
 
 // Build time optimization, generate once in .cpp file
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 3b2751248b4..d5f87073810 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -214,6 +214,7 @@ LLTabContainer::Params::Params()
 	middle_tab("middle_tab"),
 	last_tab("last_tab"),
 	use_custom_icon_ctrl("use_custom_icon_ctrl", false),
+	open_tabs_on_drag_and_drop("open_tabs_on_drag_and_drop", false),
 	tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0),
 	use_ellipses("use_ellipses"),
 	font_halign("halign")
@@ -250,6 +251,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
 	mMiddleTabParams(p.middle_tab),
 	mLastTabParams(p.last_tab),
 	mCustomIconCtrlUsed(p.use_custom_icon_ctrl),
+	mOpenTabsOnDragAndDrop(p.open_tabs_on_drag_and_drop),
 	mTabIconCtrlPad(p.tab_icon_ctrl_pad),
 	mUseTabEllipses(p.use_ellipses)
 {
@@ -812,50 +814,62 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,	BOOL drop,	EDrag
 {
 	BOOL has_scroll_arrows = (getMaxScrollPos() > 0);
 
-	if( !getTabsHidden()
-		&& mDragAndDropDelayTimer.getStarted() 
-		&& mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME )
+	if(mOpenTabsOnDragAndDrop && !getTabsHidden())
 	{
-		if (has_scroll_arrows)
+		// In that case, we'll open the hovered tab while dragging and dropping items.
+		// This allows for drilling through tabs.
+		if (mDragAndDropDelayTimer.getStarted())
 		{
-			if (mJumpPrevArrowBtn && mJumpPrevArrowBtn->getRect().pointInRect(x, y))
+			if (mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME)
 			{
-				S32	local_x	= x	- mJumpPrevArrowBtn->getRect().mLeft;
-				S32	local_y	= y	- mJumpPrevArrowBtn->getRect().mBottom;
-				mJumpPrevArrowBtn->handleHover(local_x,	local_y, mask);
-			}
-			if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x, y))
-			{
-				S32	local_x	= x	- mJumpNextArrowBtn->getRect().mLeft;
-				S32	local_y	= y	- mJumpNextArrowBtn->getRect().mBottom;
-				mJumpNextArrowBtn->handleHover(local_x,	local_y, mask);
-			}
-			if (mPrevArrowBtn->getRect().pointInRect(x,	y))
-			{
-				S32	local_x	= x	- mPrevArrowBtn->getRect().mLeft;
-				S32	local_y	= y	- mPrevArrowBtn->getRect().mBottom;
-				mPrevArrowBtn->handleHover(local_x,	local_y, mask);
-			}
-			else if	(mNextArrowBtn->getRect().pointInRect(x, y))
-			{
-				S32	local_x	= x	- mNextArrowBtn->getRect().mLeft;
-				S32	local_y	= y	- mNextArrowBtn->getRect().mBottom;
-				mNextArrowBtn->handleHover(local_x, local_y, mask);
-			}
-		}
+				if (has_scroll_arrows)
+				{
+					if (mJumpPrevArrowBtn && mJumpPrevArrowBtn->getRect().pointInRect(x, y))
+					{
+						S32	local_x	= x	- mJumpPrevArrowBtn->getRect().mLeft;
+						S32	local_y	= y	- mJumpPrevArrowBtn->getRect().mBottom;
+						mJumpPrevArrowBtn->handleHover(local_x,	local_y, mask);
+					}
+					if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x, y))
+					{
+						S32	local_x	= x	- mJumpNextArrowBtn->getRect().mLeft;
+						S32	local_y	= y	- mJumpNextArrowBtn->getRect().mBottom;
+						mJumpNextArrowBtn->handleHover(local_x,	local_y, mask);
+					}
+					if (mPrevArrowBtn->getRect().pointInRect(x,	y))
+					{
+						S32	local_x	= x	- mPrevArrowBtn->getRect().mLeft;
+						S32	local_y	= y	- mPrevArrowBtn->getRect().mBottom;
+						mPrevArrowBtn->handleHover(local_x,	local_y, mask);
+					}
+					else if	(mNextArrowBtn->getRect().pointInRect(x, y))
+					{
+						S32	local_x	= x	- mNextArrowBtn->getRect().mLeft;
+						S32	local_y	= y	- mNextArrowBtn->getRect().mBottom;
+						mNextArrowBtn->handleHover(local_x, local_y, mask);
+					}
+				}
 
-		for(tuple_list_t::iterator iter	= mTabList.begin();	iter !=	 mTabList.end(); ++iter)
-		{
-			LLTabTuple*	tuple =	*iter;
-			tuple->mButton->setVisible(	TRUE );
-			S32	local_x	= x	- tuple->mButton->getRect().mLeft;
-			S32	local_y	= y	- tuple->mButton->getRect().mBottom;
-			if (tuple->mButton->pointInView(local_x, local_y) &&  tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible())
-			{
-				tuple->mButton->onCommit();
+				for(tuple_list_t::iterator iter	= mTabList.begin();	iter !=	 mTabList.end(); ++iter)
+				{
+					LLTabTuple*	tuple =	*iter;
+					tuple->mButton->setVisible(	TRUE );
+					S32	local_x	= x	- tuple->mButton->getRect().mLeft;
+					S32	local_y	= y	- tuple->mButton->getRect().mBottom;
+					if (tuple->mButton->pointInView(local_x, local_y) &&  tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible())
+					{
+						tuple->mButton->onCommit();
+					}
+				}
+				// Stop the timer whether successful or not. Don't let it run forever.
 				mDragAndDropDelayTimer.stop();
 			}
 		}
+		else 
+		{
+			// Start a timer so we don't open tabs as soon as we hover on them
+			mDragAndDropDelayTimer.start();
+		}
 	}
 
 	return LLView::handleDragAndDrop(x,	y, mask, drop, type, cargo_data,  accept, tooltip);
@@ -1041,7 +1055,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 		p.tab_stop(false);
 		p.label_shadow(false);
 		p.follows.flags = FOLLOWS_LEFT;
-		p.click_on_drag_and_drop(true);
 		
 		if (mIsVertical)
 		{
@@ -1246,6 +1259,10 @@ void LLTabContainer::enableTabButton(S32 which, BOOL enable)
 	{
 		mTabList[which]->mButton->setEnabled(enable);
 	}
+	// Stop the DaD timer as it might run forever
+	// enableTabButton() is typically called on refresh and draw when anything changed
+	// in the tab container so it's a good time to reset that.
+	mDragAndDropDelayTimer.stop();
 }
 
 void LLTabContainer::deleteAllTabs()
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index eaa2fd54e06..cebace2ceba 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -104,6 +104,11 @@ class LLTabContainer : public LLPanel
 		 */
 		Optional<bool>						use_custom_icon_ctrl;
 
+		/**
+		 * Open tabs on hover in drag and drop situations
+		 */
+		Optional<bool>						open_tabs_on_drag_and_drop;
+		
 		/**
 		 *  Paddings for LLIconCtrl in case of LLCustomButtonIconCtrl usage(use_custom_icon_ctrl = true)
 		 */
@@ -300,6 +305,7 @@ class LLTabContainer : public LLPanel
 	TabParams						mLastTabParams;
 
 	bool							mCustomIconCtrlUsed;
+	bool							mOpenTabsOnDragAndDrop;
 	S32								mTabIconCtrlPad;
 	bool							mUseTabEllipses;
 };
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 1808cab2a5e..aa18c6e039c 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -791,6 +791,7 @@
      tab_min_width="40"
      tab_position="top"
      tab_height="25"
+     open_tabs_on_drag_and_drop="true"
      top="173"
      width="295">
 	
-- 
GitLab


From 4f1d146e19e3aef00c456efec5925043544f5a45 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 11 Nov 2011 19:36:43 +0200
Subject: [PATCH 193/933] EXP-1515 FIXED Web Preference radio button must be
 clicked twice to engage.

Fixed the "Use external browser" radio group to work with its setting properly:
* Specified valid boolean values ("true" and "") for the radio buttons.
* Made default value of the setting boolean to ensure proper initialization.
---
 indra/newview/app_settings/settings.xml                        | 2 +-
 indra/newview/skins/default/xui/en/panel_preferences_setup.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9c055bdc5a4..c05754274e0 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12277,7 +12277,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <boolean>1</boolean>
     </map>
     <key>UseFreezeFrame</key>
     <map>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index a7078ce2e10..4aeea8823e6 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -122,7 +122,7 @@
       layout="topleft"
       left_delta="0"
       name="external"
-      value="1"
+      value="true"
       top="0"
       tool_tip="Use the default system web browser for help, web links, etc. Not recommended if running full screen."
       width="480" />
-- 
GitLab


From bdb27b7e81a722162adb888370e7f429117d41e8 Mon Sep 17 00:00:00 2001
From: Ansariel Hiller <none@none>
Date: Fri, 11 Nov 2011 14:13:56 -0500
Subject: [PATCH 194/933] STORM-1685 Wrong named control in
 floater_world_map.xml Patch converted to hg format by Jonathan Yap.

---
 doc/contributions.txt                                    | 2 ++
 indra/newview/skins/default/xui/en/floater_world_map.xml | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 2b39e15e2a9..e491df284eb 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -170,6 +170,7 @@ Ansariel Hiller
 	STORM-1101
 	VWR-25480
 	VWR-26150
+	STORM-1685
 Aralara Rajal
 Ardy Lay
 	STORM-859
@@ -586,6 +587,7 @@ Jonathan Yap
 	STORM-1222
 	STORM-1659
 	STORM-1674
+	STORM-1685
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index 4314c8a9e2a..56d79f62c7b 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -468,7 +468,7 @@
      left="3"
      top_pad="7"
      mouse_opaque="true"
-     name="region_icon"
+     name="location_icon"
      width="16" />
     <search_editor
      follows="top|right"
-- 
GitLab


From 267e75d8dc36386070ddb3ecebb31a7bbadd6d03 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 11 Nov 2011 11:17:44 -0800
Subject: [PATCH 195/933] support for assignment of named values to params

---
 indra/llxuixml/llinitparam.cpp |  1 +
 indra/llxuixml/llinitparam.h   | 55 +++++++++++++++++-----------------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp
index 482064ed7b6..8880072f069 100644
--- a/indra/llxuixml/llinitparam.cpp
+++ b/indra/llxuixml/llinitparam.cpp
@@ -478,6 +478,7 @@ namespace LLInitParam
 			if (merge_func)
 			{
 				Param* paramp = getParamFromHandle((*it)->mParamHandle);
+				llassert(paramp->mEnclosingBlockOffset == (*it)->mParamHandle);
 				some_param_changed |= merge_func(*paramp, *other_paramp, overwrite);
 			}
 		}
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index f5f68767367..ec14bc2fdc3 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -671,10 +671,11 @@ namespace LLInitParam
 		self_t& operator =(const self_t& other)
 		{
 			mValue = other.mValue;
+			static_cast<NAME_VALUE_LOOKUP&>(*this) = other;
 			return *this;
 		}
 
-	private:
+	protected:
 		T mValue;
 	};
 
@@ -741,7 +742,10 @@ namespace LLInitParam
 
 		self_t& operator =(const self_t& other)
 		{
-			*(static_cast<T*>(this)) = other;
+			static_cast<T&>(*this) = other;
+			static_cast<NAME_VALUE_LOOKUP&>(*this) = other;
+			mValidatedVersion = other.mValidatedVersion;
+			mValidated = other.mValidated;
 			return *this;
 		}
 	protected:
@@ -875,24 +879,17 @@ namespace LLInitParam
 
 		self_t& operator =(typename const name_value_lookup_t::name_t& name)
 		{
-			if (name_value_lookup_t::getValueFromName(name, getValue()))
-			{
-				setValueName(name);
-				setProvided();
-			}
-
-			return *this;
+			return static_cast<self_t&>(param_value_t::operator =(name));
 		}
 
 		void set(value_assignment_t val, bool flag_as_provided = true)
 		{
-			setValue(val);
 			param_value_t::clearValueName();
+			setValue(val);
 			setProvided(flag_as_provided);
 		}
 
 	protected:
-
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
 			const self_t& src_typed_param = static_cast<const self_t&>(src);
@@ -1026,17 +1023,6 @@ namespace LLInitParam
 			setProvided(flag_as_provided);
 		}
 
-		self_t& operator =(typename const name_value_lookup_t::name_t& name)
-		{
-			if (name_value_lookup_t::getValueFromName(name, getValue()))
-			{
-				setValueName(name);
-				setProvided();
-			}
-
-			return *this;
-		}
-
 		// propagate changed status up to enclosing block
 		/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
 		{ 
@@ -1239,6 +1225,12 @@ namespace LLInitParam
 		}
 
 	protected:
+		self_t& operator=(const self_t& other)
+		{
+			mValues = other.mValues;
+			return *this;
+		}
+
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
 			const self_t& src_typed_param = static_cast<const self_t&>(src);
@@ -1432,6 +1424,11 @@ namespace LLInitParam
 		}
 
 	protected:
+		self_t& operator=(const self_t& other)
+		{
+			mValues = other.mValues;
+			return *this;
+		}
 
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
@@ -1540,6 +1537,8 @@ namespace LLInitParam
 			typedef TypedParam<T, NAME_VALUE_LOOKUP, false, IsBlock<ParamValue<T, NAME_VALUE_LOOKUP> >::value>		super_t;
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
+			using super_t::param_value_t::operator =;
+
 			explicit Alternative(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1),
 				mOriginalValue(val)
@@ -1565,7 +1564,7 @@ namespace LLInitParam
 				super_t::set(val);
 			}
 
-			void operator=(value_assignment_t val)
+			void operator =(value_assignment_t val)
 			{
 				super_t::set(val);
 			}
@@ -1657,7 +1656,7 @@ namespace LLInitParam
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
 			using super_t::operator();
-			using super_t::operator=;
+			using super_t::param_value_t::operator =;
 
 			explicit Optional(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1)
@@ -1665,7 +1664,7 @@ namespace LLInitParam
 				//#pragma message("Parsing LLInitParam::Block::Optional")
 			}
 
-			Optional& operator=(value_assignment_t val)
+			Optional& operator =(value_assignment_t val)
 			{
 				set(val);
 				return *this;
@@ -1687,14 +1686,14 @@ namespace LLInitParam
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
 			using super_t::operator();
-			using super_t::operator=;
+			using super_t::param_value_t::operator =;
 
 			// mandatory parameters require a name to be parseable
 			explicit Mandatory(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, &validate, 1, 1)
 			{}
 
-			Mandatory& operator=(value_assignment_t val)
+			Mandatory& operator =(value_assignment_t val)
 			{
 				set(val);
 				return *this;
@@ -1729,7 +1728,7 @@ namespace LLInitParam
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, container_t(), &validate, RANGE::minCount, RANGE::maxCount)
 			{}
 
-			Multiple& operator=(value_assignment_t val)
+			Multiple& operator =(value_assignment_t val)
 			{
 				set(val);
 				return *this;
-- 
GitLab


From e4e4977f5eab5aac24c32b569c5273c4be926cb2 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 11 Nov 2011 12:29:04 -0800
Subject: [PATCH 196/933] EXP-1527 FIX Debug values for windowwidth and
 windowheight can be set below minimum required values and EXP-1528 Launching
 viewer with a settings.xml file with windowwidth and windowheight set below
 minimum values, launches to those values not minimum window size

---
 indra/llwindow/llwindow.cpp             |   9 ++
 indra/llwindow/llwindow.h               |   3 +
 indra/llwindow/llwindowmacosx.cpp       | 206 ++++++++++++------------
 indra/llwindow/llwindowwin32.cpp        |   4 +-
 indra/newview/app_settings/settings.xml |  26 ++-
 indra/newview/llappviewer.cpp           |  14 +-
 indra/newview/llviewerwindow.cpp        |  14 +-
 7 files changed, 166 insertions(+), 110 deletions(-)

diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index dc3a1099b11..a313885ca3b 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -111,6 +111,8 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags)
 	  mCursorHidden(FALSE),
 	  mBusyCount(0),
 	  mIsMouseClipping(FALSE),
+	  mMinWindowWidth(1024),		// just a sanity check - actual minimum size is stored in settings.xml
+	  mMinWindowHeight(768),
 	  mSwapMethod(SWAP_METHOD_UNDEFINED),
 	  mHideCursorPermanent(FALSE),
 	  mFlags(flags),
@@ -179,6 +181,13 @@ void *LLWindow::getMediaWindow()
 	return getPlatformWindow();
 }
 
+// virtual
+void LLWindow::setMinSize(U32 min_width, U32 min_height)
+{
+	mMinWindowWidth = min_width;
+	mMinWindowHeight = min_height;
+}
+
 //virtual
 void LLWindow::processMiscNativeEvents()
 {
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index e8a86a18807..b2c2628ec4f 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -73,6 +73,7 @@ class LLWindow
 	virtual BOOL getSize(LLCoordWindow *size) = 0;
 	virtual BOOL setPosition(LLCoordScreen position) = 0;
 	virtual BOOL setSize(LLCoordScreen size) = 0;
+	virtual void setMinSize(U32 min_width, U32 min_height);
 	virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0;
 	virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
 	virtual BOOL getCursorPosition(LLCoordWindow *position) = 0;
@@ -188,6 +189,8 @@ class LLWindow
 	BOOL		mHideCursorPermanent;
 	U32			mFlags;
 	U16			mHighSurrogate;
+	U32			mMinWindowWidth;
+	U32			mMinWindowHeight;
 
  	// Handle a UTF-16 encoding unit received from keyboard.
  	// Converting the series of UTF-16 encoding units to UTF-32 data,
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 80575067360..c48c3564b2a 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1,25 +1,25 @@
-/** 
+/**
  * @file llwindowmacosx.cpp
  * @brief Platform-dependent implementation of llwindow
  *
  * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  * Second Life Viewer Source Code
  * Copyright (C) 2010, Linden Research, Inc.
- * 
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation;
  * version 2.1 of the License only.
- * 
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
+ *
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
@@ -220,10 +220,10 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
 	// Route them to a dummy callback structure until the end of constructor.
 	LLWindowCallbacks null_callbacks;
 	mCallbacks = &null_callbacks;
-	
+
 	// Voodoo for calling cocoa from carbon (see llwindowmacosx-objc.mm).
 	setupCocoa();
-	
+
 	// Initialize the keyboard
 	gKeyboard = new LLKeyboardMacOSX();
 	gKeyboard->setCallbacks(callbacks);
@@ -254,10 +254,10 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
 	mRawKeyEvent = NULL;
 	mFSAASamples = fsaa_samples;
 	mForceRebuild = FALSE;
-	
+
 	// For reasons that aren't clear to me, LLTimers seem to be created in the "started" state.
 	// Since the started state of this one is used to track whether the NMRec has been installed, it wants to start out in the "stopped" state.
-	mBounceTimer.stop();	
+	mBounceTimer.stop();
 
 	// Get the original aspect ratio of the main device.
 	mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay);
@@ -270,7 +270,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
 	mMoveEventCampartorUPP = NewEventComparatorUPP(staticMoveEventComparator);
 	mGlobalHandlerRef = NULL;
 	mWindowHandlerRef = NULL;
-	
+
 	mDragOverrideCursor = -1;
 
 	// We're not clipping yet
@@ -445,7 +445,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 			mFullscreenBits    = -1;
 			mFullscreenRefresh = -1;
 
-			std::string error= llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height);	
+			std::string error= llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height);
 			OSMessageBox(error, "Error", OSMB_OK);
 		}
 	}
@@ -477,7 +477,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 			kFirstWindowOfClass,
 			true,
 			(long)this);
-		
+
 		if (!mWindow)
 		{
 			setupFailure("Window creation error", "Error", OSMB_OK);
@@ -493,7 +493,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 		InstallStandardEventHandler(GetWindowEventTarget(mWindow));
 		InstallWindowEventHandler(mWindow, mEventHandlerUPP, GetEventTypeCount (WindowHandlerEventList), WindowHandlerEventList, (void*)this, &mWindowHandlerRef); // add event handler
 #if LL_OS_DRAGDROP_ENABLED
-		InstallTrackingHandler( dragTrackingHandler, mWindow, (void*)this );		
+		InstallTrackingHandler( dragTrackingHandler, mWindow, (void*)this );
 		InstallReceiveHandler( dragReceiveHandler, mWindow, (void*)this );
 #endif // LL_OS_DRAGDROP_ENABLED
 	}
@@ -790,7 +790,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 		LL_DEBUGS("GLinit") << "Keeping vertical sync" << LL_ENDL;
 		frames_per_swap = 1;
 	}
-	aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap);  
+	aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap);
 
 	//enable multi-threaded OpenGL
 	if (sUseMultGL)
@@ -803,7 +803,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 		if (cgl_err != kCGLNoError )
 		{
 			LL_DEBUGS("GLInit") << "Multi-threaded OpenGL not available." << LL_ENDL;
-		}    
+		}
 		else
 		{
 			LL_DEBUGS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL;
@@ -1109,7 +1109,7 @@ BOOL LLWindowMacOSX::maximize()
 	{
 		ZoomWindow(mWindow, inContent, true);
 	}
-	
+
 	return mMaximized;
 }
 
@@ -1433,7 +1433,7 @@ static void fixOrigin(void)
 	GrafPtr port;
 	Rect portrect;
 
-	::GetPort(&port);	
+	::GetPort(&port);
 	::GetPortBounds(port, &portrect);
 	if((portrect.left != 0) || (portrect.top != 0))
 	{
@@ -1447,17 +1447,17 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position)
 	Point cursor_point;
 	LLCoordScreen screen_pos;
 	GrafPtr save;
-	
+
 	if(mWindow == NULL)
 		return FALSE;
-		
+
 	::GetPort(&save);
 	::SetPort(GetWindowPort(mWindow));
 	fixOrigin();
 
 	// gets the mouse location in local coordinates
 	::GetMouse(&cursor_point);
-	
+
 //	lldebugs << "getCursorPosition(): cursor is at " << cursor_point.h << ", " << cursor_point.v << "  port origin: " << portrect.left << ", " << portrect.top << llendl;
 
 	::SetPort(save);
@@ -1522,7 +1522,7 @@ F32 LLWindowMacOSX::getNativeAspectRatio()
 	{
 		// The constructor for this class grabs the aspect ratio of the monitor before doing any resolution
 		// switching, and stashes it in mOriginalAspectRatio.  Here, we just return it.
-	
+
 		if (mOverrideAspectRatio > 0.f)
 		{
 			return mOverrideAspectRatio;
@@ -1997,7 +1997,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					if (mPreeditor
 						&& (result = GetEventParameter(event, kEventParamTextInputSendFixLen,
 										typeLongInteger, &param_type, sizeof(fix_len), NULL, &fix_len)) == noErr
-						&& typeLongInteger == param_type 
+						&& typeLongInteger == param_type
 						&& (result = GetEventParameter(event, kEventParamTextInputSendText,
 										typeUnicodeText, &param_type, 0, &text_len, NULL)) == noErr
 						&& typeUnicodeText == param_type)
@@ -2017,7 +2017,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 							mPreeditor->markAsPreedit(location, length);
 						}
 						mPreeditor->resetPreedit();
-						
+
 						// Receive the text from input method.
 						U16 *const text = new U16[text_len / sizeof(U16)];
 						GetEventParameter(event, kEventParamTextInputSendText, typeUnicodeText, NULL, text_len, NULL, text);
@@ -2056,11 +2056,11 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 							GetEventParameter(event, kEventParamTextInputSendHiliteRng, typeTextRangeArray,
 									NULL, text_range_array_size, NULL, text_range_array);
 
-							// WARNING: We assume ranges are in ascending order, 
+							// WARNING: We assume ranges are in ascending order,
 							// although the condition is undocumented.  It seems
 							// OK to assume this.  I also assumed
 							// the ranges are contiguous in previous versions, but I
-							// have heard a rumore that older versions os ATOK may 
+							// have heard a rumore that older versions os ATOK may
 							// return ranges with some _gap_.  I don't know whether
 							// it is true, but I'm preparing my code for the case.
 
@@ -2124,7 +2124,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					}
 				}
 				break;
-				
+
 			case kEventTextInputUnicodeForKeyEvent:
 				{
 					UInt32 modifiers = 0;
@@ -2133,7 +2133,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					// First, process the raw event.
 					{
 						EventRef rawEvent = NULL;
-						
+
 						// Get the original event and extract the modifier keys, so we can ignore command-key events.
 						if (GetEventParameter(event, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(rawEvent), NULL, &rawEvent) == noErr)
 						{
@@ -2142,7 +2142,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 
 							// and call this function recursively to handle the raw key event.
 							eventHandler (myHandler, rawEvent);
-							
+
 							// save the raw event until we're done processing the unicode input as well.
 							mRawKeyEvent = rawEvent;
 						}
@@ -2173,7 +2173,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 						else
 						{
 							MASK mask = LLWindowMacOSX::modifiersToMask(modifiers);
-							
+
 							llassert( actualType == typeUnicodeText );
 
 							// The result is a UTF16 buffer.  Pass the characters in turn to handleUnicodeChar.
@@ -2199,7 +2199,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					result = err;
 				}
 				break;
-				
+
 			case kEventTextInputOffsetToPos:
 				{
 					EventParamType param_type;
@@ -2212,7 +2212,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 						S32 preedit, preedit_length;
 						mPreeditor->getPreeditRange(&preedit, &preedit_length);
 						const LLWString & text = mPreeditor->getPreeditString();
-						 
+
 						LLCoordGL caret_coord;
 						LLRect preedit_bounds;
 						if (0 <= offset
@@ -2226,10 +2226,10 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 							qd_point.h = caret_base_coord_screen.mX;
 							qd_point.v = caret_base_coord_screen.mY;
 							SetEventParameter(event, kEventParamTextInputReplyPoint, typeQDPoint, sizeof(qd_point), &qd_point);
-							
+
 							short line_height = (short) preedit_bounds.getHeight();
 							SetEventParameter(event, kEventParamTextInputReplyLineHeight, typeShortInteger, sizeof(line_height), &line_height);
-							
+
 							result = noErr;
 						}
 						else
@@ -2282,7 +2282,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 			case kEventRawKeyRepeat:
 				if (gDebugWindowProc)
 				{
-					printf("key down, key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n", 
+					printf("key down, key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n",
 							(unsigned int)keyCode, charCode, (char)charCode, (unsigned int)modifiers);
 					fflush(stdout);
 				}
@@ -2293,7 +2293,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 			case kEventRawKeyUp:
 				if (gDebugWindowProc)
 				{
-					printf("key up,   key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n", 
+					printf("key up,   key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n",
 							(unsigned int)keyCode, charCode, (char)charCode, (unsigned int)modifiers);
 					fflush(stdout);
 				}
@@ -2351,7 +2351,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 				}
 
 				// When the state of the 'Fn' key (the one that changes some of the mappings on a powerbook/macbook keyboard
-				// to an embedded keypad) changes, it may subsequently cause a key up event to be lost, which may lead to 
+				// to an embedded keypad) changes, it may subsequently cause a key up event to be lost, which may lead to
 				// a movement key getting "stuck" down.  This is bad.
 				// This is an OS bug -- even the GetKeys() API doesn't tell you the key has been released.
 				// This workaround causes all held-down keys to be reset whenever the state of the Fn key changes.  This isn't
@@ -2361,14 +2361,14 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					if (gDebugWindowProc) printf("Fn key state change event\n");
 					gKeyboard->resetKeys();
 				}
-				
+
 				if (gDebugWindowProc) fflush(stdout);
 
 				mLastModifiers = modifiers;
 				result = eventNotHandledErr;
 				break;
 			}
-			
+
 			mRawKeyEvent = NULL;
 		}
 		break;
@@ -2463,7 +2463,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					case kEventMouseButtonSecondary:
 						mCallbacks->handleRightMouseDown(this, outCoords, mask);
 						break;
-					
+
 					case kEventMouseButtonTertiary:
 						mCallbacks->handleMiddleMouseDown(this, outCoords, mask);
 						break;
@@ -2525,7 +2525,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 
 	case kEventClassWindow:
 		switch(evtKind)
-		{		
+		{
 		case kEventWindowActivated:
 			if (mTSMDocument)
 			{
@@ -2540,20 +2540,20 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 			}
 			mCallbacks->handleFocusLost(this);
 			break;
-			
+
 		case kEventWindowBoundsChanging:
 			{
 				// This is where we would constrain move/resize to a particular screen
 
-				const S32 MIN_WIDTH  = 1024;
-				const S32 MIN_HEIGHT = 768;
-				
+				const S32 MIN_WIDTH  = mMinWindowWidth;
+				const S32 MIN_HEIGHT = mMinWindowHeight;
+
 				Rect currentBounds;
 				Rect previousBounds;
 
 				GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &currentBounds);
 				GetEventParameter(event, kEventParamPreviousBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &previousBounds);
-				
+
 				// Put an offset into window un-maximize operation since the kEventWindowGetIdealSize
 				// event only allows the specification of size and not position.
 				if (mMaximized)
@@ -2561,7 +2561,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 					short leftOffset = mPreviousWindowRect.left - currentBounds.left;
 					currentBounds.left += leftOffset;
 					currentBounds.right += leftOffset;
-					
+
 					short topOffset = mPreviousWindowRect.top - currentBounds.top;
 					currentBounds.top += topOffset;
 					currentBounds.bottom += topOffset;
@@ -2581,7 +2581,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 				{
 					currentBounds.bottom = currentBounds.top + MIN_HEIGHT;
 				}
-				
+
 				SetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, sizeof(Rect), &currentBounds);
 				result = noErr;
 			}
@@ -2592,38 +2592,38 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 				// Get new window bounds
 				Rect newBounds;
 				GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &newBounds);
-				
+
 				// Get previous window bounds
 				Rect oldBounds;
 				GetEventParameter(event, kEventParamPreviousBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &oldBounds);
-				
+
 				// Determine if the new size is larger than the old
 				bool newBoundsLarger = ((newBounds.right - newBounds.left) >= (oldBounds.right - oldBounds.left));
 				newBoundsLarger &= ((newBounds.bottom - newBounds.top) >= (oldBounds.bottom - oldBounds.top));
-				
+
 				// Check to see if this is a zoom event (+ button on window pane)
 				unsigned int eventParams;
 				GetEventParameter(event, kEventParamAttributes, typeUInt32, NULL, sizeof(int), NULL, &eventParams);
 				bool isZoomEvent = ((eventParams & kWindowBoundsChangeZoom) != 0);
-				
+
 				// Maximized flag is if zoom event and increasing window size
 				mMaximized = (isZoomEvent && newBoundsLarger);
-				
+
 				aglUpdateContext(mContext);
-				
+
 				mCallbacks->handleResize(this, newBounds.right - newBounds.left, newBounds.bottom - newBounds.top);
 			}
 			break;
-			
+
 		case kEventWindowGetIdealSize:
 			// Only recommend a new ideal size when un-maximizing
 			if (mMaximized == TRUE)
 			{
 				Point nonMaximizedSize;
-				
+
 				nonMaximizedSize.v = mPreviousWindowRect.bottom - mPreviousWindowRect.top;
 				nonMaximizedSize.h = mPreviousWindowRect.right - mPreviousWindowRect.left;
-				
+
 				SetEventParameter(event, kEventParamDimensions, typeQDPoint, sizeof(Point), &nonMaximizedSize);
 				result = noErr;
 			}
@@ -2678,7 +2678,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 		if (mPreeditor)
 		{
 			switch(evtKind)
-			{		
+			{
 
 			case kEventTSMDocumentAccessGetLength:
 				{
@@ -2697,14 +2697,14 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 				{
 					// Return the selected range, excluding preedit.
 					// In our preeditor, preedit and selection are exclusive, so,
-					// when it has a preedit, there is no selection and the 
+					// when it has a preedit, there is no selection and the
 					// insertion point is on the preedit that corrupses into the
 					// beginning of the preedit when the preedit was removed.
 
 					S32 preedit, preedit_length;
 					mPreeditor->getPreeditRange(&preedit, &preedit_length);
 					const LLWString & text = mPreeditor->getPreeditString();
-					
+
 					CFRange range;
 					if (preedit_length)
 					{
@@ -2768,7 +2768,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 						memcpy(target_pointer, text_utf16.c_str() + range.location, range.length * sizeof(UniChar));
 
 						// Note that result has already been set above.
-					}					
+					}
 				}
 				break;
 
@@ -2815,14 +2815,14 @@ const char* cursorIDToName(int id)
 		case UI_CURSOR_TOOLPLAY:		return "UI_CURSOR_TOOLPLAY";
 		case UI_CURSOR_TOOLPAUSE:		return "UI_CURSOR_TOOLPAUSE";
 		case UI_CURSOR_TOOLMEDIAOPEN:	return "UI_CURSOR_TOOLMEDIAOPEN";
-		case UI_CURSOR_PIPETTE:			return "UI_CURSOR_PIPETTE";		
+		case UI_CURSOR_PIPETTE:			return "UI_CURSOR_PIPETTE";
 		case UI_CURSOR_TOOLSIT:			return "UI_CURSOR_TOOLSIT";
 		case UI_CURSOR_TOOLBUY:			return "UI_CURSOR_TOOLBUY";
 		case UI_CURSOR_TOOLOPEN:		return "UI_CURSOR_TOOLOPEN";
 	}
 
 	llerrs << "cursorIDToName: unknown cursor id" << id << llendl;
-	
+
 	return "UI_CURSOR_ARROW";
 }
 
@@ -2838,7 +2838,7 @@ static void initPixmapCursor(int cursorid, int hotspotX, int hotspotY)
 	fullpath += gDirUtilp->getDirDelimiter();
 	fullpath += cursorIDToName(cursorid);
 	fullpath += ".tif";
-	
+
 	gCursors[cursorid] = createImageCursor(fullpath.c_str(), hotspotX, hotspotY);
 }
 
@@ -2846,20 +2846,20 @@ void LLWindowMacOSX::setCursor(ECursorType cursor)
 {
 	OSStatus result = noErr;
 
-	if (mDragOverrideCursor != -1) 
+	if (mDragOverrideCursor != -1)
 	{
 		// A drag is in progress...remember the requested cursor and we'll
 		// restore it when it is done
 		mCurrentCursor = cursor;
 		return;
 	}
-		
+
 	if (cursor == UI_CURSOR_ARROW
 		&& mBusyCount > 0)
 	{
 		cursor = UI_CURSOR_WORKING;
 	}
-	
+
 	if(mCurrentCursor == cursor)
 		return;
 
@@ -3269,14 +3269,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)
 LLSD LLWindowMacOSX::getNativeKeyData()
 {
 	LLSD result = LLSD::emptyMap();
-	
+
 	if(mRawKeyEvent)
 	{
 		char char_code = 0;
 		UInt32 key_code = 0;
 		UInt32 modifiers = 0;
 		UInt32 keyboard_type = 0;
-		
+
 		GetEventParameter (mRawKeyEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &char_code);
 		GetEventParameter (mRawKeyEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &key_code);
 		GetEventParameter (mRawKeyEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
@@ -3286,7 +3286,7 @@ LLSD LLWindowMacOSX::getNativeKeyData()
 		result["key_code"] = (S32)key_code;
 		result["modifiers"] = (S32)modifiers;
 		result["keyboard_type"] = (S32)keyboard_type;
-		
+
 #if 0
 		// This causes trouble for control characters -- apparently character codes less than 32 (escape, control-A, etc)
 		// cause llsd serialization to create XML that the llsd deserializer won't parse!
@@ -3295,7 +3295,7 @@ LLSD LLWindowMacOSX::getNativeKeyData()
 		EventParamType actualType = typeUTF8Text;
 		UInt32 actualSize = 0;
 		char *buffer = NULL;
-		
+
 		err = GetEventParameter (mRawKeyEvent, kEventParamKeyUnicodes, typeUTF8Text, &actualType, 0, &actualSize, NULL);
 		if(err == noErr)
 		{
@@ -3308,7 +3308,7 @@ LLSD LLWindowMacOSX::getNativeKeyData()
 			}
 			delete[] buffer;
 		}
-		
+
 		result["unicode"] = unicode;
 #endif
 
@@ -3316,7 +3316,7 @@ LLSD LLWindowMacOSX::getNativeKeyData()
 
 
 	lldebugs << "native key data is: " << result << llendl;
-	
+
 	return result;
 }
 
@@ -3363,17 +3363,17 @@ void *LLWindowMacOSX::getPlatformWindow()
 
 void *LLWindowMacOSX::getMediaWindow()
 {
-	/* 
-		Mozilla needs to be initialized with a WindowRef to function properly.  
+	/*
+		Mozilla needs to be initialized with a WindowRef to function properly.
 		(There's no good reason for this, since it shouldn't be interacting with our window in any way, but that's another issue.)
-		If we're in windowed mode, we _could_ hand it our actual window pointer, but a subsequent switch to fullscreen will destroy that window, 
+		If we're in windowed mode, we _could_ hand it our actual window pointer, but a subsequent switch to fullscreen will destroy that window,
 		which trips up Mozilla.
 		Instead of using our actual window, we create an invisible window which will persist for the lifetime of the application and pass that to Mozilla.
 		This satisfies its deep-seated need to latch onto a WindowRef and solves the issue with switching between fullscreen and windowed modes.
 
 		Note that we will never destroy this window (by design!), but since only one will ever be created per run of the application, that's okay.
 	*/
-	
+
 	if(sMediaWindow == NULL)
 	{
 		Rect window_rect = {100, 100, 200, 200};
@@ -3382,13 +3382,13 @@ void *LLWindowMacOSX::getMediaWindow()
 			NULL,
 			&window_rect,
 			(ConstStr255Param) "\p",
-			false,				// Create the window invisible.  
+			false,				// Create the window invisible.
 			zoomDocProc,		// Window with a grow box and a zoom box
 			kLastWindowOfClass,		// create it behind other windows
 			false,					// no close box
 			0);
 	}
-	
+
 	return (void*)sMediaWindow;
 }
 
@@ -3438,7 +3438,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b)
 	}
 
 	UseInputWindow(mTSMDocument, !b);
-	
+
 	// Take care of old and new preeditors.
 	if (preeditor != mPreeditor || !b)
 	{
@@ -3457,7 +3457,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b)
 		return;
 	}
 	mLanguageTextInputAllowed = b;
-	
+
 	if (b)
 	{
 		if (mTSMScriptCode != smRoman)
@@ -3506,7 +3506,7 @@ MASK LLWindowMacOSX::modifiersToMask(SInt16 modifiers)
 	if(modifiers & (cmdKey | controlKey)) { mask |= MASK_CONTROL; }
 	if(modifiers & optionKey) { mask |= MASK_ALT; }
 	return mask;
-}	
+}
 
 #if LL_OS_DRAGDROP_ENABLED
 
@@ -3517,53 +3517,53 @@ OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef
 	LLWindowMacOSX *self = (LLWindowMacOSX*)handlerRefCon;
 
 	lldebugs << "drag tracking handler, message = " << message << llendl;
-	
+
 	switch(message)
 	{
 		case kDragTrackingInWindow:
 			result = self->handleDragNDrop(drag, LLWindowCallbacks::DNDA_TRACK);
 		break;
-		
+
 		case kDragTrackingEnterHandler:
 			result = self->handleDragNDrop(drag, LLWindowCallbacks::DNDA_START_TRACKING);
 		break;
-		
+
 		case kDragTrackingLeaveHandler:
 			result = self->handleDragNDrop(drag, LLWindowCallbacks::DNDA_STOP_TRACKING);
 		break;
-		
+
 		default:
 		break;
 	}
-	
+
 	return result;
 }
 
-OSErr LLWindowMacOSX::dragReceiveHandler(WindowRef theWindow, void * handlerRefCon,	
+OSErr LLWindowMacOSX::dragReceiveHandler(WindowRef theWindow, void * handlerRefCon,
 										 DragRef drag)
-{	
+{
 	LLWindowMacOSX *self = (LLWindowMacOSX*)handlerRefCon;
 	return self->handleDragNDrop(drag, LLWindowCallbacks::DNDA_DROPPED);
 
 }
 
 OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDropAction action)
-{	
+{
 	OSErr result = dragNotAcceptedErr;	// overall function result
 	OSErr err = noErr;	// for local error handling
-	
+
 	// Get the mouse position and modifiers of this drag.
 	SInt16 modifiers, mouseDownModifiers, mouseUpModifiers;
 	::GetDragModifiers(drag, &modifiers, &mouseDownModifiers, &mouseUpModifiers);
 	MASK mask = LLWindowMacOSX::modifiersToMask(modifiers);
-	
+
 	Point mouse_point;
 	// This will return the mouse point in global screen coords
 	::GetDragMouse(drag, &mouse_point, NULL);
 	LLCoordScreen screen_coords(mouse_point.h, mouse_point.v);
 	LLCoordGL gl_pos;
 	convertCoords(screen_coords, &gl_pos);
-	
+
 	// Look at the pasteboard and try to extract an URL from it
 	PasteboardRef   pasteboard;
 	if(GetDragPasteboard(drag, &pasteboard) == noErr)
@@ -3571,22 +3571,22 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop
 		ItemCount num_items = 0;
 		// Treat an error here as an item count of 0
 		(void)PasteboardGetItemCount(pasteboard, &num_items);
-		
+
 		// Only deal with single-item drags.
 		if(num_items == 1)
 		{
 			PasteboardItemID item_id = NULL;
 			CFArrayRef flavors = NULL;
 			CFDataRef data = NULL;
-			
+
 			err = PasteboardGetItemIdentifier(pasteboard, 1, &item_id); // Yes, this really is 1-based.
-			
+
 			// Try to extract an URL from the pasteboard
 			if(err == noErr)
 			{
 				err = PasteboardCopyItemFlavors( pasteboard, item_id, &flavors);
 			}
-			
+
 			if(err == noErr)
 			{
 				if(CFArrayContainsValue(flavors, CFRangeMake(0, CFArrayGetCount(flavors)), kUTTypeURL))
@@ -3599,9 +3599,9 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop
 					// This is a string that might be an URL.
 					err = PasteboardCopyItemFlavorData(pasteboard, item_id, kUTTypeUTF8PlainText, &data);
 				}
-				
+
 			}
-			
+
 			if(flavors != NULL)
 			{
 				CFRelease(flavors);
@@ -3612,12 +3612,12 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop
 				std::string url;
 				url.assign((char*)CFDataGetBytePtr(data), CFDataGetLength(data));
 				CFRelease(data);
-				
+
 				if(!url.empty())
 				{
-					LLWindowCallbacks::DragNDropResult res = 
+					LLWindowCallbacks::DragNDropResult res =
 						mCallbacks->handleDragNDrop(this, gl_pos, mask, action, url);
-					
+
 					switch (res) {
 						case LLWindowCallbacks::DND_NONE:		// No drop allowed
 							if (action == LLWindowCallbacks::DNDA_TRACK)
@@ -3652,7 +3652,7 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop
 						// Restore the cursor
 						ECursorType temp_cursor = mCurrentCursor;
 						// get around the "setting the same cursor" code in setCursor()
-						mCurrentCursor = UI_CURSOR_COUNT; 
+						mCurrentCursor = UI_CURSOR_COUNT;
  						setCursor(temp_cursor);
 					}
 					else {
@@ -3664,7 +3664,7 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop
 			}
 		}
 	}
-	
+
 	return result;
 }
 
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index a84bd5fb08a..06360d261fc 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2363,8 +2363,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 		case WM_GETMINMAXINFO:
 			{
 				LPMINMAXINFO min_max = (LPMINMAXINFO)l_param;
-				min_max->ptMinTrackSize.x = 1024;
-				min_max->ptMinTrackSize.y = 768;
+				min_max->ptMinTrackSize.x = window_imp->mMinWindowWidth;
+				min_max->ptMinTrackSize.y = window_imp->mMinWindowHeight;
 				return 0;
 			}
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9c055bdc5a4..bc6c63985fb 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12927,6 +12927,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>MinWindowHeight</key>
+    <map>
+      <key>Comment</key>
+      <string>SL viewer minimum window height in pixels</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>768</integer>
+    </map>
     <key>WindowHeight</key>
     <map>
       <key>Comment</key>
@@ -12934,7 +12945,7 @@
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
-      <string>S32</string>
+      <string>U32</string>
       <key>Value</key>
       <integer>738</integer>
     </map>
@@ -12949,6 +12960,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>MinWindowWidth</key>
+    <map>
+      <key>Comment</key>
+      <string>SL viewer minimum window width in pixels</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>1024</integer>
+    </map>
     <key>WindowWidth</key>
     <map>
       <key>Comment</key>
@@ -12956,7 +12978,7 @@
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
-      <string>S32</string>
+      <string>U32</string>
       <key>Value</key>
       <integer>1024</integer>
     </map>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 8bf4d940597..9b8f5c59612 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2860,10 +2860,22 @@ bool LLAppViewer::initWindow()
 
 	// always start windowed
 	BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
+
+	// clamp to minimum window size
+	U32 min_window_width=gSavedSettings.getU32("MinWindowWidth");
+	U32 window_width=gSavedSettings.getU32("WindowWidth");
+	if ( window_width < min_window_width )
+		window_width=min_window_width;
+
+	U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
+	U32 window_height=gSavedSettings.getU32("WindowHeight");
+	if ( window_height < min_window_height )
+		window_height=min_window_height;
+
 	gViewerWindow = new LLViewerWindow(gWindowTitle, 
 		VIEWER_WINDOW_CLASSNAME,
 		gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"),
-		gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"),
+		window_width, window_height,
 		gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth);
 
 	LL_INFOS("AppInit") << "gViewerwindow created." << LL_ENDL;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cf21ac4e5d6..140cbb4e040 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2161,8 +2161,18 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 		if (!maximized
 			&& mWindow->getSize(&window_size))
 		{
-			gSavedSettings.setS32("WindowWidth", window_size.mX);
-			gSavedSettings.setS32("WindowHeight", window_size.mY);
+			U32 min_window_width=gSavedSettings.getU32("MinWindowWidth");
+			if ( window_size.mX < min_window_width )
+				window_size.mX=min_window_width;
+			gSavedSettings.setU32("WindowWidth", window_size.mX);
+
+			U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
+			if ( window_size.mY < min_window_height )
+				window_size.mY=min_window_height;
+			gSavedSettings.setU32("WindowHeight", window_size.mY);
+
+			// tell the OS specific window code about min windoow size
+			mWindow->setMinSize(min_window_width, min_window_height);
 		}
 
 		LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width);
-- 
GitLab


From fabbae5e6e22883696ec7257716be0d5bdbbcfaf Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 11 Nov 2011 16:20:55 -0600
Subject: [PATCH 197/933] SH-2666 Fix for pixel doubling failsafe on out out of
 memory.

---
 indra/newview/pipeline.cpp | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index da4ffd97ded..226db5a520c 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -679,6 +679,8 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 			releaseScreenBuffers();
 		}
 
+		samples = 0;
+
 		//reduce resolution
 		while (resY > 0 && resX > 0)
 		{
@@ -6253,8 +6255,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	U32 res_mod = RenderResolutionDivisor;
 
 	LLVector2 tc1(0,0);
-	LLVector2 tc2((F32) gViewerWindow->getWorldViewWidthRaw()*2,
-				  (F32) gViewerWindow->getWorldViewHeightRaw()*2);
+	LLVector2 tc2((F32) mScreen.getWidth()*2,
+				  (F32) mScreen.getHeight()*2);
 
 	if (res_mod > 1)
 	{
@@ -6403,8 +6405,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight();
 	glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]);
 
-	tc2.setVec((F32) gViewerWindow->getWorldViewWidthRaw(),
-			(F32) gViewerWindow->getWorldViewHeightRaw());
+	tc2.setVec((F32) mScreen.getWidth(),
+			(F32) mScreen.getHeight());
 
 	gGL.flush();
 	
@@ -6418,7 +6420,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 							RenderDepthOfField;
 
 
-		bool multisample = RenderFSAASamples > 1;
+		bool multisample = RenderFSAASamples > 1 && mFXAABuffer.isComplete();
 
 #if LL_DARWIN //force FXAA to off on OSX (SH-2620)
 		multisample = false;
@@ -6606,11 +6608,20 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				if (multisample)
 				{
 					mDeferredLight.bindTarget();
+					glViewport(0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
+				}
+				else
+				{
+					gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft;
+					gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom;
+					gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth();
+					gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight();
+					glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]);
 				}
 
 				shader = &gDeferredDoFCombineProgram;
 				bindDeferredShader(*shader);
-				glViewport(0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
+				
 				S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage());
 				if (channel > -1)
 				{
-- 
GitLab


From e926b33567f4bb27fb1ec6cb6a422b20f8d8a487 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 11 Nov 2011 16:12:33 -0800
Subject: [PATCH 198/933] EXP-1544 FIX Remove 'Edit Terrain' from About Land
 floater

---
 indra/newview/llfloaterland.cpp               | 14 +--
 indra/newview/llfloaterland.h                 |  1 -
 .../default/xui/en/floater_about_land.xml     | 99 +++++++++----------
 3 files changed, 48 insertions(+), 66 deletions(-)

diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 2bb1075ec44..b13a9aab888 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1806,7 +1806,6 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel)
 	mCheckEditGroupObjects(NULL),
 	mCheckAllObjectEntry(NULL),
 	mCheckGroupObjectEntry(NULL),
-	mCheckEditLand(NULL),
 	mCheckSafe(NULL),
 	mCheckFly(NULL),
 	mCheckGroupScripts(NULL),
@@ -1840,10 +1839,6 @@ BOOL LLPanelLandOptions::postBuild()
 	mCheckGroupObjectEntry = getChild<LLCheckBoxCtrl>( "group object entry check");
 	childSetCommitCallback("group object entry check", onCommitAny, this);
 	
-	mCheckEditLand = getChild<LLCheckBoxCtrl>( "edit land check");
-	childSetCommitCallback("edit land check", onCommitAny, this);
-
-	
 	mCheckGroupScripts = getChild<LLCheckBoxCtrl>( "check group scripts");
 	childSetCommitCallback("check group scripts", onCommitAny, this);
 
@@ -1956,9 +1951,6 @@ void LLPanelLandOptions::refresh()
 		mCheckGroupObjectEntry	->set(FALSE);
 		mCheckGroupObjectEntry	->setEnabled(FALSE);
 
-		mCheckEditLand		->set(FALSE);
-		mCheckEditLand		->setEnabled(FALSE);
-		
 		mCheckSafe			->set(FALSE);
 		mCheckSafe			->setEnabled(FALSE);
 
@@ -2006,10 +1998,6 @@ void LLPanelLandOptions::refresh()
 
 		mCheckGroupObjectEntry	->set( parcel->getAllowGroupObjectEntry() ||  parcel->getAllowAllObjectEntry());
 		mCheckGroupObjectEntry	->setEnabled( can_change_options && !parcel->getAllowAllObjectEntry() );
-
-		BOOL can_change_terraform = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_EDIT);
-		mCheckEditLand		->set( parcel->getAllowTerraform() );
-		mCheckEditLand		->setEnabled( can_change_terraform );
 		
 		mCheckSafe			->set( !parcel->getAllowDamage() );
 		mCheckSafe			->setEnabled( can_change_options );
@@ -2235,7 +2223,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
 	BOOL create_group_objects	= self->mCheckEditGroupObjects->get() || self->mCheckEditObjects->get();
 	BOOL all_object_entry		= self->mCheckAllObjectEntry->get();
 	BOOL group_object_entry	= self->mCheckGroupObjectEntry->get() || self->mCheckAllObjectEntry->get();
-	BOOL allow_terraform	= self->mCheckEditLand->get();
+	BOOL allow_terraform	= false; // removed from UI so always off now - self->mCheckEditLand->get();
 	BOOL allow_damage		= !self->mCheckSafe->get();
 	BOOL allow_fly			= self->mCheckFly->get();
 	BOOL allow_landmark		= TRUE; // cannot restrict landmark creation
diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h
index 6fceca1acdd..4f1c10274a0 100644
--- a/indra/newview/llfloaterland.h
+++ b/indra/newview/llfloaterland.h
@@ -330,7 +330,6 @@ class LLPanelLandOptions
 	LLCheckBoxCtrl*	mCheckEditGroupObjects;
 	LLCheckBoxCtrl*	mCheckAllObjectEntry;
 	LLCheckBoxCtrl*	mCheckGroupObjectEntry;
-	LLCheckBoxCtrl*	mCheckEditLand;
 	LLCheckBoxCtrl*	mCheckSafe;
 	LLCheckBoxCtrl*	mCheckFly;
 	LLCheckBoxCtrl*	mCheckGroupScripts;
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 1c7b354221a..db1856b9e79 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1208,7 +1208,7 @@ Only large parcels can be listed in search.
             </panel.string>
             <panel.string
              name="see_avs_text">
-                 See and chat with residents on this parcel
+                    Avatars on other parcels can see
             </panel.string>
             <text
              type="string"
@@ -1223,30 +1223,33 @@ Only large parcels can be listed in search.
              width="278">
                 Allow other Residents to:
             </text>
-            <check_box
-             height="16"
-             label="Edit Terrain"
-             layout="topleft"
-             left="14"
-             name="edit land check"
-             tool_tip="If checked, anyone can terraform your land. It is best to leave this unchecked, as you can always edit your own land."
-             top_pad="4"
-             width="147i" />
-            <check_box
+          <text
+           type="string"
+           length="1"
+           follows="left|top"
+           height="16"
+           layout="topleft"
+           left="20"
+           name="allow_label0"
+           width="150">
+            Fly:
+          </text>
+
+          <check_box
              height="16"
-             label="Fly"
+             label="Everyone"
              layout="topleft"
              name="check fly"
              tool_tip="If checked, Residents can fly on your land. If unchecked, they can only fly into and over your land."
-             left_pad="4"
-             width="150" />
+             left_pad="2"
+             width="130" />
             <text
              type="string"
              length="1"
              follows="left|top"
              height="16"
              layout="topleft"
-             left="14"
+             left="20"
              name="allow_label2"
              width="150">
                 Build:
@@ -1271,7 +1274,7 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="14"
+             left="20"
              name="allow_label3"
              width="150">
                 Object Entry:
@@ -1298,7 +1301,7 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="14"
+             left="20"
              name="allow_label4"
              width="150">
                 Run Scripts:
@@ -1319,32 +1322,21 @@ Only large parcels can be listed in search.
              name="check group scripts"
              top_delta="0"
              width="70" />
-           <text
-             type="string"
-             text_color="white"
-             length="1"
-             follows="left|top"
-             height="16"
-             layout="topleft"
-             left="10"
-             name="land_options_label"
-             width="278">
-                Land Options:
-            </text>
+ 
             <check_box
              height="16"
              label="Safe (no damage)"
              layout="topleft"
-             left="14"
+             left="18"
              name="check safe"
              tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled."
-             top_pad="5"
+             top_pad="20"
              width="200" />
             <check_box
              height="16"
              label="No Pushing"
              layout="topleft"
-             left_pad="5"
+             left_pad="35"
              name="PushRestrictCheck"
              tool_tip="Prevents scripts from pushing. Checking this option may be useful for preventing disruptive behavior on your land."
              top_delta="0"
@@ -1353,7 +1345,7 @@ Only large parcels can be listed in search.
              height="16"
              label="Show Place in Search (L$30/week)"
              layout="topleft"
-             left="14"
+             left="18"
              name="ShowDirectoryCheck"
              tool_tip="Let people see this parcel in search results"
              width="430" />
@@ -1361,7 +1353,7 @@ Only large parcels can be listed in search.
              enabled="false"
              height="23"
              layout="topleft"
-             left="30"
+             left="20"
              name="land category with adult"
              visible="false"
              width="140">
@@ -1426,7 +1418,7 @@ Only large parcels can be listed in search.
              enabled="false"
              height="23"
              layout="topleft"
-             left="30"
+             left="20"
              name="land category"
              visible="false"
              width="140">
@@ -1487,11 +1479,11 @@ Only large parcels can be listed in search.
              height="16"
              label="Moderate Content"
              layout="topleft"
-             left="14"
+             left="18"
              name="MatureCheck"
-             top="177"
+             top="167"
              label_text.valign="center" 
-             label_text.v_pad="-5" 
+             label_text.v_pad="-1" 
              tool_tip=" "
              width="200" />
             <text
@@ -1500,18 +1492,19 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="10"
+             left="20"
              name="Snapshot:"
              text_color="white"
-             top="220"
+             top="225"
              width="200">
                 Snapshot:
             </text>
             <texture_picker
              follows="left|top"
+             top_pad="0"
              height="150"
              layout="topleft"
-             left="14"
+             left="20"
              name="snapshot_ctrl"
              fallback_image="default_land_picture.j2c" 
              tool_tip="Click to choose a picture"
@@ -1520,23 +1513,24 @@ Only large parcels can be listed in search.
              type="string"
              length="1"
              follows="left|top"
-             text_color="white"
+             text_color="LtGray"
              height="16"
              layout="topleft"
-             left="230"
-             top="174"
+             left="274"
+             top="160"
              name="allow_label5"
              width="278">
-              Allow Residents on other parcels to:
+              and chat with avatars on this parcel
             </text>
             <check_box
              height="16"
              label="See Avatars"
              follows="top"
              layout="topleft"
-             left="230"
+             left="253"
+             top="146"
              name="SeeAvatarsCheck"
-             tool_tip="Allows residents on other parcels to see and chat with residents on this parcel, and you to see and chat with them."
+             tool_tip="Allows avatars on other parcels to see and chat with avatars on this parcel, and you to see and chat with them."
              width="120" />
             <text
              type="string"
@@ -1544,8 +1538,8 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="230"
-             top="230"
+             left="255"
+             top="282"
              text_color="white"
              name="landing_point"
              word_wrap="true"
@@ -1554,12 +1548,13 @@ Only large parcels can be listed in search.
             </text>
             <button
              follows="right|top"
+             top_pad="0"
              height="23"
              label="Set"
              label_selected="Set"
              layout="topleft"
              name="Set"
-             left="230"
+             left="255"
              tool_tip="Sets the landing point where visitors arrive. Sets to your avatar&apos;s location inside this parcel."
              width="50" />
             <button
@@ -1579,7 +1574,7 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="230"
+             left="255"
              top_pad="10"
              name="Teleport Routing: "
              width="200">
@@ -1589,7 +1584,7 @@ Only large parcels can be listed in search.
              height="23"
              layout="topleft"
              name="landing type"
-             top_pad="3"
+             top_pad="0"
              tool_tip="Teleport Routing -- select how to handle teleports onto your land"
              width="120">
                 <combo_box.item
-- 
GitLab


From 84ab08d2a5ac59ea2681e3dea0e0bc48e3d99de5 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 11 Nov 2011 16:27:08 -0800
Subject: [PATCH 199/933] Assorted shader cleanup to remove a few warnings and
 errors for OS X.

---
 .../shaders/class1/deferred/attachmentShadowV.glsl     |  3 ---
 .../shaders/class1/deferred/avatarShadowV.glsl         |  3 ---
 .../shaders/class1/deferred/impostorV.glsl             |  4 ----
 .../shaders/class2/deferred/sunLightF.glsl             | 10 +++++-----
 .../shaders/class2/deferred/sunLightSSAOF.glsl         |  8 ++++----
 .../app_settings/shaders/class2/windlight/skyV.glsl    |  3 ---
 6 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index 533babf3dc2..ded6cced27f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -31,15 +31,12 @@ ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
 
 mat4 getObjectSkinnedTransform();
 
 void main()
 {
 	//transform vertex
-	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-	
 	mat4 mat = getObjectSkinnedTransform();
 	
 	mat = modelview_matrix * mat;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index 525acbe4ea9..23feb09d723 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -32,12 +32,9 @@ ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
 
 VARYING vec4 post_pos;
-VARYING vec2 vary_texcoord0;
 
 void main()
 {
-	vary_texcoord0 = texcoord0;
-				
 	vec4 pos;
 	vec3 norm;
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 58e5dc0b569..42266e9378e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -27,10 +27,8 @@ uniform mat4 texture_matrix0;
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
-VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
 void main()
@@ -38,6 +36,4 @@ void main()
 	//transform vertex
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-	
-	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 7e62012b5da..229c2f4b675 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -99,15 +99,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	
-	float cs = shadow2D(shadowMap, stc.xyz);
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 	float shadow = cs;
 
 	vec2 off = 1.5/proj_shadow_res;
 	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
 				
 	return shadow/5.0;
 	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 025ff481091..fc19f15e025 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -155,10 +155,10 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 
 	vec2 off = 1.5/proj_shadow_res;
 	
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
-	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
+	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
 	
 			
 	return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index b768cc9cf36..46773cf89f6 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -26,7 +26,6 @@
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
 
 // SKY ////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
@@ -34,7 +33,6 @@ ATTRIBUTE vec2 texcoord0;
 
 // Output parameters
 VARYING vec4 vary_HazeColor;
-VARYING vec2 vary_texcoord0;
 
 // Inputs
 uniform vec3 camPosLocal;
@@ -62,7 +60,6 @@ void main()
 
 	// World / view / projection
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	vary_texcoord0 = texcoord0;
 
 	// Get relative position
 	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
-- 
GitLab


From e7daefeb4d09ff7726e8865d5323b2c1e6ffe9a8 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 11 Nov 2011 16:36:00 -0800
Subject: [PATCH 200/933] SH-2620 -- Enabled FXAA on OSX, which fixes the issue
 with latest code and some assorted shader cleanup from changeset e156c46db1b2

---
 indra/newview/pipeline.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 226db5a520c..af96a042a12 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6422,10 +6422,6 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 		bool multisample = RenderFSAASamples > 1 && mFXAABuffer.isComplete();
 
-#if LL_DARWIN //force FXAA to off on OSX (SH-2620)
-		multisample = false;
-#endif
-
 		gViewerWindow->setup3DViewport();
 				
 		if (dof_enabled)
-- 
GitLab


From 8ff29a9e84b37e8962c4f485e0e1d678793f718e Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 11 Nov 2011 16:55:50 -0800
Subject: [PATCH 201/933] EXP-1544 ADDITIONAL FIX Remove 'Edit Terrain' from
 About Land floater

---
 .../default/xui/en/floater_about_land.xml     | 24 +++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index db1856b9e79..4772f744ead 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1322,15 +1322,22 @@ Only large parcels can be listed in search.
              name="check group scripts"
              top_delta="0"
              width="70" />
- 
-            <check_box
+          <panel
+            bevel_style="none"
+            border="true"
+            top="146"
+            bottom="146"
+            follows="left|bottom|right"
+            left="20"
+            right="-20"/>
+          <check_box
              height="16"
              label="Safe (no damage)"
              layout="topleft"
              left="18"
              name="check safe"
              tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled."
-             top_pad="20"
+             top="130"
              width="200" />
             <check_box
              height="16"
@@ -1339,7 +1346,7 @@ Only large parcels can be listed in search.
              left_pad="35"
              name="PushRestrictCheck"
              tool_tip="Prevents scripts from pushing. Checking this option may be useful for preventing disruptive behavior on your land."
-             top_delta="0"
+             top="130"
              width="119" />
             <check_box
              height="16"
@@ -1348,12 +1355,14 @@ Only large parcels can be listed in search.
              left="18"
              name="ShowDirectoryCheck"
              tool_tip="Let people see this parcel in search results"
+             top="150"
              width="430" />
             <combo_box
              enabled="false"
              height="23"
              layout="topleft"
              left="20"
+             top="194"
              name="land category with adult"
              visible="false"
              width="140">
@@ -1419,6 +1428,7 @@ Only large parcels can be listed in search.
              height="23"
              layout="topleft"
              left="20"
+             top="194"
              name="land category"
              visible="false"
              width="140">
@@ -1481,7 +1491,7 @@ Only large parcels can be listed in search.
              layout="topleft"
              left="18"
              name="MatureCheck"
-             top="167"
+             top="170"
              label_text.valign="center" 
              label_text.v_pad="-1" 
              tool_tip=" "
@@ -1517,7 +1527,7 @@ Only large parcels can be listed in search.
              height="16"
              layout="topleft"
              left="274"
-             top="160"
+             top="166"
              name="allow_label5"
              width="278">
               and chat with avatars on this parcel
@@ -1528,7 +1538,7 @@ Only large parcels can be listed in search.
              follows="top"
              layout="topleft"
              left="253"
-             top="146"
+             top="150"
              name="SeeAvatarsCheck"
              tool_tip="Allows avatars on other parcels to see and chat with avatars on this parcel, and you to see and chat with them."
              width="120" />
-- 
GitLab


From db371c98248b790eed22a6295d33dd1d02adc602 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 11 Nov 2011 23:58:37 -0800
Subject: [PATCH 202/933] EXP-1498 : Hide empty system folders. System folders
 can be specifically marked to be hidden if empty in the
 LLViewerFolderDictionary constructor.

---
 indra/newview/llfolderviewitem.cpp   |  4 +-
 indra/newview/llinventorybridge.cpp  | 14 ++++++
 indra/newview/llinventorybridge.h    |  1 +
 indra/newview/llinventorymodel.h     |  2 +-
 indra/newview/llinventorypanel.cpp   | 46 +++++++++++++-----
 indra/newview/llviewerfoldertype.cpp | 71 ++++++++++++++++------------
 indra/newview/llviewerfoldertype.h   |  1 +
 7 files changed, 95 insertions(+), 44 deletions(-)

diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 622dcfe8ddb..68a176e385a 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -1173,8 +1173,8 @@ BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* r
 	return folder->addFolder(this);
 }
 
-// Finds width and height of this object and it's children.  Also
-// makes sure that this view and it's children are the right size.
+// Finds width and height of this object and its children. Also
+// makes sure that this view and its children are the right size.
 S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
 {
 	// sort before laying out contents
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 0c092e9a561..244b001adb8 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -195,6 +195,20 @@ BOOL LLInvFVBridge::isLink() const
 	return mIsLink;
 }
 
+// Is a "System" folder
+// System folders are predefined named folders that have a specific preferred type
+// e.g. "Textures" which has an FT_TEXTURE preferred type.
+// Those are folders used to route incoming items in the current (soon to be obsolete) inventory
+// asset routing.
+// If a folder uses the same name as a predefined folder but is not of the same preferred type
+// or if it has a preferred type but a different name, it will not be considered a system folder.
+// *TODO: Test that logic in all languages
+bool LLInvFVBridge::isSystemFolder() const
+{
+	LLFolderType::EType preferred_type = getPreferredType();
+	return (preferred_type == LLFolderType::FT_NONE ? false : LLViewerFolderType::lookupTypeFromNewCategoryName(getDisplayName()) == preferred_type);
+}
+
 /*virtual*/
 /**
  * @brief Adds this item into clipboard storage
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 2d625befb4c..9832c683c66 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -72,6 +72,7 @@ class LLInvFVBridge : public LLFolderViewEventListener
 	BOOL canShare() const;
 	BOOL canListOnMarketplace() const;
 	BOOL canListOnMarketplaceNow() const;
+	bool isSystemFolder() const; // true if is a "System" folder
 
 	//--------------------------------------------------------------------
 	// LLInvFVBridge functionality
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index a0fd455cf3b..340c1b0c22d 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -411,7 +411,7 @@ class LLInventoryModel
 	// Return (yes/no/maybe) child status of category children.
 	EHasChildren categoryHasChildren(const LLUUID& cat_id) const;
 
-	// Returns true iff category version is known and theoretical
+	// Returns true if category version is known and theoretical
 	// descendents == actual descendents.
 	bool isCategoryComplete(const LLUUID& cat_id) const;
 	
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index acbec531b6a..aff48b19610 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -618,22 +618,41 @@ LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool u
 
 LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
 {
-	LLFolderViewFolder::Params params;
+	// Create the folder ui widget, unless it's an empty system folder that should be hidden
+	// Note : we still let the code create a listener for it (in case something shows up in it)
+	// but we simply skip creating the ui ctrl and adding it.
+	// *TODO : Need to be verified: if the listener is triggered and something added, will the code
+	// crash (because it's assuming, wrongly, that the uictrl exists)?
+
+	bool is_system_folder = bridge->isSystemFolder();
+	bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(bridge->getPreferredType());
+	bool is_empty = (mInventory->categoryHasChildren(bridge->getUUID()) != LLInventoryModel::CHILDREN_YES);
+	
+	if (!is_system_folder || !is_empty || !is_hidden_if_empty)
+	{
+		LLFolderViewFolder::Params params;
 
-	params.name = bridge->getDisplayName();
-	params.icon = bridge->getIcon();
-	params.icon_open = bridge->getOpenIcon();
+		params.name = bridge->getDisplayName();
+		params.icon = bridge->getIcon();
+		params.icon_open = bridge->getOpenIcon();
 
-	if (mShowItemLinkOverlays) // if false, then links show up just like normal items
+		if (mShowItemLinkOverlays) // if false, then links show up just like normal items
+		{
+			params.icon_overlay = LLUI::getUIImage("Inv_Link");
+		}
+	
+		params.root = mFolderRoot;
+		params.listener = bridge;
+		params.tool_tip = params.name;
+
+		return LLUICtrlFactory::create<LLFolderViewFolder>(params);
+	}
+	else 
 	{
-		params.icon_overlay = LLUI::getUIImage("Inv_Link");
+		// It's an empty system folder that should be hidden -> return NULL
+		return NULL;
 	}
-	
-	params.root = mFolderRoot;
-	params.listener = bridge;
-	params.tool_tip = params.name;
 
-	return LLUICtrlFactory::create<LLFolderViewFolder>(params);
 }
 
 LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
@@ -697,7 +716,10 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id)
   				if (new_listener)
   				{
 					LLFolderViewFolder* folderp = createFolderViewFolder(new_listener);
-  					folderp->setItemSortOrder(mFolderRoot->getSortOrder());
+					if (folderp)
+					{
+						folderp->setItemSortOrder(mFolderRoot->getSortOrder());
+					}
   					itemp = folderp;
   				}
   			}
diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp
index 91012223930..a179b61cffc 100644
--- a/indra/newview/llviewerfoldertype.cpp
+++ b/indra/newview/llviewerfoldertype.cpp
@@ -40,6 +40,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry
 					  const std::string &icon_name_open,	// name of the folder icon
 					  const std::string &icon_name_closed,
 					  BOOL is_quiet,						// folder doesn't need a UI update when changed
+					  bool hide_if_empty,					// folder not shown if empty
 					  const std::string &dictionary_name = empty_string // no reverse lookup needed on non-ensembles, so in most cases just leave this blank
 		) 
 		:
@@ -47,7 +48,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry
 		mNewCategoryName(new_category_name),
 		mIconNameOpen(icon_name_open),
 		mIconNameClosed(icon_name_closed),
-		mIsQuiet(is_quiet)
+		mIsQuiet(is_quiet),
+		mHideIfEmpty(hide_if_empty)
 	{
 		mAllowedNames.clear();
 	}
@@ -66,7 +68,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry
 		*/
 		mIconNameOpen("Inv_FolderOpen"), mIconNameClosed("Inv_FolderClosed"),
 		mNewCategoryName(new_category_name),
-		mIsQuiet(FALSE)
+		mIsQuiet(FALSE),
+		mHideIfEmpty(false)
 	{
 		const std::string delims (",");
 		LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims);
@@ -91,6 +94,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry
 	typedef std::vector<std::string> name_vec_t;
 	name_vec_t mAllowedNames;
 	BOOL mIsQuiet;
+	bool mHideIfEmpty;
 };
 
 class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>,
@@ -104,43 +108,43 @@ class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>,
 
 LLViewerFolderDictionary::LLViewerFolderDictionary()
 {
-	//       													    	  NEW CATEGORY NAME         FOLDER OPEN             FOLDER CLOSED          QUIET?
-	//      												  		     |-------------------------|-----------------------|----------------------|-----------|
-	addEntry(LLFolderType::FT_TEXTURE, 				new ViewerFolderEntry("Textures",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_SOUND, 				new ViewerFolderEntry("Sounds",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_CALLINGCARD, 			new ViewerFolderEntry("Calling Cards",			"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_LANDMARK, 			new ViewerFolderEntry("Landmarks",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_CLOTHING, 			new ViewerFolderEntry("Clothing",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_OBJECT, 				new ViewerFolderEntry("Objects",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_NOTECARD, 			new ViewerFolderEntry("Notecards",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_ROOT_INVENTORY, 		new ViewerFolderEntry("My Inventory",			"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_LSL_TEXT, 			new ViewerFolderEntry("Scripts",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_BODYPART, 			new ViewerFolderEntry("Body Parts",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_TRASH, 				new ViewerFolderEntry("Trash",					"Inv_TrashOpen",		"Inv_TrashClosed",		TRUE));
-	addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, 	new ViewerFolderEntry("Photo Album",			"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_LOST_AND_FOUND, 		new ViewerFolderEntry("Lost And Found",	   		"Inv_LostOpen",			"Inv_LostClosed",		TRUE));
-	addEntry(LLFolderType::FT_ANIMATION, 			new ViewerFolderEntry("Animations",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_GESTURE, 				new ViewerFolderEntry("Gestures",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_FAVORITE, 			new ViewerFolderEntry("Favorites",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
+	//       													    	  NEW CATEGORY NAME         FOLDER OPEN             FOLDER CLOSED          QUIET?      HIDE IF EMPTY?
+	//      												  		     |-------------------------|-----------------------|----------------------|-----------|--------------|
+	addEntry(LLFolderType::FT_TEXTURE, 				new ViewerFolderEntry("Textures",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_SOUND, 				new ViewerFolderEntry("Sounds",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_CALLINGCARD, 			new ViewerFolderEntry("Calling Cards",			"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_LANDMARK, 			new ViewerFolderEntry("Landmarks",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_CLOTHING, 			new ViewerFolderEntry("Clothing",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_OBJECT, 				new ViewerFolderEntry("Objects",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_NOTECARD, 			new ViewerFolderEntry("Notecards",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_ROOT_INVENTORY, 		new ViewerFolderEntry("My Inventory",			"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     false));
+	addEntry(LLFolderType::FT_LSL_TEXT, 			new ViewerFolderEntry("Scripts",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_BODYPART, 			new ViewerFolderEntry("Body Parts",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_TRASH, 				new ViewerFolderEntry("Trash",					"Inv_TrashOpen",		"Inv_TrashClosed",		TRUE,      false));
+	addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, 	new ViewerFolderEntry("Photo Album",			"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_LOST_AND_FOUND, 		new ViewerFolderEntry("Lost And Found",	   		"Inv_LostOpen",			"Inv_LostClosed",		TRUE,      true));
+	addEntry(LLFolderType::FT_ANIMATION, 			new ViewerFolderEntry("Animations",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_GESTURE, 				new ViewerFolderEntry("Gestures",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_FAVORITE, 			new ViewerFolderEntry("Favorites",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
 
-	addEntry(LLFolderType::FT_CURRENT_OUTFIT, 		new ViewerFolderEntry("Current Outfit",			"Inv_SysOpen",			"Inv_SysClosed",		TRUE));
-	addEntry(LLFolderType::FT_OUTFIT, 				new ViewerFolderEntry("New Outfit",				"Inv_LookFolderOpen",	"Inv_LookFolderClosed",	TRUE));
-	addEntry(LLFolderType::FT_MY_OUTFITS, 			new ViewerFolderEntry("My Outfits",				"Inv_SysOpen",			"Inv_SysClosed",		TRUE));
-	addEntry(LLFolderType::FT_MESH, 				new ViewerFolderEntry("Meshes",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
+	addEntry(LLFolderType::FT_CURRENT_OUTFIT, 		new ViewerFolderEntry("Current Outfit",			"Inv_SysOpen",			"Inv_SysClosed",		TRUE,      false));
+	addEntry(LLFolderType::FT_OUTFIT, 				new ViewerFolderEntry("New Outfit",				"Inv_LookFolderOpen",	"Inv_LookFolderClosed",	TRUE,      true));
+	addEntry(LLFolderType::FT_MY_OUTFITS, 			new ViewerFolderEntry("My Outfits",				"Inv_SysOpen",			"Inv_SysClosed",		TRUE,      true));
+	addEntry(LLFolderType::FT_MESH, 				new ViewerFolderEntry("Meshes",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
 	
-	addEntry(LLFolderType::FT_INBOX, 				new ViewerFolderEntry("Inbox",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
-	addEntry(LLFolderType::FT_OUTBOX, 				new ViewerFolderEntry("Outbox",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
+	addEntry(LLFolderType::FT_INBOX, 				new ViewerFolderEntry("Inbox",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
+	addEntry(LLFolderType::FT_OUTBOX, 				new ViewerFolderEntry("Outbox",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
 
-	addEntry(LLFolderType::FT_BASIC_ROOT, 			new ViewerFolderEntry("Basic Root",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
+	addEntry(LLFolderType::FT_BASIC_ROOT, 			new ViewerFolderEntry("Basic Root",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE,     true));
 		 
-	addEntry(LLFolderType::FT_NONE, 				new ViewerFolderEntry("New Folder",				"Inv_FolderOpen",		"Inv_FolderClosed",		FALSE, "default"));
+	addEntry(LLFolderType::FT_NONE, 				new ViewerFolderEntry("New Folder",				"Inv_FolderOpen",		"Inv_FolderClosed",		FALSE,     false, "default"));
 
 #if SUPPORT_ENSEMBLES
 	initEnsemblesFromFile();
 #else
 	for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type)
 	{
-		addEntry((LLFolderType::EType)type, 		new ViewerFolderEntry("New Folder",				"Inv_FolderOpen",		"Inv_FolderClosed",		FALSE));
+		addEntry((LLFolderType::EType)type, 		new ViewerFolderEntry("New Folder",				"Inv_FolderOpen",		"Inv_FolderClosed",		FALSE,     false));
 	}	
 #endif
 }
@@ -259,6 +263,15 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type)
 	return FALSE;
 }
 
+bool LLViewerFolderType::lookupIsHiddenIfEmpty(LLFolderType::EType folder_type)
+{
+	const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type);
+	if (entry)
+	{
+		return entry->mHideIfEmpty;
+	}
+	return false;
+}
 
 const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type)
 {
diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h
index f5938de619b..13d5a8fbbdf 100644
--- a/indra/newview/llviewerfoldertype.h
+++ b/indra/newview/llviewerfoldertype.h
@@ -40,6 +40,7 @@ class LLViewerFolderType : public LLFolderType
 
 	static const std::string&   lookupIconName(EType folder_type, BOOL is_open = FALSE); // folder icon name
 	static BOOL					lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured
+	static bool					lookupIsHiddenIfEmpty(EType folder_type); // folder is not displayed if empty
 	static const std::string&	lookupNewCategoryName(EType folder_type); // default name when creating new category
 	static LLFolderType::EType	lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category
 
-- 
GitLab


From 82f7ccdb0ae72de0dbef8350da122bd74b7d12a5 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 14 Nov 2011 17:38:08 +0200
Subject: [PATCH 203/933] EXP-1573 FIXED Display "Refresh to save" hint when
 snapshot needs to be refreshed.

By the way, removed redundant onCommitResolution() callback.
---
 indra/newview/llfloatersnapshot.cpp           | 72 +++++++++++++++----
 indra/newview/llfloatersnapshot.h             |  1 +
 .../skins/default/xui/en/floater_snapshot.xml | 59 ++++++++-------
 3 files changed, 89 insertions(+), 43 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index bca913c4bb0..8e346d3e7a9 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1064,6 +1064,7 @@ class LLFloaterSnapshot::Impl
 	:	mAvatarPauseHandles(),
 		mLastToolset(NULL),
 		mAspectRatioCheckOff(false),
+		mNeedRefresh(false),
 		mStatus(STATUS_READY)
 	{
 	}
@@ -1083,7 +1084,6 @@ class LLFloaterSnapshot::Impl
 	static void onClickKeepAspectCheck(LLUICtrl *ctrl, void* data);
 #endif
 	static void applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked);
-	static void onCommitResolution(LLUICtrl* ctrl, void* data) { updateResolution(ctrl, data); }
 	static void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE);
 	static void onCommitFreezeFrame(LLUICtrl* ctrl, void* data);
 	static void onCommitLayerTypes(LLUICtrl* ctrl, void*data);
@@ -1113,6 +1113,7 @@ class LLFloaterSnapshot::Impl
 	static void updateLayout(LLFloaterSnapshot* floater);
 	static void setStatus(EStatus status, bool ok = true, const std::string& msg = LLStringUtil::null);
 	EStatus getStatus() const { return mStatus; }
+	static void setNeedRefresh(LLFloaterSnapshot* floater, bool need);
 
 private:
 	static LLViewerWindow::ESnapshotType getLayerType(LLFloaterSnapshot* floater);
@@ -1129,6 +1130,7 @@ class LLFloaterSnapshot::Impl
 	LLToolset*	mLastToolset;
 	LLHandle<LLView> mPreviewHandle;
 	bool mAspectRatioCheckOff ;
+	bool mNeedRefresh;
 	EStatus mStatus;
 };
 
@@ -1347,6 +1349,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 // No other methods should be changing any of the controls directly except for helpers called by this method.
 // The basic pattern for programmatically changing the GUI settings is to first set the
 // appropriate saved settings and then call this method to sync the GUI with them.
+// FIXME: The above comment seems obsolete now.
 // static
 void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 {
@@ -1514,6 +1517,15 @@ void LLFloaterSnapshot::Impl::setStatus(EStatus status, bool ok, const std::stri
 	floater->impl.mStatus = status;
 }
 
+// static
+void LLFloaterSnapshot::Impl::setNeedRefresh(LLFloaterSnapshot* floater, bool need)
+{
+	if (!floater) return;
+
+	floater->mRefreshLabel->setVisible(need);
+	floater->impl.mNeedRefresh = need;
+}
+
 // static
 void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp, BOOL update_thumbnail)
 {
@@ -1869,6 +1881,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 			if(do_update)
 			{
 				updateControls(view);
+				setNeedRefresh(view, true);
 			}
 		}
 	}
@@ -1911,6 +1924,7 @@ void LLFloaterSnapshot::Impl::onImageFormatChange(LLFloaterSnapshot* view)
 		gSavedSettings.setS32("SnapshotFormat", getImageFormat(view));
 		getPreviewView(view)->updateSnapshot(TRUE);
 		updateControls(view);
+		setNeedRefresh(view, false); // we're refreshing
 	}
 }
 
@@ -2060,6 +2074,8 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat
 // static
 void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h)
 {
+	bool need_refresh = false;
+
 	lldebugs << "applyCustomResolution(" << w << ", " << h << ")" << llendl;
 	if (view)
 	{
@@ -2110,6 +2126,7 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32
 				comboSetCustom(view, "postcard_size_combo");
 				comboSetCustom(view, "texture_size_combo");
 				comboSetCustom(view, "local_size_combo");
+				need_refresh = true;
 			}
 		}
 
@@ -2117,6 +2134,10 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32
 		gSavedSettings.setS32(lastSnapshotHeightName(getActiveSnapshotType(view)), h);
 
 		updateControls(view);
+		if (need_refresh)
+		{
+			setNeedRefresh(view, true); // need to do this after updateControls()
+		}
 	}
 }
 
@@ -2140,6 +2161,8 @@ void LLFloaterSnapshot::Impl::onSendingPostcardFinished(bool status)
 // Default constructor
 LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)
 	: LLFloater(key),
+	  mRefreshBtn(NULL),
+	  mRefreshLabel(NULL),
 	  impl (*(new Impl))
 {
 }
@@ -2173,7 +2196,9 @@ BOOL LLFloaterSnapshot::postBuild()
 	childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this);
 #endif
 	
+	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this);
+	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
 
 	childSetAction("advanced_options_btn", Impl::onClickMore, this);
 
@@ -2208,11 +2233,6 @@ BOOL LLFloaterSnapshot::postBuild()
 	getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));
 	childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this);
 
-	childSetCommitCallback("profile_size_combo", Impl::onCommitResolution, this);
-	childSetCommitCallback("postcard_size_combo", Impl::onCommitResolution, this);
-	childSetCommitCallback("texture_size_combo", Impl::onCommitResolution, this);
-	childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this);
-
 	LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
 	LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1));
 
@@ -2272,15 +2292,28 @@ void LLFloaterSnapshot::draw()
 
 			previewp->drawPreviewRect(offset_x, offset_y) ;
 
-			// Draw progress indicators on top of the preview.
-			if (working)
+			// Draw some controls on top of the preview thumbnail.
+			static const S32 PADDING = 5;
+			static const S32 REFRESH_LBL_BG_HEIGHT = 32;
+
+			// Position the refresh button in the bottom left corner of the thumbnail.
+			mRefreshBtn->setOrigin(offset_x + PADDING - thumbnail_rect.mLeft, offset_y + PADDING - thumbnail_rect.mBottom);
+
+			if (impl.mNeedRefresh)
 			{
-				gGL.pushUIMatrix();
-				const LLRect& r = getThumbnailPlaceholderRect();
-				LLUI::translate((F32) r.mLeft, (F32) r.mBottom);
-				sThumbnailPlaceholder->draw();
-				gGL.popUIMatrix();
+				// Place the refresh hint text to the right of the refresh button.
+				const LLRect& refresh_btn_rect = mRefreshBtn->getRect();
+				mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom);
+
+				// Draw the refresh hint background.
+				LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + previewp->getThumbnailWidth() - 1, offset_y);
+				gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE);
 			}
+
+			gGL.pushUIMatrix();
+			LLUI::translate((F32) thumbnail_rect.mLeft, (F32) thumbnail_rect.mBottom);
+			sThumbnailPlaceholder->draw();
+			gGL.popUIMatrix();
 		}
 	}
 }
@@ -2440,6 +2473,9 @@ void LLFloaterSnapshot::preUpdate()
 	{
 		// Disable the send/post/save buttons until snapshot is ready.
 		Impl::updateControls(instance);
+
+		// Force hiding the "Refresh to save" hint because we know we've just started refresh.
+		Impl::setNeedRefresh(instance, false);
 	}
 }
 
@@ -2452,6 +2488,16 @@ void LLFloaterSnapshot::postUpdate()
 	{
 		// Enable the send/post/save buttons.
 		Impl::updateControls(instance);
+
+		// We've just done refresh.
+		Impl::setNeedRefresh(instance, false);
+
+		// The refresh button is initially hidden. We show it after the first update,
+		// i.e. when preview appears.
+		if (!instance->mRefreshBtn->getVisible())
+		{
+			instance->mRefreshBtn->setVisible(true);
+		}
 	}
 }
 
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index 2c79c749d60..7e5a08b1c63 100644
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -71,6 +71,7 @@ class LLFloaterSnapshot : public LLFloater
 
 private:
 	static LLUICtrl* sThumbnailPlaceholder;
+	LLUICtrl *mRefreshBtn, *mRefreshLabel;
 
 	class Impl;
 	Impl& impl;
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 07d5819c457..96c5c704afd 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -65,35 +65,6 @@
  	 name="local_failed_str">
  	    Failed to save to computer.
  	</string>
-   <view_border 
-    bevel_style="in"
-    follows="left|top" 
-    height="21"
-    left="10"
-    layout="topleft"
-    name="img_info_border"
-    top="22"
-    width="50"
-   />
-   <icon
-    follows="top|left"
-    height="18"
-    image_name="Snapshot_Off"
-    layout="topleft"
-    left_delta="-5"
-    mouse_opaque="true"
-    name="refresh_icon"
-    top_delta="3"
-    width="36" />
-   <button
-    follows="left|top"
-    height="22"
-    image_overlay="Refresh_Off"
-    layout="topleft"
-    left_delta="31"
-    name="new_snapshot_btn"
-    top_delta="-3"
-    width="23" />
     <button
      follows="left|top"
      height="23"
@@ -102,7 +73,7 @@
      left="236"
      name="advanced_options_btn"
      tool_tip="Advanced options"
-     top_delta="0"
+     top="25"
      width="23" />
   <ui_ctrl 
     height="160"
@@ -138,6 +109,34 @@
        width="130">
           Working
       </text>
+      <button
+       follows="left|top"
+       height="22"
+       image_overlay="Refresh_Off"
+       layout="topleft"
+       left="20"
+       name="new_snapshot_btn"
+       bottom="-20"
+       visible="false"
+       width="22" />
+      <text
+       follows="left|top"
+       font="SansSerifBold"
+       halign="left"
+       height="18"
+       layout="topleft"
+       left_pad="10"
+       length="1"
+       name="refresh_lbl"
+       right="-5"
+       text_color="red"
+       top_delta="0"
+       translate="false"
+       type="string"
+       visible="false"
+       width="130">
+          Refresh to save.
+      </text>
   </ui_ctrl>
   <view_border 
    bevel_style="in" 
-- 
GitLab


From 98e067cad4f919275f170650f3c21c8986f2a0cd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 14 Nov 2011 12:33:00 -0600
Subject: [PATCH 204/933] SH-2650 Fix for avatar eyeballs protruding from lower
 eyelids

---
 indra/newview/llvoavatar.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 799e1bbfb96..a3550000df8 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2138,7 +2138,15 @@ void LLVOAvatar::updateMeshData()
 
 			for(S32 k = j ; k < part_index ; k++)
 			{
-				mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update);
+				bool rigid = false;
+				if (k == MESH_ID_EYEBALL_LEFT ||
+					k == MESH_ID_EYEBALL_RIGHT)
+				{ //eyeballs can't have terse updates since they're never rendered with
+					//the hardware skinning shader
+					rigid = true;
+				}
+				
+				mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update && !rigid);
 			}
 
 			stop_glerror();
-- 
GitLab


From 9740887b90791b3fad37e58ab9e2ac772e8d2e95 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 14 Nov 2011 14:40:58 -0800
Subject: [PATCH 205/933] Build fix from bad merge

---
 indra/newview/llviewermedia.cpp | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 47aa2d86568..6fc4dd25afb 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -33,37 +33,14 @@
 #include "llappviewer.h"
 #include "llaudioengine.h"  // for gAudiop
 #include "llcallbacklist.h"
-#include "llparcel.h"
-#include "llaudioengine.h"  // for gAudiop
-#include "llurldispatcher.h"
-#include "llvoavatar.h"
-#include "llvoavatarself.h"
-#include "llviewerregion.h"
-#include "llwebprofile.h"
-#include "llwebsharing.h"	// For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this!
-#include "llfilepicker.h"
-#include "llnotifications.h"
 #include "lldir.h"
 #include "lldiriterator.h"
 #include "llevent.h"		// LLSimpleListener
 #include "llfilepicker.h"
-#include "llfloatermediabrowser.h"	// for handling window close requests and geometry change requests in media browser windows.
-#include "llnotificationsutil.h"
-#include "lluuid.h"
-#include "llkeyboard.h"
-#include "llmutelist.h"
-#include "llpanelprofile.h"
-#include "llappviewer.h"
-#include "lllogininstance.h" 
-//#include "llfirstuse.h"
-#include "llviewernetwork.h"
-#include "llwindow.h"
-
-
 #include "llfloaterwebcontent.h"	// for handling window close requests and geometry change requests in media browser windows.
 #include "llfocusmgr.h"
 #include "llkeyboard.h"
-#include "lllogininstance.h" 
+#include "lllogininstance.h"
 #include "llmarketplacefunctions.h"
 #include "llmediaentry.h"
 #include "llmimetypes.h"
@@ -77,8 +54,9 @@
 #include "llurldispatcher.h"
 #include "lluuid.h"
 #include "llversioninfo.h"
-#include "llviewercontrol.h"
 #include "llviewermediafocus.h"
+#include "llviewercontrol.h"
+#include "llviewernetwork.h"
 #include "llviewerparcelmedia.h"
 #include "llviewerparcelmgr.h"
 #include "llviewerregion.h"
@@ -88,6 +66,7 @@
 #include "llvoavatar.h"
 #include "llvoavatarself.h"
 #include "llvovolume.h"
+#include "llwebprofile.h"
 #include "llwebsharing.h"	// For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this!
 #include "llwindow.h"
 
-- 
GitLab


From c24645f7b51ea27e1686bbe72470a9f3c09fc676 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 14 Nov 2011 14:41:26 -0800
Subject: [PATCH 206/933] Updated url for damballah to use secondlife-staging

---
 indra/newview/llmarketplacefunctions.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 599731a6415..99b03894136 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -38,8 +38,16 @@ std::string getMarketplaceBaseURL()
 
 	if (!LLGridManager::getInstance()->isInProductionGrid())
 	{
-		std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
-		url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
+		std::string gridLabel = utf8str_tolower(LLGridManager::getInstance()->getGridLabel());
+		
+		if (gridLabel == "damballah")
+		{
+			url = "https://marketplace.secondlife-staging.com/";
+		}
+		else
+		{
+			url = llformat("https://marketplace.%s.lindenlab.com/", gridLabel.c_str());
+		}
 	}
 
 	url += "api/1/users/";
@@ -67,7 +75,7 @@ std::string getMarketplaceURL_UserStatus()
 }
 
 
-static bool gMarketplaceSyncEnabled = false;
+static bool gMarketplaceSyncEnabled = true;
 
 bool getMarketplaceSyncEnabled()
 {
-- 
GitLab


From 98755a62bb414f23919e003101153c20d3ab3f72 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 14 Nov 2011 15:39:32 -0800
Subject: [PATCH 207/933] EXP-1588 WIP Floaters do not snap to edge

---
 indra/llui/llfloater.cpp          | 66 +++++++++++++++----------------
 indra/llui/llfloater.h            |  1 +
 indra/newview/llurldispatcher.cpp |  4 +-
 3 files changed, 34 insertions(+), 37 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 432397d3e9f..05bd7fb67f9 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -58,6 +58,8 @@
 #include "llhelp.h"
 #include "llmultifloater.h"
 #include "llsdutil.h"
+#include <boost/foreach.hpp>
+
 
 // use this to control "jumping" behavior when Ctrl-Tabbing
 const S32 TABBED_FLOATER_OFFSET = 0;
@@ -2163,8 +2165,15 @@ LLFloaterView::LLFloaterView (const Params& p)
 // By default, adjust vertical.
 void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 {
-	S32 old_width = getRect().getWidth();
-	S32 old_height = getRect().getHeight();
+	S32 old_right = mLastSnapRect.mRight;
+	S32 old_top = mLastSnapRect.mTop;
+
+	LLView::reshape(width, height, called_from_parent);
+
+	S32 new_right = getSnapRect().mRight;
+	S32 new_top = getSnapRect().mTop;
+
+	mLastSnapRect = getSnapRect();
 
 	for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
 	{
@@ -2179,59 +2188,40 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		// Make if follow the edge it is closest to
 		U32 follow_flags = 0x0;
 
-		if (floaterp->isMinimized())
-		{
-			follow_flags |= (FOLLOWS_LEFT | FOLLOWS_TOP);
-		}
-		else
+		if (!floaterp->isMinimized())
 		{
 			LLRect r = floaterp->getRect();
 
 			// Compute absolute distance from each edge of screen
 			S32 left_offset = llabs(r.mLeft - 0);
-			S32 right_offset = llabs(old_width - r.mRight);
+			S32 right_offset = llabs(old_right - r.mRight);
 
-			S32 top_offset = llabs(old_height - r.mTop);
+			S32 top_offset = llabs(old_top - r.mTop);
 			S32 bottom_offset = llabs(r.mBottom - 0);
 
+			S32 translate_x = 0;
+			S32 translate_y = 0;
 
-			if (left_offset < right_offset)
-			{
-				follow_flags |= FOLLOWS_LEFT;
-			}
-			else
+			if (left_offset > right_offset)
 			{
-				follow_flags |= FOLLOWS_RIGHT;
+				translate_x = new_right - old_right;
 			}
 
-			// "No vertical adjustment" usually means that the bottom of the view
-			// has been pushed up or down.  Hence we want the floaters to follow
-			// the top.
 			if (top_offset < bottom_offset)
 			{
-				follow_flags |= FOLLOWS_TOP;
-			}
-			else
-			{
-				follow_flags |= FOLLOWS_BOTTOM;
+				translate_y = new_top - old_top;
 			}
-		}
 
-		floaterp->setFollows(follow_flags);
-
-		//RN: all dependent floaters copy follow behavior of "parent"
-		for(LLFloater::handle_set_iter_t dependent_it = floaterp->mDependents.begin();
-			dependent_it != floaterp->mDependents.end(); ++dependent_it)
-		{
-			LLFloater* dependent_floaterp = dependent_it->get();
-			if (dependent_floaterp)
+			floaterp->translate(translate_x, translate_y);
+			BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents)
 			{
-				dependent_floaterp->setFollows(follow_flags);
+				if (dependent_floater.get())
+				{
+					dependent_floater.get()->translate(translate_x, translate_y);
+				}
 			}
 		}
 	}
-
-	LLView::reshape(width, height, called_from_parent);
 }
 
 
@@ -2631,6 +2621,12 @@ void LLFloaterView::shiftFloaters(S32 x_offset, S32 y_offset)
 
 void LLFloaterView::refresh()
 {
+	LLRect snap_rect = getSnapRect();
+	if (snap_rect != mLastSnapRect)
+	{
+		reshape(getRect().getWidth(), getRect().getHeight(), TRUE);
+	}
+
 	// Constrain children to be entirely on the screen
 	for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
 	{
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 73e9c9e8310..4e8c539144f 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -537,6 +537,7 @@ class LLFloaterView : public LLUICtrl
 private:
 	void hiddenFloaterClosed(LLFloater* floater);
 
+	LLRect				mLastSnapRect;
 	LLHandle<LLView>	mSnapView;
 	BOOL			mFocusCycleMode;
 	S32				mSnapOffsetBottom;
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index f6d7ceeec36..4240a383263 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -167,9 +167,9 @@ bool LLURLDispatcherImpl::dispatchApp(const LLSLURL& slurl,
 // static
 bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, const std::string& nav_type, bool right_mouse)
 {
-  if(slurl.getType() != LLSLURL::LOCATION)
+	if(slurl.getType() != LLSLURL::LOCATION)
     {
-      return false;
+		return false;
     }
 	// Before we're logged in, need to update the startup screen
 	// to tell the user where they are going.
-- 
GitLab


From 28db67c3952f65d9c3ee23ce85851ba8ab29fc50 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 14 Nov 2011 17:16:34 -0800
Subject: [PATCH 208/933] Removed unused variable to fix the mac build

---
 indra/llui/llfloater.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 05bd7fb67f9..c5d7d1db569 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2185,9 +2185,6 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 			continue;
 		}
 
-		// Make if follow the edge it is closest to
-		U32 follow_flags = 0x0;
-
 		if (!floaterp->isMinimized())
 		{
 			LLRect r = floaterp->getRect();
-- 
GitLab


From 59a7cc2e0fdba593c6bd444d01ff5ac0bd2fc9cd Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 15 Nov 2011 20:07:58 +0200
Subject: [PATCH 209/933] EXP-1590 FIXED Success / Failure message now appears
 on top, overlaying the preview image.

---
 indra/newview/llfloatersnapshot.cpp           | 46 ++++++++++---
 indra/newview/llfloatersnapshot.h             |  1 +
 .../skins/default/xui/en/floater_snapshot.xml | 64 +++++++++++++++++++
 .../default/xui/en/panel_snapshot_options.xml | 64 -------------------
 4 files changed, 103 insertions(+), 72 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 8e346d3e7a9..d0d681132b3 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1543,6 +1543,7 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data)
 	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
 	if (previewp && view)
 	{
+		view->impl.setStatus(Impl::STATUS_READY);
 		previewp->updateSnapshot(TRUE);
 	}
 }
@@ -1568,6 +1569,7 @@ void LLFloaterSnapshot::Impl::onClickMore(void* data)
 	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
 	if (view)
 	{
+		view->impl.setStatus(Impl::STATUS_READY);
 		gSavedSettings.setBOOL("AdvanceSnapshot", !visible);
 #if 0
 		view->translate( 0, view->getUIWinHeightShort() - view->getUIWinHeightLong() );
@@ -1709,6 +1711,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde
 	return ;
 }
 
+// Show/hide upload progress indicators.
 // static
 void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool working)
 {
@@ -1724,7 +1727,7 @@ void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool workin
 		working_lbl->setValue(progress_text);
 	}
 
-	// All controls should be disable while posting.
+	// All controls should be disabled while posting.
 	floater->setCtrlsEnabled(!working);
 	LLPanelSnapshot* active_panel = getActivePanel(floater);
 	if (active_panel)
@@ -1733,11 +1736,12 @@ void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool workin
 	}
 }
 
+// Show/hide upload status message.
 // static
 void LLFloaterSnapshot::Impl::setFinished(LLFloaterSnapshot* floater, bool finished, bool ok, const std::string& msg)
 {
-	floater->getChild<LLUICtrl>("succeeded_panel")->setVisible(finished && ok);
-	floater->getChild<LLUICtrl>("failed_panel")->setVisible(finished && !ok);
+	floater->mSucceessLblPanel->setVisible(finished && ok);
+	floater->mFailureLblPanel->setVisible(finished && !ok);
 
 	if (finished)
 	{
@@ -2163,6 +2167,8 @@ LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)
 	: LLFloater(key),
 	  mRefreshBtn(NULL),
 	  mRefreshLabel(NULL),
+	  mSucceessLblPanel(NULL),
+	  mFailureLblPanel(NULL),
 	  impl (*(new Impl))
 {
 }
@@ -2199,6 +2205,8 @@ BOOL LLFloaterSnapshot::postBuild()
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this);
 	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
+	mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
+	mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
 
 	childSetAction("advanced_options_btn", Impl::onClickMore, this);
 
@@ -2279,15 +2287,23 @@ void LLFloaterSnapshot::draw()
 		{
 			bool working = impl.getStatus() == Impl::STATUS_WORKING;
 			const LLRect& thumbnail_rect = getThumbnailPlaceholderRect();
-			S32 offset_x = thumbnail_rect.mLeft + (thumbnail_rect.getWidth() - previewp->getThumbnailWidth()) / 2 ;
-			S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ;
+			const S32 thumbnail_w = previewp->getThumbnailWidth();
+			const S32 thumbnail_h = previewp->getThumbnailHeight();
+
+			// calc preview offset within the preview rect
+			const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ;
+			const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; // preview y pos within the preview rect
+
+			// calc preview offset within the floater rect
+			S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
+			S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
 
 			glMatrixMode(GL_MODELVIEW);
 			// Apply floater transparency to the texture unless the floater is focused.
 			F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
 			LLColor4 color = working ? LLColor4::grey4 : LLColor4::white;
 			gl_draw_scaled_image(offset_x, offset_y, 
-					previewp->getThumbnailWidth(), previewp->getThumbnailHeight(), 
+					thumbnail_w, thumbnail_h,
 					previewp->getThumbnailImage(), color % alpha);
 
 			previewp->drawPreviewRect(offset_x, offset_y) ;
@@ -2296,8 +2312,19 @@ void LLFloaterSnapshot::draw()
 			static const S32 PADDING = 5;
 			static const S32 REFRESH_LBL_BG_HEIGHT = 32;
 
+			// Reshape and position the posting result message panels at the top of the thumbnail.
+			// Do this regardless of current posting status (finished or not) to avoid flicker
+			// when the result message is displayed for the first time.
+			// if (impl.getStatus() == Impl::STATUS_FINISHED)
+			{
+				LLRect result_lbl_rect = mSucceessLblPanel->getRect();
+				result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_rect.getHeight());
+				mSucceessLblPanel->setRect(result_lbl_rect);
+				mFailureLblPanel->setRect(result_lbl_rect);
+			}
+
 			// Position the refresh button in the bottom left corner of the thumbnail.
-			mRefreshBtn->setOrigin(offset_x + PADDING - thumbnail_rect.mLeft, offset_y + PADDING - thumbnail_rect.mBottom);
+			mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING);
 
 			if (impl.mNeedRefresh)
 			{
@@ -2306,7 +2333,7 @@ void LLFloaterSnapshot::draw()
 				mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom);
 
 				// Draw the refresh hint background.
-				LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + previewp->getThumbnailWidth() - 1, offset_y);
+				LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y);
 				gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE);
 			}
 
@@ -2520,6 +2547,9 @@ void LLFloaterSnapshot::postPanelSwitch()
 {
 	LLFloaterSnapshot* instance = getInstance();
 	instance->impl.updateControls(instance);
+
+	// Remove the success/failure indicator whenever user presses a snapshot option button.
+	instance->impl.setStatus(Impl::STATUS_READY);
 }
 
 // static
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index 7e5a08b1c63..48015ad4d71 100644
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -72,6 +72,7 @@ class LLFloaterSnapshot : public LLFloater
 private:
 	static LLUICtrl* sThumbnailPlaceholder;
 	LLUICtrl *mRefreshBtn, *mRefreshLabel;
+	LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
 
 	class Impl;
 	Impl& impl;
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 96c5c704afd..7fd19d0f22f 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -83,6 +83,70 @@
     top="50"
     follows="left|top"
     left="10">
+      <panel
+       background_visible="true"
+       bg_alpha_color="0.9 1 0.9 1"
+       follows="left|top"
+       font="SansSerifLarge"
+       halign="center"
+       height="20"
+       layout="topleft"
+       left="0"
+       length="1"
+       name="succeeded_panel"
+       right="-1"
+       top="0"
+       type="string"
+       visible="false">
+          <text
+           follows="all"
+           font="SansSerif"
+           halign="center"
+           height="18"
+           layout="topleft"
+           left="1"
+           length="1"
+           name="succeeded_lbl"
+           right="-1"
+           text_color="0.2 0.5 0.2 1"
+           top="4"
+           translate="false"
+           type="string">
+              Succeeded
+          </text>
+      </panel>
+      <panel
+       background_visible="true"
+       bg_alpha_color="1 0.9 0.9 1"
+       follows="left|top"
+       font="SansSerifLarge"
+       halign="center"
+       height="20"
+       layout="topleft"
+       left_delta="0"
+       length="1"
+       name="failed_panel"
+       right="-1"
+       top="0"
+       type="string"
+       visible="false">
+          <text
+           follows="all"
+           font="SansSerif"
+           halign="center"
+           height="18"
+           layout="topleft"
+           left="1"
+           length="1"
+           name="failed_lbl"
+           right="-1"
+           text_color="0.5 0.2 0.2 1"
+           top="4"
+           translate="false"
+           type="string">
+              Failed
+          </text>
+      </panel>
       <loading_indicator
        follows="left|top"
        height="48"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 792f6dbec8f..d2f29ade44c 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -81,68 +81,4 @@
     <button.commit_callback
      function="Snapshot.SaveToComputer" />
   </button>
-  <panel
-   background_visible="true"
-   bg_alpha_color="0.9 1 0.9 1"
-   bottom="-10"
-   follows="left|bottom|right"
-   font="SansSerifLarge"
-   halign="center"
-   height="20"
-   layout="topleft"
-   left_delta="0"
-   length="1"
-   name="succeeded_panel"
-   right="-10"
-   type="string"
-   visible="false">
-      <text
-       follows="all"
-       font="SansSerif"
-       halign="center"
-       height="18"
-       layout="topleft"
-       left="1"
-       length="1"
-       name="succeeded_lbl"
-       right="-1"
-       text_color="0.2 0.5 0.2 1"
-       top="4"
-       translate="false"
-       type="string">
-          Succeeded
-      </text>
-  </panel>
-  <panel
-   background_visible="true"
-   bg_alpha_color="1 0.9 0.9 1"
-   bottom="-10"
-   follows="left|bottom|right"
-   font="SansSerifLarge"
-   halign="center"
-   height="20"
-   layout="topleft"
-   left_delta="0"
-   length="1"
-   name="failed_panel"
-   right="-10"
-   type="string"
-   visible="false">
-      <text
-       follows="all"
-       font="SansSerif"
-       halign="center"
-       height="18"
-       layout="topleft"
-       left="1"
-       length="1"
-       name="failed_lbl"
-       right="-1"
-       text_color="0.5 0.2 0.2 1"
-       top="4"
-       translate="false"
-       type="string">
-          Failed
-      </text>
-  </panel>
 </panel>
-- 
GitLab


From 73d70b5d4562cf00f810446479918e64cbcb6008 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 15 Nov 2011 12:19:05 -0600
Subject: [PATCH 210/933] SH-2240 Make alpha mask cutoff a little less
 aggressive (err on the side of not creating an alpha mask)

---
 indra/llrender/llimagegl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 7d738881518..789402c4a90 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1853,7 +1853,7 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
 		upperhalftotal += sample[i];
 	}
 
-	if (midrangetotal > length/16 || // lots of midrange, or
+	if (midrangetotal > length/48 || // lots of midrange, or
 	    (lowerhalftotal == length && alphatotal != 0) || // all close to transparent but not all totally transparent, or
 	    (upperhalftotal == length && alphatotal != 255*length)) // all close to opaque but not all totally opaque
 	{
-- 
GitLab


From 961ce1c4e785103b696a8ec76674aee4c91fe011 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 15 Nov 2011 12:24:31 -0600
Subject: [PATCH 211/933] SH-2591 WIP -- fix for UI disappearing, introduces
 some artifacts in rotation ring, committing to debug elsewhere

---
 indra/llui/llui.cpp             |  2 ++
 indra/newview/llmaniprotate.cpp | 35 ++++++++++++++++++++++++++++++---
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index c6f7e280277..33bc2479873 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -955,10 +955,12 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor
 		if( render_center )
 		{
 			gGL.color4fv(center_color.mV);
+			gGL.diffuseColor4fv(center_color.mV);
 			gl_deep_circle( radius, width, steps );
 		}
 		else
 		{
+			gGL.diffuseColor4fv(side_color.mV);
 			gl_washer_2d(radius, radius - width, steps, side_color, side_color);
 			gGL.translateUI(0.f, 0.f, width);
 			gl_washer_2d(radius - width, radius, steps, side_color, side_color);
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index 04dd2be583f..a8da94f75e2 100644
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -53,6 +53,7 @@
 #include "llviewercamera.h"
 #include "llviewerobject.h"
 #include "llviewerobject.h"
+#include "llviewershadermgr.h"
 #include "llviewerwindow.h"
 #include "llworld.h"
 #include "pipeline.h"
@@ -113,7 +114,7 @@ void LLManipRotate::handleSelect()
 void LLManipRotate::render()
 {
 	LLGLSUIDefault gls_ui;
-	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+	gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
 	LLGLDepthTest gls_depth(GL_TRUE);
 	LLGLEnable gl_blend(GL_BLEND);
 	LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
@@ -147,6 +148,7 @@ void LLManipRotate::render()
 
 	gGL.pushMatrix();
 	{
+		
 		// are we in the middle of a constrained drag?
 		if (mManipPart >= LL_ROT_X && mManipPart <= LL_ROT_Z)
 		{
@@ -154,6 +156,11 @@ void LLManipRotate::render()
 		}
 		else
 		{
+			if (LLGLSLShader::sNoFixedFunction)
+			{
+				gDebugProgram.bind();
+			}
+
 			LLGLEnable cull_face(GL_CULL_FACE);
 			LLGLDepthTest gls_depth(GL_FALSE);
 			gGL.pushMatrix();
@@ -190,20 +197,27 @@ void LLManipRotate::render()
 				{
 					color.setVec( 0.7f, 0.7f, 0.7f, 0.6f );
 				}
+				gGL.diffuseColor4fv(color.mV);
 				gl_washer_2d(mRadiusMeters + width_meters, mRadiusMeters, CIRCLE_STEPS, color, color);
 
 
 				if (mManipPart == LL_NO_PART)
 				{
 					gGL.color4f( 0.7f, 0.7f, 0.7f, 0.3f );
+					gGL.diffuseColor4f(0.7f, 0.7f, 0.7f, 0.3f);
 					gl_circle_2d( 0, 0,  mRadiusMeters, CIRCLE_STEPS, TRUE );
 				}
 				
 				gGL.flush();
 			}
 			gGL.popMatrix();
-		}
 
+			if (LLGLSLShader::sNoFixedFunction)
+			{
+				gUIProgram.bind();
+			}
+		}
+		
 		gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] );
 
 		LLQuaternion rot;
@@ -219,6 +233,11 @@ void LLManipRotate::render()
 		gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
 
 
+		if (LLGLSLShader::sNoFixedFunction)
+		{
+			gDebugProgram.bind();
+		}
+
 		if (mManipPart == LL_ROT_Z)
 		{
 			mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
@@ -270,6 +289,7 @@ void LLManipRotate::render()
 			// First pass: centers. Second pass: sides.
 			for( S32 i=0; i<2; i++ )
 			{
+				
 				gGL.pushMatrix();
 				{
 					if (mHighlightedPart == LL_ROT_Z)
@@ -286,7 +306,7 @@ void LLManipRotate::render()
 					}
 				}
 				gGL.popMatrix();
-
+				
 				gGL.pushMatrix();
 				{
 					gGL.rotatef( 90.f, 1.f, 0.f, 0.f );
@@ -328,11 +348,20 @@ void LLManipRotate::render()
 				{
 					mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
 				}
+				
 			}
+			
 		}
+
+		if (LLGLSLShader::sNoFixedFunction)
+		{
+			gUIProgram.bind();
+		}
+		
 	}
 	gGL.popMatrix();
 	gGL.popMatrix();
+	
 
 	LLVector3 euler_angles;
 	LLQuaternion object_rot = first_object->getRotationEdit();
-- 
GitLab


From bbac7e9aecf433c1a84515ede954650bd76befbf Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 15 Nov 2011 13:01:23 -0600
Subject: [PATCH 212/933] SH-2681 Fix for shader compiler error on GLSL 1.30
 and later

---
 indra/llrender/llshadermgr.cpp                                  | 2 +-
 .../app_settings/shaders/class2/deferred/sunLightSSAOF.glsl     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 947c4443d1d..75c584daab0 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -618,7 +618,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		//backwards compatibility with legacy texture lookup syntax
 		text[count++] = strdup("#define textureCube texture\n");
 		text[count++] = strdup("#define texture2DLod textureLod\n");
-		text[count++] = strdup("#define	shadow2D texture\n");
+		text[count++] = strdup("#define	shadow2D(a,b) vec2(texture(a,b))\n");
 	}
 
 	//copy preprocessor definitions into buffer
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index fc19f15e025..5b207ab558f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -150,7 +150,7 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	
-	float cs = shadow2D(shadowMap, stc.xyz);
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 	float shadow = cs;
 
 	vec2 off = 1.5/proj_shadow_res;
-- 
GitLab


From b493b8cca491c4b7a76f4c98b34272970d3bb58b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 15 Nov 2011 13:56:00 -0600
Subject: [PATCH 213/933] SH-2652 Fix for linux compile error

---
 indra/newview/pipeline.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index af96a042a12..c9e1b44b3ff 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6569,7 +6569,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 			{ //perform DoF sampling at half-res (preserve alpha channel)
 				mScreen.bindTarget();
-				glViewport(0,0,mScreen.getWidth()*CameraDoFResScale, mScreen.getHeight()*CameraDoFResScale);
+				glViewport(0,0,(GLsizei) (mScreen.getWidth()*CameraDoFResScale), (GLsizei) (mScreen.getHeight()*CameraDoFResScale));
 				gGL.setColorMask(true, false);
 
 				shader = &gDeferredPostProgram;
-- 
GitLab


From aa909a86cbc613f39cbc6eb395b01b7886171496 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 15 Nov 2011 12:51:07 -0800
Subject: [PATCH 214/933] EXP-1561 FIX Preview image looks stretched

---
 indra/newview/llfloatersnapshot.cpp | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index d0d681132b3..63fa93b1a1b 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -380,7 +380,6 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
 	{
 		mThumbnailUpToDate = FALSE ;
 	}
-	setThumbnailImageSize();
 }
 
 void LLSnapshotLivePreview::setSnapshotQuality(S32 quality)
@@ -723,25 +722,19 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
 		resetThumbnailImage() ;
 	}		
 
-	LLPointer<LLImageRaw> raw = NULL ;
-	S32 w , h ;
-	w = get_lower_power_two(mThumbnailWidth, 512) * 2 ;
-	h = get_lower_power_two(mThumbnailHeight, 512) * 2 ;
-
+	LLPointer<LLImageRaw> raw = new LLImageRaw;
+	if(!gViewerWindow->thumbnailSnapshot(raw,
+							mThumbnailWidth, mThumbnailHeight,
+							gSavedSettings.getBOOL("RenderUIInSnapshot"),
+							FALSE,
+							mSnapshotBufferType) )								
 	{
-		raw = new LLImageRaw ;
-		if(!gViewerWindow->thumbnailSnapshot(raw,
-								w, h,
-								gSavedSettings.getBOOL("RenderUIInSnapshot"),
-								FALSE,
-								mSnapshotBufferType) )								
-		{
-			raw = NULL ;
-		}
+		raw = NULL ;
 	}
 
 	if(raw)
 	{
+		raw->expandToPowerOfTwo();
 		mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); 		
 		mThumbnailUpToDate = TRUE ;
 	}
@@ -791,6 +784,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 	}
 
 	// time to produce a snapshot
+	previewp->setThumbnailImageSize();
 
 	lldebugs << "producing snapshot" << llendl;
 	if (!previewp->mPreviewImage)
-- 
GitLab


From df221246c46b22663864d831bcc3488b707c247c Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 00:01:18 +0200
Subject: [PATCH 215/933] EXP-1589 FIXED Centered Post/Save/Send and Cancel
 buttons.

---
 indra/newview/skins/default/xui/en/panel_postcard_message.xml   | 2 +-
 indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml | 2 +-
 indra/newview/skins/default/xui/en/panel_snapshot_local.xml     | 2 +-
 indra/newview/skins/default/xui/en/panel_snapshot_profile.xml   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_postcard_message.xml b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
index e9f322f590f..6e346d8ecc0 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
@@ -104,7 +104,7 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index 7b148fa338f..662cd5c3bcf 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -125,7 +125,7 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index 4d6c4bcdfac..fc4b85ae2a7 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -173,7 +173,7 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 0760a33f82e..1ad2e701413 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -144,7 +144,7 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
-- 
GitLab


From 4440d9b14071f692089eb1c0a74fb8818ce3ed50 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 00:40:23 +0200
Subject: [PATCH 216/933] EXP-1574 FIXED Decreased Snapshot floater height.

---
 indra/newview/skins/default/xui/en/floater_snapshot.xml       | 4 ++--
 indra/newview/skins/default/xui/en/panel_postcard_message.xml | 4 ++--
 indra/newview/skins/default/xui/en/panel_snapshot_profile.xml | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 7fd19d0f22f..b8d368ec524 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -5,7 +5,7 @@
  can_minimize="true"
  can_close="true"
  follows="left|top"
- height="600"
+ height="500"
  layout="topleft"
  name="Snapshot"
  help_topic="snapshot"
@@ -242,7 +242,7 @@
    </text>
     <panel_container
      follows="left|top"
-     height="360"
+     height="260"
      layout="topleft"
      left="0"
      name="panel_container"
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_message.xml b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
index 6e346d8ecc0..ab2a42ea01b 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
@@ -87,8 +87,8 @@
     <text_editor
      type="string"
      length="1"
-     follows="left|top|right|bottom"
-     height="140"
+     follows="left|top|right"
+     height="60"
      layout="topleft"
      left_delta="0"
      max_length="700"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 1ad2e701413..ee79a4b3b82 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -119,7 +119,7 @@
     </text>
     <text_editor
      follows="all"
-     height="170"
+     height="160"
      layout="topleft"
      left_delta="0"
      length="1"
-- 
GitLab


From ad9e08b8a1c3ba34c2bb0ccaffe2e968da7b8c9a Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 15 Nov 2011 15:52:29 -0800
Subject: [PATCH 217/933] SH-2563 FIX -- Added diffuse map to the avatar rigid
 pass to properly set up the eyeball texture for Mac OS Lion

---
 indra/newview/lldrawpoolavatar.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 60313b25a0f..55b314fbb15 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -657,7 +657,7 @@ void LLDrawPoolAvatar::endDeferredImpostor()
 void LLDrawPoolAvatar::beginDeferredRigid()
 {
 	sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
-				
+	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 	sVertexProgram->bind();
 	sVertexProgram->setMinimumAlpha(0.2f);
 }
@@ -665,6 +665,7 @@ void LLDrawPoolAvatar::beginDeferredRigid()
 void LLDrawPoolAvatar::endDeferredRigid()
 {
 	sShaderLevel = mVertexShaderLevel;
+	sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
 	sVertexProgram->unbind();
 	gGL.getTexUnit(0)->activate();
 }
-- 
GitLab


From 30beda590a93aca9b2a27edb9be94665290c2e7c Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 15 Nov 2011 16:40:31 -0800
Subject: [PATCH 218/933] EXP-1588 FIX Floaters do not snap to edge made
 non-movable floaters not use auto-follow logic toasts will now use own layout
 logic

---
 indra/llui/llfloater.cpp | 14 ++++++++++++--
 indra/llui/llfloater.h   |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c5d7d1db569..a5fd3ea5525 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1951,6 +1951,12 @@ void LLFloater::setCanDrag(BOOL can_drag)
 	}
 }
 
+bool LLFloater::getCanDrag()
+{
+	return mDragHandle->getEnabled();
+}
+
+
 void LLFloater::updateTitleButtons()
 {
 	static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0);
@@ -2181,7 +2187,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		LLFloater* floaterp = (LLFloater*)viewp;
 		if (floaterp->isDependent())
 		{
-			// dependents use same follow flags as their "dependee"
+			// dependents are moved with their "dependee"
 			continue;
 		}
 
@@ -2209,7 +2215,11 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 				translate_y = new_top - old_top;
 			}
 
-			floaterp->translate(translate_x, translate_y);
+			// don't reposition immovable floaters
+			if (floaterp->getCanDrag())
+			{
+				floaterp->translate(translate_x, translate_y);
+			}
 			BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents)
 			{
 				if (dependent_floater.get())
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 4e8c539144f..8886ae3393c 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -234,6 +234,7 @@ class LLFloater : public LLPanel
 	void			setCanTearOff(BOOL can_tear_off);
 	virtual void	setCanResize(BOOL can_resize);
 	void			setCanDrag(BOOL can_drag);
+	bool			getCanDrag();
 	void			setHost(LLMultiFloater* host);
 	BOOL			isResizable() const				{ return mResizable; }
 	void			setResizeLimits( S32 min_width, S32 min_height );
-- 
GitLab


From d71736f3d92f1a276d4aafcbf70c6a8597457220 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 15 Nov 2011 17:32:09 -0800
Subject: [PATCH 219/933] SH-1865 PROGRESS -- Disable the anti-aliasing control
 on hardware our code doesn't support for anti-aliasing

---
 indra/llui/llspinctrl.h                       |  3 ++
 indra/newview/llfloaterhardwaresettings.cpp   | 38 +++++++++++++++----
 indra/newview/pipeline.cpp                    |  4 +-
 .../xui/en/floater_hardware_settings.xml      |  2 +-
 4 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h
index d197084e38f..87814f838e8 100644
--- a/indra/llui/llspinctrl.h
+++ b/indra/llui/llspinctrl.h
@@ -96,6 +96,9 @@ class LLSpinCtrl
 
 	void			onUpBtn(const LLSD& data);
 	void			onDownBtn(const LLSD& data);
+	
+	const LLColor4&	getEnabledTextColor() const	{ return mTextEnabledColor.get(); }
+	const LLColor4&	getDisabledTextColor() const { return mTextDisabledColor.get(); }
 
 private:
 	void			updateLabelColor();
diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp
index 42ec7d765b4..f9a403cf9ff 100644
--- a/indra/newview/llfloaterhardwaresettings.cpp
+++ b/indra/newview/llfloaterhardwaresettings.cpp
@@ -34,7 +34,9 @@
 #include "llviewercontrol.h"
 #include "llviewertexturelist.h"
 #include "llfeaturemanager.h"
+#include "llspinctrl.h"
 #include "llstartup.h"
+#include "lltextbox.h"
 #include "pipeline.h"
 
 // Linden library includes
@@ -98,18 +100,40 @@ void LLFloaterHardwareSettings::refreshEnabledState()
 	}
 
 	// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
-	getChildView("gamma")->setEnabled(!gPipeline.canUseWindLightShaders());
+	LLSpinCtrl* gamma_ctrl = getChild<LLSpinCtrl>("gamma");
+	gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders());
 	getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders());
 	getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders());
-	getChildView("fsaa")->setEnabled(gPipeline.canUseAntiAliasing());
-	getChildView("antialiasing restart")->setVisible(!gSavedSettings.getBOOL("RenderDeferred"));
 
-	/* Enable to reset fsaa value to disabled when feature is not available.
-	if (!gPipeline.canUseAntiAliasing())
+	// anti-aliasing
 	{
-		getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) 0);
+		LLUICtrl* fsaa_ctrl = getChild<LLUICtrl>("fsaa");
+		LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label");
+		LLView* fsaa_restart = getChildView("antialiasing restart");
+		
+		// Enable or disable the control, the "Antialiasing:" label and the restart warning
+		// based on code support for the feature on the current hardware.
+
+		if (gPipeline.canUseAntiAliasing())
+		{
+			fsaa_ctrl->setEnabled(TRUE);
+			
+			// borrow the text color from the gamma control for consistency
+			fsaa_text->setColor(gamma_ctrl->getEnabledTextColor());
+
+			fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred"));
+		}
+		else
+		{
+			fsaa_ctrl->setEnabled(FALSE);
+			fsaa_ctrl->setValue((LLSD::Integer) 0);
+			
+			// borrow the text color from the gamma control for consistency
+			fsaa_text->setColor(gamma_ctrl->getDisabledTextColor());
+			
+			fsaa_restart->setVisible(FALSE);
+		}
 	}
-	*/
 }
 
 //============================================================================
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c9e1b44b3ff..230bf0e9fdf 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1165,7 +1165,9 @@ BOOL LLPipeline::canUseWindLightShadersOnObjects() const
 
 BOOL LLPipeline::canUseAntiAliasing() const
 {
-	return TRUE;
+	// We can use anti-aliasing if the GL manager can support some multisampling
+	BOOL can_fsaa = (gGLManager.getNumFBOFSAASamples(2) > 1);
+	return can_fsaa;
 }
 
 void LLPipeline::unloadShaders()
diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
index 05f4c52b950..66bb9d3cea8 100644
--- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
@@ -35,7 +35,7 @@
      height="12"
      layout="topleft"
      left="10"
-     name="Antialiasing:"
+     name="antialiasing label"
      top_pad="7"
      width="188">
         Antialiasing:
-- 
GitLab


From 557a64f8076666be767eea7567e3375aa71aa1e4 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 18:03:49 +0200
Subject: [PATCH 220/933] EXP-1560 FIXED Removed misleading "Constrain
 proportions" checkbox from the "Save to My Inventory" panel.

---
 indra/newview/llpanelsnapshotinventory.cpp                 | 7 ++++---
 .../skins/default/xui/en/panel_snapshot_inventory.xml      | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index 63ccbc1b029..aca0ee67003 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -70,6 +70,7 @@ LLPanelSnapshotInventory::LLPanelSnapshotInventory()
 // virtual
 BOOL LLPanelSnapshotInventory::postBuild()
 {
+	getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures
 	return LLPanelSnapshot::postBuild();
 }
 
@@ -89,10 +90,10 @@ void LLPanelSnapshotInventory::updateCustomResControls()
 
 	getChild<LLUICtrl>(getWidthSpinnerName())->setVisible(show);
 	getChild<LLUICtrl>(getHeightSpinnerName())->setVisible(show);
-	getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(show);
 
-	// enable controls if possible
-	LLPanelSnapshot::updateCustomResControls();
+	// Editing gets often enable elsewhere in common snapshot panel code. Override that.
+	getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
+	getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
 }
 
 // virtual
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index 662cd5c3bcf..9057ebb65eb 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -118,7 +118,8 @@
      label="Constrain proportions"
      layout="topleft"
      left="10"
-     name="inventory_keep_aspect_check" />
+     name="inventory_keep_aspect_check"
+     visible="false" />
     <button
      follows="right|bottom"
      height="23"
-- 
GitLab


From e7ef0512a27adce621b8523f6cb81a8daa73e12d Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 18:57:41 +0200
Subject: [PATCH 221/933] EXP-1562 WIP Disable custom resolution controls by
 default (when "Current Window" is pre-select).

---
 indra/newview/llfloatersnapshot.cpp |  2 +-
 indra/newview/llpanelsnapshot.cpp   | 10 ++++++++++
 indra/newview/llpanelsnapshot.h     |  1 +
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 63fa93b1a1b..181570138e7 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1726,7 +1726,7 @@ void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool workin
 	LLPanelSnapshot* active_panel = getActivePanel(floater);
 	if (active_panel)
 	{
-		active_panel->setCtrlsEnabled(!working);
+		active_panel->enableControls(!working);
 	}
 }
 
diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index fdae521ac52..90e32f973f6 100644
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -74,6 +74,16 @@ LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
 	return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG;
 }
 
+void LLPanelSnapshot::enableControls(BOOL enable)
+{
+	setCtrlsEnabled(enable);
+	if (enable)
+	{
+		// Make sure only relevant controls are enabled/shown.
+		updateCustomResControls();
+	}
+}
+
 LLSpinCtrl* LLPanelSnapshot::getWidthSpinner()
 {
 	return getChild<LLSpinCtrl>(getWidthSpinnerName());
diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h
index a49782a3e04..7adb2fabc71 100644
--- a/indra/newview/llpanelsnapshot.h
+++ b/indra/newview/llpanelsnapshot.h
@@ -52,6 +52,7 @@ class LLPanelSnapshot: public LLPanel
 	virtual void enableAspectRatioCheckbox(BOOL enable);
 	virtual LLFloaterSnapshot::ESnapshotFormat getImageFormat() const;
 	virtual void updateControls(const LLSD& info) = 0; ///< Update controls from saved settings
+	void enableControls(BOOL enable);
 
 protected:
 	LLSideTrayPanelContainer* getParentContainer();
-- 
GitLab


From 0a25d9b1ba4f01ae391319d35e4f573dc6624365 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 19:46:31 +0200
Subject: [PATCH 222/933] EXP-1562 WIP Turned the Save button into flyout (Save
 / Save as).

By the way, fixed:
* inability to save a snapshot to disk after pressing "Cancel" in the file picker.
* displaying "Saved to computer!" after pressing "Cancel" in the file picker.
---
 indra/newview/llfloatersnapshot.cpp           | 16 ++++-------
 indra/newview/llfloatersnapshot.h             |  2 +-
 indra/newview/llpanelsnapshotlocal.cpp        | 27 ++++++++++++++-----
 .../default/xui/en/panel_snapshot_local.xml   | 15 ++++++++---
 4 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 181570138e7..5b26e93898c 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -997,13 +997,7 @@ void LLSnapshotLivePreview::saveTexture()
 
 BOOL LLSnapshotLivePreview::saveLocal()
 {
-	BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage, true);
-
-	// Relinquish image memory. Save button will be disabled as a side-effect.
-	lldebugs << "resetting formatted image after saving to disk" << llendl;
-	mFormattedImage = NULL;
-	mDataSize = 0;
-	updateSnapshot(FALSE, FALSE);
+	BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
 
 	if(success)
 	{
@@ -2465,7 +2459,7 @@ void LLFloaterSnapshot::saveTexture()
 }
 
 // static
-void LLFloaterSnapshot::saveLocal()
+BOOL LLFloaterSnapshot::saveLocal()
 {
 	lldebugs << "saveLocal" << llendl;
 	// FIXME: duplicated code
@@ -2473,16 +2467,16 @@ void LLFloaterSnapshot::saveLocal()
 	if (!instance)
 	{
 		llassert(instance != NULL);
-		return;
+		return FALSE;
 	}
 	LLSnapshotLivePreview* previewp = Impl::getPreviewView(instance);
 	if (!previewp)
 	{
 		llassert(previewp != NULL);
-		return;
+		return FALSE;
 	}
 
-	previewp->saveLocal();
+	return previewp->saveLocal();
 }
 
 // static
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index 48015ad4d71..afe135fa407 100644
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -58,7 +58,7 @@ class LLFloaterSnapshot : public LLFloater
 	// TODO: create a snapshot model instead
 	static LLFloaterSnapshot* getInstance();
 	static void saveTexture();
-	static void saveLocal();
+	static BOOL saveLocal();
 	static void preUpdate();
 	static void postUpdate();
 	static void postSave();
diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp
index eaa27b8d410..4a2614fa7d7 100644
--- a/indra/newview/llpanelsnapshotlocal.cpp
+++ b/indra/newview/llpanelsnapshotlocal.cpp
@@ -34,6 +34,7 @@
 #include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model
 #include "llpanelsnapshot.h"
 #include "llviewercontrol.h" // gSavedSettings
+#include "llviewerwindow.h"
 
 /**
  * The panel provides UI for saving snapshot to a local folder.
@@ -58,14 +59,13 @@ class LLPanelSnapshotLocal
 
 	void onFormatComboCommit(LLUICtrl* ctrl);
 	void onQualitySliderCommit(LLUICtrl* ctrl);
-	void onSend();
+	void onSaveFlyoutCommit(LLUICtrl* ctrl);
 };
 
 static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal");
 
 LLPanelSnapshotLocal::LLPanelSnapshotLocal()
 {
-	mCommitCallbackRegistrar.add("Local.Save",		boost::bind(&LLPanelSnapshotLocal::onSend,		this));
 	mCommitCallbackRegistrar.add("Local.Cancel",	boost::bind(&LLPanelSnapshotLocal::cancel,		this));
 }
 
@@ -74,6 +74,7 @@ BOOL LLPanelSnapshotLocal::postBuild()
 {
 	getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onQualitySliderCommit, this, _1));
 	getChild<LLUICtrl>("local_format_combo")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onFormatComboCommit, this, _1));
+	getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onSaveFlyoutCommit, this, _1));
 
 	return LLPanelSnapshot::postBuild();
 }
@@ -142,13 +143,25 @@ void LLPanelSnapshotLocal::onQualitySliderCommit(LLUICtrl* ctrl)
 	LLFloaterSnapshot::getInstance()->notify(info);
 }
 
-void LLPanelSnapshotLocal::onSend()
+void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl)
 {
+	if (ctrl->getValue().asString() == "save as")
+	{
+		gViewerWindow->resetSnapshotLoc();
+	}
+
 	LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance();
 
 	floater->notify(LLSD().with("set-working", true));
-	LLFloaterSnapshot::saveLocal();
-	LLFloaterSnapshot::postSave();
-	goBack();
-	floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
+	BOOL saved = LLFloaterSnapshot::saveLocal();
+	if (saved)
+	{
+		LLFloaterSnapshot::postSave();
+		goBack();
+		floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
+	}
+	else
+	{
+		cancel();
+	}
 }
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index fc4b85ae2a7..30403a21dd6 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -179,16 +179,23 @@
       <button.commit_callback
        function="Local.Cancel" />
     </button>
-    <button
+    <flyout_button
      follows="right|bottom"
      height="23"
      label="Save"
      layout="topleft"
      left_delta="-106"
      name="save_btn"
+     tool_tip="Save image to a file"
      top_delta="0"
      width="100">
-      <button.commit_callback
-       function="Local.Save" />
-    </button>
+        <flyout_button.item
+         label="Save"
+         name="save_item"
+         value="save" />
+        <flyout_button.item
+         label="Save As..."
+         name="saveas_item"
+         value="save as" />
+    </flyout_button>
 </panel>
-- 
GitLab


From 6343c769ce402c31ae10944b5fef72fb70e6758a Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 16 Nov 2011 10:00:41 -0800
Subject: [PATCH 223/933] SH-1865 FIX -- removed some old non-deferred
 rendering code that was preventing anti-aliasing from working when
 GL_ARB_texture_multisample is unsupported

---
 indra/llrender/llgl.cpp    | 8 --------
 indra/llrender/llgl.h      | 1 -
 indra/newview/pipeline.cpp | 6 ++----
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 20ca189e7f5..946e602fee6 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -835,14 +835,6 @@ std::string LLGLManager::getRawGLString()
 	return gl_string;
 }
 
-U32 LLGLManager::getNumFBOFSAASamples(U32 samples)
-{
-	samples = llmin(samples, (U32) mMaxColorTextureSamples);
-	samples = llmin(samples, (U32) mMaxDepthTextureSamples);
-	samples = llmin(samples, (U32) 4);
-	return samples;
-}
-
 void LLGLManager::shutdownGL()
 {
 	if (mInited)
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index dee7ec07395..6a147b8e19a 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -150,7 +150,6 @@ class LLGLManager
 	void printGLInfoString();
 	void getGLInfo(LLSD& info);
 
-	U32 getNumFBOFSAASamples(U32 desired_samples = 32);
 	// In ALL CAPS
 	std::string mGLVendor;
 	std::string mGLVendorShort;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 230bf0e9fdf..5e9f0e3efec 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -658,7 +658,7 @@ void LLPipeline::allocatePhysicsBuffer()
 void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 {
 	refreshCachedSettings();
-	U32 samples = gGLManager.getNumFBOFSAASamples(RenderFSAASamples);
+	U32 samples = RenderFSAASamples;
 
 	//try to allocate screen buffers at requested resolution and samples
 	// - on failure, shrink number of samples and try again
@@ -1165,9 +1165,7 @@ BOOL LLPipeline::canUseWindLightShadersOnObjects() const
 
 BOOL LLPipeline::canUseAntiAliasing() const
 {
-	// We can use anti-aliasing if the GL manager can support some multisampling
-	BOOL can_fsaa = (gGLManager.getNumFBOFSAASamples(2) > 1);
-	return can_fsaa;
+	return TRUE;
 }
 
 void LLPipeline::unloadShaders()
-- 
GitLab


From bd0bd119c0bdae7e7d02014a5a843b927b9d226f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 20:07:55 +0200
Subject: [PATCH 224/933] EXP-1594 FIXED Stop the upload progress indicator if
 inventory texture upoload fails.

---
 indra/newview/llassetuploadresponders.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 40a4d665f8e..65bfc990d1e 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -295,6 +295,11 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
 {
 	// remove the "Uploading..." message
 	LLUploadDialog::modalUploadFinished();
+	LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
+	if (floater_snapshot)
+	{
+		floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "inventory")));
+	}
 	
 	std::string reason = content["state"];
 	// deal with L$ errors
-- 
GitLab


From dbef1616dc22ba8623a53f7d4d4daeabaeafa78a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 16 Nov 2011 12:40:51 -0600
Subject: [PATCH 225/933] SH-2240 Make alpha mask cutoff even less aggressive
 (fix for eyes on Curious Ringtail avatar)

---
 indra/llrender/llimagegl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 789402c4a90..78591ddd384 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1838,7 +1838,7 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
 	// this to be an intentional effect and don't treat as a mask.
 
 	U32 midrangetotal = 0;
-	for (U32 i = 4; i < 11; i++)
+	for (U32 i = 2; i < 13; i++)
 	{
 		midrangetotal += sample[i];
 	}
-- 
GitLab


From f1719459d5ed2164fe56aa86c1a33ff5cd87ccb1 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 16 Nov 2011 21:39:55 +0200
Subject: [PATCH 226/933] EXP-1597 FIXED Reshape save status messages
 correctly.

---
 indra/newview/llfloatersnapshot.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 5b26e93898c..ad571451f32 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -2306,8 +2306,11 @@ void LLFloaterSnapshot::draw()
 			// if (impl.getStatus() == Impl::STATUS_FINISHED)
 			{
 				LLRect result_lbl_rect = mSucceessLblPanel->getRect();
-				result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_rect.getHeight());
+				const S32 result_lbl_h = result_lbl_rect.getHeight();
+				result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h);
+				mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
 				mSucceessLblPanel->setRect(result_lbl_rect);
+				mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
 				mFailureLblPanel->setRect(result_lbl_rect);
 			}
 
-- 
GitLab


From 2ee4bae1a39814467e4bd361211f7836266af880 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 16 Nov 2011 12:28:10 -0800
Subject: [PATCH 227/933] support for assignment of named values to params,
 works with string-typed params as well as () operator

---
 indra/llxuixml/llinitparam.h   | 93 +++++++++++++++++++++++++++++-----
 indra/llxuixml/llxuiparser.cpp |  4 +-
 2 files changed, 80 insertions(+), 17 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index ec14bc2fdc3..575e8231bd1 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -572,7 +572,7 @@ namespace LLInitParam
 		static bool equals(const BaseBlock::Lazy<T>& a, const BaseBlock::Lazy<T>& b) { return !a.empty() || !b.empty(); }
 	};
 
-		class Param
+	class Param
 	{
 	public:
 		void setProvided(bool is_provided = true)
@@ -580,6 +580,12 @@ namespace LLInitParam
 			mIsProvided = is_provided;
 			enclosingBlock().paramChanged(*this, is_provided);
 		}
+
+		Param& operator =(const Param& other)
+		{
+			setProvided(other.mIsProvided);
+			return *this;
+		}
 	protected:
 
 		bool anyProvided() const { return mIsProvided; }
@@ -671,7 +677,7 @@ namespace LLInitParam
 		self_t& operator =(const self_t& other)
 		{
 			mValue = other.mValue;
-			static_cast<NAME_VALUE_LOOKUP&>(*this) = other;
+			NAME_VALUE_LOOKUP::operator =(other);
 			return *this;
 		}
 
@@ -742,8 +748,8 @@ namespace LLInitParam
 
 		self_t& operator =(const self_t& other)
 		{
-			static_cast<T&>(*this) = other;
-			static_cast<NAME_VALUE_LOOKUP&>(*this) = other;
+			T::operator = (other);
+			NAME_VALUE_LOOKUP::operator =(other);
 			mValidatedVersion = other.mValidatedVersion;
 			mValidated = other.mValidated;
 			return *this;
@@ -753,6 +759,54 @@ namespace LLInitParam
 		mutable bool 	mValidated; // lazy validation flag
 	};
 
+	template<typename NAME_VALUE_LOOKUP>
+	class ParamValue<std::string, NAME_VALUE_LOOKUP, false>
+	: public NAME_VALUE_LOOKUP
+	{
+	public:
+		typedef const std::string&	value_assignment_t;
+		typedef ParamValue<std::string, NAME_VALUE_LOOKUP, false>	self_t;
+
+		ParamValue(): mValue() {}
+		ParamValue(value_assignment_t other) : mValue(other) {}
+
+		void setValue(value_assignment_t val)
+		{
+			if (NAME_VALUE_LOOKUP::getValueFromName(val, mValue))
+			{
+				setValueName(val);
+			}
+			else
+			{
+				mValue = val;
+			}
+		}
+
+		value_assignment_t getValue() const
+		{
+			return mValue;
+		}
+
+		std::string& getValue()
+		{
+			return mValue;
+		}
+
+		operator value_assignment_t() const
+		{
+			return mValue;
+		}
+
+		value_assignment_t operator()() const
+		{
+			return mValue;
+		}
+
+	protected:
+		std::string mValue;
+	};
+
+
 	template<typename T, typename NAME_VALUE_LOOKUP = TypeValues<T> >
 	struct ParamIterator
 	{
@@ -776,6 +830,8 @@ namespace LLInitParam
 		typedef NAME_VALUE_LOOKUP															name_value_lookup_t;
 		typedef ParamValue<T, NAME_VALUE_LOOKUP>											param_value_t;
 
+		using param_value_t::operator();
+
 		TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count) 
 		:	Param(block_descriptor.mCurrentBlockPtr)
 		{
@@ -877,11 +933,6 @@ namespace LLInitParam
 			}
 		}
 
-		self_t& operator =(typename const name_value_lookup_t::name_t& name)
-		{
-			return static_cast<self_t&>(param_value_t::operator =(name));
-		}
-
 		void set(value_assignment_t val, bool flag_as_provided = true)
 		{
 			param_value_t::clearValueName();
@@ -889,6 +940,11 @@ namespace LLInitParam
 			setProvided(flag_as_provided);
 		}
 
+		self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
+		{
+			return static_cast<self_t&>(param_value_t::operator =(name));
+		}
+
 	protected:
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
@@ -919,6 +975,8 @@ namespace LLInitParam
 		typedef NAME_VALUE_LOOKUP								name_value_lookup_t;
 		typedef ParamValue<T, NAME_VALUE_LOOKUP>				param_value_t;
 
+		using param_value_t::operator();
+
 		TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
 		:	Param(block_descriptor.mCurrentBlockPtr),
 			param_value_t(value)
@@ -1023,6 +1081,11 @@ namespace LLInitParam
 			setProvided(flag_as_provided);
 		}
 
+		self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
+		{
+			return static_cast<self_t&>(param_value_t::operator =(name));
+		}
+
 		// propagate changed status up to enclosing block
 		/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
 		{ 
@@ -1189,7 +1252,9 @@ namespace LLInitParam
 
 		void add(const value_t& item)
 		{
-			mValues.push_back(param_value_t(item));
+			param_value_t param_value;
+			param_value.setValue(item);
+			mValues.push_back(param_value);
 			setProvided();
 		}
 
@@ -1537,7 +1602,7 @@ namespace LLInitParam
 			typedef TypedParam<T, NAME_VALUE_LOOKUP, false, IsBlock<ParamValue<T, NAME_VALUE_LOOKUP> >::value>		super_t;
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
-			using super_t::param_value_t::operator =;
+			using super_t::operator =;
 
 			explicit Alternative(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1),
@@ -1656,8 +1721,8 @@ namespace LLInitParam
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
 			using super_t::operator();
-			using super_t::param_value_t::operator =;
-
+			using super_t::operator =;
+			
 			explicit Optional(const char* name = "", value_assignment_t val = defaultValue<T>())
 			:	super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1)
 			{
@@ -1686,7 +1751,7 @@ namespace LLInitParam
 			typedef typename super_t::value_assignment_t								value_assignment_t;
 
 			using super_t::operator();
-			using super_t::param_value_t::operator =;
+			using super_t::operator =;
 
 			// mandatory parameters require a name to be parseable
 			explicit Mandatory(const char* name = "", value_assignment_t val = defaultValue<T>())
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index cdf578113ad..90c2671242a 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -61,8 +61,6 @@ const S32 LINE_NUMBER_HERE = 0;
 
 struct MaxOccursValues : public LLInitParam::TypeValuesHelper<U32, MaxOccursValues>
 {
-	using TypeValuesHelper<U32, MaxOccursValues>::operator =;
-	typedef std::string name_t;
 	static void declareValues()
 	{
 		declare("unbounded", U32_MAX);
@@ -73,11 +71,11 @@ struct Occurs : public LLInitParam::Block<Occurs>
 {
 	Optional<U32>					minOccurs;
 	Optional<U32, MaxOccursValues>	maxOccurs;
-	Multiple<U32, AnyAmount, MaxOccursValues> foo;
 
 	Occurs()
 	:	minOccurs("minOccurs", 0),
 		maxOccurs("maxOccurs", U32_MAX)
+
 	{}
 };
 
-- 
GitLab


From 986dccbeafa3fe0ddd9a05e0916a414e4abc51d6 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 16 Nov 2011 15:08:17 -0600
Subject: [PATCH 228/933] SH-2690 Fix for spammy triangle death on GeForce 7800
 Go when selecting flexi attachments.

---
 indra/llrender/llrender.cpp   | 11 +++++++++++
 indra/newview/llselectmgr.cpp | 13 +++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 97aeae548af..010d3df9b75 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1887,6 +1887,17 @@ void LLRender::flush()
 void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 { 
 	//the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095]
+	if (mCount > 2048)
+	{
+		switch (mMode)
+		{
+			case LLRender::POINTS: flush(); break;
+			case LLRender::TRIANGLES: if (mCount%3==0) flush(); break;
+			case LLRender::QUADS: if(mCount%4 == 0) flush(); break; 
+			case LLRender::LINES: if (mCount%2 == 0) flush(); break;
+		}
+	}
+			
 	if (mCount > 4094)
 	{
 	//	llwarns << "GL immediate mode overflow.  Some geometry not drawn." << llendl;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 830a7778ac5..036e4284150 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5713,6 +5713,14 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
 		return;
 	}
 
+
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (shader)
+	{
+		gSolidColorProgram.bind();
+	}
+
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	gGL.pushUIMatrix();
@@ -5835,6 +5843,11 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
 	}
 	gGL.popMatrix();
 	gGL.popUIMatrix();
+
+	if (shader)
+	{
+		shader->bind();
+	}
 }
 
 //
-- 
GitLab


From b2824aa21dc52aa4db5374fa3b8084e34a280747 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 16 Nov 2011 15:25:09 -0600
Subject: [PATCH 229/933] SH-2690 Add comments per Vir's review feedback

---
 indra/llrender/llrender.cpp   | 2 +-
 indra/newview/llselectmgr.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 010d3df9b75..812fa7024bf 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1888,7 +1888,7 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 { 
 	//the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095]
 	if (mCount > 2048)
-	{
+	{ //break when buffer gets reasonably full to keep GL command buffers happy and avoid overflow below
 		switch (mMode)
 		{
 			case LLRender::POINTS: flush(); break;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 036e4284150..5d0d1ef9a3f 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5717,7 +5717,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
 	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
 
 	if (shader)
-	{
+	{ //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes
 		gSolidColorProgram.bind();
 	}
 
-- 
GitLab


From e822ecc8035fe2624270c0c81ace9f74dcc8a8e1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 16 Nov 2011 18:56:25 -0600
Subject: [PATCH 230/933] SH-2675 Fix for shadow appearing on terrain at midday
 when terrain is totally flat and there are no prims visible

---
 indra/newview/llvosurfacepatch.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 01086905382..c3a2e6a712b 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -1035,6 +1035,8 @@ void LLVOSurfacePatch::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newM
 {
 	LLVector3 posAgent = getPositionAgent();
 	LLVector3 scale = getScale();
+	//make z-axis scale at least 1 to avoid shadow artifacts on totally flat land
+	scale.mV[VZ] = llmax(scale.mV[VZ], 1.f);
 	newMin.load3( (posAgent-scale*0.5f).mV); // Changing to 2.f makes the culling a -little- better, but still wrong
 	newMax.load3( (posAgent+scale*0.5f).mV);
 	LLVector4a pos;
-- 
GitLab


From c79c4f1477cae232a033e33cc1722b4658cf6634 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 16 Nov 2011 17:14:28 -0800
Subject: [PATCH 231/933] SH-1618 FIX SH-1619 FIX SH-1620 FIX SH-2621 FIX

* Got lighting, shadows, and ambient occlusion working on ATI macs.
* Re-enabled ambient occlusion on ATI macs.
* Re-enabled depth of field on ATI macs.

Reviewed by Runitai Linden.
---
 .../shaders/class1/deferred/blurLightF.glsl   | 24 +++++++----
 .../class2/deferred/sunLightSSAOF.glsl        | 43 +++++++++++--------
 indra/newview/featuretable_mac.txt            |  4 +-
 3 files changed, 44 insertions(+), 27 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 7d3b546d3e6..60d4dae99f0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -44,6 +44,11 @@ VARYING vec2 vary_fragcoord;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
+vec3 getKern(int i)
+{
+	return kern[i];
+}
+
 vec4 getPosition(vec2 pos_screen)
 {
 	float depth = texture2DRect(depthMap, pos_screen.xy).r;
@@ -68,35 +73,38 @@ void main()
 	vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy);
 	dlt /= max(-pos.z*dist_factor, 1.0);
 	
-	vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free'
+	vec2 defined_weight = getKern(0).xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free'
 	vec4 col = defined_weight.xyxx * ccol;
 
 	// relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances
 	float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005;
 
 	// perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large
-	tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 );
+	float tc_mod = 0.5*(tc.x + tc.y); // mod(tc.x+tc.y,2)
+	tc_mod -= floor(tc_mod);
+	tc_mod *= 2.0;
+	tc += ( (tc_mod - 0.5) * getKern(1).z * dlt * 0.5 );
 
 	for (int i = 1; i < 4; i++)
 	{
-		vec2 samptc = tc + kern[i].z*dlt;
+		vec2 samptc = tc + getKern(i).z*dlt;
 	        vec3 samppos = getPosition(samptc).xyz; 
 		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
 		if (d*d <= pointplanedist_tolerance_pow2)
 		{
-			col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
-			defined_weight += kern[i].xy;
+			col += texture2DRect(lightMap, samptc)*getKern(i).xyxx;
+			defined_weight += getKern(i).xy;
 		}
 	}
 	for (int i = 1; i < 4; i++)
 	{
-		vec2 samptc = tc - kern[i].z*dlt;
+		vec2 samptc = tc - getKern(i).z*dlt;
 	        vec3 samppos = getPosition(samptc).xyz; 
 		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
 		if (d*d <= pointplanedist_tolerance_pow2)
 		{
-			col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
-			defined_weight += kern[i].xy;
+			col += texture2DRect(lightMap, samptc)*getKern(i).xyxx;
+			defined_weight += getKern(i).xy;
 		}
 	}
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 5b207ab558f..6b420833b95 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -40,6 +40,7 @@ uniform sampler2DShadow shadowMap4;
 uniform sampler2DShadow shadowMap5;
 uniform sampler2D noiseMap;
 
+
 // Inputs
 uniform mat4 shadow_matrix[6];
 uniform vec4 shadow_clip;
@@ -49,12 +50,12 @@ uniform float ssao_factor;
 uniform float ssao_factor_inv;
 
 VARYING vec2 vary_fragcoord;
-uniform vec3 sun_dir;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 uniform vec2 shadow_res;
 uniform vec2 proj_shadow_res;
+uniform vec3 sun_dir;
 
 uniform float shadow_bias;
 uniform float shadow_offset;
@@ -75,11 +76,8 @@ vec4 getPosition(vec2 pos_screen)
 	return pos;
 }
 
-//calculate decreases in ambient lighting when crowded out (SSAO)
-float calcAmbientOcclusion(vec4 pos, vec3 norm)
+vec2 getKern(int i)
 {
-	float ret = 1.0;
-
 	vec2 kern[8];
 	// exponentially (^2) distant occlusion samples spread around origin
 	kern[0] = vec2(-1.0, 0.0) * 0.125*0.125;
@@ -90,22 +88,30 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm)
 	kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750;
 	kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875;
 	kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000;
+	
+	return kern[i];
+}
+
+//calculate decreases in ambient lighting when crowded out (SSAO)
+float calcAmbientOcclusion(vec4 pos, vec3 norm)
+{
+	float ret = 1.0;
 
 	vec2 pos_screen = vary_fragcoord.xy;
 	vec3 pos_world = pos.xyz;
 	vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy;
 		
 	float angle_hidden = 0.0;
-	int points = 0;
+	float points = 0;
 		
 	float scale = min(ssao_radius / -pos_world.z, ssao_max_radius);
-		
+	
 	// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?)
 	for (int i = 0; i < 8; i++)
 	{
-		vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect);
+		vec2 samppos_screen = pos_screen + scale * reflect(getKern(i), noise_reflect);
 		vec3 samppos_world = getPosition(samppos_screen).xyz; 
-			
+		
 		vec3 diff = pos_world - samppos_world;
 		float dist2 = dot(diff, diff);
 			
@@ -113,17 +119,21 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm)
 		// --> solid angle shrinking by the square of distance
 		//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2
 		//(k should vary inversely with # of samples, but this is taken care of later)
-			
-		angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv);
+		
+		float funky_val = (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) ? 1.0 : 0.0;
+		angle_hidden = angle_hidden + funky_val * min(1.0/dist2, ssao_factor_inv);
 			
 		// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" 
-		points = points + int(diff.z > -1.0);
+		float diffz_val = (diff.z > -1.0) ? 1.0 : 0.0;
+		points = points + diffz_val;
 	}
 		
-	angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0);
-		
-	ret = (1.0 - (float(points != 0) * angle_hidden));
+	angle_hidden = min(ssao_factor*angle_hidden/points, 1.0);
 	
+	float points_val = (points > 0.0) ? 1.0 : 0.0;
+	ret = (1.0 - (points_val * angle_hidden));
+
+	ret = max(ret, 0.0);
 	return min(ret, 1.0);
 }
 
@@ -160,7 +170,6 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
 	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
 	shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
 	
-			
 	return shadow/5.0;
 	
 	//return shadow;
@@ -253,7 +262,7 @@ void main()
 	gl_FragColor[0] = shadow;
 	gl_FragColor[1] = calcAmbientOcclusion(pos, norm);
 	
-	spos.xyz = shadow_pos+norm*spot_shadow_offset;
+	spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0);
 	
 	//spotlight shadow 1
 	vec4 lpos = shadow_matrix[4]*spos;
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 803c22507a0..390da2273d9 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
-version 30
+version 31
 // The version number above should be implemented IF AND ONLY IF some
 // change has been made that is sufficiently important to justify
 // resetting the graphics preferences of all users to the recommended
@@ -291,7 +291,7 @@ list TexUnit8orLess
 RenderDeferredSSAO			0	0
 
 list ATI
-RenderDeferredSSAO			0	0
+RenderDeferredSSAO			1	0
 
 list Intel
 RenderAnisotropic			1	0
-- 
GitLab


From 13a7fbc7a0cf460b4f57028b2e46c33426aa3a01 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 16 Nov 2011 17:48:10 -0800
Subject: [PATCH 232/933] EXP-1498 : Add a debug setting
 DebugHideEmptySystemFolders which is OFF by default so that we can control
 showing or hidding of system folders (this is temporary so we unblock
 testers).

---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llviewerfoldertype.cpp    |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a7dabeb5637..e9b4d4d96db 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1893,6 +1893,17 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>DebugHideEmptySystemFolders</key>
+    <map>
+      <key>Comment</key>
+      <string>Hide empty system folders when on</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>DebugInventoryFilters</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp
index a179b61cffc..c39df7efce3 100644
--- a/indra/newview/llviewerfoldertype.cpp
+++ b/indra/newview/llviewerfoldertype.cpp
@@ -30,6 +30,7 @@
 #include "lldictionary.h"
 #include "llmemory.h"
 #include "llvisualparam.h"
+#include "llviewercontrol.h"
 
 static const std::string empty_string;
 
@@ -266,7 +267,7 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type)
 bool LLViewerFolderType::lookupIsHiddenIfEmpty(LLFolderType::EType folder_type)
 {
 	const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type);
-	if (entry)
+	if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders") && entry)
 	{
 		return entry->mHideIfEmpty;
 	}
-- 
GitLab


From 87b85b78ef9824222b83334544b9f6c1d720b8a1 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 16 Nov 2011 18:08:21 -0800
Subject: [PATCH 233/933] FIX VWR-26744

---
 indra/newview/skins/default/xui/es/panel_people.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/es/panel_people.xml b/indra/newview/skins/default/xui/es/panel_people.xml
index 2fcbb00aed1..a9d38dca250 100644
--- a/indra/newview/skins/default/xui/es/panel_people.xml
+++ b/indra/newview/skins/default/xui/es/panel_people.xml
@@ -76,7 +76,7 @@
 				<button label="Compartir" name="share_btn" tool_tip="Compartir un objeto del inventario"/>
 			</layout_panel>
 			<layout_panel name="teleport_btn_lp">
-				<button label="Teleportarte" name="teleport_btn" tool_tip="Ofrecer teleporte"/>
+				<button label="Teleporte" name="teleport_btn" tool_tip="Ofrecer teleporte"/>
 			</layout_panel>
 		</layout_stack>
 		<layout_stack name="bottom_bar_ls1">
-- 
GitLab


From 13b084fde7fe5a51729491c4173acf7cbb85defe Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 16 Nov 2011 18:18:58 -0800
Subject: [PATCH 234/933] FIX VWR-26774

---
 indra/newview/skins/default/xui/es/strings.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 83747b85c03..4cae6ce5e86 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -3841,6 +3841,9 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE].
 	<string name="inventory_item_offered-im">
 		Ofrecido el item del inventario
 	</string>
+	<string name="share_alert">
+		Arrastra los ítems desde el invenbtario hasta aquí
+	</string>
 	<string name="no_session_message">
 		(La sesión de MI no existe)
 	</string>
-- 
GitLab


From cc1fb7bcac2924674763d917f66d84fbadb11623 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 17 Nov 2011 08:06:31 -0500
Subject: [PATCH 235/933] LLSD-14: Bring over llsd.{h,cpp} enhancements from
 server-trunk. Because new enum values have been added to the LLSD type field,
 a few external switch statements must be adjusted to suppress fatal warnings,
 even though we never expect to encounter an LLSD instance containing any of
 the new values.

---
 indra/llcommon/llsd.cpp               | 194 +++++++++++++++++++++-----
 indra/llcommon/llsd.h                 |  82 ++++++++++-
 indra/llmessage/llsdmessagereader.cpp |   1 +
 indra/test/lltut.cpp                  |   5 +
 4 files changed, 248 insertions(+), 34 deletions(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 6ca07374451..862b6b5ebc2 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -31,6 +31,7 @@
 #include "../llmath/llmath.h"
 #include "llformat.h"
 #include "llsdserialize.h"
+#include "stringize.h"
 
 #ifndef LL_RELEASE_FOR_DOWNLOAD
 #define NAME_UNNAMED_NAMESPACE
@@ -50,6 +51,24 @@ namespace
 using namespace LLSDUnnamedNamespace;
 #endif
 
+
+// Normally undefined
+#ifdef LLSD_DEBUG_INFO
+
+// statics
+S32	LLSD::sLLSDAllocationCount = 0;
+S32 LLSD::sLLSDNetObjects = 0;
+
+#define	ALLOC_LLSD_OBJECT			{ sLLSDNetObjects++;	sLLSDAllocationCount++;		}
+#define	FREE_LLSD_OBJECT			{ sLLSDNetObjects--;								}
+
+#else
+
+#define	ALLOC_LLSD_OBJECT
+#define	FREE_LLSD_OBJECT
+
+#endif
+
 class LLSD::Impl
 	/**< This class is the abstract base class of the implementation of LLSD
 		 It provides the reference counting implementation, and the default
@@ -58,13 +77,10 @@ class LLSD::Impl
 		
 	*/
 {
-private:
-	U32 mUseCount;
-	
 protected:
 	Impl();
 
-	enum StaticAllocationMarker { STATIC };
+	enum StaticAllocationMarker { STATIC_USAGE_COUNT = 0xFFFFFFFF };
 	Impl(StaticAllocationMarker);
 		///< This constructor is used for static objects and causes the
 		//   suppresses adjusting the debugging counters when they are
@@ -72,7 +88,9 @@ class LLSD::Impl
 		
 	virtual ~Impl();
 	
-	bool shared() const							{ return mUseCount > 1; }
+	bool shared() const							{ return (mUseCount > 1) && (mUseCount != STATIC_USAGE_COUNT); }
+	
+	U32 mUseCount;
 	
 public:
 	static void reset(Impl*& var, Impl* impl);
@@ -128,6 +146,9 @@ class LLSD::Impl
 	virtual LLSD::array_const_iterator beginArray() const { return endArray(); }
 	virtual LLSD::array_const_iterator endArray() const { static const std::vector<LLSD> empty; return empty.end(); }
 
+	virtual void dumpStats() const;
+	virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
+
 	static const LLSD& undef();
 	
 	static U32 sAllocationCount;
@@ -360,6 +381,9 @@ namespace
 		LLSD::map_iterator endMap() { return mData.end(); }
 		virtual LLSD::map_const_iterator beginMap() const { return mData.begin(); }
 		virtual LLSD::map_const_iterator endMap() const { return mData.end(); }
+
+		virtual void dumpStats() const;
+		virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
 	};
 	
 	ImplMap& ImplMap::makeMap(LLSD::Impl*& var)
@@ -414,6 +438,36 @@ namespace
 		return i->second;
 	}
 
+	void ImplMap::dumpStats() const
+	{
+		std::cout << "Map size: " << mData.size() << std::endl;
+
+		#ifdef LLSD_DEBUG_INFO
+		std::cout << "LLSD Net Objects: " << LLSD::sLLSDNetObjects << std::endl;
+		std::cout << "LLSD allocations: " << LLSD::sLLSDAllocationCount << std::endl;
+		#endif
+
+		std::cout << "LLSD::Impl Net Objects: " << sOutstandingCount << std::endl;
+		std::cout << "LLSD::Impl allocations: " << sAllocationCount << std::endl;
+
+		Impl::dumpStats();
+	}
+
+	void ImplMap::calcStats(S32 type_counts[], S32 share_counts[]) const
+	{
+		LLSD::map_const_iterator iter = beginMap();
+		while (iter != endMap())
+		{
+			//std::cout << "  " << (*iter).first << ": " << (*iter).second << std::endl;
+			(*iter).second.calcStats(type_counts, share_counts);
+			iter++;
+		}
+
+		// Add in the values for this map
+		Impl::calcStats(type_counts, share_counts);
+	}
+
+
 	class ImplArray : public LLSD::Impl
 	{
 	private:
@@ -449,6 +503,8 @@ namespace
 		LLSD::array_iterator endArray() { return mData.end(); }
 		virtual LLSD::array_const_iterator beginArray() const { return mData.begin(); }
 		virtual LLSD::array_const_iterator endArray() const { return mData.end(); }
+
+		virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
 	};
 
 	ImplArray& ImplArray::makeArray(Impl*& var)
@@ -490,12 +546,13 @@ namespace
 	
 	void ImplArray::insert(LLSD::Integer i, const LLSD& v)
 	{
-		if (i < 0) {
+		if (i < 0) 
+		{
 			return;
 		}
 		DataVector::size_type index = i;
 		
-		if (index >= mData.size())
+		if (index >= mData.size())	// tbd - sanity check limit for index ?
 		{
 			mData.resize(index + 1);
 		}
@@ -543,6 +600,19 @@ namespace
 		
 		return mData[index];
 	}
+
+	void ImplArray::calcStats(S32 type_counts[], S32 share_counts[]) const
+	{
+		LLSD::array_const_iterator iter = beginArray();
+		while (iter != endArray())
+		{	// Add values for all items held in the array
+			(*iter).calcStats(type_counts, share_counts);
+			iter++;
+		}
+
+		// Add in the values for this array
+		Impl::calcStats(type_counts, share_counts);
+	}
 }
 
 LLSD::Impl::Impl()
@@ -564,8 +634,11 @@ LLSD::Impl::~Impl()
 
 void LLSD::Impl::reset(Impl*& var, Impl* impl)
 {
-	if (impl) ++impl->mUseCount;
-	if (var  &&  --var->mUseCount == 0)
+	if (impl && impl->mUseCount != STATIC_USAGE_COUNT) 
+	{
+		++impl->mUseCount;
+	}
+	if (var  &&  var->mUseCount != STATIC_USAGE_COUNT && --var->mUseCount == 0)
 	{
 		delete var;
 	}
@@ -574,13 +647,13 @@ void LLSD::Impl::reset(Impl*& var, Impl* impl)
 
 LLSD::Impl& LLSD::Impl::safe(Impl* impl)
 {
-	static Impl theUndefined(STATIC);
+	static Impl theUndefined(STATIC_USAGE_COUNT);
 	return impl ? *impl : theUndefined;
 }
 
 const LLSD::Impl& LLSD::Impl::safe(const Impl* impl)
 {
-	static Impl theUndefined(STATIC);
+	static Impl theUndefined(STATIC_USAGE_COUNT);
 	return impl ? *impl : theUndefined;
 }
 
@@ -656,6 +729,39 @@ const LLSD& LLSD::Impl::undef()
 	return immutableUndefined;
 }
 
+void LLSD::Impl::dumpStats() const
+{
+	S32 type_counts[LLSD::TypeLLSDNumTypes + 1];
+	memset(&type_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32));
+
+	S32 share_counts[LLSD::TypeLLSDNumTypes + 1];
+	memset(&share_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32));
+
+	// Add info from all the values this object has
+	calcStats(type_counts, share_counts);
+
+	S32 type_index = LLSD::TypeLLSDTypeBegin;
+	while (type_index != LLSD::TypeLLSDTypeEnd)
+	{
+		std::cout << LLSD::typeString((LLSD::Type)type_index) << " type "
+			<< type_counts[type_index] << " objects, "
+			<< share_counts[type_index] << " shared"
+			<< std::endl;
+		type_index++;
+	}
+}
+
+
+void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const
+{ 
+	type_counts[(S32) type()]++;	
+	if (shared())
+	{
+		share_counts[(S32) type()]++;
+	}
+}
+
+
 U32 LLSD::Impl::sAllocationCount = 0;
 U32 LLSD::Impl::sOutstandingCount = 0;
 
@@ -681,10 +787,10 @@ namespace
 }
 
 
-LLSD::LLSD()							: impl(0)	{ }
-LLSD::~LLSD()							{ Impl::reset(impl, 0); }
+LLSD::LLSD() : impl(0)					{ ALLOC_LLSD_OBJECT; }
+LLSD::~LLSD()							{ FREE_LLSD_OBJECT; Impl::reset(impl, 0); }
 
-LLSD::LLSD(const LLSD& other)			: impl(0) { assign(other); }
+LLSD::LLSD(const LLSD& other) : impl(0) { ALLOC_LLSD_OBJECT;  assign(other); }
 void LLSD::assign(const LLSD& other)	{ Impl::assign(impl, other.impl); }
 
 
@@ -693,17 +799,17 @@ void LLSD::clear()						{ Impl::assignUndefined(impl); }
 LLSD::Type LLSD::type() const			{ return safe(impl).type(); }
 
 // Scaler Constructors
-LLSD::LLSD(Boolean v)					: impl(0) { assign(v); }
-LLSD::LLSD(Integer v)					: impl(0) { assign(v); }
-LLSD::LLSD(Real v)						: impl(0) { assign(v); }
-LLSD::LLSD(const UUID& v)				: impl(0) { assign(v); }
-LLSD::LLSD(const String& v)				: impl(0) { assign(v); }
-LLSD::LLSD(const Date& v)				: impl(0) { assign(v); }
-LLSD::LLSD(const URI& v)				: impl(0) { assign(v); }
-LLSD::LLSD(const Binary& v)				: impl(0) { assign(v); }
+LLSD::LLSD(Boolean v) : impl(0)			{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(Integer v) : impl(0)			{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(Real v) : impl(0)			{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(const UUID& v) : impl(0)		{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(const String& v) : impl(0)	{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(const Date& v) : impl(0)		{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(const URI& v) : impl(0)		{ ALLOC_LLSD_OBJECT;	assign(v); }
+LLSD::LLSD(const Binary& v) : impl(0)	{ ALLOC_LLSD_OBJECT;	assign(v); }
 
 // Convenience Constructors
-LLSD::LLSD(F32 v)						: impl(0) { assign((Real)v); }
+LLSD::LLSD(F32 v) : impl(0)				{ ALLOC_LLSD_OBJECT;	assign((Real)v); }
 
 // Scalar Assignment
 void LLSD::assign(Boolean v)			{ safe(impl).assign(impl, v); }
@@ -726,7 +832,7 @@ LLSD::URI		LLSD::asURI() const		{ return safe(impl).asURI(); }
 LLSD::Binary	LLSD::asBinary() const	{ return safe(impl).asBinary(); }
 
 // const char * helpers
-LLSD::LLSD(const char* v)				: impl(0) { assign(v); }
+LLSD::LLSD(const char* v) : impl(0)		{ ALLOC_LLSD_OBJECT;	assign(v); }
 void LLSD::assign(const char* v)
 {
 	if(v) assign(std::string(v));
@@ -801,15 +907,9 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
 	{
 		std::ostringstream out;
 		if (useXMLFormat)
-		{
-			LLSDXMLStreamer xml_streamer(llsd);
-			out << xml_streamer;
-		}
+			out << LLSDXMLStreamer(llsd);
 		else
-		{
-			LLSDNotationStreamer notation_streamer(llsd);
-			out << notation_streamer;
-		}
+			out << LLSDNotationStreamer(llsd);
 		out_string = out.str();
 	}
 	int len = out_string.length();
@@ -840,3 +940,33 @@ LLSD::array_iterator		LLSD::beginArray()		{ return makeArray(impl).beginArray();
 LLSD::array_iterator		LLSD::endArray()		{ return makeArray(impl).endArray(); }
 LLSD::array_const_iterator	LLSD::beginArray() const{ return safe(impl).beginArray(); }
 LLSD::array_const_iterator	LLSD::endArray() const	{ return safe(impl).endArray(); }
+
+
+// Diagnostic dump of contents in an LLSD object
+void LLSD::dumpStats()	const						{ safe(impl).dumpStats();	}
+void LLSD::calcStats(S32 type_counts[], S32 share_counts[]) const
+													{ safe(impl).calcStats(type_counts, share_counts);	}
+
+// static
+std::string		LLSD::typeString(Type type)
+{
+	static const char * sTypeNameArray[] = {
+		"Undefined",
+		"Boolean",
+		"Integer",
+		"Real",
+		"String",
+		"UUID",
+		"Date",
+		"URI",
+		"Binary",
+		"Map",
+		"Array"
+	};
+
+	if (0 <= type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0])))
+	{
+		return sTypeNameArray[type];
+	}
+	return STRINGIZE("** invalid type value " << type);
+}
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index 90d0f978730..1ffa1d279b6 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -80,9 +80,73 @@
 	
 	An array is a sequence of zero or more LLSD values.
 	
+	Thread Safety
+
+	In general, these LLSD classes offer *less* safety than STL container
+	classes.  Implementations prior to this one were unsafe even when
+	completely unrelated LLSD trees were in two threads due to reference
+	sharing of special 'undefined' values that participated in the reference
+	counting mechanism.
+
+	The dereference-before-refcount and aggressive tree sharing also make
+	it impractical to share an LLSD across threads.  A strategy of passing
+	ownership or a copy to another thread is still difficult due to a lack
+	of a cloning interface but it can be done with some care.
+
+	One way of transferring ownership is as follows:
+
+		void method(const LLSD input) {
+		...
+		LLSD * xfer_tree = new LLSD();
+		{
+			// Top-level values
+			(* xfer_tree)['label'] = "Some text";
+			(* xfer_tree)['mode'] = APP_MODE_CONSTANT;
+
+			// There will be a second-level
+			LLSD subtree(LLSD::emptyMap());
+			(* xfer_tree)['subtree'] = subtree;
+
+			// Do *not* copy from LLSD objects via LLSD
+			// intermediaries.  Only use plain-old-data
+			// types as intermediaries to prevent reference
+			// sharing.
+			subtree['value1'] = input['value1'].asInteger();
+			subtree['value2'] = input['value2'].asString();
+
+			// Close scope and drop 'subtree's reference.
+			// Only xfer_tree has a reference to the second
+			// level data.
+		}
+		...
+		// Transfer the LLSD pointer to another thread.  Ownership
+		// transfers, this thread no longer has a reference to any
+		// part of the xfer_tree and there's nothing to free or
+		// release here.  Receiving thread does need to delete the
+		// pointer when it is done with the LLSD.  Transfer
+		// mechanism must perform correct data ordering operations
+		// as dictated by architecture.
+		other_thread.sendMessageAndPointer("Take This", xfer_tree);
+		xfer_tree = NULL;
+
+
+	Avoid this pattern which provides half of a race condition:
+	
+		void method(const LLSD input) {
+		...
+		LLSD xfer_tree(LLSD::emptyMap());
+		xfer_tree['label'] = "Some text";
+		xfer_tree['mode'] = APP_MODE_CONSTANT;
+		...
+		other_thread.sendMessageAndPointer("Take This", xfer_tree);
+
+	
 	@nosubgrouping
 */
 
+// Normally undefined, used for diagnostics
+//#define LLSD_DEBUG_INFO	1
+
 class LL_COMMON_API LLSD
 {
 public:
@@ -266,7 +330,7 @@ class LL_COMMON_API LLSD
 	/** @name Type Testing */
 	//@{
 		enum Type {
-			TypeUndefined,
+			TypeUndefined = 0,
 			TypeBoolean,
 			TypeInteger,
 			TypeReal,
@@ -276,7 +340,10 @@ class LL_COMMON_API LLSD
 			TypeURI,
 			TypeBinary,
 			TypeMap,
-			TypeArray
+			TypeArray,
+			TypeLLSDTypeEnd,
+			TypeLLSDTypeBegin = TypeUndefined,
+			TypeLLSDNumTypes = (TypeLLSDTypeEnd - TypeLLSDTypeBegin)
 		};
 		
 		Type type() const;
@@ -338,6 +405,17 @@ class LL_COMMON_API LLSD
 		/// Returns Notation version of llsd -- only to be called from debugger
 		static const char *dump(const LLSD &llsd);
 	//@}
+
+public:
+	void			dumpStats() const;					// Output information on object and usage
+	void			calcStats(S32 type_counts[], S32 share_counts[]) const;		// Calculate the number of LLSD objects used by this value
+
+	static std::string		typeString(Type type);		// Return human-readable type as a string
+
+#ifdef LLSD_DEBUG_INFO
+	static S32		sLLSDAllocationCount;		// Number of LLSD objects ever created
+	static S32		sLLSDNetObjects;			// Number of LLSD objects that exist
+#endif
 };
 
 struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index 304a692cdfe..3ab62a8c579 100644
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -291,6 +291,7 @@ S32 getElementSize(const LLSD& llsd)
 	case LLSD::TypeMap:
 	case LLSD::TypeArray:
 	case LLSD::TypeUndefined:
+	default:                        // TypeLLSDTypeEnd, TypeLLSDNumTypes, etc.
 		return 0;
 	}
 	return 0;
diff --git a/indra/test/lltut.cpp b/indra/test/lltut.cpp
index da7031b52a8..c43a8f0c7d7 100644
--- a/indra/test/lltut.cpp
+++ b/indra/test/lltut.cpp
@@ -34,6 +34,7 @@
 #include "llformat.h"
 #include "llsd.h"
 #include "lluri.h"
+#include "stringize.h"
 
 namespace tut
 {
@@ -144,6 +145,10 @@ namespace tut
 				}
 				return;
 			}
+			default:
+				// should never get here, but compiler produces warning if we
+				// don't cover this case, and at Linden warnings are fatal.
+				throw failure(STRINGIZE("invalid type field " << actual.type()));
 		}
 	}
 
-- 
GitLab


From e62c691aab36b50d3eecb99310d5652d0b8e6f23 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 17 Nov 2011 10:02:05 -0500
Subject: [PATCH 236/933] LLSD-14: Fix silly syntax error in subscript bounds
 check.

---
 indra/llcommon/llsd.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 862b6b5ebc2..b0801745d7b 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -964,7 +964,7 @@ std::string		LLSD::typeString(Type type)
 		"Array"
 	};
 
-	if (0 <= type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0])))
+	if (0 <= type && type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0])))
 	{
 		return sTypeNameArray[type];
 	}
-- 
GitLab


From b0d869554b902c30f8a874b1e772a0241acf9f1f Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 17 Nov 2011 11:10:39 -0500
Subject: [PATCH 237/933] LLSD-14: Add tests from Simon's server-trunk
 changeset 3852648182db. That changeset provides most of the changes
 previously checked in on this Jira (viewer changeset 22b293aae639). Bring
 over the code he added to llsd_new_tut.cpp as well.

---
 indra/test/llsd_new_tut.cpp | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp
index dd93b36f041..f332ad0ee2b 100644
--- a/indra/test/llsd_new_tut.cpp
+++ b/indra/test/llsd_new_tut.cpp
@@ -742,6 +742,42 @@ namespace tut
 			LLSD w = v;
 			w = "nice day";
 		}
+
+		{
+			SDAllocationCheck check("shared values test for threaded work", 9);
+
+			//U32 start_llsd_count = LLSD::outstandingCount();
+
+			LLSD m = LLSD::emptyMap();
+
+			m["one"] = 1;
+			m["two"] = 2;
+			m["one_copy"] = m["one"];			// 3 (m, "one" and "two")
+
+			m["undef_one"] = LLSD();
+			m["undef_two"] = LLSD();
+			m["undef_one_copy"] = m["undef_one"];
+
+			{	// Ensure first_array gets freed to avoid counting it
+				LLSD first_array = LLSD::emptyArray();
+				first_array.append(1.0f);
+				first_array.append(2.0f);			
+				first_array.append(3.0f);			// 7
+
+				m["array"] = first_array;
+				m["array_clone"] = first_array;
+				m["array_copy"] = m["array"];		// 7
+			}
+
+			m["string_one"] = "string one value";
+			m["string_two"] = "string two value";
+			m["string_one_copy"] = m["string_one"];		// 9
+
+			//U32 llsd_object_count = LLSD::outstandingCount();
+			//std::cout << "Using " << (llsd_object_count - start_llsd_count) << " LLSD objects" << std::endl;
+
+			//m.dumpStats();
+		}
 	}
 
 	template<> template<>
-- 
GitLab


From 570ac04e167c97553a03f283ee0683cc4648601c Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 17 Nov 2011 11:54:13 -0500
Subject: [PATCH 238/933] LLSD-14: while we're in llsd.h anyway, fix
 longstanding misspellings. My tollerance is at an end.  :-P

---
 indra/llcommon/llsd.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index 1ffa1d279b6..80c3e9e7b58 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -40,10 +40,10 @@
 /**
 	LLSD provides a flexible data system similar to the data facilities of
 	dynamic languages like Perl and Python.  It is created to support exchange
-	of structured data between loosly coupled systems.  (Here, "loosly coupled"
+	of structured data between loosely coupled systems.  (Here, "loosely coupled"
 	means not compiled together into the same module.)
 	
-	Data in such exchanges must be highly tollerant of changes on either side
+	Data in such exchanges must be highly tolerant of changes on either side
 	such as:
 			- recompilation
 			- implementation in a different langauge
@@ -51,19 +51,19 @@
 			- execution of older versions (with fewer parameters)
 
 	To this aim, the C++ API of LLSD strives to be very easy to use, and to
-	default to "the right thing" whereever possible.  It is extremely tollerant
+	default to "the right thing" wherever possible.  It is extremely tolerant
 	of errors and unexpected situations.
 	
-	The fundimental class is LLSD.  LLSD is a value holding object.  It holds
+	The fundamental class is LLSD.  LLSD is a value holding object.  It holds
 	one value that is either undefined, one of the scalar types, or a map or an
 	array.  LLSD objects have value semantics (copying them copies the value,
-	though it can be considered efficient, due to shareing.), and mutable.
+	though it can be considered efficient, due to sharing), and mutable.
 
 	Undefined is the singular value given to LLSD objects that are not
 	initialized with any data.  It is also used as the return value for
-	operations that return an LLSD,
+	operations that return an LLSD.
 	
-	The sclar data types are:
+	The scalar data types are:
 		- Boolean	- true or false
 		- Integer	- a 32 bit signed integer
 		- Real		- a 64 IEEE 754 floating point value
@@ -266,7 +266,7 @@ class LL_COMMON_API LLSD
 	//@}
 	
 	/** @name Character Pointer Helpers
-		These are helper routines to make working with char* the same as easy as
+		These are helper routines to make working with char* as easy as
 		working with strings.
 	 */
 	//@{
@@ -369,7 +369,7 @@ class LL_COMMON_API LLSD
 		If you get a linker error about these being missing, you have made
 		mistake in your code.  DO NOT IMPLEMENT THESE FUNCTIONS as a fix.
 		
-		All of thse problems stem from trying to support char* in LLSD or in
+		All of these problems stem from trying to support char* in LLSD or in
 		std::string.  There are too many automatic casts that will lead to
 		using an arbitrary pointer or scalar type to std::string.
 	 */
@@ -378,7 +378,7 @@ class LL_COMMON_API LLSD
 		void assign(const void*);		///< assign from arbitrary pointers
 		LLSD& operator=(const void*);	///< assign from arbitrary pointers
 		
-		bool has(Integer) const;		///< has only works for Maps
+		bool has(Integer) const;		///< has() only works for Maps
 	//@}
 	
 	/** @name Implementation */
@@ -464,8 +464,8 @@ struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
 LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
 
 /** QUESTIONS & TO DOS
-	- Would Binary be more convenient as usigned char* buffer semantics?
-	- Should Binary be convertable to/from String, and if so how?
+	- Would Binary be more convenient as unsigned char* buffer semantics?
+	- Should Binary be convertible to/from String, and if so how?
 		- as UTF8 encoded strings (making not like UUID<->String)
 		- as Base64 or Base96 encoded (making like UUID<->String)
 	- Conversions to std::string and LLUUID do not result in easy assignment
-- 
GitLab


From c902ff338b85d244bd0a1a972c9d0eed35668c44 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 17 Nov 2011 11:53:48 -0600
Subject: [PATCH 239/933] SH-2670 Fix for terrain being wrong detail.

---
 indra/newview/lldrawpoolterrain.cpp | 30 ++++-------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index b8e653c5de8..b95d8296fa0 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -130,24 +130,9 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass )
 	LLFastTimer t(FTM_RENDER_TERRAIN);
 	LLFacePool::beginRenderPass(pass);
 
-	if (sDetailMode > 0)
-	{
-		sShader = LLPipeline::sUnderWaterRender ? 
-						&gTerrainWaterProgram :
-						&gTerrainProgram;
-	}
-	else
-	{
-		if (LLPipeline::sUnderWaterRender)
-		{
-			sShader = &gObjectSimpleNonIndexedTexGenWaterProgram;
-		}
-		else
-		{
-			sShader = &gObjectSimpleNonIndexedTexGenProgram;
-		}
-	}
-					
+	sShader = LLPipeline::sUnderWaterRender ? 
+					&gTerrainWaterProgram :
+					&gTerrainProgram;	
 
 	if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0)
 	{
@@ -210,14 +195,7 @@ void LLDrawPoolTerrain::render(S32 pass)
 	{
 		gPipeline.enableLightsDynamic();
 
-		if (sDetailMode > 0)
-		{
-			renderFullShader();
-		}
-		else
-		{
-			renderSimple();
-		}
+		renderFullShader();
 	}
 	else
 	{
-- 
GitLab


From 0559c2c24f1d82989793922601a4d0df57e04349 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Thu, 17 Nov 2011 13:20:24 -0500
Subject: [PATCH 240/933] SH-2663 WIP, SH-2667 FIX - better logic for when to
 copy temp files, only uninstall V2 when called from auto-update, clean temp
 files when done

---
 .../installers/windows/installer_template.nsi | 97 ++++++++++++++++---
 1 file changed, 82 insertions(+), 15 deletions(-)

diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index 02ca7cbb3a5..8a6114f0d57 100755
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -115,6 +115,7 @@ Var COMMANDLINE         ; command line passed to this installer, set in .onInit
 Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
 Var SKIP_DIALOGS        ; set from command line in  .onInit. autoinstall 
                         ; GUI and the defaults.
+Var DO_UNINSTALL_V2     ; If non-null, path to a previous Viewer 2 installation that will be uninstalled.
 
 ;;; Function definitions should go before file includes, because calls to
 ;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
@@ -310,6 +311,29 @@ Function CheckNetworkConnection
 FunctionEnd
 
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Function CheckWillUninstallV2               
+;
+; If we are being called through auto-update, we need to uninstall any
+; existing V2 installation. Otherwise, we wind up with
+; SecondLifeViewer2 and SecondLifeViewer installations existing side
+; by side no indication which to use.
+; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function CheckWillUninstallV2
+
+  StrCpy $DO_UNINSTALL_V2 ""
+
+  StrCmp $SKIP_DIALOGS "true" 0 CHECKV2_DONE
+  StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" CHECKV2_DONE ; don't uninstall our own install dir.
+  IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" CHECKV2_FOUND CHECKV2_DONE
+
+CHECKV2_FOUND:
+  StrCpy $DO_UNINSTALL_V2 "true"
+
+CHECKV2_DONE:
+
+FunctionEnd
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Save user files to temp location
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -334,7 +358,7 @@ Push $2
     ExpandEnvStrings $2 $2
 
     CreateDirectory "$TEMP\SecondLifeSettingsBackup\$0"
-    CopyFiles  "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
+    CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
 
   CONTINUE:
     IntOp $0 $0 + 1
@@ -350,7 +374,7 @@ Push $0
     ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
     StrCmp $0 "" +2
     CreateDirectory "$TEMP\SecondLifeSettingsBackup\AllUsers\"
-    CopyFiles "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
+    CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
 Pop $0
 
 FunctionEnd
@@ -377,7 +401,7 @@ Push $2
     ExpandEnvStrings $2 $2
 
     CreateDirectory "$2\Application Data\SecondLife\"
-    CopyFiles "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\" 
+    CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\" 
 
   CONTINUE:
     IntOp $0 $0 + 1
@@ -393,11 +417,53 @@ Push $0
     ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
     StrCmp $0 "" +2
     CreateDirectory "$2\Application Data\SecondLife\"
-    CopyFiles "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\" 
+    CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\" 
+Pop $0
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Remove temp dirs
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function RemoveTempUserFiles
+
+Push $0
+Push $1
+Push $2
+
+    StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+
+  LOOP:
+    EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
+    StrCmp $1 "" DONE               ; no more users
+
+    ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" 
+    StrCmp $2 "" CONTINUE 0         ; "ProfileImagePath" value is missing
+
+    ; Required since ProfileImagePath is of type REG_EXPAND_SZ
+    ExpandEnvStrings $2 $2
+
+    RMDir /r "$TEMP\SecondLifeSettingsBackup\$0\*"
+
+  CONTINUE:
+    IntOp $0 $0 + 1
+    Goto LOOP
+  DONE:
+
+Pop $2
+Pop $1
+Pop $0
+
+; Copy files in Documents and Settings\All Users\SecondLife
+Push $0
+    ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+    StrCmp $0 "" +2
+    RMDir /r "$TEMP\SecondLifeSettingsBackup\AllUsers\*"
 Pop $0
 
 FunctionEnd
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Clobber user files - TEST ONLY
 ; This is here for testing, generally not desirable to call it.
@@ -864,9 +930,12 @@ Call CheckIfAdministrator		; Make sure the user can install/uninstall
 Call CheckIfAlreadyCurrent		; Make sure that we haven't already installed this version
 Call CloseSecondLife			; Make sure we're not running
 Call CheckNetworkConnection		; ping secondlife.com
+Call CheckWillUninstallV2               ; See if a V2 install exists and will be removed.
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Call PreserveUserFiles
+StrCmp $DO_UNINSTALL_V2 "" PRESERVE_DONE
+  Call PreserveUserFiles
+PRESERVE_DONE:
 
 ;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers.
 ;Call RemoveCacheFiles			; Installing over removes potentially corrupted
@@ -951,17 +1020,15 @@ WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" ""
 ; write out uninstaller
 WriteUninstaller "$INSTDIR\uninst.exe"
 
-; Remove existing "Second Life Viewer 2" install if any.
-StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" SLV2_DONE ; unless that's the install directory
-IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" SLV2_FOUND SLV2_DONE
-
-SLV2_FOUND:
-ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
-Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" ; with _? option above, uninst.exe will be left behind.
-RMDir "$PROGRAMFILES\SecondLifeViewer2" ; will remove only if empty.
+; Uninstall existing "Second Life Viewer 2" install if needed.
+StrCmp $DO_UNINSTALL_V2 "" REMOVE_SLV2_DONE
+  ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
+  Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" ; with _? option above, uninst.exe will be left behind.
+  RMDir "$PROGRAMFILES\SecondLifeViewer2" ; will remove only if empty.
 
-SLV2_DONE:
-Call RestoreUserFiles
+  Call RestoreUserFiles
+  Call RemoveTempUserFiles
+REMOVE_SLV2_DONE:
 
 ; end of default section
 SectionEnd
-- 
GitLab


From 0c36f481f13493801788ef233b96a2bfe5a44060 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 17 Nov 2011 20:39:07 +0200
Subject: [PATCH 241/933] EXP-1559 FOLLOWUP Changed the success message for
 profile feed.

---
 indra/newview/skins/default/xui/en/floater_snapshot.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index b8d368ec524..85f65dedd38 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -35,7 +35,7 @@
     </string>
  	<string
  	 name="profile_succeeded_str">
- 	    Your Profile Feed has been updated!
+ 	    Profile feed updated!
  	</string>
  	<string
  	 name="postcard_succeeded_str">
-- 
GitLab


From bd5b1ed713506d365793c7f9cb49d506ce392e7a Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 17 Nov 2011 13:55:11 -0500
Subject: [PATCH 242/933] LLSD-14: Make dumpStats()/calcStats() implementation
 more robust per Monty code review

---
 indra/llcommon/llsd.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index b0801745d7b..39d1f3e35f0 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -732,10 +732,10 @@ const LLSD& LLSD::Impl::undef()
 void LLSD::Impl::dumpStats() const
 {
 	S32 type_counts[LLSD::TypeLLSDNumTypes + 1];
-	memset(&type_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32));
+	memset(&type_counts, 0, sizeof(type_counts));
 
 	S32 share_counts[LLSD::TypeLLSDNumTypes + 1];
-	memset(&share_counts, 0, LLSD::TypeLLSDNumTypes * sizeof(S32));
+	memset(&share_counts, 0, sizeof(share_counts));
 
 	// Add info from all the values this object has
 	calcStats(type_counts, share_counts);
@@ -753,11 +753,15 @@ void LLSD::Impl::dumpStats() const
 
 
 void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const
-{ 
-	type_counts[(S32) type()]++;	
-	if (shared())
+{
+	S32 type = S32(type());
+	if (0 <= type && type < LLSD::TypeLLSDNumTypes)
 	{
-		share_counts[(S32) type()]++;
+		type_counts[type]++;	
+		if (shared())
+		{
+			share_counts[type]++;
+		}
 	}
 }
 
-- 
GitLab


From b49c934bd913c0973630abf32ea566eefa1aa973 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 17 Nov 2011 15:03:25 -0500
Subject: [PATCH 243/933] LLSD-14: fixed way-too-overloaded local variable.

---
 indra/llcommon/llsd.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 39d1f3e35f0..3fa08aee8d1 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -754,13 +754,13 @@ void LLSD::Impl::dumpStats() const
 
 void LLSD::Impl::calcStats(S32 type_counts[], S32 share_counts[]) const
 {
-	S32 type = S32(type());
-	if (0 <= type && type < LLSD::TypeLLSDNumTypes)
+	S32 tp = S32(type());
+	if (0 <= tp && tp < LLSD::TypeLLSDNumTypes)
 	{
-		type_counts[type]++;	
+		type_counts[tp]++;	
 		if (shared())
 		{
-			share_counts[type]++;
+			share_counts[tp]++;
 		}
 	}
 }
-- 
GitLab


From b28492fbffd7bea9e7174260d66d5f52c76d24b2 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Thu, 17 Nov 2011 23:17:26 +0000
Subject: [PATCH 244/933] STORM-1708 Adding ability to save/load scripts from
 file.

---
 doc/contributions.txt                         |  1 +
 indra/newview/llfilepicker.cpp                | 15 ++++
 indra/newview/llfilepicker.h                  |  2 +
 indra/newview/llfloaternamedesc.cpp           | 21 +++++
 indra/newview/llfloaternamedesc.h             | 10 ++-
 indra/newview/llpreviewscript.cpp             | 78 +++++++++++++++++--
 indra/newview/llpreviewscript.h               |  2 +
 indra/newview/llviewerfloaterreg.cpp          |  3 +-
 indra/newview/llviewermenufile.cpp            | 22 ++++++
 .../skins/default/xui/en/menu_viewer.xml      | 15 +++-
 .../skins/default/xui/en/panel_script_ed.xml  | 22 ++++--
 11 files changed, 174 insertions(+), 17 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 2b39e15e2a9..9daef4035a0 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -482,6 +482,7 @@ Ima Mechanique
 	OPEN-76
 	STORM-959
 	STORM-1175
+	STORM-1708
 Imnotgoing Sideways
 Inma Rau
 Innula Zenovka
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 4897cf18859..0801871409f 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -58,6 +58,7 @@ LLFilePicker LLFilePicker::sInstance;
 #define SLOBJECT_FILTER L"Objects (*.slobject)\0*.slobject\0"
 #define RAW_FILTER L"RAW files (*.raw)\0*.raw\0"
 #define MODEL_FILTER L"Model files (*.dae)\0*.dae\0"
+#define SCRIPT_FILTER L"Script files (*.lsl; *.txt)\0*.lsl;*.txt\0"
 #endif
 
 //
@@ -213,6 +214,10 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter)
 		mOFN.lpstrFilter = MODEL_FILTER \
 			L"\0";
 		break;
+	case FFLOAD_SCRIPT:
+		mOFN.lpstrFilter = SCRIPT_FILTER \
+			L"\0";
+		break;
 	default:
 		res = FALSE;
 		break;
@@ -497,6 +502,16 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename)
 			L"Compressed Images (*.j2c)\0*.j2c\0" \
 			L"\0";
 		break;
+	case FFSAVE_SCRIPT:
+		if (filename.empty())
+		{
+			wcsncpy( mFilesW,L"untitled.lsl", FILENAME_BUFFER_SIZE);
+		}
+		mOFN.lpstrDefExt = L"txt";
+		mOFN.lpstrFilter = 
+			L"LSL Files (*.lsl; *.txt)\0*.lsl;*.txt\0"
+			L"\0";
+		break;
 	default:
 		return FALSE;
 	}
diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h
index cd843a8f33f..a4d5d68ff58 100644
--- a/indra/newview/llfilepicker.h
+++ b/indra/newview/llfilepicker.h
@@ -84,6 +84,7 @@ class LLFilePicker
 		FFLOAD_RAW = 8,
 		FFLOAD_MODEL = 9,
 		FFLOAD_COLLADA = 10,
+		FFLOAD_SCRIPT = 11,
 	};
 
 	enum ESaveFilter
@@ -103,6 +104,7 @@ class LLFilePicker
 		FFSAVE_J2C = 12,
 		FFSAVE_PNG = 13,
 		FFSAVE_JPEG = 14,
+		FFSAVE_SCRIPT = 15,
 	};
 
 	// open the dialog. This is a modal operation
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index ae95d4392ac..4d4f9f57bf2 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -204,3 +204,24 @@ BOOL LLFloaterSoundPreview::postBuild()
 	getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
 	return TRUE;
 }
+
+
+//-----------------------------------------------------------------------------
+// LLFloaterScriptPreview()
+//-----------------------------------------------------------------------------
+
+LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename )
+	: LLFloaterNameDesc(filename)
+{
+	mIsAudio = TRUE;
+}
+
+BOOL LLFloaterScriptPreview::postBuild()
+{
+	if (!LLFloaterNameDesc::postBuild())
+	{
+		return FALSE;
+	}
+	getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
+	return TRUE;
+}
diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h
index 7381a6334a9..69bbccaf804 100644
--- a/indra/newview/llfloaternamedesc.h
+++ b/indra/newview/llfloaternamedesc.h
@@ -51,6 +51,7 @@ class LLFloaterNameDesc : public LLFloater
 
 protected:
 	BOOL        mIsAudio;
+	bool		mIsText;
 
 	std::string		mFilenameAndPath;
 	std::string		mFilename;
@@ -62,5 +63,12 @@ class LLFloaterSoundPreview : public LLFloaterNameDesc
 	LLFloaterSoundPreview(const LLSD& filename );
 	virtual BOOL postBuild();
 };
-	
+
+class LLFloaterScriptPreview : public LLFloaterNameDesc
+{
+public:
+	LLFloaterScriptPreview(const LLSD& filename );
+	virtual BOOL postBuild();
+};
+
 #endif  // LL_LLFLOATERNAMEDESC_H
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index b19bf5d234c..072df39514b 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -35,6 +35,7 @@
 #include "llcombobox.h"
 #include "lldir.h"
 #include "llexternaleditor.h"
+#include "llfilepicker.h"
 #include "llfloaterreg.h"
 #include "llinventorydefines.h"
 #include "llinventorymodel.h"
@@ -89,15 +90,15 @@
 const std::string HELLO_LSL =
 	"default\n"
 	"{\n"
-	"    state_entry()\n"
-    "    {\n"
-    "        llSay(0, \"Hello, Avatar!\");\n"
-    "    }\n"
+	"\tstate_entry()\n"
+    "\t{\n"
+    "\t\tllOwnerSay(\"Hello, Avatar!\");\n"
+    "\t}\n"
 	"\n"
-	"    touch_start(integer total_number)\n"
-	"    {\n"
-	"        llSay(0, \"Touched.\");\n"
-	"    }\n"
+	"\ttouch_start(integer total_number)\n"
+	"\t{\n"
+	"\t\tllSay(llDetectedKey(0), \"Touched.\");\n"
+	"\t}\n"
 	"}\n";
 const std::string HELP_LSL_PORTAL_TOPIC = "LSL_Portal";
 
@@ -503,6 +504,14 @@ void LLScriptEdCore::initMenu()
 
 	menuItem = getChild<LLMenuItemCallGL>("Keyword Help...");
 	menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnDynamicHelp, this));
+
+	menuItem = getChild<LLMenuItemCallGL>("LoadFromFile");
+	menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnLoadFromFile, this));
+//	menuItem->setEnabledCallback(NULL);
+
+	menuItem = getChild<LLMenuItemCallGL>("SaveToFile");
+	menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnSaveToFile, this));
+	menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this));
 }
 
 void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid)
@@ -1096,6 +1105,59 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask)
 	return FALSE;
 }
 
+void LLScriptEdCore::onBtnLoadFromFile( void* data )
+{
+
+	LLScriptEdCore* self = (LLScriptEdCore*) data;
+	
+	LLFilePicker& file_picker = LLFilePicker::instance();
+	if( !file_picker.getOpenFile( LLFilePicker::FFLOAD_SCRIPT ) )
+	{
+		return;
+	}
+
+	std::string filename = file_picker.getFirstFile();
+
+	std::ifstream fin(filename.c_str());
+
+	std::string line;
+	std::string linetotal;
+	self->mEditor->clear();
+	while (!fin.eof())
+	{ 
+		getline(fin,line);
+		line=line+"\n";
+		self->mEditor->insertText(line);
+
+	}
+	fin.close();
+}
+
+void LLScriptEdCore::onBtnSaveToFile( void* userdata )
+{
+
+	LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+
+	LLScriptEdCore* self = (LLScriptEdCore*) userdata;
+
+	if( self->mSaveCallback )
+	{
+		LLFilePicker& file_picker = LLFilePicker::instance();
+		if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) )
+		{
+			return;
+		}
+
+		std::string filename = file_picker.getFirstFile();
+		std::string scriptText=self->mEditor->getText();
+		std::ofstream fout(filename.c_str());
+		fout<<(scriptText);
+		fout.close();
+		self->mSaveCallback( self->mUserdata, FALSE );
+	}
+}
+
+
 /// ---------------------------------------------------------------------------
 /// LLScriptEdContainer
 /// ---------------------------------------------------------------------------
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index f86be615c44..f50e9322b06 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -98,6 +98,8 @@ class LLScriptEdCore : public LLPanel
 	static void		onClickForward(void* userdata);
 	static void		onBtnInsertSample(void*);
 	static void		onBtnInsertFunction(LLUICtrl*, void*);
+	static void		onBtnLoadFromFile(void*);
+	static void		onBtnSaveToFile(void*);
 
 	virtual bool	hasAccelerators() const { return true; }
 
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 273bf822bcf..56c79f5b9f4 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -292,9 +292,10 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterUIPreviewUtil::registerFloater();
 	LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload");
 	LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload");
-	LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload");
 	LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload");
 	LLFloaterReg::add("upload_model_wizard", "floater_model_wizard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelWizard>);
+	LLFloaterReg::add("upload_script", "floater_script_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptPreview>, "upload");
+	LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload");
 
 	LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>);
 	LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceEffect>);
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 7e830e14bf2..f23d0f6b72e 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -87,6 +87,14 @@ class LLFileEnableUpload : public view_listener_t
 	}
 };
 
+class LLFileEnableUploadScript : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		return true;
+	}
+};
+
 class LLFileEnableUploadModel : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
@@ -391,6 +399,20 @@ class LLFileUploadAnim : public view_listener_t
 	}
 };
 
+class LLFileUploadScript : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_SCRIPT);
+		if (!filename.empty())
+		{
+			LLFloaterReg::showInstance("upload_script", LLSD(filename));
+		}
+
+		return true;
+	}
+};
+
 class LLFileUploadBulk : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 263d961be1f..b9605e1edec 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1101,7 +1101,20 @@
             <menu_item_call.on_visible
             function="File.VisibleUploadModel"/>
             </menu_item_call>
-	   <menu_item_call
+          <menu_item_call
+           label="Script (L$ 0)..."
+           layout="topleft"
+           name="Upload Script">
+            <menu_item_call.on_click
+             function="File.UploadScript"
+             parameter="" />
+            <menu_item_call.on_enable
+             function="File.EnableUploadScript" />
+            <!--menu_item_call.on_visible
+             function="Upload.CalculateCosts"
+             parameter="Upload Script" /-->
+          </menu_item_call>
+          <menu_item_call
              label="Bulk (L$[COST] per file)..."
              layout="topleft"
              name="Bulk Upload">
diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml
index 8d420243864..f6a8af09735 100644
--- a/indra/newview/skins/default/xui/en/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml
@@ -54,12 +54,22 @@
              label="Save"
              layout="topleft"
              name="Save" />
-            <menu_item_separator
-             layout="topleft" />
-            <menu_item_call
-             label="Revert All Changes"
-             layout="topleft"
-             name="Revert All Changes" />
+          <menu_item_separator
+           layout="topleft" />
+          <menu_item_call
+           label="Revert All Changes"
+           layout="topleft"
+           name="Revert All Changes" />
+          <menu_item_separator
+           layout="topleft" />
+          <menu_item_call
+           label="Load from file..."
+           layout="topleft"
+           name="LoadFromFile" />
+          <menu_item_call
+           label="Save to file..."
+           layout="topleft"
+           name="SaveToFile" />
         </menu>
         <menu
          top="0"
-- 
GitLab


From 28344855dc4c4b20f4188e7dd64991707d87377f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 17 Nov 2011 19:48:39 -0800
Subject: [PATCH 245/933] EXP-1498 : Always create the folder widget, move
 empty filtering to foltering code. Still update issues though.

---
 indra/newview/llinventoryfilter.cpp | 13 ++++++++-
 indra/newview/llinventorypanel.cpp  | 41 ++++++++---------------------
 2 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 516b47e616d..438081c177e 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -36,6 +36,7 @@
 #include "llviewercontrol.h"
 #include "llfolderview.h"
 #include "llinventorybridge.h"
+#include "llviewerfoldertype.h"
 
 // linden library includes
 #include "lltrans.h"
@@ -117,7 +118,17 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
 
 	const LLFolderViewEventListener* listener = folder->getListener();
 	const LLUUID folder_id = listener->getUUID();
-
+	
+	const LLInvFVBridge *bridge = dynamic_cast<const LLInvFVBridge *>(folder->getListener());
+	bool is_system_folder = bridge->isSystemFolder();
+	bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
+	bool is_empty = (gInventory.categoryHasChildren(folder_id) != LLInventoryModel::CHILDREN_YES);
+	
+	if (is_system_folder && is_empty && is_hidden_if_empty)
+	{
+		return false;
+	}
+		
 	if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
 	{
 		// Can only filter categories for items in your inventory
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index aff48b19610..a9ec4af4f30 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -618,41 +618,22 @@ LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool u
 
 LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
 {
-	// Create the folder ui widget, unless it's an empty system folder that should be hidden
-	// Note : we still let the code create a listener for it (in case something shows up in it)
-	// but we simply skip creating the ui ctrl and adding it.
-	// *TODO : Need to be verified: if the listener is triggered and something added, will the code
-	// crash (because it's assuming, wrongly, that the uictrl exists)?
-
-	bool is_system_folder = bridge->isSystemFolder();
-	bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(bridge->getPreferredType());
-	bool is_empty = (mInventory->categoryHasChildren(bridge->getUUID()) != LLInventoryModel::CHILDREN_YES);
-	
-	if (!is_system_folder || !is_empty || !is_hidden_if_empty)
-	{
-		LLFolderViewFolder::Params params;
+	LLFolderViewFolder::Params params;
 
-		params.name = bridge->getDisplayName();
-		params.icon = bridge->getIcon();
-		params.icon_open = bridge->getOpenIcon();
-
-		if (mShowItemLinkOverlays) // if false, then links show up just like normal items
-		{
-			params.icon_overlay = LLUI::getUIImage("Inv_Link");
-		}
-	
-		params.root = mFolderRoot;
-		params.listener = bridge;
-		params.tool_tip = params.name;
+	params.name = bridge->getDisplayName();
+	params.icon = bridge->getIcon();
+	params.icon_open = bridge->getOpenIcon();
 
-		return LLUICtrlFactory::create<LLFolderViewFolder>(params);
-	}
-	else 
+	if (mShowItemLinkOverlays) // if false, then links show up just like normal items
 	{
-		// It's an empty system folder that should be hidden -> return NULL
-		return NULL;
+		params.icon_overlay = LLUI::getUIImage("Inv_Link");
 	}
+	
+	params.root = mFolderRoot;
+	params.listener = bridge;
+	params.tool_tip = params.name;
 
+	return LLUICtrlFactory::create<LLFolderViewFolder>(params);
 }
 
 LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
-- 
GitLab


From ed596077c4eb5b1ba6be4a71824ef220c086d436 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 18 Nov 2011 09:47:55 -0500
Subject: [PATCH 246/933] STORM-591 Removed commented out debugging lines

---
 indra/newview/llvieweraudio.cpp | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 10ba54356c6..0262da4dee4 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -65,12 +65,6 @@ void LLViewerAudio::registerIdleListener()
 
 void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 {
-/*	llinfos << "DBG streamURI: " << streamURI << llendl;
-	llinfos << "DBG mNextStreamURI: " << mNextStreamURI << llendl;
-	if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
-	if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;}
-	if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;}
-*/
 	// Old and new stream are identical
 	if (mNextStreamURI == streamURI)
 	{
@@ -86,14 +80,11 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 		if (!gAudiop->getInternetStreamURL().empty())
 		{
 			mFadeState = FADE_OUT;
-//llinfos << "DBG new mFadeState: OUT" << llendl;
 		}
 		// Otherwise the new stream can be faded in
 		else
 		{
 			mFadeState = FADE_IN;
-//llinfos << "DBG new mFadeState: IN" << llendl;
-
 			gAudiop->startInternetStream(mNextStreamURI);
 			startFading();
 			registerIdleListener();
@@ -123,10 +114,6 @@ bool LLViewerAudio::onIdleUpdate()
 {
 	if (mDone)
 	{
-/*		if (mFadeState == FADE_OUT) {llinfos << "DBG mFadeState: FADE_OUT " << llendl;}
-		if (mFadeState == FADE_IN) {llinfos << "DBG mFadeState: FADE_IN " << llendl;}
-		if (mFadeState == FADE_IDLE) {llinfos << "DBG mFadeState: FADE_IDLE " << llendl;}
-*/
 		//  This should be a rare or never occurring state.
 		if (mFadeState == FADE_IDLE)
 		{
@@ -144,7 +131,6 @@ bool LLViewerAudio::onIdleUpdate()
 			if (!mNextStreamURI.empty())
 			{
 				mFadeState = FADE_IN;
-//llinfos << "DBG new mFadeState: IN" << llendl;
 				gAudiop->startInternetStream(mNextStreamURI);
 				startFading();
 				return false;
@@ -152,7 +138,6 @@ bool LLViewerAudio::onIdleUpdate()
 			else
 			{
 				mFadeState = FADE_IDLE;
-//llinfos << "DBG new mFadeState: IDLE" << llendl;
 				deregisterIdleListener();
 				return true; // Stop calling onIdleUpdate
 			}
@@ -164,12 +149,10 @@ bool LLViewerAudio::onIdleUpdate()
 				mFadeState = FADE_OUT;
 				startFading();
 				return false;
-//llinfos << "DBG new mFadeState: OUT" << llendl;
 			}
 			else
 			{
 				mFadeState = FADE_IDLE;
-//llinfos << "DBG new mFadeState: IDLE" << llendl;
 				deregisterIdleListener();
 				return true; // Stop calling onIdleUpdate
 			}
@@ -181,12 +164,9 @@ bool LLViewerAudio::onIdleUpdate()
 
 void LLViewerAudio::stopInternetStreamWithAutoFade()
 {
-//llinfos << "DBG stopping stream" << llendl;
 	mFadeState = FADE_IDLE;
-//llinfos << "DBG new mFadeState: IDLE" << llendl;
 	mNextStreamURI = LLStringUtil::null;
 	mDone = true;
-//llinfos << "DBG mDone: true" << llendl;
 
 	gAudiop->startInternetStream(LLStringUtil::null);
 	gAudiop->stopInternetStream();
@@ -194,8 +174,6 @@ void LLViewerAudio::stopInternetStreamWithAutoFade()
 
 void LLViewerAudio::startFading()
 {
-//llinfos << "DBG startFading" << llendl;
-
 	if(mDone)
 	{
 		// The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not,
@@ -208,7 +186,6 @@ void LLViewerAudio::startFading()
 		stream_fade_timer.reset();
 		stream_fade_timer.setTimerExpirySec(mFadeTime);
 		mDone = false;
-//llinfos << "DBG mDone: false" << llendl;
 	}
 }
 
@@ -349,7 +326,6 @@ void audio_update_volume(bool force_update)
 		F32 music_volume = gSavedSettings.getF32("AudioLevelMusic");
 		BOOL music_muted = gSavedSettings.getBOOL("MuteMusic");
 		F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume();
-//llinfos << "DBG fade_volume:" << fade_volume << llendl;
 
 		music_volume = mute_volume * master_volume * music_volume * fade_volume;
 		gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume);
-- 
GitLab


From f78dcdf2c4c3ccc7864d5487e748ec7a4e1740fb Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 18 Nov 2011 19:00:48 +0200
Subject: [PATCH 247/933] EXP-1582 FIXED (Add "Snapshots" button to 2nd tier
 default toolbar)

- Added "Snapshots" button to 2nd tier default toolbar
---
 indra/newview/app_settings/toolbars.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index f2192a75ad4..30be6974360 100644
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -14,6 +14,7 @@
   <left_toolbar
     button_display_mode="icons_only">
     <command name="avatar"/>
+    <command name="snapshot"/>
     <command name="appearance"/>
     <command name="inventory"/>
     <command name="search"/>
-- 
GitLab


From df7f4f60b60e7d53060e4d8e3d0ca03bf74bf24e Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 18 Nov 2011 19:32:58 +0200
Subject: [PATCH 248/933] EXP-1576 FIXED (Remove old profile window from People
 panel)

- Removed old profile window from People panel with all subpanels and dependencies
---
 indra/newview/CMakeLists.txt                  |   2 -
 indra/newview/llpanelavatar.cpp               | 709 ------------------
 indra/newview/llpanelavatar.h                 | 191 +----
 indra/newview/llpanelme.cpp                   | 285 -------
 indra/newview/llpanelme.h                     |  64 +-
 indra/newview/llpanelprofile.cpp              |   2 -
 indra/newview/llpanelprofileview.cpp          | 247 ------
 indra/newview/llpanelprofileview.h            | 108 ---
 .../skins/default/xui/da/panel_my_profile.xml |  31 -
 .../skins/default/xui/da/panel_notes.xml      |  35 -
 .../skins/default/xui/da/panel_profile.xml    |  59 --
 .../default/xui/da/panel_profile_view.xml     |  20 -
 .../skins/default/xui/de/panel_my_profile.xml |  42 --
 .../skins/default/xui/de/panel_notes.xml      |  35 -
 .../skins/default/xui/de/panel_profile.xml    |  74 --
 .../default/xui/de/panel_profile_view.xml     |  20 -
 .../skins/default/xui/en/floater_people.xml   |   4 -
 .../skins/default/xui/en/panel_my_profile.xml | 146 ----
 .../skins/default/xui/en/panel_notes.xml      | 236 ------
 .../skins/default/xui/en/panel_profile.xml    | 458 -----------
 .../default/xui/en/panel_profile_view.xml     | 162 ----
 .../skins/default/xui/es/panel_my_profile.xml |  31 -
 .../skins/default/xui/es/panel_notes.xml      |  35 -
 .../skins/default/xui/es/panel_profile.xml    |  70 --
 .../default/xui/es/panel_profile_view.xml     |  20 -
 .../skins/default/xui/fr/panel_my_profile.xml |  42 --
 .../skins/default/xui/fr/panel_notes.xml      |  35 -
 .../skins/default/xui/fr/panel_profile.xml    |  74 --
 .../default/xui/fr/panel_profile_view.xml     |  20 -
 .../skins/default/xui/it/panel_my_profile.xml |  31 -
 .../skins/default/xui/it/panel_notes.xml      |  35 -
 .../skins/default/xui/it/panel_profile.xml    |  70 --
 .../default/xui/it/panel_profile_view.xml     |  22 -
 .../skins/default/xui/ja/panel_my_profile.xml |  42 --
 .../skins/default/xui/ja/panel_notes.xml      |  35 -
 .../skins/default/xui/ja/panel_profile.xml    |  74 --
 .../default/xui/ja/panel_profile_view.xml     |  22 -
 .../skins/default/xui/pl/panel_my_profile.xml |  31 -
 .../skins/default/xui/pl/panel_notes.xml      |  35 -
 .../skins/default/xui/pl/panel_profile.xml    |  59 --
 .../default/xui/pl/panel_profile_view.xml     |  20 -
 .../skins/default/xui/pt/panel_my_profile.xml |  31 -
 .../skins/default/xui/pt/panel_notes.xml      |  35 -
 .../skins/default/xui/pt/panel_profile.xml    |  70 --
 .../default/xui/pt/panel_profile_view.xml     |  20 -
 .../skins/default/xui/ru/panel_my_profile.xml |  42 --
 .../skins/default/xui/ru/panel_notes.xml      |  35 -
 .../skins/default/xui/ru/panel_profile.xml    |  67 --
 .../default/xui/ru/panel_profile_view.xml     |  20 -
 .../skins/default/xui/tr/panel_my_profile.xml |  42 --
 .../skins/default/xui/tr/panel_notes.xml      |  35 -
 .../skins/default/xui/tr/panel_profile.xml    |  67 --
 .../default/xui/tr/panel_profile_view.xml     |  20 -
 .../skins/default/xui/zh/panel_my_profile.xml |  42 --
 .../skins/default/xui/zh/panel_notes.xml      |  35 -
 .../skins/default/xui/zh/panel_profile.xml    |  67 --
 .../default/xui/zh/panel_profile_view.xml     |  20 -
 57 files changed, 3 insertions(+), 4378 deletions(-)
 delete mode 100644 indra/newview/llpanelprofileview.cpp
 delete mode 100644 indra/newview/llpanelprofileview.h
 delete mode 100644 indra/newview/skins/default/xui/da/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/da/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/da/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/da/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_profile_view.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index ba05f6288bf..4760670573e 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -393,7 +393,6 @@ set(viewer_SOURCE_FILES
     llpanelplacestab.cpp
     llpanelprimmediacontrols.cpp
     llpanelprofile.cpp
-    llpanelprofileview.cpp
     llpanelsnapshot.cpp
     llpanelsnapshotinventory.cpp
     llpanelsnapshotlocal.cpp
@@ -960,7 +959,6 @@ set(viewer_HEADER_FILES
     llpanelplacestab.h
     llpanelprimmediacontrols.h
     llpanelprofile.h
-    llpanelprofileview.h
     llpanelsnapshot.h
     llpanelteleporthistory.h
     llpaneltiptoast.h
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 988e801b61a..679b1bdcda6 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -120,269 +120,6 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 
 static LLDefaultChildRegistry::Register<LLDropTarget> r("drop_target");
 
-static LLRegisterPanelClassWrapper<LLPanelAvatarProfile> t_panel_profile("panel_profile");
-static LLRegisterPanelClassWrapper<LLPanelMyProfile> t_panel_my_profile("panel_my_profile");
-static LLRegisterPanelClassWrapper<LLPanelAvatarNotes> t_panel_notes("panel_notes");
-
-//-----------------------------------------------------------------------------
-// LLPanelAvatarNotes()
-//-----------------------------------------------------------------------------
-LLPanelAvatarNotes::LLPanelAvatarNotes()
-: LLPanelProfileTab()
-{
-
-}
-
-void LLPanelAvatarNotes::updateData()
-{
-	LLAvatarPropertiesProcessor::getInstance()->
-		sendAvatarNotesRequest(getAvatarId());
-}
-
-BOOL LLPanelAvatarNotes::postBuild()
-{
-	childSetCommitCallback("status_check", boost::bind(&LLPanelAvatarNotes::onCommitRights, this), NULL);
-	childSetCommitCallback("map_check", boost::bind(&LLPanelAvatarNotes::onCommitRights, this), NULL);
-	childSetCommitCallback("objects_check", boost::bind(&LLPanelAvatarNotes::onCommitRights, this), NULL);
-
-	childSetCommitCallback("add_friend", boost::bind(&LLPanelAvatarNotes::onAddFriendButtonClick, this),NULL);
-	childSetCommitCallback("im", boost::bind(&LLPanelAvatarNotes::onIMButtonClick, this), NULL);
-	childSetCommitCallback("call", boost::bind(&LLPanelAvatarNotes::onCallButtonClick, this), NULL);
-	childSetCommitCallback("teleport", boost::bind(&LLPanelAvatarNotes::onTeleportButtonClick, this), NULL);
-	childSetCommitCallback("share", boost::bind(&LLPanelAvatarNotes::onShareButtonClick, this), NULL);
-	childSetCommitCallback("show_on_map_btn", (boost::bind(
-				&LLPanelAvatarNotes::onMapButtonClick, this)), NULL);
-
-	LLTextEditor* te = getChild<LLTextEditor>("notes_edit");
-	te->setCommitCallback(boost::bind(&LLPanelAvatarNotes::onCommitNotes,this));
-	te->setCommitOnFocusLost(TRUE);
-
-	resetControls();
-	resetData();
-
-	LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this);
-
-	return TRUE;
-}
-
-void LLPanelAvatarNotes::onOpen(const LLSD& key)
-{
-	LLPanelProfileTab::onOpen(key);
-
-	fillRightsData();
-
-	//Disable "Add Friend" button for friends.
-	getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId()));
-}
-
-void LLPanelAvatarNotes::fillRightsData()
-{
-	getChild<LLUICtrl>("status_check")->setValue(FALSE);
-	getChild<LLUICtrl>("map_check")->setValue(FALSE);
-	getChild<LLUICtrl>("objects_check")->setValue(FALSE);
-
-	const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
-	// If true - we are viewing friend's profile, enable check boxes and set values.
-	if(relation)
-	{
-		S32 rights = relation->getRightsGrantedTo();
-
-		getChild<LLUICtrl>("status_check")->setValue(LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE);
-		getChild<LLUICtrl>("map_check")->setValue(LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE);
-		getChild<LLUICtrl>("objects_check")->setValue(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE);
-
-	}
-
-	enableCheckboxes(NULL != relation);
-}
-
-void LLPanelAvatarNotes::onCommitNotes()
-{
-	std::string notes = getChild<LLUICtrl>("notes_edit")->getValue().asString();
-	LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes);
-}
-
-void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification,
-		const LLSD& response, S32 rights)
-{
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-	if (option == 0)
-	{
-		LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(
-				getAvatarId(), rights);
-	}
-	else
-	{
-		getChild<LLUICtrl>("objects_check")->setValue(
-				getChild<LLUICtrl>("objects_check")->getValue().asBoolean() ? FALSE : TRUE);
-	}
-}
-
-void LLPanelAvatarNotes::confirmModifyRights(bool grant, S32 rights)
-{
-	LLSD args;
-	args["NAME"] = LLSLURL("agent", getAvatarId(), "displayname").getSLURLString();
-
-	if (grant)
-	{
-		LLNotificationsUtil::add("GrantModifyRights", args, LLSD(),
-				boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this,
-						_1, _2, rights));
-	}
-	else
-	{
-		LLNotificationsUtil::add("RevokeModifyRights", args, LLSD(),
-				boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this,
-						_1, _2, rights));
-	}
-}
-
-void LLPanelAvatarNotes::onCommitRights()
-{
-	const LLRelationship* buddy_relationship =
-		LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
-
-	if (NULL == buddy_relationship)
-	{
-		// Lets have a warning log message instead of having a crash. EXT-4947.
-		llwarns << "Trying to modify rights for non-friend avatar. Skipped." << llendl;
-		return;
-	}
-
-
-	S32 rights = 0;
-
-	if(getChild<LLUICtrl>("status_check")->getValue().asBoolean())
-		rights |= LLRelationship::GRANT_ONLINE_STATUS;
-	if(getChild<LLUICtrl>("map_check")->getValue().asBoolean())
-		rights |= LLRelationship::GRANT_MAP_LOCATION;
-	if(getChild<LLUICtrl>("objects_check")->getValue().asBoolean())
-		rights |= LLRelationship::GRANT_MODIFY_OBJECTS;
-
-	bool allow_modify_objects = getChild<LLUICtrl>("objects_check")->getValue().asBoolean();
-
-	// if modify objects checkbox clicked
-	if (buddy_relationship->isRightGrantedTo(
-			LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects)
-	{
-		confirmModifyRights(allow_modify_objects, rights);
-	}
-	// only one checkbox can trigger commit, so store the rest of rights
-	else
-	{
-		LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(
-						getAvatarId(), rights);
-	}
-}
-
-void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type)
-{
-	if(APT_NOTES == type)
-	{
-		LLAvatarNotes* avatar_notes = static_cast<LLAvatarNotes*>(data);
-		if(avatar_notes && getAvatarId() == avatar_notes->target_id)
-		{
-			getChild<LLUICtrl>("notes_edit")->setValue(avatar_notes->notes);
-			getChildView("notes edit")->setEnabled(true);
-
-			LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
-		}
-	}
-}
-
-void LLPanelAvatarNotes::resetData()
-{
-	getChild<LLUICtrl>("notes_edit")->setValue(LLStringUtil::null);
-	// Default value is TRUE
-	getChild<LLUICtrl>("status_check")->setValue(TRUE);
-}
-
-void LLPanelAvatarNotes::resetControls()
-{
-	//Disable "Add Friend" button for friends.
-	getChildView("add_friend")->setEnabled(TRUE);
-
-	enableCheckboxes(false);
-}
-
-void LLPanelAvatarNotes::onAddFriendButtonClick()
-{
-	LLAvatarActions::requestFriendshipDialog(getAvatarId());
-}
-
-void LLPanelAvatarNotes::onIMButtonClick()
-{
-	LLAvatarActions::startIM(getAvatarId());
-}
-
-void LLPanelAvatarNotes::onTeleportButtonClick()
-{
-	LLAvatarActions::offerTeleport(getAvatarId());
-}
-
-void LLPanelAvatarNotes::onCallButtonClick()
-{
-	LLAvatarActions::startCall(getAvatarId());
-}
-
-void LLPanelAvatarNotes::onShareButtonClick()
-{
-	//*TODO not implemented.
-}
-
-void LLPanelAvatarNotes::enableCheckboxes(bool enable)
-{
-	getChildView("status_check")->setEnabled(enable);
-	getChildView("map_check")->setEnabled(enable);
-	getChildView("objects_check")->setEnabled(enable);
-}
-
-LLPanelAvatarNotes::~LLPanelAvatarNotes()
-{
-	if(getAvatarId().notNull())
-	{
-		LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
-	}
-
-	if(LLVoiceClient::instanceExists())
-	{
-		LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this);
-	}
-}
-
-// virtual, called by LLAvatarTracker
-void LLPanelAvatarNotes::changed(U32 mask)
-{
-	getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId()));
-
-	// update rights to avoid have checkboxes enabled when friendship is terminated. EXT-4947.
-	fillRightsData();
-}
-
-// virtual
-void LLPanelAvatarNotes::onChange(EStatusType status, const std::string &channelURI, bool proximal)
-{
-	if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL)
-	{
-		return;
-	}
-
-	getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking());
-}
-
-void LLPanelAvatarNotes::setAvatarId(const LLUUID& id)
-{
-	if(id.notNull())
-	{
-		if(getAvatarId().notNull())
-		{
-			LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
-		}
-		LLPanelProfileTab::setAvatarId(id);
-		LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this);
-	}
-}
-
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -461,449 +198,3 @@ void LLPanelProfileTab::updateButtons()
 		|| gAgent.isGodlike();
 	getChildView("show_on_map_btn")->setEnabled(enable_map_btn);
 }
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-bool enable_god()
-{
-	return gAgent.isGodlike();
-}
-
-LLPanelAvatarProfile::LLPanelAvatarProfile()
-: LLPanelProfileTab()
-{
-}
-
-BOOL LLPanelAvatarProfile::postBuild()
-{
-	childSetCommitCallback("see_profile_btn",(boost::bind(&LLPanelAvatarProfile::onSeeProfileBtnClick,this)),NULL);
-	childSetCommitCallback("add_friend",(boost::bind(&LLPanelAvatarProfile::onAddFriendButtonClick,this)),NULL);
-	childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL);
-	childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL);
-	childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL);
-	childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL);
-	childSetCommitCallback("show_on_map_btn", (boost::bind(
-			&LLPanelAvatarProfile::onMapButtonClick, this)), NULL);
-
-	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
-	registrar.add("Profile.ShowOnMap",  boost::bind(&LLPanelAvatarProfile::onMapButtonClick, this));
-	registrar.add("Profile.Pay",  boost::bind(&LLPanelAvatarProfile::pay, this));
-	registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this));
-	registrar.add("Profile.BlockUnblock", boost::bind(&LLPanelAvatarProfile::toggleBlock, this));
-	registrar.add("Profile.Kick", boost::bind(&LLPanelAvatarProfile::kick, this));
-	registrar.add("Profile.Freeze", boost::bind(&LLPanelAvatarProfile::freeze, this));
-	registrar.add("Profile.Unfreeze", boost::bind(&LLPanelAvatarProfile::unfreeze, this));
-	registrar.add("Profile.CSR", boost::bind(&LLPanelAvatarProfile::csr, this));
-
-	LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
-	enable.add("Profile.EnableShowOnMap", boost::bind(&LLPanelAvatarProfile::enableShowOnMap, this));
-	enable.add("Profile.EnableGod", boost::bind(&enable_god));
-	enable.add("Profile.EnableBlock", boost::bind(&LLPanelAvatarProfile::enableBlock, this));
-	enable.add("Profile.EnableUnblock", boost::bind(&LLPanelAvatarProfile::enableUnblock, this));
-
-	LLToggleableMenu* profile_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
-	getChild<LLMenuButton>("overflow_btn")->setMenu(profile_menu, LLMenuButton::MP_TOP_RIGHT);
-
-	LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this);
-
-	resetControls();
-	resetData();
-
-	return TRUE;
-}
-
-void LLPanelAvatarProfile::onOpen(const LLSD& key)
-{
-	LLPanelProfileTab::onOpen(key);
-
-	mGroups.clear();
-
-	//Disable "Add Friend" button for friends.
-	getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId()));
-}
-
-void LLPanelAvatarProfile::updateData()
-{
-	if (getAvatarId().notNull())
-	{
-		LLAvatarPropertiesProcessor::getInstance()->
-			sendAvatarPropertiesRequest(getAvatarId());
-		LLAvatarPropertiesProcessor::getInstance()->
-			sendAvatarGroupsRequest(getAvatarId());
-	}
-}
-
-void LLPanelAvatarProfile::resetControls()
-{
-	getChildView("status_panel")->setVisible( true);
-	getChildView("profile_buttons_panel")->setVisible( true);
-	getChildView("title_groups_text")->setVisible( true);
-	getChildView("sl_groups")->setVisible( true);
-	getChildView("add_friend")->setEnabled(true);
-
-	getChildView("status_me_panel")->setVisible( false);
-	getChildView("profile_me_buttons_panel")->setVisible( false);
-	getChildView("account_actions_panel")->setVisible( false);
-}
-
-void LLPanelAvatarProfile::resetData()
-{
-	mGroups.clear();
-	getChild<LLUICtrl>("2nd_life_pic")->setValue(LLUUID::null);
-	getChild<LLUICtrl>("real_world_pic")->setValue(LLUUID::null);
-	getChild<LLUICtrl>("online_status")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("status_message")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("sl_description_edit")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("fl_description_edit")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("sl_groups")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("homepage_edit")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("register_date")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("acc_status_text")->setValue(LLStringUtil::null);
-	getChild<LLUICtrl>("partner_text")->setValue(LLStringUtil::null);
-}
-
-void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType type)
-{
-	if(APT_PROPERTIES == type)
-	{
-		const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
-		if(avatar_data && getAvatarId() == avatar_data->avatar_id)
-		{
-			processProfileProperties(avatar_data);
-		}
-	}
-	else if(APT_GROUPS == type)
-	{
-		LLAvatarGroups* avatar_groups = static_cast<LLAvatarGroups*>(data);
-		if(avatar_groups && getAvatarId() == avatar_groups->avatar_id)
-		{
-			processGroupProperties(avatar_groups);
-		}
-	}
-}
-
-void LLPanelAvatarProfile::processProfileProperties(const LLAvatarData* avatar_data)
-{
-	fillCommonData(avatar_data);
-
-	fillPartnerData(avatar_data);
-
-	fillAccountStatus(avatar_data);
-}
-
-void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_groups)
-{
-	// *NOTE dzaporozhan
-	// Group properties may arrive in two callbacks, we need to save them across
-	// different calls. We can't do that in textbox as textbox may change the text.
-
-	LLAvatarGroups::group_list_t::const_iterator it = avatar_groups->group_list.begin();
-	const LLAvatarGroups::group_list_t::const_iterator it_end = avatar_groups->group_list.end();
-
-	for(; it_end != it; ++it)
-	{
-		LLAvatarGroups::LLGroupData group_data = *it;
-		mGroups[group_data.group_name] = group_data.group_id;
-	}
-
-	// Creating string, containing group list
-	std::string groups = "";
-	for (group_map_t::iterator it = mGroups.begin(); it != mGroups.end(); ++it)
-	{
-		if (it != mGroups.begin())
-			groups += ", ";
-
-		std::string group_name = LLURI::escape(it->first);
-		std::string group_url= it->second.notNull()
-				? "[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]"
-						: getString("no_group_text");
-
-		groups += group_url;
-	}
-
-	getChild<LLUICtrl>("sl_groups")->setValue(groups);
-}
-
-static void got_full_name_callback( LLHandle<LLPanel> profile_panel_handle, const std::string& full_name )
-{
-	if (profile_panel_handle.isDead() ) return;
-
-	LLPanelAvatarProfile* profile_panel = dynamic_cast<LLPanelAvatarProfile*>(profile_panel_handle.get());
-	if ( ! profile_panel ) return;
-
-	LLStringUtil::format_map_t args;
-
-	std::string name;
-	if (LLAvatarNameCache::useDisplayNames())
-	{
-		name = LLCacheName::buildUsername(full_name);
-	}
-	else
-	{
-		name = full_name;
-	}
-
-	args["[NAME]"] = name;
-
-	std::string linden_name = profile_panel->getString("name_text_args", args);
-	profile_panel->getChild<LLUICtrl>("name_descr_text")->setValue(linden_name);
-}
-
-void LLPanelAvatarProfile::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
-{
-	LLStringUtil::format_map_t args;
-	args["[DISPLAY_NAME]"] = av_name.mDisplayName;
-
-	std::string display_name = getString("display_name_text_args", args);
-	getChild<LLUICtrl>("display_name_descr_text")->setValue(display_name);
-}
-
-void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data)
-{
-	//remove avatar id from cache to get fresh info
-	LLAvatarIconIDCache::getInstance()->remove(avatar_data->avatar_id);
-
-	LLStringUtil::format_map_t args;
-	{
-		std::string birth_date = LLTrans::getString("AvatarBirthDateFormat");
-		LLStringUtil::format(birth_date, LLSD().with("datetime", (S32) avatar_data->born_on.secondsSinceEpoch()));
-		args["[REG_DATE]"] = birth_date;
-	}
-
-	// ask (asynchronously) for the avatar name
-	LLHandle<LLPanel> profile_panel_handle = getHandle();
-	std::string full_name;
-	if (gCacheName->getFullName(avatar_data->agent_id, full_name))
-	{
-		// name in cache, call callback directly
-		got_full_name_callback( profile_panel_handle, full_name );
-	}
-	else
-	{
-		// not in cache, lookup name 
-		gCacheName->get(avatar_data->agent_id, false, boost::bind( got_full_name_callback, profile_panel_handle, _2 ));
-	}
-
-	// get display name
-	LLAvatarNameCache::get(avatar_data->avatar_id,
-		boost::bind(&LLPanelAvatarProfile::onNameCache, this, _1, _2));
-
-	args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now());
-	std::string register_date = getString("RegisterDateFormat", args);
-	getChild<LLUICtrl>("register_date")->setValue(register_date );
-	getChild<LLUICtrl>("sl_description_edit")->setValue(avatar_data->about_text);
-	getChild<LLUICtrl>("fl_description_edit")->setValue(avatar_data->fl_about_text);
-	getChild<LLUICtrl>("2nd_life_pic")->setValue(avatar_data->image_id);
-	getChild<LLUICtrl>("real_world_pic")->setValue(avatar_data->fl_image_id);
-	getChild<LLUICtrl>("homepage_edit")->setValue(avatar_data->profile_url);
-
-	// Hide home page textbox if no page was set to fix "homepage URL appears clickable without URL - EXT-4734"
-	getChildView("homepage_edit")->setVisible( !avatar_data->profile_url.empty());
-}
-
-void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data)
-{
-	LLTextBox* partner_text = getChild<LLTextBox>("partner_text");
-	if (avatar_data->partner_id.notNull())
-	{
-		partner_text->setText(LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString());
-	}
-	else
-	{
-		partner_text->setText(getString("no_partner_text"));
-	}
-}
-
-void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data)
-{
-	LLStringUtil::format_map_t args;
-	args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(avatar_data);
-	args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(avatar_data);
-	// *NOTE: AVATAR_AGEVERIFIED not currently getting set in 
-	// dataserver/lldataavatar.cpp for privacy considerations
-	args["[AGEVERIFICATION]"] = "";
-	std::string caption_text = getString("CaptionTextAcctInfo", args);
-	getChild<LLUICtrl>("acc_status_text")->setValue(caption_text);
-}
-
-void LLPanelAvatarProfile::pay()
-{
-	LLAvatarActions::pay(getAvatarId());
-}
-
-void LLPanelAvatarProfile::share()
-{
-	LLAvatarActions::share(getAvatarId());
-}
-
-void LLPanelAvatarProfile::toggleBlock()
-{
-	LLAvatarActions::toggleBlock(getAvatarId());
-}
-
-bool LLPanelAvatarProfile::enableShowOnMap()
-{
-	bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId());
-
-	bool enable_map_btn = (is_buddy_online && is_agent_mappable(getAvatarId()))
-		|| gAgent.isGodlike();
-	return enable_map_btn;
-}
-
-bool LLPanelAvatarProfile::enableBlock()
-{
-	return LLAvatarActions::canBlock(getAvatarId()) && !LLAvatarActions::isBlocked(getAvatarId());
-}
-
-bool LLPanelAvatarProfile::enableUnblock()
-{
-	return LLAvatarActions::isBlocked(getAvatarId());
-}
-
-void LLPanelAvatarProfile::kick()
-{
-	LLAvatarActions::kick(getAvatarId());
-}
-
-void LLPanelAvatarProfile::freeze()
-{
-	LLAvatarActions::freeze(getAvatarId());
-}
-
-void LLPanelAvatarProfile::unfreeze()
-{
-	LLAvatarActions::unfreeze(getAvatarId());
-}
-
-void LLPanelAvatarProfile::csr()
-{
-	std::string name;
-	gCacheName->getFullName(getAvatarId(), name);
-	LLAvatarActions::csr(getAvatarId(), name);
-}
-
-void LLPanelAvatarProfile::onAddFriendButtonClick()
-{
-	LLAvatarActions::requestFriendshipDialog(getAvatarId());
-}
-
-void LLPanelAvatarProfile::onSeeProfileBtnClick()
-{
-	LLAvatarActions::showProfile(getAvatarId());
-}
-
-void LLPanelAvatarProfile::onIMButtonClick()
-{
-	LLAvatarActions::startIM(getAvatarId());
-}
-
-void LLPanelAvatarProfile::onTeleportButtonClick()
-{
-	LLAvatarActions::offerTeleport(getAvatarId());
-}
-
-void LLPanelAvatarProfile::onCallButtonClick()
-{
-	LLAvatarActions::startCall(getAvatarId());
-}
-
-void LLPanelAvatarProfile::onShareButtonClick()
-{
-	//*TODO not implemented
-}
-
-LLPanelAvatarProfile::~LLPanelAvatarProfile()
-{
-	if(getAvatarId().notNull())
-	{
-		LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
-	}
-
-	if(LLVoiceClient::instanceExists())
-	{
-		LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this);
-	}
-}
-
-// virtual, called by LLAvatarTracker
-void LLPanelAvatarProfile::changed(U32 mask)
-{
-	getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId()));
-}
-
-// virtual
-void LLPanelAvatarProfile::onChange(EStatusType status, const std::string &channelURI, bool proximal)
-{
-	if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL)
-	{
-		return;
-	}
-
-	getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking());
-}
-
-void LLPanelAvatarProfile::setAvatarId(const LLUUID& id)
-{
-	if(id.notNull())
-	{
-		if(getAvatarId().notNull())
-		{
-			LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
-		}
-		LLPanelProfileTab::setAvatarId(id);
-		LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this);
-	}
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-LLPanelMyProfile::LLPanelMyProfile()
-: LLPanelAvatarProfile()
-{
-}
-
-BOOL LLPanelMyProfile::postBuild()
-{
-	LLPanelAvatarProfile::postBuild();
-
-	childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelMyProfile::onStatusMessageChanged, this), NULL);
-
-	resetControls();
-	resetData();
-
-	return TRUE;
-}
-
-void LLPanelMyProfile::onOpen(const LLSD& key)
-{
-	LLPanelProfileTab::onOpen(key);
-}
-
-void LLPanelMyProfile::processProfileProperties(const LLAvatarData* avatar_data)
-{
-	fillCommonData(avatar_data);
-
-	fillPartnerData(avatar_data);
-
-	fillAccountStatus(avatar_data);
-}
-
-void LLPanelMyProfile::resetControls()
-{
-	getChildView("status_panel")->setVisible( false);
-	getChildView("profile_buttons_panel")->setVisible( false);
-	getChildView("title_groups_text")->setVisible( false);
-	getChildView("sl_groups")->setVisible( false);
-	getChildView("status_me_panel")->setVisible( true);
-	getChildView("profile_me_buttons_panel")->setVisible( true);
-}
-
-
-void LLPanelMyProfile::onStatusMessageChanged()
-{
-	updateData();
-}
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index e95441cd581..e33a850cfa4 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -36,14 +36,8 @@
 class LLComboBox;
 class LLLineEditor;
 
-enum EOnlineStatus
-{
-	ONLINE_STATUS_NO      = 0,
-	ONLINE_STATUS_YES     = 1
-};
-
 /**
-* Base class for any Profile View or My Profile Panel.
+* Base class for any Profile View.
 */
 class LLPanelProfileTab
 	: public LLPanel
@@ -111,187 +105,4 @@ class LLPanelProfileTab
 	LLUUID mAvatarId;
 };
 
-/**
-* Panel for displaying Avatar's first and second life related info.
-*/
-class LLPanelAvatarProfile
-	: public LLPanelProfileTab
-	, public LLFriendObserver
-	, public LLVoiceClientStatusObserver
-{
-public:
-	LLPanelAvatarProfile();
-	/*virtual*/ ~LLPanelAvatarProfile();
-
-	/*virtual*/ void onOpen(const LLSD& key);
-
-	/**
-	 * LLFriendObserver trigger
-	 */
-	virtual void changed(U32 mask);
-
-	// Implements LLVoiceClientStatusObserver::onChange() to enable the call
-	// button when voice is available
-	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
-
-	/*virtual*/ void setAvatarId(const LLUUID& id);
-
-	/**
-	 * Processes data received from server.
-	 */
-	/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
-	/*virtual*/ BOOL postBuild();
-
-	/*virtual*/ void updateData();
-
-	/*virtual*/ void resetControls();
-
-	/*virtual*/ void resetData();
-
-protected:
-
-	/**
-	 * Process profile related data received from server.
-	 */
-	virtual void processProfileProperties(const LLAvatarData* avatar_data);
-
-	/**
-	 * Processes group related data received from server.
-	 */
-	virtual void processGroupProperties(const LLAvatarGroups* avatar_groups);
-
-	/**
-	 * Fills common for Avatar profile and My Profile fields.
-	 */
-	virtual void fillCommonData(const LLAvatarData* avatar_data);
-
-	/**
-	 * Fills partner data.
-	 */
-	virtual void fillPartnerData(const LLAvatarData* avatar_data);
-
-	/**
-	 * Fills account status.
-	 */
-	virtual void fillAccountStatus(const LLAvatarData* avatar_data);
-
-	/**
-	 * Opens "Pay Resident" dialog.
-	 */
-	void pay();
-
-	/**
-	 * opens inventory and IM for sharing items
-	 */
-	void share();
-
-	/**
-	 * Add/remove resident to/from your block list.
-	 */
-	void toggleBlock();
-
-	void kick();
-	void freeze();
-	void unfreeze();
-	void csr();
-	
-	bool enableShowOnMap();
-	bool enableBlock();
-	bool enableUnblock();
-	bool enableGod();
-
-	void onSeeProfileBtnClick();
-	void onAddFriendButtonClick();
-	void onIMButtonClick();
-	void onCallButtonClick();
-	void onTeleportButtonClick();
-	void onShareButtonClick();
-
-private:
-	void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
-	typedef std::map< std::string,LLUUID>	group_map_t;
-	group_map_t 			mGroups;
-};
-
-/**
- * Panel for displaying own first and second life related info.
- */
-class LLPanelMyProfile
-	: public LLPanelAvatarProfile
-{
-public:
-	LLPanelMyProfile();
-
-	/*virtual*/ BOOL postBuild();
-
-protected:
-
-	/*virtual*/ void onOpen(const LLSD& key);
-
-	/*virtual*/ void processProfileProperties(const LLAvatarData* avatar_data);
-
-	/*virtual*/ void resetControls();
-
-protected:
-	void onStatusMessageChanged();
-};
-
-/**
- * Panel for displaying Avatar's notes and modifying friend's rights.
- */
-class LLPanelAvatarNotes 
-	: public LLPanelProfileTab
-	, public LLFriendObserver
-	, public LLVoiceClientStatusObserver
-{
-public:
-	LLPanelAvatarNotes();
-	/*virtual*/ ~LLPanelAvatarNotes();
-
-	virtual void setAvatarId(const LLUUID& id);
-
-	/** 
-	 * LLFriendObserver trigger
-	 */
-	virtual void changed(U32 mask);
-
-	// Implements LLVoiceClientStatusObserver::onChange() to enable the call
-	// button when voice is available
-	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
-
-	/*virtual*/ void onOpen(const LLSD& key);
-
-	/*virtual*/ BOOL postBuild();
-
-	/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
-	/*virtual*/ void updateData();
-
-protected:
-
-	/*virtual*/ void resetControls();
-
-	/*virtual*/ void resetData();
-
-	/**
-	 * Fills rights data for friends.
-	 */
-	void fillRightsData();
-
-	void rightsConfirmationCallback(const LLSD& notification,
-			const LLSD& response, S32 rights);
-	void confirmModifyRights(bool grant, S32 rights);
-	void onCommitRights();
-	void onCommitNotes();
-
-	void onAddFriendButtonClick();
-	void onIMButtonClick();
-	void onCallButtonClick();
-	void onTeleportButtonClick();
-	void onShareButtonClick();
-	void enableCheckboxes(bool enable);
-};
-
 #endif // LL_LLPANELAVATAR_H
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 7e47a96f44e..a9af56f750b 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -48,16 +48,10 @@
 #include "lltabcontainer.h"
 #include "lltexturectrl.h"
 
-#define PICKER_SECOND_LIFE "2nd_life_pic"
-#define PICKER_FIRST_LIFE "real_world_pic"
-#define PANEL_PROFILE "panel_profile"
-
-static LLRegisterPanelClassWrapper<LLPanelMyProfileEdit> t_panel_me_profile_edit("edit_profile_panel");
 static LLRegisterPanelClassWrapper<LLPanelMe> t_panel_me_profile("panel_me");
 
 LLPanelMe::LLPanelMe(void) 
  : LLPanelProfile()
- , mEditPanel(NULL)
 {
 	setAvatarId(gAgent.getID());
 }
@@ -73,282 +67,3 @@ void LLPanelMe::onOpen(const LLSD& key)
 {
 	LLPanelProfile::onOpen(key);
 }
-
-void LLPanelMe::buildEditPanel()
-{
-	if (NULL == mEditPanel)
-	{
-		mEditPanel = new LLPanelMyProfileEdit();
-
-		// Note: Remove support for editing profile through this method.
-		//       All profile editing should go through the web.
-		//mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this);
-
-		//mEditPanel->childSetAction("cancel_btn", boost::bind(&LLPanelMe::onCancelClicked, this), this);
-	}
-}
-
-
-void LLPanelMe::onEditProfileClicked()
-{
-	buildEditPanel();
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-LLPanelMyProfileEdit::LLPanelMyProfileEdit() 
- : LLPanelMyProfile()
-{
-	buildFromFile( "panel_edit_profile.xml");
-
-	setAvatarId(gAgent.getID());
-
-	LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this));
-}
-
-void LLPanelMyProfileEdit::onOpen(const LLSD& key)
-{
-	resetData();
-
-	// Disable editing until data is loaded, or edited fields will be overwritten when data
-	// is loaded.
-	enableEditing(false);
-
-	// force new avatar name fetch so we have latest update time
-	LLAvatarNameCache::fetch(gAgent.getID()); 
-	LLPanelMyProfile::onOpen(getAvatarId());
-	
-	LLAvatarName av_name;	
-	if (LLAvatarNameCache::useDisplayNames())
-	{
-		if (LLAvatarNameCache::get(gAgent.getID(), &av_name) && av_name.mIsDisplayNameDefault)  	
-		{
-			LLFirstUse::setDisplayName();
-		}
-		else
-		{
-			LLFirstUse::setDisplayName(false);
-		}
-	}
-
-	if (LLAvatarNameCache::useDisplayNames())
-	{
-		getChild<LLUICtrl>("user_label")->setVisible( true );
-		getChild<LLUICtrl>("user_slid")->setVisible( true );
-		getChild<LLUICtrl>("display_name_label")->setVisible( true );
-		getChild<LLUICtrl>("set_name")->setVisible( true );
-		getChild<LLUICtrl>("set_name")->setEnabled( true );
-		getChild<LLUICtrl>("solo_user_name")->setVisible( false );
-		getChild<LLUICtrl>("solo_username_label")->setVisible( false );
-	}
-	else
-	{
-		getChild<LLUICtrl>("user_label")->setVisible( false );
-		getChild<LLUICtrl>("user_slid")->setVisible( false );
-		getChild<LLUICtrl>("display_name_label")->setVisible( false );
-		getChild<LLUICtrl>("set_name")->setVisible( false );
-		getChild<LLUICtrl>("set_name")->setEnabled( false );
-		getChild<LLUICtrl>("solo_user_name")->setVisible( true );
-		getChild<LLUICtrl>("solo_username_label")->setVisible( true );
-	}
-}
-
-void LLPanelMyProfileEdit::onClose(const LLSD& key)
-{
-	if (LLAvatarNameCache::useDisplayNames())
-	{
-		LLFirstUse::setDisplayName(false);
-	}	
-}
-
-void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type)
-{
-	if(APT_PROPERTIES == type)
-	{
-		const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
-		if(avatar_data && getAvatarId() == avatar_data->avatar_id)
-		{
-			// *TODO dzaporozhan
-			// Workaround for ticket EXT-1099, waiting for fix for ticket EXT-1128
-			enableEditing(true);
-			processProfileProperties(avatar_data);
-			LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
-		}
-	}
-}
-
-void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_data)
-{
-	fillCommonData(avatar_data);
-
-	// 'Home page' was hidden in LLPanelAvatarProfile::fillCommonData() to fix  EXT-4734
-	// Show 'Home page' in Edit My Profile (EXT-4873)
-	getChildView("homepage_edit")->setVisible( true);
-
-	fillPartnerData(avatar_data);
-
-	fillAccountStatus(avatar_data);
-
-	getChild<LLUICtrl>("show_in_search_checkbox")->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH));
-
-	LLAvatarNameCache::get(avatar_data->avatar_id,
-		boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2));
-}
-
-void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
-{
-	getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName );
-	getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername );
-	getChild<LLUICtrl>("user_name_small")->setValue( av_name.mDisplayName );
-	getChild<LLUICtrl>("solo_user_name")->setValue( av_name.mDisplayName );
-
-
-	if (LLAvatarNameCache::useDisplayNames())
-	{
-		getChild<LLUICtrl>("user_label")->setVisible( true );
-		getChild<LLUICtrl>("user_slid")->setVisible( true );
-		getChild<LLUICtrl>("display_name_label")->setVisible( true );
-		getChild<LLUICtrl>("set_name")->setVisible( true );
-		getChild<LLUICtrl>("set_name")->setEnabled( true );
-
-		getChild<LLUICtrl>("solo_user_name")->setVisible( false );
-		getChild<LLUICtrl>("solo_username_label")->setVisible( false );
-
-		// show smaller display name if too long to display in regular size
-		if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth())
-		{
-			getChild<LLUICtrl>("user_name_small")->setVisible( true );
-			getChild<LLUICtrl>("user_name")->setVisible( false );
-		}
-		else
-		{
-			getChild<LLUICtrl>("user_name_small")->setVisible( false );
-			getChild<LLUICtrl>("user_name")->setVisible( true );
-		}
-	}
-	else
-	{
-		getChild<LLUICtrl>("user_label")->setVisible( false );
-		getChild<LLUICtrl>("user_slid")->setVisible( false );
-		getChild<LLUICtrl>("display_name_label")->setVisible( false );
-		getChild<LLUICtrl>("set_name")->setVisible( false );
-		getChild<LLUICtrl>("set_name")->setEnabled( false );
-		
-		getChild<LLUICtrl>("solo_user_name")->setVisible( true );
-		getChild<LLUICtrl>("user_name_small")->setVisible( false );
-		getChild<LLUICtrl>("user_name")->setVisible( false );
-		getChild<LLUICtrl>("solo_username_label")->setVisible( true );
-	}
-}
-
-
-void LLPanelMyProfileEdit::onAvatarNameChanged()
-{
-	LLAvatarNameCache::get(getAvatarId(),
-		boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2));
-}
-
-BOOL LLPanelMyProfileEdit::postBuild()
-{
-	initTexturePickerMouseEvents();
-
-	getChild<LLUICtrl>("partner_edit_link")->setTextArg("[URL]", getString("partner_edit_link_url"));
-	getChild<LLUICtrl>("my_account_link")->setTextArg("[URL]", getString("my_account_link_url"));
-
-	getChild<LLUICtrl>("set_name")->setCommitCallback(
-		boost::bind(&LLPanelMyProfileEdit::onClickSetName, this));
-
-	LLHints::registerHintTarget("set_display_name", getChild<LLUICtrl>("set_name")->getHandle());
-	LLViewerDisplayName::addNameChangedCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this));
-	return LLPanelAvatarProfile::postBuild();
-}
-/**
- * Inits map with texture picker and appropriate edit icon.
- * Sets callbacks of Mouse Enter and Mouse Leave signals of Texture Pickers 
- */
-void LLPanelMyProfileEdit::initTexturePickerMouseEvents()
-{
-	LLTextureCtrl* text_pic = getChild<LLTextureCtrl>(PICKER_SECOND_LIFE);	
-	LLIconCtrl* text_icon = getChild<LLIconCtrl>("2nd_life_edit_icon");
-	mTextureEditIconMap[text_pic->getName()] = text_icon;
-	text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1));
-	text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1));
-	text_icon->setVisible(FALSE);
-
-	text_pic = getChild<LLTextureCtrl>(PICKER_FIRST_LIFE);
-	text_icon = getChild<LLIconCtrl>("real_world_edit_icon");
-	mTextureEditIconMap[text_pic->getName()] = text_icon;
-	text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1));
-	text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1));
-	text_icon->setVisible(FALSE);
-}
-
-void LLPanelMyProfileEdit::resetData()
-{
-	LLPanelMyProfile::resetData();
-
-	//childSetTextArg("name_text", "[FIRST]", LLStringUtil::null);
-	//childSetTextArg("name_text", "[LAST]", LLStringUtil::null);
-	getChild<LLUICtrl>("user_name")->setValue( LLSD() );
-	getChild<LLUICtrl>("user_slid")->setValue( LLSD() );
-	getChild<LLUICtrl>("solo_user_name")->setValue( LLSD() );
-	getChild<LLUICtrl>("user_name_small")->setValue( LLSD() );
-}
-
-void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl)
-{
-	mTextureEditIconMap[ctrl->getName()]->setVisible(TRUE);
-}
-void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl)
-{
-	mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE);
-}
-
-void LLPanelMyProfileEdit::onClickSetName()
-{	
-	LLAvatarNameCache::get(getAvatarId(), 
-			boost::bind(&LLPanelMyProfileEdit::onAvatarNameCache,
-				this, _1, _2));	
-
-	LLFirstUse::setDisplayName(false);
-}
-
-void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
-{
-	if (av_name.mDisplayName.empty())
-	{
-		// something is wrong, tell user to try again later
-		LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
-		return;		
-	}
-
-	llinfos << "name-change now " << LLDate::now() << " next_update "
-		<< LLDate(av_name.mNextUpdate) << llendl;
-	F64 now_secs = LLDate::now().secondsSinceEpoch();
-
-	if (now_secs < av_name.mNextUpdate)
-	{
-		// if the update time is more than a year in the future, it means updates have been blocked
-		// show a more general message
-        const int YEAR = 60*60*24*365; 
-		if (now_secs + YEAR < av_name.mNextUpdate)
-		{
-			LLNotificationsUtil::add("SetDisplayNameBlocked");
-			return;
-		}
-	}
-	
-	LLFloaterReg::showInstance("display_name");
-}
-
-void LLPanelMyProfileEdit::enableEditing(bool enable)
-{
-	getChildView("2nd_life_pic")->setEnabled(enable);
-	getChildView("real_world_pic")->setEnabled(enable);
-	getChildView("sl_description_edit")->setEnabled(enable);
-	getChildView("fl_description_edit")->setEnabled(enable);
-	getChildView("homepage_edit")->setEnabled(enable);
-	getChildView("show_in_search_checkbox")->setEnabled(enable);
-}
diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h
index b0f5d184cc8..60e9d4317d8 100644
--- a/indra/newview/llpanelme.h
+++ b/indra/newview/llpanelme.h
@@ -30,15 +30,9 @@
 #include "llpanel.h"
 #include "llpanelprofile.h"
 
-class LLAvatarName;
-class LLPanelMyProfileEdit;
-class LLPanelProfile;
-class LLIconCtrl;
-
 /**
-* Panel for displaying Agent's profile, it consists of two sub panels - Profile
-* and Picks. 
-* LLPanelMe allows user to edit his profile and picks.
+* Panel for displaying Agent's Picks and Classifieds panel.
+* LLPanelMe allows user to edit his picks and classifieds.
 */
 class LLPanelMe : public LLPanelProfile
 {
@@ -51,60 +45,6 @@ class LLPanelMe : public LLPanelProfile
 	/*virtual*/ void onOpen(const LLSD& key);
 
 	/*virtual*/ BOOL postBuild();
-
-private:
-
-	void buildEditPanel();
-
-	void onEditProfileClicked();
-
-	LLPanelMyProfileEdit *  mEditPanel;
-
-};
-
-class LLPanelMyProfileEdit : public LLPanelMyProfile
-{
-	LOG_CLASS(LLPanelMyProfileEdit);
-
-public:
-
-	LLPanelMyProfileEdit();
-
-	/*virtual*/void processProperties(void* data, EAvatarProcessorType type);
-	
-	/*virtual*/BOOL postBuild();
-
-	/*virtual*/ void onOpen(const LLSD& key);
-	/*virtual*/ void onClose(const LLSD& key);
-
-	void onAvatarNameChanged();
-
-protected:	
-
-	/*virtual*/void resetData();
-
-	void processProfileProperties(const LLAvatarData* avatar_data);
-	void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
-private:
-	void initTexturePickerMouseEvents();
-	void onTexturePickerMouseEnter(LLUICtrl* ctrl);
-	void onTexturePickerMouseLeave(LLUICtrl* ctrl);
-	void onClickSetName();
-	void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
-
-	/**
-	 * Enabled/disables controls to prevent overwriting edited data upon receiving
-	 * current data from server.
-	 */
-	void enableEditing(bool enable);
-
-
-
-private:
-	// map TexturePicker name => Edit Icon pointer should be visible while hovering Texture Picker
-	typedef std::map<std::string, LLIconCtrl*> texture_edit_icon_map_t;
-	texture_edit_icon_map_t mTextureEditIconMap;
 };
 
 #endif // LL_LLPANELMEPROFILE_H
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 5ce59d89599..c237bf1d060 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -38,7 +38,6 @@
 #include "llviewernetwork.h"
 
 static const std::string PANEL_PICKS = "panel_picks";
-static const std::string PANEL_PROFILE = "panel_profile";
 
 std::string getProfileURL(const std::string& agent_name)
 {
@@ -272,7 +271,6 @@ BOOL LLPanelProfile::postBuild()
 	panel_picks->setProfilePanel(this);
 
 	getTabContainer()[PANEL_PICKS] = panel_picks;
-	getTabContainer()[PANEL_PROFILE] = findChild<LLPanelAvatarProfile>(PANEL_PROFILE);
 
 	return TRUE;
 }
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
deleted file mode 100644
index 7635aedf584..00000000000
--- a/indra/newview/llpanelprofileview.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/** 
-* @file llpanelprofileview.cpp
-* @brief Side tray "Profile View" panel
-*
-* $LicenseInfo:firstyear=2009&license=viewerlgpl$
-* Second Life Viewer Source Code
-* Copyright (C) 2010, Linden Research, Inc.
-* 
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation;
-* version 2.1 of the License only.
-* 
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* Lesser General Public License for more details.
-* 
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-* 
-* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
-* $/LicenseInfo$
-*/
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llpanelprofileview.h"
-
-#include "llavatarconstants.h"
-#include "llavatarnamecache.h"	// IDEVO
-#include "llclipboard.h"
-#include "lluserrelations.h"
-
-#include "llavatarpropertiesprocessor.h"
-#include "llcallingcard.h"
-#include "llpanelavatar.h"
-#include "llpanelpicks.h"
-#include "llpanelprofile.h"
-#include "llsidetraypanelcontainer.h"
-
-static LLRegisterPanelClassWrapper<LLPanelProfileView> t_panel_target_profile("panel_profile_view");
-
-static std::string PANEL_NOTES = "panel_notes";
-static const std::string PANEL_PROFILE = "panel_profile";
-static const std::string PANEL_PICKS = "panel_picks";
-
-
-class AvatarStatusObserver : public LLAvatarPropertiesObserver
-{
-public:
-	AvatarStatusObserver(LLPanelProfileView* profile_view)
-	{
-		mProfileView = profile_view;
-	}
-
-	void processProperties(void* data, EAvatarProcessorType type)
-	{
-		if(APT_PROPERTIES != type) return;
-		const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
-		if(avatar_data && mProfileView->getAvatarId() == avatar_data->avatar_id)
-		{
-			mProfileView->processOnlineStatus(avatar_data->flags & AVATAR_ONLINE);
-			LLAvatarPropertiesProcessor::instance().removeObserver(mProfileView->getAvatarId(), this);
-		}
-	}
-
-	void subscribe()
-	{
-		LLAvatarPropertiesProcessor::instance().addObserver(mProfileView->getAvatarId(), this);
-	}
-
-private:
-	LLPanelProfileView* mProfileView;
-};
-
-LLPanelProfileView::LLPanelProfileView()
-:	LLPanelProfile()
-,	mStatusText(NULL)
-,	mAvatarStatusObserver(NULL)
-{
-	mAvatarStatusObserver = new AvatarStatusObserver(this);
-}
-
-LLPanelProfileView::~LLPanelProfileView(void)
-{
-	delete mAvatarStatusObserver;
-}
-
-/*virtual*/ 
-void LLPanelProfileView::onOpen(const LLSD& key)
-{
-	LLUUID id;
-	if(key.has("id"))
-	{
-		id = key["id"];
-	}
-
-	if(id.notNull() && getAvatarId() != id)
-	{
-		setAvatarId(id);
-
-		// clear name fields, which might have old data
-		getChild<LLUICtrl>("user_name")->setValue( LLSD() );
-		getChild<LLUICtrl>("user_slid")->setValue( LLSD() );
-	}
-
-	// Update the avatar name.
-	LLAvatarNameCache::get(getAvatarId(),
-		boost::bind(&LLPanelProfileView::onAvatarNameCache, this, _1, _2));
-
-	updateOnlineStatus();
-
-
-	LLPanelProfile::onOpen(key);
-}
-
-BOOL LLPanelProfileView::postBuild()
-{
-	LLPanelProfile::postBuild();
-
-	getTabContainer()[PANEL_NOTES] = findChild<LLPanelAvatarNotes>(PANEL_NOTES);
-	
-	//*TODO remove this, according to style guide we don't use status combobox
-	getTabContainer()[PANEL_PROFILE]->getChildView("online_me_status_text")->setVisible( FALSE);
-	getTabContainer()[PANEL_PROFILE]->getChildView("status_combo")->setVisible( FALSE);
-
-	mStatusText = getChild<LLTextBox>("status");
-	mStatusText->setVisible(false);
-
-	childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL);
-	childSetCommitCallback("copy_to_clipboard",boost::bind(&LLPanelProfileView::onCopyToClipboard,this),NULL);
-		
-	return TRUE;
-}
-
-
-//private
-
-void LLPanelProfileView::onBackBtnClick()
-{
-	// Set dummy value to make picks panel dirty, 
-	// This will make Picks reload on next open.
-	getTabContainer()[PANEL_PICKS]->setValue(LLSD());
-
-	LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
-	if(parent)
-	{
-		parent->openPreviousPanel();
-	}
-}
-
-void LLPanelProfileView::onCopyToClipboard()
-{
-	std::string name = getChild<LLUICtrl>("user_name")->getValue().asString() + " (" + getChild<LLUICtrl>("user_slid")->getValue().asString() + ")";
-	gClipboard.copyFromString(utf8str_to_wstring(name));
-}
-
-bool LLPanelProfileView::isGrantedToSeeOnlineStatus()
-{
-	const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
-	if (NULL == relationship)
-		return false;
-
-	// *NOTE: GRANT_ONLINE_STATUS is always set to false while changing any other status.
-	// When avatar disallow me to see her online status processOfflineNotification Message is received by the viewer
-	// see comments for ChangeUserRights template message. EXT-453.
-	// If GRANT_ONLINE_STATUS flag is changed it will be applied when viewer restarts. EXT-3880
-	return relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS);
-}
-
-// method was disabled according to EXT-2022. Re-enabled & improved according to EXT-3880
-void LLPanelProfileView::updateOnlineStatus()
-{
-	// set text box visible to show online status for non-friends who has not set in Preferences
-	// "Only Friends & Groups can see when I am online"
-	mStatusText->setVisible(TRUE);
-
-	const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
-	if (NULL == relationship)
-	{
-		// this is non-friend avatar. Status will be updated from LLAvatarPropertiesProcessor.
-		// in LLPanelProfileView::processOnlineStatus()
-
-		// subscribe observer to get online status. Request will be sent by LLPanelAvatarProfile itself.
-		// do not subscribe for friend avatar because online status can be wrong overridden
-		// via LLAvatarData::flags if Preferences: "Only Friends & Groups can see when I am online" is set.
-		mAvatarStatusObserver->subscribe();
-		return;
-	}
-	// For friend let check if he allowed me to see his status
-
-	// status should only show if viewer has permission to view online/offline. EXT-453, EXT-3880
-	mStatusText->setVisible(isGrantedToSeeOnlineStatus());
-
-	bool online = relationship->isOnline();
-	processOnlineStatus(online);
-}
-
-void LLPanelProfileView::processOnlineStatus(bool online)
-{
-	std::string status = getString(online ? "status_online" : "status_offline");
-
-	mStatusText->setValue(status);
-}
-
-void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id,
-										   const LLAvatarName& av_name)
-{
-	getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName );
-	getChild<LLUICtrl>("user_name_small")->setValue( av_name.mDisplayName );
-	getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername );
-
-	// show smaller display name if too long to display in regular size
-	if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth())
-	{
-		getChild<LLUICtrl>("user_name_small")->setVisible( true );
-		getChild<LLUICtrl>("user_name")->setVisible( false );
-	}
-	else
-	{
-		getChild<LLUICtrl>("user_name_small")->setVisible( false );
-		getChild<LLUICtrl>("user_name")->setVisible( true );
-	}
-
-	if (LLAvatarNameCache::useDisplayNames())
-	{
-		getChild<LLUICtrl>("user_label")->setVisible( true );
-		getChild<LLUICtrl>("user_slid")->setVisible( true );
-		getChild<LLUICtrl>("display_name_label")->setVisible( true );
-		getChild<LLUICtrl>("copy_to_clipboard")->setVisible( true );
-		getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( true );
-		getChild<LLUICtrl>("solo_username_label")->setVisible( false );
-	}
-	else
-	{
-		getChild<LLUICtrl>("user_label")->setVisible( false );
-		getChild<LLUICtrl>("user_slid")->setVisible( false );
-		getChild<LLUICtrl>("display_name_label")->setVisible( false );
-		getChild<LLUICtrl>("copy_to_clipboard")->setVisible( false );
-		getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( false );
-		getChild<LLUICtrl>("solo_username_label")->setVisible( true );
-	}
-}
-
-// EOF
diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h
deleted file mode 100644
index c6d921fdc40..00000000000
--- a/indra/newview/llpanelprofileview.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/** 
-* @file llpanelprofileview.h
-* @brief Side tray "Profile View" panel
-*
-* $LicenseInfo:firstyear=2009&license=viewerlgpl$
-* Second Life Viewer Source Code
-* Copyright (C) 2010, Linden Research, Inc.
-* 
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation;
-* version 2.1 of the License only.
-* 
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* Lesser General Public License for more details.
-* 
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-* 
-* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
-* $/LicenseInfo$
-*/
-
-#ifndef LL_LLPANELPROFILEVIEW_H
-#define LL_LLPANELPROFILEVIEW_H
-
-#include "llpanel.h"
-#include "llpanelprofile.h"
-#include "llavatarpropertiesprocessor.h"
-#include "llagent.h"
-#include "lltooldraganddrop.h"
-
-class LLAvatarName;
-class LLPanelProfile;
-class LLPanelProfileTab;
-class LLTextBox;
-class AvatarStatusObserver;
-
-/**
-* Panel for displaying Avatar's profile. It consists of three sub panels - Profile,
-* Picks and Notes.
-*/
-class LLPanelProfileView : public LLPanelProfile
-{
-	LOG_CLASS(LLPanelProfileView);
-	friend class LLUICtrlFactory;
-	friend class AvatarStatusObserver;
-
-public:
-
-	LLPanelProfileView();
-
-	/*virtual*/ ~LLPanelProfileView();
-
-	/*virtual*/ void onOpen(const LLSD& key);
-	
-	/*virtual*/ BOOL postBuild();
-
-	BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
-						   BOOL drop, EDragAndDropType cargo_type,
-						   void *cargo_data, EAcceptance *accept,
-						   std::string& tooltip_msg)
-	{
-		LLToolDragAndDrop::handleGiveDragAndDrop(getAvatarId(), gAgent.getSessionID(), drop,
-				 cargo_type, cargo_data, accept);
-
-		return TRUE;
-	}
-
-
-protected:
-
-	void onBackBtnClick();
-	void onCopyToClipboard();
-	bool isGrantedToSeeOnlineStatus();
-
-	/**
-	 * Displays avatar's online status if possible.
-	 *
-	 * Requirements from EXT-3880:
-	 * For friends:
-	 * - Online when online and privacy settings allow to show
-	 * - Offline when offline and privacy settings allow to show
-	 * - Else: nothing
-	 * For other avatars:
-	 *  - Online when online and was not set in Preferences/"Only Friends & Groups can see when I am online"
-	 *  - Else: Offline
-	 */
-	void updateOnlineStatus();
-	void processOnlineStatus(bool online);
-
-private:
-	// LLCacheName will call this function when avatar name is loaded from server.
-	// This is required to display names that have not been cached yet.
-//	void onNameCache(
-//		const LLUUID& id, 
-//		const std::string& full_name,
-//		bool is_group);
-	void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
-	LLTextBox* mStatusText;
-	AvatarStatusObserver* mAvatarStatusObserver;
-};
-
-#endif //LL_LLPANELPROFILEVIEW_H
diff --git a/indra/newview/skins/default/xui/da/panel_my_profile.xml b/indra/newview/skins/default/xui/da/panel_my_profile.xml
deleted file mode 100644
index 94da58389f2..00000000000
--- a/indra/newview/skins/default/xui/da/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Ingen"/>
-	<string name="no_group_text" value="Ingen"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Brugernavn
-						</text>
-						<text name="name_descr_text">
-							Visningsnavn
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Se profil for denne avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_notes.xml b/indra/newview/skins/default/xui/da/panel_notes.xml
deleted file mode 100644
index 7d8097f6ffe..00000000000
--- a/indra/newview/skins/default/xui/da/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Noter &amp; Privatliv" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Min private noter:"/>
-					<text name="status_message2" value="Tillad denne person at:"/>
-					<check_box label="Se min online status" name="status_check"/>
-					<check_box label="Se mig på kortet" name="map_check"/>
-					<check_box label="Editére, slette og tage mine objekter" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboer"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Ã…ben session med personlige beskeder"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Opkald" name="call" tool_tip="Opkald til denne beboer"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Kort" name="show_on_map_btn" tool_tip="Vis denne beboer på kortet"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_profile.xml b/indra/newview/skins/default/xui/da/panel_profile.xml
deleted file mode 100644
index db85eb23a84..00000000000
--- a/indra/newview/skins/default/xui/da/panel_profile.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Ingen"/>
-	<string name="no_group_text" value="Ingen"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Real World:"/>
-					</panel>
-					<text name="title_member_text" value="Beboer siden:"/>
-					<text name="title_acc_status_text" value="Konto status:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(henter)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupper:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboeren"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="Personlig besked" name="im" tool_tip="Ã…ben session med personlig besked"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Opkald" name="call" tool_tip="Opkald til denne beboer"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="â–¼" name="overflow_btn" tool_tip="Betal eller del beholdning med denne beboer"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Redigér profil" name="edit_profile_btn" tool_tip="Redigér din personlige information"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_profile_view.xml b/indra/newview/skins/default/xui/da/panel_profile_view.xml
deleted file mode 100644
index e6e8ca4d102..00000000000
--- a/indra/newview/skins/default/xui/da/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Online
-	</string>
-	<string name="status_offline">
-		Offline
-	</string>
-	<text name="display_name_label" value="Visningsnavn:"/>
-	<text name="solo_username_label" value="Brugernavn:"/>
-	<text name="status" value="Online"/>
-	<text name="user_name_small" value="Se på mig med dette enormt ekstremt super lange navn"/>
-	<button name="copy_to_clipboard" tool_tip="Kopiér til udskriftsholder"/>
-	<text name="user_label" value="Brugernavn:"/>
-	<tab_container name="tabs">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="FAVORITTER" name="panel_picks"/>
-		<panel label="NOTER &amp; PRIVATLIV" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_my_profile.xml b/indra/newview/skins/default/xui/de/panel_my_profile.xml
deleted file mode 100644
index 89a4dfdabae..00000000000
--- a/indra/newview/skins/default/xui/de/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=de-DE
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=de
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=de-DE"/>
-	<string name="no_partner_text" value="Keiner"/>
-	<string name="no_group_text" value="Keiner"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Benutzername
-						</text>
-						<text name="name_descr_text">
-							Anzeigename
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Profil zu diesem Avatar anzeigen"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_notes.xml b/indra/newview/skins/default/xui/de/panel_notes.xml
deleted file mode 100644
index ef1961b63d5..00000000000
--- a/indra/newview/skins/default/xui/de/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notizen &amp; Privatsphäre" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Meine Notizen:"/>
-					<text name="status_message2" value="Diese Person kann:"/>
-					<check_box label="meinen Online-Status sehen." name="status_check"/>
-					<check_box label="mich auf der Karte sehen." name="map_check"/>
-					<check_box label="meine Objekte bearbeiten, löschen oder nehmen." name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Freund hinzufügen" name="add_friend" tool_tip="Dem Einwohner die Freundschaft anbieten"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Instant Messenger öffnen"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Anrufen" name="call" tool_tip="Diesen Einwohner anrufen"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Karte" name="show_on_map_btn" tool_tip="Einwohner auf Karte anzeigen"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_profile.xml b/indra/newview/skins/default/xui/de/panel_profile.xml
deleted file mode 100644
index b4c6e671085..00000000000
--- a/indra/newview/skins/default/xui/de/panel_profile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=de-DE
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=de
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=de-DE"/>
-	<string name="no_partner_text" value="Keiner"/>
-	<string name="no_group_text" value="Keiner"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Echtes Leben:"/>
-					</panel>
-					<text name="title_member_text" value="Einwohner seit:"/>
-					<text name="title_acc_status_text" value="Kontostatus:"/>
-					<text_editor name="acc_status_text">
-						Einwohner. Keine Zahlungsinfo archiviert.
-              Linden.
-					</text_editor>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(wird in Datenbank gesucht)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Gruppen:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Freund hinzufügen" name="add_friend" tool_tip="Dem Einwohner die Freundschaft anbieten"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Instant Messenger öffnen"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Anrufen" name="call" tool_tip="Diesen Einwohner anrufen"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="â–¼" name="overflow_btn" tool_tip="Dem Einwohner Geld geben oder Inventar an den Einwohner schicken"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Profil bearbeiten" name="edit_profile_btn" tool_tip="Ihre persönlichen Informationen bearbeiten"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_profile_view.xml b/indra/newview/skins/default/xui/de/panel_profile_view.xml
deleted file mode 100644
index 7e93bd1edee..00000000000
--- a/indra/newview/skins/default/xui/de/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Online
-	</string>
-	<string name="status_offline">
-		Offline
-	</string>
-	<text name="display_name_label" value="Anzeigename:"/>
-	<text name="solo_username_label" value="Benutzername:"/>
-	<text name="status" value="Online"/>
-	<text name="user_name_small" value="Dieser Name ist ein ganz außerordentlich langer Name"/>
-	<button name="copy_to_clipboard" tool_tip="In Zwischenablage kopieren"/>
-	<text name="user_label" value="Benutzername:"/>
-	<tab_container name="tabs" tab_min_width="60">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="AUSWAHL" name="panel_picks"/>
-		<panel label="NOTIZEN &amp; PRIVATSPHÄRE" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml
index 32dda1b6949..d6d8431150a 100644
--- a/indra/newview/skins/default/xui/en/floater_people.xml
+++ b/indra/newview/skins/default/xui/en/floater_people.xml
@@ -25,10 +25,6 @@
         class="panel_people"
         name="panel_people"
         filename="panel_people.xml"/>
-      <panel
-        class="panel_profile_view"
-        name="panel_profile_view"
-        filename="panel_profile_view.xml"/>
       <panel
         class="panel_group_info_sidetray"
         name="panel_group_info_sidetray"
diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml
deleted file mode 100644
index 4bd2235cdae..00000000000
--- a/indra/newview/skins/default/xui/en/panel_my_profile.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- follows="all"
- height="535"
- label="Profile"
- layout="topleft"
- left="0"
- name="panel_profile"
- top="0"
- width="315">
-    <string
-     name="CaptionTextAcctInfo">
-        [ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-    </string>
-    <string
-     name="payment_update_link_url">
-        http://www.secondlife.com/account/billing.php?lang=en
-    </string>
-    <string
-     name="partner_edit_link_url">
-        http://www.secondlife.com/account/partners.php?lang=en
-    </string>
-    <string
-     name="my_account_link_url"
-     value="http://secondlife.com/account" />
-    <string
-     name="no_partner_text"
-     value="None" />
-    <string
-     name="no_group_text"
-     value="None" />
-    <string
-	   name="RegisterDateFormat">
-	   [REG_DATE] ([AGE])
-	  </string>
-    <string
-      name="name_text_args">
-      [NAME]
-    </string>
-    <string
-      name="display_name_text_args">
-      [DISPLAY_NAME]
-    </string>
-  <layout_stack
-     name="layout"
-     orientation="vertical"
-     follows="all"
-     layout="topleft"
-     left="0"
-     top="0"
-     height="510"
-     width="315"
-     border_size="0">
-      <layout_panel
-         name="profile_stack"
-         follows="all"
-         layout="topleft"
-         top="0"
-         left="0"
-         height="492"
-         user_resize="false"
-         width="315">
-        <scroll_container
-         color="DkGray2"
-         follows="all"
-         layout="topleft"
-         left="0"
-         name="profile_scroll"
-         opaque="true"
-         height="488"
-         width="315"
-         top="0">
-          <panel
-                layout="topleft"
-          follows="left|top|right"
-                height="488"
-               name="scroll_content_panel"
-                top="0"
-                left="0"
-                width="297">
-            <panel
-                  follows="left|top|right"
-                  height="117"
-                  layout="topleft"
-                  left="10"
-                  name="second_life_image_panel"
-                  top="0"
-                  width="297">
-
-              <texture_picker
-               allow_no_texture="true"
-               default_image_name="None"
-               enabled="false"
-               fallback_image="Generic_Person_Large"
-               follows="top|left"
-               height="124"
-               layout="topleft"
-               left="3"
-               name="2nd_life_pic"
-               top="10"
-               width="102" />
-
-              <text
-                follows="left|top|right"
-                font="SansSerifLarge"
-                font.style="BOLD"
-                height="15"
-                layout="topleft"
-                left_pad="10"
-                name="display_name_descr_text"
-                text_color="0.7 0.7 0.7 1.0"
-                top_delta="0"
-                width="280" >
-                User name
-                </text>
-
-              <text
-                follows="left|top|right"
-                font.style="BOLD"
-                height="15"
-                layout="topleft"
-                left_delta="0"
-                name="name_descr_text"
-                text_color="0.4 0.4 0.4 1.0"
-                top_delta="20"
-                width="280">
-                Display Name
-              </text>
-
-              <button
-                follows="bottom"
-                height="23"
-                left_delta="0"
-                top_delta="20"
-                label="Profile"
-                name="see_profile_btn"
-                tool_tip="See profile for this avatar"
-                width="120" />
-
-            </panel>
-          </panel>
-        </scroll_container>
-      </layout_panel>
-      </layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml
deleted file mode 100644
index 124b1cfc6be..00000000000
--- a/indra/newview/skins/default/xui/en/panel_notes.xml
+++ /dev/null
@@ -1,236 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- follows="all"
- height="515"
- label="Notes &amp; Privacy"
- layout="topleft"
- left="0"
- name="panel_notes"
- top="0"
- width="313"
->
-    <layout_stack
-     name="layout"
-     orientation="vertical"
-     follows="all"
-     layout="topleft"
-     left="0"
-     top="0"
-     height="517"
-     width="313"
-     border_size="0">
-      <layout_panel
-       name="notes_stack"
-       follows="all"
-       layout="topleft"
-       top="0"
-       left="0"
-       height="450"
-       width="313">
-        <scroll_container
-         color="DkGray2"
-         follows="all"
-         layout="topleft"
-         left="0"
-         name="profile_scroll"
-         opaque="true"
-         height="450"
-         width="313"
-         top="0">
-          <panel
-           height="450"
-           layout="topleft"
-           name="profile_scroll_panel"
-           top="0"
-           left="0"
-           width="303">
-            <text
-             follows="left|top"
-         font.style="BOLD"
-             height="16"
-             layout="topleft"
-             left="11"
-             name="status_message"
-             text_color="white"
-             top="10"
-             value="My private notes:"
-             width="293" />
-            <text_editor
-             follows="left|top"
-             height="120"
-             layout="topleft"
-             left="12"
-             max_length="1000"
-             name="notes_edit"
-             text_color="DkGray"
-             top_pad="3"
-             width="288"
-             word_wrap="true" />
-            <text
-             follows="left|top"
-         font.style="BOLD"
-             height="16"
-             layout="topleft"
-             left="11"
-             name="status_message2"
-             text_color="white"
-             top_pad="20"
-             value="Allow this person to:"
-             width="293" />
-            <check_box
-             enabled="false"
-             height="16"
-             label="See my online status"
-             layout="topleft"
-             left="10"
-             name="status_check"
-             width="293" />
-            <check_box
-             enabled="false"
-             height="16"
-             label="See me on the map"
-             layout="topleft"
-             left="10"
-             name="map_check"
-             width="293" />
-            <check_box
-             enabled="false"
-             height="16"
-             label="Edit, delete or take my objects"
-             layout="topleft"
-             left="10"
-             name="objects_check"
-             width="293" />
-          </panel>
-        </scroll_container>
-      </layout_panel>
-      <layout_panel
-       follows="bottom|left"
-       height="30"
-         layout="topleft"
-         left="0"
-         name="notes_buttons_panel"
-         auto_resize="false"
-         width="313">
-         
-         <layout_stack
-	     	follows="bottom|left|right"
-			height="23"
-			layout="topleft"
-			name="bottom_bar_ls"
-			left="2"
-			orientation="horizontal"
-			top_pad="5"
-			width="309">
-	
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left="0"
-				name="add_friend_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="118">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Add Friend"
-			         layout="topleft"
-			         left="1"
-			         mouse_opaque="false"
-			         name="add_friend"
-			         tool_tip="Offer friendship to the Resident"
-			         top="0"
-			         width="117" />	
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="im_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="22">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="IM"
-			         layout="topleft"
-			         name="im"
-			         tool_tip="Open instant message session"
-			         top="0"
-			         left="1"
-			         width="21" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="call_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="52">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Call"
-			         layout="topleft"
-			         name="call"
-			         tool_tip="Call this Resident"
-			         left="1"
-			         top="0"
-			         use_ellipses="true"
-			         width="51" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="show_on_map_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="46">
-					<button
-			         enabled="false"
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Map"
-			         layout="topleft"
-			         name="show_on_map_btn"
-			         tool_tip="Show the Resident on the map"
-			         top="0"
-			         left="1"
-			         width="45" />
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="teleport_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="81">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Teleport"
-			         layout="topleft"
-			         name="teleport"
-			         tool_tip="Offer teleport"
-			         left="1"
-			         top="0"
-			         width="80" />	
-				</layout_panel>
-		</layout_stack>     
-        </layout_panel>
-    </layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml
deleted file mode 100644
index f5a9daa994c..00000000000
--- a/indra/newview/skins/default/xui/en/panel_profile.xml
+++ /dev/null
@@ -1,458 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- follows="all"
- height="430"
- label="Profile"
- layout="topleft"
- left="0"
- name="panel_profile"
- top="0"
- width="317">
-    <string
-     name="CaptionTextAcctInfo">
-        [ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-    </string>
-    <string
-     name="payment_update_link_url">
-        http://www.secondlife.com/account/billing.php?lang=en
-    </string>
-    <string
-     name="partner_edit_link_url">
-        http://www.secondlife.com/account/partners.php?lang=en
-    </string>
-    <string
-     name="my_account_link_url"
-     value="http://secondlife.com/account" />
-    <string
-     name="no_partner_text"
-     value="None" />
-    <string
-     name="no_group_text"
-     value="None" />
-    <string
-	 name="RegisterDateFormat">
-	 [REG_DATE] ([AGE])
-	</string>
-  <string
-  name="name_text_args">
-    [NAME]
-  </string>
-  <string
-    name="display_name_text_args">
-    [DISPLAY_NAME]
-  </string>
-    <layout_stack
-     name="layout"
-     orientation="vertical"
-     follows="all"
-     layout="topleft"
-     left="0"
-     top="0"
-     height="400"
-     width="317"
-     border_size="0">
-      <layout_panel
-         name="profile_stack"
-         follows="all"
-         layout="topleft"
-         top="0"
-         left="0"
-         height="400"
-         width="317">
-        <scroll_container
-         color="DkGray2"
-         follows="all"
-         layout="topleft"
-         left="0"
-         name="profile_scroll"
-         opaque="true"
-         height="400"
-         width="317"
-         top="0">
-          <panel
-                layout="topleft"
-          follows="left|top|right"
-                height="505"
-		min_height="505"
-                name="profile_scroll_panel"
-                top="0"
-                left="0"
-                width="297">
-            <panel
-                  follows="left|top|right"
-                  height="124"
-                  layout="topleft"
-                  left="13"
-                  name="second_life_image_panel"
-                  top="0"
-                  width="297">
-              <texture_picker
-               allow_no_texture="true"
-               default_image_name="None"
-               enabled="false"
-               fallback_image="Generic_Person_Large"
-               follows="top|left"
-               height="124"
-               layout="topleft"
-               left="0"
-               name="2nd_life_pic"
-               top="10"
-               width="102" />
-              <text
-               follows="left|top|right"
-         font.style="BOLD"
-               height="15"
-               layout="topleft"
-               left_pad="10"
-               name="title_sl_descr_text"
-               text_color="white"
-               top_delta="0"
-               value="[SECOND_LIFE]:"
-               width="180" />
-              <expandable_text
-               follows="left|top|right"
-               height="97"
-               layout="topleft"
-               left="107"
-               textbox.max_length="512"
-               textbox.show_context_menu="true"
-               name="sl_description_edit"
-               top_pad="-3"
-               translate="false"
-               width="180"
-               expanded_bg_visible="true"
-               expanded_bg_color="DkGray">
-                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet.Nullamma lesuada mauris sit amet ipsum. adipiscing elit. Ae nean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
-              </expandable_text>
-            </panel>
-            <panel
-             follows="left|top|right"
-             height="124"
-             layout="topleft"
-       top_pad="0"
-             left="13"
-             name="first_life_image_panel"
-             width="297">
-              <texture_picker
-               allow_no_texture="true"
-               default_image_name="None"
-               enabled="false"
-               fallback_image="Generic_Person_Large"
-               follows="top|left"
-               height="124"
-               layout="topleft"
-               left="0"
-               name="real_world_pic"
-               width="102" />
-              <text
-               follows="left|top|right"
-         font.style="BOLD"
-               height="15"
-               layout="topleft"
-               left_pad="10"
-               name="title_rw_descr_text"
-               text_color="white"
-               top_delta="0"
-               value="Real World:"
-               width="180" />
-              <expandable_text
-               follows="left|top|right"
-               height="97"
-               layout="topleft"
-               left="107"
-               textbox.max_length="512"
-               textbox.show_context_menu="true"
-               name="fl_description_edit"
-               top_pad="-3"
-               translate="false"
-               width="180"
-               expanded_bg_visible="true"
-               expanded_bg_color="DkGray">
-                Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
-              </expandable_text>
-            </panel>
-            <text
-              follows="left|top"
-              height="15"
-        font.style="BOLD"
-        font="SansSerifMedium"
-              layout="topleft"
-              left="10"
-              name="homepage_edit"
-              top_pad="0"
-              translate="false"
-              value="http://librarianavengers.org"
-              width="300"
-              word_wrap="false"
-              use_ellipses="true" />
-            <text
-             follows="left|top"
-           font.style="BOLD"
-             height="10"
-             layout="topleft"
-             left="10"
-             name="title_member_text"
-             text_color="white"
-             top_pad="10"
-             value="Resident Since:"
-             width="300" />
-            <text_editor
-             allow_scroll="false"
-             bg_visible="false"
-             follows="left|top"
-             h_pad="0"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="register_date"
-             read_only="true"
-             translate="false"
-             v_pad="0"
-             value="05/31/2376"
-             width="300"
-             word_wrap="true" />
-            <text
-             follows="left|top"
-       font.style="BOLD"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="title_acc_status_text"
-             text_color="white"
-             top_pad="5"
-             value="Account Status:"
-             width="300" />
-            <!-- <text
-         type="string"
-         follows="left|top"
-         font="SansSerifSmall"
-         height="15"
-         layout="topleft"
-         left_pad="10"
-         name="my_account_link"
-         top_delta="0"
-	 value="Go to Dashboard"
-         width="100"/> -->
-            <text_editor
-             allow_scroll="false"
-             bg_visible="false"
-             follows="left|top"
-             h_pad="0"
-             height="28"
-             layout="topleft"
-             left="10"
-             name="acc_status_text"
-             read_only="true"
-             top_pad="0"
-             translate="false"
-             v_pad="0"
-             width="300"
-             word_wrap="true">
-              Resident. No payment info on file.
-              Linden.
-            </text_editor>
-            <text
-             follows="left|top"
-       font.style="BOLD"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="title_partner_text"
-             text_color="white"
-             top_pad="3"
-             value="Partner:"
-             width="300" />
-            <panel
-             follows="left|top"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="partner_data_panel"
-             top_pad="0"
-             width="300">
-              <text
-               follows="left|top"
-               height="10"
-               initial_value="(retrieving)"
-               layout="topleft"
-               left="0"
-               parse_urls="true"
-               name="partner_text"
-               top="0"
-               use_ellipses="true"
-           width="300" />
-            </panel>
-            <text
-             follows="left|top"
-       font.style="BOLD"
-             height="13"
-             layout="topleft"
-             left="10"
-             name="title_groups_text"
-             text_color="white"
-             top_pad="3"
-             value="Groups:"
-             width="300" />
-            <expandable_text
-            follows="all"
-            height="103"
-            layout="topleft"
-            left="7"
-            name="sl_groups"
-            textbox.max_length="512"
-            textbox.show_context_menu="true"
-            top_pad="0"
-            translate="false"
-            width="290"
-            expanded_bg_visible="true"
-            expanded_bg_color="DkGray">
-              Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. Aenean viverra tulip moosetop. Slan de heelish marfnik tooplod. Sum sum to whop de wompam booster copm.
-            </expandable_text>
-          </panel>
-        </scroll_container>
-      </layout_panel>
-           
-</layout_stack>
-
-	<layout_stack
-     name="layout_verb_buttons"
-     orientation="horizontal"
-     follows="bottom|left|right"
-     layout="topleft"
-     left="2"
-     top_pad="1"
-     height="30"
-     width="315"
-     border_size="0">
-     	<layout_panel
-         follows="bottom|left"
-         height="30"
-         layout="topleft"
-         name="profile_buttons_panel"
-         top="0"
-         auto_resize="false"
-         width="317">
-         	
-           <layout_stack
-	     	follows="bottom|left|right"
-			height="23"
-			layout="topleft"
-			name="bottom_bar_ls"
-			left="0"
-			orientation="horizontal"
-			top_pad="5"
-			width="317">
-	
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left="0"
-				name="add_friend_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="121">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Add Friend"
-			         layout="topleft"
-			         left="1"
-			         mouse_opaque="false"
-			         name="add_friend"
-			         tool_tip="Offer friendship to the Resident"
-			         top="0"
-			         width="120" />	
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="im_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="22">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="IM"
-			         layout="topleft"
-			         name="im"
-			         tool_tip="Open instant message session"
-			         top="0"
-			         left="1"
-			         width="21" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="call_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="52">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Call"
-			         layout="topleft"
-			         name="call"
-			         tool_tip="Call this Resident"
-			         left="1"
-			         top="0"
-			         use_ellipses="true"
-			         width="51" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="chat_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="93">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Teleport"
-			         layout="topleft"
-			         name="teleport"
-			         tool_tip="Offer teleport"
-			         left="1"
-			         top="0"
-			         use_ellipses="true"
-			         width="92" />
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="overflow_btn_lp"
-			    user_resize="false" 
-			    auto_resize="false"
-				width="24">
-					<menu_button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="â–¼"
-			         layout="topleft"
-			         name="overflow_btn"
-			         tool_tip="Pay money to or share inventory with the Resident"
-			         left="1"
-			         top="0"
-			         width="23" />		
-				</layout_panel>
-		</layout_stack>
-      </layout_panel>
-     </layout_stack>
-
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml
deleted file mode 100644
index 646875b52e8..00000000000
--- a/indra/newview/skins/default/xui/en/panel_profile_view.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- background_visible="true"
- follows="all"
- height="570"
- layout="topleft"
- min_height="350"
- name="panel_target_profile"
- left="0"
- width="333">
-  <string
-   name="status_online">
-    Online
-  </string>
-  <string
-   name="status_offline">
-    Offline
-  </string>
-  <button
-   follows="top|left"
-   height="24"
-   image_hover_unselected="BackButton_Over"
-   image_pressed="BackButton_Press"
-   image_unselected="BackButton_Off"
-   layout="topleft"
-   name="back"
-   left="10"
-   tab_stop="false"
-   top="2"
-   width="30"
-   use_draw_context_alpha="false" />
-  <text
-   top="10"
-   follows="top|left"
-   height="13"
-   layout="topleft"
-   left="45"
-   name="display_name_label"
-   text_color="LtGray"
-   value="Display Name:"
-   width="80" />
-  <text
-   top_delta="0"
-   follows="top|left"
-   height="13"
-   layout="topleft"
-   left="45"
-   name="solo_username_label"
-   text_color="LtGray"
-   value="Username:"
-   visible="false" 
-   width="80" />
-  <text
-   follows="top|right"
-   halign="right"
-   height="13"
-   layout="topleft"
-   right="-15"
-   name="status"
-   text_color="LtGray_50"
-   top_delta="0"
-   value="Online"
-   width="150" />
-  <text
-   follows="top|left|right"
-   font="SansSerifBigBold"
-   height="29"
-   layout="topleft"
-   left="45"
-   name="user_name_small"
-   text_color="LtGray"
-   top="22"
-   value="Jack oh look at me this is a super duper long name"
-   use_ellipses="true"
-   word_wrap="true"
-   visible="false"
-   width="255" />
-  <text
-   follows="top|left|right"
-   font="SansSerifHugeBold"
-   height="27"
-   layout="topleft"
-   left="45"
-   name="user_name"
-   text_color="LtGray"
-   translate="false"
-   top="25"
-   value="TestString PleaseIgnore"
-   visible="true"
-   use_ellipses="true"
-   width="258" /> 
-  <button
-         name="copy_to_clipboard"
-         layout="topleft"
-         follows="top|right"
-         image_overlay="Copy"
-         top_delta="0"
-         right="-15"
-         height="21"
-         width="21"
-         tab_stop="false" 
-         tool_tip="Copy to Clipboard"/>
-  <text
-   follows="top|left"
-   height="13"
-   layout="topleft"
-   left="45"
-   name="user_label"
-   text_color="LtGray"
-   top_pad="10" 
-   value="Username:"
-   width="70" />
-  <text
-   follows="top|left"
-   height="20"
-   layout="topleft"
-   left_pad="0"
-   name="user_slid"
-   text_color="EmphasisColor"
-   font="SansSerifBold"
-   top_delta="-2"
-   translate="false"
-   use_ellipses="true"
-   value="teststring.pleaseignore"
-   width="195" 
-   wrap="true "/>
-  <tab_container
-   follows="all"
-   height="489"
-   halign="center"
-   layout="topleft"
-   left="5"
-   min_width="333"
-   name="tabs"
-   tab_min_width="80"
-   tab_height="30"
-   tab_position="top"
-   top_pad="5"
-   width="317">
-    <panel
-     class="panel_profile"
-     filename="panel_profile.xml"
-     label="PROFILE"
-     layout="topleft"
-     help_topic="profile_profile_tab"
-     name="panel_profile" />
-    <panel
-     class="panel_picks"
-     filename="panel_picks.xml"
-     label="PICKS"
-     layout="topleft"
-     help_topic="profile_picks_tab"
-     name="panel_picks" />
-    <panel
-     class="panel_notes"
-     filename="panel_notes.xml"
-     label="NOTES &amp; PRIVACY"
-     layout="topleft"
-     help_topic="profile_notes_tab"
-     name="panel_notes" />
-  </tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_my_profile.xml b/indra/newview/skins/default/xui/es/panel_my_profile.xml
deleted file mode 100644
index 29e5e6f652e..00000000000
--- a/indra/newview/skins/default/xui/es/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="no_partner_text" value="Ninguno/a"/>
-	<string name="no_group_text" value="Ninguno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nombre de usuario
-						</text>
-						<text name="name_descr_text">
-							Nombre mostrado
-						</text>
-						<button label="Perfil" name="see_profile_btn" tool_tip="Ver el perfil de este avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_notes.xml b/indra/newview/skins/default/xui/es/panel_notes.xml
deleted file mode 100644
index 00d4caf4685..00000000000
--- a/indra/newview/skins/default/xui/es/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notas y Privacidad" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Mis notas privadas:"/>
-					<text name="status_message2" value="Permitir que esta persona:"/>
-					<check_box label="Vea si estoy conectado" name="status_check"/>
-					<check_box label="Me vea en el mapa" name="map_check"/>
-					<check_box label="Edite, borre o coja mis objetos" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir una sesión de mensajes instantáneos"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Llamar" name="call" tool_tip="Llamar a este Residente"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mapa" name="show_on_map_btn" tool_tip="Mostrar al Residente en el mapa"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_profile.xml b/indra/newview/skins/default/xui/es/panel_profile.xml
deleted file mode 100644
index 334c0541af9..00000000000
--- a/indra/newview/skins/default/xui/es/panel_profile.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=es-ES
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=es
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=es-ES"/>
-	<string name="no_partner_text" value="Ninguno"/>
-	<string name="no_group_text" value="Ninguno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Mundo real:"/>
-					</panel>
-					<text name="title_member_text" value="Residente desde:"/>
-					<text name="title_acc_status_text" value="Estado de la cuenta:"/>
-					<text name="title_partner_text" value="Compañero/a:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(obteniendo)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupos:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir una sesión de mensajes instantáneos"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Llamar" name="call" tool_tip="Llamar a este Residente"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Pagar dinero al Residente o compartir algo del inventario con él"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Editar el perfil" name="edit_profile_btn" tool_tip="Modificar tu información personal"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_profile_view.xml b/indra/newview/skins/default/xui/es/panel_profile_view.xml
deleted file mode 100644
index cb374dee52f..00000000000
--- a/indra/newview/skins/default/xui/es/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Conectado/a
-	</string>
-	<string name="status_offline">
-		Desconectado/a
-	</string>
-	<text name="display_name_label" value="Nombre mostrado:"/>
-	<text name="solo_username_label" value="Nombre de usuario:"/>
-	<text name="status" value="Conectado/a"/>
-	<text name="user_name_small" value="Jack, ¿has visto esto? Es un nombre larguísimo."/>
-	<button name="copy_to_clipboard" tool_tip="Copiar al portapapeles"/>
-	<text name="user_label" value="Nombre de usuario:"/>
-	<tab_container name="tabs">
-		<panel label="PERFIL" name="panel_profile"/>
-		<panel label="DESTACADOS" name="panel_picks"/>
-		<panel label="NOTAS Y PRIVACIDAD" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_my_profile.xml b/indra/newview/skins/default/xui/fr/panel_my_profile.xml
deleted file mode 100644
index 5207c5a28e7..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Aucun"/>
-	<string name="no_group_text" value="Aucun"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nom d&apos;utilisateur
-						</text>
-						<text name="name_descr_text">
-							Nom d&apos;affichage
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Afficher le profil de cet avatar."/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_notes.xml b/indra/newview/skins/default/xui/fr/panel_notes.xml
deleted file mode 100644
index 1b44bc4b73c..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notes/Perso" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Mes notes perso :"/>
-					<text name="status_message2" value="Autoriser cette personne à :"/>
-					<check_box label="Afficher mon statut en ligne" name="status_check"/>
-					<check_box label="Me situer sur la carte" name="map_check"/>
-					<check_box label="Modifier, supprimer ou prendre mes objets" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Devenir amis" name="add_friend" tool_tip="Proposer à ce résident de devenir votre ami"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Ouvrir une session IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Appeler" name="call" tool_tip="Appeler ce résident"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Carte" name="show_on_map_btn" tool_tip="Afficher le résident sur la carte"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_profile.xml b/indra/newview/skins/default/xui/fr/panel_profile.xml
deleted file mode 100644
index 9aa6fe97a1e..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_profile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=fr-FR
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=fr
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=fr-FR"/>
-	<string name="no_partner_text" value="Aucun"/>
-	<string name="no_group_text" value="Aucun"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Vie réelle :"/>
-					</panel>
-					<text name="title_member_text" value="Résident depuis :"/>
-					<text name="title_acc_status_text" value="Statut du compte :"/>
-					<text_editor name="acc_status_text">
-						Résident. Aucune info de paiement enregistrée.
-              Linden.
-					</text_editor>
-					<text name="title_partner_text" value="Partenaire :"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(récupération en cours)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Groupes :"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Devenir amis" name="add_friend" tool_tip="Proposer à ce résident de devenir votre ami"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Ouvrir une session IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Appeler" name="call" tool_tip="Appeler ce résident"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Payer le résident ou partager l&apos;inventaire avec lui"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Modifier le profil" name="edit_profile_btn" tool_tip="Modifier vos informations personnelles"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_profile_view.xml b/indra/newview/skins/default/xui/fr/panel_profile_view.xml
deleted file mode 100644
index 76ba44e8990..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		En ligne
-	</string>
-	<string name="status_offline">
-		Hors ligne
-	</string>
-	<text name="display_name_label" value="Nom d&apos;affichage :"/>
-	<text name="solo_username_label" value="Nom d&apos;utilisateur :"/>
-	<text name="status" value="En ligne"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="Copier dans le presse-papiers"/>
-	<text name="user_label" value="Nom d&apos;utilisateur :"/>
-	<tab_container name="tabs">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="FAVORIS" name="panel_picks"/>
-		<panel label="NOTES/PERSO" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_my_profile.xml b/indra/newview/skins/default/xui/it/panel_my_profile.xml
deleted file mode 100644
index 094b97962f4..00000000000
--- a/indra/newview/skins/default/xui/it/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profilo" name="panel_profile">
-	<string name="no_partner_text" value="Nessuno"/>
-	<string name="no_group_text" value="Nessuno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nome utente
-						</text>
-						<text name="name_descr_text">
-							Nome visualizzato
-						</text>
-						<button label="Profilo" name="see_profile_btn" tool_tip="Visualizza profilo per questo avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_notes.xml b/indra/newview/skins/default/xui/it/panel_notes.xml
deleted file mode 100644
index e1271382778..00000000000
--- a/indra/newview/skins/default/xui/it/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Note e Privacy" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Le mie note private:"/>
-					<text name="status_message2" value="Consenti a questa persona di:"/>
-					<check_box label="Vedere se sono online" name="status_check"/>
-					<check_box label="Vedermi sulla mappa" name="map_check"/>
-					<check_box label="Modificare, eliminare o prendere i miei oggetti" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Aggiungi come amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Chiama" name="call" tool_tip="Chiama questo residente"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mappa" name="show_on_map_btn" tool_tip="Mostra il residente sulla mappa"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleport" name="teleport" tool_tip="Offri teleport"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_profile.xml b/indra/newview/skins/default/xui/it/panel_profile.xml
deleted file mode 100644
index 309937c5a01..00000000000
--- a/indra/newview/skins/default/xui/it/panel_profile.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profilo" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=it-IT
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=it
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=it-IT"/>
-	<string name="no_partner_text" value="Nessuno"/>
-	<string name="no_group_text" value="Nessuno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Mondo reale:"/>
-					</panel>
-					<text name="title_member_text" value="Residente dal:"/>
-					<text name="title_acc_status_text" value="Stato account:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(recupero)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Gruppi:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Aggiungi come amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Chiama" name="call" tool_tip="Chiama questo residente"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleport" name="teleport" tool_tip="Offri teleport"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="â–¼" name="overflow_btn" tool_tip="Paga del denaro o condividi qualcosa dall&apos;inventario con il residente"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Modifica profilo" name="edit_profile_btn" tool_tip="Modifica le tue informazioni personali"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_profile_view.xml b/indra/newview/skins/default/xui/it/panel_profile_view.xml
deleted file mode 100644
index 409eb5d1f40..00000000000
--- a/indra/newview/skins/default/xui/it/panel_profile_view.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Online
-	</string>
-	<string name="status_offline">
-		Offline
-	</string>
-	<text name="display_name_label" value="Nome visualizzato:"/>
-	<text name="solo_username_label" value="Nome utente:"/>
-	<text name="status" value="Online"/>
-	<text name="user_name_small" value="Jack guarda quanto è lungo questo splendido nome"/>
-	<text name="user_name" value="Jack Linden"/>
-	<button name="copy_to_clipboard" tool_tip="Copia negli appunti"/>
-	<text name="user_label" value="Nome utente:"/>
-	<text name="user_slid" value="jack.linden"/>
-	<tab_container name="tabs">
-		<panel label="PROFILO" name="panel_profile"/>
-		<panel label="LUOGHI CONSIGLIATI" name="panel_picks"/>
-		<panel label="NOTE E PRIVACY" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_my_profile.xml b/indra/newview/skins/default/xui/ja/panel_my_profile.xml
deleted file mode 100644
index a0d99ba5a8f..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="プロフィール" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=ja
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/billing.php?lang=ja
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="なし"/>
-	<string name="no_group_text" value="なし"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							ユーザー名
-						</text>
-						<text name="name_descr_text">
-							表示名
-						</text>
-						<button label="プロフィール" name="see_profile_btn" tool_tip="このアバターのプロフィールを表示"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_notes.xml b/indra/newview/skins/default/xui/ja/panel_notes.xml
deleted file mode 100644
index aa6d823c59f..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="メモとプライバシー" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="個人的メモ:"/>
-					<text name="status_message2" value="この人に許可:"/>
-					<check_box label="オンライン状態の確認" name="status_check"/>
-					<check_box label="地図で居場所を確認" name="map_check"/>
-					<check_box label="私のオブジェクトの編集・削除・取得" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="フレンド登録" name="add_friend" tool_tip="フレンド登録を申し出ます"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="インスタントメッセージを開きます"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="コール" name="call" tool_tip="この住人にコールする"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="地図" name="show_on_map_btn" tool_tip="住人を地図上で表示する"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_profile.xml b/indra/newview/skins/default/xui/ja/panel_profile.xml
deleted file mode 100644
index 1acad9f81aa..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_profile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="プロフィール" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=ja-JP
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=ja
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=ja-JP"/>
-	<string name="no_partner_text" value="なし"/>
-	<string name="no_group_text" value="なし"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="現実世界:"/>
-					</panel>
-					<text name="title_member_text" value="住人登録:"/>
-					<text name="title_acc_status_text" value="アカウントの状態:"/>
-					<text_editor name="acc_status_text">
-						住人。 支払情報未登録。
-              リンデン。
-					</text_editor>
-					<text name="title_partner_text" value="パートナー:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(取得中)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="グループ:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="フレンド登録" name="add_friend" tool_tip="フレンド登録を申し出ます"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="インスタントメッセージを開きます"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="コール" name="call" tool_tip="この住人にコールする"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="住人にお金を渡すか持ち物を共有します"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="プロフィールの編集" name="edit_profile_btn" tool_tip="個人的な情報を編集します"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_profile_view.xml b/indra/newview/skins/default/xui/ja/panel_profile_view.xml
deleted file mode 100644
index 5cb65757731..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_profile_view.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		オンライン
-	</string>
-	<string name="status_offline">
-		オフライン
-	</string>
-	<text name="display_name_label" value="表示名:"/>
-	<text name="solo_username_label" value="ユーザー名:"/>
-	<text name="status" value="オンライン"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<text name="user_name" value="Jack Linden"/>
-	<button name="copy_to_clipboard" tool_tip="クリップボードにコピー"/>
-	<text name="user_label" value="ユーザー名:"/>
-	<text name="user_slid" value="jack.linden"/>
-	<tab_container name="tabs">
-		<panel label="プロフィール" name="panel_profile"/>
-		<panel label="ピック" name="panel_picks"/>
-		<panel label="メモとプライバシー" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_my_profile.xml b/indra/newview/skins/default/xui/pl/panel_my_profile.xml
deleted file mode 100644
index cdc833241d6..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Żadne"/>
-	<string name="no_group_text" value="Żadne"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nazwa użytkownika
-						</text>
-						<text name="name_descr_text">
-							Wyświetlana nazwa
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Zobacz profil tego awatara"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_notes.xml b/indra/newview/skins/default/xui/pl/panel_notes.xml
deleted file mode 100644
index 571171d64c7..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notatki &amp; Prywatność" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Notatki:"/>
-					<text name="status_message2" value="Pozwól tej osobie na:"/>
-					<check_box label="Widzenie mojego statusu" name="status_check"/>
-					<check_box label="Lokalizowanie mnie na mapie" name="map_check"/>
-					<check_box label="Edytowanie, kasowanie lub zabieranie moich obiektów" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Dodaj do Znajomych" name="add_friend" tool_tip="Zaoferuj znajomość Rezydentowi"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Dzwoń" name="call" tool_tip="Zadzwoń do Rezydenta"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mapa" name="show_on_map_btn" tool_tip="Pokaż Rezydenta na mapie"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_profile.xml b/indra/newview/skins/default/xui/pl/panel_profile.xml
deleted file mode 100644
index 77dd951bc42..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_profile.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Brak"/>
-	<string name="no_group_text" value="Żadne"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Życie#1:"/>
-					</panel>
-					<text name="title_member_text" value="Urodziny:"/>
-					<text name="title_acc_status_text" value="Konto:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(przetwarzanie)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupy:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Poznaj" name="add_friend" tool_tip="Zaproponuj znajomość Rezydentowi"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Dzwoń" name="call" tool_tip="Zadzwoń do tego Rezydenta"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Zapłać lub udostępnij obiekt Rezydentowi"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Edytuj profil" name="edit_profile_btn" tool_tip="Edytuj informacje o sobie"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_profile_view.xml b/indra/newview/skins/default/xui/pl/panel_profile_view.xml
deleted file mode 100644
index 1fd6bc1d109..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Obecnie w SL
-	</string>
-	<string name="status_offline">
-		Nieaktywny
-	</string>
-	<text name="display_name_label" value="Wyświetlana nazwa:"/>
-	<text name="solo_username_label" value="Nazwa użytkownika:"/>
-	<text name="status" value="Obecnie w SL"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="Kopiuj do schowka"/>
-	<text name="user_label" value="Nazwa użytkownika:"/>
-	<tab_container name="tabs">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="ULUBIONE" name="panel_picks"/>
-		<panel label="NOTATKI &amp; PRYWATNOŚĆ" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_my_profile.xml b/indra/newview/skins/default/xui/pt/panel_my_profile.xml
deleted file mode 100644
index aa15a2445d2..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="no_partner_text" value="Nenhum"/>
-	<string name="no_group_text" value="Nenhum"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nome de usuário
-						</text>
-						<text name="name_descr_text">
-							Nome de tela
-						</text>
-						<button label="Perfil" name="see_profile_btn" tool_tip="Ver o perfil deste avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_notes.xml b/indra/newview/skins/default/xui/pt/panel_notes.xml
deleted file mode 100644
index c15e838b34f..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Anotações e Privacidade" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Minhas anotações privadas:"/>
-					<text name="status_message2" value="Deixar esta pessoa:"/>
-					<check_box label="Ver meu status" name="status_check"/>
-					<check_box label="Ver minha localização no mapa" name="map_check"/>
-					<check_box label="Pegar, editar ou excluir objetos meus" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ligar" name="call" tool_tip="Ligar para este residente"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mapa" name="show_on_map_btn" tool_tip="Exibir o residente no mapa"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_profile.xml b/indra/newview/skins/default/xui/pt/panel_profile.xml
deleted file mode 100644
index 075ef55dee5..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_profile.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=pt-BR
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=pt
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=pt-BR"/>
-	<string name="no_partner_text" value="Ninguém"/>
-	<string name="no_group_text" value="Nenhum"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Mundo real:"/>
-					</panel>
-					<text name="title_member_text" value="Residente desde:"/>
-					<text name="title_acc_status_text" value="Conta:"/>
-					<text name="title_partner_text" value="Parceiro(a):"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(pesquisando)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupos:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ligar" name="call" tool_tip="Ligar para este residente"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Pagar ou compartilhar inventário com o residente"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Editar perfil" name="edit_profile_btn" tool_tip="Editar dados pessoais"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_profile_view.xml b/indra/newview/skins/default/xui/pt/panel_profile_view.xml
deleted file mode 100644
index d81ee08e6cf..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Conectado
-	</string>
-	<string name="status_offline">
-		Desconectado
-	</string>
-	<text name="display_name_label" value="Nome de tela:"/>
-	<text name="solo_username_label" value="Nome de usuário:"/>
-	<text name="status" value="Conectado"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="Copiar para área de transferência"/>
-	<text name="user_label" value="Nome de usuário:"/>
-	<tab_container name="tabs">
-		<panel label="PERFIL" name="panel_profile"/>
-		<panel label="DESTAQUES" name="panel_picks"/>
-		<panel label="ANOTAÇÕES E PRIVACIDADE" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_my_profile.xml b/indra/newview/skins/default/xui/ru/panel_my_profile.xml
deleted file mode 100644
index 9117bfec188..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Профиль" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Нет"/>
-	<string name="no_group_text" value="Нет"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Имя пользователя
-						</text>
-						<text name="name_descr_text">
-							Экранное имя
-						</text>
-						<button label="Профиль" name="see_profile_btn" tool_tip="Посмотреть профиль этого аватара"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_notes.xml b/indra/newview/skins/default/xui/ru/panel_notes.xml
deleted file mode 100644
index f88b4f13c3e..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Заметки и приватность" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Мои личные заметки:"/>
-					<text name="status_message2" value="Разрешить этому жителю:"/>
-					<check_box label="Видеть мой статус в сети" name="status_check"/>
-					<check_box label="Видеть меня на карте" name="map_check"/>
-					<check_box label="Редактировать, удалять или брать мои объекты" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Добавить в друзья" name="add_friend" tool_tip="Предложить дружбу этому жителю"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Начать сеанс IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Позвонить" name="call" tool_tip="Позвонить этому жителю"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Карта" name="show_on_map_btn" tool_tip="Показать жителя на карте"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Телепортация" name="teleport" tool_tip="Предложить телепортацию"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_profile.xml b/indra/newview/skins/default/xui/ru/panel_profile.xml
deleted file mode 100644
index 79c060c050c..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_profile.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Профиль" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Нет"/>
-	<string name="no_group_text" value="Нет"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Реальный мир:"/>
-					</panel>
-					<text name="title_member_text" value="Обитатель SL с:"/>
-					<text name="title_acc_status_text" value="Статус аккаунта:"/>
-					<text name="title_partner_text" value="Партнер:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(получение информации)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Группы:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="В друзья" name="add_friend" tool_tip="Предложить дружбу этому жителю"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Начать сеанс IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Позвонить" name="call" tool_tip="Позвонить этому жителю"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Телепортироваться" name="teleport" tool_tip="Предложить телепортацию"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Заплатить жителю или поделиться с ним вещами"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_profile_view.xml b/indra/newview/skins/default/xui/ru/panel_profile_view.xml
deleted file mode 100644
index c97c5afc018..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Онлайн
-	</string>
-	<string name="status_offline">
-		Оффлайн
-	</string>
-	<text name="display_name_label" value="Экранное имя:"/>
-	<text name="solo_username_label" value="Имя пользователя:"/>
-	<text name="status" value="Онлайн"/>
-	<text name="user_name_small" value="Взгляни-ка, друг, какое длиннющее имя"/>
-	<button name="copy_to_clipboard" tool_tip="Копировать в буфер обмена"/>
-	<text name="user_label" value="Имя пользователя:"/>
-	<tab_container name="tabs">
-		<panel label="ПРОФИЛЬ" name="panel_profile"/>
-		<panel label="ПОДБОРКА" name="panel_picks"/>
-		<panel label="ЗАМЕТКИ И ДОСТУП" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_my_profile.xml b/indra/newview/skins/default/xui/tr/panel_my_profile.xml
deleted file mode 100644
index fc0b9b6e032..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Hiçbiri"/>
-	<string name="no_group_text" value="Hiçbiri"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Kullanıcı adı
-						</text>
-						<text name="name_descr_text">
-							Görüntü Adı
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Bu avatar profiline bak"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_notes.xml b/indra/newview/skins/default/xui/tr/panel_notes.xml
deleted file mode 100644
index ff5b60996ab..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notlar ve Gizlilik" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Özel notlarım:"/>
-					<text name="status_message2" value="Bu kiÅŸiye ÅŸu izinler verilsin:"/>
-					<check_box label="Çevrimiçi durumumu görme" name="status_check"/>
-					<check_box label="Beni haritada görme" name="map_check"/>
-					<check_box label="Nesnelerimi düzenleme, silme veya alma" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Arkadaş Ekle" name="add_friend" tool_tip="Sakine arkadaşlık öner"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="Aİ" name="im" tool_tip="Anlık ileti oturumu aç"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ara" name="call" tool_tip="Bu Sakini ara"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Harita" name="show_on_map_btn" tool_tip="Sakini haritada göster"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Işınla" name="teleport" tool_tip="Işınlama teklif et"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_profile.xml b/indra/newview/skins/default/xui/tr/panel_profile.xml
deleted file mode 100644
index 4b7a9645373..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_profile.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Hiçbiri"/>
-	<string name="no_group_text" value="Hiçbiri"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Gerçek Dünya:"/>
-					</panel>
-					<text name="title_member_text" value="Ne Zamandan Beri SL Sakini:"/>
-					<text name="title_acc_status_text" value="Hesap Durumu:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(alınıyor)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Gruplar:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Arkadaş Ekle" name="add_friend" tool_tip="Sakine arkadaşlık öner"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="Aİ" name="im" tool_tip="Anlık ileti oturumu aç"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ara" name="call" tool_tip="Bu Sakini ara"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Işınla" name="teleport" tool_tip="Işınlama teklif et"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Sakine para öde veya envanteri paylaş"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_profile_view.xml b/indra/newview/skins/default/xui/tr/panel_profile_view.xml
deleted file mode 100644
index 17c5002bd75..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Çevrimiçi
-	</string>
-	<string name="status_offline">
-		Çevrimdışı
-	</string>
-	<text name="display_name_label" value="Ekran Adı:"/>
-	<text name="solo_username_label" value="Kullanıcı Adı:"/>
-	<text name="status" value="Çevrimiçi"/>
-	<text name="user_name_small" value="Bak arkadaşım bu çok uzun bir ad"/>
-	<button name="copy_to_clipboard" tool_tip="Panoya Kopyala"/>
-	<text name="user_label" value="Kullanıcı Adı:"/>
-	<tab_container name="tabs">
-		<panel label="PROFÄ°L" name="panel_profile"/>
-		<panel label="SEÇMELER" name="panel_picks"/>
-		<panel label="NOTLAR &amp; GÄ°ZLÄ°LÄ°K" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_my_profile.xml b/indra/newview/skins/default/xui/zh/panel_my_profile.xml
deleted file mode 100644
index 79817d7be9e..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="檔案" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="ç„¡"/>
-	<string name="no_group_text" value="ç„¡"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							User name
-						</text>
-						<text name="name_descr_text">
-							顯示名稱
-						</text>
-						<button label="檔案" name="see_profile_btn" tool_tip="察看這位化身的檔案"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_notes.xml b/indra/newview/skins/default/xui/zh/panel_notes.xml
deleted file mode 100644
index 875c6bb3284..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notes &amp; Privacy" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="My private notes:"/>
-					<text name="status_message2" value="允許這個人可以:"/>
-					<check_box label="看到我上線狀態" name="status_check"/>
-					<check_box label="在地圖上看見我" name="map_check"/>
-					<check_box label="邊輯,刪除或取下我的物件" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="加為朋友" name="add_friend" tool_tip="向這個居民提出交友邀請"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="開啟即時訊息會話"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="通話" name="call" tool_tip="與這位居民通話"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="地圖" name="show_on_map_btn" tool_tip="在地圖上顯示這個居民"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_profile.xml b/indra/newview/skins/default/xui/zh/panel_profile.xml
deleted file mode 100644
index 502449ac3ab..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_profile.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="檔案" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="ç„¡"/>
-	<string name="no_group_text" value="ç„¡"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="真實世界:"/>
-					</panel>
-					<text name="title_member_text" value="成為居民自:"/>
-					<text name="title_acc_status_text" value="帳戶狀態:"/>
-					<text name="title_partner_text" value="配偶:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(檢索中)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="群組:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="加為朋友" name="add_friend" tool_tip="發出交友邀請給這居民"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="開啟即時訊息會話"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="通話" name="call" tool_tip="與這位居民通話"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="支付金錢,或分享收納區給居民"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_profile_view.xml b/indra/newview/skins/default/xui/zh/panel_profile_view.xml
deleted file mode 100644
index 2684287692f..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		上線
-	</string>
-	<string name="status_offline">
-		離線
-	</string>
-	<text name="display_name_label" value="顯示名稱:"/>
-	<text name="solo_username_label" value="使用者名稱:"/>
-	<text name="status" value="上線"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="覆製到剪貼簿"/>
-	<text name="user_label" value="使用者名稱:"/>
-	<tab_container name="tabs">
-		<panel label="檔案" name="panel_profile"/>
-		<panel label="精選地點" name="panel_picks"/>
-		<panel label="NOTES &amp; PRIVACY" name="panel_notes"/>
-	</tab_container>
-</panel>
-- 
GitLab


From 4924306db50bdf0c621d19455c0d07fbf74859f8 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 18 Nov 2011 09:39:10 -0800
Subject: [PATCH 249/933] fix for notification buttons not being read

---
 indra/llxuixml/llinitparam.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 575e8231bd1..2edb9b98c76 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -945,6 +945,12 @@ namespace LLInitParam
 			return static_cast<self_t&>(param_value_t::operator =(name));
 		}
 
+		self_t& operator =(value_assignment_t val)
+		{
+			set(val);
+			return *this;
+		}
+
 	protected:
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
@@ -1086,6 +1092,12 @@ namespace LLInitParam
 			return static_cast<self_t&>(param_value_t::operator =(name));
 		}
 
+		self_t& operator =(value_assignment_t val)
+		{
+			set(val);
+			return *this;
+		}
+
 		// propagate changed status up to enclosing block
 		/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
 		{ 
@@ -1290,12 +1302,6 @@ namespace LLInitParam
 		}
 
 	protected:
-		self_t& operator=(const self_t& other)
-		{
-			mValues = other.mValues;
-			return *this;
-		}
-
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
 			const self_t& src_typed_param = static_cast<const self_t&>(src);
@@ -1489,11 +1495,6 @@ namespace LLInitParam
 		}
 
 	protected:
-		self_t& operator=(const self_t& other)
-		{
-			mValues = other.mValues;
-			return *this;
-		}
 
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
-- 
GitLab


From b79ccf9dd76104d53e4da6845b970bd13717ff8f Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 18 Nov 2011 20:02:54 +0200
Subject: [PATCH 250/933] EXP-1554 FIXED (Selecting More Info for more than one
 Classified section in Search floater, breaks the navigation history in Picks
 Floater)

- For each classified info create a new instance of LLPanelClassifiedInfo
- Added destructor for LLPanelProfile::ChildStack to avoid memory leak
---
 indra/newview/llpanelpicks.cpp   | 11 ++++-------
 indra/newview/llpanelprofile.cpp | 17 +++++++++++++++++
 indra/newview/llpanelprofile.h   |  1 +
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 50dc66ed7c3..244108162b6 100755
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -1048,13 +1048,10 @@ void LLPanelPicks::createPickInfoPanel()
 
 void LLPanelPicks::createClassifiedInfoPanel()
 {
-	if(!mPanelClassifiedInfo)
-	{
-		mPanelClassifiedInfo = LLPanelClassifiedInfo::create();
-		mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo));
-		mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&LLPanelPicks::onPanelClassifiedEdit, this));
-		mPanelClassifiedInfo->setVisible(FALSE);
-	}
+	mPanelClassifiedInfo = LLPanelClassifiedInfo::create();
+	mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo));
+	mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&LLPanelPicks::onPanelClassifiedEdit, this));
+	mPanelClassifiedInfo->setVisible(FALSE);
 }
 
 void LLPanelPicks::createClassifiedEditPanel(LLPanelClassifiedEdit** panel)
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index c237bf1d060..b1eeabb0282 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -167,6 +167,23 @@ LLPanelProfile::ChildStack::ChildStack()
 {
 }
 
+LLPanelProfile::ChildStack::~ChildStack()
+{
+	while (mStack.size() != 0)
+	{
+		view_list_t& top = mStack.back();
+		for (view_list_t::const_iterator it = top.begin(); it != top.end(); ++it)
+		{
+			LLView* viewp = *it;
+			if (viewp)
+			{
+				delete viewp;
+			}
+		}
+		mStack.pop_back();
+	}
+}
+
 void LLPanelProfile::ChildStack::setParent(LLPanel* parent)
 {
 	llassert_always(parent != NULL);
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index bd4457c240b..d97f60ed229 100755
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -74,6 +74,7 @@ class LLPanelProfile : public LLPanel
 		LOG_CLASS(LLPanelProfile::ChildStack);
 	public:
 		ChildStack();
+		~ChildStack();
 		void setParent(LLPanel* parent);
 
 		bool push();
-- 
GitLab


From 1543f98bab0ca7445c09e63644c8a5e428f9c5b1 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 18 Nov 2011 22:19:57 +0200
Subject: [PATCH 251/933] EXP-1501 FIX Specified help topic for the IM floater.

---
 indra/newview/skins/default/xui/en/floater_im_session.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index cb7d91abb88..0ef6709f112 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -5,6 +5,7 @@
  default_tab_group="1"
  follows="all"
  height="350"
+ help_topic="floater_im_box"
  layout="topleft"
  name="panel_im"
  can_dock="false"
-- 
GitLab


From 649beed53bd44ae5b06cd36f40897ed561fe48ab Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 18 Nov 2011 22:23:09 +0200
Subject: [PATCH 252/933] EXP-1577 FIX Made agent profile position and size
 persistent.

Enable My Profile to use saved_rect.
Value of the "WebProfileRect" setting is ignored in this case.
---
 indra/newview/llavataractions.cpp             | 31 +++++++--
 indra/newview/llviewerfloaterreg.cpp          |  1 +
 indra/newview/llviewermenu.cpp                |  2 +-
 .../default/xui/en/floater_my_web_profile.xml |  9 +++
 .../default/xui/en/panel_snapshot_local.xml   | 65 +++++++++++++++++++
 5 files changed, 101 insertions(+), 7 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_my_web_profile.xml

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 10fd6b739e6..7f6abb09375 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -302,6 +302,25 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids)
 	make_ui_sound("UISndStartIM");
 }
 
+static const LLRect& get_preferred_profile_rect(const LLUUID& avatar_id)
+{
+	if (avatar_id == gAgentID)
+	{
+		return LLRect::null; // no preference
+	}
+
+	// Preferred size for all residents' profiles except our own,
+	// for which saved_rect will be used.
+	static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect");
+	return profile_rect;
+}
+
+static const char* get_profile_floater_name(const LLUUID& avatar_id)
+{
+	// Use different floater XML for our profile to be able to save its rect.
+	return avatar_id == gAgentID ? "my_profile" : "profile";
+}
+
 static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
 {
 	std::string username = av_name.mUsername;
@@ -315,14 +334,13 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa
 
 	// PROFILES: open in webkit window
 	const bool show_chrome = false;
-	static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect");
 	LLFloaterWebContent::Params p;
 	p.url(url).
 		id(agent_id.asString()).
 		show_chrome(show_chrome).
 		window_class("profile").
-		preferred_media_size(profile_rect);
-	LLFloaterReg::showInstance("profile", p);
+		preferred_media_size(get_preferred_profile_rect(agent_id));
+	LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p);
 }
 
 // static
@@ -339,14 +357,15 @@ bool LLAvatarActions::profileVisible(const LLUUID& id)
 {
 	LLSD sd;
 	sd["id"] = id;
-	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", sd));
+	LLFloater* browser = getProfileFloater(id);
 	return browser && browser->isShown();
 }
 
 //static
 LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id)
 {
-	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", LLSD().with("id", id)));
+	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*>
+		(LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id)));
 	return browser;
 }
 
@@ -355,7 +374,7 @@ void LLAvatarActions::hideProfile(const LLUUID& id)
 {
 	LLSD sd;
 	sd["id"] = id;
-	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", sd));
+	LLFloater* browser = getProfileFloater(id);
 	if (browser)
 	{
 		browser->closeFloater();
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 273bf822bcf..0ec8cc1d4ea 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -285,6 +285,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>);
 	LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>);
 	LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>);
+	LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
 	LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);	
 	LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);	
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 22d95563d86..81311b03f54 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -3122,7 +3122,7 @@ void handle_avatar_eject(const LLSD& avatar_id)
 
 bool my_profile_visible()
 {
-	LLFloater* floaterp = LLFloaterReg::findInstance("profile", LLSD().with("id", gAgent.getID()));
+	LLFloater* floaterp = LLAvatarActions::getProfileFloater(gAgentID);
 	return floaterp && floaterp->isInVisibleChain();
 }
 
diff --git a/indra/newview/skins/default/xui/en/floater_my_web_profile.xml b/indra/newview/skins/default/xui/en/floater_my_web_profile.xml
new file mode 100644
index 00000000000..df46fc198f2
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_my_web_profile.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater name="floater_my_web_profile"
+         help_topic="web_profile"
+         width="780"
+         height="775"
+         save_rect="true"
+         single_instance="true"
+         reuse_instance="false"
+         filename="floater_web_content.xml"/>
\ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index 4d6c4bcdfac..a9b373430ab 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -80,6 +80,7 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
+<!--
     <spinner
      allow_text_entry="false"
      decimal_digits="0"
@@ -167,6 +168,70 @@
      width="60">
        ([QLVL])
     </text>
+ -->
+    <layout_stack
+     follows="all"
+     height="275"
+     layout="bottomleft"
+     name="edit_panel_ls"
+     left_delta="0"
+     orientation="vertical"
+     top_pad="10"
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="23"
+         layout="topleft"
+         left="0"
+         name="size_controls_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <button
+             follows="top|left|right"
+             height="23"
+             label="Info"
+             layout="topleft"
+             name="info_btn"
+             tab_stop="false"
+             tool_tip="Show pick information"
+             right="-1" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="23"
+         layout="topleft"
+         left="0"
+         name="test_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <button
+             follows="top|left|right"
+             height="23"
+             label="Test"
+             layout="topleft"
+             name="test_btn"
+             tab_stop="false"
+             tool_tip="Show pick information"
+             right="-1" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="28"
+         layout="topleft"
+         left="0"
+         name="spacer_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true" />
+    </layout_stack>
     <button
      follows="right|bottom"
      height="23"
-- 
GitLab


From b1b852ce6c73f5723df5ed5a0c729da7df847c26 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 18 Nov 2011 23:01:35 +0200
Subject: [PATCH 253/933] EXP-1577 FOLLOWUP Reverting an accidentally submitted
 change.

---
 .../default/xui/en/panel_snapshot_local.xml   | 65 -------------------
 1 file changed, 65 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index a9b373430ab..4d6c4bcdfac 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -80,7 +80,6 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-<!--
     <spinner
      allow_text_entry="false"
      decimal_digits="0"
@@ -168,70 +167,6 @@
      width="60">
        ([QLVL])
     </text>
- -->
-    <layout_stack
-     follows="all"
-     height="275"
-     layout="bottomleft"
-     name="edit_panel_ls"
-     left_delta="0"
-     orientation="vertical"
-     top_pad="10"
-     right="-10">
-        <layout_panel
-         follows="top|left|right"
-         height="23"
-         layout="topleft"
-         left="0"
-         name="size_controls_lp"
-         user_resize="false" 
-         auto_resize="false"
-         top="0"
-         right="-1"
-         visible="true">
-            <button
-             follows="top|left|right"
-             height="23"
-             label="Info"
-             layout="topleft"
-             name="info_btn"
-             tab_stop="false"
-             tool_tip="Show pick information"
-             right="-1" />
-        </layout_panel>
-        <layout_panel
-         follows="top|left|right"
-         height="23"
-         layout="topleft"
-         left="0"
-         name="test_lp"
-         user_resize="false" 
-         auto_resize="true"
-         top="0"
-         right="-1"
-         visible="true">
-            <button
-             follows="top|left|right"
-             height="23"
-             label="Test"
-             layout="topleft"
-             name="test_btn"
-             tab_stop="false"
-             tool_tip="Show pick information"
-             right="-1" />
-        </layout_panel>
-        <layout_panel
-         follows="top|left|right"
-         height="28"
-         layout="topleft"
-         left="0"
-         name="spacer_lp"
-         user_resize="false" 
-         auto_resize="true"
-         top="0"
-         right="-1"
-         visible="true" />
-    </layout_stack>
     <button
      follows="right|bottom"
      height="23"
-- 
GitLab


From 50112c163a1d7fcea4bd3be815d6eddd7d44364e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 18 Nov 2011 15:03:37 -0600
Subject: [PATCH 254/933] SH-2699 Potential fix for occlusion culling being
 overly aggressive on 9800 GT

---
 indra/newview/llspatialpartition.cpp |  13 -
 indra/newview/pipeline.cpp           | 565 ++++++++++++++-------------
 2 files changed, 290 insertions(+), 288 deletions(-)

diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 3fecc338027..3e16ccf3dac 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1642,19 +1642,6 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 		{
 			if (!isOcclusionState(QUERY_PENDING) || isOcclusionState(DISCARD_QUERY))
 			{
-				bool check = true;
-
-				if (isOcclusionState(QUERY_PENDING))
-				{
-					GLuint available = 0;
-					glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
-					if (available == GL_FALSE)
-					{
-						check = false;
-					}
-				}
-
-				if (check)
 				{ //no query pending, or previous query to be discarded
 					LLFastTimer t(FTM_RENDER_OCCLUSION);
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5e9f0e3efec..d8e271811a3 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8737,378 +8737,393 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	// convenience array of 4 near clip plane distances
 	F32 dist[] = { near_clip, mSunClipPlanes.mV[0], mSunClipPlanes.mV[1], mSunClipPlanes.mV[2], mSunClipPlanes.mV[3] };
 	
-	for (S32 j = 0; j < 4; j++)
-	{
-		if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA))
+
+	if (mSunDiffuse == LLColor4::black)
+	{ //sun diffuse is totally black, shadows don't matter
+		LLGLDepthTest depth(GL_TRUE);
+
+		for (S32 j = 0; j < 4; j++)
 		{
-			mShadowFrustPoints[j].clear();
+			mShadow[j].bindTarget();
+			mShadow[j].clear();
+			mShadow[j].flush();
 		}
+	}
+	else
+	{
+		for (S32 j = 0; j < 4; j++)
+		{
+			if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA))
+			{
+				mShadowFrustPoints[j].clear();
+			}
 
-		LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+j;
+			LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+j;
 
-		//restore render matrices
-		glh_set_current_modelview(saved_view);
-		glh_set_current_projection(saved_proj);
+			//restore render matrices
+			glh_set_current_modelview(saved_view);
+			glh_set_current_projection(saved_proj);
 
-		LLVector3 eye = camera.getOrigin();
+			LLVector3 eye = camera.getOrigin();
 
-		//camera used for shadow cull/render
-		LLCamera shadow_cam;
+			//camera used for shadow cull/render
+			LLCamera shadow_cam;
 		
-		//create world space camera frustum for this split
-		shadow_cam = camera;
-		shadow_cam.setFar(16.f);
+			//create world space camera frustum for this split
+			shadow_cam = camera;
+			shadow_cam.setFar(16.f);
 	
-		LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE);
+			LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE);
 
-		LLVector3* frust = shadow_cam.mAgentFrustum;
+			LLVector3* frust = shadow_cam.mAgentFrustum;
 
-		LLVector3 pn = shadow_cam.getAtAxis();
+			LLVector3 pn = shadow_cam.getAtAxis();
 		
-		LLVector3 min, max;
+			LLVector3 min, max;
 
-		//construct 8 corners of split frustum section
-		for (U32 i = 0; i < 4; i++)
-		{
-			LLVector3 delta = frust[i+4]-eye;
-			delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f;
-			delta.normVec();
-			F32 dp = delta*pn;
-			frust[i] = eye + (delta*dist[j]*0.95f)/dp;
-			frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp;
-		}
+			//construct 8 corners of split frustum section
+			for (U32 i = 0; i < 4; i++)
+			{
+				LLVector3 delta = frust[i+4]-eye;
+				delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f;
+				delta.normVec();
+				F32 dp = delta*pn;
+				frust[i] = eye + (delta*dist[j]*0.95f)/dp;
+				frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp;
+			}
 						
-		shadow_cam.calcAgentFrustumPlanes(frust);
-		shadow_cam.mFrustumCornerDist = 0.f;
+			shadow_cam.calcAgentFrustumPlanes(frust);
+			shadow_cam.mFrustumCornerDist = 0.f;
 		
-		if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
-		{
-			mShadowCamera[j] = shadow_cam;
-		}
-
-		std::vector<LLVector3> fp;
-
-		if (!gPipeline.getVisiblePointCloud(shadow_cam, min, max, fp, lightDir))
-		{
-			//no possible shadow receivers
 			if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
 			{
-				mShadowExtents[j][0] = LLVector3();
-				mShadowExtents[j][1] = LLVector3();
-				mShadowCamera[j+4] = shadow_cam;
-			}
-
-			mShadow[j].bindTarget();
-			{
-				LLGLDepthTest depth(GL_TRUE);
-				mShadow[j].clear();
+				mShadowCamera[j] = shadow_cam;
 			}
-			mShadow[j].flush();
 
-			mShadowError.mV[j] = 0.f;
-			mShadowFOV.mV[j] = 0.f;
-
-			continue;
-		}
+			std::vector<LLVector3> fp;
 
-		if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
-		{
-			mShadowExtents[j][0] = min;
-			mShadowExtents[j][1] = max;
-			mShadowFrustPoints[j] = fp;
-		}
-				
+			if (!gPipeline.getVisiblePointCloud(shadow_cam, min, max, fp, lightDir))
+			{
+				//no possible shadow receivers
+				if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
+				{
+					mShadowExtents[j][0] = LLVector3();
+					mShadowExtents[j][1] = LLVector3();
+					mShadowCamera[j+4] = shadow_cam;
+				}
 
-		//find a good origin for shadow projection
-		LLVector3 origin;
+				mShadow[j].bindTarget();
+				{
+					LLGLDepthTest depth(GL_TRUE);
+					mShadow[j].clear();
+				}
+				mShadow[j].flush();
 
-		//get a temporary view projection
-		view[j] = look(camera.getOrigin(), lightDir, -up);
+				mShadowError.mV[j] = 0.f;
+				mShadowFOV.mV[j] = 0.f;
 
-		std::vector<LLVector3> wpf;
+				continue;
+			}
 
-		for (U32 i = 0; i < fp.size(); i++)
-		{
-			glh::vec3f p = glh::vec3f(fp[i].mV);
-			view[j].mult_matrix_vec(p);
-			wpf.push_back(LLVector3(p.v));
-		}
+			if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
+			{
+				mShadowExtents[j][0] = min;
+				mShadowExtents[j][1] = max;
+				mShadowFrustPoints[j] = fp;
+			}
+				
 
-		min = wpf[0];
-		max = wpf[0];
+			//find a good origin for shadow projection
+			LLVector3 origin;
 
-		for (U32 i = 0; i < fp.size(); ++i)
-		{ //get AABB in camera space
-			update_min_max(min, max, wpf[i]);
-		}
-
-		// Construct a perspective transform with perspective along y-axis that contains
-		// points in wpf
-		//Known:
-		// - far clip plane
-		// - near clip plane
-		// - points in frustum
-		//Find:
-		// - origin
-
-		//get some "interesting" points of reference
-		LLVector3 center = (min+max)*0.5f;
-		LLVector3 size = (max-min)*0.5f;
-		LLVector3 near_center = center;
-		near_center.mV[1] += size.mV[1]*2.f;
-		
-		
-		//put all points in wpf in quadrant 0, reletive to center of min/max
-		//get the best fit line using least squares
-		F32 bfm = 0.f;
-		F32 bfb = 0.f;
+			//get a temporary view projection
+			view[j] = look(camera.getOrigin(), lightDir, -up);
 
-		for (U32 i = 0; i < wpf.size(); ++i)
-		{
-			wpf[i] -= center;
-			wpf[i].mV[0] = fabsf(wpf[i].mV[0]);
-			wpf[i].mV[2] = fabsf(wpf[i].mV[2]);
-		}
+			std::vector<LLVector3> wpf;
 
-		if (!wpf.empty())
-		{ 
-			F32 sx = 0.f;
-			F32 sx2 = 0.f;
-			F32 sy = 0.f;
-			F32 sxy = 0.f;
-			
-			for (U32 i = 0; i < wpf.size(); ++i)
-			{		
-				sx += wpf[i].mV[0];
-				sx2 += wpf[i].mV[0]*wpf[i].mV[0];
-				sy += wpf[i].mV[1];
-				sxy += wpf[i].mV[0]*wpf[i].mV[1]; 
+			for (U32 i = 0; i < fp.size(); i++)
+			{
+				glh::vec3f p = glh::vec3f(fp[i].mV);
+				view[j].mult_matrix_vec(p);
+				wpf.push_back(LLVector3(p.v));
 			}
 
-			bfm = (sy*sx-wpf.size()*sxy)/(sx*sx-wpf.size()*sx2);
-			bfb = (sx*sxy-sy*sx2)/(sx*sx-bfm*sx2);
-		}
-		
-		{
-			// best fit line is y=bfm*x+bfb
-		
-			//find point that is furthest to the right of line
-			F32 off_x = -1.f;
-			LLVector3 lp;
-
-			for (U32 i = 0; i < wpf.size(); ++i)
-			{
-				//y = bfm*x+bfb
-				//x = (y-bfb)/bfm
-				F32 lx = (wpf[i].mV[1]-bfb)/bfm;
+			min = wpf[0];
+			max = wpf[0];
 
-				lx = wpf[i].mV[0]-lx;
-				
-				if (off_x < lx)
-				{
-					off_x = lx;
-					lp = wpf[i];
-				}
+			for (U32 i = 0; i < fp.size(); ++i)
+			{ //get AABB in camera space
+				update_min_max(min, max, wpf[i]);
 			}
 
-			//get line with slope bfm through lp
-			// bfb = y-bfm*x
-			bfb = lp.mV[1]-bfm*lp.mV[0];
+			// Construct a perspective transform with perspective along y-axis that contains
+			// points in wpf
+			//Known:
+			// - far clip plane
+			// - near clip plane
+			// - points in frustum
+			//Find:
+			// - origin
 
-			//calculate error
-			mShadowError.mV[j] = 0.f;
+			//get some "interesting" points of reference
+			LLVector3 center = (min+max)*0.5f;
+			LLVector3 size = (max-min)*0.5f;
+			LLVector3 near_center = center;
+			near_center.mV[1] += size.mV[1]*2.f;
+		
+		
+			//put all points in wpf in quadrant 0, reletive to center of min/max
+			//get the best fit line using least squares
+			F32 bfm = 0.f;
+			F32 bfb = 0.f;
 
 			for (U32 i = 0; i < wpf.size(); ++i)
 			{
-				F32 lx = (wpf[i].mV[1]-bfb)/bfm;
-				mShadowError.mV[j] += fabsf(wpf[i].mV[0]-lx);
+				wpf[i] -= center;
+				wpf[i].mV[0] = fabsf(wpf[i].mV[0]);
+				wpf[i].mV[2] = fabsf(wpf[i].mV[2]);
 			}
 
-			mShadowError.mV[j] /= wpf.size();
-			mShadowError.mV[j] /= size.mV[0];
+			if (!wpf.empty())
+			{ 
+				F32 sx = 0.f;
+				F32 sx2 = 0.f;
+				F32 sy = 0.f;
+				F32 sxy = 0.f;
+			
+				for (U32 i = 0; i < wpf.size(); ++i)
+				{		
+					sx += wpf[i].mV[0];
+					sx2 += wpf[i].mV[0]*wpf[i].mV[0];
+					sy += wpf[i].mV[1];
+					sxy += wpf[i].mV[0]*wpf[i].mV[1]; 
+				}
 
-			if (mShadowError.mV[j] > RenderShadowErrorCutoff)
-			{ //just use ortho projection
-				mShadowFOV.mV[j] = -1.f;
-				origin.clearVec();
-				proj[j] = gl_ortho(min.mV[0], max.mV[0],
-									min.mV[1], max.mV[1],
-									-max.mV[2], -min.mV[2]);
+				bfm = (sy*sx-wpf.size()*sxy)/(sx*sx-wpf.size()*sx2);
+				bfb = (sx*sxy-sy*sx2)/(sx*sx-bfm*sx2);
 			}
-			else
+		
 			{
-				//origin is where line x = 0;
-				origin.setVec(0,bfb,0);
-
-				F32 fovz = 1.f;
-				F32 fovx = 1.f;
-				
-				LLVector3 zp;
-				LLVector3 xp;
+				// best fit line is y=bfm*x+bfb
+		
+				//find point that is furthest to the right of line
+				F32 off_x = -1.f;
+				LLVector3 lp;
 
 				for (U32 i = 0; i < wpf.size(); ++i)
 				{
-					LLVector3 atz = wpf[i]-origin;
-					atz.mV[0] = 0.f;
-					atz.normVec();
-					if (fovz > -atz.mV[1])
-					{
-						zp = wpf[i];
-						fovz = -atz.mV[1];
-					}
-					
-					LLVector3 atx = wpf[i]-origin;
-					atx.mV[2] = 0.f;
-					atx.normVec();
-					if (fovx > -atx.mV[1])
+					//y = bfm*x+bfb
+					//x = (y-bfb)/bfm
+					F32 lx = (wpf[i].mV[1]-bfb)/bfm;
+
+					lx = wpf[i].mV[0]-lx;
+				
+					if (off_x < lx)
 					{
-						fovx = -atx.mV[1];
-						xp = wpf[i];
+						off_x = lx;
+						lp = wpf[i];
 					}
 				}
 
-				fovx = acos(fovx);
-				fovz = acos(fovz);
+				//get line with slope bfm through lp
+				// bfb = y-bfm*x
+				bfb = lp.mV[1]-bfm*lp.mV[0];
 
-				F32 cutoff = llmin((F32) RenderShadowFOVCutoff, 1.4f);
-				
-				mShadowFOV.mV[j] = fovx;
-				
-				if (fovx < cutoff && fovz > cutoff)
+				//calculate error
+				mShadowError.mV[j] = 0.f;
+
+				for (U32 i = 0; i < wpf.size(); ++i)
 				{
-					//x is a good fit, but z is too big, move away from zp enough so that fovz matches cutoff
-					F32 d = zp.mV[2]/tan(cutoff);
-					F32 ny = zp.mV[1] + fabsf(d);
+					F32 lx = (wpf[i].mV[1]-bfb)/bfm;
+					mShadowError.mV[j] += fabsf(wpf[i].mV[0]-lx);
+				}
 
-					origin.mV[1] = ny;
+				mShadowError.mV[j] /= wpf.size();
+				mShadowError.mV[j] /= size.mV[0];
 
-					fovz = 1.f;
-					fovx = 1.f;
+				if (mShadowError.mV[j] > RenderShadowErrorCutoff)
+				{ //just use ortho projection
+					mShadowFOV.mV[j] = -1.f;
+					origin.clearVec();
+					proj[j] = gl_ortho(min.mV[0], max.mV[0],
+										min.mV[1], max.mV[1],
+										-max.mV[2], -min.mV[2]);
+				}
+				else
+				{
+					//origin is where line x = 0;
+					origin.setVec(0,bfb,0);
+
+					F32 fovz = 1.f;
+					F32 fovx = 1.f;
+				
+					LLVector3 zp;
+					LLVector3 xp;
 
 					for (U32 i = 0; i < wpf.size(); ++i)
 					{
 						LLVector3 atz = wpf[i]-origin;
 						atz.mV[0] = 0.f;
 						atz.normVec();
-						fovz = llmin(fovz, -atz.mV[1]);
-
+						if (fovz > -atz.mV[1])
+						{
+							zp = wpf[i];
+							fovz = -atz.mV[1];
+						}
+					
 						LLVector3 atx = wpf[i]-origin;
 						atx.mV[2] = 0.f;
 						atx.normVec();
-						fovx = llmin(fovx, -atx.mV[1]);
+						if (fovx > -atx.mV[1])
+						{
+							fovx = -atx.mV[1];
+							xp = wpf[i];
+						}
 					}
 
 					fovx = acos(fovx);
 					fovz = acos(fovz);
 
-					mShadowFOV.mV[j] = cutoff;
-				}
+					F32 cutoff = llmin((F32) RenderShadowFOVCutoff, 1.4f);
+				
+					mShadowFOV.mV[j] = fovx;
+				
+					if (fovx < cutoff && fovz > cutoff)
+					{
+						//x is a good fit, but z is too big, move away from zp enough so that fovz matches cutoff
+						F32 d = zp.mV[2]/tan(cutoff);
+						F32 ny = zp.mV[1] + fabsf(d);
+
+						origin.mV[1] = ny;
+
+						fovz = 1.f;
+						fovx = 1.f;
+
+						for (U32 i = 0; i < wpf.size(); ++i)
+						{
+							LLVector3 atz = wpf[i]-origin;
+							atz.mV[0] = 0.f;
+							atz.normVec();
+							fovz = llmin(fovz, -atz.mV[1]);
+
+							LLVector3 atx = wpf[i]-origin;
+							atx.mV[2] = 0.f;
+							atx.normVec();
+							fovx = llmin(fovx, -atx.mV[1]);
+						}
+
+						fovx = acos(fovx);
+						fovz = acos(fovz);
+
+						mShadowFOV.mV[j] = cutoff;
+					}
 
 				
-				origin += center;
+					origin += center;
 			
-				F32 ynear = -(max.mV[1]-origin.mV[1]);
-				F32 yfar = -(min.mV[1]-origin.mV[1]);
+					F32 ynear = -(max.mV[1]-origin.mV[1]);
+					F32 yfar = -(min.mV[1]-origin.mV[1]);
 				
-				if (ynear < 0.1f) //keep a sensible near clip plane
-				{
-					F32 diff = 0.1f-ynear;
-					origin.mV[1] += diff;
-					ynear += diff;
-					yfar += diff;
-				}
+					if (ynear < 0.1f) //keep a sensible near clip plane
+					{
+						F32 diff = 0.1f-ynear;
+						origin.mV[1] += diff;
+						ynear += diff;
+						yfar += diff;
+					}
 								
-				if (fovx > cutoff)
-				{ //just use ortho projection
-					origin.clearVec();
-					mShadowError.mV[j] = -1.f;
-					proj[j] = gl_ortho(min.mV[0], max.mV[0],
-							min.mV[1], max.mV[1],
-							-max.mV[2], -min.mV[2]);
-				}
-				else
-				{
-					//get perspective projection
-					view[j] = view[j].inverse();
+					if (fovx > cutoff)
+					{ //just use ortho projection
+						origin.clearVec();
+						mShadowError.mV[j] = -1.f;
+						proj[j] = gl_ortho(min.mV[0], max.mV[0],
+								min.mV[1], max.mV[1],
+								-max.mV[2], -min.mV[2]);
+					}
+					else
+					{
+						//get perspective projection
+						view[j] = view[j].inverse();
 
-					glh::vec3f origin_agent(origin.mV);
+						glh::vec3f origin_agent(origin.mV);
 					
-					//translate view to origin
-					view[j].mult_matrix_vec(origin_agent);
+						//translate view to origin
+						view[j].mult_matrix_vec(origin_agent);
 
-					eye = LLVector3(origin_agent.v);
+						eye = LLVector3(origin_agent.v);
 
-					if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
-					{
-						mShadowFrustOrigin[j] = eye;
-					}
+						if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
+						{
+							mShadowFrustOrigin[j] = eye;
+						}
 				
-					view[j] = look(LLVector3(origin_agent.v), lightDir, -up);
+						view[j] = look(LLVector3(origin_agent.v), lightDir, -up);
 
-					F32 fx = 1.f/tanf(fovx);
-					F32 fz = 1.f/tanf(fovz);
+						F32 fx = 1.f/tanf(fovx);
+						F32 fz = 1.f/tanf(fovz);
 
-					proj[j] = glh::matrix4f(-fx, 0, 0, 0,
-											0, (yfar+ynear)/(ynear-yfar), 0, (2.f*yfar*ynear)/(ynear-yfar),
-											0, 0, -fz, 0,
-											0, -1.f, 0, 0);
+						proj[j] = glh::matrix4f(-fx, 0, 0, 0,
+												0, (yfar+ynear)/(ynear-yfar), 0, (2.f*yfar*ynear)/(ynear-yfar),
+												0, 0, -fz, 0,
+												0, -1.f, 0, 0);
+					}
 				}
 			}
-		}
 
-		//shadow_cam.setFar(128.f);
-		shadow_cam.setOriginAndLookAt(eye, up, center);
+			//shadow_cam.setFar(128.f);
+			shadow_cam.setOriginAndLookAt(eye, up, center);
 
-		shadow_cam.setOrigin(0,0,0);
+			shadow_cam.setOrigin(0,0,0);
 
-		glh_set_current_modelview(view[j]);
-		glh_set_current_projection(proj[j]);
+			glh_set_current_modelview(view[j]);
+			glh_set_current_projection(proj[j]);
 
-		LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE);
+			LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE);
 
-		//shadow_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR);
-		shadow_cam.getAgentPlane(LLCamera::AGENT_PLANE_NEAR).set(shadow_near_clip);
+			//shadow_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR);
+			shadow_cam.getAgentPlane(LLCamera::AGENT_PLANE_NEAR).set(shadow_near_clip);
 
-		//translate and scale to from [-1, 1] to [0, 1]
-		glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f,
-						0.f, 0.5f, 0.f, 0.5f,
-						0.f, 0.f, 0.5f, 0.5f,
-						0.f, 0.f, 0.f, 1.f);
+			//translate and scale to from [-1, 1] to [0, 1]
+			glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f,
+							0.f, 0.5f, 0.f, 0.5f,
+							0.f, 0.f, 0.5f, 0.5f,
+							0.f, 0.f, 0.f, 1.f);
 
-		glh_set_current_modelview(view[j]);
-		glh_set_current_projection(proj[j]);
+			glh_set_current_modelview(view[j]);
+			glh_set_current_projection(proj[j]);
 
-		for (U32 i = 0; i < 16; i++)
-		{
-			gGLLastModelView[i] = mShadowModelview[j].m[i];
-			gGLLastProjection[i] = mShadowProjection[j].m[i];
-		}
+			for (U32 i = 0; i < 16; i++)
+			{
+				gGLLastModelView[i] = mShadowModelview[j].m[i];
+				gGLLastProjection[i] = mShadowProjection[j].m[i];
+			}
 
-		mShadowModelview[j] = view[j];
-		mShadowProjection[j] = proj[j];
+			mShadowModelview[j] = view[j];
+			mShadowProjection[j] = proj[j];
 
 	
-		mSunShadowMatrix[j] = trans*proj[j]*view[j]*inv_view;
+			mSunShadowMatrix[j] = trans*proj[j]*view[j]*inv_view;
 		
-		stop_glerror();
+			stop_glerror();
 
-		mShadow[j].bindTarget();
-		mShadow[j].getViewport(gGLViewport);
-		mShadow[j].clear();
+			mShadow[j].bindTarget();
+			mShadow[j].getViewport(gGLViewport);
+			mShadow[j].clear();
 		
-		{
-			static LLCullResult result[4];
+			{
+				static LLCullResult result[4];
 
-			//LLGLEnable enable(GL_DEPTH_CLAMP_NV);
-			renderShadow(view[j], proj[j], shadow_cam, result[j], TRUE);
-		}
+				//LLGLEnable enable(GL_DEPTH_CLAMP_NV);
+				renderShadow(view[j], proj[j], shadow_cam, result[j], TRUE);
+			}
 
-		mShadow[j].flush();
+			mShadow[j].flush();
  
-		if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
-		{
-			LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE);
-			mShadowCamera[j+4] = shadow_cam;
+			if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
+			{
+				LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE);
+				mShadowCamera[j+4] = shadow_cam;
+			}
 		}
 	}
 
-- 
GitLab


From 5c690db63ff118b6bc66fe1607624a59f4162b30 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 18 Nov 2011 15:04:26 -0600
Subject: [PATCH 255/933] SH-2700 Fix for random black textures due to texture
 index out of bounds.  Also change shader to show bright pink on index out of
 bounds and add assertions to help prevent this sort of bug in the future.

---
 indra/llrender/llshadermgr.cpp    |  4 ++--
 indra/llrender/llvertexbuffer.cpp | 19 +++++++++++++++++++
 indra/newview/llface.cpp          |  2 ++
 indra/newview/llvovolume.cpp      |  2 +-
 4 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 75c584daab0..eea768a3eae 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -695,7 +695,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 			}
 
 			text[count++] = strdup("\t}\n");
-			text[count++] = strdup("\treturn vec4(0,0,0,0);\n");
+			text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
 			text[count++] = strdup("}\n");
 		}
 		else
@@ -718,7 +718,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 				text[count++] = strdup(if_str.c_str());
 			}
 
-			text[count++] = strdup("\treturn vec4(0,0,0,0);\n");
+			text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
 			text[count++] = strdup("}\n");
 		}			
 	}
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index b426421f88e..3948145580b 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -511,6 +511,25 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
 				llerrs << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << llendl;
 			}
 		}
+
+		LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+		if (shader && shader->mFeatures.mIndexedTextureChannels > 1)
+		{
+			LLStrider<LLVector4a> v;
+			//hack to get non-const reference
+			LLVertexBuffer* vb = (LLVertexBuffer*) this;
+			vb->getVertexStrider(v);
+
+			for (U32 i = start; i < end; i++)
+			{
+				S32 idx = (S32) (v[i][3]+0.25f);
+				if (idx < 0 || idx >= shader->mFeatures.mIndexedTextureChannels)
+				{
+					llerrs << "Bad texture index found in vertex data stream." << llendl;
+				}
+			}
+		}
 	}
 }
 
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index eab3dcfaddb..6dbeae6677f 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1658,6 +1658,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		while(dst < end);
 
 		F32 index = (F32) (mTextureIndex < 255 ? mTextureIndex : 0);
+
+		llassert(index <= LLGLSLShader::sIndexedTextureChannels-1);
 		F32 *index_dst = (F32*) vertices;
 		F32 *index_end = (F32*) end;
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 827c5b9cb58..baab191cb6c 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4652,7 +4652,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 		buffer_index = -1;
 	}
 
-	S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity
+	S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity
 	
 	if (gGLManager.mGLVersion < 3.1f)
 	{
-- 
GitLab


From 476cfabf6302e83fec77a8e0ac729f1de07bf679 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Fri, 18 Nov 2011 21:18:13 +0000
Subject: [PATCH 256/933] Reverting changes to Build => Upload menu. This
 change was mistakenly included from a follow on project that is incomplete.

---
 .../newview/skins/default/xui/en/menu_viewer.xml  | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index b9605e1edec..263d961be1f 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1101,20 +1101,7 @@
             <menu_item_call.on_visible
             function="File.VisibleUploadModel"/>
             </menu_item_call>
-          <menu_item_call
-           label="Script (L$ 0)..."
-           layout="topleft"
-           name="Upload Script">
-            <menu_item_call.on_click
-             function="File.UploadScript"
-             parameter="" />
-            <menu_item_call.on_enable
-             function="File.EnableUploadScript" />
-            <!--menu_item_call.on_visible
-             function="Upload.CalculateCosts"
-             parameter="Upload Script" /-->
-          </menu_item_call>
-          <menu_item_call
+	   <menu_item_call
              label="Bulk (L$[COST] per file)..."
              layout="topleft"
              name="Bulk Upload">
-- 
GitLab


From c1745ca4aa4b7d8eb113978eb850ca791dcf2255 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Fri, 18 Nov 2011 21:55:40 +0000
Subject: [PATCH 257/933] Fixes .lsl not being appended if no extension is
 provided.

---
 indra/newview/llfloaternamedesc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index 4d4f9f57bf2..66f0fc3cd77 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -213,7 +213,7 @@ BOOL LLFloaterSoundPreview::postBuild()
 LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename )
 	: LLFloaterNameDesc(filename)
 {
-	mIsAudio = TRUE;
+	mIsText = TRUE;
 }
 
 BOOL LLFloaterScriptPreview::postBuild()
-- 
GitLab


From e875e0548b69d1cf141e3970a81aa3f0a5ff7ed3 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Fri, 18 Nov 2011 22:56:31 +0000
Subject: [PATCH 258/933] Removing code associated with Build => Upload =>
 Script previously reverted.

---
 indra/newview/llviewermenufile.cpp | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index f23d0f6b72e..7e830e14bf2 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -87,14 +87,6 @@ class LLFileEnableUpload : public view_listener_t
 	}
 };
 
-class LLFileEnableUploadScript : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		return true;
-	}
-};
-
 class LLFileEnableUploadModel : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
@@ -399,20 +391,6 @@ class LLFileUploadAnim : public view_listener_t
 	}
 };
 
-class LLFileUploadScript : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_SCRIPT);
-		if (!filename.empty())
-		{
-			LLFloaterReg::showInstance("upload_script", LLSD(filename));
-		}
-
-		return true;
-	}
-};
-
 class LLFileUploadBulk : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
-- 
GitLab


From 17ca9f9ae7b80dd9797408487499e9d3168c6291 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 18 Nov 2011 15:13:12 -0800
Subject: [PATCH 259/933] Removed unused code from alpha fragment shaders to
 fix some mac rendering glitches with non-fullbright alpha objects.

---
 .../shaders/class1/deferred/alphaF.glsl             | 13 -------------
 .../shaders/class2/deferred/alphaF.glsl             | 13 -------------
 2 files changed, 26 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 4cca2873560..c012efa0563 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -51,19 +51,6 @@ VARYING vec2 vary_texcoord0;
 
 uniform mat4 inv_proj;
 
-vec4 getPosition(vec2 pos_screen)
-{
-	float depth = texture2DRect(depthMap, pos_screen.xy).a;
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
 void main() 
 {
 	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 8d88e93698f..1179b212aeb 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -56,19 +56,6 @@ uniform float shadow_bias;
 
 uniform mat4 inv_proj;
 
-vec4 getPosition(vec2 pos_screen)
-{
-	float depth = texture2DRect(depthMap, pos_screen.xy).a;
-	vec2 sc = pos_screen.xy*2.0;
-	sc /= screen_res;
-	sc -= vec2(1.0,1.0);
-	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
-	vec4 pos = inv_proj * ndc;
-	pos.xyz /= pos.w;
-	pos.w = 1.0;
-	return pos;
-}
-
 float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl)
 {
 	stc.xyz /= stc.w;
-- 
GitLab


From 01e75a3d85f78697736629f703bd133cae95acf9 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 18 Nov 2011 15:24:29 -0800
Subject: [PATCH 260/933] Update LLQtWebKit to fix EXP-1191 Update loading
 overlay graphic to resemble a typical Web loading... spinner

---
 autobuild.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 1b8a61acad0..bb6de76d7a5 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1206,9 +1206,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c006dd7f1f7a9d4cb9e2bbf311dd1973</string>
+              <string>4b144790799df284f2ebe739a21aa4ec</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244983/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111110.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245528/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111118.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1230,9 +1230,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>8e7bbe2ee0a281fdd9c8af0c8f75d206</string>
+              <string>60a36c75456eaffc4858bc11df1c49a9</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244983/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111110.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245528/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111118.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
GitLab


From 7a29e9bb5a4d3cddd4021400a52327b18b24cbe7 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 18 Nov 2011 16:00:52 -0800
Subject: [PATCH 261/933] EXP-1485 FIX -- Viewer should have a minimum size
 1024x768

Per conversation with Product and Leonidas, the minimum size
is now set to 960x600.
---
 indra/newview/app_settings/settings.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e9b4d4d96db..baa225a2fc7 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12947,7 +12947,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>768</integer>
+      <integer>600</integer>
     </map>
     <key>WindowHeight</key>
     <map>
@@ -12980,7 +12980,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>1024</integer>
+      <integer>960</integer>
     </map>
     <key>WindowWidth</key>
     <map>
-- 
GitLab


From 7c2bbfc4fc905e8fff63d58f19f5e22cd755281c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 18 Nov 2011 17:22:40 -0800
Subject: [PATCH 262/933] EXP-1498, EXP-1595, EXP-1596 : Hide empty system
 folders in a dynamic way, turn the setting ON by default

---
 indra/newview/app_settings/settings.xml |  2 +-
 indra/newview/llinventorybridge.cpp     | 14 ------------
 indra/newview/llinventorybridge.h       |  1 -
 indra/newview/llinventoryfilter.cpp     | 30 ++++++++++++++++---------
 indra/newview/llinventoryfilter.h       |  4 +++-
 indra/newview/llinventorypanel.cpp      |  6 +++++
 indra/newview/llviewerfoldertype.cpp    |  3 +--
 7 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e9b4d4d96db..8138643385c 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1902,7 +1902,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
     <key>DebugInventoryFilters</key>
     <map>
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 244b001adb8..0c092e9a561 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -195,20 +195,6 @@ BOOL LLInvFVBridge::isLink() const
 	return mIsLink;
 }
 
-// Is a "System" folder
-// System folders are predefined named folders that have a specific preferred type
-// e.g. "Textures" which has an FT_TEXTURE preferred type.
-// Those are folders used to route incoming items in the current (soon to be obsolete) inventory
-// asset routing.
-// If a folder uses the same name as a predefined folder but is not of the same preferred type
-// or if it has a preferred type but a different name, it will not be considered a system folder.
-// *TODO: Test that logic in all languages
-bool LLInvFVBridge::isSystemFolder() const
-{
-	LLFolderType::EType preferred_type = getPreferredType();
-	return (preferred_type == LLFolderType::FT_NONE ? false : LLViewerFolderType::lookupTypeFromNewCategoryName(getDisplayName()) == preferred_type);
-}
-
 /*virtual*/
 /**
  * @brief Adds this item into clipboard storage
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 9832c683c66..2d625befb4c 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -72,7 +72,6 @@ class LLInvFVBridge : public LLFolderViewEventListener
 	BOOL canShare() const;
 	BOOL canListOnMarketplace() const;
 	BOOL canListOnMarketplaceNow() const;
-	bool isSystemFolder() const; // true if is a "System" folder
 
 	//--------------------------------------------------------------------
 	// LLInvFVBridge functionality
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 438081c177e..bc025402812 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -119,16 +119,6 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
 	const LLFolderViewEventListener* listener = folder->getListener();
 	const LLUUID folder_id = listener->getUUID();
 	
-	const LLInvFVBridge *bridge = dynamic_cast<const LLInvFVBridge *>(folder->getListener());
-	bool is_system_folder = bridge->isSystemFolder();
-	bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
-	bool is_empty = (gInventory.categoryHasChildren(folder_id) != LLInventoryModel::CHILDREN_YES);
-	
-	if (is_system_folder && is_empty && is_hidden_if_empty)
-	{
-		return false;
-	}
-		
 	if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
 	{
 		// Can only filter categories for items in your inventory
@@ -217,6 +207,21 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 		}
 	}
 
+	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_EMPTYFOLDERS
+	// Pass if this item is a folder and is not a system folder that should be hidden
+	if (filterTypes & FILTERTYPE_EMPTYFOLDERS)
+	{
+		if (object_type == LLInventoryType::IT_CATEGORY)
+		{
+			bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
+			if (is_hidden_if_empty)
+			{
+				return FALSE;
+			}
+		}
+	}
+	
 	return TRUE;
 }
 
@@ -354,6 +359,11 @@ void LLInventoryFilter::setFilterWearableTypes(U64 types)
 	mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE;
 }
 
+void LLInventoryFilter::setFilterEmptySystemFolders()
+{
+	mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
+}
+
 void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
 {
 	if (mFilterOps.mFilterUUID == LLUUID::null)
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index f9460822f7d..bba24ac6529 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -57,7 +57,8 @@ class LLInventoryFilter
 		FILTERTYPE_CATEGORY = 0x1 << 1,	// search by folder type
 		FILTERTYPE_UUID	= 0x1 << 2,		// find the object with UUID and any links to it
 		FILTERTYPE_DATE = 0x1 << 3,		// search by date range
-		FILTERTYPE_WEARABLE = 0x1 << 4	// search by wearable type
+		FILTERTYPE_WEARABLE = 0x1 << 4,	// search by wearable type
+		FILTERTYPE_EMPTYFOLDERS = 0x1 << 5	// pass if folder is not a system folder to be hidden if empty
 	};
 
 	enum EFilterLink
@@ -88,6 +89,7 @@ class LLInventoryFilter
 	void 				setFilterCategoryTypes(U64 types);
 	void 				setFilterUUID(const LLUUID &object_id);
 	void				setFilterWearableTypes(U64 types);
+	void				setFilterEmptySystemFolders();
 	void				updateFilterTypes(U64 types, U64& current_types);
 
 	void 				setFilterSubString(const std::string& string);
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index a9ec4af4f30..d06374d2323 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -240,6 +240,12 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 	getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX));
 	getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX));
 
+	// set the filter for the empty folder if the debug setting is on
+	if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders"))
+	{
+		getFilter()->setFilterEmptySystemFolders();
+	}
+	
 	// Initialize base class params.
 	LLPanel::initFromParams(params);
 }
diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp
index c39df7efce3..a179b61cffc 100644
--- a/indra/newview/llviewerfoldertype.cpp
+++ b/indra/newview/llviewerfoldertype.cpp
@@ -30,7 +30,6 @@
 #include "lldictionary.h"
 #include "llmemory.h"
 #include "llvisualparam.h"
-#include "llviewercontrol.h"
 
 static const std::string empty_string;
 
@@ -267,7 +266,7 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type)
 bool LLViewerFolderType::lookupIsHiddenIfEmpty(LLFolderType::EType folder_type)
 {
 	const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type);
-	if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders") && entry)
+	if (entry)
 	{
 		return entry->mHideIfEmpty;
 	}
-- 
GitLab


From e97fb23218734d1fbda87eedd7659235777a69ae Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Sat, 19 Nov 2011 10:02:20 -0500
Subject: [PATCH 263/933] Make LLSD diagnostic methods conditional on
 LLSD_DEBUG_INFO. This establishes that there are no viewer-side unit tests
 relying on these methods. The point is to try to clean up the LLSD public
 API. In the same vein, remove from LLSD public API a diagnostic method which
 is nothing more than an implementation detail for the corresponding
 LLSD::Impl method. The same effect can be achieved by making LLSD::Impl a
 friend of LLSD, moving the method with the messy signature (classic-C
 arrays!) into LLSD::Impl itself.

---
 indra/llcommon/llsd.cpp | 19 ++++++++++++++-----
 indra/llcommon/llsd.h   | 14 +++++++++++++-
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 3fa08aee8d1..1bd5d06d299 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -148,6 +148,13 @@ class LLSD::Impl
 
 	virtual void dumpStats() const;
 	virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
+	// Container subclasses contain LLSD objects, rather than directly
+	// containing Impl objects. This helper forwards through LLSD.
+	void calcStats(const LLSD& llsd, S32 type_counts[], S32 share_counts[]) const
+	{
+		safe(llsd.impl).calcStats(type_counts, share_counts);
+	}
+
 
 	static const LLSD& undef();
 	
@@ -459,7 +466,7 @@ namespace
 		while (iter != endMap())
 		{
 			//std::cout << "  " << (*iter).first << ": " << (*iter).second << std::endl;
-			(*iter).second.calcStats(type_counts, share_counts);
+			Impl::calcStats((*iter).second, type_counts, share_counts);
 			iter++;
 		}
 
@@ -606,7 +613,7 @@ namespace
 		LLSD::array_const_iterator iter = beginArray();
 		while (iter != endArray())
 		{	// Add values for all items held in the array
-			(*iter).calcStats(type_counts, share_counts);
+			Impl::calcStats((*iter), type_counts, share_counts);
 			iter++;
 		}
 
@@ -802,7 +809,7 @@ void LLSD::clear()						{ Impl::assignUndefined(impl); }
 
 LLSD::Type LLSD::type() const			{ return safe(impl).type(); }
 
-// Scaler Constructors
+// Scalar Constructors
 LLSD::LLSD(Boolean v) : impl(0)			{ ALLOC_LLSD_OBJECT;	assign(v); }
 LLSD::LLSD(Integer v) : impl(0)			{ ALLOC_LLSD_OBJECT;	assign(v); }
 LLSD::LLSD(Real v) : impl(0)			{ ALLOC_LLSD_OBJECT;	assign(v); }
@@ -894,8 +901,10 @@ LLSD&		LLSD::operator[](Integer i)
 const LLSD& LLSD::operator[](Integer i) const
 										{ return safe(impl).ref(i); }
 
+#ifdef LLSD_DEBUG_INFO
 U32 LLSD::allocationCount()				{ return Impl::sAllocationCount; }
 U32 LLSD::outstandingCount()			{ return Impl::sOutstandingCount; }
+#endif
 
 static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
 {
@@ -947,9 +956,9 @@ LLSD::array_const_iterator	LLSD::endArray() const	{ return safe(impl).endArray()
 
 
 // Diagnostic dump of contents in an LLSD object
+#ifdef LLSD_DEBUG_INFO
 void LLSD::dumpStats()	const						{ safe(impl).dumpStats();	}
-void LLSD::calcStats(S32 type_counts[], S32 share_counts[]) const
-													{ safe(impl).calcStats(type_counts, share_counts);	}
+#endif
 
 // static
 std::string		LLSD::typeString(Type type)
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index 80c3e9e7b58..3519b134c20 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -387,13 +387,20 @@ class LL_COMMON_API LLSD
 		class Impl;
 private:
 		Impl* impl;
+		friend class LLSD::Impl;
 	//@}
 	
 	/** @name Unit Testing Interface */
 	//@{
 public:
+#ifdef LLSD_DEBUG_INFO
+		/// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
+		/// ENVIRONMENT.
+		///
+		/// These counts track LLSD::Impl (hidden) objects.
 		static U32 allocationCount();	///< how many Impls have been made
 		static U32 outstandingCount();	///< how many Impls are still alive
+#endif
 	//@}
 
 private:
@@ -407,12 +414,17 @@ class LL_COMMON_API LLSD
 	//@}
 
 public:
+#ifdef LLSD_DEBUG_INFO
 	void			dumpStats() const;					// Output information on object and usage
-	void			calcStats(S32 type_counts[], S32 share_counts[]) const;		// Calculate the number of LLSD objects used by this value
+#endif
 
 	static std::string		typeString(Type type);		// Return human-readable type as a string
 
 #ifdef LLSD_DEBUG_INFO
+	/// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
+	/// ENVIRONMENT.
+	///
+	/// These counts track LLSD (public) objects.
 	static S32		sLLSDAllocationCount;		// Number of LLSD objects ever created
 	static S32		sLLSDNetObjects;			// Number of LLSD objects that exist
 #endif
-- 
GitLab


From 0bea8f2a9738502c8bc5482522de3b7ea49f989d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Sat, 19 Nov 2011 07:48:24 -0800
Subject: [PATCH 264/933] fix for notification dialog buttons not working

---
 indra/llxuixml/llinitparam.h | 39 +++++++++++++-----------------------
 1 file changed, 14 insertions(+), 25 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 2edb9b98c76..5ed3337c45c 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -583,7 +583,8 @@ namespace LLInitParam
 
 		Param& operator =(const Param& other)
 		{
-			setProvided(other.mIsProvided);
+			mIsProvided = other.mIsProvided;
+			// don't change mEnclosingblockoffset
 			return *this;
 		}
 	protected:
@@ -674,13 +675,6 @@ namespace LLInitParam
 			return *this;
 		}
 
-		self_t& operator =(const self_t& other)
-		{
-			mValue = other.mValue;
-			NAME_VALUE_LOOKUP::operator =(other);
-			return *this;
-		}
-
 	protected:
 		T mValue;
 	};
@@ -746,14 +740,6 @@ namespace LLInitParam
 			return *this;
 		}
 
-		self_t& operator =(const self_t& other)
-		{
-			T::operator = (other);
-			NAME_VALUE_LOOKUP::operator =(other);
-			mValidatedVersion = other.mValidatedVersion;
-			mValidated = other.mValidated;
-			return *this;
-		}
 	protected:
 		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
@@ -945,13 +931,15 @@ namespace LLInitParam
 			return static_cast<self_t&>(param_value_t::operator =(name));
 		}
 
-		self_t& operator =(value_assignment_t val)
+	protected:
+
+		self_t& operator =(const self_t& other)
 		{
-			set(val);
+			param_value_t::operator =(other);
+			Param::operator =(other);
 			return *this;
 		}
 
-	protected:
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
 			const self_t& src_typed_param = static_cast<const self_t&>(src);
@@ -1092,12 +1080,6 @@ namespace LLInitParam
 			return static_cast<self_t&>(param_value_t::operator =(name));
 		}
 
-		self_t& operator =(value_assignment_t val)
-		{
-			set(val);
-			return *this;
-		}
-
 		// propagate changed status up to enclosing block
 		/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
 		{ 
@@ -1117,6 +1099,13 @@ namespace LLInitParam
 
 	protected:
 
+		self_t& operator =(const self_t& other)
+		{
+			param_value_t::operator =(other);
+			Param::operator =(other);
+			return *this;
+		}
+
 		static bool mergeWith(Param& dst, const Param& src, bool overwrite)
 		{
 			const self_t& src_typed_param = static_cast<const self_t&>(src);
-- 
GitLab


From 4cb3634932fe8175fb878894cce584bfb8bba8c6 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 21 Nov 2011 13:55:09 +0200
Subject: [PATCH 265/933] EXP-1630 FIXED Only show snapshot size spinners and
 "Constrain proportions" checkbox when Custom resolution is selected.

---
 indra/newview/llpanelsnapshot.cpp             |  12 +-
 indra/newview/llpanelsnapshot.h               |   1 +
 indra/newview/llpanelsnapshotinventory.cpp    |   7 +-
 indra/newview/llpanelsnapshotlocal.cpp        |   1 +
 indra/newview/llpanelsnapshotpostcard.cpp     |   1 +
 indra/newview/llpanelsnapshotprofile.cpp      |   1 +
 .../xui/en/panel_postcard_settings.xml        | 163 ++++++++------
 .../default/xui/en/panel_snapshot_local.xml   | 205 ++++++++++--------
 .../default/xui/en/panel_snapshot_profile.xml | 171 +++++++++------
 9 files changed, 333 insertions(+), 229 deletions(-)

diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index 90e32f973f6..2f29e758c6b 100644
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -124,15 +124,11 @@ LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer()
 // virtual
 void LLPanelSnapshot::updateCustomResControls()
 {
+	// Only show width/height spinners and the aspect ratio checkbox
+	// when a custom resolution is chosen.
 	LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
-	S32 selected_idx = combo->getFirstSelectedIndex();
-	const bool enable = selected_idx == (combo->getItemCount() - 1); // Current Window or Custom selected
-
-	getChild<LLUICtrl>(getWidthSpinnerName())->setEnabled(enable);
-	getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(enable);
-	getChild<LLUICtrl>(getHeightSpinnerName())->setEnabled(enable);
-	getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(enable);
-	enableAspectRatioCheckbox(enable);
+	const bool show = combo->getFirstSelectedIndex() == (combo->getItemCount() - 1);
+	getChild<LLUICtrl>(getImageSizePanelName())->setVisible(show);
 }
 
 void LLPanelSnapshot::updateImageQualityLevel()
diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h
index 7adb2fabc71..f3274cf5940 100644
--- a/indra/newview/llpanelsnapshot.h
+++ b/indra/newview/llpanelsnapshot.h
@@ -44,6 +44,7 @@ class LLPanelSnapshot: public LLPanel
 	virtual std::string getHeightSpinnerName() const = 0;
 	virtual std::string getAspectRatioCBName() const = 0;
 	virtual std::string getImageSizeComboName() const = 0;
+	virtual std::string getImageSizePanelName() const = 0;
 
 	virtual S32 getTypedPreviewWidth() const;
 	virtual S32 getTypedPreviewHeight() const;
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index aca0ee67003..381c11348d5 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -54,6 +54,7 @@ class LLPanelSnapshotInventory
 	/*virtual*/ std::string getHeightSpinnerName() const	{ return "inventory_snapshot_height"; }
 	/*virtual*/ std::string getAspectRatioCBName() const	{ return "inventory_keep_aspect_check"; }
 	/*virtual*/ std::string getImageSizeComboName() const	{ return "texture_size_combo"; }
+	/*virtual*/ std::string getImageSizePanelName() const	{ return LLStringUtil::null; }
 	/*virtual*/ void updateControls(const LLSD& info);
 
 	void onSend();
@@ -70,6 +71,8 @@ LLPanelSnapshotInventory::LLPanelSnapshotInventory()
 // virtual
 BOOL LLPanelSnapshotInventory::postBuild()
 {
+	getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
+	getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
 	getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures
 	return LLPanelSnapshot::postBuild();
 }
@@ -90,10 +93,6 @@ void LLPanelSnapshotInventory::updateCustomResControls()
 
 	getChild<LLUICtrl>(getWidthSpinnerName())->setVisible(show);
 	getChild<LLUICtrl>(getHeightSpinnerName())->setVisible(show);
-
-	// Editing gets often enable elsewhere in common snapshot panel code. Override that.
-	getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
-	getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
 }
 
 // virtual
diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp
index 4a2614fa7d7..d153ff598d0 100644
--- a/indra/newview/llpanelsnapshotlocal.cpp
+++ b/indra/newview/llpanelsnapshotlocal.cpp
@@ -54,6 +54,7 @@ class LLPanelSnapshotLocal
 	/*virtual*/ std::string getHeightSpinnerName() const	{ return "local_snapshot_height"; }
 	/*virtual*/ std::string getAspectRatioCBName() const	{ return "local_keep_aspect_check"; }
 	/*virtual*/ std::string getImageSizeComboName() const	{ return "local_size_combo"; }
+	/*virtual*/ std::string getImageSizePanelName() const	{ return "local_image_size_lp"; }
 	/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const;
 	/*virtual*/ void updateControls(const LLSD& info);
 
diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp
index 6867c7af4ef..f2bb8f530ba 100644
--- a/indra/newview/llpanelsnapshotpostcard.cpp
+++ b/indra/newview/llpanelsnapshotpostcard.cpp
@@ -62,6 +62,7 @@ class LLPanelSnapshotPostcard
 	/*virtual*/ std::string getHeightSpinnerName() const	{ return "postcard_snapshot_height"; }
 	/*virtual*/ std::string getAspectRatioCBName() const	{ return "postcard_keep_aspect_check"; }
 	/*virtual*/ std::string getImageSizeComboName() const	{ return "postcard_size_combo"; }
+	/*virtual*/ std::string getImageSizePanelName() const	{ return "postcard_image_size_lp"; }
 	/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; }
 	/*virtual*/ void updateControls(const LLSD& info);
 
diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp
index 89245fc804e..a7063183692 100644
--- a/indra/newview/llpanelsnapshotprofile.cpp
+++ b/indra/newview/llpanelsnapshotprofile.cpp
@@ -57,6 +57,7 @@ class LLPanelSnapshotProfile
 	/*virtual*/ std::string getHeightSpinnerName() const	{ return "profile_snapshot_height"; }
 	/*virtual*/ std::string getAspectRatioCBName() const	{ return "profile_keep_aspect_check"; }
 	/*virtual*/ std::string getImageSizeComboName() const	{ return "profile_size_combo"; }
+	/*virtual*/ std::string getImageSizePanelName() const	{ return "profile_image_size_lp"; }
 	/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; }
 	/*virtual*/ void updateControls(const LLSD& info);
 
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index 84e35937980..aebbc51be1f 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -34,69 +34,104 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Width"
-     label_width="40"
-     layout="topleft"
-     left="10"
-     max_val="6016"
-     min_val="32"
-     name="postcard_snapshot_width"
+    <layout_stack
+     animate="false"
+     follows="all"
+     height="275"
+     layout="bottomleft"
+     name="postcard_image_params_ls"
+     left_delta="0"
+     orientation="vertical"
      top_pad="10"
-     width="95" />
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Height"
-     label_width="40"
-     layout="topleft"
-     left_pad="5"
-     max_val="6016"
-     min_val="32"
-     name="postcard_snapshot_height"
-     top_delta="0"
-     width="95" />
-    <check_box
-     bottom_delta="20"
-     follows="left|top"
-     label="Constrain proportions"
-     layout="topleft"
-     left="10"
-     name="postcard_keep_aspect_check" />
-    <slider
-     decimal_digits="0"
-     follows="left|top"
-     height="15"
-     increment="1"
-     initial_value="75"
-     label="Image quality"
-     label_width="80"
-     layout="topleft"
-     left="10"
-     max_val="100"
-     name="image_quality_slider"
-     top_pad="7"
-     width="200" />
-    <text
-     type="string"
-     follows="left|top"
-     font="SansSerifSmall"
-     length="1"
-     height="14"
-     layout="topleft"
-     left_pad="-5"
-     halign="left"
-     name="image_quality_level"
-     top_delta="0"
-     width="60">
-       ([QLVL])
-    </text>
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="60"
+         layout="topleft"
+         left="0"
+         name="postcard_image_size_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="postcard_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="postcard_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+             bottom_delta="20"
+             follows="left|top"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="postcard_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="23"
+         layout="topleft"
+         left="0"
+         name="postcard_image_format_quality_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <slider
+             decimal_digits="0"
+             follows="left|top"
+             height="15"
+             increment="1"
+             initial_value="75"
+             label="Image quality"
+             label_width="80"
+             layout="topleft"
+             left="10"
+             max_val="100"
+             name="image_quality_slider"
+             top_pad="7"
+             width="200" />
+            <text
+             type="string"
+             follows="left|top"
+             font="SansSerifSmall"
+             length="1"
+             height="14"
+             layout="topleft"
+             left_pad="-5"
+             halign="left"
+             name="image_quality_level"
+             top_delta="0"
+             width="60">
+               ([QLVL])
+            </text>
+        </layout_panel>
+    </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index 30403a21dd6..ae0215a5786 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -80,93 +80,128 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Width"
-     label_width="40"
-     layout="topleft"
-     left="10"
-     max_val="6016"
-     min_val="32"
-     name="local_snapshot_width"
-     top_pad="10"
-     width="95" />
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Height"
-     label_width="40"
-     layout="topleft"
-     left_pad="5"
-     max_val="6016"
-     min_val="32"
-     name="local_snapshot_height"
-     top_delta="0"
-     width="95" />
-    <check_box
-     bottom_delta="20"
-     follows="left|top"
-     label="Constrain proportions"
-     layout="topleft"
-     left="10"
-     name="local_keep_aspect_check" />
-    <combo_box
-     follows="left|top"
-     height="23"
-     label="Format"
-     layout="topleft"
+    <layout_stack
+     animate="false"
+     follows="all"
+     height="275"
+     layout="bottomleft"
+     name="local_image_params_ls"
      left_delta="0"
-     name="local_format_combo"
+     orientation="vertical"
      top_pad="10"
-     width="120">
-        <combo_box.item
-         label="PNG (Lossless)"
-         name="PNG"
-         value="PNG" />
-        <combo_box.item
-         label="JPEG"
-         name="JPEG"
-         value="JPEG" />
-        <combo_box.item
-         label="BMP (Lossless)"
-         name="BMP"
-         value="BMP" />
-    </combo_box>
-    <slider
-     decimal_digits="0"
-     follows="left|top"
-     height="15"
-     increment="1"
-     initial_value="75"
-     label="Image quality"
-     label_width="80"
-     layout="topleft"
-     left="10"
-     max_val="100"
-     name="image_quality_slider"
-     top_pad="7"
-     width="200" />
-    <text
-     type="string"
-     follows="left|top"
-     font="SansSerifSmall"
-     length="1"
-     height="14"
-     layout="topleft"
-     left_pad="-5"
-     halign="left"
-     name="image_quality_level"
-     top_delta="0"
-     width="60">
-       ([QLVL])
-    </text>
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="60"
+         layout="topleft"
+         left="0"
+         name="local_image_size_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="local_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="local_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+             bottom_delta="20"
+             follows="left|top"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="local_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="23"
+         layout="topleft"
+         left="0"
+         name="local_image_format_quality_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <combo_box
+             follows="left|top"
+             height="23"
+             label="Format"
+             layout="topleft"
+             left_delta="0"
+             name="local_format_combo"
+             top_pad="0"
+             width="120">
+                <combo_box.item
+                 label="PNG (Lossless)"
+                 name="PNG"
+                 value="PNG" />
+                <combo_box.item
+                 label="JPEG"
+                 name="JPEG"
+                 value="JPEG" />
+                <combo_box.item
+                 label="BMP (Lossless)"
+                 name="BMP"
+                 value="BMP" />
+            </combo_box>
+            <slider
+             decimal_digits="0"
+             follows="left|top"
+             height="15"
+             increment="1"
+             initial_value="75"
+             label="Image quality"
+             label_width="80"
+             layout="topleft"
+             left="10"
+             max_val="100"
+             name="image_quality_slider"
+             top_pad="7"
+             width="200" />
+            <text
+             type="string"
+             follows="left|top"
+             font="SansSerifSmall"
+             length="1"
+             height="14"
+             layout="topleft"
+             left_pad="-5"
+             halign="left"
+             name="image_quality_level"
+             top_delta="0"
+             width="60">
+               ([QLVL])
+            </text>
+        </layout_panel>
+    </layout_stack>
     <button
      follows="right|bottom"
      height="23"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index ee79a4b3b82..91ac9ad6584 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -68,76 +68,111 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Width"
-     label_width="40"
-     layout="topleft"
-     left="10"
-     max_val="6016"
-     min_val="32"
-     name="profile_snapshot_width"
-     top_pad="10"
-     width="95" />
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Height"
-     label_width="40"
-     layout="topleft"
-     left_pad="5"
-     max_val="6016"
-     min_val="32"
-     name="profile_snapshot_height"
-     top_delta="0"
-     width="95" />
-    <check_box
-     bottom_delta="20"
-     label="Constrain proportions"
-     layout="topleft"
-     left="10"
-     name="profile_keep_aspect_check" />
-    <text
-     length="1"
-     follows="top|left|right"
-     font="SansSerif"
-     height="16"
-     layout="topleft"
-     left="12"
-     name="caption_label"
-     right="-10"
-     top_pad="10"
-     type="string">
-        Caption:
-    </text>
-    <text_editor
+    <layout_stack
+     animate="false"
      follows="all"
-     height="160"
-     layout="topleft"
+     height="270"
+     layout="bottomleft"
+     name="profile_image_params_ls"
      left_delta="0"
-     length="1"
-     max_length="700"
-     name="caption"
-     right="-10"
-     top_pad="5"
-     type="string"
-     word_wrap="true">
-    </text_editor>
-    <check_box
-     follows="left|bottom"
-     initial_value="true"
-     label="Include location"
-     layout="topleft"
-     left_delta="0"
-     name="add_location_cb"
-     top_pad="15" />
+     orientation="vertical"
+     top_pad="10"
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="55"
+         layout="topleft"
+         left="0"
+         name="profile_image_size_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="profile_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="profile_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+             bottom_delta="20"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="profile_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="200"
+         layout="topleft"
+         left="0"
+         name="profile_image_metadata_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <text
+             length="1"
+             follows="top|left|right"
+             font="SansSerif"
+             height="16"
+             layout="topleft"
+             left="0"
+             name="caption_label"
+             right="-10"
+             top_pad="0"
+             type="string">
+                Caption:
+            </text>
+            <text_editor
+             follows="all"
+             height="155"
+             layout="topleft"
+             left_delta="0"
+             length="1"
+             max_length="700"
+             name="caption"
+             right="-10"
+             top_pad="5"
+             type="string"
+             word_wrap="true">
+            </text_editor>
+            <check_box
+             follows="left|bottom"
+             initial_value="true"
+             label="Include location"
+             layout="topleft"
+             left_delta="0"
+             name="add_location_cb"
+             top_pad="15" />
+        </layout_panel>
+    </layout_stack>
     <button
      follows="right|bottom"
      height="23"
-- 
GitLab


From b901998c6f6642a3ada3193237253a29c8e637d3 Mon Sep 17 00:00:00 2001
From: Tofu Buzzard <no-email>
Date: Mon, 21 Nov 2011 09:20:09 -0500
Subject: [PATCH 266/933] Add "Use Region Settings" to World->Sun menu

---
 doc/contributions.txt                              | 1 +
 indra/newview/llviewermenu.cpp                     | 9 ++++++++-
 indra/newview/skins/default/xui/en/menu_viewer.xml | 8 ++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 2b39e15e2a9..2ebbe34073d 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1114,6 +1114,7 @@ Tofu Buzzard
 	CTS-411
 	STORM-546
 	VWR-24509
+    STORM-1684
 Tony Kembia
 Torben Trautman
 TouchaHoney Perhaps
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 22d95563d86..6d45e48d23e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7701,7 +7701,14 @@ class LLWorldEnvSettings : public view_listener_t
 		}
 		else
 		{
-			LLEnvManagerNew::instance().setUseDayCycle(LLEnvManagerNew::instance().getDayCycleName());
+			LLEnvManagerNew &envmgr = LLEnvManagerNew::instance();
+			// reset all environmental settings to track the region defaults, make this reset 'sticky' like the other sun settings.
+			bool use_fixed_sky = false;
+			bool use_region_settings = true;
+			envmgr.setUserPrefs(envmgr.getWaterPresetName(),
+					    envmgr.getSkyPresetName(),
+					    envmgr.getDayCycleName(),
+					    use_fixed_sky, use_region_settings);
 		}
 
 		return true;
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 263d961be1f..575e3673c6d 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -533,6 +533,14 @@
                  function="World.EnvSettings"
                  parameter="midnight" />
             </menu_item_call>
+            <menu_item_separator/>
+            <menu_item_call
+             label="Use Region Settings"
+             name="Use Region Settings">
+                <menu_item_call.on_click
+                 function="World.EnvSettings"
+                 parameter="region" />
+            </menu_item_call>
         </menu>
 	    
    
-- 
GitLab


From 6e2c76221e9cc933eb6f40e71af359c3cf6c2063 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 21 Nov 2011 09:28:39 -0500
Subject: [PATCH 267/933] update build params

---
 BuildParams | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/BuildParams b/BuildParams
index 5068edb21f1..3f5d6f8c6b6 100755
--- a/BuildParams
+++ b/BuildParams
@@ -136,14 +136,6 @@ viewer-mesh.login_channel = "Project Viewer - Mesh"
 viewer-mesh.viewer_grid = aditi
 viewer-mesh.email = shining@lists.lindenlab.com
 
-
-# ========================================
-# CG
-# ========================================
-
-cg_viewer-development_lenny.show_changes_since = 4b140ce7839d
-cg_viewer-development_lenny.email = cg@lindenlab.com
-
 # ================
 # oz
 # ================
@@ -151,20 +143,29 @@ cg_viewer-development_lenny.email = cg@lindenlab.com
 oz_viewer-devreview.build_debug_release_separately = true
 oz_viewer-devreview.codeticket_add_context = false
 oz_viewer-devreview.build_enforce_coding_policy = true
+oz_viewer-devreview.email = oz@lindenlab.com
 
 oz_project-1.build_debug_release_separately = true
 oz_project-1.codeticket_add_context = false
+oz_project-1.email = oz@lindenlab.com
 oz_project-2.build_debug_release_separately = true
 oz_project-2.codeticket_add_context = false
+oz_project-2.email = oz@lindenlab.com
 oz_project-3.build_debug_release_separately = true
 oz_project-3.codeticket_add_context = false
+oz_project-3.email = oz@lindenlab.com
 oz_project-4.build_debug_release_separately = true
 oz_project-4.codeticket_add_context = false
+oz_project-4.email = oz@lindenlab.com
+oz_project-5.build_debug_release_separately = true
+oz_project-5.codeticket_add_context = false
+oz_project-5.email = oz@lindenlab.com
 
 oz_viewer-beta-review.build_debug_release_separately = true
 oz_viewer-beta-review.codeticket_add_context = false
 oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
 oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
+oz_viewer-beta-review.email = oz@lindenlab.com
 
 # =================================================================
 # asset delivery 2010 projects
-- 
GitLab


From 8448f9d727a5cb4d6c9610684e1001fee8982ce2 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 21 Nov 2011 12:38:43 -0800
Subject: [PATCH 268/933] Moved snapshot to the bottom of the left toolbar per
 wolf

---
 indra/newview/app_settings/toolbars.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index 30be6974360..8862355bfd0 100644
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -14,12 +14,12 @@
   <left_toolbar
     button_display_mode="icons_only">
     <command name="avatar"/>
-    <command name="snapshot"/>
     <command name="appearance"/>
     <command name="inventory"/>
     <command name="search"/>
     <command name="places"/>
     <command name="voice"/>
     <command name="minimap"/>
+    <command name="snapshot"/>
   </left_toolbar>
 </toolbars>
-- 
GitLab


From b4766d2fde6b74c5a4a50cdde4373b5261a020e2 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 21 Nov 2011 14:42:21 -0700
Subject: [PATCH 269/933] fix for sh-2601: [crashhunters] crash in
 LLBufferArray::countAfter() sh-2602: [crashhunters] crash on exit in
 ~LLPumpIO()

---
 indra/llmessage/llcurl.cpp            | 356 ++++++++++++++++----------
 indra/llmessage/llcurl.h              | 105 +++++---
 indra/llmessage/llurlrequest.cpp      |   6 +-
 indra/newview/llappviewer.cpp         |   5 +
 indra/newview/llxmlrpctransaction.cpp |  16 +-
 5 files changed, 308 insertions(+), 180 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 330028c9268..7f61e1ac040 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -86,9 +86,7 @@ S32 gCurlMultiCount = 0;
 std::vector<LLMutex*> LLCurl::sSSLMutex;
 std::string LLCurl::sCAPath;
 std::string LLCurl::sCAFile;
-
-bool LLCurl::sMultiThreaded = false;
-static U32 sMainThreadID = 0;
+LLCurlThread* LLCurl::sCurlThread = NULL ;
 
 void check_curl_code(CURLcode code)
 {
@@ -221,14 +219,11 @@ namespace boost
 
 std::set<CURL*> LLCurl::Easy::sFreeHandles;
 std::set<CURL*> LLCurl::Easy::sActiveHandles;
-LLMutex* LLCurl::Easy::sHandleMutex = NULL;
-LLMutex* LLCurl::Easy::sMultiMutex = NULL;
 
 //static
 CURL* LLCurl::Easy::allocEasyHandle()
 {
 	CURL* ret = NULL;
-	LLMutexLock lock(sHandleMutex);
 	if (sFreeHandles.empty())
 	{
 		ret = curl_easy_init();
@@ -256,8 +251,6 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle)
 		llerrs << "handle cannot be NULL!" << llendl;
 	}
 
-	LLMutexLock lock(sHandleMutex);
-	
 	if (sActiveHandles.find(handle) != sActiveHandles.end())
 	{
 		sActiveHandles.erase(handle);
@@ -521,23 +514,13 @@ void LLCurl::Easy::prepRequest(const std::string& url,
 ////////////////////////////////////////////////////////////////////////////
 
 LLCurl::Multi::Multi()
-	: LLThread("Curl Multi"),
-	  mQueued(0),
+	: mQueued(0),
 	  mErrorCount(0),
-	  mPerformState(PERFORM_STATE_READY)
+	  mState(STATE_READY),
+	  mDead(FALSE),
+	  mMutexp(NULL),
+	  mDeletionMutexp(NULL)
 {
-	mQuitting = false;
-
-	mThreaded = LLCurl::sMultiThreaded && LLThread::currentID() == sMainThreadID;
-	if (mThreaded)
-	{
-		mSignal = new LLCondition(NULL);
-	}
-	else
-	{
-		mSignal = NULL;
-	}
-
 	mCurlMultiHandle = curl_multi_init();
 	if (!mCurlMultiHandle)
 	{
@@ -545,22 +528,20 @@ LLCurl::Multi::Multi()
 		mCurlMultiHandle = curl_multi_init();
 	}
 	
-	llassert_always(mCurlMultiHandle);
-	++gCurlMultiCount;
-}
-
-LLCurl::Multi::~Multi()
-{
-	llassert(isStopped());
+	llassert_always(mCurlMultiHandle);	
 
-	if (LLCurl::sMultiThreaded)
+	if(LLCurl::getCurlThread()->getThreaded())
 	{
-		LLCurl::Easy::sMultiMutex->lock();
+		mMutexp = new LLMutex(NULL) ;
+		mDeletionMutexp = new LLMutex(NULL) ;
 	}
+	LLCurl::getCurlThread()->addMulti(this) ;
 
-	delete mSignal;
-	mSignal = NULL;
+	++gCurlMultiCount;
+}
 
+LLCurl::Multi::~Multi()
+{
 	// Clean up active
 	for(easy_active_list_t::iterator iter = mEasyActiveList.begin();
 		iter != mEasyActiveList.end(); ++iter)
@@ -577,75 +558,149 @@ LLCurl::Multi::~Multi()
 	mEasyFreeList.clear();
 
 	check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle));
+
+	delete mMutexp ;
+	mMutexp = NULL ;
+	delete mDeletionMutexp ;
+	mDeletionMutexp = NULL ;
+
 	--gCurlMultiCount;
+}
 
-	if (LLCurl::sMultiThreaded)
+void LLCurl::Multi::lock()
+{
+	if(mMutexp)
 	{
-		LLCurl::Easy::sMultiMutex->unlock();
+		mMutexp->lock() ;
 	}
 }
 
-CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
+void LLCurl::Multi::unlock()
 {
-	CURLMsg* curlmsg = curl_multi_info_read(mCurlMultiHandle, msgs_in_queue);
-	return curlmsg;
+	if(mMutexp)
+	{
+		mMutexp->unlock() ;
+	}
 }
 
-void LLCurl::Multi::perform()
+void LLCurl::Multi::markDead()
 {
-	if (mThreaded)
+	if(mDeletionMutexp)
 	{
-		if (mPerformState == PERFORM_STATE_READY)
-		{
-			mSignal->signal();
-		}
+		mDeletionMutexp->lock() ;
 	}
-	else
+
+	mDead = TRUE ;
+
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->unlock() ;
+	}
+}
+
+void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
+{
+	lock() ;
+	mState = state ;
+	if(mState == STATE_READY)
 	{
-		doPerform();
+		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ;
 	}
+	unlock() ;
 }
 
-void LLCurl::Multi::run()
+LLCurl::Multi::ePerformState LLCurl::Multi::getState()
 {
-	llassert(mThreaded);
+	ePerformState state ;
+
+	lock() ;
+	state = mState ;
+	unlock() ;
+
+	return state ;
+}
+	
+bool LLCurl::Multi::isCompleted() 
+{
+	return STATE_COMPLETED == getState() ;
+}
 
-	while (!mQuitting)
+bool LLCurl::Multi::waitToComplete()
+{
+	if(!mMutexp) //not threaded
 	{
-		mSignal->wait();
-		mPerformState = PERFORM_STATE_PERFORMING;
-		if (!mQuitting)
-		{
-			LLMutexLock lock(LLCurl::Easy::sMultiMutex);
-			doPerform();
-		}
+		doPerform() ;
+		return true ;
+	}
+
+	bool completed ;
+
+	lock() ;
+	completed = (STATE_COMPLETED == mState) ;
+	if(!completed)
+	{
+		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
 	}
+	unlock() ;
+
+	return completed;
 }
 
-void LLCurl::Multi::doPerform()
+CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 {
-	S32 q = 0;
-	for (S32 call_count = 0;
-			call_count < MULTI_PERFORM_CALL_REPEAT;
-			call_count += 1)
+	CURLMsg* curlmsg = curl_multi_info_read(mCurlMultiHandle, msgs_in_queue);
+	return curlmsg;
+}
+
+//return true if dead
+bool LLCurl::Multi::doPerform()
+{
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->lock() ;
+	}
+	bool dead = mDead ;
+
+	if(mDead)
 	{
-		CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
-		if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
+		setState(STATE_COMPLETED);
+		mQueued = 0 ;
+	}
+	else if(getState() != STATE_COMPLETED)
+	{		
+		setState(STATE_PERFORMING);
+
+		S32 q = 0;
+		for (S32 call_count = 0;
+				call_count < MULTI_PERFORM_CALL_REPEAT;
+				call_count++)
 		{
-			check_curl_multi_code(code);
-			break;
+			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
+			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
+			{
+				check_curl_multi_code(code);
+			
+				break;
+			}
 		}
-	
+
+		mQueued = q;	
+		setState(STATE_COMPLETED) ;
 	}
-	mQueued = q;
-	mPerformState = PERFORM_STATE_COMPLETED;
+
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->unlock() ;
+	}
+
+	return dead ;
 }
 
 S32 LLCurl::Multi::process()
 {
-	perform();
+	waitToComplete() ;
 
-	if (mPerformState != PERFORM_STATE_COMPLETED)
+	if (getState() != STATE_COMPLETED)
 	{
 		return 0;
 	}
@@ -681,7 +736,8 @@ S32 LLCurl::Multi::process()
 		}
 	}
 
-	mPerformState = PERFORM_STATE_READY;
+	setState(STATE_READY);
+
 	return processed;
 }
 
@@ -739,6 +795,75 @@ void LLCurl::Multi::removeEasy(Easy* easy)
 	easyFree(easy);
 }
 
+//------------------------------------------------------------
+//LLCurlThread
+LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi) :
+	LLQueuedThread::QueuedRequest(handle, LLQueuedThread::PRIORITY_NORMAL, FLAG_AUTO_COMPLETE),
+	mMulti(multi)
+{	
+}
+
+LLCurlThread::CurlRequest::~CurlRequest()
+{	
+	if(mMulti)
+	{
+		delete mMulti ;
+		mMulti = NULL ;
+	}
+}
+
+bool LLCurlThread::CurlRequest::processRequest()
+{
+	bool completed = true ;
+	if(mMulti)
+	{
+		completed = mMulti->doPerform() ;
+		setPriority(LLQueuedThread::PRIORITY_LOW) ;
+	}
+
+	return completed ;
+}
+
+void LLCurlThread::CurlRequest::finishRequest(bool completed)
+{
+	delete mMulti ;
+	mMulti = NULL ;
+}
+	
+LLCurlThread::LLCurlThread(bool threaded) :
+	LLQueuedThread("curlthread", threaded)
+{
+}
+	
+//virtual 
+LLCurlThread::~LLCurlThread() 
+{
+}
+
+S32 LLCurlThread::update(U32 max_time_ms)
+{	
+	return LLQueuedThread::update(max_time_ms);
+}
+
+void LLCurlThread::addMulti(LLCurl::Multi* multi)
+{
+	multi->mHandle = generateHandle() ;
+
+	CurlRequest* req = new CurlRequest(multi->mHandle, multi) ;
+
+	if (!addRequest(req))
+	{
+		llwarns << "curl request added when the thread is quitted" << llendl;
+	}
+}
+	
+void LLCurlThread::deleteMulti(LLCurl::Multi* multi)
+{
+	multi->markDead() ;
+}
+
+//------------------------------------------------------------
+
 //static
 std::string LLCurl::strerror(CURLcode errorcode)
 {
@@ -753,39 +878,23 @@ LLCurlRequest::LLCurlRequest() :
 	mActiveMulti(NULL),
 	mActiveRequestCount(0)
 {
-	mThreadID = LLThread::currentID();
 	mProcessing = FALSE;
 }
 
 LLCurlRequest::~LLCurlRequest()
 {
-	llassert_always(mThreadID == LLThread::currentID());
-
 	//stop all Multi handle background threads
 	for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter)
 	{
-		LLCurl::Multi* multi = *iter;
-		multi->mQuitting = true;
-		if (multi->mThreaded)
-		{
-			while (!multi->isStopped())
-			{
-				multi->mSignal->signal();
-				apr_sleep(1000);
-			}
-		}
+		LLCurl::getCurlThread()->deleteMulti(*iter) ;
 	}
-	for_each(mMultiSet.begin(), mMultiSet.end(), DeletePointer());
+	mMultiSet.clear() ;
 }
 
 void LLCurlRequest::addMulti()
 {
-	llassert_always(mThreadID == LLThread::currentID());
 	LLCurl::Multi* multi = new LLCurl::Multi();
-	if (multi->mThreaded)
-	{
-		multi->start();
-	}
+	
 	mMultiSet.insert(multi);
 	mActiveMulti = multi;
 	mActiveRequestCount = 0;
@@ -901,7 +1010,6 @@ bool LLCurlRequest::post(const std::string& url,
 // Note: call once per frame
 S32 LLCurlRequest::process()
 {
-	llassert_always(mThreadID == LLThread::currentID());
 	S32 res = 0;
 
 	mProcessing = TRUE;
@@ -915,17 +1023,7 @@ S32 LLCurlRequest::process()
 		if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0)
 		{
 			mMultiSet.erase(curiter);
-			multi->mQuitting = true;
-			if (multi->mThreaded)
-			{
-				while (!multi->isStopped())
-				{
-					multi->mSignal->signal();
-					apr_sleep(1000);
-				}
-			}
-
-			delete multi;
+			LLCurl::getCurlThread()->deleteMulti(multi);
 		}
 	}
 	mProcessing = FALSE;
@@ -934,7 +1032,6 @@ S32 LLCurlRequest::process()
 
 S32 LLCurlRequest::getQueued()
 {
-	llassert_always(mThreadID == LLThread::currentID());
 	S32 queued = 0;
 	for (curlmulti_set_t::iterator iter = mMultiSet.begin();
 		 iter != mMultiSet.end(); )
@@ -942,7 +1039,7 @@ S32 LLCurlRequest::getQueued()
 		curlmulti_set_t::iterator curiter = iter++;
 		LLCurl::Multi* multi = *curiter;
 		queued += multi->mQueued;
-		if (multi->mPerformState != LLCurl::Multi::PERFORM_STATE_READY)
+		if (multi->getState() != LLCurl::Multi::STATE_READY)
 		{
 			++queued;
 		}
@@ -959,10 +1056,7 @@ LLCurlEasyRequest::LLCurlEasyRequest()
 	  mResultReturned(false)
 {
 	mMulti = new LLCurl::Multi();
-	if (mMulti->mThreaded)
-	{
-		mMulti->start();
-	}
+	
 	mEasy = mMulti->allocEasy();
 	if (mEasy)
 	{
@@ -975,16 +1069,7 @@ LLCurlEasyRequest::LLCurlEasyRequest()
 
 LLCurlEasyRequest::~LLCurlEasyRequest()
 {
-	mMulti->mQuitting = true;
-	if (mMulti->mThreaded)
-	{
-		while (!mMulti->isStopped())
-		{
-			mMulti->mSignal->signal();
-			apr_sleep(1000);
-		}
-	}
-	delete mMulti;
+	LLCurl::getCurlThread()->deleteMulti(mMulti) ;
 }
 	
 void LLCurlEasyRequest::setopt(CURLoption option, S32 value)
@@ -1080,19 +1165,14 @@ void LLCurlEasyRequest::requestComplete()
 	}
 }
 
-void LLCurlEasyRequest::perform()
-{
-	mMulti->perform();
-}
-
 // Usage: Call getRestult until it returns false (no more messages)
 bool LLCurlEasyRequest::getResult(CURLcode* result, LLCurl::TransferInfo* info)
 {
-	if (mMulti->mPerformState != LLCurl::Multi::PERFORM_STATE_COMPLETED)
+	if (!mMulti->isCompleted())
 	{ //we're busy, try again later
 		return false;
 	}
-	mMulti->mPerformState = LLCurl::Multi::PERFORM_STATE_READY;
+	mMulti->setState(LLCurl::Multi::STATE_READY) ;
 
 	if (!mEasy)
 	{
@@ -1180,8 +1260,6 @@ unsigned long LLCurl::ssl_thread_id(void)
 
 void LLCurl::initClass(bool multi_threaded)
 {
-	sMainThreadID = LLThread::currentID();
-	sMultiThreaded = multi_threaded;
 	// Do not change this "unless you are familiar with and mean to control 
 	// internal operations of libcurl"
 	// - http://curl.haxx.se/libcurl/c/curl_global_init.html
@@ -1189,9 +1267,6 @@ void LLCurl::initClass(bool multi_threaded)
 
 	check_curl_code(code);
 	
-	Easy::sHandleMutex = new LLMutex(NULL);
-	Easy::sMultiMutex = new LLMutex(NULL);
-
 #if SAFE_SSL
 	S32 mutex_count = CRYPTO_num_locks();
 	for (S32 i=0; i<mutex_count; i++)
@@ -1201,20 +1276,29 @@ void LLCurl::initClass(bool multi_threaded)
 	CRYPTO_set_id_callback(&LLCurl::ssl_thread_id);
 	CRYPTO_set_locking_callback(&LLCurl::ssl_locking_callback);
 #endif
+
+	sCurlThread = new LLCurlThread(multi_threaded) ;
 }
 
 void LLCurl::cleanupClass()
 {
+	//shut down curl thread
+	while(1)
+	{
+		if(!sCurlThread->update(1)) //finish all tasks
+		{
+			break ;
+		}
+	}
+	sCurlThread->shutdown() ;
+	delete sCurlThread ;
+	sCurlThread = NULL ;
+
 #if SAFE_SSL
 	CRYPTO_set_locking_callback(NULL);
 	for_each(sSSLMutex.begin(), sSSLMutex.end(), DeletePointer());
 #endif
 
-	delete Easy::sHandleMutex;
-	Easy::sHandleMutex = NULL;
-	delete Easy::sMultiMutex;
-	Easy::sMultiMutex = NULL;
-
 	for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
 	{
 		CURL* curl = *iter;
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 87de202717c..23a6ca67e3b 100755
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -42,8 +42,10 @@
 #include "lliopipe.h"
 #include "llsd.h"
 #include "llthread.h"
+#include "llqueuedthread.h"
 
 class LLMutex;
+class LLCurlThread;
 
 // For whatever reason, this is not typedef'd in curl.h
 typedef size_t (*curl_header_callback)(void *ptr, size_t size, size_t nmemb, void *stream);
@@ -56,8 +58,6 @@ class LLCurl
 	class Easy;
 	class Multi;
 
-	static bool sMultiThreaded;
-
 	struct TransferInfo
 	{
 		TransferInfo() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {}
@@ -181,10 +181,12 @@ class LLCurl
 	static void ssl_locking_callback(int mode, int type, const char *file, int line);
 	static unsigned long ssl_thread_id(void);
 
+	static LLCurlThread* getCurlThread() { return sCurlThread ;}
 private:
 	static std::string sCAPath;
 	static std::string sCAFile;
 	static const unsigned int MAX_REDIRECTS;
+	static LLCurlThread* sCurlThread;
 };
 
 class LLCurl::Easy
@@ -216,7 +218,7 @@ class LLCurl::Easy
 	U32 report(CURLcode);
 	void getTransferInfo(LLCurl::TransferInfo* info);
 
-	void prepRequest(const std::string& url, const std::vector<std::string>& headers, ResponderPtr, S32 time_out = 0, bool post = false);
+	void prepRequest(const std::string& url, const std::vector<std::string>& headers, LLCurl::ResponderPtr, S32 time_out = 0, bool post = false);
 
 	const char* getErrorBuffer();
 
@@ -247,64 +249,105 @@ class LLCurl::Easy
 	// Note: char*'s not strings since we pass pointers to curl
 	std::vector<char*>	mStrings;
 
-	ResponderPtr		mResponder;
+	LLCurl::ResponderPtr		mResponder;
 
 	static std::set<CURL*> sFreeHandles;
 	static std::set<CURL*> sActiveHandles;
-	static LLMutex* sHandleMutex;
-	static LLMutex* sMultiMutex;
 };
 
-class LLCurl::Multi : public LLThread
+class LLCurl::Multi
 {
 	LOG_CLASS(Multi);
+
+	friend class LLCurlThread ;
+
+private:
+	~Multi();
+
+	void markDead() ;
+	bool doPerform();
+
 public:
 
 	typedef enum
 	{
-		PERFORM_STATE_READY=0,
-		PERFORM_STATE_PERFORMING=1,
-		PERFORM_STATE_COMPLETED=2
+		STATE_READY=0,
+		STATE_PERFORMING=1,
+		STATE_COMPLETED=2
 	} ePerformState;
 
-	Multi();
-	~Multi();
+	Multi();	
 
-	Easy* allocEasy();
-	bool addEasy(Easy* easy);
+	LLCurl::Easy* allocEasy();
+	bool addEasy(LLCurl::Easy* easy);	
+	void removeEasy(LLCurl::Easy* easy);
 	
-	void removeEasy(Easy* easy);
+	void lock() ;
+	void unlock() ;
+
+	void setState(ePerformState state) ;
+	ePerformState getState() ;
+	bool isCompleted() ;
+
+	bool waitToComplete() ;
 
 	S32 process();
-	void perform();
-	void doPerform();
 	
-	virtual void run();
-
 	CURLMsg* info_read(S32* msgs_in_queue);
 
 	S32 mQueued;
 	S32 mErrorCount;
 	
-	S32 mPerformState;
-
-	LLCondition* mSignal;
-	bool mQuitting;
-	bool mThreaded;
-
 private:
-	void easyFree(Easy*);
+	void easyFree(LLCurl::Easy*);
 	
 	CURLM* mCurlMultiHandle;
 
-	typedef std::set<Easy*> easy_active_list_t;
+	typedef std::set<LLCurl::Easy*> easy_active_list_t;
 	easy_active_list_t mEasyActiveList;
-	typedef std::map<CURL*, Easy*> easy_active_map_t;
+	typedef std::map<CURL*, LLCurl::Easy*> easy_active_map_t;
 	easy_active_map_t mEasyActiveMap;
-	typedef std::set<Easy*> easy_free_list_t;
+	typedef std::set<LLCurl::Easy*> easy_free_list_t;
 	easy_free_list_t mEasyFreeList;
+
+	LLQueuedThread::handle_t mHandle ;
+	ePerformState mState;
+
+	BOOL mDead ;
+	LLMutex* mMutexp ;
+	LLMutex* mDeletionMutexp ;
 };
 
+class LLCurlThread : public LLQueuedThread
+{
+public:
+
+	class CurlRequest : public LLQueuedThread::QueuedRequest
+	{
+	protected:
+		virtual ~CurlRequest(); // use deleteRequest()
+		
+	public:
+		CurlRequest(handle_t handle, LLCurl::Multi* multi);
+
+		/*virtual*/ bool processRequest();
+		/*virtual*/ void finishRequest(bool completed);
+
+	private:
+		// input
+		LLCurl::Multi* mMulti;
+	};
+	
+public:
+	LLCurlThread(bool threaded = true) ;
+	virtual ~LLCurlThread() ;
+
+	S32 update(U32 max_time_ms);
+
+	void addMulti(LLCurl::Multi* multi) ;
+	void deleteMulti(LLCurl::Multi* multi) ;
+} ;
+
 namespace boost
 {
 	void intrusive_ptr_add_ref(LLCurl::Responder* p);
@@ -339,7 +382,6 @@ class LLCurlRequest
 	LLCurl::Multi* mActiveMulti;
 	S32 mActiveRequestCount;
 	BOOL mProcessing;
-	U32 mThreadID; // debug
 };
 
 class LLCurlEasyRequest
@@ -357,9 +399,10 @@ class LLCurlEasyRequest
 	void slist_append(const char* str);
 	void sendRequest(const std::string& url);
 	void requestComplete();
-	void perform();
 	bool getResult(CURLcode* result, LLCurl::TransferInfo* info = NULL);
 	std::string getErrorString();
+	bool isCompleted() {return mMulti->isCompleted() ;}
+	bool wait() { return mMulti->waitToComplete(); }
 
 	LLCurl::Easy* getEasy() const { return mEasy; }
 
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index fa03bb7512f..a3a2b2b1b8c 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -170,6 +170,7 @@ LLURLRequest::~LLURLRequest()
 {
 	LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
 	delete mDetail;
+	mDetail = NULL ;
 }
 
 void LLURLRequest::setURL(const std::string& url)
@@ -344,7 +345,10 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 		static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform");
 		{
 			LLFastTimer t(FTM_URL_PERFORM);
-			mDetail->mCurlRequest->perform();
+			if(!mDetail->mCurlRequest->wait())
+			{
+				return status ;
+			}
 		}
 
 		while(1)
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c937f604fc1..8b7108e1e2b 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1417,6 +1417,11 @@ bool LLAppViewer::mainLoop()
 					}
 				}
 				gMeshRepo.update() ;
+				
+				if(!LLCurl::getCurlThread()->update(1))
+				{
+					LLCurl::getCurlThread()->pause() ; //nothing in the curl thread.
+				}
 
 				if(!total_work_pending) //pause texture fetching threads if nothing to process.
 				{
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index f483ba5af8d..920a9a37528 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -382,19 +382,11 @@ bool LLXMLRPCTransaction::Impl::process()
 			// continue onward
 		}
 	}
-	
-	//const F32 MAX_PROCESSING_TIME = 0.05f;
-	//LLTimer timer;
-
-	mCurlRequest->perform();
-
-	/*while (mCurlRequest->perform() > 0)
+		
+	if(!mCurlRequest->wait())
 	{
-		if (timer.getElapsedTimeF32() >= MAX_PROCESSING_TIME)
-		{
-			return false;
-		}
-	}*/
+		return false ;
+	}
 
 	while(1)
 	{
-- 
GitLab


From 08f364bfc9aaeb771145d660287427c41b1dc0bf Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 21 Nov 2011 16:00:52 -0600
Subject: [PATCH 270/933] SH-2708 Fix for broken shadows on alpha objects

---
 .../class1/deferred/shadowAlphaMaskF.glsl     |  2 +-
 .../class1/deferred/shadowAlphaMaskV.glsl     |  5 +++-
 indra/newview/lldrawpool.h                    |  1 -
 indra/newview/llviewershadermgr.cpp           |  1 +
 indra/newview/llvovolume.cpp                  |  5 ----
 indra/newview/pipeline.cpp                    | 27 +++++++++++++++----
 indra/newview/pipeline.h                      |  3 +--
 7 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index 46d42d2a4ad..c1fb7b55d4f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -37,7 +37,7 @@ VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a;
+	float alpha = diffuseLookup(vary_texcoord0.xy).a * vertex_color.a;
 
 	if (alpha < minimum_alpha)
 	{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index 6a3cba771bb..7d3b06c56e7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -34,15 +34,18 @@ VARYING vec4 post_pos;
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
+void passTextureIndex();
+
 void main()
 {
 	//transform vertex
 	vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
-	
 	post_pos = pos;
 	
 	gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
 	
+	passTextureIndex();
+
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	vertex_color = diffuse_color;
 }
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index c7acbb42c62..5a2981e7496 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -133,7 +133,6 @@ class LLRenderPass : public LLDrawPool
 		PASS_ALPHA,
 		PASS_ALPHA_MASK,
 		PASS_FULLBRIGHT_ALPHA_MASK,
-		PASS_ALPHA_SHADOW,
 		NUM_RENDER_TYPES,
 	};
 
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 18ae83e3b6e..bddc07b395c 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1338,6 +1338,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	if (success)
 	{
 		gDeferredShadowAlphaMaskProgram.mName = "Deferred Shadow Alpha Mask Shader";
+		gDeferredShadowAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
 		gDeferredShadowAlphaMaskProgram.mShaderFiles.clear();
 		gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB));
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index baab191cb6c..3d013f286c6 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4896,11 +4896,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 				{
 					registerFace(group, facep, LLRenderPass::PASS_ALPHA);
 				}
-
-				if (LLPipeline::sRenderDeferred)
-				{
-					registerFace(group, facep, LLRenderPass::PASS_ALPHA_SHADOW);
-				}
 			}
 			else if (gPipeline.canUseVertexShaders()
 				&& group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d8e271811a3..f3d5f948137 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6159,13 +6159,13 @@ void LLPipeline::resetVertexBuffers()
 	LLVertexBuffer::initClass(LLVertexBuffer::sEnableVBOs, LLVertexBuffer::sDisableVBOMapping);
 }
 
-void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture)
+void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture, BOOL batch_texture)
 {
 	LLMemType mt_ro(LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS);
 	assertInitialized();
 	gGL.loadMatrix(gGLModelView);
 	gGLLastMatrix = NULL;
-	mSimplePool->pushBatches(type, mask);
+	mSimplePool->pushBatches(type, mask, texture, batch_texture);
 	gGL.loadMatrix(gGLModelView);
 	gGLLastMatrix = NULL;		
 }
@@ -8195,7 +8195,14 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 	}
 	LLPipeline::sShadowRender = TRUE;
 	
-	U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY, LLRenderPass::PASS_BUMP, LLRenderPass::PASS_FULLBRIGHT_SHINY };
+	U32 types[] = { 
+		LLRenderPass::PASS_SIMPLE, 
+		LLRenderPass::PASS_FULLBRIGHT, 
+		LLRenderPass::PASS_SHINY, 
+		LLRenderPass::PASS_BUMP, 
+		LLRenderPass::PASS_FULLBRIGHT_SHINY 
+	};
+
 	LLGLEnable cull(GL_CULL_FACE);
 
 	if (use_shader)
@@ -8267,7 +8274,15 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
 		LLFastTimer ftm(FTM_SHADOW_ALPHA);
 		gDeferredShadowAlphaMaskProgram.bind();
 		gDeferredShadowAlphaMaskProgram.setMinimumAlpha(0.598f);
-		renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE);
+		
+		U32 mask =	LLVertexBuffer::MAP_VERTEX | 
+					LLVertexBuffer::MAP_TEXCOORD0 | 
+					LLVertexBuffer::MAP_COLOR | 
+					LLVertexBuffer::MAP_TEXTURE_INDEX;
+
+		renderObjects(LLRenderPass::PASS_ALPHA_MASK, mask, TRUE, TRUE);
+		renderObjects(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, mask, TRUE, TRUE);
+		renderObjects(LLRenderPass::PASS_ALPHA, mask, TRUE, TRUE);
 		gDeferredTreeShadowProgram.bind();
 		gDeferredTreeShadowProgram.setMinimumAlpha(0.598f);
 		renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE);
@@ -8589,7 +8604,9 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 					LLPipeline::RENDER_TYPE_TERRAIN,
 					LLPipeline::RENDER_TYPE_WATER,
 					LLPipeline::RENDER_TYPE_VOIDWATER,
-					LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW,
+					LLPipeline::RENDER_TYPE_PASS_ALPHA,
+					LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK,
+					LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK,
 					LLPipeline::RENDER_TYPE_PASS_GRASS,
 					LLPipeline::RENDER_TYPE_PASS_SIMPLE,
 					LLPipeline::RENDER_TYPE_PASS_BUMP,
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 8b6532ca257..c6b2e20fa53 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -231,7 +231,7 @@ class LLPipeline
 	void postSort(LLCamera& camera);
 	void forAllVisibleDrawables(void (*func)(LLDrawable*));
 
-	void renderObjects(U32 type, U32 mask, BOOL texture = TRUE);
+	void renderObjects(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_texture = FALSE);
 	void renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture);
 
 	void grabReferences(LLCullResult& result);
@@ -408,7 +408,6 @@ class LLPipeline
 		RENDER_TYPE_PASS_ALPHA					= LLRenderPass::PASS_ALPHA,
 		RENDER_TYPE_PASS_ALPHA_MASK				= LLRenderPass::PASS_ALPHA_MASK,
 		RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK	= LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK,
-		RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW,
 		// Following are object types (only used in drawable mRenderType)
 		RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES,
 		RENDER_TYPE_VOLUME,
-- 
GitLab


From 1dd24cfcf85f4807410bb8d5320a692e2d7e121c Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 21 Nov 2011 17:40:12 -0500
Subject: [PATCH 271/933] SH-2614 FIX, SH-2684 FIX - fixed buggy state
 management in onPhysicsUseLOD

---
 indra/newview/llfloatermodelpreview.cpp | 38 ++++++++++++-------------
 1 file changed, 19 insertions(+), 19 deletions(-)
 mode change 100644 => 100755 indra/newview/llfloatermodelpreview.cpp

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
old mode 100644
new mode 100755
index 881f087d7b7..49e29e7447d
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -995,38 +995,38 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata)
 //static
 void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
 {
-	S32 num_modes = 4;
-	S32 which_mode = 3;
-	static S32 previous_mode = which_mode;
+	S32 num_lods = 4;
+	S32 which_mode;
 
 	LLCtrlSelectionInterface* iface = sInstance->childGetSelectionInterface("physics_lod_combo");
 	if (iface)
 	{
 		which_mode = iface->getFirstSelectedIndex();
 	}
+	else
+	{
+		llwarns << "no iface" << llendl;
+		return;
+	}
 
-	S32 file_mode = iface->getItemCount() - 1;
-	bool file_browse = which_mode == file_mode;
-	bool lod_to_file = file_browse && (previous_mode != file_mode);
-	bool file_to_lod = !file_browse && (previous_mode == file_mode);
-
-	if (!lod_to_file)
+	if (which_mode <= 0)
 	{
-		which_mode = num_modes - which_mode;
-		sInstance->mModelPreview->setPhysicsFromLOD(which_mode);
+		llwarns << "which_mode out of range, " << which_mode << llendl;
 	}
 
-	if (lod_to_file || file_to_lod)
+	S32 file_mode = iface->getItemCount() - 1;
+	if (which_mode < file_mode)
 	{
-		LLModelPreview *model_preview = sInstance->mModelPreview;
-		if (model_preview)
-		{
-			model_preview->refresh();
-			model_preview->updateStatusMessages();
-		}
+		S32 which_lod = num_lods - which_mode;
+		sInstance->mModelPreview->setPhysicsFromLOD(which_lod);
 	}
 
-	previous_mode = which_mode;
+	LLModelPreview *model_preview = sInstance->mModelPreview;
+	if (model_preview)
+	{
+		model_preview->refresh();
+		model_preview->updateStatusMessages();
+	}
 }
 
 //static 
-- 
GitLab


From abf39f788609f65d1b2b3ac1548f7146aa5c8584 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 21 Nov 2011 15:15:26 -0800
Subject: [PATCH 272/933] Greatly reduced the number of memcpy operations done
 on the media plug-in message output pipe by removing 's = s.substr()' type
 operations.  The output string is now cleared via 's.clear()' when its entire
 contents have been pumped and the beginning of the data is stored as an index
 when necessary, rather than modifying the initial string.

Reviewed by davep.
---
 indra/llplugin/llpluginmessagepipe.cpp | 51 +++++++++++++++++---------
 indra/llplugin/llpluginmessagepipe.h   |  1 +
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp
index 8d13e38ad5c..091e93ea4be 100644
--- a/indra/llplugin/llpluginmessagepipe.cpp
+++ b/indra/llplugin/llpluginmessagepipe.cpp
@@ -94,10 +94,10 @@ void LLPluginMessagePipeOwner::killMessagePipe(void)
 LLPluginMessagePipe::LLPluginMessagePipe(LLPluginMessagePipeOwner *owner, LLSocket::ptr_t socket):
 	mInputMutex(gAPRPoolp),
 	mOutputMutex(gAPRPoolp),
+	mOutputStartIndex(0),
 	mOwner(owner),
 	mSocket(socket)
 {
-	
 	mOwner->setMessagePipe(this);
 }
 
@@ -113,6 +113,14 @@ bool LLPluginMessagePipe::addMessage(const std::string &message)
 {
 	// queue the message for later output
 	LLMutexLock lock(&mOutputMutex);
+
+	// If we're starting to use up too much memory, clear
+	if (mOutputStartIndex > 1024 * 1024)
+	{
+		mOutput = mOutput.substr(mOutputStartIndex);
+		mOutputStartIndex = 0;
+	}
+		
 	mOutput += message;
 	mOutput += MESSAGE_DELIMITER;	// message separator
 	
@@ -165,35 +173,44 @@ bool LLPluginMessagePipe::pumpOutput()
 	if(mSocket)
 	{
 		apr_status_t status;
-		apr_size_t size;
+		apr_size_t in_size, out_size;
 		
 		LLMutexLock lock(&mOutputMutex);
-		if(!mOutput.empty())
+
+		const char * output_data = &(mOutput.data()[mOutputStartIndex]);
+		if(*output_data != '\0')
 		{
 			// write any outgoing messages
-			size = (apr_size_t)mOutput.size();
+			in_size = (apr_size_t) (mOutput.size() - mOutputStartIndex);
+			out_size = in_size;
 			
 			setSocketTimeout(0);
 			
 //			LL_INFOS("Plugin") << "before apr_socket_send, size = " << size << LL_ENDL;
 
-			status = apr_socket_send(
-					mSocket->getSocket(),
-					(const char*)mOutput.data(),
-					&size);
+			status = apr_socket_send(mSocket->getSocket(),
+									 output_data,
+									 &out_size);
 
 //			LL_INFOS("Plugin") << "after apr_socket_send, size = " << size << LL_ENDL;
 			
-			if(status == APR_SUCCESS)
+			if((status == APR_SUCCESS) || APR_STATUS_IS_EAGAIN(status))
 			{
-				// success
-				mOutput = mOutput.substr(size);
-			}
-			else if(APR_STATUS_IS_EAGAIN(status))
-			{
-				// Socket buffer is full... 
-				// remove the written part from the buffer and try again later.
-				mOutput = mOutput.substr(size);
+				// Success or Socket buffer is full... 
+				
+				// If we've pumped the entire string, clear it
+				if (out_size == in_size)
+				{
+					mOutputStartIndex = 0;
+					mOutput.clear();
+				}
+				else
+				{
+					llassert(in_size > out_size);
+					
+					// Remove the written part from the buffer and try again later.
+					mOutputStartIndex += out_size;
+				}
 			}
 			else if(APR_STATUS_IS_EOF(status))
 			{
diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h
index beb942c0fe0..059943cc902 100644
--- a/indra/llplugin/llpluginmessagepipe.h
+++ b/indra/llplugin/llpluginmessagepipe.h
@@ -86,6 +86,7 @@ class LLPluginMessagePipe
 	std::string mInput;
 	LLMutex mOutputMutex;
 	std::string mOutput;
+	std::string::size_type mOutputStartIndex;
 
 	LLPluginMessagePipeOwner *mOwner;
 	LLSocket::ptr_t mSocket;
-- 
GitLab


From 13ece17f1d177a90b09e66d81fd9b4a99496de11 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 21 Nov 2011 16:24:49 -0800
Subject: [PATCH 273/933] sync with viewer-development

---
 .../default/xui/en/floater_model_preview.xml  |   5 +-
 .../skins/default/xui/en/floater_snapshot.xml | 132 +++++++++++++-----
 .../default/xui/en/panel_postcard_message.xml |   6 +-
 .../xui/en/panel_snapshot_inventory.xml       |   5 +-
 .../default/xui/en/panel_snapshot_local.xml   |  17 ++-
 .../default/xui/en/panel_snapshot_options.xml |  64 ---------
 .../default/xui/en/panel_snapshot_profile.xml |   4 +-
 7 files changed, 120 insertions(+), 113 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index fbaf4f0a8a8..eebc5ddc72a 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -6,6 +6,7 @@
 
   <string name="status_idle"></string>
   <string name="status_parse_error">Error: Dae parsing issue - see log for details.</string>
+  <string name="status_material_mismatch">Error: Material of model is not a subset of reference model.</string>
   <string name="status_reading_file">Loading...</string>
   <string name="status_generating_meshes">Generating Meshes...</string>
   <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
@@ -789,7 +790,7 @@
                     <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/> -->
                 </panel>
             
-            <!-- ==== STEP 2: Analyse ==== -->
+            <!-- ==== STEP 2: Analyze ==== -->
             <view_border
               bevel_style="none"
               follows="top|left"
@@ -818,7 +819,7 @@
                       name="method_label"
                       text_color="White"
                       top_pad="0">
-                      Step 2: Analyse
+                      Step 2: Analyze
                     </text>
                     <text
                       follows="top|left"
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index d7a1510c1c0..85f65dedd38 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -5,7 +5,7 @@
  can_minimize="true"
  can_close="true"
  follows="left|top"
- height="600"
+ height="500"
  layout="topleft"
  name="Snapshot"
  help_topic="snapshot"
@@ -35,7 +35,7 @@
     </string>
  	<string
  	 name="profile_succeeded_str">
- 	    Your Profile Feed has been updated!
+ 	    Profile feed updated!
  	</string>
  	<string
  	 name="postcard_succeeded_str">
@@ -65,45 +65,15 @@
  	 name="local_failed_str">
  	    Failed to save to computer.
  	</string>
-   <view_border 
-    bevel_style="in"
-    follows="left|top" 
-    height="21"
-    left="10"
-    layout="topleft"
-    name="img_info_border"
-    top="22"
-    width="50"
-   />
-   <icon
-    follows="top|left"
-    height="18"
-    image_name="Snapshot_Off"
-    layout="topleft"
-    left_delta="-5"
-    mouse_opaque="true"
-    name="refresh_icon"
-    top_delta="3"
-    width="36" />
-   <button
-    follows="left|top"
-    height="22"
-    image_overlay="Refresh_Off"
-    layout="topleft"
-    left_delta="31"
-    name="new_snapshot_btn"
-    top_delta="-3"
-    width="23" />
     <button
      follows="left|top"
      height="23"
      image_overlay="TabIcon_Close_Off"
-     is_toggle="true"
      layout="topleft"
-     left="240"
+     left="236"
      name="advanced_options_btn"
      tool_tip="Advanced options"
-     top_delta="0"
+     top="25"
      width="23" />
   <ui_ctrl 
     height="160"
@@ -113,6 +83,70 @@
     top="50"
     follows="left|top"
     left="10">
+      <panel
+       background_visible="true"
+       bg_alpha_color="0.9 1 0.9 1"
+       follows="left|top"
+       font="SansSerifLarge"
+       halign="center"
+       height="20"
+       layout="topleft"
+       left="0"
+       length="1"
+       name="succeeded_panel"
+       right="-1"
+       top="0"
+       type="string"
+       visible="false">
+          <text
+           follows="all"
+           font="SansSerif"
+           halign="center"
+           height="18"
+           layout="topleft"
+           left="1"
+           length="1"
+           name="succeeded_lbl"
+           right="-1"
+           text_color="0.2 0.5 0.2 1"
+           top="4"
+           translate="false"
+           type="string">
+              Succeeded
+          </text>
+      </panel>
+      <panel
+       background_visible="true"
+       bg_alpha_color="1 0.9 0.9 1"
+       follows="left|top"
+       font="SansSerifLarge"
+       halign="center"
+       height="20"
+       layout="topleft"
+       left_delta="0"
+       length="1"
+       name="failed_panel"
+       right="-1"
+       top="0"
+       type="string"
+       visible="false">
+          <text
+           follows="all"
+           font="SansSerif"
+           halign="center"
+           height="18"
+           layout="topleft"
+           left="1"
+           length="1"
+           name="failed_lbl"
+           right="-1"
+           text_color="0.5 0.2 0.2 1"
+           top="4"
+           translate="false"
+           type="string">
+              Failed
+          </text>
+      </panel>
       <loading_indicator
        follows="left|top"
        height="48"
@@ -139,6 +173,34 @@
        width="130">
           Working
       </text>
+      <button
+       follows="left|top"
+       height="22"
+       image_overlay="Refresh_Off"
+       layout="topleft"
+       left="20"
+       name="new_snapshot_btn"
+       bottom="-20"
+       visible="false"
+       width="22" />
+      <text
+       follows="left|top"
+       font="SansSerifBold"
+       halign="left"
+       height="18"
+       layout="topleft"
+       left_pad="10"
+       length="1"
+       name="refresh_lbl"
+       right="-5"
+       text_color="red"
+       top_delta="0"
+       translate="false"
+       type="string"
+       visible="false"
+       width="130">
+          Refresh to save.
+      </text>
   </ui_ctrl>
   <view_border 
    bevel_style="in" 
@@ -180,7 +242,7 @@
    </text>
     <panel_container
      follows="left|top"
-     height="360"
+     height="260"
      layout="topleft"
      left="0"
      name="panel_container"
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_message.xml b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
index e9f322f590f..ab2a42ea01b 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
@@ -87,8 +87,8 @@
     <text_editor
      type="string"
      length="1"
-     follows="left|top|right|bottom"
-     height="140"
+     follows="left|top|right"
+     height="60"
      layout="topleft"
      left_delta="0"
      max_length="700"
@@ -104,7 +104,7 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index 7b148fa338f..9057ebb65eb 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -118,14 +118,15 @@
      label="Constrain proportions"
      layout="topleft"
      left="10"
-     name="inventory_keep_aspect_check" />
+     name="inventory_keep_aspect_check"
+     visible="false" />
     <button
      follows="right|bottom"
      height="23"
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index 4d6c4bcdfac..30403a21dd6 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -173,22 +173,29 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
        function="Local.Cancel" />
     </button>
-    <button
+    <flyout_button
      follows="right|bottom"
      height="23"
      label="Save"
      layout="topleft"
      left_delta="-106"
      name="save_btn"
+     tool_tip="Save image to a file"
      top_delta="0"
      width="100">
-      <button.commit_callback
-       function="Local.Save" />
-    </button>
+        <flyout_button.item
+         label="Save"
+         name="save_item"
+         value="save" />
+        <flyout_button.item
+         label="Save As..."
+         name="saveas_item"
+         value="save as" />
+    </flyout_button>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 792f6dbec8f..d2f29ade44c 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -81,68 +81,4 @@
     <button.commit_callback
      function="Snapshot.SaveToComputer" />
   </button>
-  <panel
-   background_visible="true"
-   bg_alpha_color="0.9 1 0.9 1"
-   bottom="-10"
-   follows="left|bottom|right"
-   font="SansSerifLarge"
-   halign="center"
-   height="20"
-   layout="topleft"
-   left_delta="0"
-   length="1"
-   name="succeeded_panel"
-   right="-10"
-   type="string"
-   visible="false">
-      <text
-       follows="all"
-       font="SansSerif"
-       halign="center"
-       height="18"
-       layout="topleft"
-       left="1"
-       length="1"
-       name="succeeded_lbl"
-       right="-1"
-       text_color="0.2 0.5 0.2 1"
-       top="4"
-       translate="false"
-       type="string">
-          Succeeded
-      </text>
-  </panel>
-  <panel
-   background_visible="true"
-   bg_alpha_color="1 0.9 0.9 1"
-   bottom="-10"
-   follows="left|bottom|right"
-   font="SansSerifLarge"
-   halign="center"
-   height="20"
-   layout="topleft"
-   left_delta="0"
-   length="1"
-   name="failed_panel"
-   right="-10"
-   type="string"
-   visible="false">
-      <text
-       follows="all"
-       font="SansSerif"
-       halign="center"
-       height="18"
-       layout="topleft"
-       left="1"
-       length="1"
-       name="failed_lbl"
-       right="-1"
-       text_color="0.5 0.2 0.2 1"
-       top="4"
-       translate="false"
-       type="string">
-          Failed
-      </text>
-  </panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 0760a33f82e..ee79a4b3b82 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -119,7 +119,7 @@
     </text>
     <text_editor
      follows="all"
-     height="170"
+     height="160"
      layout="topleft"
      left_delta="0"
      length="1"
@@ -144,7 +144,7 @@
      label="Cancel"
      layout="topleft"
      name="cancel_btn"
-     right="-10"
+     right="-32"
      top="350"
      width="100">
       <button.commit_callback
-- 
GitLab


From f8067d7b6865569371ba1e2ec3ea2bcc4c458f6d Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 21 Nov 2011 16:36:14 -0800
Subject: [PATCH 274/933] FIX INTL-82 LQA changes for Turkish and French

---
 .../xui/fr/panel_preferences_privacy.xml      |  2 +-
 .../xui/fr/panel_preferences_sound.xml        |  6 +-
 .../default/xui/fr/panel_region_debug.xml     |  2 +-
 .../newview/skins/default/xui/fr/strings.xml  |  2 +-
 .../skins/default/xui/tr/floater_about.xml    |  6 +-
 .../default/xui/tr/floater_about_land.xml     | 16 ++--
 .../skins/default/xui/tr/floater_buy_land.xml |  4 +-
 .../default/xui/tr/floater_edit_day_cycle.xml |  4 +-
 .../xui/tr/floater_environment_settings.xml   |  2 +-
 .../default/xui/tr/floater_god_tools.xml      |  2 +-
 .../skins/default/xui/tr/floater_joystick.xml |  8 +-
 .../default/xui/tr/floater_preferences.xml    |  2 +-
 .../xui/tr/floater_preview_gesture.xml        |  2 +-
 .../default/xui/tr/floater_report_abuse.xml   |  2 +-
 .../skins/default/xui/tr/floater_tools.xml    |  6 +-
 .../skins/default/xui/tr/menu_viewer.xml      |  4 +-
 .../skins/default/xui/tr/notifications.xml    |  2 +-
 .../skins/default/xui/tr/panel_people.xml     |  6 +-
 .../xui/tr/panel_preferences_advanced.xml     |  4 +-
 .../default/xui/tr/panel_preferences_chat.xml |  4 +-
 .../xui/tr/panel_preferences_general.xml      |  2 +-
 .../xui/tr/panel_preferences_graphics1.xml    |  4 +-
 .../xui/tr/panel_preferences_privacy.xml      |  2 +-
 .../default/xui/tr/panel_region_debug.xml     |  4 +-
 .../xui/tr/panel_region_environment.xml       |  2 +-
 .../default/xui/tr/panel_region_terrain.xml   |  2 +-
 .../skins/default/xui/tr/role_actions.xml     |  2 +-
 .../default/xui/tr/sidepanel_task_info.xml    |  2 +-
 .../newview/skins/default/xui/tr/strings.xml  | 92 +++++++++----------
 29 files changed, 99 insertions(+), 99 deletions(-)

diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
index 3123a4c6fe1..b122db95027 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
@@ -20,7 +20,7 @@
 	<check_box label="Inclure la date et l&apos;heure pour chaque ligne du journal de chat" name="show_timestamps_check_im"/>
 	<check_box label="Inclure la date dans le nom du fichier journal" name="logfile_name_datestamp"/>
 	<text name="log_path_desc">
-		Emplacement :
+		Emplacement des journaux :
 	</text>
 	<line_editor left="308" name="log_path_string" right="-20"/>
 	<button label="Parcourir" label_selected="Parcourir" name="log_path_button" width="150"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml b/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml
index deaec2e14fa..37eb6bbeb03 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml
@@ -17,9 +17,9 @@
 	<check_box label="Activé" name="enable_media"/>
 	<slider label="Chat vocal" name="Voice Volume"/>
 	<check_box label="Activé" name="enable_voice_check"/>
-	<check_box label="Autoriser la lecture automatique du média" name="media_auto_play_btn" tool_tip="Cochez pour autoriser la lecture automatique du média" value="true"/>
-	<check_box label="Lecture du média aux autres avatars" name="media_show_on_others_btn" tool_tip="Décochez pour masquer le média aux autres avatars près de vous" value="true"/>
-	<check_box label="Lire les sons des gestes" name="gesture_audio_play_btn" tool_tip="Cochez cette case pour entendre les sons associés aux gestes." value="true"/>
+	<check_box label="Autoriser la lecture automatique du média" name="media_auto_play_btn" tool_tip="Cocher pour autoriser la lecture automatique du média." value="true"/>
+	<check_box label="Lire le média attaché aux autres avatars" name="media_show_on_others_btn" tool_tip="Décocher pour masquer le média attaché aux autres avatars près de vous." value="true"/>
+	<check_box label="Lire les sons des gestes" name="gesture_audio_play_btn" tool_tip="Cocher cette case pour entendre les sons associés aux gestes." value="true"/>
 	<text name="voice_chat_settings">
 		Paramètres du chat vocal
 	</text>
diff --git a/indra/newview/skins/default/xui/fr/panel_region_debug.xml b/indra/newview/skins/default/xui/fr/panel_region_debug.xml
index cb4a74e1424..733c3f9a22c 100644
--- a/indra/newview/skins/default/xui/fr/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/fr/panel_region_debug.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Débugger" name="Debug">
+<panel label="Débogage" name="Debug">
 	<text name="region_text_lbl">
 		Région :
 	</text>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index daa31c980a7..f9f3366f63e 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -4837,7 +4837,7 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 		Parler
 	</string>
 	<string name="Command_View_Label">
-		Vue
+		Affichage
 	</string>
 	<string name="Command_Voice_Label">
 		Chat près de vous
diff --git a/indra/newview/skins/default/xui/tr/floater_about.xml b/indra/newview/skins/default/xui/tr/floater_about.xml
index 998890b85c8..993ec429581 100644
--- a/indra/newview/skins/default/xui/tr/floater_about.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about.xml
@@ -46,16 +46,16 @@ Ses Sunucusu Sürümü: [VOICE_VERSION]
 		</panel>
 		<panel label="Katkıda Bulunanlar" name="credits_panel">
 			<text name="linden_intro">
-				Second Life, Lindens&apos;lar tarafından geliştirilmiştir:
+				Second Life, Linden&apos;lar tarafından geliştirilmiştir:
 			</text>
 			<text name="contrib_intro">
-				açık kaynak kod katkısında bulunanlar:
+				Açık kaynak kod katkısında bulunanlar:
 			</text>
 			<text_editor name="contrib_names">
 				Geçici Ad çalıştırma sırasında değiştirilir
 			</text_editor>
 			<text name="trans_intro">
-				çevirileri yapanlar:
+				Çevirileri yapanlar:
 			</text>
 			<text_editor name="trans_names">
 				Geçici Ad çalıştırma sırasında değiştirilir
diff --git a/indra/newview/skins/default/xui/tr/floater_about_land.xml b/indra/newview/skins/default/xui/tr/floater_about_land.xml
index c44722f4baa..e0350964b59 100644
--- a/indra/newview/skins/default/xui/tr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about_land.xml
@@ -102,7 +102,7 @@
 			<text name="For Sale: Price L$[PRICE].">
 				Fiyat: L$[PRICE] (L$[PRICE_PER_SQM]/m²)
 			</text>
-			<button label="Arazi Sat" name="Sell Land..."/>
+			<button label="Araziyi Sat" name="Sell Land..."/>
 			<text name="For sale to">
 				Şu Alıcıya Satılık: [BUYER]
 			</text>
@@ -307,7 +307,7 @@ Sadece büyük parseller aramada görünür.
 				İtme Yok (Bölge Geçersiz Kılma)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Bu parseldeki sakinleri gör ve onlarla sohbet et
+				Parseldeki sakinleri gör ve onlarla sohbet et
 			</panel.string>
 			<text name="allow_label">
 				Sakinlere şunun için izin ver:
@@ -336,7 +336,7 @@ Sadece büyük parseller aramada görünür.
 			<check_box label="İtme Yok" name="PushRestrictCheck" tool_tip="Komut dosyalarının itmesini önler Bu seçeneğin işaretlenmesi arazinizdeki bozucu davranışları önlemeye yardımcı olabilir."/>
 			<check_box label="Konumu Arama sonuçlarında göster (L$30/hafta)" name="ShowDirectoryCheck" tool_tip="Arama sonuçlarında bu parsel görünsün"/>
 			<combo_box name="land category with adult">
-				<combo_box.item label="Herhangi Bir Kategori" name="item0"/>
+				<combo_box.item label="Herh. Bir Kategori" name="item0"/>
 				<combo_box.item label="Linden Konumu" name="item1"/>
 				<combo_box.item label="YetiÅŸkin" name="item2"/>
 				<combo_box.item label="Sanat ve Kültür" name="item3"/>
@@ -352,7 +352,7 @@ Sadece büyük parseller aramada görünür.
 				<combo_box.item label="DiÄŸer" name="item12"/>
 			</combo_box>
 			<combo_box name="land category">
-				<combo_box.item label="Herhangi Bir Kategori" name="item0"/>
+				<combo_box.item label="Herh. Bir Kategori" name="item0"/>
 				<combo_box.item label="Linden Konumu" name="item1"/>
 				<combo_box.item label="Sanat ve Kültür" name="item3"/>
 				<combo_box.item label="Ä°ÅŸ" name="item4"/>
@@ -372,7 +372,7 @@ Sadece büyük parseller aramada görünür.
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Bir resim seçmek için tıklayın"/>
 			<text name="allow_label5">
-				Diğer parsellerdeki Sakinlere şunun için izin verin:
+				Diğer parsel Sakinlerine şunun için izin verin:
 			</text>
 			<check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki sakinlerin bu parseldeki sakinleri görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/>
 			<text name="landing_point">
@@ -419,7 +419,7 @@ Sadece büyük parseller aramada görünür.
 				piksel
 			</text>
 			<text name="Options:">
-				Seçenekler:
+				Seçenklr.:
 			</text>
 			<check_box label="Döngü" name="media_loop" tool_tip="Ortamı döngüsel olarak oynat.  Ortamın oynatılması bittiğinde baştan tekrar başlayacaktır."/>
 		</panel>
@@ -448,7 +448,7 @@ Sadece büyük parseller aramada görünür.
 				(Gayrimenkul tarafından tanımlanır)
 			</panel.string>
 			<panel.string name="allow_public_access">
-				Kamusal Erişime İzin Ver ([MATURITY]) (Not: Bunun işaretinin kaldırılması yasaklama çizgileri oluşturacaktır)
+				Kamusal Erişime İzin Ver ([MATURITY]) (Not: İşaret kaldırılırsa yasaklama çizgileri oluşur)
 			</panel.string>
 			<panel.string name="estate_override">
 				Bu seçeneklerden biri veya daha fazlası gayrimenkul düzeyinde ayarlanır
@@ -462,7 +462,7 @@ Sadece büyük parseller aramada görünür.
 			<check_box label="Dosyadaki ödeme bilgileri [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Tanınmayan Sakinleri Yasakla."/>
 			<check_box label="Yaş doğrulama [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Yaşını doğrulamayan Sakinleri yasakla Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
 			<check_box label="Grup EriÅŸimine Ä°zin Ver: [GROUP]" name="GroupCheck" tool_tip="Genel sekmesinde grup ayarla."/>
-			<check_box label="Geçiş haklarını şuna sat:" name="PassCheck" tool_tip="Bu parsele geçici erişim verir"/>
+			<check_box label="Geçiş haklr. şuna sat:" name="PassCheck" tool_tip="Bu parsele geçici erişim verir"/>
 			<combo_box name="pass_combo">
 				<combo_box.item label="Herkes" name="Anyone"/>
 				<combo_box.item label="Grup" name="Group"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_buy_land.xml b/indra/newview/skins/default/xui/tr/floater_buy_land.xml
index 4d43157f99d..7b43af2ea48 100644
--- a/indra/newview/skins/default/xui/tr/floater_buy_land.xml
+++ b/indra/newview/skins/default/xui/tr/floater_buy_land.xml
@@ -53,7 +53,7 @@ Daha küçük bir alan seçmeyi deneyin.
 		Arazi alma bilgileri çekilirken hata oluştu.
 	</floater.string>
 	<floater.string name="buying_will">
-		Bu arazinin satın alınması sonucu:
+		Arazinin satın alınması sonucu:
 	</floater.string>
 	<floater.string name="buying_for_group">
 		Bu arazinin grup için satın alınması sonucu:
@@ -185,7 +185,7 @@ Daha küçük bir alan seçmeyi deneyin.
 nesnelerle satılır
 	</text>
 	<text name="info_action">
-		Bu arazinin satın alınması sonucu:
+		Arazinin satın alınması sonucu:
 	</text>
 	<text name="error_message">
 		Bir ÅŸeyler yolunda deÄŸil.
diff --git a/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml b/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml
index e2e87ddf1e7..4be1068dcc4 100644
--- a/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml
+++ b/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml
@@ -22,10 +22,10 @@
 		Not: Ön ayarınızın adını değiştirirseniz, yeni bir ön ayar oluşturursunuz ve mevcut ön ayar değişmez.
 	</text>
 	<text name="hint_item1">
-		- Belirli gökyüzü ayarlarını ve zamanı düzenlemek için bir sekmeye tıklayın.
+		- Birine tıklayarak gökyüzü ayarlarını/zamanı düzenleyin.
 	</text>
 	<text name="hint_item2">
-		- Geçiş sürelerini ayarlamak için sekmelere tıklayın ve bunları sürükleyin.
+		- Sekmelere tıklayıp sürükleyerek geçiş sürlrn. ayarlayın.
 	</text>
 	<text name="hint_item3">
 		- Gün döngünüzü önizlemek için fırçayı kullanın.
diff --git a/indra/newview/skins/default/xui/tr/floater_environment_settings.xml b/indra/newview/skins/default/xui/tr/floater_environment_settings.xml
index 943e1e810d8..e702da7e1b0 100644
--- a/indra/newview/skins/default/xui/tr/floater_environment_settings.xml
+++ b/indra/newview/skins/default/xui/tr/floater_environment_settings.xml
@@ -18,7 +18,7 @@
 			<combo_box.item label="-Bir ön ayar seçin-" name="item0"/>
 		</combo_box>
 		<text name="sky_dayc_settings_title">
-			Gökyüzü / Gün Döngüsü
+			Gökyüzü/Gün Dön.
 		</text>
 		<radio_group name="sky_dayc_settings_radio_group">
 			<radio_item label="Sabit gökyüzü" name="my_sky_settings"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_god_tools.xml b/indra/newview/skins/default/xui/tr/floater_god_tools.xml
index ce7f7badcc9..26e5ebd18b8 100644
--- a/indra/newview/skins/default/xui/tr/floater_god_tools.xml
+++ b/indra/newview/skins/default/xui/tr/floater_god_tools.xml
@@ -67,7 +67,7 @@
 			<button label="Hedefin *Herhangi Bir* Arazideki Komut Dosyalı Nesnelerini Sil" label_selected="Hedefin *Herhangi Bir* Arazideki Komut Dosyalı Nesnelerini Sil" name="Delete Target&apos;s Scripted Objects On *Any* Land" tool_tip="Bu bölgede hedefe ait olan tüm komut dosyalı nesneleri silin. (kopya yok) nesneler geri döndürülür."/>
 			<button label="Hedefin *TÜM* Nesnelerini Sil" label_selected="Hedefin *TÜM* Nesnelerini Sil" name="Delete *ALL* Of Target&apos;s Objects" tool_tip="Bu bölgede hedefe ait olan tüm nesneleri silin. (kopya yok) nesneler geri döndürülür."/>
 			<button label="En Çok Çarpışanlar" label_selected="En Çok Çarpışanlar" name="Get Top Colliders" tool_tip="En dar fazda geri aramaları yaşayan nesnelerin listesini alır"/>
-			<button label="En Çok Komut Dosyası Çalıştıranlar" label_selected="En Çok Komut Dosyası Çalıştıranlar" name="Get Top Scripts" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesini alır"/>
+			<button label="En Çok Komut Dsy. Çalştr." label_selected="En Çok Komut Dsy. Çalştr." name="Get Top Scripts" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesini alır"/>
 			<button label="Komut dosyaları özeti" label_selected="Komut dosyaları özeti" name="Scripts digest" tool_tip="Tüm komut dosyalarının ve her birinin ne kadar kullanıldığının listesini alır"/>
 		</panel>
 		<panel label="Talep" name="request">
diff --git a/indra/newview/skins/default/xui/tr/floater_joystick.xml b/indra/newview/skins/default/xui/tr/floater_joystick.xml
index 31d819743ca..4a27aac3c19 100644
--- a/indra/newview/skins/default/xui/tr/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/tr/floater_joystick.xml
@@ -3,10 +3,10 @@
 	<floater.string name="NoDevice">
 		cihaz tespit edilmedi
 	</floater.string>
-	<check_box label="Oyun Çubuğunu Etkinleştir:" name="enable_joystick"/>
-	<spinner label="X Eksen Haritalama" name="JoystickAxis1"/>
-	<spinner label="Y Eksen Haritalama" name="JoystickAxis2"/>
-	<spinner label="Z Eksen Haritalama" name="JoystickAxis0"/>
+	<check_box label="Oyun Çub. Etkşt:" name="enable_joystick"/>
+	<spinner label="X Eks. Haritalama" name="JoystickAxis1"/>
+	<spinner label="Y Eks. Haritalama" name="JoystickAxis2"/>
+	<spinner label="Z Eks. Haritalama" name="JoystickAxis0"/>
 	<spinner label="EÄŸim Haritalama" name="JoystickAxis4"/>
 	<spinner label="Düşey Sapma Haritalama" name="JoystickAxis5"/>
 	<spinner label="Tilt Haritalama" name="JoystickAxis3"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_preferences.xml b/indra/newview/skins/default/xui/tr/floater_preferences.xml
index a0be9dc53f0..edb3c19b81f 100644
--- a/indra/newview/skins/default/xui/tr/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/tr/floater_preferences.xml
@@ -7,7 +7,7 @@
 		<panel label="Grafikler" name="display"/>
 		<panel label="Ses ve Ortamlar" name="audio"/>
 		<panel label="Sohbet" name="chat"/>
-		<panel label="Hareketler ve Görünümler" name="move"/>
+		<panel label="Hareket ve Görünümler" name="move"/>
 		<panel label="Bildirimler" name="msgs"/>
 		<panel label="Renkler" name="colors"/>
 		<panel label="Gizlilik" name="im"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml
index fa9fd37e6c5..dc6f66f6571 100644
--- a/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml
+++ b/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml
@@ -65,7 +65,7 @@
 	<check_box label="tüm animasyonlar bitinceye kadar" name="wait_anim_check"/>
 	<check_box label="saniye olarak zaman:" name="wait_time_check"/>
 	<text name="help_label">
-		Bekleme adımlar eklemediğiniz sürece tüm adımlar aynı anda gerçekleşir.
+		Bekleme adımları eklemediğiniz sürece tüm adımlar aynı anda gerçekleşir.
 	</text>
 	<check_box label="Etkin" name="active_check" tool_tip="Etkin mimikleri tetiklemek için tetikleme fazları için sohbet gerçekleştirebilir veya kısayol tuşlarına basabilirsiniz.  Bir anahtar bağlama ihtilafı olduğunda mimikler genellikle inaktif hale geçer."/>
 	<button label="Önizleme" name="preview_btn"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml
index ae4c3cc75e4..c5765883c43 100644
--- a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml
@@ -81,7 +81,7 @@
 		Özet:
 	</text>
 	<text name="dscr_title">
-		Ayrıntılar:
+		Ayrıntl:
 	</text>
 	<text name="bug_aviso">
 		Mümkün olduğunca spesifik olun
diff --git a/indra/newview/skins/default/xui/tr/floater_tools.xml b/indra/newview/skins/default/xui/tr/floater_tools.xml
index cd5e6b7fac4..d4ee9995dda 100644
--- a/indra/newview/skins/default/xui/tr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/tr/floater_tools.xml
@@ -55,7 +55,7 @@
 		<radio_item label="Uzat (Ctrl+Shift)" name="radio stretch"/>
 		<radio_item label="Yüzü Seç" name="radio select face"/>
 	</radio_group>
-	<check_box label="Bağlantılı olanları düzenle" name="checkbox edit linked parts"/>
+	<check_box label="Bağlantılıları düzenle" name="checkbox edit linked parts"/>
 	<button label="BaÄŸla" name="link_btn"/>
 	<button label="Bağlantıyı Kopar" name="unlink_btn"/>
 	<text label="Her İki Tarafı Uzat" name="checkbox uniform label">
@@ -81,7 +81,7 @@
 	<button name="ToolGrass" tool_tip="Çimen"/>
 	<check_box label="Seçili Aracı tut" name="checkbox sticky"/>
 	<check_box label="Seçimi kopyala" name="checkbox copy selection"/>
-	<check_box initial_value="true" label="Kopyayı Merkeze Al" name="checkbox copy centers"/>
+	<check_box initial_value="true" label="Kopyayı Merkezle" name="checkbox copy centers"/>
 	<check_box label="Kopyayı Döndür" name="checkbox copy rotates"/>
 	<radio_group name="land_radio_group">
 		<radio_item label="Araziyi Seç" name="radio select land"/>
@@ -376,7 +376,7 @@
 			</combo_box>
 			<spinner label="Yerçekimi" name="Physics Gravity"/>
 			<spinner label="Sürtünme" name="Physics Friction"/>
-			<spinner label="100 kg/m^3 cinsinden yoÄŸunluk" name="Physics Density"/>
+			<spinner label="100 kg/m3 cinsinden yoÄŸunluk" name="Physics Density"/>
 			<spinner label="Restitüsyon" name="Physics Restitution"/>
 		</panel>
 		<panel label="Doku" name="Texture">
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index efeed833a56..75294e38d5b 100644
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -93,7 +93,7 @@
 			<menu_item_call label="Arazi Aracı" name="Land"/>
 		</menu>
 		<menu_item_call label="BaÄŸla" name="Link"/>
-		<menu_item_call label="Bağlantıyı Kopar" name="Unlink"/>
+		<menu_item_call label="BaÄŸlnty. Kopar" name="Unlink"/>
 		<menu_item_check label="Bağlantılı Parçaları Düzenle" name="Edit Linked Parts"/>
 		<menu label="Bağlantılı Parçaları Seç" name="Select Linked Parts">
 			<menu_item_call label="Sonraki Parçayı Seç" name="Select Next Part"/>
@@ -118,7 +118,7 @@
 			<menu_item_call label="Komut Dosyalarını Çalışıyor Olarak Ayarla" name="Set Scripts to Running"/>
 			<menu_item_call label="Komut Dosyalarını Çalışmıyor Olarak Ayarla" name="Set Scripts to Not Running"/>
 		</menu>
-		<menu label="Seçenekler" name="Options">
+		<menu label="Seçenklr." name="Options">
 			<menu_item_check label="Gelişmiş İzinleri Göster" name="DebugPermissions"/>
 			<menu_item_check label="Sadece Nesnelerimi Seç" name="Select Only My Objects"/>
 			<menu_item_check label="Sadece Hareket Ettirilebilir Nesneleri Seç" name="Select Only Movable Objects"/>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index a268c103a6e..b62ff01ab96 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -2270,7 +2270,7 @@ Daha küçük bir arazi parçası seçmeyi deneyin.
 [NAME]
 [DATE]
 		<form name="form">
-			<button name="Details" text="Ayrıntılar"/>
+			<button name="Details" text="Ayrıntl"/>
 			<button name="Cancel" text="Ä°ptal"/>
 		</form>
 	</notification>
diff --git a/indra/newview/skins/default/xui/tr/panel_people.xml b/indra/newview/skins/default/xui/tr/panel_people.xml
index 7d42e3ab798..1a1e53bac20 100644
--- a/indra/newview/skins/default/xui/tr/panel_people.xml
+++ b/indra/newview/skins/default/xui/tr/panel_people.xml
@@ -24,7 +24,7 @@ Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/worldmap Dünya
 	<tab_container name="tabs">
 		<panel label="YAKIN" name="nearby_panel">
 			<panel label="bottom_panel" name="bottom_panel">
-				<menu_button name="nearby_view_sort_btn" tool_tip="Seçenekler"/>
+				<menu_button name="nearby_view_sort_btn" tool_tip="Seçenklr."/>
 				<button name="add_friend_btn" tool_tip="Seçilen Sakini arkadaş listene ekle"/>
 			</panel>
 		</panel>
@@ -49,14 +49,14 @@ Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/worldmap Dünya
 		</panel>
 		<panel label="GRUPLARIM" name="groups_panel">
 			<panel label="bottom_panel" name="bottom_panel">
-				<menu_button name="groups_viewsort_btn" tool_tip="Seçenekler"/>
+				<menu_button name="groups_viewsort_btn" tool_tip="Seçenklr."/>
 				<button name="plus_btn" tool_tip="Gruba katıl/yeni grup oluştur"/>
 				<button name="activate_btn" tool_tip="Seçilen grubu etkinleştir"/>
 			</panel>
 		</panel>
 		<panel label="SON" name="recent_panel">
 			<panel label="bottom_panel" name="bottom_panel">
-				<menu_button name="recent_viewsort_btn" tool_tip="Seçenekler"/>
+				<menu_button name="recent_viewsort_btn" tool_tip="Seçenklr."/>
 				<button name="add_friend_btn" tool_tip="Seçilen Sakini arkadaş listene ekle"/>
 			</panel>
 		</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml
index 787efa32f4c..770cdc6efd4 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml
@@ -6,11 +6,11 @@
 	<text name="Cache:">
 		Önbellek:
 	</text>
-	<spinner label="Önbellek büyüklüğü (64 - 9984 MB)" name="cachesizespinner"/>
+	<spinner label="Önbellek boyutu (64-9984 MB)" name="cachesizespinner"/>
 	<text name="text_box5">
 		MB
 	</text>
-	<button label="Önbelleği Temizle" label_selected="Önbelleği Temizle" name="clear_cache"/>
+	<button label="Önbelleği Sil" label_selected="Önbelleği Sil" name="clear_cache"/>
 	<text name="Cache location">
 		Önbellek konumu:
 	</text>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
index 9c9e960715c..f7f0698a318 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
@@ -16,9 +16,9 @@
 		Aİ&apos;leri şurada göster:
 	</text>
 	<text name="requires_restart_label">
-		(yeniden baÅŸlatma gerektirir)
+		(tekrar baÅŸlatma gerekir)
 	</text>
-	<radio_group name="chat_window" tool_tip="Anlık İletilerinizi ayrı gezdiricilerde veya birden çok sekmeye sahip tek bir gezdiricide gösterin (Yeniden başlatma gerektirir)">
+	<radio_group name="chat_window" tool_tip="Anlık İletileri ayrı gezdiricilerde veya çoklu sekmelere sahip tek bir gezdiricide gösterin (tekrar başlatma gerekir)">
 		<radio_item label="Ayrı Pencereler" name="radio" value="0"/>
 		<radio_item label="Sekmeler" name="radio2" value="1"/>
 	</radio_group>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml
index fbfc07c4b87..4a48b1588c1 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml
@@ -22,7 +22,7 @@
 		(Yeniden baÅŸlatma gerekir)
 	</text>
 	<text name="maturity_desired_prompt">
-		Seviyelendirdiğim şu içeriğe erişim istiyorum:
+		Seviyelndrl. içeriğe erişim istiyorum::
 	</text>
 	<combo_box name="maturity_desired_combobox">
 		<combo_box.item label="Genel, Orta, YetiÅŸkin" name="Desired_Adult"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml
index ba31640e9c9..ddb83ffc695 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml
@@ -51,7 +51,7 @@
 			<combo_box.item label="Tüm avatarlar ve nesneler" name="3"/>
 			<combo_box.item label="Her ÅŸey" name="4"/>
 		</combo_box>
-		<slider label="Avatarın Fiziksel Özellikleri:" name="AvatarPhysicsDetail"/>
+		<slider label="Avatar Fzk. Özlk.:" name="AvatarPhysicsDetail"/>
 		<text name="AvatarPhysicsDetailText">
 			Düşük
 		</text>
@@ -60,7 +60,7 @@
 			m
 		</text>
 		<slider label="Maks. parçacık sayısı:" name="MaxParticleCount"/>
-		<slider label="Düşük grafik özellikli olmayan maks. avatar sayısı:" name="MaxNumberAvatarDrawn"/>
+		<slider label="Düşük gr. özl. olmayan mks. avatar:" name="MaxNumberAvatarDrawn"/>
 		<slider label="Son iÅŸleme kalitesi:" name="RenderPostProcess"/>
 		<text name="MeshDetailText">
 			Örgü detayı:
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml
index e76616f667a..9111594979b 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml
@@ -11,7 +11,7 @@
 	<check_box label="Çevrimiçi olduğumu sadece arkadaşlar ve gruplar bilsin" name="online_visibility"/>
 	<check_box label="Sadece arkadaşlar ve gruplar beni arasın veya Aİ göndersin" name="voice_call_friends_only_check"/>
 	<check_box label="Aramaları sonlandırırken mikrofonu kapat" name="auto_disengage_mic_check"/>
-	<check_box label="Oturum Açarken Favori Yer İmlerimi Göster (&apos;Buradan başla&apos; açılır menüsünden)" name="favorites_on_login_check"/>
+	<check_box label="Oturum Açarken Favori Yer İmlerimi Göster (&apos;Buradan başla&apos; menüsünden)" name="favorites_on_login_check"/>
 	<text name="Logs:">
 		Sohbet Günlükleri:
 	</text>
diff --git a/indra/newview/skins/default/xui/tr/panel_region_debug.xml b/indra/newview/skins/default/xui/tr/panel_region_debug.xml
index f16c666e868..6e15e0f6f6a 100644
--- a/indra/newview/skins/default/xui/tr/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/tr/panel_region_debug.xml
@@ -21,14 +21,14 @@
 	</line_editor>
 	<button label="Seç" name="choose_avatar_btn"/>
 	<text name="options_text_lbl">
-		Seçenekler:
+		Seçenklr.:
 	</text>
 	<check_box label="Komut dosyaları ile" name="return_scripts" tool_tip="Sadece komut dosyaları olan nesneler iade edilsin"/>
 	<check_box label="Başkasına ait arazi üzerinde" name="return_other_land" tool_tip="Sadece başkasına ait arazi üzerinde olan nesneler iade edilsin"/>
 	<check_box label="Bu gayrimenkulu oluşturan bölgelerin tümünde" name="return_estate_wide" tool_tip="Bu gayrimenkulu oluşturan bölgelerin tümündeki nesneler iade edilsin"/>
 	<button label="Ä°ade Et" name="return_btn"/>
 	<button label="En Çok Çarpışanlar..." name="top_colliders_btn" tool_tip="En çok potansiyel çarpışma yaşayan nesnelerin listesi"/>
-	<button label="En Çok Komut Dosyası Çalıştıranlar..." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/>
+	<button label="En Çok Komut Dsy. Çalştr...." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/>
 	<button label="Bölgeyi Yeniden Başlat" name="restart_btn" tool_tip="2 dakikalık bir geri sayımdan sonra bölgeyi yeniden başlat"/>
 	<button label="Yeniden Başlatmayı Ertele" name="cancel_restart_btn" tool_tip="Bölgenin yeniden başlatılmasını 1 saat ertele"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_region_environment.xml b/indra/newview/skins/default/xui/tr/panel_region_environment.xml
index 851cd23f30d..058ea91b702 100644
--- a/indra/newview/skins/default/xui/tr/panel_region_environment.xml
+++ b/indra/newview/skins/default/xui/tr/panel_region_environment.xml
@@ -15,7 +15,7 @@
 			<combo_box.item label="-Bir ön ayar seçin-" name="item0"/>
 		</combo_box>
 		<text name="sky_dayc_settings_title">
-			Gökyüzü / Gün Döngüsü
+			Gökyüzü/Gün Dön.
 		</text>
 		<radio_group name="sky_dayc_settings_radio_group">
 			<radio_item label="Sabit gökyüzü" name="my_sky_settings"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_region_terrain.xml b/indra/newview/skins/default/xui/tr/panel_region_terrain.xml
index 874d27abfbb..3226ee008e7 100644
--- a/indra/newview/skins/default/xui/tr/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/tr/panel_region_terrain.xml
@@ -7,7 +7,7 @@
 		bilinmiyor
 	</text>
 	<spinner label="Su Yüksekliği" name="water_height_spin"/>
-	<spinner label="Yüzey Yükseltme Limiti" name="terrain_raise_spin"/>
+	<spinner label="Yüzey Yükslt. Limiti" name="terrain_raise_spin"/>
 	<spinner label="Yüzey Alçatma Limiti" name="terrain_lower_spin"/>
 	<text name="detail_texture_text">
 		Yüzey Dokuları (512x512, 24 bit .tga dosyalar gerektirir)
diff --git a/indra/newview/skins/default/xui/tr/role_actions.xml b/indra/newview/skins/default/xui/tr/role_actions.xml
index 18f7d6dca26..655ac641720 100644
--- a/indra/newview/skins/default/xui/tr/role_actions.xml
+++ b/indra/newview/skins/default/xui/tr/role_actions.xml
@@ -44,7 +44,7 @@
 	<action_set description="Bu Yeteneklere, grubun sahip olduğu parsellere erişime izin verme veya buralara erişimi yasaklama ve Second Life Sakinlerini dondurma veya parselden dışarı çıkarma da dahildir." name="Parcel Access">
 		<action description="Parselin Erişim listelerini yönet" longdescription="Parselin Erişim listelerini Arazi Hakkında &gt; Erişim sekmesinden yönetin." name="land manage allowed" value="29"/>
 		<action description="Parselin Yasaklama listelerini yönet" longdescription="Parselin Yasaklama listelerini Arazi Hakkında &gt; Erişim sekmesinden yönetin." name="land manage banned" value="30"/>
-		<action description="Parselin &apos;Geçiş haklarını şuna sat&apos; ayarlarını değiştir" longdescription="Parselin &apos;Geçiş haklarını şuna sat&apos; ayarlarını Arazi Hakkında &gt; Erişim sekmesinden değiştirin." name="land manage passes" value="31"/>
+		<action description="Parselin &apos;Geçiş haklr. şuna sat&apos; ayarlarını değiştir" longdescription="Parselin &apos;Geçiş haklr. şuna sat&apos; ayarlarını Arazi Hakkında &gt; Erişim sekmesinden değiştirin." name="land manage passes" value="31"/>
 		<action description="Parsel üzerindeki Second Life Sakinlerini dışarı çıkar veya dondur" longdescription="Bu Yeteneğe sahip olan bir Roldeki Üyeler, grubun sahip olduğu bir parsel üzerinde olmasını istemedikleri bir Second Life sakininin üzerini sağ tıklatıp &apos;Dışarı Çıkar&apos; veya &apos;Dondur&apos;u seçebilirler." name="land admin" value="32"/>
 	</action_set>
 	<action_set description="Bu Yeteneklere üyelerin nesneleri iade etmelerine, Linden bitkilerini yerleştirmelerine ve bu bitkilerin yerlerini değiştirmelerine izin veren güçler de dahildir. Bu özellik, Üyelerin çöpleri temizlemeleri ve bahçe düzenlemesi yapmaları için kullanışlıdır; fakat dikkatle kullanılmalıdır, çünkü nesneleri iade etmenin geri alınma imkanı yoktur." name="Parcel Content">
diff --git a/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml b/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml
index 28eeef02d35..2fa6281f052 100644
--- a/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml
@@ -118,6 +118,6 @@
 		<button label="Aç" name="open_btn"/>
 		<button label="Öde" name="pay_btn"/>
 		<button label="Satın Al" name="buy_btn"/>
-		<button label="Ayrıntılar" name="details_btn"/>
+		<button label="Ayrıntl" name="details_btn"/>
 	</panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index a17d78486d4..bf331dc3cf3 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -2160,7 +2160,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		Aşağı
 	</string>
 	<string name="Any Category">
-		Herhangi Bir Kategori
+		Herh. Bir Kategori
 	</string>
 	<string name="Shopping">
 		Alışveriş
@@ -2190,7 +2190,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		KiÅŸisel
 	</string>
 	<string name="None">
-		Hiçbiri
+		Renksiz
 	</string>
 	<string name="Linden Location">
 		Linden Konumu
@@ -2390,7 +2390,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Arka Perçem
 	</string>
 	<string name="Baggy">
-		Lüleler
+		Torbalı
 	</string>
 	<string name="Bangs">
 		Kahküller
@@ -2480,7 +2480,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		GeniÅŸ
 	</string>
 	<string name="Brow Size">
-		Kaş Büyüklüğü
+		Alın Genişliği
 	</string>
 	<string name="Bug Eyes">
 		Patlak Gözlü
@@ -2777,7 +2777,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Kaş Yüksekliği
 	</string>
 	<string name="Eyebrow Points">
-		Kaş Noktaları
+		Kaş Yapısı
 	</string>
 	<string name="Eyebrow Size">
 		Kaş Büyüklüğü
@@ -2846,13 +2846,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Ön Perçem
 	</string>
 	<string name="Full Back">
-		Saçlar Arkada
+		Arkası Düz
 	</string>
 	<string name="Full Eyeliner">
 		Çift Taraflı Göz Kalemi
 	</string>
 	<string name="Full Front">
-		Saçlar Önde
+		Önü Düz
 	</string>
 	<string name="Full Hair Sides">
 		Saçlar Yanda
@@ -2936,13 +2936,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Yüksek Topuklar
 	</string>
 	<string name="High Jaw">
-		Yüksek Çene Ucu
+		Ayrık
 	</string>
 	<string name="High Platforms">
-		Yüksek Topuklu Ayakkabılar
+		Yüksek Topuklu
 	</string>
 	<string name="High and Tight">
-		Tepede Bırakılmış Saç
+		Düşük
 	</string>
 	<string name="Higher">
 		Daha Yüksek
@@ -2954,7 +2954,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Kalça Genişliği
 	</string>
 	<string name="In">
-		İç
+		İçeri
 	</string>
 	<string name="In Shdw Color">
 		İç Gölge Rengi
@@ -2978,19 +2978,19 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Ceket Kırışıklıkları
 	</string>
 	<string name="Jaw Angle">
-		Çene Ucu Açısı
+		Çenenin Boyuna Uzaklığı
 	</string>
 	<string name="Jaw Jut">
-		Çene Ucu Çıkıntısı
+		Alt Çene Uzunluğu
 	</string>
 	<string name="Jaw Shape">
-		Çene Ucu Şekli
+		Çene Kemiği Genişliği
 	</string>
 	<string name="Join">
-		BirleÅŸtir
+		BirleÅŸik
 	</string>
 	<string name="Jowls">
-		Gıdıklar
+		Avurtlar
 	</string>
 	<string name="Knee Angle">
 		Diz Açısı
@@ -3029,7 +3029,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Daha Az Dolgun
 	</string>
 	<string name="Less Gravity">
-		Daha Az Yerçekimi
+		Dik Göğüs
 	</string>
 	<string name="Less Love">
 		Daha Ä°nce Bel
@@ -3047,7 +3047,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Daha Az Yuvarlak
 	</string>
 	<string name="Less Saddle">
-		Daha Dar Kalça
+		Basensiz
 	</string>
 	<string name="Less Square">
 		Daha Az Küt
@@ -3098,7 +3098,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Uzun Kafa
 	</string>
 	<string name="Long Hips">
-		Geniş Kalçalar
+		Yüksek kalça
 	</string>
 	<string name="Long Legs">
 		Uzun Bacaklar
@@ -3107,7 +3107,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Uzun Boyun
 	</string>
 	<string name="Long Pigtails">
-		Uzun Saç Örgüleri
+		Yandan Uzun Kuyruk
 	</string>
 	<string name="Long Ponytail">
 		Uzun AtkuyruÄŸu
@@ -3137,13 +3137,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Alçak Topuklar
 	</string>
 	<string name="Low Jaw">
-		Düşük Çene Ucu
+		BitiÅŸik
 	</string>
 	<string name="Low Platforms">
 		Alçak Topuklu
 	</string>
 	<string name="Low and Loose">
-		Serbest At KuyruÄŸu
+		Yüksek
 	</string>
 	<string name="Lower">
 		Daha Alçak
@@ -3182,7 +3182,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Daha Dolgun
 	</string>
 	<string name="More Gravity">
-		Daha Çok Yerçekimi
+		Sarkık Göğüs
 	</string>
 	<string name="More Lipstick">
 		Daha Çok Ruj
@@ -3191,7 +3191,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Daha Kalın Bel
 	</string>
 	<string name="More Lower Lip">
-		Daha Çok Alt Dudak
+		Daha Dolgun Alt Dudak
 	</string>
 	<string name="More Muscles">
 		Daha Çok Kas
@@ -3206,7 +3206,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Daha Yuvarlak
 	</string>
 	<string name="More Saddle">
-		Daha Geniş Kalça
+		Basenli
 	</string>
 	<string name="More Sloped">
 		Daha EÄŸimli
@@ -3215,7 +3215,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Daha Küt
 	</string>
 	<string name="More Upper Lip">
-		Daha Çok Üst Dudak
+		Daha Dolgun Ãœst Dudak
 	</string>
 	<string name="More Vertical">
 		Daha Dikey
@@ -3260,7 +3260,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Önü Dar
 	</string>
 	<string name="Narrow Lips">
-		Ä°nce Dudaklar
+		Küçük Dudaklar
 	</string>
 	<string name="Natural">
 		DoÄŸal
@@ -3359,7 +3359,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Turuncu
 	</string>
 	<string name="Out">
-		Dış
+		Dışarı
 	</string>
 	<string name="Out Shdw Color">
 		Dış Gölge Rengi
@@ -3377,7 +3377,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Dış Gölge
 	</string>
 	<string name="Overbite">
-		Üst Dişler Önde
+		Öne Doğru
 	</string>
 	<string name="Package">
 		Apış Arası Şişkinliği
@@ -3416,7 +3416,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Pigment
 	</string>
 	<string name="Pigtails">
-		Saç Örgüleri
+		Yan Kuyruklar
 	</string>
 	<string name="Pink">
 		Pembe
@@ -3431,7 +3431,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Topuk GeniÅŸliÄŸi
 	</string>
 	<string name="Pointy">
-		Sivri
+		Dar
 	</string>
 	<string name="Pointy Heels">
 		Sivri Topuklar
@@ -3482,25 +3482,25 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Dağınık Saç
 	</string>
 	<string name="Saddle Bags">
-		Kalça Kalınlığı
+		Basen GeniÅŸliÄŸi
 	</string>
 	<string name="Scrawny Leg">
 		Sıska Bacak
 	</string>
 	<string name="Separate">
-		Ayrı
+		Ayrık
 	</string>
 	<string name="Shallow">
 		Sığ
 	</string>
 	<string name="Shear Back">
-		Arkayı Dikey Kaydır
+		Arka DolgunluÄŸu
 	</string>
 	<string name="Shear Face">
 		Yüzü Dikey Kaydır
 	</string>
 	<string name="Shear Front">
-		Önü Dikey Kaydır
+		Ön Dolgunluğu
 	</string>
 	<string name="Shear Left Up">
 		Solu Yukarı Kaydır
@@ -3509,10 +3509,10 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Sağı Yukarı Kaydır
 	</string>
 	<string name="Sheared Back">
-		Arkası Dikey Kaydırılmış
+		Arkası Dolgun
 	</string>
 	<string name="Sheared Front">
-		Önü Dikey Kaydırılmış
+		Önü Dolgun
 	</string>
 	<string name="Shift Left">
 		Sola Kaydır
@@ -3548,7 +3548,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Kısa Boyun
 	</string>
 	<string name="Short Pigtails">
-		Kısa Atkuyrukları
+		Yandan Kısa Kuyruk
 	</string>
 	<string name="Short Ponytail">
 		Kısa Atkuyruğu
@@ -3560,7 +3560,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Kısa Gövde
 	</string>
 	<string name="Short hips">
-		Dar kalçalar
+		Düşük kalça
 	</string>
 	<string name="Shoulders">
 		Omuzlar
@@ -3638,7 +3638,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Dikleştirilmiş Saç
 	</string>
 	<string name="Square">
-		Kare
+		GeniÅŸ
 	</string>
 	<string name="Square Toe">
 		Küt Burunlu
@@ -3680,7 +3680,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Kalın Boyun
 	</string>
 	<string name="Thick Toe">
-		Kalın kabu Burnu
+		Kalın Ayak Ucu
 	</string>
 	<string name="Thin">
 		Ä°nce
@@ -3695,7 +3695,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Ä°nce Burun
 	</string>
 	<string name="Tight Chin">
-		Dar Çene
+		Çift Çene
 	</string>
 	<string name="Tight Cuffs">
 		Dar Paçalar
@@ -3710,7 +3710,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Dar Etek
 	</string>
 	<string name="Tight Sleeves">
-		Dar Kollar
+		Dar Kollu
 	</string>
 	<string name="Toe Shape">
 		Ayakkabu Burnu Åžekli
@@ -3728,13 +3728,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Sıska Gövde
 	</string>
 	<string name="Unattached">
-		Bağımsız
+		Ayrık
 	</string>
 	<string name="Uncreased">
 		BuruÅŸuk olmayan
 	</string>
 	<string name="Underbite">
-		Alt Dişler Önde
+		Geriye DoÄŸru
 	</string>
 	<string name="Unnatural">
 		DoÄŸal Olmayan
@@ -3770,7 +3770,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		GeniÅŸ
 	</string>
 	<string name="Wide Back">
-		Geniş Sırt
+		GeniÅŸ Arka
 	</string>
 	<string name="Wide Front">
 		Geniş Ön
-- 
GitLab


From d3773b991a22e2f13b37bc50fafb4477b5b940b1 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 22 Nov 2011 19:36:00 +0200
Subject: [PATCH 275/933] EXP-1506 FIXED starting the toast fade timer when a
 toast is overlapped by other floater like avatar inspector. This is a kind of
 a workaround: perhaps the logic of updating the toast fade timer should be
 refactored to start/stop the timer from onMouseLeave/onMouseEnter callbacks
 instead of using "IsHovered" flag for each toast.

---
 indra/newview/lltoast.cpp | 49 ++++++++++++++++++++++++++++-----------
 1 file changed, 35 insertions(+), 14 deletions(-)

diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index e0b07ed408e..2d9d3241d8c 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -419,25 +419,22 @@ void LLToast::onToastMouseLeave()
 	S32 x, y;
 	LLUI::getMousePositionScreen(&x, &y);
 
-	if( !panel_rc.pointInRect(x, y) && !button_rc.pointInRect(x, y))
-	{
-		mOnToastHoverSignal(this, MOUSE_LEAVE);
+	mOnToastHoverSignal(this, MOUSE_LEAVE);
 
-		updateTransparency();
+	updateTransparency();
 
-		//toasts fading is management by Screen Channel
+	//toasts fading is management by Screen Channel
 
-		if(mHideBtn && mHideBtn->getEnabled())
+	if(mHideBtn && mHideBtn->getEnabled())
+	{
+		if( mHideBtnPressed )
 		{
-			if( mHideBtnPressed )
-			{
-				mHideBtnPressed = false;
-				return;
-			}
-			mHideBtn->setVisible(FALSE);		
+			mHideBtnPressed = false;
+			return;
 		}
-		mToastMouseLeaveSignal(this, getValue());
+		mHideBtn->setVisible(FALSE);
 	}
+	mToastMouseLeaveSignal(this, getValue());
 }
 
 void LLToast::setBackgroundOpaque(BOOL b)
@@ -499,7 +496,31 @@ bool LLToast::isHovered()
 {
 	S32 x, y;
 	LLUI::getMousePositionScreen(&x, &y);
-	return mWrapperPanel->calcScreenRect().pointInRect(x, y);
+
+	if (!mWrapperPanel->calcScreenRect().pointInRect(x, y))
+	{
+		// mouse is not over this toast
+		return false;
+	}
+
+	bool is_overlapped_by_other_floater = false;
+
+	const child_list_t* child_list = gFloaterView->getChildList();
+
+	// find this toast in gFloaterView child list to check whether any floater
+	// with higher Z-order is visible under the mouse pointer overlapping this toast
+	child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
+	if (r_iter != child_list->rend())
+	{
+		// skip this toast and proceed to views above in Z-order
+		for (++r_iter; r_iter != child_list->rend(); ++r_iter)
+		{
+			LLView* view = *r_iter;
+			is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
+			if (is_overlapped_by_other_floater) break;
+		}
+	}
+	return !is_overlapped_by_other_floater;
 }
 
 //--------------------------------------------------------------------------
-- 
GitLab


From 2b43a6b8c9b22d02373ac70193fa85f2bfb77b19 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 22 Nov 2011 13:13:51 -0500
Subject: [PATCH 276/933] STORM-591 Remove 2 development debug settings and
 replace them with constants

---
 indra/newview/app_settings/settings.xml | 22 ----------------------
 indra/newview/llvieweraudio.cpp         |  7 +++++--
 2 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c7300cc1bb7..3c53a9d44c3 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -192,28 +192,6 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>AudioMusicFadeIn</key>
-    <map>
-      <key>Comment</key>
-      <string>Fade in time in seconds for music streams</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>5.0</real>
-    </map>
-    <key>AudioMusicFadeOut</key>
-    <map>
-      <key>Comment</key>
-      <string>Fade out time in seconds for music streams</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>5.0</real>
-    </map>
     <key>AudioLevelAmbient</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 0262da4dee4..1e5c742cf9a 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -174,14 +174,17 @@ void LLViewerAudio::stopInternetStreamWithAutoFade()
 
 void LLViewerAudio::startFading()
 {
+	const F32 AUDIO_MUSIC_FADE_IN_TIME = 3.0;
+	const F32 AUDIO_MUSIC_FADE_OUT_TIME = 2.0;
+
 	if(mDone)
 	{
 		// The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not,
 		// rather than check for both states assume a fade in and check for the fade out case.
-		mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeIn"));
+		mFadeTime = AUDIO_MUSIC_FADE_IN_TIME;
 		if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT)
 		{
-			mFadeTime = llmax(0.0f, gSavedSettings.getF32("AudioMusicFadeOut"));
+			mFadeTime = AUDIO_MUSIC_FADE_OUT_TIME;
 		}
 		stream_fade_timer.reset();
 		stream_fade_timer.setTimerExpirySec(mFadeTime);
-- 
GitLab


From 9850e09f7663558070bca6353a7da806a53f4441 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 22 Nov 2011 11:51:49 -0700
Subject: [PATCH 277/933] trivial: update the memory pool log info to the
 latest.

---
 indra/llcommon/llmemory.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index bb7998c0a88..3b9758f996a 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -159,6 +159,7 @@ void LLMemory::logMemoryInfo(BOOL update)
 	if(update)
 	{
 		updateMemoryInfo() ;
+		LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ;
 	}
 
 	llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ;
-- 
GitLab


From be3c6747a88d8bbb2c6b87c9eb97b14a42b90ae7 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 22 Nov 2011 11:53:44 -0700
Subject: [PATCH 278/933] remove redundant memory allocation for sh-2651:
 [crashhunters] Crash after google translate failure

---
 indra/llxml/llxmlnode.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 9f1e249ddda..4362c88c4ec 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -1277,7 +1277,7 @@ bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node,
 	{
 		return mDefault->getAttribute(name, node, FALSE);
 	}
-	node = new LLXMLNode();
+	
 	return false;
 }
 
-- 
GitLab


From eeefec394c932b79a22c5ea2b8aa03690bb6061e Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Wed, 23 Nov 2011 01:30:15 +0000
Subject: [PATCH 279/933] Changes to filter out tabs from file load and to test
 if loading/saving should be allowed.

---
 indra/llui/lltexteditor.cpp       | 26 ++++++++++++++
 indra/llui/lltexteditor.h         |  5 +++
 indra/newview/llfilepicker.cpp    | 12 +------
 indra/newview/llpreviewscript.cpp | 56 ++++++++++++++++++++++++++-----
 indra/newview/llpreviewscript.h   |  4 +++
 5 files changed, 84 insertions(+), 19 deletions(-)

diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 9bd445988d5..3a23ce1caca 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2250,6 +2250,22 @@ void LLTextEditor::insertText(const std::string &new_text)
 	setEnabled( enabled );
 }
 
+void LLTextEditor::insertText(LLWString &new_text)
+{
+	BOOL enabled = getEnabled();
+	setEnabled( TRUE );
+
+	// Delete any selected characters (the insertion replaces them)
+	if( hasSelection() )
+	{
+		deleteSelection(TRUE);
+	}
+
+	setCursorPos(mCursorPos + insert( mCursorPos, new_text, FALSE, LLTextSegmentPtr() ));
+
+	setEnabled( enabled );
+}
+
 void LLTextEditor::appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo)
 {
 	// Save old state
@@ -2838,3 +2854,13 @@ void LLTextEditor::clear()
 	getViewModel()->setDisplay(LLWStringUtil::null);
 	clearSegments();
 }
+
+bool LLTextEditor::canLoadOrSaveToFile()
+{
+	return !mReadOnly;
+}
+
+S32 LLTextEditor::spacesPerTab()
+{
+	return SPACES_PER_TAB;
+}
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 9e4b95003b7..40821ae9fbc 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -92,6 +92,8 @@ class LLTextEditor :
 
 	void	setParseHighlights(BOOL parsing) {mParseHighlights=parsing;}
 
+	static S32		spacesPerTab();
+
 	// mousehandler overrides
 	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);
@@ -140,6 +142,8 @@ class LLTextEditor :
 	virtual void	selectAll();
 	virtual BOOL	canSelectAll()	const;
 
+	virtual bool	canLoadOrSaveToFile();
+
 	void			selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE);
 	BOOL			replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE);
 	void			replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive);
@@ -158,6 +162,7 @@ class LLTextEditor :
 
 	// inserts text at cursor
 	void			insertText(const std::string &text);
+	void			insertText(LLWString &text);
 
 	void			appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo);
 	// Non-undoable
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 0801871409f..3cbc4e5648f 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -58,7 +58,7 @@ LLFilePicker LLFilePicker::sInstance;
 #define SLOBJECT_FILTER L"Objects (*.slobject)\0*.slobject\0"
 #define RAW_FILTER L"RAW files (*.raw)\0*.raw\0"
 #define MODEL_FILTER L"Model files (*.dae)\0*.dae\0"
-#define SCRIPT_FILTER L"Script files (*.lsl; *.txt)\0*.lsl;*.txt\0"
+#define SCRIPT_FILTER L"Script files (*.lsl)\0*.lsl\0"
 #endif
 
 //
@@ -502,16 +502,6 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename)
 			L"Compressed Images (*.j2c)\0*.j2c\0" \
 			L"\0";
 		break;
-	case FFSAVE_SCRIPT:
-		if (filename.empty())
-		{
-			wcsncpy( mFilesW,L"untitled.lsl", FILENAME_BUFFER_SIZE);
-		}
-		mOFN.lpstrDefExt = L"txt";
-		mOFN.lpstrFilter = 
-			L"LSL Files (*.lsl; *.txt)\0*.lsl;*.txt\0"
-			L"\0";
-		break;
 	default:
 		return FALSE;
 	}
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 072df39514b..16b582d1889 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -507,11 +507,11 @@ void LLScriptEdCore::initMenu()
 
 	menuItem = getChild<LLMenuItemCallGL>("LoadFromFile");
 	menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnLoadFromFile, this));
-//	menuItem->setEnabledCallback(NULL);
+	menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableLoadFromFileMenu, this));
 
 	menuItem = getChild<LLMenuItemCallGL>("SaveToFile");
 	menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnSaveToFile, this));
-	menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this));
+	menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableSaveToFileMenu, this));
 }
 
 void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid)
@@ -1107,9 +1107,17 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask)
 
 void LLScriptEdCore::onBtnLoadFromFile( void* data )
 {
-
 	LLScriptEdCore* self = (LLScriptEdCore*) data;
-	
+/*
+	if( self->isDirty())
+	{
+		llwarns << "Script has unsaved changes, loading from disc aborted." << llendl;
+		LLStringBase<char>::format_map_t args;
+		args["[REASON]"] = std::string("Existing script has unsaved changes. You must save this script before loading from disc.");
+		gViewerWindow->alertXml("LoadDiskScriptFailReason", args);		
+		return;
+	}
+*/
 	LLFilePicker& file_picker = LLFilePicker::instance();
 	if( !file_picker.getOpenFile( LLFilePicker::FFLOAD_SCRIPT ) )
 	{
@@ -1121,16 +1129,27 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data )
 	std::ifstream fin(filename.c_str());
 
 	std::string line;
+	std::string text;
 	std::string linetotal;
-	self->mEditor->clear();
 	while (!fin.eof())
 	{ 
 		getline(fin,line);
-		line=line+"\n";
-		self->mEditor->insertText(line);
-
+		text += line;
+		if (!fin.eof())
+		{
+			text += "\n";
+		}
 	}
 	fin.close();
+
+	// Only replace the script if there is something to replace with.
+	if (text.length() > 0)
+	{
+		self->mEditor->selectAll();
+		LLWString script(utf8str_to_wstring(text));
+		LLWStringUtil::replaceTabsWithSpaces(script, self->mEditor->spacesPerTab());
+		self->mEditor->insertText(script);
+	}
 }
 
 void LLScriptEdCore::onBtnSaveToFile( void* userdata )
@@ -1157,6 +1176,27 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata )
 	}
 }
 
+bool LLScriptEdCore::canLoadOrSaveToFile( void* userdata )
+{
+	LLScriptEdCore* self = (LLScriptEdCore*) userdata;
+	return self->mEditor->canLoadOrSaveToFile();
+}
+
+// static
+bool LLScriptEdCore::enableSaveToFileMenu(void* userdata)
+{
+	LLScriptEdCore* self = (LLScriptEdCore*)userdata;
+	if (!self || !self->mEditor) return FALSE;
+	return self->mEditor->canLoadOrSaveToFile();
+}
+
+// static 
+bool LLScriptEdCore::enableLoadFromFileMenu(void* userdata)
+{
+	LLScriptEdCore* self = (LLScriptEdCore*)userdata;
+	if (!self || !self->mEditor) return FALSE;
+	return self->mEditor->canLoadOrSaveToFile();
+}
 
 /// ---------------------------------------------------------------------------
 /// LLScriptEdContainer
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index f50e9322b06..7563cecd9db 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -79,6 +79,7 @@ class LLScriptEdCore : public LLPanel
 	/*virtual*/	BOOL	postBuild();
 	BOOL			canClose();
 	void			setEnableEditing(bool enable);
+	bool			canLoadOrSaveToFile( void* userdata );
 
 	void            setScriptText(const std::string& text, BOOL is_valid);
 	bool			loadScriptText(const std::string& filename);
@@ -101,6 +102,9 @@ class LLScriptEdCore : public LLPanel
 	static void		onBtnLoadFromFile(void*);
 	static void		onBtnSaveToFile(void*);
 
+	static bool		enableSaveToFileMenu(void* userdata);
+	static bool		enableLoadFromFileMenu(void* userdata);
+
 	virtual bool	hasAccelerators() const { return true; }
 
 private:
-- 
GitLab


From 710d2fd0f34484495fa494eefa2ffc1cdb3087e3 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 23 Nov 2011 14:33:05 +0200
Subject: [PATCH 280/933] EXP-1581 FIXED Added more floaters to the viewer
 menu. It is also now possible to toggle microphone via the menu.

See JIRA for the full list of changes.
---
 indra/newview/llagent.cpp                     |  12 +-
 indra/newview/llagent.h                       |   3 +-
 indra/newview/llviewermenu.cpp                |   5 +
 .../skins/default/xui/en/menu_viewer.xml      | 303 +++++++++++-------
 4 files changed, 192 insertions(+), 131 deletions(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f8b204eca0e..2c59a59c0c9 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -204,6 +204,12 @@ void LLAgent::releaseMicrophone(const LLSD& name)
 	LLVoiceClient::getInstance()->inputUserControlState(false);
 }
 
+// static
+void LLAgent::toggleMicrophone(const LLSD& name)
+{
+	LLVoiceClient::getInstance()->toggleUserPTTState();
+}
+
 // static
 bool LLAgent::isMicrophoneOn(const LLSD& sdname)
 {
@@ -331,12 +337,6 @@ void LLAgent::init()
 
 	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
 
-	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
-	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
-	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
-	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
-
-	
 	mInitialized = TRUE;
 }
 
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 0f7ed9ce681..740770bbdf2 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -292,7 +292,9 @@ class LLAgent : public LLOldEvents::LLObservable
 
 	static void		pressMicrophone(const LLSD& name);
 	static void		releaseMicrophone(const LLSD& name);
+	static void		toggleMicrophone(const LLSD& name);
 	static bool		isMicrophoneOn(const LLSD& sdname);
+	static bool		isActionAllowed(const LLSD& sdname);
 
 private:
 	bool			mVoiceConnected;
@@ -595,7 +597,6 @@ class LLAgent : public LLOldEvents::LLObservable
 private:
 	bool			mCanEditParcel;
 
-	static bool isActionAllowed(const LLSD& sdname);
 	static void parcelChangedCallback();
 
 /********************************************************************************
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 81311b03f54..5056954ffb4 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7976,6 +7976,11 @@ void initialize_menus()
 	// Agent
 	commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying));
 	enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying));
+	commit.add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
+	commit.add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
+	commit.add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2));
+	enable.add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
+	enable.add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
 
 	// File menu
 	init_menu_file();
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 263d961be1f..3e779782e80 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -8,14 +8,6 @@
      label="Me"
      name="Me"
      tear_off="true">
-      <menu_item_call
-           label="Dashboard..."
-           name="Manage My Account">
-        <menu_item_call.on_click
-         function="PromptShowURL"
-         name="ManageMyAccount_url"
-         parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
-      </menu_item_call>
       <menu_item_call
        label="Profile..."
        name="Profile">
@@ -31,6 +23,14 @@
         <menu_item_call.on_enable
          function="Edit.EnableCustomizeAvatar" />
       </menu_item_call>
+      <menu_item_call
+       label="Choose an avatar..."
+       name="Avatar Picker">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="avatar" />
+      </menu_item_call>
+      <menu_item_separator/>
       <menu_item_check
          label="Inventory..."
          name="Inventory"
@@ -52,29 +52,28 @@
          function="Inventory.NewWindow"
          parameter="" />
       </menu_item_call>
-      <menu_item_check
-       label="Gestures..."
-       name="Gestures"
-       shortcut="control|G">
-        <menu_item_check.on_check
-         function="Floater.Visible"
-         parameter="gestures" />
-        <menu_item_check.on_click
-         function="Floater.Toggle"
-         parameter="gestures" />
-      </menu_item_check>
-      <menu_item_check
-       label="Voice..."
-       name="ShowVoice"
-       visibility_control="VoiceMorphingEnabled">
-        <menu_item_check.on_check
-         function="Floater.Visible"
-         Parameter="voice_effect" />
-        <menu_item_check.on_click
-         function="Floater.Toggle"
-         parameter="voice_effect" />
-      </menu_item_check>
-
+      <menu_item_call
+       label="Places..."
+       name="Places">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="places" />
+      </menu_item_call>
+      <menu_item_call
+       label="Picks..."
+       name="Picks">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="picks" />
+      </menu_item_call>
+      <menu_item_separator/>
+      <menu_item_call
+       label="Camera Controls..."
+       name="Camera Controls">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="camera" />
+      </menu_item_call>
       <menu
        create_jump_keys="true"
        label="Movement"
@@ -117,6 +116,13 @@
           <menu_item_call.on_click
            function="Tools.StopAllAnimations" />
         </menu_item_call>
+        <menu_item_call
+         label="Walk / run / fly..."
+         name="Stop Animating My Avatar">
+          <menu_item_call.on_click
+           function="Floater.ToggleOrBringToFront"
+           parameter="moveview" />
+        </menu_item_call>
       </menu>
 
       <menu
@@ -163,6 +169,14 @@
         <menu_item_call.on_click
          function="BuyCurrency" />
       </menu_item_call>
+      <menu_item_call
+           label="Accout dashboard..."
+           name="Manage My Account">
+        <menu_item_call.on_click
+         function="PromptShowURL"
+         name="ManageMyAccount_url"
+         parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
+      </menu_item_call>
 
       <menu_item_separator/>
 
@@ -205,25 +219,6 @@
      label="Communicate"
      name="Communicate"
      tear_off="true">
-        <menu_item_call
-         label="My Friends"
-         name="My Friends"
-         shortcut="control|shift|F">
-            <menu_item_call.on_click
-             function="SideTray.PanelPeopleTab"
-             parameter="friends_panel" />
-            </menu_item_call>
-        <menu_item_call
-         label="My Groups"
-         name="My Groups"
-         shortcut="control|shift|G">
-            <menu_item_call.on_click
-             function="SideTray.PanelPeopleTab"
-             parameter="groups_panel" />
-        </menu_item_call>
-
-        <menu_item_separator/>
-
         <!--menu_item_call
          label="Chat"
          name="Chat">
@@ -231,7 +226,7 @@
              function="World.Chat" />
         </menu_item_call-->
         <menu_item_check
-         label="Nearby Chat"
+         label="Chat..."
          name="Nearby Chat"
          shortcut="control|H"
          use_mac_ctrl="true">
@@ -242,16 +237,21 @@
              function="Floater.Toggle"
              parameter="chat_bar" />
         </menu_item_check>
-        <menu_item_call
-         label="Nearby People"
-         name="Active Speakers"
-         shortcut="control|shift|A">
-            <menu_item_call.on_click
-             function="SideTray.PanelPeopleTab"
-             parameter="nearby_panel" />
-            </menu_item_call>
         <menu_item_check
-         label="Nearby Voice"
+         label="Speak"
+         name="Speak">
+            <menu_item_check.on_check
+             function="Agent.IsMicrophoneOn"
+             parameter="speak" />
+            <menu_item_check.on_enable
+             function="Agent.IsActionAllowed"
+             parameter="speak" />
+            <menu_item_check.on_click
+             function="Agent.ToggleMicrophone"
+             parameter="speak" />
+        </menu_item_check>
+        <menu_item_check
+         label="Voice settings..."
          name="Nearby Voice">
             <menu_item_check.on_check
              function="Floater.Visible"
@@ -260,12 +260,86 @@
              function="Floater.Toggle"
              parameter="voice_controls" />
         </menu_item_check>
+        <menu_item_check
+         label="Voice morphing..."
+         name="ShowVoice"
+         visibility_control="VoiceMorphingEnabled">
+            <menu_item_check.on_check
+             function="Floater.Visible"
+             parameter="voice_effect" />
+            <menu_item_check.on_click
+             function="Floater.Toggle"
+             parameter="voice_effect" />
+        </menu_item_check>
+        <menu_item_check
+         label="Gestures..."
+         name="Gestures"
+         shortcut="control|G">
+            <menu_item_check.on_check
+             function="Floater.Visible"
+             parameter="gestures" />
+            <menu_item_check.on_click
+             function="Floater.Toggle"
+             parameter="gestures" />
+        </menu_item_check>
+        <menu_item_separator/>
+        <menu_item_call
+         label="Friends"
+         name="My Friends"
+         shortcut="control|shift|F">
+            <menu_item_call.on_click
+             function="SideTray.PanelPeopleTab"
+             parameter="friends_panel" />
+            </menu_item_call>
+        <menu_item_call
+         label="Groups"
+         name="My Groups"
+         shortcut="control|shift|G">
+            <menu_item_call.on_click
+             function="SideTray.PanelPeopleTab"
+             parameter="groups_panel" />
+        </menu_item_call>
+        <menu_item_call
+         label="Nearby people"
+         name="Active Speakers"
+         shortcut="control|shift|A">
+            <menu_item_call.on_click
+              function="SideTray.PanelPeopleTab"
+              parameter="nearby_panel" />
+        </menu_item_call>
     </menu>
     <menu
      create_jump_keys="true"
      label="World"
      name="World"
      tear_off="true">
+        <menu_item_call
+         label="Landmark This Place"
+         name="Create Landmark Here">
+            <menu_item_call.on_click
+             function="World.CreateLandmark" />
+            <menu_item_call.on_enable
+             function="World.EnableCreateLandmark" />
+        </menu_item_call>
+        <menu_item_call
+         label="Destinations..."
+         name="Destinations">
+            <menu_item_call.on_click
+             function="Floater.ToggleOrBringToFront"
+             parameter="destinations" />
+        </menu_item_call>
+        <menu_item_check
+         label="World map"
+         name="World Map"
+         shortcut="control|M"
+         use_mac_ctrl="true">
+            <menu_item_check.on_check
+             function="Floater.Visible"
+             parameter="world_map" />
+            <menu_item_check.on_click
+             function="Floater.Toggle"
+             parameter="world_map" />
+        </menu_item_check>
             <menu_item_check
          label="Mini-map"
          name="Mini-Map"
@@ -276,18 +350,6 @@
             <menu_item_check.on_click
              function="Floater.Toggle"
              parameter="mini_map" />
-        </menu_item_check>
-         <menu_item_check
-         label="World Map"
-         name="World Map"
-         shortcut="control|M"
-         use_mac_ctrl="true">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="world_map" />
-            <menu_item_check.on_click
-             function="Floater.Toggle"
-             parameter="world_map" />
         </menu_item_check>
         <menu_item_check
         label="Search"
@@ -300,6 +362,25 @@
              function="Floater.Toggle"
              parameter="search" />
             </menu_item_check>
+        <menu_item_separator/>
+        <menu_item_call
+         label="Teleport home"
+         name="Teleport Home"
+         shortcut="control|shift|H">
+        <menu_item_call.on_click
+         function="World.TeleportHome" />
+        <menu_item_call.on_enable
+         function="World.EnableTeleportHome" />
+        </menu_item_call>
+            <menu_item_call
+             label="Set home to here"
+             name="Set Home to Here">
+                <menu_item_call.on_click
+                 function="World.SetHomeLocation" />
+                <menu_item_call.on_enable
+                 function="World.EnableSetHomeLocation" />
+            </menu_item_call>
+        <menu_item_separator/>
         <menu_item_call
          label="Snapshot"
          name="Take Snapshot"
@@ -308,59 +389,46 @@
              function="Floater.Show"
              parameter="snapshot" />
         </menu_item_call>
-      <menu_item_call
-             label="Landmark This Place"
-             name="Create Landmark Here">
-                <menu_item_call.on_click
-                 function="World.CreateLandmark" />
-                <menu_item_call.on_enable
-                 function="World.EnableCreateLandmark" />
-            </menu_item_call>
-      <menu
-           create_jump_keys="true"
-           label="Place Profile"
-           name="Land"
-           tear_off="true">
+        <menu_item_separator/>
         <menu_item_call
-         label="Place Profile"
+         label="Place profile"
          layout="topleft"
          name="Place Profile">
             <menu_item_call.on_click
              function="World.PlaceProfile" />
         </menu_item_call>
         <menu_item_call
-         label="About Land"
+         label="About land"
          name="About Land">
             <menu_item_call.on_click
              function="Floater.Show"
              parameter="about_land" />
         </menu_item_call>
         <menu_item_call
-         label="Region/Estate"
+         label="Region / Estate"
          name="Region/Estate">
             <menu_item_call.on_click
              function="Floater.Show"
              parameter="region_info" />
         </menu_item_call>
-        </menu>
+        <menu_item_call
+         label="My land holdings..."
+         name="My Land">
+            <menu_item_call.on_click
+             function="Floater.Show"
+             parameter="land_holdings" />
+        </menu_item_call>
+        <menu_item_call
+         label="Buy this land"
+         name="Buy Land">
+            <menu_item_call.on_click
+             function="Land.Buy" />
+            <menu_item_call.on_enable
+             function="World.EnableBuyLand" />
+            </menu_item_call>
 
         <menu_item_separator/>
 
-        <menu_item_call
-             label="Buy This Land"
-             name="Buy Land">
-                <menu_item_call.on_click
-                 function="Land.Buy" />
-                <menu_item_call.on_enable
-                 function="World.EnableBuyLand" />
-            </menu_item_call>
-        <menu_item_call
-             label="My Land"
-             name="My Land">
-                <menu_item_call.on_click
-                 function="Floater.Show"
-                 parameter="land_holdings" />
-        </menu_item_call>
         <menu
            create_jump_keys="true"
            label="Show"
@@ -456,24 +524,6 @@
         </menu>
 
         <menu_item_separator/>
-
-	    <menu_item_call
-	     label="Teleport Home"
-	     name="Teleport Home"
-	     shortcut="control|shift|H">
-		<menu_item_call.on_click
-		 function="World.TeleportHome" />
-		<menu_item_call.on_enable
-		 function="World.EnableTeleportHome" />
-	    </menu_item_call>
-            <menu_item_call
-             label="Set Home to Here"
-             name="Set Home to Here">
-                <menu_item_call.on_click
-                 function="World.SetHomeLocation" />
-                <menu_item_call.on_enable
-                 function="World.EnableSetHomeLocation" />
-            </menu_item_call>
     <!--    <menu_item_check
          label="Show Navigation Bar"
          name="ShowNavbarNavigationPanel">
@@ -496,8 +546,6 @@
         </menu_item_check>
         <menu_item_separator/>-->
 
-        <menu_item_separator/>
-
         <menu
          create_jump_keys="true"
          label="Sun"
@@ -1146,6 +1194,13 @@
      label="Help"
      name="Help"
      tear_off="true">
+        <menu_item_call
+         label="How to..."
+         name="How To">
+            <menu_item_call.on_click
+             function="Help.ToggleHowTo"
+             parameter="" />
+        </menu_item_call>
         <menu_item_call
          label="[SECOND_LIFE] Help"
          name="Second Life Help"
-- 
GitLab


From a4cb08ae5d20416e21bbc70540527097495af887 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 23 Nov 2011 08:42:42 -0500
Subject: [PATCH 281/933] STORM-591 Trivial code cleanup

---
 indra/newview/llvieweraudio.h       | 1 -
 indra/newview/llviewerparcelmgr.cpp | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index 1663f77f4a7..26062a2818c 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -28,7 +28,6 @@
 #define LL_VIEWERAUDIO_H
 
 #include "llframetimer.h"
-#include "llthread.h"
 #include "llsingleton.h"
 
 // comment out to turn off wind
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index ada89cc7aa7..c18665a3c3d 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1727,7 +1727,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 	else
 	{
 		// Check for video
-		LLViewerParcelMedia::update( parcel );
+		LLViewerParcelMedia::update(parcel);
 
 		// Then check for music.  Do this last, as there may be a delay waiting for
 		// the stream fading thread to finish.
-- 
GitLab


From 0ab252b8174a97311168938e93c99c0d649660ad Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 23 Nov 2011 09:51:38 -0500
Subject: [PATCH 282/933] STORM-1653 Handle last name of "Resident" case

---
 indra/newview/llviewermessage.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 05303cf3c51..c92fc5c853a 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2452,6 +2452,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			}
 
 			// The group notice packet does not have an AgentID.  Obtain one from the name cache.
+			// If last name is "Resident" strip it out so the cache name lookup works.
+			U32 index = original_name.find(" Resident");
+			if (index != std::string::npos)
+			{
+				original_name = original_name.substr(0, index);
+			}
 			std::string legacy_name = gCacheName->buildLegacyName(original_name);
 			LLUUID agent_id;
 			gCacheName->getUUID(legacy_name, agent_id);
-- 
GitLab


From 0b7bd115ad118a5792e4f835fe50ac6606fd0874 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 23 Nov 2011 19:21:52 +0200
Subject: [PATCH 283/933] EXP-1577 FOLLOWUP Making default My Profile window
 size the same as size of other residents' profile floaters.

---
 indra/newview/llavataractions.cpp | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 7f6abb09375..2f331bdab12 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -302,25 +302,26 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids)
 	make_ui_sound("UISndStartIM");
 }
 
+static const char* get_profile_floater_name(const LLUUID& avatar_id)
+{
+	// Use different floater XML for our profile to be able to save its rect.
+	return avatar_id == gAgentID ? "my_profile" : "profile";
+}
+
 static const LLRect& get_preferred_profile_rect(const LLUUID& avatar_id)
 {
-	if (avatar_id == gAgentID)
+	if (avatar_id == gAgentID &&
+		LLFloaterReg::getInstance(get_profile_floater_name(avatar_id))->hasSavedRect())
 	{
-		return LLRect::null; // no preference
+		return LLRect::null; // no preference, use saved rect
 	}
 
-	// Preferred size for all residents' profiles except our own,
-	// for which saved_rect will be used.
+	// Preferred size for all residents' profiles
+	// and default size for our own profile.
 	static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect");
 	return profile_rect;
 }
 
-static const char* get_profile_floater_name(const LLUUID& avatar_id)
-{
-	// Use different floater XML for our profile to be able to save its rect.
-	return avatar_id == gAgentID ? "my_profile" : "profile";
-}
-
 static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
 {
 	std::string username = av_name.mUsername;
-- 
GitLab


From c69785f0b5625e655838b9cc9779407077ca770e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 23 Nov 2011 12:05:24 -0600
Subject: [PATCH 284/933] SH-2449 Preserve texture scaling when animating
 textures when "size x" and "size y" parameters to llSetTextureAnim are zero.

---
 indra/llprimitive/lltextureanim.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llprimitive/lltextureanim.cpp b/indra/llprimitive/lltextureanim.cpp
index 398af4e6e8a..185a3f69c02 100644
--- a/indra/llprimitive/lltextureanim.cpp
+++ b/indra/llprimitive/lltextureanim.cpp
@@ -168,8 +168,8 @@ void LLTextureAnim::unpackTAMessage(LLDataPacker &dp)
 
 	mMode = data[0];
 	mFace = data[1];
-	mSizeX = llmax((U8)1, data[2]);
-	mSizeY = llmax((U8)1, data[3]);
+	mSizeX = data[2];
+	mSizeY = data[3];
 	htonmemcpy(&mStart, data + 4, MVT_F32, sizeof(F32));
 	htonmemcpy(&mLength, data + 8, MVT_F32, sizeof(F32));
 	htonmemcpy(&mRate, data + 12, MVT_F32, sizeof(F32));
-- 
GitLab


From 943789b53ac3f2750cb71dca6facc0de7fa39539 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 23 Nov 2011 12:11:53 -0800
Subject: [PATCH 285/933] SH-2710 FIX -- Removed calls to getChild happening
 every frame and during idle calls.

Reviewed by davep.
---
 indra/llui/llscrolllistctrl.cpp       |   8 +-
 indra/llui/llscrolllistctrl.h         |   2 +
 indra/newview/lldebugview.cpp         |  39 ++++---
 indra/newview/lldebugview.h           |   6 +-
 indra/newview/llfloaterwebcontent.cpp |  40 ++++---
 indra/newview/llfloaterwebcontent.h   |   6 +
 indra/newview/llnearbychatbar.cpp     |  17 +--
 indra/newview/llnearbychatbar.h       |   7 +-
 indra/newview/llnearbychathandler.cpp |  11 +-
 indra/newview/llscreenchannel.cpp     |  42 +++++--
 indra/newview/llscreenchannel.h       |   7 +-
 indra/newview/llsidepaneltaskinfo.cpp | 159 ++++++++++++++++----------
 indra/newview/llsidepaneltaskinfo.h   |  40 ++++++-
 indra/newview/llstatusbar.cpp         |   5 +-
 indra/newview/llstatusbar.h           |   3 +-
 15 files changed, 272 insertions(+), 120 deletions(-)

diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 622f3e215c9..466fac33ea3 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -175,6 +175,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
 	mBorder(NULL),
 	mSortCallback(NULL),
 	mPopupMenu(NULL),
+	mCommentTextView(NULL),
 	mNumDynamicWidthColumns(0),
 	mTotalStaticColumnWidth(0),
 	mTotalColumnPadding(0),
@@ -476,7 +477,12 @@ void LLScrollListCtrl::updateLayout()
 		getRect().getWidth() - 2 * mBorderThickness,
 		getRect().getHeight() - (2 * mBorderThickness ) - heading_size );
 
-	getChildView("comment_text")->setShape(mItemListRect);
+	if (mCommentTextView == NULL)
+	{
+		mCommentTextView = getChildView("comment_text");
+	}
+
+	mCommentTextView->setShape(mItemListRect);
 
 	// how many lines of content in a single "page"
 	S32 page_lines =  getLinesPerPage();
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 09ab89960da..ae8aea92457 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -480,6 +480,8 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler,
 	S32				mHighlightedItem;
 	class LLViewBorder*	mBorder;
 	LLContextMenu	*mPopupMenu;
+	
+	LLView			*mCommentTextView;
 
 	LLWString		mSearchString;
 	LLFrameTimer	mSearchTimer;
diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp
index ba511a36931..92ac336d0db 100644
--- a/indra/newview/lldebugview.cpp
+++ b/indra/newview/lldebugview.cpp
@@ -55,9 +55,30 @@ LLDebugView* gDebugView = NULL;
 static LLDefaultChildRegistry::Register<LLDebugView> r("debug_view");
 
 LLDebugView::LLDebugView(const LLDebugView::Params& p)
-:	LLView(p)
+:	LLView(p),
+	mFastTimerView(NULL),
+	mMemoryView(NULL),
+	mDebugConsolep(NULL),
+	mFloaterSnapRegion(NULL)
 {}
 
+LLDebugView::~LLDebugView()
+{
+	// These have already been deleted.  Fix the globals appropriately.
+	gDebugView = NULL;
+	gTextureView = NULL;
+	gSceneView = NULL;
+	gTextureSizeView = NULL;
+	gTextureCategoryView = NULL;
+}
+
+BOOL LLDebugView::postBuild()
+{
+	mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region");
+	
+	return TRUE;
+}
+
 void LLDebugView::init()
 {
 	LLRect r;
@@ -109,8 +130,6 @@ void LLDebugView::init()
 	addChild(gTextureView);
 	//gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE);
 
-	
-
 
 	if(gAuditTexture)
 	{
@@ -136,22 +155,10 @@ void LLDebugView::init()
 	}
 }
 
-
-LLDebugView::~LLDebugView()
-{
-	// These have already been deleted.  Fix the globals appropriately.
-	gDebugView = NULL;
-	gTextureView = NULL;
-	gSceneView = NULL;
-	gTextureSizeView = NULL;
-	gTextureCategoryView = NULL;
-}
-
 void LLDebugView::draw()
 {
-	LLView* floater_snap_region = getRootView()->getChildView("floater_snap_region");
 	LLRect debug_rect;
-	floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &debug_rect, getParent());
+	mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &debug_rect, getParent());
 
 	setShape(debug_rect);
 	LLView::draw();
diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h
index 907a42c981e..33d6a7394f5 100644
--- a/indra/newview/lldebugview.h
+++ b/indra/newview/lldebugview.h
@@ -51,17 +51,21 @@ class LLDebugView : public LLView
 			changeDefault(mouse_opaque, false);
 		}
 	};
+	
 	LLDebugView(const Params&);
 	~LLDebugView();
 
+	BOOL postBuild();
+	
 	void init();
 	void draw();
-
+	
 	void setStatsVisible(BOOL visible);
 	
 	LLFastTimerView* mFastTimerView;
 	LLMemoryView*	 mMemoryView;
 	LLConsole*		 mDebugConsolep;
+	LLView*			 mFloaterSnapRegion;
 };
 
 extern LLDebugView* gDebugView;
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index f410c31f44f..02f1899e6e3 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -55,6 +55,15 @@ LLFloaterWebContent::_Params::_Params()
 LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 :	LLFloater( params ),
 	LLInstanceTracker<LLFloaterWebContent, std::string>(params.id()),
+	mWebBrowser(NULL),
+	mAddressCombo(NULL),
+	mSecureLockIcon(NULL),
+	mStatusBarText(NULL),
+	mStatusBarProgress(NULL),
+	mBtnBack(NULL),
+	mBtnForward(NULL),
+	mBtnReload(NULL),
+	mBtnStop(NULL),
 	mUUID(params.id()),
 	mShowPageTitle(params.show_page_title)
 {
@@ -74,11 +83,16 @@ BOOL LLFloaterWebContent::postBuild()
 	mStatusBarText     = getChild< LLTextBox >( "statusbartext" );
 	mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress" );
 
+	mBtnBack           = getChildView( "back" );
+	mBtnForward        = getChildView( "forward" );
+	mBtnReload         = getChildView( "reload" );
+	mBtnStop           = getChildView( "stop" );
+
 	// observe browser events
 	mWebBrowser->addObserver( this );
 
 	// these buttons are always enabled
-	getChildView("reload")->setEnabled( true );
+	mBtnReload->setEnabled( true );
 	getChildView("popexternal")->setEnabled( true );
 
 	// cache image for secure browsing
@@ -276,8 +290,8 @@ void LLFloaterWebContent::onClose(bool app_quitting)
 void LLFloaterWebContent::draw()
 {
 	// this is asynchronous so we need to keep checking
-	getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() );
-	getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() );
+	mBtnBack->setEnabled( mWebBrowser->canNavigateBack() );
+	mBtnForward->setEnabled( mWebBrowser->canNavigateForward() );
 
 	LLFloater::draw();
 }
@@ -297,12 +311,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 	else if(event == MEDIA_EVENT_NAVIGATE_BEGIN)
 	{
 		// flags are sent with this event
-		getChildView("back")->setEnabled( self->getHistoryBackAvailable() );
-		getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() );
+		mBtnBack->setEnabled( self->getHistoryBackAvailable() );
+		mBtnForward->setEnabled( self->getHistoryForwardAvailable() );
 
 		// toggle visibility of these buttons based on browser state
-		getChildView("reload")->setVisible( false );
-		getChildView("stop")->setVisible( true );
+		mBtnReload->setVisible( false );
+		mBtnStop->setVisible( true );
 
 		// turn "on" progress bar now we're about to start loading
 		mStatusBarProgress->setVisible( true );
@@ -310,12 +324,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 	else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
 	{
 		// flags are sent with this event
-		getChildView("back")->setEnabled( self->getHistoryBackAvailable() );
-		getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() );
+		mBtnBack->setEnabled( self->getHistoryBackAvailable() );
+		mBtnForward->setEnabled( self->getHistoryForwardAvailable() );
 
 		// toggle visibility of these buttons based on browser state
-		getChildView("reload")->setVisible( true );
-		getChildView("stop")->setVisible( false );
+		mBtnReload->setVisible( true );
+		mBtnStop->setVisible( false );
 
 		// turn "off" progress bar now we're loaded
 		mStatusBarProgress->setVisible( false );
@@ -421,8 +435,8 @@ void LLFloaterWebContent::onClickStop()
 	// still should happen when we catch the navigate complete event
 	// but sometimes (don't know why) that event isn't sent from Qt
 	// and we ghetto a point where the stop button stays active.
-	getChildView("reload")->setVisible( true );
-	getChildView("stop")->setVisible( false );
+	mBtnReload->setVisible( true );
+	mBtnStop->setVisible( false );
 }
 
 void LLFloaterWebContent::onEnterAddress()
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index 6fc66d1ad8c..0340eedd932 100644
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -97,6 +97,12 @@ class LLFloaterWebContent :
 	LLIconCtrl*		mSecureLockIcon;
 	LLTextBox*		mStatusBarText;
 	LLProgressBar*	mStatusBarProgress;
+
+	LLView*			mBtnBack;
+	LLView*			mBtnForward;
+	LLView*			mBtnReload;
+	LLView*			mBtnStop;
+
 	std::string		mCurrentURL;
 	std::string		mUUID;
 	bool			mShowPageTitle;
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 4674c853240..701fdf43c74 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -70,9 +70,14 @@ static LLChatTypeTrigger sChatTypeTriggers[] = {
 };
 
 LLNearbyChatBar::LLNearbyChatBar(const LLSD& key)
-	: LLFloater(key),
-	mChatBox(NULL)
-{	mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
+:	LLFloater(key),
+	mChatBox(NULL),
+	mNearbyChat(NULL),
+	mOutputMonitor(NULL),
+	mSpeakerMgr(NULL),
+	mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT)
+{
+	mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
 }
 
 //virtual
@@ -94,6 +99,7 @@ BOOL LLNearbyChatBar::postBuild()
 	mChatBox->setEnableLineHistory(TRUE);
 	mChatBox->setFont(LLViewerChat::getChatFont());
 
+	mNearbyChat = getChildView("nearby_chat");
 
 	LLUICtrl* show_btn = getChild<LLUICtrl>("show_nearby_chat");
 	show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this));
@@ -104,8 +110,6 @@ BOOL LLNearbyChatBar::postBuild()
 	// Register for font change notifications
 	LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1));
 
-	mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT;
-
 	enableResizeCtrls(true, true, false);
 
 	return TRUE;
@@ -115,8 +119,7 @@ bool LLNearbyChatBar::applyRectControl()
 {
 	bool rect_controlled = LLFloater::applyRectControl();
 
-	LLView* nearby_chat = getChildView("nearby_chat");	
-	if (!nearby_chat->getVisible())
+	if (!mNearbyChat->getVisible())
 	{
 		reshape(getRect().getWidth(), getMinHeight());
 		enableResizeCtrls(true, true, false);
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index e9734899b31..c2f57dc4ca3 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -84,9 +84,10 @@ class LLNearbyChatBar :	public LLFloater
 	// Which non-zero channel did we last chat on?
 	static S32 sLastSpecialChatChannel;
 
-	LLLineEditor*		mChatBox;
-	LLOutputMonitorCtrl* mOutputMonitor;
-	LLLocalSpeakerMgr*  mSpeakerMgr;
+	LLLineEditor*			mChatBox;
+	LLView*					mNearbyChat;
+	LLOutputMonitorCtrl*	mOutputMonitor;
+	LLLocalSpeakerMgr*		mSpeakerMgr;
 
 	S32 mExpandedHeight;
 };
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index c43c95a366d..7a17dbce3d7 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -365,12 +365,15 @@ void LLNearbyChatScreenChannel::arrangeToasts()
 	if(mStopProcessing || isHovering())
 		return;
 
-	LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region");
-
+	if (mFloaterSnapRegion == NULL)
+	{
+		mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region");
+	}
+	
 	if (!getParent())
 	{
 		// connect to floater snap region just to get resize events, we don't care about being a proper widget 
-		floater_snap_region->addChild(this);
+		mFloaterSnapRegion->addChild(this);
 		setFollows(FOLLOWS_ALL);
 	}
 
@@ -378,7 +381,7 @@ void LLNearbyChatScreenChannel::arrangeToasts()
 	updateRect();
 
 	LLRect channel_rect;
-	floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &channel_rect, gFloaterView);
+	mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &channel_rect, gFloaterView);
 	channel_rect.mLeft += 10;
 	channel_rect.mRight = channel_rect.mLeft + 300;
 
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 45cf81751be..33dbd3bdc35 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -53,13 +53,22 @@ LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel R
 LLRect LLScreenChannelBase::getChannelRect()
 {
 	LLFastTimer _(FTM_GET_CHANNEL_RECT);
+
+	if (mFloaterSnapRegion == NULL)
+	{
+		mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region");
+	}
+	
+	if (mChicletRegion == NULL)
+	{
+		mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container");
+	}
+	
 	LLRect channel_rect;
 	LLRect chiclet_rect;
-	LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region");
-	floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect);
 
-	LLView* chiclet_region = gViewerWindow->getRootView()->getChildView("chiclet_container");
-	chiclet_region->localRectToScreen(chiclet_region->getLocalRect(), &chiclet_rect);
+	mFloaterSnapRegion->localRectToScreen(mFloaterSnapRegion->getLocalRect(), &channel_rect);
+	mChicletRegion->localRectToScreen(mChicletRegion->getLocalRect(), &chiclet_rect);
 
 	channel_rect.mTop = chiclet_rect.mBottom;
 	return channel_rect;
@@ -81,14 +90,31 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p)
 	mShowToasts(true),
 	mID(p.id),
 	mDisplayToastsAlways(p.display_toasts_always),
-	mChannelAlignment(p.channel_align)
-{	
+	mChannelAlignment(p.channel_align),
+	mFloaterSnapRegion(NULL),
+	mChicletRegion(NULL)
+{
 	mID = p.id;
 
 	setMouseOpaque( false );
 	setVisible(FALSE);
 }
 
+BOOL LLScreenChannelBase::postBuild()
+{
+	if (mFloaterSnapRegion == NULL)
+	{
+		mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region");
+	}
+	
+	if (mChicletRegion == NULL)
+	{
+		mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container");
+	}
+	
+	return TRUE;
+}
+
 void LLScreenChannelBase::reshape(S32 width, S32 height, BOOL called_from_parent)
 {
 	redrawToasts();
@@ -473,12 +499,10 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
 //--------------------------------------------------------------------------
 void LLScreenChannel::redrawToasts()
 {
-	LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region");
-
 	if (!getParent())
 	{
 		// connect to floater snap region just to get resize events, we don't care about being a proper widget 
-		floater_snap_region->addChild(this);
+		mFloaterSnapRegion->addChild(this);
 		setFollows(FOLLOWS_ALL);
 	}
 
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index 2f23552828b..c9f8855fe63 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -69,6 +69,8 @@ class LLScreenChannelBase : public LLUICtrl
 	};
 
 	LLScreenChannelBase(const Params&);
+	
+	BOOL postBuild();
 
 	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
 
@@ -123,7 +125,7 @@ class LLScreenChannelBase : public LLUICtrl
 
 	// Channel's flags
 	bool		mControlHovering;
-	LLToast*		mHoveredToast;
+	LLToast*	mHoveredToast;
 	bool		mCanStoreToasts;
 	bool		mDisplayToastsAlways;
 	// controls whether a channel shows toasts or not
@@ -137,6 +139,9 @@ class LLScreenChannelBase : public LLUICtrl
 
 	// channel's ID
 	LLUUID	mID;
+	
+	LLView*	mFloaterSnapRegion;
+	LLView* mChicletRegion;
 };
 
 
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 8774482acdf..24cb559fd05 100644
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -117,6 +117,42 @@ BOOL LLSidepanelTaskInfo::postBuild()
 	childSetCommitCallback("checkbox next owner can transfer",	&LLSidepanelTaskInfo::onCommitNextOwnerTransfer,this);
 	childSetCommitCallback("clickaction",						&LLSidepanelTaskInfo::onCommitClickAction,this);
 	childSetCommitCallback("search_check",						&LLSidepanelTaskInfo::onCommitIncludeInSearch,this);
+	
+	mDAPermModify = getChild<LLUICtrl>("perm_modify");
+	mDACreator = getChildView("Creator:");
+	mDACreatorName = getChild<LLUICtrl>("Creator Name");
+	mDAOwner = getChildView("Owner:");
+	mDAOwnerName = getChild<LLUICtrl>("Owner Name");
+	mDAGroup = getChildView("Group:");
+	mDAGroupName = getChild<LLUICtrl>("Group Name");
+	mDAButtonSetGroup = getChildView("button set group");
+	mDAObjectName = getChild<LLUICtrl>("Object Name");
+	mDAName = getChildView("Name:");
+	mDADescription = getChildView("Description:");
+	mDAObjectDescription = getChild<LLUICtrl>("Object Description");
+	mDAPermissions = getChildView("Permissions:");
+	mDACheckboxShareWithGroup = getChild<LLUICtrl>("checkbox share with group");
+	mDAButtonDeed = getChildView("button deed");
+	mDACheckboxAllowEveryoneMove = getChild<LLUICtrl>("checkbox allow everyone move");
+	mDACheckboxAllowEveryoneCopy = getChild<LLUICtrl>("checkbox allow everyone copy");
+	mDANextOwnerCan = getChildView("Next owner can:");
+	mDACheckboxNextOwnerCanModify = getChild<LLUICtrl>("checkbox next owner can modify");
+	mDACheckboxNextOwnerCanCopy = getChild<LLUICtrl>("checkbox next owner can copy");
+	mDACheckboxNextOwnerCanTransfer = getChild<LLUICtrl>("checkbox next owner can transfer");
+	mDACheckboxForSale = getChild<LLUICtrl>("checkbox for sale");
+	mDASearchCheck = getChild<LLUICtrl>("search_check");
+	mDAComboSaleType = getChild<LLComboBox>("sale type");
+	mDACost = getChild<LLUICtrl>("Cost");
+	mDAEditCost = getChild<LLUICtrl>("Edit Cost");
+	mDALabelClickAction = getChildView("label click action");
+	mDAComboClickAction = getChild<LLComboBox>("clickaction");
+	mDAB = getChildView("B:");
+	mDAO = getChildView("O:");
+	mDAG = getChildView("G:");
+	mDAE = getChildView("E:");
+	mDAN = getChildView("N:");
+	mDAF = getChildView("F:");
+	
 	return TRUE;
 }
 
@@ -138,81 +174,80 @@ BOOL LLSidepanelTaskInfo::postBuild()
 
 void LLSidepanelTaskInfo::disableAll()
 {
-	getChildView("perm_modify")->setEnabled(FALSE);
-	getChild<LLUICtrl>("perm_modify")->setValue(LLStringUtil::null);
-
-	getChildView("Creator:")->setEnabled(FALSE);
-	getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null);
-	getChildView("Creator Name")->setEnabled(FALSE);
-
-	getChildView("Owner:")->setEnabled(FALSE);
-	getChild<LLUICtrl>("Owner Name")->setValue(LLStringUtil::null);
-	getChildView("Owner Name")->setEnabled(FALSE);
-
-	getChildView("Group:")->setEnabled(FALSE);
-	getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null);
-	getChildView("Group Name")->setEnabled(FALSE);
-	getChildView("button set group")->setEnabled(FALSE);
-
-	getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null);
-	getChildView("Object Name")->setEnabled(FALSE);
-	getChildView("Name:")->setEnabled(FALSE);
-	getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null);
-	getChildView("Group Name")->setEnabled(FALSE);
-	getChildView("Description:")->setEnabled(FALSE);
-	getChild<LLUICtrl>("Object Description")->setValue(LLStringUtil::null);
-	getChildView("Object Description")->setEnabled(FALSE);
-
-	getChildView("Permissions:")->setEnabled(FALSE);
+	mDAPermModify->setEnabled(FALSE);
+	mDAPermModify->setValue(LLStringUtil::null);
+
+	mDACreator->setEnabled(FALSE);
+	mDACreatorName->setValue(LLStringUtil::null);
+	mDACreatorName->setEnabled(FALSE);
+
+	mDAOwner->setEnabled(FALSE);
+	mDAOwnerName->setValue(LLStringUtil::null);
+	mDAOwnerName->setEnabled(FALSE);
+
+	mDAGroup->setEnabled(FALSE);
+	mDAGroupName->setValue(LLStringUtil::null);
+	mDAGroupName->setEnabled(FALSE);
+	mDAButtonSetGroup->setEnabled(FALSE);
+
+	mDAObjectName->setValue(LLStringUtil::null);
+	mDAObjectName->setEnabled(FALSE);
+	mDAName->setEnabled(FALSE);
+	mDAGroupName->setValue(LLStringUtil::null);
+	mDAGroupName->setEnabled(FALSE);
+	mDADescription->setEnabled(FALSE);
+	mDAObjectDescription->setValue(LLStringUtil::null);
+	mDAObjectDescription->setEnabled(FALSE);
+
+	mDAPermissions->setEnabled(FALSE);
 		
-	getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE);
-	getChildView("checkbox share with group")->setEnabled(FALSE);
-	getChildView("button deed")->setEnabled(FALSE);
+	mDACheckboxShareWithGroup->setValue(FALSE);
+	mDACheckboxShareWithGroup->setEnabled(FALSE);
+	mDAButtonDeed->setEnabled(FALSE);
 
-	getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE);
-	getChildView("checkbox allow everyone move")->setEnabled(FALSE);
-	getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE);
-	getChildView("checkbox allow everyone copy")->setEnabled(FALSE);
+	mDACheckboxAllowEveryoneMove->setValue(FALSE);
+	mDACheckboxAllowEveryoneMove->setEnabled(FALSE);
+	mDACheckboxAllowEveryoneCopy->setValue(FALSE);
+	mDACheckboxAllowEveryoneCopy->setEnabled(FALSE);
 
 	//Next owner can:
-	getChildView("Next owner can:")->setEnabled(FALSE);
-	getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE);
-	getChildView("checkbox next owner can modify")->setEnabled(FALSE);
-	getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE);
-	getChildView("checkbox next owner can copy")->setEnabled(FALSE);
-	getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE);
-	getChildView("checkbox next owner can transfer")->setEnabled(FALSE);
+	mDANextOwnerCan->setEnabled(FALSE);
+	mDACheckboxNextOwnerCanModify->setValue(FALSE);
+	mDACheckboxNextOwnerCanModify->setEnabled(FALSE);
+	mDACheckboxNextOwnerCanCopy->setValue(FALSE);
+	mDACheckboxNextOwnerCanCopy->setEnabled(FALSE);
+	mDACheckboxNextOwnerCanTransfer->setValue(FALSE);
+	mDACheckboxNextOwnerCanTransfer->setEnabled(FALSE);
 
 	//checkbox for sale
-	getChild<LLUICtrl>("checkbox for sale")->setValue(FALSE);
-	getChildView("checkbox for sale")->setEnabled(FALSE);
+	mDACheckboxForSale->setValue(FALSE);
+	mDACheckboxForSale->setEnabled(FALSE);
 
 	//checkbox include in search
-	getChild<LLUICtrl>("search_check")->setValue(FALSE);
-	getChildView("search_check")->setEnabled(FALSE);
+	mDASearchCheck->setValue(FALSE);
+	mDASearchCheck->setEnabled(FALSE);
 		
-	LLComboBox*	combo_sale_type = getChild<LLComboBox>("sale type");
-	combo_sale_type->setValue(LLSaleInfo::FS_COPY);
-	combo_sale_type->setEnabled(FALSE);
+	mDAComboSaleType->setValue(LLSaleInfo::FS_COPY);
+	mDAComboSaleType->setEnabled(FALSE);
 		
-	getChildView("Cost")->setEnabled(FALSE);
-	getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default"));
-	getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null);
-	getChildView("Edit Cost")->setEnabled(FALSE);
+	mDACost->setEnabled(FALSE);
+	mDACost->setValue(getString("Cost Default"));
+	mDAEditCost->setValue(LLStringUtil::null);
+	mDAEditCost->setEnabled(FALSE);
 		
-	getChildView("label click action")->setEnabled(FALSE);
-	LLComboBox*	combo_click_action = getChild<LLComboBox>("clickaction");
-	if (combo_click_action)
+	mDALabelClickAction->setEnabled(FALSE);
+	if (mDAComboClickAction)
 	{
-		combo_click_action->setEnabled(FALSE);
-		combo_click_action->clear();
+		mDAComboClickAction->setEnabled(FALSE);
+		mDAComboClickAction->clear();
 	}
-	getChildView("B:")->setVisible(								FALSE);
-	getChildView("O:")->setVisible(								FALSE);
-	getChildView("G:")->setVisible(								FALSE);
-	getChildView("E:")->setVisible(								FALSE);
-	getChildView("N:")->setVisible(								FALSE);
-	getChildView("F:")->setVisible(								FALSE);
+
+	mDAB->setVisible(FALSE);
+	mDAO->setVisible(FALSE);
+	mDAG->setVisible(FALSE);
+	mDAE->setVisible(FALSE);
+	mDAN->setVisible(FALSE);
+	mDAF->setVisible(FALSE);
 	
 	mOpenBtn->setEnabled(FALSE);
 	mPayBtn->setEnabled(FALSE);
diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h
index 384bc479d6b..be0fee21272 100644
--- a/indra/newview/llsidepaneltaskinfo.h
+++ b/indra/newview/llsidepaneltaskinfo.h
@@ -37,8 +37,9 @@
 // Panel for permissions of an object.
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-class LLNameBox;
 class LLCheckBoxCtrl;
+class LLComboBox;
+class LLNameBox;
 class LLViewerObject;
 
 class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel
@@ -118,6 +119,43 @@ class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel
 	LLPointer<LLViewerObject>	mObject;
 	LLObjectSelectionHandle		mObjectSelection;
 	static LLSidepanelTaskInfo* sActivePanel;
+	
+private:
+	// Pointers cached here to speed up the "disableAll" function which gets called on idle
+	LLUICtrl*	mDAPermModify;
+	LLView*		mDACreator;
+	LLUICtrl*	mDACreatorName;
+	LLView*		mDAOwner;
+	LLUICtrl*	mDAOwnerName;
+	LLView*		mDAGroup;
+	LLUICtrl*	mDAGroupName;
+	LLView*		mDAButtonSetGroup;
+	LLUICtrl*	mDAObjectName;
+	LLView*		mDAName;
+	LLView*		mDADescription;
+	LLUICtrl*	mDAObjectDescription;
+	LLView*		mDAPermissions;
+	LLUICtrl*	mDACheckboxShareWithGroup;
+	LLView*		mDAButtonDeed;
+	LLUICtrl*	mDACheckboxAllowEveryoneMove;
+	LLUICtrl*	mDACheckboxAllowEveryoneCopy;
+	LLView*		mDANextOwnerCan;
+	LLUICtrl*	mDACheckboxNextOwnerCanModify;
+	LLUICtrl*	mDACheckboxNextOwnerCanCopy;
+	LLUICtrl*	mDACheckboxNextOwnerCanTransfer;
+	LLUICtrl*	mDACheckboxForSale;
+	LLUICtrl*	mDASearchCheck;
+	LLComboBox*	mDAComboSaleType;
+	LLUICtrl*	mDACost;
+	LLUICtrl*	mDAEditCost;
+	LLView*		mDALabelClickAction;
+	LLComboBox*	mDAComboClickAction;
+	LLView*		mDAB;
+	LLView*		mDAO;
+	LLView*		mDAG;
+	LLView*		mDAE;
+	LLView*		mDAN;
+	LLView*		mDAF;
 };
 
 
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 75db269bde9..89240c982f5 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -114,6 +114,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
 	mTextTime(NULL),
 	mSGBandwidth(NULL),
 	mSGPacketLoss(NULL),
+	mBtnStats(NULL),
 	mBtnVolume(NULL),
 	mBoxBalance(NULL),
 	mBalance(0),
@@ -173,6 +174,8 @@ BOOL LLStatusBar::postBuild()
 
 	mBoxBalance = getChild<LLTextBox>("balance");
 	mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this );
+	
+	mBtnStats = getChildView("stat_btn");
 
 	mBtnVolume = getChild<LLButton>( "volume_btn" );
 	mBtnVolume->setClickedCallback( onClickVolume, this );
@@ -288,7 +291,7 @@ void LLStatusBar::refresh()
 
 	mSGBandwidth->setVisible(net_stats_visible);
 	mSGPacketLoss->setVisible(net_stats_visible);
-	getChildView("stat_btn")->setEnabled(net_stats_visible);
+	mBtnStats->setEnabled(net_stats_visible);
 
 	// update the master volume button state
 	bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute();
diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h
index 4ea3183d182..9d28e6c2bc5 100644
--- a/indra/newview/llstatusbar.h
+++ b/indra/newview/llstatusbar.h
@@ -102,10 +102,11 @@ class LLStatusBar
 	LLStatGraph *mSGBandwidth;
 	LLStatGraph *mSGPacketLoss;
 
+	LLView		*mBtnStats;
 	LLButton	*mBtnVolume;
 	LLTextBox	*mBoxBalance;
 	LLButton	*mMediaToggle;
-	LLView*		mScriptOut;
+	LLView		*mScriptOut;
 	LLFrameTimer	mClockUpdateTimer;
 
 	S32				mBalance;
-- 
GitLab


From 619cda179d28a9d62732a952d349dff76fd57180 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 23 Nov 2011 13:18:41 -0800
Subject: [PATCH 286/933] SH-2711 FIX -- Removed the "RenderAnimateTrees"
 setting and associated code.

---
 indra/newview/app_settings/settings.xml |  12 --
 indra/newview/lldrawpooltree.cpp        | 154 ++----------------------
 indra/newview/lldrawpooltree.h          |   3 -
 indra/newview/llviewercontrol.cpp       |   1 -
 indra/newview/llvotree.cpp              |  96 ++++-----------
 indra/newview/llvotree.h                |   1 -
 6 files changed, 36 insertions(+), 231 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index aa08b0783e1..b41c7f0e78f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7869,18 +7869,6 @@
     <integer>0</integer>
   </map>
 
-  <key>RenderAnimateTrees</key>
-  <map>
-    <key>Comment</key>
-    <string>Use GL matrix ops to animate tree branches.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>0</integer>
-  </map>
-  
   <key>RenderMinimumLODTriangleCount</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index d198e28c140..3165a3516c0 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -97,25 +97,18 @@ void LLDrawPoolTree::render(S32 pass)
 	LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1);
 	LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
 
-	if (gSavedSettings.getBOOL("RenderAnimateTrees"))
-	{
-		renderTree();
-	}
-	else
+	gGL.getTexUnit(sDiffTex)->bind(mTexturep);
+				
+	for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
+		 iter != mDrawFace.end(); iter++)
 	{
-		gGL.getTexUnit(sDiffTex)->bind(mTexturep);
-					
-		for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
-			 iter != mDrawFace.end(); iter++)
+		LLFace *face = *iter;
+		LLVertexBuffer* buff = face->getVertexBuffer();
+		if(buff)
 		{
-			LLFace *face = *iter;
-			LLVertexBuffer* buff = face->getVertexBuffer();
-			if(buff)
-			{
-				buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
-				buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); 
-				gPipeline.addTrianglesDrawn(buff->getNumIndices());
-			}
+			buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
+			buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); 
+			gPipeline.addTrianglesDrawn(buff->getNumIndices());
 		}
 	}
 }
@@ -187,133 +180,6 @@ void LLDrawPoolTree::endShadowPass(S32 pass)
 	gDeferredTreeShadowProgram.unbind();
 }
 
-
-void LLDrawPoolTree::renderTree(BOOL selecting)
-{
-	LLGLState normalize(GL_NORMALIZE, TRUE);
-	
-	// Bind the texture for this tree.
-	gGL.getTexUnit(sDiffTex)->bind(mTexturep.get(), TRUE);
-		
-	U32 indices_drawn = 0;
-
-	gGL.matrixMode(LLRender::MM_MODELVIEW);
-	
-	for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
-		 iter != mDrawFace.end(); iter++)
-	{
-		LLFace *face = *iter;
-		LLDrawable *drawablep = face->getDrawable();
-
-		if (drawablep->isDead() || !face->getVertexBuffer())
-		{
-			continue;
-		}
-
-		face->getVertexBuffer()->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
-		U16* indicesp = (U16*) face->getVertexBuffer()->getIndicesPointer();
-
-		// Render each of the trees
-		LLVOTree *treep = (LLVOTree *)drawablep->getVObj().get();
-
-		LLColor4U color(255,255,255,255);
-
-		if (!selecting || treep->mGLName != 0)
-		{
-			if (selecting)
-			{
-				S32 name = treep->mGLName;
-				
-				color = LLColor4U((U8)(name >> 16), (U8)(name >> 8), (U8)name, 255);
-			}
-			
-			gGLLastMatrix = NULL;
-			gGL.loadMatrix(gGLModelView);
-			//gGL.pushMatrix();
-			F32 mat[16];
-			for (U32 i = 0; i < 16; i++)
-				mat[i] = (F32) gGLModelView[i];
-
-			LLMatrix4 matrix(mat);
-			
-			// Translate to tree base  HACK - adjustment in Z plants tree underground
-			const LLVector3 &pos_agent = treep->getPositionAgent();
-			//gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
-			LLMatrix4 trans_mat;
-			trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
-			trans_mat *= matrix;
-			
-			// Rotate to tree position and bend for current trunk/wind
-			// Note that trunk stiffness controls the amount of bend at the trunk as 
-			// opposed to the crown of the tree
-			// 
-			const F32 TRUNK_STIFF = 22.f;
-			
-			LLQuaternion rot = 
-				LLQuaternion(treep->mTrunkBend.magVec()*TRUNK_STIFF*DEG_TO_RAD, LLVector4(treep->mTrunkBend.mV[VX], treep->mTrunkBend.mV[VY], 0)) *
-				LLQuaternion(90.f*DEG_TO_RAD, LLVector4(0,0,1)) *
-				treep->getRotation();
-
-			LLMatrix4 rot_mat(rot);
-			rot_mat *= trans_mat;
-
-			F32 radius = treep->getScale().magVec()*0.05f;
-			LLMatrix4 scale_mat;
-			scale_mat.mMatrix[0][0] = 
-				scale_mat.mMatrix[1][1] =
-				scale_mat.mMatrix[2][2] = radius;
-
-			scale_mat *= rot_mat;
-
-			const F32 THRESH_ANGLE_FOR_BILLBOARD = 15.f;
-			const F32 BLEND_RANGE_FOR_BILLBOARD = 3.f;
-
-			F32 droop = treep->mDroop + 25.f*(1.f - treep->mTrunkBend.magVec());
-			
-			S32 stop_depth = 0;
-			F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor;
-			F32 alpha = 1.0;
-			S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS;
-
-			for (S32 j = 0; j < 4; j++)
-			{
-
-				if (app_angle > LLVOTree::sLODAngles[j])
-				{
-					trunk_LOD = j;
-					break;
-				}
-			} 
-			if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS)
-			{
-				continue ; //do not render.
-			}
-
-			if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
-			{
-				//
-				//  Draw only the billboard 
-				//
-				//  Only the billboard, can use closer to normal alpha func.
-				stop_depth = -1;
-				LLFacePool::LLOverrideFaceColor clr(this, color); 
-				indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
-			}
-			else // if (app_angle > (THRESH_ANGLE_FOR_BILLBOARD + BLEND_RANGE_FOR_BILLBOARD))
-			{
-				//
-				//  Draw only the full geometry tree
-				//
-				//stop_depth = (app_angle < THRESH_ANGLE_FOR_RECURSION_REDUCTION);
-				LLFacePool::LLOverrideFaceColor clr(this, color); 
-				indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
-			}
-			
-			//gGL.popMatrix();
-		}
-	}
-}
-
 BOOL LLDrawPoolTree::verify() const
 {
 /*	BOOL ok = TRUE;
diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h
index ddb259bb821..e7e25453cff 100644
--- a/indra/newview/lldrawpooltree.h
+++ b/indra/newview/lldrawpooltree.h
@@ -68,9 +68,6 @@ class LLDrawPoolTree : public LLFacePool
 	/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
 
 	static S32 sDiffTex;
-
-private:
-	void renderTree(BOOL selecting = FALSE);
 };
 
 #endif // LL_LLDRAWPOOLTREE_H
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 73e4d11d7bc..093b84413a0 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -564,7 +564,6 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
 	gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
-	gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 6486fd24ea4..4564207da4d 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -341,45 +341,11 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys,
 
 BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
 {
-	const U16 FRAMES_PER_WIND_UPDATE = 20;				//  How many frames between wind update per tree
-	const F32 TREE_WIND_SENSITIVITY = 0.005f;
-	const F32 TREE_TRUNK_STIFFNESS = 0.1f;
-
  	if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE)))
 	{
 		return TRUE;
 	}
 	
-	if (gSavedSettings.getBOOL("RenderAnimateTrees"))
-	{
-		F32 mass_inv; 
-
-		//  For all tree objects, update the trunk bending with the current wind 
-		//  Walk sprite list in order away from viewer 
-		if (!(mFrameCount % FRAMES_PER_WIND_UPDATE)) 
-		{
-			//  If needed, Get latest wind for this tree
-			mWind = mRegionp->mWind.getVelocity(getPositionRegion());
-		}
-		mFrameCount++;
-
-		mass_inv = 1.f/(5.f + mDepth*mBranches*0.2f);
-		mTrunkVel += (mWind * mass_inv * TREE_WIND_SENSITIVITY);		//  Pull in direction of wind
-		mTrunkVel -= (mTrunkBend * mass_inv * TREE_TRUNK_STIFFNESS);		//  Restoring force in direction of trunk 	
-		mTrunkBend += mTrunkVel;
-		mTrunkVel *= 0.99f;									//  Add damping
-
-		if (mTrunkBend.length() > 1.f)
-		{
-			mTrunkBend.normalize();
-		}
-
-		if (mTrunkVel.length() > 1.f)
-		{
-			mTrunkVel.normalize();
-		}
-	}
-
 	S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ;
 	F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor;
 
@@ -392,39 +358,36 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
 		}
 	} 
 
-	if (!gSavedSettings.getBOOL("RenderAnimateTrees"))
+	if (mReferenceBuffer.isNull())
 	{
-		if (mReferenceBuffer.isNull())
-		{
-			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
-		}
-		else if (trunk_LOD != mTrunkLOD)
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
+	}
+	else if (trunk_LOD != mTrunkLOD)
+	{
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE);
+	}
+	else
+	{
+		// we're not animating but we may *still* need to
+		// regenerate the mesh if we moved, since position
+		// and rotation are baked into the mesh.
+		// *TODO: I don't know what's so special about trees
+		// that they don't get REBUILD_POSITION automatically
+		// at a higher level.
+		const LLVector3 &this_position = getPositionAgent();
+		if (this_position != mLastPosition)
 		{
-			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE);
+			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
+			mLastPosition = this_position;
 		}
 		else
 		{
-			// we're not animating but we may *still* need to
-			// regenerate the mesh if we moved, since position
-			// and rotation are baked into the mesh.
-			// *TODO: I don't know what's so special about trees
-			// that they don't get REBUILD_POSITION automatically
-			// at a higher level.
-			const LLVector3 &this_position = getPositionAgent();
-			if (this_position != mLastPosition)
+			const LLQuaternion &this_rotation = getRotation();
+			
+			if (this_rotation != mLastRotation)
 			{
 				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
-				mLastPosition = this_position;
-			}
-			else
-			{
-				const LLQuaternion &this_rotation = getRotation();
-				
-				if (this_rotation != mLastRotation)
-				{
-					gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
-					mLastRotation = this_rotation;
-				}
+				mLastRotation = this_rotation;
 			}
 		}
 	}
@@ -559,7 +522,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
 			max_vertices += sLODVertexCount[lod];
 		}
 
-		mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, gSavedSettings.getBOOL("RenderAnimateTrees") ? GL_STATIC_DRAW_ARB : 0);
+		mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, 0);
 		mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE);
 
 		LLStrider<LLVector3> vertices;
@@ -863,15 +826,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
 		llassert(index_count == max_indices);
 	}
 
-	if (gSavedSettings.getBOOL("RenderAnimateTrees"))
-	{
-		mDrawable->getFace(0)->setVertexBuffer(mReferenceBuffer);
-	}
-	else
-	{
-		//generate tree mesh
-		updateMesh();
-	}
+	//generate tree mesh
+	updateMesh();
 	
 	return TRUE;
 }
diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h
index 1e1deede264..0554935539e 100644
--- a/indra/newview/llvotree.h
+++ b/indra/newview/llvotree.h
@@ -152,7 +152,6 @@ class LLVOTree : public LLViewerObject
 	friend class LLDrawPoolTree;
 protected:
 	LLVector3		mTrunkBend;		// Accumulated wind (used for blowing trees)
-	LLVector3		mTrunkVel;		// 
 	LLVector3		mWind;
 
 	LLPointer<LLVertexBuffer> mReferenceBuffer; //reference geometry for generating tree mesh
-- 
GitLab


From e09f8e651a87e92a64c49bf0107dc7fee80bc5ef Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 23 Nov 2011 13:44:56 -0800
Subject: [PATCH 287/933] SH-2712 FIX -- added caching to isFullyLoaded

---
 indra/newview/llvoavatar.cpp | 8 +++-----
 indra/newview/llvoavatar.h   | 3 +++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a3550000df8..d69d1a79625 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -690,7 +690,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
 	mFullyLoadedInitialized(FALSE),
 	mSupportsAlphaLayers(FALSE),
 	mLoadedCallbacksPaused(FALSE),
-	mHasPelvisOffset( FALSE )
+	mHasPelvisOffset( FALSE ),
+	mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar"))
 {
 	LLMemType mt(LLMemType::MTYPE_AVATAR);
 	//VTResume();  // VTune
@@ -6493,10 +6494,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
 
 BOOL LLVOAvatar::isFullyLoaded() const
 {
-	if (gSavedSettings.getBOOL("RenderUnloadedAvatar"))
-		return TRUE;
-	else
-		return mFullyLoaded;
+	return (mRenderUnloadedAvatar || mFullyLoaded);
 }
 
 bool LLVOAvatar::isTooComplex() const
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index e53b8e3f4bf..59796370ae6 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -40,6 +40,7 @@
 #include "lldrawpoolalpha.h"
 #include "llviewerobject.h"
 #include "llcharacter.h"
+#include "llcontrol.h"
 #include "llviewerjointmesh.h"
 #include "llviewerjointattachment.h"
 #include "llrendertarget.h"
@@ -450,6 +451,8 @@ class LLVOAvatar :
 	F32			mImpostorDistance;
 	F32			mImpostorPixelArea;
 	LLVector3	mLastAnimExtents[2];  
+	
+	LLCachedControl<bool> mRenderUnloadedAvatar;
 
 	//--------------------------------------------------------------------
 	// Wind rippling in clothes
-- 
GitLab


From 2878b6d1da2820efb2ab50ff77a9f31f25ed5f6b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 23 Nov 2011 14:30:30 -0800
Subject: [PATCH 288/933] SH-2713 FIX -- modified code to call
 LLPipeline::refreshCachedSettings only when settings that could affect it are
 modified.

Reviewed by davep.
---
 indra/newview/llviewerdisplay.cpp |  4 --
 indra/newview/pipeline.cpp        | 95 ++++++++++++++++++++++++++++---
 indra/newview/pipeline.h          |  1 -
 3 files changed, 88 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3f0b5bf3fb9..cb40af70612 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -230,7 +230,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		glClear(GL_COLOR_BUFFER_BIT);
 		gViewerWindow->getWindow()->swapBuffers();
 		LLPipeline::refreshCachedSettings();
-		LLPipeline::refreshRenderDeferred();
 		gPipeline.resizeScreenTexture();
 		gResizeScreenTexture = FALSE;
 		gWindowResized = FALSE;
@@ -617,9 +616,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		//Increment drawable frame counter
 		LLDrawable::incrementVisible();
 
-		LLPipeline::refreshCachedSettings();
-		LLPipeline::refreshRenderDeferred();
-
 		LLSpatialGroup::sNoDelete = TRUE;
 		LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName();
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f3d5f948137..12bec908811 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -509,6 +509,92 @@ void LLPipeline::init()
 	mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0);
 	mDeferredVB->allocateBuffer(8, 0, true);
 	setLightingDetail(-1);
+	
+	//
+	// Update all settings to trigger a cached settings refresh
+	//
+
+	gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderUseFarClip")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderAvatarMaxVisible")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDelayVBUpdate")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	
+	gSavedSettings.getControl("UseOcclusion")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	
+	gSavedSettings.getControl("VertexShaderEnable")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderAvatarVP")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("WindLightUseAtmosShaders")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDeferredSunWash")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderFSAASamples")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderResolutionDivisor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderUIBuffer")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowDetail")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDeferredSSAO")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowResolutionScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderLocalLights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDelayCreation")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderAnimateRes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("FreezeTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("DebugBeaconLineWidth")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderHighlightBrightness")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderHighlightColor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderHighlightThickness")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSpotLightsInNondeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewAmbientColor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewDiffuse0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewSpecular0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewDiffuse1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewSpecular1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewDiffuse2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewSpecular2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewDirection0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewDirection1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("PreviewDirection2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowMinLuminance")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowMaxExtractAlpha")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowWarmthAmount")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowLumWeights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowWarmthWeights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowResolutionPow")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowIterations")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowWidth")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderGlowStrength")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDepthOfField")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraFocusTransitionTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraFNumber")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraFocalLength")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraFieldOfView")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowNoise")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowBlurSize")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSSAOScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSSAOMaxScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSSAOFactor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSSAOEffect")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowOffsetError")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowBiasError")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowBias")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSpotShadowOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderSpotShadowBias")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderEdgeDepthCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderEdgeNormCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowGaussian")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowBlurDistFactor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderDeferredAtmospheric")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderReflectionDetail")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderHighlightFadeTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowClipPlanes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowOrthoClipPlanes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowNearDist")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderFarClip")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowSplitExponent")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowErrorCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("RenderShadowFOVCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraMaxCoF")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
+	gSavedSettings.getControl("CameraDoFResScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
 }
 
 LLPipeline::~LLPipeline()
@@ -707,7 +793,6 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
 bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 {
 	refreshCachedSettings();
-	refreshRenderDeferred();
 
 	// remember these dimensions
 	mScreenWidth = resX;
@@ -839,12 +924,6 @@ void LLPipeline::updateRenderDeferred()
 	}
 }
 
-//static
-void LLPipeline::refreshRenderDeferred()
-{
-	updateRenderDeferred();
-}
-
 //static
 void LLPipeline::refreshCachedSettings()
 {
@@ -933,6 +1012,8 @@ void LLPipeline::refreshCachedSettings()
 	CameraOffset = gSavedSettings.getBOOL("CameraOffset");
 	CameraMaxCoF = gSavedSettings.getF32("CameraMaxCoF");
 	CameraDoFResScale = gSavedSettings.getF32("CameraDoFResScale");
+	
+	updateRenderDeferred();
 }
 
 void LLPipeline::releaseGLBuffers()
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index c6b2e20fa53..2815d736e4a 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -359,7 +359,6 @@ class LLPipeline
 	static BOOL getRenderHighlights(void* data);
 
 	static void updateRenderDeferred();
-	static void refreshRenderDeferred();
 	static void refreshCachedSettings();
 
 	static void throttleNewMemoryAllocation(BOOL disable);
-- 
GitLab


From 413cd15f070c6c0406026c96e0b70698120366ef Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Thu, 24 Nov 2011 12:48:17 +0000
Subject: [PATCH 289/933] Fixed accidental change to HELLO_WORLD script.

---
 indra/newview/llpreviewscript.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 16b582d1889..0a429269ba7 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -90,15 +90,15 @@
 const std::string HELLO_LSL =
 	"default\n"
 	"{\n"
-	"\tstate_entry()\n"
-    "\t{\n"
-    "\t\tllOwnerSay(\"Hello, Avatar!\");\n"
-    "\t}\n"
+	"	state_entry()\n"
+    "	{\n"
+    "		llOwnerSay(\"Hello, Avatar!\");\n"
+    "	}\n"
 	"\n"
-	"\ttouch_start(integer total_number)\n"
-	"\t{\n"
-	"\t\tllSay(llDetectedKey(0), \"Touched.\");\n"
-	"\t}\n"
+	"	touch_start(integer total_number)\n"
+	"	{\n"
+	"		llSay(llDetectedKey(0), \"Touched.\");\n"
+	"	}\n"
 	"}\n";
 const std::string HELP_LSL_PORTAL_TOPIC = "LSL_Portal";
 
-- 
GitLab


From fd669e7341a62c81dd1981cecb4cd00cd3448dd5 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 24 Nov 2011 17:19:36 +0200
Subject: [PATCH 290/933] EXP-1581 FOLLOWUP Main menu: fixed a typo, removed
 duplicated items.

---
 indra/newview/llviewermenu.cpp                | 21 -------------------
 .../skins/default/xui/en/menu_viewer.xml      | 20 +-----------------
 2 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 5056954ffb4..74a43b66fa6 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7803,24 +7803,6 @@ class LLWorldPostProcess : public view_listener_t
 	}
 };
 
-class LLWorldToggleMovementControls : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		LLFloaterReg::toggleInstanceOrBringToFront("moveview");
-		return true;
-	}
-};
-
-class LLWorldToggleCameraControls : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		LLFloaterReg::toggleInstanceOrBringToFront("camera");
-		return true;
-	}
-};
-
 void handle_flush_name_caches()
 {
 	// Toggle display names on and off to flush
@@ -8044,9 +8026,6 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset");
 	view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess");
 
-	view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls");
-	view_listener_t::addMenu(new LLWorldToggleCameraControls(), "World.Toggle.CameraControls");
-
 	// Tools menu
 	view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool");
 	view_listener_t::addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects");
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 3e779782e80..8e9e555c52a 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -170,7 +170,7 @@
          function="BuyCurrency" />
       </menu_item_call>
       <menu_item_call
-           label="Accout dashboard..."
+           label="Account dashboard..."
            name="Manage My Account">
         <menu_item_call.on_click
          function="PromptShowURL"
@@ -434,24 +434,6 @@
            label="Show"
            name="LandShow"
            tear_off="true">
-         <menu_item_check
-         label="Move Controls"
-         name="Movement Controls">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="moveview" />
-            <menu_item_check.on_click
-             function="World.Toggle.MovementControls" />
-        </menu_item_check>
-        <menu_item_check
-         label="View Controls"
-         name="Camera Controls">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="camera" />
-            <menu_item_check.on_click
-             function="World.Toggle.CameraControls" />
-        </menu_item_check>
           <menu_item_check
              label="Ban Lines"
              name="Ban Lines">
-- 
GitLab


From c577966d198889730cc1b4f4d43ec9c4865c47f6 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 24 Nov 2011 19:37:59 +0200
Subject: [PATCH 291/933] EXP-1631 FIXED (Selecting Edit for more than one Pick
 from Profile floater, breaks the navigation history in Picks Floater)

- Allowed to create a new instance of LLPanelPickEdit for each pick
---
 indra/newview/llpanelpicks.cpp | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 244108162b6..cfbc8f1a94d 100755
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -1069,14 +1069,11 @@ void LLPanelPicks::createClassifiedEditPanel(LLPanelClassifiedEdit** panel)
 
 void LLPanelPicks::createPickEditPanel()
 {
-	if(!mPanelPickEdit)
-	{
-		mPanelPickEdit = LLPanelPickEdit::create();
-		mPanelPickEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit));
-		mPanelPickEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelPickSave, this, mPanelPickEdit));
-		mPanelPickEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit));
-		mPanelPickEdit->setVisible(FALSE);
-	}
+	mPanelPickEdit = LLPanelPickEdit::create();
+	mPanelPickEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit));
+	mPanelPickEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelPickSave, this, mPanelPickEdit));
+	mPanelPickEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit));
+	mPanelPickEdit->setVisible(FALSE);
 }
 
 // void LLPanelPicks::openPickEditPanel(LLPickItem* pick)
-- 
GitLab


From 8a442d5edb9074fa76856fc739b362a7374bc1cf Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 25 Nov 2011 19:24:47 +0200
Subject: [PATCH 292/933] EXP-1463 FIXED (IM chiclets overlay Mini-Location
 bar)

- Now chiclet bar adjusts its width with Mini-Location bar
---
 indra/newview/llchicletbar.cpp      | 32 +++++++++++++++++++++++++++++
 indra/newview/llchicletbar.h        |  6 ++++++
 indra/newview/llpaneltopinfobar.cpp | 18 ++++++++++++++++
 indra/newview/llpaneltopinfobar.h   |  6 ++++++
 4 files changed, 62 insertions(+)

diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index a17e1d13f57..1bd5a571a56 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -35,6 +35,7 @@
 // newview includes
 #include "llchiclet.h"
 #include "llimfloater.h" // for LLIMFloater
+#include "llpaneltopinfobar.h"
 #include "llsyswellwindow.h"
 
 namespace
@@ -181,6 +182,9 @@ BOOL LLChicletBar::postBuild()
 	showWellButton("im_well", !LLIMWellWindow::getInstance()->isWindowEmpty());
 	showWellButton("notification_well", !LLNotificationWellWindow::getInstance()->isWindowEmpty());
 
+	LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
+	LLPanelTopInfoBar::instance().setVisibleCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
+
 	return TRUE;
 }
 
@@ -338,3 +342,31 @@ S32 LLChicletBar::getChicletPanelShrinkHeadroom() const
 	llassert(shrink_headroom >= 0); // the panel cannot get narrower than the minimum
 	return shrink_headroom;
 }
+
+void LLChicletBar::fitWithTopInfoBar()
+{
+	LLPanelTopInfoBar& top_info_bar = LLPanelTopInfoBar::instance();
+
+	LLRect rect = getRect();
+	S32 width = rect.getWidth();
+
+	if (top_info_bar.getVisible())
+	{
+		S32 delta = top_info_bar.calcScreenRect().mRight - calcScreenRect().mLeft;
+		rect.setLeftTopAndSize(rect.mLeft + delta, rect.mTop, rect.getWidth(), rect.getHeight());
+		width = rect.getWidth() - delta;
+	}
+	else
+	{
+		LLView* parent = getParent();
+		if (parent)
+		{
+			LLRect parent_rect = parent->getRect();
+			rect.setLeftTopAndSize(0, rect.mTop, rect.getWidth(), rect.getHeight());
+			width = parent_rect.getWidth();
+		}
+	}
+
+	setRect(rect);
+	LLPanel::reshape(width, rect.getHeight(), false);
+}
diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h
index 224dfbb6470..1427bf95e0f 100644
--- a/indra/newview/llchicletbar.h
+++ b/indra/newview/llchicletbar.h
@@ -89,6 +89,12 @@ class LLChicletBar
 	 */
 	S32 getChicletPanelShrinkHeadroom() const;
 
+	/**
+	 * function adjusts Chiclet bar width to prevent overlapping with Mini-Location bar
+	 * EXP-1463
+	 */
+	void fitWithTopInfoBar();
+
 protected:
 	LLChicletBar(const LLSD& key = LLSD());
 
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 5ed23d2f425..eb4c7572d43 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -203,6 +203,11 @@ void LLPanelTopInfoBar::onVisibilityChange(const LLSD& show)
 	gFloaterView->setMinimizePositionVerticalOffset(minimize_pos_offset);
 }
 
+boost::signals2::connection LLPanelTopInfoBar::setResizeCallback( const resize_signal_t::slot_type& cb )
+{
+	return mResizeSignal.connect(cb);
+}
+
 void LLPanelTopInfoBar::draw()
 {
 	updateParcelInfoText();
@@ -224,6 +229,7 @@ void LLPanelTopInfoBar::buildLocationString(std::string& loc_str, bool show_coor
 
 void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text)
 {
+	LLRect old_rect = getRect();
 	const LLFontGL* font = mParcelInfoText->getDefaultFont();
 	S32 new_text_width = font->getWidth(new_text);
 
@@ -235,6 +241,11 @@ void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text)
 	mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE);
 	mParcelInfoText->setRect(rect);
 	layoutParcelIcons();
+
+	if (old_rect != getRect())
+	{
+		mResizeSignal();
+	}
 }
 
 void LLPanelTopInfoBar::update()
@@ -342,6 +353,8 @@ void LLPanelTopInfoBar::updateHealth()
 
 void LLPanelTopInfoBar::layoutParcelIcons()
 {
+	LLRect old_rect = getRect();
+
 	// TODO: remove hard-coded values and read them as xml parameters
 	static const int FIRST_ICON_HPAD = 32;
 	static const int LAST_ICON_HPAD = 11;
@@ -358,6 +371,11 @@ void LLPanelTopInfoBar::layoutParcelIcons()
 	LLRect rect = getRect();
 	rect.set(rect.mLeft, rect.mTop, left + LAST_ICON_HPAD, rect.mBottom);
 	setRect(rect);
+
+	if (old_rect != getRect())
+	{
+		mResizeSignal();
+	}
 }
 
 S32 LLPanelTopInfoBar::layoutWidget(LLUICtrl* ctrl, S32 left)
diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h
index e934b522bed..d58d95be900 100644
--- a/indra/newview/llpaneltopinfobar.h
+++ b/indra/newview/llpaneltopinfobar.h
@@ -41,6 +41,8 @@ class LLPanelTopInfoBar : public LLPanel, public LLSingleton<LLPanelTopInfoBar>,
 	friend class LLDestroyClass<LLPanelTopInfoBar>;
 
 public:
+	typedef boost::signals2::signal<void ()> resize_signal_t;
+
 	LLPanelTopInfoBar();
 	~LLPanelTopInfoBar();
 
@@ -57,6 +59,8 @@ class LLPanelTopInfoBar : public LLPanel, public LLSingleton<LLPanelTopInfoBar>,
 	 */
 	void onVisibilityChange(const LLSD& show);
 
+	boost::signals2::connection setResizeCallback( const resize_signal_t::slot_type& cb );
+
 private:
 	class LLParcelChangeObserver;
 
@@ -167,6 +171,8 @@ class LLPanelTopInfoBar : public LLPanel, public LLSingleton<LLPanelTopInfoBar>,
 	boost::signals2::connection	mParcelPropsCtrlConnection;
 	boost::signals2::connection	mShowCoordsCtrlConnection;
 	boost::signals2::connection	mParcelMgrConnection;
+
+	resize_signal_t mResizeSignal;
 };
 
 #endif /* LLPANELTOPINFOBAR_H_ */
-- 
GitLab


From 61570bf84fdf5edad1e34188111d551b262c67e8 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Sat, 26 Nov 2011 21:14:33 -0800
Subject: [PATCH 293/933] changed RelWithDebInfo config on Windows to not
 auto-inline, for easier debugging.

---
 indra/cmake/00-Common.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 0266239454c..41656486d59 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -46,7 +46,7 @@ if (WINDOWS)
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
       CACHE STRING "C++ compiler debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO 
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob2 -D_SECURE_STL=0"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
       "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
-- 
GitLab


From 2851cd519338ef4a1fde15da8d4015ab4380d6cb Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 28 Nov 2011 11:33:49 -0700
Subject: [PATCH 294/933] a try fix for sh-2651: [crashhunters] Crash after
 google translate failure and sh-2658: crash in LLPluginMessage::parse

---
 indra/llprimitive/llvolumexml.cpp | 19 +++++++++++--------
 indra/llprimitive/llvolumexml.h   |  6 +++---
 indra/llui/llui.cpp               |  7 +++++--
 indra/llxml/llxmlnode.cpp         |  8 ++++----
 indra/llxuixml/llxuiparser.cpp    |  1 +
 indra/newview/llvoicevivox.cpp    |  1 -
 6 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/indra/llprimitive/llvolumexml.cpp b/indra/llprimitive/llvolumexml.cpp
index f4f9d4d713f..bf2297a0299 100644
--- a/indra/llprimitive/llvolumexml.cpp
+++ b/indra/llprimitive/llvolumexml.cpp
@@ -34,9 +34,9 @@
 
 //============================================================================
 
-LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params)
+LLPointer<LLXMLNode> LLVolumeXml::exportProfileParams(const LLProfileParams* params)
 {
-	LLXMLNode *ret = new LLXMLNode("profile", FALSE);
+	LLPointer<LLXMLNode> ret = new LLXMLNode("profile", FALSE);
 
 	ret->createChild("curve_type", TRUE)->setByteValue(1, &params->getCurveType());
 	ret->createChild("interval", FALSE)->setFloatValue(2, &params->getBegin());
@@ -46,9 +46,9 @@ LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params)
 }
 
 
-LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params)
+LLPointer<LLXMLNode> LLVolumeXml::exportPathParams(const LLPathParams* params)
 {
-	LLXMLNode *ret = new LLXMLNode("path", FALSE); 
+	LLPointer<LLXMLNode> ret = new LLXMLNode("path", FALSE); 
 	ret->createChild("curve_type", TRUE)->setByteValue(1, &params->getCurveType());
 	ret->createChild("interval", FALSE)->setFloatValue(2, &params->getBegin());
 	ret->createChild("scale", FALSE)->setFloatValue(2, params->getScale().mV);
@@ -63,12 +63,15 @@ LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params)
 }
 
 
-LLXMLNode *LLVolumeXml::exportVolumeParams(const LLVolumeParams* params)
+LLPointer<LLXMLNode> LLVolumeXml::exportVolumeParams(const LLVolumeParams* params)
 {
-	LLXMLNode *ret = new LLXMLNode("shape", FALSE);
+	LLPointer<LLXMLNode> ret = new LLXMLNode("shape", FALSE);
 	
-	exportPathParams(&params->getPathParams())->setParent(ret);
-	exportProfileParams(&params->getProfileParams())->setParent(ret);
+	LLPointer<LLXMLNode> node ;
+	node = exportPathParams(&params->getPathParams()) ;
+	node->setParent(ret);
+	node = exportProfileParams(&params->getProfileParams()) ;
+	node->setParent(ret);
 
 	return ret;
 }
diff --git a/indra/llprimitive/llvolumexml.h b/indra/llprimitive/llvolumexml.h
index 5e79205d9a6..9d4d989475d 100644
--- a/indra/llprimitive/llvolumexml.h
+++ b/indra/llprimitive/llvolumexml.h
@@ -34,11 +34,11 @@
 class LLVolumeXml
 {
 public:
-	static LLXMLNode* exportProfileParams(const LLProfileParams* params);
+	static LLPointer<LLXMLNode> exportProfileParams(const LLProfileParams* params);
 
-	static LLXMLNode* exportPathParams(const LLPathParams* params);
+	static LLPointer<LLXMLNode> exportPathParams(const LLPathParams* params);
 
-	static LLXMLNode* exportVolumeParams(const LLVolumeParams* params);
+	static LLPointer<LLXMLNode> exportVolumeParams(const LLVolumeParams* params);
 };
 
 #endif // LL_LLVOLUMEXML_H
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 79ad99a7704..69461ec099b 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1823,9 +1823,12 @@ void LLUI::setupPaths()
 	LLXMLNodePtr root;
 	BOOL success  = LLXMLNode::parseFile(filename, root, NULL);
 	Paths paths;
-	LLXUIParser parser;
-	parser.readXUI(root, paths, filename);
 
+	if(success)
+	{
+		LLXUIParser parser;
+		parser.readXUI(root, paths, filename);
+	}
 	sXUIPaths.clear();
 	
 	if (success && paths.validateBlock())
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 4362c88c4ec..2b4a0fc2a1e 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -693,7 +693,7 @@ bool LLXMLNode::parseFile(const std::string& filename, LLXMLNodePtr& node, LLXML
 	LLFILE* fp = LLFile::fopen(filename, "rb");		/* Flawfinder: ignore */
 	if (fp == NULL)
 	{
-		node = new LLXMLNode();
+		node = NULL ;
 		return false;
 	}
 	fseek(fp, 0, SEEK_END);
@@ -746,7 +746,7 @@ bool LLXMLNode::parseBuffer(
 	{
 		llwarns << "Parse failure - wrong number of top-level nodes xml."
 				<< llendl;
-		node = new LLXMLNode();
+		node = NULL ;
 		return false;
 	}
 
@@ -805,7 +805,7 @@ bool LLXMLNode::parseStream(
 	{
 		llwarns << "Parse failure - wrong number of top-level nodes xml."
 				<< llendl;
-		node = new LLXMLNode();
+		node = NULL;
 		return false;
 	}
 
@@ -1206,7 +1206,7 @@ bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOO
 	{
 		return mDefault->getChild(name, node, FALSE);
 	}
-	node = new LLXMLNode();
+	node = NULL;
 	return false;
 }
 
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 878f9921783..5a525f84a80 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -1247,6 +1247,7 @@ bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBl
 	if( !file.isOpen() )
 	{
 		LL_WARNS("ReadXUI") << "Unable to open file " << filename << LL_ENDL;
+		XML_ParserFree( mParser );
 		return false;
 	}
 
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 8ecf4a80b78..2d7437f4f3b 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -7020,7 +7020,6 @@ void LLVivoxVoiceClient::captureBufferPlayStopSendMessage()
 
 LLVivoxProtocolParser::LLVivoxProtocolParser()
 {
-	parser = NULL;
 	parser = XML_ParserCreate(NULL);
 	
 	reset();
-- 
GitLab


From 20221c8e77824068d4a54885f5c57ace1c9660a2 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 12:51:15 -0800
Subject: [PATCH 295/933] EXP-1485 FIX -- Viewer should have a minimum size
 moved min size logic into LLWindow

---
 indra/llwindow/llwindow.cpp                | 25 +++++++-
 indra/llwindow/llwindow.h                  |  8 ++-
 indra/llwindow/llwindowheadless.h          |  2 +-
 indra/llwindow/llwindowmacosx.cpp          |  2 +-
 indra/llwindow/llwindowmacosx.h            |  2 +-
 indra/llwindow/llwindowmesaheadless.h      |  2 +-
 indra/llwindow/llwindowsdl.cpp             |  2 +-
 indra/llwindow/llwindowsdl.h               |  2 +-
 indra/llwindow/llwindowwin32.cpp           |  2 +-
 indra/llwindow/llwindowwin32.h             |  2 +-
 indra/newview/llappviewer.cpp              | 30 +++++-----
 indra/newview/llfloaterwindowsize.cpp      | 35 +----------
 indra/newview/llfloaterwindowsize.h        | 22 +++++--
 indra/newview/llviewerfloaterreg.cpp       |  2 +-
 indra/newview/llviewerprecompiledheaders.h |  3 +
 indra/newview/llviewerwindow.cpp           | 70 ++++++++++------------
 indra/newview/llviewerwindow.h             | 19 +++++-
 17 files changed, 125 insertions(+), 105 deletions(-)

diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index a313885ca3b..4919605afdf 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -111,8 +111,8 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags)
 	  mCursorHidden(FALSE),
 	  mBusyCount(0),
 	  mIsMouseClipping(FALSE),
-	  mMinWindowWidth(1024),		// just a sanity check - actual minimum size is stored in settings.xml
-	  mMinWindowHeight(768),
+	  mMinWindowWidth(S32_MAX),		// just a sanity check - actual minimum size is stored in settings.xml
+	  mMinWindowHeight(S32_MAX),
 	  mSwapMethod(SWAP_METHOD_UNDEFINED),
 	  mHideCursorPermanent(FALSE),
 	  mFlags(flags),
@@ -181,11 +181,32 @@ void *LLWindow::getMediaWindow()
 	return getPlatformWindow();
 }
 
+BOOL LLWindow::setSize(LLCoordScreen size)
+{
+	if (!getMaximized())
+	{
+		size.mX = llmin(size.mX, mMinWindowWidth);
+		size.mY = llmin(size.mY, mMinWindowHeight);
+	}
+	return setSizeImpl(size);
+}
+
+
 // virtual
 void LLWindow::setMinSize(U32 min_width, U32 min_height)
 {
 	mMinWindowWidth = min_width;
 	mMinWindowHeight = min_height;
+
+	LLCoordScreen cur_size;
+	if (!getMaximized() && getSize(&cur_size))
+	{
+		if (cur_size.mX < mMinWindowWidth || cur_size.mY < mMinWindowHeight)
+		{
+			setSizeImpl(LLCoordScreen(llmin(cur_size.mX, mMinWindowWidth), llmin(cur_size.mY, mMinWindowHeight)));
+		}
+	}
+
 }
 
 //virtual
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index b2c2628ec4f..77a9e88287d 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -72,7 +72,7 @@ class LLWindow
 	virtual BOOL getSize(LLCoordScreen *size) = 0;
 	virtual BOOL getSize(LLCoordWindow *size) = 0;
 	virtual BOOL setPosition(LLCoordScreen position) = 0;
-	virtual BOOL setSize(LLCoordScreen size) = 0;
+	BOOL setSize(LLCoordScreen size);
 	virtual void setMinSize(U32 min_width, U32 min_height);
 	virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0;
 	virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
@@ -170,6 +170,8 @@ class LLWindow
 	// Defaults to true
 	virtual BOOL canDelete();
 
+	virtual BOOL setSizeImpl(LLCoordScreen size) = 0;
+
 protected:
 	LLWindowCallbacks*	mCallbacks;
 
@@ -189,8 +191,8 @@ class LLWindow
 	BOOL		mHideCursorPermanent;
 	U32			mFlags;
 	U16			mHighSurrogate;
-	U32			mMinWindowWidth;
-	U32			mMinWindowHeight;
+	S32			mMinWindowWidth;
+	S32			mMinWindowHeight;
 
  	// Handle a UTF-16 encoding unit received from keyboard.
  	// Converting the series of UTF-16 encoding units to UTF-32 data,
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index ac53e6a86ee..01f1d4fcd34 100644
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -46,7 +46,7 @@ class LLWindowHeadless : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;};
 	/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
 	/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
-	/*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;};
+	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index c48c3564b2a..505e20278d1 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1254,7 +1254,7 @@ BOOL LLWindowMacOSX::setPosition(const LLCoordScreen position)
 	return TRUE;
 }
 
-BOOL LLWindowMacOSX::setSize(const LLCoordScreen size)
+BOOL LLWindowMacOSX::setSizeImpl(const LLCoordScreen size)
 {
 	if(mWindow)
 	{
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 6c9e075a219..b3010cee24c 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -58,7 +58,7 @@ class LLWindowMacOSX : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordScreen *size);
 	/*virtual*/ BOOL getSize(LLCoordWindow *size);
 	/*virtual*/ BOOL setPosition(LLCoordScreen position);
-	/*virtual*/ BOOL setSize(LLCoordScreen size);
+	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index fd4bd635e2e..45f96d2a0cc 100644
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -50,7 +50,7 @@ class LLWindowMesaHeadless : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;};
 	/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
 	/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
-	/*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;};
+	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index da2222ad512..c75b6c2dce2 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -966,7 +966,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
 	return TRUE;
 }
 
-BOOL LLWindowSDL::setSize(const LLCoordScreen size)
+BOOL LLWindowSDL::setSizeImpl(const LLCoordScreen size)
 {
 	if(mWindow)
 	{
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index fa544b16cef..03dbfc22e01 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -63,7 +63,7 @@ class LLWindowSDL : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordScreen *size);
 	/*virtual*/ BOOL getSize(LLCoordWindow *size);
 	/*virtual*/ BOOL setPosition(LLCoordScreen position);
-	/*virtual*/ BOOL setSize(LLCoordScreen size);
+	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 06360d261fc..34b1184cee8 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -861,7 +861,7 @@ BOOL LLWindowWin32::setPosition(const LLCoordScreen position)
 	return TRUE;
 }
 
-BOOL LLWindowWin32::setSize(const LLCoordScreen size)
+BOOL LLWindowWin32::setSizeImpl(const LLCoordScreen size)
 {
 	LLCoordScreen position;
 
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 387e4cbdb65..fa4a0ec1d35 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -57,7 +57,7 @@ class LLWindowWin32 : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordScreen *size);
 	/*virtual*/ BOOL getSize(LLCoordWindow *size);
 	/*virtual*/ BOOL setPosition(LLCoordScreen position);
-	/*virtual*/ BOOL setSize(LLCoordScreen size);
+	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9b8f5c59612..106b2727674 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2861,22 +2861,20 @@ bool LLAppViewer::initWindow()
 	// always start windowed
 	BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
 
-	// clamp to minimum window size
-	U32 min_window_width=gSavedSettings.getU32("MinWindowWidth");
-	U32 window_width=gSavedSettings.getU32("WindowWidth");
-	if ( window_width < min_window_width )
-		window_width=min_window_width;
-
-	U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
-	U32 window_height=gSavedSettings.getU32("WindowHeight");
-	if ( window_height < min_window_height )
-		window_height=min_window_height;
-
-	gViewerWindow = new LLViewerWindow(gWindowTitle, 
-		VIEWER_WINDOW_CLASSNAME,
-		gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"),
-		window_width, window_height,
-		gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth);
+	LLViewerWindow::Params window_params;
+	window_params
+		.title(gWindowTitle)
+		.name(VIEWER_WINDOW_CLASSNAME)
+		.x(gSavedSettings.getS32("WindowX"))
+		.y(gSavedSettings.getS32("WindowY"))
+		.width(gSavedSettings.getU32("WindowWidth"))
+		.height(gSavedSettings.getU32("WindowHeight"))
+		.min_width(gSavedSettings.getU32("MinWindowWidth"))
+		.min_height(gSavedSettings.getU32("MinWindowHeight"))
+		.fullscreen(gSavedSettings.getBOOL("WindowFullScreen"))
+		.ignore_pixel_depth(ignorePixelDepth);
+
+	gViewerWindow = new LLViewerWindow(window_params);
 
 	LL_INFOS("AppInit") << "gViewerwindow created." << LL_ENDL;
 
diff --git a/indra/newview/llfloaterwindowsize.cpp b/indra/newview/llfloaterwindowsize.cpp
index a70f2af11a1..ec161018b84 100644
--- a/indra/newview/llfloaterwindowsize.cpp
+++ b/indra/newview/llfloaterwindowsize.cpp
@@ -58,33 +58,12 @@ bool extractWindowSizeFromString(const std::string& instr, U32 *width, U32 *heig
 }
 
 
-///----------------------------------------------------------------------------
-/// Class LLFloaterWindowSize
-///----------------------------------------------------------------------------
-class LLFloaterWindowSize
-:	public LLFloater
-{
-	friend class LLFloaterReg;
-private:
-	LLFloaterWindowSize(const LLSD& key);
-	virtual ~LLFloaterWindowSize();
-
-public:
-	/*virtual*/ BOOL postBuild();
-	void initWindowSizeControls();
-	void onClickSet();
-	void onClickCancel();
-};
-
-
 LLFloaterWindowSize::LLFloaterWindowSize(const LLSD& key) 
 :	LLFloater(key)
-{
-}
+{}
 
 LLFloaterWindowSize::~LLFloaterWindowSize()
-{
-}
+{}
 
 BOOL LLFloaterWindowSize::postBuild()
 {
@@ -145,13 +124,3 @@ void LLFloaterWindowSize::onClickCancel()
 {
 	closeFloater();
 }
-
-///----------------------------------------------------------------------------
-/// LLFloaterWindowSizeUtil
-///----------------------------------------------------------------------------
-void LLFloaterWindowSizeUtil::registerFloater()
-{
-	LLFloaterReg::add("window_size", "floater_window_size.xml",
-		&LLFloaterReg::build<LLFloaterWindowSize>);
-
-}
diff --git a/indra/newview/llfloaterwindowsize.h b/indra/newview/llfloaterwindowsize.h
index 40f1a25bb3a..a71e5e273c9 100644
--- a/indra/newview/llfloaterwindowsize.h
+++ b/indra/newview/llfloaterwindowsize.h
@@ -26,10 +26,24 @@
 #ifndef LLFLOATERWINDOWSIZE_H
 #define LLFLOATERWINDOWSIZE_H
 
-// Allow user to set the window size for filming tutorials, machinima, etc
-namespace LLFloaterWindowSizeUtil
+#include "llfloater.h"
+
+///----------------------------------------------------------------------------
+/// Class LLFloaterWindowSize
+///----------------------------------------------------------------------------
+class LLFloaterWindowSize
+	:	public LLFloater
 {
-	void registerFloater();
-}
+	friend class LLFloaterReg;
+private:
+	LLFloaterWindowSize(const LLSD& key);
+	virtual ~LLFloaterWindowSize();
+
+public:
+	/*virtual*/ BOOL postBuild();
+	void initWindowSizeControls();
+	void onClickSet();
+	void onClickCancel();
+};
 
 #endif
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 0ec8cc1d4ea..acbc5f8fb6f 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -302,7 +302,7 @@ void LLViewerFloaterReg::registerFloaters()
 
 	LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);	
 	LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>);	
-	LLFloaterWindowSizeUtil::registerFloater();
+	LLFloaterReg::add("window_size", "floater_window_size.xml", &LLFloaterReg::build<LLFloaterWindowSize>);
 	LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>);	
 
 	// *NOTE: Please keep these alphabetized for easier merges
diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h
index 12f6a0dd1c6..f738b84bb9a 100644
--- a/indra/newview/llviewerprecompiledheaders.h
+++ b/indra/newview/llviewerprecompiledheaders.h
@@ -124,4 +124,7 @@
 // Library includes from llmessage project
 #include "llcachename.h"
 
+// Library includes from llxuixml
+#include "llinitparam.h"
+
 #endif
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 140cbb4e040..f24bab29a6d 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -838,6 +838,20 @@ void LLViewerWindow::updateDebugText()
 // LLViewerWindow
 //
 
+LLViewerWindow::Params::Params()
+:	title("title"),
+	name("name"),
+	x("x"),
+	y("y"),
+	width("width"),
+	height("height"),
+	min_width("min_width"),
+	min_height("min_height"),
+	fullscreen("fullscreen", false),
+	ignore_pixel_depth("ignore_pixel_depth", false)
+{}
+
+
 BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window,  LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down)
 {
 	const char* buttonname = "";
@@ -1531,18 +1545,13 @@ std::string LLViewerWindow::translateString(const char* tag,
 //
 // Classes
 //
-LLViewerWindow::LLViewerWindow(
-	const std::string& title, const std::string& name,
-	S32 x, S32 y,
-	S32 width, S32 height,
-	BOOL fullscreen, BOOL ignore_pixel_depth) // fullscreen is no longer used
-	:
-	mWindow(NULL),
+LLViewerWindow::LLViewerWindow(const Params& p)
+:	mWindow(NULL),
 	mActive(true),
 	mUIVisible(true),
-	mWindowRectRaw(0, height, width, 0),
-	mWindowRectScaled(0, height, width, 0),
-	mWorldViewRectRaw(0, height, width, 0),
+	mWindowRectRaw(0, p.height, p.width, 0),
+	mWindowRectScaled(0, p.height, p.width, 0),
+	mWorldViewRectRaw(0, p.height, p.width, 0),
 	mLeftMouseDown(FALSE),
 	mMiddleMouseDown(FALSE),
 	mRightMouseDown(FALSE),
@@ -1578,12 +1587,12 @@ LLViewerWindow::LLViewerWindow(
 
 	// create window
 	mWindow = LLWindowManager::createWindow(this,
-		title, name, x, y, width, height, 0,
-		fullscreen, 
+		p.title, p.name, p.x, p.y, p.width, p.height, 0,
+		p.fullscreen, 
 		gHeadlessClient,
 		gSavedSettings.getBOOL("DisableVerticalSync"),
 		!gHeadlessClient,
-		ignore_pixel_depth,
+		p.ignore_pixel_depth,
 		gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled
 
 	if (NULL == mWindow)
@@ -1610,10 +1619,11 @@ LLViewerWindow::LLViewerWindow(
 		LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL;
 	}
 
+	mWindow->setMinSize(p.min_width, p.min_height);
 	LLCoordScreen scr;
     mWindow->getSize(&scr);
 
-    if(fullscreen && ( scr.mX!=width || scr.mY!=height))
+    if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height))
     {
 		llwarns << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<llendl;
 		gSavedSettings.setS32("FullScreenWidth",scr.mX);
@@ -2157,21 +2167,11 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 		BOOL maximized = mWindow->getMaximized();
 		gSavedSettings.setBOOL("WindowMaximized", maximized);
 
-		LLCoordScreen window_size;
-		if (!maximized
-			&& mWindow->getSize(&window_size))
+		if (!maximized)
 		{
 			U32 min_window_width=gSavedSettings.getU32("MinWindowWidth");
-			if ( window_size.mX < min_window_width )
-				window_size.mX=min_window_width;
-			gSavedSettings.setU32("WindowWidth", window_size.mX);
-
 			U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
-			if ( window_size.mY < min_window_height )
-				window_size.mY=min_window_height;
-			gSavedSettings.setU32("WindowHeight", window_size.mY);
-
-			// tell the OS specific window code about min windoow size
+			// tell the OS specific window code about min window size
 			mWindow->setMinSize(min_window_width, min_window_height);
 		}
 
@@ -4099,25 +4099,21 @@ void LLViewerWindow::resetSnapshotLoc()
 	sSnapshotDir.clear();
 }
 
-static S32 BORDERHEIGHT = 0;
-static S32 BORDERWIDTH = 0;
-
 // static
 void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 {
-	LLCoordScreen size;
+	LLCoordWindow size;
 	gViewerWindow->getWindow()->getSize(&size);
-	if (  (size.mX != new_width + BORDERWIDTH)
-		||(size.mY != new_height + BORDERHEIGHT))
+	if ( size.mX != new_width
+		|| size.mY != new_height)
 	{
 		// use actual display dimensions, not virtual UI dimensions
 		S32 x = gViewerWindow->getWindowWidthRaw();
 		S32 y = gViewerWindow->getWindowHeightRaw();
-		BORDERWIDTH = size.mX - x;
-		BORDERHEIGHT = size.mY- y;
-		LLCoordScreen new_size(new_width + BORDERWIDTH, 
-							   new_height + BORDERHEIGHT);
-		gViewerWindow->getWindow()->setSize(new_size);
+		LLCoordWindow new_size(new_width, new_height);
+		LLCoordScreen screen_size;
+		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
+		gViewerWindow->getWindow()->setSize(screen_size);
 	}
 }
 
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 0cb7f82b585..6efcaeaf18a 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -44,6 +44,7 @@
 #include "llstat.h"
 #include "llmousehandler.h"
 #include "llhandle.h"
+#include "llinitparam.h"
 
 #include <boost/function.hpp>
 #include <boost/signals2.hpp>
@@ -133,7 +134,23 @@ class LLViewerWindow : public LLWindowCallbacks
 	//
 	// CREATORS
 	//
-	LLViewerWindow(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, BOOL fullscreen, BOOL ignore_pixel_depth);
+	struct Params : public LLInitParam::Block<Params>
+	{
+		Mandatory<std::string>		title,
+									name;
+		Mandatory<S32>				x,
+									y,
+									width,
+									height,
+									min_width,
+									min_height;
+		Optional<bool>				fullscreen,
+									ignore_pixel_depth;
+
+		Params();
+	};
+
+	LLViewerWindow(const Params& p);
 	virtual ~LLViewerWindow();
 
 	void			shutdownViews();
-- 
GitLab


From a3ab3909309b90ca99dad69b55ed4f98d68f795e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 14:35:17 -0800
Subject: [PATCH 296/933] simple code cleanup

---
 indra/newview/llviewerparcelmgr.cpp | 110 ++++++++++++++--------------
 1 file changed, 56 insertions(+), 54 deletions(-)

diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index d6002e7320f..4f66b63d348 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1457,6 +1457,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 
 	S32		other_clean_time = 0;
 
+	LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance();
+
 	msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result );
 	msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id );
 
@@ -1472,31 +1474,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 	if (sequence_id == SELECTED_PARCEL_SEQ_ID)
 	{
 		// ...selected parcels report this sequence id
-		LLViewerParcelMgr::getInstance()->mRequestResult = PARCEL_RESULT_SUCCESS;
-		parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel;
+		parcel_mgr.mRequestResult = PARCEL_RESULT_SUCCESS;
+		parcel = parcel_mgr.mCurrentParcel;
 	}
 	else if (sequence_id == HOVERED_PARCEL_SEQ_ID)
 	{
-		LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS;
-		parcel = LLViewerParcelMgr::getInstance()->mHoverParcel;
+		parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS;
+		parcel = parcel_mgr.mHoverParcel;
 	}
 	else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID ||
 			 sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID ||
 			 sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
 	{
-		LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS;
-		parcel = LLViewerParcelMgr::getInstance()->mCollisionParcel;
+		parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS;
+		parcel = parcel_mgr.mCollisionParcel;
 	}
-	else if (sequence_id == 0 || sequence_id > LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID)
+	else if (sequence_id == 0 || sequence_id > parcel_mgr.mAgentParcelSequenceID)
 	{
 		// new agent parcel
-		LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID = sequence_id;
-		parcel = LLViewerParcelMgr::getInstance()->mAgentParcel;
+		parcel_mgr.mAgentParcelSequenceID = sequence_id;
+		parcel = parcel_mgr.mAgentParcel;
 	}
 	else
 	{
 		llinfos << "out of order agent parcel sequence id " << sequence_id
-			<< " last good " << LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID
+			<< " last good " << parcel_mgr.mAgentParcelSequenceID
 			<< llendl;
 		return;
 	}
@@ -1567,15 +1569,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 		parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override);
 		parcel->unpackMessage(msg);
 
-		if (parcel == LLViewerParcelMgr::getInstance()->mAgentParcel)
+		if (parcel == parcel_mgr.mAgentParcel)
 		{
-			S32 bitmap_size =	LLViewerParcelMgr::getInstance()->mParcelsPerEdge
-								* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
+			S32 bitmap_size =	parcel_mgr.mParcelsPerEdge
+								* parcel_mgr.mParcelsPerEdge
 								/ 8;
 			U8* bitmap = new U8[ bitmap_size ];
 			msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
 
-			LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap);
+			parcel_mgr.writeAgentParcelFromBitmap(bitmap);
 			delete[] bitmap;
 
 			// Let interesting parties know about agent parcel change.
@@ -1595,11 +1597,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 	if (sequence_id == SELECTED_PARCEL_SEQ_ID)
 	{
 		// Update selected counts
-		LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedSelfCount = self_count;
-		LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedOtherCount = other_count;
-		LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedPublicCount = public_count;
+		parcel_mgr.mCurrentParcelSelection->mSelectedSelfCount = self_count;
+		parcel_mgr.mCurrentParcelSelection->mSelectedOtherCount = other_count;
+		parcel_mgr.mCurrentParcelSelection->mSelectedPublicCount = public_count;
 
-		LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedMultipleOwners =
+		parcel_mgr.mCurrentParcelSelection->mSelectedMultipleOwners =
 							(request_result == PARCEL_RESULT_MULTIPLE);
 
 		// Select the whole parcel
@@ -1610,67 +1612,67 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 			{
 				// don't muck with the westsouth and eastnorth.
 				// just highlight it
-				LLVector3 west_south = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mWestSouth);
-				LLVector3 east_north = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mEastNorth);
+				LLVector3 west_south = region->getPosRegionFromGlobal(parcel_mgr.mWestSouth);
+				LLVector3 east_north = region->getPosRegionFromGlobal(parcel_mgr.mEastNorth);
 
-				LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
-				LLViewerParcelMgr::getInstance()->writeHighlightSegments(
+				parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
+				parcel_mgr.writeHighlightSegments(
 								west_south.mV[VX],
 								west_south.mV[VY],
 								east_north.mV[VX],
 								east_north.mV[VY] );
-				LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = FALSE;
+				parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = FALSE;
 			}
 			else if (0 == local_id)
 			{
 				// this is public land, just highlight the selection
-				LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min );
-				LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max );
+				parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min );
+				parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max );
 
-				LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
-				LLViewerParcelMgr::getInstance()->writeHighlightSegments(
+				parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
+				parcel_mgr.writeHighlightSegments(
 								aabb_min.mV[VX],
 								aabb_min.mV[VY],
 								aabb_max.mV[VX],
 								aabb_max.mV[VY] );
-				LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
+				parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE;
 			}
 			else
 			{
-				LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min );
-				LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max );
+				parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min );
+				parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max );
 
 				// Owned land, highlight the boundaries
-				S32 bitmap_size =	LLViewerParcelMgr::getInstance()->mParcelsPerEdge
-									* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
+				S32 bitmap_size =	parcel_mgr.mParcelsPerEdge
+									* parcel_mgr.mParcelsPerEdge
 									/ 8;
 				U8* bitmap = new U8[ bitmap_size ];
 				msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
 
-				LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
-				LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mHighlightSegments );
+				parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
+				parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mHighlightSegments );
 
 				delete[] bitmap;
 				bitmap = NULL;
 
-				LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
+				parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE;
 			}
 
 			// Request access list information for this land
-			LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
+			parcel_mgr.sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
 
 			// Request the media url filter list for this land
-			LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter();
+			parcel_mgr.requestParcelMediaURLFilter();
 
 			// Request dwell for this land, if it's not public land.
-			LLViewerParcelMgr::getInstance()->mSelectedDwell = DWELL_NAN;
+			parcel_mgr.mSelectedDwell = DWELL_NAN;
 			if (0 != local_id)
 			{
-				LLViewerParcelMgr::getInstance()->sendParcelDwellRequest();
+				parcel_mgr.sendParcelDwellRequest();
 			}
 
-			LLViewerParcelMgr::getInstance()->mSelected = TRUE;
-			LLViewerParcelMgr::getInstance()->notifyObservers();
+			parcel_mgr.mSelected = TRUE;
+			parcel_mgr.notifyObservers();
 		}
 	}
 	else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID ||
@@ -1678,32 +1680,32 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 			 sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
 	{
 		// We're about to collide with this parcel
-		LLViewerParcelMgr::getInstance()->mRenderCollision = TRUE;
-		LLViewerParcelMgr::getInstance()->mCollisionTimer.reset();
+		parcel_mgr.mRenderCollision = TRUE;
+		parcel_mgr.mCollisionTimer.reset();
 
 		// Differentiate this parcel if we are banned from it.
 		if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
 		{
-			LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_BANNED;
+			parcel_mgr.mCollisionBanned = BA_BANNED;
 		}
 		else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID)
 		{
-			LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_IN_GROUP;
+			parcel_mgr.mCollisionBanned = BA_NOT_IN_GROUP;
 		}
 		else 
 		{
-			LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_ON_LIST;
+			parcel_mgr.mCollisionBanned = BA_NOT_ON_LIST;
 
 		}
 
-		S32 bitmap_size =	LLViewerParcelMgr::getInstance()->mParcelsPerEdge
-							* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
+		S32 bitmap_size =	parcel_mgr.mParcelsPerEdge
+							* parcel_mgr.mParcelsPerEdge
 							/ 8;
 		U8* bitmap = new U8[ bitmap_size ];
 		msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
 
-		LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mCollisionSegments);
-		LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mCollisionSegments );
+		parcel_mgr.resetSegments(parcel_mgr.mCollisionSegments);
+		parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments );
 
 		delete[] bitmap;
 		bitmap = NULL;
@@ -1714,13 +1716,13 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 		LLViewerRegion *region = LLWorld::getInstance()->getRegion( msg->getSender() );
 		if (region)
 		{
-			LLViewerParcelMgr::getInstance()->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min );
-			LLViewerParcelMgr::getInstance()->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max );
+			parcel_mgr.mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min );
+			parcel_mgr.mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max );
 		}
 		else
 		{
-			LLViewerParcelMgr::getInstance()->mHoverWestSouth.clearVec();
-			LLViewerParcelMgr::getInstance()->mHoverEastNorth.clearVec();
+			parcel_mgr.mHoverWestSouth.clearVec();
+			parcel_mgr.mHoverEastNorth.clearVec();
 		}
 	}
 	else
-- 
GitLab


From f5159294f1c67503a1137f1fe31a41954643a7d7 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 15:21:01 -0800
Subject: [PATCH 297/933] build fix

---
 indra/newview/llviewerwindow.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f24bab29a6d..2479006eeb7 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4107,9 +4107,6 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	if ( size.mX != new_width
 		|| size.mY != new_height)
 	{
-		// use actual display dimensions, not virtual UI dimensions
-		S32 x = gViewerWindow->getWindowWidthRaw();
-		S32 y = gViewerWindow->getWindowHeightRaw();
 		LLCoordWindow new_size(new_width, new_height);
 		LLCoordScreen screen_size;
 		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
-- 
GitLab


From 06a2d4eb274b1cd02b82bf2e5ffb458880ae8517 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 28 Nov 2011 17:13:42 -0800
Subject: [PATCH 298/933] SH-2038 PROGRESS -- Hacked the code to not render
 alpha using VBO's on OS X since everything renders faster using VBO's except
 alpha for some mysterious reason.

---
 indra/llrender/llshadermgr.cpp     | 54 +++++++++++++++++++-----------
 indra/newview/featuretable_mac.txt |  4 +--
 indra/newview/llvovolume.cpp       | 21 +++++++++---
 3 files changed, 52 insertions(+), 27 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index eea768a3eae..ac9dc9544d5 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -845,28 +845,42 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
 		LL_WARNS("ShaderLoading") << "GLSL Linker Error:" << LL_ENDL;
 	}
 
-// NOTE: Removing LL_DARWIN block as it doesn't seem to actually give the correct answer, 
-// but want it for reference once I move it.
-#if 0
-	// Force an evaluation of the gl state so the driver can tell if the shader will run in hardware or software
-	// per Apple's suggestion   
-	glBegin(gGL.mMode);
-	glEnd();
-
-	// Query whether the shader can or cannot run in hardware
-	// http://developer.apple.com/qa/qa2007/qa1502.html
-	long vertexGPUProcessing;
-	CGLContextObj ctx = CGLGetCurrentContext();
-	CGLGetParameter (ctx, kCGLCPGPUVertexProcessing, &vertexGPUProcessing);	
-	long fragmentGPUProcessing;
-	CGLGetParameter (ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing);
-	if (!fragmentGPUProcessing || !vertexGPUProcessing)
+#if LL_DARWIN
+
+	// For some reason this absolutely kills the frame rate when VBO's are enabled
+	if (0)
 	{
-		LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL;
-		success = GL_FALSE;
-		suppress_errors = FALSE;		
+		// Force an evaluation of the gl state so the driver can tell if the shader will run in hardware or software
+		// per Apple's suggestion
+		LLGLSLShader::sNoFixedFunction = false;
+		
+		glUseProgramObjectARB(obj);
+
+		gGL.begin(LLRender::TRIANGLES);
+		gGL.vertex3f(0.0f, 0.0f, 0.0f);
+		gGL.vertex3f(0.0f, 0.0f, 0.0f);
+		gGL.vertex3f(0.0f, 0.0f, 0.0f);
+		gGL.end();
+		gGL.flush();
+		
+		glUseProgramObjectARB(0);
+		
+		LLGLSLShader::sNoFixedFunction = true;
+
+		// Query whether the shader can or cannot run in hardware
+		// http://developer.apple.com/qa/qa2007/qa1502.html
+		GLint vertexGPUProcessing, fragmentGPUProcessing;
+		CGLContextObj ctx = CGLGetCurrentContext();
+		CGLGetParameter(ctx, kCGLCPGPUVertexProcessing, &vertexGPUProcessing);	
+		CGLGetParameter(ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing);
+		if (!fragmentGPUProcessing || !vertexGPUProcessing)
+		{
+			LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL;
+			success = GL_FALSE;
+			suppress_errors = FALSE;		
+		}
 	}
-	
+
 #else
 	std::string log = get_object_log(obj);
 	LLStringUtil::toLower(log);
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 390da2273d9..1e2fbc677d5 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
-version 31
+version 32
 // The version number above should be implemented IF AND ONLY IF some
 // change has been made that is sufficiently important to justify
 // resetting the graphics preferences of all users to the recommended
@@ -67,7 +67,7 @@ RenderDeferred				1	1
 RenderDeferredSSAO			1	1
 RenderShadowDetail			1	2
 WatchdogDisabled				1	1
-RenderUseStreamVBO			1	0
+RenderUseStreamVBO			1	1
 RenderFSAASamples			1	16
 RenderMaxTextureIndex		1	16
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3d013f286c6..20f86746550 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4624,6 +4624,19 @@ struct CompareBatchBreakerModified
 
 void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures)
 {
+	U32 buffer_usage = group->mBufferUsage;
+	
+#if LL_DARWIN
+	// HACK from Leslie:
+	// Disable VBO usage for alpha on Mac OS X because it kills the framerate
+	// due to implicit calls to glTexSubImage that are beyond our control.
+	// (this works because the only calls here that sort by distance are alpha)
+	if (distance_sort)
+	{
+		buffer_usage = 0x0;
+	}
+#endif
+	
 	//calculate maximum number of vertices to store in a single buffer
 	U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
 	max_vertices = llmin(max_vertices, (U32) 65535);
@@ -4805,17 +4818,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 						
 		if (!buffer)
 		{ //create new buffer if needed
-			buffer = createVertexBuffer(mask, 
-											group->mBufferUsage);
+			buffer = createVertexBuffer(mask, buffer_usage);
 			buffer->allocateBuffer(geom_count, index_count, TRUE);
 		}
 		else 
 		{ //resize pre-existing buffer
-			if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage ||
+			if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != buffer_usage ||
 				buffer->getTypeMask() != mask)
 			{
-				buffer = createVertexBuffer(mask, 
-											group->mBufferUsage);
+				buffer = createVertexBuffer(mask, buffer_usage);
 				buffer->allocateBuffer(geom_count, index_count, TRUE);
 			}
 			else
-- 
GitLab


From d089e6c26452a61fa3b33b71735bc39d90701865 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 19:16:49 -0800
Subject: [PATCH 299/933] bumped up MSVC warning level to 3 to catch more stuff
 that gcc catches

---
 indra/cmake/00-Common.cmake             | 4 ++--
 indra/llcommon/llpreprocessor.h         | 1 +
 indra/llplugin/llpluginclassmedia.h     | 2 +-
 indra/llplugin/llplugininstance.h       | 2 +-
 indra/llplugin/llpluginmessagepipe.h    | 2 +-
 indra/llplugin/llpluginprocessparent.h  | 2 +-
 indra/llprimitive/llmodel.cpp           | 9 ++++++++-
 indra/llrender/llvertexbuffer.cpp       | 2 +-
 indra/newview/llfloatermodelpreview.cpp | 8 ++++++++
 indra/newview/llviewerwindow.cpp        | 1 +
 indra/newview/llvovolume.cpp            | 2 +-
 indra/newview/llvovolume.h              | 6 ++++--
 12 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 0266239454c..98eeed09b3a 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -46,7 +46,7 @@ if (WINDOWS)
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
       CACHE STRING "C++ compiler debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO 
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob2 -D_SECURE_STL=0"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
       "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
@@ -62,7 +62,7 @@ if (WINDOWS)
       /D_UNICODE 
       /GS
       /TP
-      /W2
+      /W3
       /c
       /Zc:forScope
       /nologo
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 17a42875385..31d5f3d2c7e 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -151,6 +151,7 @@
 
 #pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
 #pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
+#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch	
 #endif	//	LL_MSVC
 
 #if LL_WINDOWS
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index d95fa400919..a0edd9f5f72 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -41,7 +41,7 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 	LOG_CLASS(LLPluginClassMedia);
 public:
 	LLPluginClassMedia(LLPluginClassMediaOwner *owner);
-	~LLPluginClassMedia();
+	virtual ~LLPluginClassMedia();
 
 	// local initialization, called by the media manager when creating a source
 	bool init(const std::string &launcher_filename, 
diff --git a/indra/llplugin/llplugininstance.h b/indra/llplugin/llplugininstance.h
index 3643a15d8c2..e6926c3e377 100644
--- a/indra/llplugin/llplugininstance.h
+++ b/indra/llplugin/llplugininstance.h
@@ -39,7 +39,7 @@
 class LLPluginInstanceMessageListener
 {
 public:
-	~LLPluginInstanceMessageListener();
+	virtual ~LLPluginInstanceMessageListener();
    /** Plugin receives message from plugin loader shell. */
 	virtual void receivePluginMessage(const std::string &message) = 0;
 };
diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h
index beb942c0fe0..c6f1686bf4f 100644
--- a/indra/llplugin/llpluginmessagepipe.h
+++ b/indra/llplugin/llpluginmessagepipe.h
@@ -40,7 +40,7 @@ class LLPluginMessagePipeOwner
 	LOG_CLASS(LLPluginMessagePipeOwner);
 public:
 	LLPluginMessagePipeOwner();
-	~LLPluginMessagePipeOwner();
+	virtual ~LLPluginMessagePipeOwner();
 
 	// called with incoming messages
 	virtual void receiveMessageRaw(const std::string &message) = 0;
diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h
index 26c6b0c4027..c66723f1753 100644
--- a/indra/llplugin/llpluginprocessparent.h
+++ b/indra/llplugin/llpluginprocessparent.h
@@ -41,7 +41,7 @@
 class LLPluginProcessParentOwner
 {
 public:
-	~LLPluginProcessParentOwner();
+	virtual ~LLPluginProcessParentOwner();
 	virtual void receivePluginMessage(const LLPluginMessage &message) = 0;
 	virtual bool receivePluginMessageEarly(const LLPluginMessage &message) {return false;};
 	// This will only be called when the plugin has died unexpectedly 
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 6e4bb7ec973..cb32a510b80 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -31,11 +31,18 @@
 #include "llconvexdecomposition.h"
 #include "llsdserialize.h"
 #include "llvector4a.h"
-
+#if LL_MSVC
+#pragma warning (disable : 4263)
+#pragma warning (disable : 4264)
+#endif
 #include "dae.h"
 #include "dae/daeErrorHandler.h"
 #include "dom/domConstants.h"
 #include "dom/domMesh.h"
+#if LL_MSVC
+#pragma warning (default : 4263)
+#pragma warning (default : 4264)
+#endif
 
 #ifdef LL_STANDALONE
 # include <zlib.h>
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 8fd11937801..ad2385dcf4f 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -84,7 +84,7 @@ class LLGLSyncFence : public LLGLFence
 #endif
 	}
 
-	~LLGLSyncFence()
+	virtual ~LLGLSyncFence()
 	{
 #ifdef GL_ARB_sync
 		if (mSync)
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 881f087d7b7..c716a7ecf7e 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -26,6 +26,10 @@
 
 #include "llviewerprecompiledheaders.h"
 
+#if LL_MSVC
+#pragma warning (disable : 4263)
+#pragma warning (disable : 4264)
+#endif
 #include "dae.h"
 //#include "dom.h"
 #include "dom/domAsset.h"
@@ -47,6 +51,10 @@
 #include "dom/domScale.h"
 #include "dom/domTranslate.h"
 #include "dom/domVisual_scene.h"
+#if LL_MSVC
+#pragma warning (default : 4263)
+#pragma warning (default : 4264)
+#endif
 
 #include "llfloatermodelpreview.h"
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 2479006eeb7..7bc4248053a 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4107,6 +4107,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	if ( size.mX != new_width
 		|| size.mY != new_height)
 	{
+		S32 x = 0;
 		LLCoordWindow new_size(new_width, new_height);
 		LLCoordScreen screen_size;
 		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 380d63c77b9..1bf991a3a92 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3266,7 +3266,7 @@ void LLVOVolume::updateRenderComplexity()
 	mRenderComplexity_current = 0;
 }
 
-U32 LLVOVolume::getTriangleCount() const
+U32 LLVOVolume::getTriangleCount()
 {
 	U32 count = 0;
 	LLVolume* volume = getVolume();
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index b6347526eee..22648ce46f8 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -131,9 +131,11 @@ class LLVOVolume : public LLViewerObject
 	/*virtual*/	const LLMatrix4	getRenderMatrix() const;
 				typedef std::map<LLUUID, S32> texture_cost_t;
 				U32 	getRenderCost(texture_cost_t &textures) const;
-	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
 
-	/*virtual*/ U32		getTriangleCount() const;
+				F32		getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const;
+	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL) { return getStreamingCost(bytes, visible_bytes, NULL); }
+
+	/*virtual*/ U32		getTriangleCount();
 	/*virtual*/ U32		getHighLODTriangleCount();
 	/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, 
 										  S32 face = -1,                        // which face to check, -1 = ALL_SIDES
-- 
GitLab


From 3001ad1a02f85e5e4f902e4a5973d4ccfcc689bb Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 28 Nov 2011 20:37:58 -0800
Subject: [PATCH 300/933] EXP-1596 : Fetch system folders so we're sure they
 are empty if we need to hide them

---
 indra/newview/llinventoryfilter.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index bc025402812..d54bce4619d 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -217,6 +217,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 			bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
 			if (is_hidden_if_empty)
 			{
+				// Force the fetching of those folders so they are hidden iff they really are empty...
+				gInventory.fetchDescendentsOf(object_id);
 				return FALSE;
 			}
 		}
-- 
GitLab


From 700277e00aa83506808f2128705143d7ae4937bd Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 22:30:12 -0800
Subject: [PATCH 301/933] removed unneeded changeversion tracking in param
 blocks in favor of a simpler dirty bit

---
 indra/llui/tests/llurlentry_stub.cpp |  3 --
 indra/llui/tests/llurlmatch_test.cpp |  5 --
 indra/llxuixml/llinitparam.cpp       | 20 +-------
 indra/llxuixml/llinitparam.h         | 74 +++++++++++++---------------
 4 files changed, 36 insertions(+), 66 deletions(-)

diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp
index 4f251db93bb..c75df868918 100644
--- a/indra/llui/tests/llurlentry_stub.cpp
+++ b/indra/llui/tests/llurlentry_stub.cpp
@@ -105,8 +105,6 @@ LLStyle::Params::Params()
 
 namespace LLInitParam
 {
-	BaseBlock::BaseBlock() {}
-	BaseBlock::~BaseBlock() {}
 	Param::Param(BaseBlock* enclosing_block)
 	:	mIsProvided(false)
 	{
@@ -114,7 +112,6 @@ namespace LLInitParam
 		const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block);
 		mEnclosingBlockOffset = (U16)(my_addr - block_addr);
 	}
-	void BaseBlock::paramChanged(const Param& last_param, bool user_provided) {}
 
 	void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name){}
 	void BaseBlock::addSynonym(Param& param, const std::string& synonym) {}
diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp
index 627f3129e93..7183413463f 100644
--- a/indra/llui/tests/llurlmatch_test.cpp
+++ b/indra/llui/tests/llurlmatch_test.cpp
@@ -63,9 +63,6 @@ S32 LLUIImage::getHeight() const
 
 namespace LLInitParam
 {
-	BaseBlock::BaseBlock() {}
-	BaseBlock::~BaseBlock() {}
-
 	BlockDescriptor::BlockDescriptor() {}
 	ParamDescriptor::ParamDescriptor(param_handle_t p, 
 						merge_func_t merge_func, 
@@ -77,8 +74,6 @@ namespace LLInitParam
 						S32 max_count){}
 	ParamDescriptor::~ParamDescriptor() {}
 
-	void BaseBlock::paramChanged(const Param& last_param, bool user_provided) {}
-
 	void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name){}
 	param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;}
 	void BaseBlock::addSynonym(Param& param, const std::string& synonym) {}
diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp
index 8880072f069..db72aa19b98 100644
--- a/indra/llxuixml/llinitparam.cpp
+++ b/indra/llxuixml/llinitparam.cpp
@@ -40,7 +40,7 @@ namespace LLInitParam
 	{
 		const U8* my_addr = reinterpret_cast<const U8*>(this);
 		const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block);
-		mEnclosingBlockOffset = 0x7FFFffff & ((U32)(my_addr - block_addr));
+		mEnclosingBlockOffset = 0x7FFFffff & (U32)(my_addr - block_addr);
 	}
 
 	//
@@ -118,16 +118,6 @@ namespace LLInitParam
 		mCurrentBlockPtr(NULL)
 	{}
 
-	//
-	// BaseBlock
-	//
-	BaseBlock::BaseBlock()
-	:	mChangeVersion(0)
-	{}
-
-	BaseBlock::~BaseBlock()
-	{}
-
 	// called by each derived class in least to most derived order
 	void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size)
 	{
@@ -427,14 +417,6 @@ namespace LLInitParam
 		}
 	}
 
-	void BaseBlock::paramChanged(const Param& changed_param, bool user_provided)
-	{ 
-		if (user_provided)
-		{
-			mChangeVersion++;
-		}
-	}
-
 	const std::string& BaseBlock::getParamName(const BlockDescriptor& block_data, const Param* paramp) const
 	{
 		param_handle_t handle = getHandleFromParam(paramp);
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 5ed3337c45c..80b6504c4f7 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -491,8 +491,7 @@ namespace LLInitParam
 		LOG_CLASS(BaseBlock);
 		friend class Param;
 
-		BaseBlock();
-		virtual ~BaseBlock();
+		virtual ~BaseBlock() {}
 		bool submitValue(Parser::name_stack_t& name_stack, Parser& p, bool silent=false);
 
 		param_handle_t getHandleFromParam(const Param* param) const;
@@ -515,9 +514,7 @@ namespace LLInitParam
 		void addSynonym(Param& param, const std::string& synonym);
 
 		// Blocks can override this to do custom tracking of changes
-		virtual void paramChanged(const Param& changed_param, bool user_provided);
-
-		S32 getLastChangeVersion() const { return mChangeVersion; }
+		virtual void paramChanged(const Param& changed_param, bool user_provided) {}
 
 		bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name);
 		void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const;
@@ -553,9 +550,6 @@ namespace LLInitParam
 		// take all provided params from other and apply to self
 		bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite);
 
-		// can be updated in getters
-		mutable S32				mChangeVersion;
-
 		static BlockDescriptor& selfBlockDescriptor()
 		{
 			static BlockDescriptor sBlockDescriptor;
@@ -604,7 +598,7 @@ namespace LLInitParam
 		}
 
 	private:
-		friend class BaseBlock;
+		friend BaseBlock;
 
 		U32		mEnclosingBlockOffset:31;
 		U32		mIsProvided:1;
@@ -617,12 +611,22 @@ namespace LLInitParam
 	struct IsBlock
 	{
 		static const bool value = false;
+		struct EmptyBase {};
+		typedef EmptyBase base_class_t;
 	};
 
 	template<typename T>
 	struct IsBlock<T, typename T::baseblock_base_class_t>
 	{
 		static const bool value = true;
+		typedef BaseBlock base_class_t;
+	};
+
+	template<typename T>
+	struct IsBlock<BaseBlock::Lazy<T>, typename T::baseblock_base_class_t >
+	{
+		static const bool value = true;
+		typedef BaseBlock base_class_t;
 	};
 
 	template<typename T, typename NAME_VALUE_LOOKUP, bool VALUE_IS_BLOCK = IsBlock<T>::value>
@@ -630,6 +634,7 @@ namespace LLInitParam
 	{
 	public:
 		typedef const T&							value_assignment_t;
+		typedef T									value_t;
 		typedef ParamValue<T, NAME_VALUE_LOOKUP, VALUE_IS_BLOCK>	self_t;
 
 		ParamValue(): mValue() {}
@@ -686,17 +691,16 @@ namespace LLInitParam
 	{
 	public:
 		typedef const T&							value_assignment_t;
+		typedef T									value_t;
 		typedef ParamValue<T, NAME_VALUE_LOOKUP, true>	self_t;
 
 		ParamValue() 
 		:	T(),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	T(other),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
@@ -741,7 +745,6 @@ namespace LLInitParam
 		}
 
 	protected:
-		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
 	};
 
@@ -751,6 +754,7 @@ namespace LLInitParam
 	{
 	public:
 		typedef const std::string&	value_assignment_t;
+		typedef std::string			value_t;
 		typedef ParamValue<std::string, NAME_VALUE_LOOKUP, false>	self_t;
 
 		ParamValue(): mValue() {}
@@ -811,10 +815,10 @@ namespace LLInitParam
 		public ParamValue<T, NAME_VALUE_LOOKUP>
 	{
 	public:
-		typedef const T&																	value_assignment_t;
 		typedef	TypedParam<T, NAME_VALUE_LOOKUP, HAS_MULTIPLE_VALUES, VALUE_IS_BLOCK>		self_t;
-		typedef NAME_VALUE_LOOKUP															name_value_lookup_t;
 		typedef ParamValue<T, NAME_VALUE_LOOKUP>											param_value_t;
+		typedef param_value_t::value_assignment_t											value_assignment_t;
+		typedef NAME_VALUE_LOOKUP															name_value_lookup_t;
 
 		using param_value_t::operator();
 
@@ -962,12 +966,10 @@ namespace LLInitParam
 		public ParamValue<T, NAME_VALUE_LOOKUP>
 	{
 	public:
-		typedef const T											value_const_t;
-		typedef T												value_t;
-		typedef value_const_t&									value_assignment_t;
+		typedef ParamValue<T, NAME_VALUE_LOOKUP>				param_value_t;
+		typedef typename param_value_t::value_assignment_t		value_assignment_t;
 		typedef TypedParam<T, NAME_VALUE_LOOKUP, false, true>	self_t;
 		typedef NAME_VALUE_LOOKUP								name_value_lookup_t;
-		typedef ParamValue<T, NAME_VALUE_LOOKUP>				param_value_t;
 
 		using param_value_t::operator();
 
@@ -1055,11 +1057,10 @@ namespace LLInitParam
 		bool isProvided() const 
 		{ 
 			// only validate block when it hasn't already passed validation with current data
-			if (Param::anyProvided() && param_value_t::mValidatedVersion < param_value_t::getLastChangeVersion())
+			if (Param::anyProvided() && !param_value_t::mValidated)
 			{
 				// a sub-block is "provided" when it has been filled in enough to be valid
 				param_value_t::mValidated = param_value_t::validateBlock(false);
-				param_value_t::mValidatedVersion = param_value_t::getLastChangeVersion();
 			}
 			return Param::anyProvided() && param_value_t::mValidated;
 		}
@@ -1069,9 +1070,9 @@ namespace LLInitParam
 		{
 			setValue(val);
 			param_value_t::clearValueName();
-			// force revalidation of block by clearing known provided version
+			// force revalidation of block
 			// next call to isProvided() will update provision status based on validity
-			param_value_t::mValidatedVersion = -1;
+			param_value_t::mValidated = false;
 			setProvided(flag_as_provided);
 		}
 
@@ -1088,6 +1089,7 @@ namespace LLInitParam
 			{
 				// a child param has been explicitly changed
 				// so *some* aspect of this block is now provided
+				param_value_t::mValidated = false;
 				setProvided();
 				param_value_t::clearValueName();
 			}
@@ -1135,7 +1137,7 @@ namespace LLInitParam
 		typedef typename std::vector<param_value_t>							container_t;
 		typedef const container_t&											value_assignment_t;
 
-		typedef VALUE_TYPE													value_t;
+		typedef typename param_value_t::value_t								value_t;
 		typedef NAME_VALUE_LOOKUP											name_value_lookup_t;
 		
 		TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count) 
@@ -1327,7 +1329,7 @@ namespace LLInitParam
 		typedef ParamValue<VALUE_TYPE, NAME_VALUE_LOOKUP>				param_value_t;
 		typedef typename std::vector<param_value_t>						container_t;
 		typedef const container_t&										value_assignment_t;
-		typedef VALUE_TYPE												value_t;
+		typedef typename param_value_t::value_t							value_t;
 		typedef NAME_VALUE_LOOKUP										name_value_lookup_t;
 
 		TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count) 
@@ -1911,16 +1913,15 @@ namespace LLInitParam
 	public:
 		typedef BatchBlock<DERIVED_BLOCK, BASE_BLOCK> block_t;
 		typedef const BatchBlock<DERIVED_BLOCK, BASE_BLOCK>&	value_assignment_t;
+		typedef block_t value_t;
 
 		ParamValue()
 		:	block_t(),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	block_t(other),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{
 		}
@@ -1951,28 +1952,27 @@ namespace LLInitParam
 		}
 
 	protected:
-		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
 	};
 
-	template<typename T>
+	template<typename T, bool IS_BLOCK>
 	class ParamValue <BaseBlock::Lazy<T>,
 					TypeValues<T>,
-					false>
+					IS_BLOCK>
+	:	public IsBlock<T>::base_class_t
 	{
 	public:
 		typedef ParamValue <BaseBlock::Lazy<T>, TypeValues<T>, false> self_t;
 		typedef const T& value_assignment_t;
+		typedef T value_t;
 	
 		ParamValue()
 		:	mValue(),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	mValue(other),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
@@ -2021,7 +2021,6 @@ namespace LLInitParam
 		}
 
 	protected:
-		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
 
 	private:
@@ -2040,13 +2039,11 @@ namespace LLInitParam
 		typedef const LLSD&	value_assignment_t;
 
 		ParamValue()
-		:	mValidatedVersion(-1),
-			mValidated(false)
+		:	mValidated(false)
 		{}
 
 		ParamValue(value_assignment_t other)
 		:	mValue(other),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
@@ -2069,7 +2066,6 @@ namespace LLInitParam
 		}
 
 	protected:
-		mutable S32 	mValidatedVersion;
 		mutable bool 	mValidated; // lazy validation flag
 
 	private:
@@ -2093,13 +2089,14 @@ namespace LLInitParam
 
 		typedef ParamValue<T, TypeValues<T> >	derived_t;
 		typedef CustomParamValue<T>				self_t;
-		typedef Block<derived_t>		block_t;
+		typedef Block<derived_t>				block_t;
 		typedef const T&						value_assignment_t;
+		typedef T								value_t;
+
 
 		CustomParamValue(const T& value = T())
 		:	mValue(value),
 			mValueAge(VALUE_AUTHORITATIVE),
-			mValidatedVersion(-1),
 			mValidated(false)
 		{}
 
@@ -2285,7 +2282,6 @@ namespace LLInitParam
 			return block_t::mergeBlock(block_data, source, overwrite);
 		}
 
-		mutable S32			mValidatedVersion;
 		mutable bool 		mValidated; // lazy validation flag
 
 	private:
-- 
GitLab


From a16bc265da9229bebc7ced7aeccdf56693b88a80 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 22:30:57 -0800
Subject: [PATCH 302/933] build fix

---
 indra/newview/llviewerwindow.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 7bc4248053a..2479006eeb7 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4107,7 +4107,6 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	if ( size.mX != new_width
 		|| size.mY != new_height)
 	{
-		S32 x = 0;
 		LLCoordWindow new_size(new_width, new_height);
 		LLCoordScreen screen_size;
 		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
-- 
GitLab


From 9a5a96aadc5fe5e8582663bd616b457def749b5b Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 29 Nov 2011 16:45:10 +0200
Subject: [PATCH 303/933] EXP-1580 FIXED resize indicator on Linux showing
 Viewer window can be resized below minimum size. Fixed using minimum window
 dimensions configured in debug settings.

---
 indra/llwindow/llwindowsdl.cpp | 29 ++++++++++++++++++++++++-----
 indra/llwindow/llwindowsdl.h   |  1 +
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index c75b6c2dce2..a70791d39f6 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -63,9 +63,6 @@ extern BOOL gDebugWindowProc;
 
 const S32 MAX_NUM_RESOLUTIONS = 200;
 
-const S32 MIN_WINDOW_WIDTH = 1024;
-const S32 MIN_WINDOW_HEIGHT = 768;
-
 // static variable for ATI mouse cursor crash work-around:
 static bool ATIbug = false; 
 
@@ -182,6 +179,20 @@ Display* LLWindowSDL::get_SDL_Display(void)
 	}
 	return NULL;
 }
+
+void LLWindowSDL::setXWindowMinSize()
+{
+	// Set the minimum size limits for X11 window
+	// so the window manager doesn't allow resizing below those limits.
+	XSizeHints* hints = XAllocSizeHints();
+	hints->flags |= PMinSize;
+	hints->min_width = mMinWindowWidth;
+	hints->min_height = mMinWindowHeight;
+
+	XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints);
+
+	XFree(hints);
+}
 #endif // LL_X11
 
 
@@ -741,6 +752,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 			mSDL_XWindowID = info.info.x11.wmwindow;
 			Lock_Display = info.info.x11.lock_func;
 			Unlock_Display = info.info.x11.unlock_func;
+
+			setXWindowMinSize();
 		}
 		else
 		{
@@ -1850,8 +1863,8 @@ void LLWindowSDL::gatherInput()
 		llinfos << "Handling a resize event: " << event.resize.w <<
 			"x" << event.resize.h << llendl;
 
-		S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH);
-		S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT);
+		S32 width = llmax(event.resize.w, (S32)mMinWindowWidth);
+		S32 height = llmax(event.resize.h, (S32)mMinWindowHeight);
 
 		// *FIX: I'm not sure this is necessary!
 		mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags);
@@ -1868,6 +1881,12 @@ void LLWindowSDL::gatherInput()
                 break;
 		}
 		
+#if LL_X11
+		// The minimum size limits should be reset after
+		// each successful SDL_SetVideoMode() call.
+		setXWindowMinSize();
+#endif
+
 		mCallbacks->handleResize(this, width, height);
                 break;
             }
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index 03dbfc22e01..a98b1b74bd2 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -140,6 +140,7 @@ class LLWindowSDL : public LLWindow
 #if LL_X11
 	static Window get_SDL_XWindowID(void);
 	static Display* get_SDL_Display(void);
+	void setXWindowMinSize();
 #endif // LL_X11	
 
 protected:
-- 
GitLab


From 1b3bd4dab9463077d2439549f0264e5c7c0dd425 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 29 Nov 2011 16:58:33 +0200
Subject: [PATCH 304/933] EXP-1565 FIXED Fixed IRC-style emotes in chat.

---
 indra/newview/llnearbychathandler.cpp | 38 +++++++++++++--------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index c43c95a366d..b8c42a85e61 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -470,7 +470,7 @@ void LLNearbyChatHandler::initChannel()
 
 
 
-void LLNearbyChatHandler::processChat(const LLChat& chat_msg,		// WARNING - not really const, see hack below changing chat_msg.mText
+void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
 									  const LLSD &args)
 {
 	if(chat_msg.mMuted == TRUE)
@@ -479,28 +479,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,		// WARNING - not
 	if(chat_msg.mText.empty())
 		return;//don't process empty messages
 
-	// Handle irc styled messages for toast panel
-	// HACK ALERT - changes mText, stripping out IRC style "/me" prefixes
-	LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
-	std::string original_message = tmp_chat.mText;			// Save un-modified version of chat text
-	if (tmp_chat.mChatStyle == CHAT_STYLE_IRC)
-	{
-		if(!tmp_chat.mFromName.empty())
-			tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3);
-		else
-			tmp_chat.mText = tmp_chat.mText.substr(3);
-	}
-
 	LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
 
 	LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat");
 
-	{
-		//sometimes its usefull to have no name at all...
-		//if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null)
-		//	tmp_chat.mFromName = tmp_chat.mFromID.asString();
-	}
-
 	// Build notification data 
 	LLSD notification;
 	notification["message"] = chat_msg.mText;
@@ -543,7 +525,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,		// WARNING - not
 
 			LLViewerChat::getChatColor(chat_msg,txt_color);
 
-			LLFloaterScriptDebug::addScriptLine(original_message,		// Send full message with "/me" style prefix
+			LLFloaterScriptDebug::addScriptLine(chat_msg.mText,
 												chat_msg.mFromName,
 												txt_color,
 												chat_msg.mFromID);
@@ -597,6 +579,21 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,		// WARNING - not
 
 	if(channel)
 	{
+		// Handle IRC styled messages.
+		std::string toast_msg;
+		if (chat_msg.mChatStyle == CHAT_STYLE_IRC)
+		{
+			if (!chat_msg.mFromName.empty())
+			{
+				toast_msg += chat_msg.mFromName;
+			}
+			toast_msg += chat_msg.mText.substr(3);
+		}
+		else
+		{
+			toast_msg = chat_msg.mText;
+		}
+
 		// Add a nearby chat toast.
 		LLUUID id;
 		id.generate();
@@ -608,6 +605,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,		// WARNING - not
 		notification["text_color"] = r_color_name;
 		notification["color_alpha"] = r_color_alpha;
 		notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
+		notification["message"] = toast_msg;
 		channel->addNotification(notification);	
 	}
 }
-- 
GitLab


From 1a7e49ece8e9811ef2fceaebd38178c6ae7b8a46 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 30 Nov 2011 01:01:22 +0200
Subject: [PATCH 305/933] EXP-1580 FIXED applying "MinWindowWidth" and
 "MinWindowHeight" settings to Linux viewer window. Added minimum size setting
 method for X11 viewer window on Linux.

---
 indra/llwindow/llwindowsdl.cpp | 41 ++++++++++++++++------------------
 indra/llwindow/llwindowsdl.h   |  2 +-
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index a70791d39f6..10f2c2f04d3 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -179,20 +179,6 @@ Display* LLWindowSDL::get_SDL_Display(void)
 	}
 	return NULL;
 }
-
-void LLWindowSDL::setXWindowMinSize()
-{
-	// Set the minimum size limits for X11 window
-	// so the window manager doesn't allow resizing below those limits.
-	XSizeHints* hints = XAllocSizeHints();
-	hints->flags |= PMinSize;
-	hints->min_width = mMinWindowWidth;
-	hints->min_height = mMinWindowHeight;
-
-	XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints);
-
-	XFree(hints);
-}
 #endif // LL_X11
 
 
@@ -752,8 +738,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 			mSDL_XWindowID = info.info.x11.wmwindow;
 			Lock_Display = info.info.x11.lock_func;
 			Unlock_Display = info.info.x11.unlock_func;
-
-			setXWindowMinSize();
 		}
 		else
 		{
@@ -1050,6 +1034,25 @@ void LLWindowSDL::setMouseClipping( BOOL b )
     //SDL_WM_GrabInput(b ? SDL_GRAB_ON : SDL_GRAB_OFF);
 }
 
+// virtual
+void LLWindowSDL::setMinSize(U32 min_width, U32 min_height)
+{
+	LLWindow::setMinSize(min_width, min_height);
+
+#if LL_X11
+	// Set the minimum size limits for X11 window
+	// so the window manager doesn't allow resizing below those limits.
+	XSizeHints* hints = XAllocSizeHints();
+	hints->flags |= PMinSize;
+	hints->min_width = mMinWindowWidth;
+	hints->min_height = mMinWindowHeight;
+
+	XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints);
+
+	XFree(hints);
+#endif
+}
+
 BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position)
 {
 	BOOL result = TRUE;
@@ -1880,12 +1883,6 @@ void LLWindowSDL::gatherInput()
     			}
                 break;
 		}
-		
-#if LL_X11
-		// The minimum size limits should be reset after
-		// each successful SDL_SetVideoMode() call.
-		setXWindowMinSize();
-#endif
 
 		mCallbacks->handleResize(this, width, height);
                 break;
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index a98b1b74bd2..76019999b11 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -76,6 +76,7 @@ class LLWindowSDL : public LLWindow
 	/*virtual*/ void captureMouse();
 	/*virtual*/ void releaseMouse();
 	/*virtual*/ void setMouseClipping( BOOL b );
+	/*virtual*/	void setMinSize(U32 min_width, U32 min_height);
 
 	/*virtual*/ BOOL isClipboardTextAvailable();
 	/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
@@ -140,7 +141,6 @@ class LLWindowSDL : public LLWindow
 #if LL_X11
 	static Window get_SDL_XWindowID(void);
 	static Display* get_SDL_Display(void);
-	void setXWindowMinSize();
 #endif // LL_X11	
 
 protected:
-- 
GitLab


From 45d3e147aca316df59506053c4de5f4239287ee7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 29 Nov 2011 17:13:11 -0600
Subject: [PATCH 306/933] SH-1912 Add environment map back into shiny when
 lighting and shadows enabled.

---
 indra/llrender/llrender.cpp                          |  5 +++++
 indra/llrender/llrender.h                            |  1 +
 .../shaders/class1/deferred/softenLightF.glsl        | 12 ++++++------
 .../shaders/class2/deferred/softenLightF.glsl        | 10 ++++++----
 indra/newview/pipeline.cpp                           |  5 ++---
 5 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 812fa7024bf..cd827f5091e 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1444,6 +1444,11 @@ const glh::matrix4f& LLRender::getModelviewMatrix()
 	return mMatrix[MM_MODELVIEW][mMatIdx[MM_MODELVIEW]];
 }
 
+const glh::matrix4f& LLRender::getProjectionMatrix()
+{
+	return mMatrix[MM_PROJECTION][mMatIdx[MM_PROJECTION]];
+}
+
 void LLRender::translateUI(F32 x, F32 y, F32 z)
 {
 	if (mUIOffset.empty())
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 7581b9f9086..fa5f7f311df 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -348,6 +348,7 @@ class LLRender
 	void matrixMode(U32 mode);	
 
 	const glh::matrix4f& getModelviewMatrix();
+	const glh::matrix4f& getProjectionMatrix();
 
 	void syncMatrices();
 	void syncLightState();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 60952ea38ec..267c9bdaa5d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -35,7 +35,6 @@ uniform sampler2DRect positionMap;
 uniform sampler2DRect normalMap;
 uniform sampler2DRect lightMap;
 uniform sampler2DRect depthMap;
-uniform sampler2D	  noiseMap;
 uniform samplerCube environmentMap;
 uniform sampler2D	  lightFunc;
 
@@ -60,9 +59,7 @@ uniform vec4 distance_multiplier;
 uniform vec4 max_y;
 uniform vec4 glow;
 uniform float scene_light_strength;
-uniform vec3 env_mat[3];
-//uniform mat4 shadow_matrix[3];
-//uniform vec4 shadow_clip;
+uniform mat3 env_mat;
 uniform mat3 ssao_effect_mat;
 
 uniform vec3 sun_dir;
@@ -279,8 +276,7 @@ void main()
 	vec3 pos = getPosition_d(tc, depth).xyz;
 	vec3 norm = texture2DRect(normalMap, tc).xyz;
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
-	
+		
 	float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
 	
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
@@ -309,6 +305,10 @@ void main()
 			vec3 spec_contrib = dumbshiny * spec.rgb;
 			bloom = dot(spec_contrib, spec_contrib);
 			col += spec_contrib;
+
+			//add environmentmap
+			vec3 env_vec = env_mat * refnormpersp;
+			col += textureCube(environmentMap, env_vec).rgb * max(spec.a-diffuse.a-0.2, 0.0); 
 		}
 	
 		col = atmosLighting(col);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index eb367d4ad6d..d905e76df81 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -34,7 +34,6 @@ uniform sampler2DRect specularRect;
 uniform sampler2DRect normalMap;
 uniform sampler2DRect lightMap;
 uniform sampler2DRect depthMap;
-uniform sampler2D	  noiseMap;
 uniform samplerCube environmentMap;
 uniform sampler2D	  lightFunc;
 uniform vec3 gi_quad;
@@ -60,7 +59,7 @@ uniform vec4 distance_multiplier;
 uniform vec4 max_y;
 uniform vec4 glow;
 uniform float scene_light_strength;
-uniform vec3 env_mat[3];
+uniform mat3 env_mat;
 uniform vec4 shadow_clip;
 uniform mat3 ssao_effect_mat;
 
@@ -279,8 +278,7 @@ void main()
 	vec3 pos = getPosition_d(tc, depth).xyz;
 	vec3 norm = texture2DRect(normalMap, tc).xyz;
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
-	//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
-	
+		
 	float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
 	
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
@@ -315,6 +313,10 @@ void main()
 			vec3 spec_contrib = dumbshiny * spec.rgb;
 			bloom = dot(spec_contrib, spec_contrib);
 			col += spec_contrib;
+
+			//add environmentmap
+			vec3 env_vec = env_mat * refnormpersp;
+			col += textureCube(environmentMap, env_vec).rgb * max(spec.a-diffuse.a-0.2, 0.0); 
 		}
 			
 		col = atmosLighting(col);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 12bec908811..657cdc0e07b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7108,13 +7108,12 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
 			cube_map->enable(channel);
 			cube_map->bind();
 			F32* m = gGLModelView;
-
-			
+						
 			F32 mat[] = { m[0], m[1], m[2],
 						  m[4], m[5], m[6],
 						  m[8], m[9], m[10] };
 		
-			shader.uniform3fv(LLShaderMgr::DEFERRED_ENV_MAT, 3, mat);
+			shader.uniformMatrix3fv(LLShaderMgr::DEFERRED_ENV_MAT, 1, TRUE, mat);
 		}
 	}
 
-- 
GitLab


From 3fc4c14464c1b8152108a5332b754d5b2671e54d Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 29 Nov 2011 16:18:50 -0700
Subject: [PATCH 307/933] fix a mac build error: a friend declaration issue.

---
 indra/llmessage/llcurl.cpp | 32 ++++++++++++++++++++++----------
 indra/llmessage/llcurl.h   | 10 ++++++++--
 2 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 7f61e1ac040..7ca25d07fce 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -797,9 +797,10 @@ void LLCurl::Multi::removeEasy(Easy* easy)
 
 //------------------------------------------------------------
 //LLCurlThread
-LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi) :
+LLCurlThread::CurlRequest::CurlRequest(handle_t handle, LLCurl::Multi* multi, LLCurlThread* curl_thread) :
 	LLQueuedThread::QueuedRequest(handle, LLQueuedThread::PRIORITY_NORMAL, FLAG_AUTO_COMPLETE),
-	mMulti(multi)
+	mMulti(multi),
+	mCurlThread(curl_thread)
 {	
 }
 
@@ -807,7 +808,7 @@ LLCurlThread::CurlRequest::~CurlRequest()
 {	
 	if(mMulti)
 	{
-		delete mMulti ;
+		mCurlThread->deleteMulti(mMulti) ;
 		mMulti = NULL ;
 	}
 }
@@ -817,7 +818,7 @@ bool LLCurlThread::CurlRequest::processRequest()
 	bool completed = true ;
 	if(mMulti)
 	{
-		completed = mMulti->doPerform() ;
+		completed = mCurlThread->doMultiPerform(mMulti) ;
 		setPriority(LLQueuedThread::PRIORITY_LOW) ;
 	}
 
@@ -826,7 +827,7 @@ bool LLCurlThread::CurlRequest::processRequest()
 
 void LLCurlThread::CurlRequest::finishRequest(bool completed)
 {
-	delete mMulti ;
+	mCurlThread->deleteMulti(mMulti) ;
 	mMulti = NULL ;
 }
 	
@@ -849,7 +850,7 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi)
 {
 	multi->mHandle = generateHandle() ;
 
-	CurlRequest* req = new CurlRequest(multi->mHandle, multi) ;
+	CurlRequest* req = new CurlRequest(multi->mHandle, multi, this) ;
 
 	if (!addRequest(req))
 	{
@@ -857,11 +858,22 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi)
 	}
 }
 	
-void LLCurlThread::deleteMulti(LLCurl::Multi* multi)
+void LLCurlThread::killMulti(LLCurl::Multi* multi)
 {
 	multi->markDead() ;
 }
 
+//private
+bool LLCurlThread::doMultiPerform(LLCurl::Multi* multi) 
+{
+	return multi->doPerform() ;
+}
+
+//private
+void LLCurlThread::deleteMulti(LLCurl::Multi* multi) 
+{
+	delete multi ;
+}
 //------------------------------------------------------------
 
 //static
@@ -886,7 +898,7 @@ LLCurlRequest::~LLCurlRequest()
 	//stop all Multi handle background threads
 	for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter)
 	{
-		LLCurl::getCurlThread()->deleteMulti(*iter) ;
+		LLCurl::getCurlThread()->killMulti(*iter) ;
 	}
 	mMultiSet.clear() ;
 }
@@ -1023,7 +1035,7 @@ S32 LLCurlRequest::process()
 		if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0)
 		{
 			mMultiSet.erase(curiter);
-			LLCurl::getCurlThread()->deleteMulti(multi);
+			LLCurl::getCurlThread()->killMulti(multi);
 		}
 	}
 	mProcessing = FALSE;
@@ -1069,7 +1081,7 @@ LLCurlEasyRequest::LLCurlEasyRequest()
 
 LLCurlEasyRequest::~LLCurlEasyRequest()
 {
-	LLCurl::getCurlThread()->deleteMulti(mMulti) ;
+	LLCurl::getCurlThread()->killMulti(mMulti) ;
 }
 	
 void LLCurlEasyRequest::setopt(CURLoption option, S32 value)
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 23a6ca67e3b..a275db3e53b 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -328,7 +328,7 @@ class LLCurlThread : public LLQueuedThread
 		virtual ~CurlRequest(); // use deleteRequest()
 		
 	public:
-		CurlRequest(handle_t handle, LLCurl::Multi* multi);
+		CurlRequest(handle_t handle, LLCurl::Multi* multi, LLCurlThread* curl_thread);
 
 		/*virtual*/ bool processRequest();
 		/*virtual*/ void finishRequest(bool completed);
@@ -336,8 +336,10 @@ class LLCurlThread : public LLQueuedThread
 	private:
 		// input
 		LLCurl::Multi* mMulti;
+		LLCurlThread*  mCurlThread;
 	};
-	
+	friend class CurlRequest;
+
 public:
 	LLCurlThread(bool threaded = true) ;
 	virtual ~LLCurlThread() ;
@@ -345,6 +347,10 @@ class LLCurlThread : public LLQueuedThread
 	S32 update(U32 max_time_ms);
 
 	void addMulti(LLCurl::Multi* multi) ;
+	void killMulti(LLCurl::Multi* multi) ;
+
+private:
+	bool doMultiPerform(LLCurl::Multi* multi) ;
 	void deleteMulti(LLCurl::Multi* multi) ;
 } ;
 
-- 
GitLab


From 9ad8f46a6bb96a8352cf66beafa1c742a4bed5a9 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 29 Nov 2011 15:52:56 -0800
Subject: [PATCH 308/933] sync with viewer-development

---
 .../skins/default/xui/en/floater_about.xml    |  52 ++---
 .../xui/en/floater_hardware_settings.xml      |   2 +-
 .../default/xui/en/floater_world_map.xml      |   2 +-
 .../skins/default/xui/en/menu_viewer.xml      |  21 +-
 .../xui/en/panel_postcard_settings.xml        | 163 ++++++++------
 .../default/xui/en/panel_snapshot_local.xml   | 205 ++++++++++--------
 .../default/xui/en/panel_snapshot_profile.xml | 171 +++++++++------
 indra/newview/skins/minimal/colors.xml        |   6 -
 .../skins/minimal/textures/arrow_keys.png     | Bin 6558 -> 0 bytes
 .../textures/bottomtray/Speak_Btn_Off.png     | Bin 993 -> 0 bytes
 .../bottomtray/Speak_Btn_Selected_Press.png   | Bin 1217 -> 0 bytes
 .../textures/bottomtray/button_separator.png  | Bin 153 -> 0 bytes
 .../minimal/textures/bottomtray/close_off.png | Bin 3184 -> 0 bytes
 .../textures/bottomtray/close_over.png        | Bin 3173 -> 0 bytes
 .../textures/bottomtray/close_press.png       | Bin 3259 -> 0 bytes
 .../skins/minimal/textures/click_to_move.png  | Bin 8188 -> 0 bytes
 .../skins/minimal/textures/textures.xml       |  11 -
 .../minimal/xui/ru/menu_script_chiclet.xml    |   4 -
 .../minimal/xui/tr/menu_script_chiclet.xml    |   4 -
 .../minimal/xui/zh/menu_script_chiclet.xml    |   4 -
 .../minimal/xui/zh_CN/menu_script_chiclet.xml |   4 -
 21 files changed, 359 insertions(+), 290 deletions(-)
 delete mode 100644 indra/newview/skins/minimal/colors.xml
 delete mode 100644 indra/newview/skins/minimal/textures/arrow_keys.png
 delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Off.png
 delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Selected_Press.png
 delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/button_separator.png
 delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/close_off.png
 delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/close_over.png
 delete mode 100644 indra/newview/skins/minimal/textures/bottomtray/close_press.png
 delete mode 100644 indra/newview/skins/minimal/textures/click_to_move.png
 delete mode 100644 indra/newview/skins/minimal/textures/textures.xml
 delete mode 100644 indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml
 delete mode 100644 indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml
 delete mode 100644 indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml
 delete mode 100644 indra/newview/skins/minimal/xui/zh_CN/menu_script_chiclet.xml

diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index 36af4758247..c7e9ec781da 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -196,34 +196,36 @@ Dummy Name replaced at run time
        top="5"
        width="435"
        word_wrap="true">
-3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
-APR Copyright (C) 2000-2004 The Apache Software Foundation
-Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
-cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
-DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
-expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Copyright (C) 1999-2004 Brian Paul.
-GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Copyright (c) 2005, Google Inc.
-Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
-jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Copyright (C) 2001, Xiphophorus
-OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
-PCRE Copyright (c) 1997-2008 University of Cambridge
-SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
-zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
-google-perftools Copyright (c) 2005, Google Inc.
+        3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
+        APR Copyright (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
+        Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
 
-All rights reserved.  See licenses.txt for details.
+        This software contains source code provided by NVIDIA Corporation.
 
-Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
-        </text_editor>
+        All rights reserved.  See licenses.txt for details.
+
+        Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+      </text_editor>
       </panel>
     </tab_container>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
index 05f4c52b950..66bb9d3cea8 100644
--- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
@@ -35,7 +35,7 @@
      height="12"
      layout="topleft"
      left="10"
-     name="Antialiasing:"
+     name="antialiasing label"
      top_pad="7"
      width="188">
         Antialiasing:
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index 4314c8a9e2a..56d79f62c7b 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -468,7 +468,7 @@
      left="3"
      top_pad="7"
      mouse_opaque="true"
-     name="region_icon"
+     name="location_icon"
      width="16" />
     <search_editor
      follows="top|right"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 263d961be1f..c8c1922bf67 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -533,6 +533,14 @@
                  function="World.EnvSettings"
                  parameter="midnight" />
             </menu_item_call>
+            <menu_item_separator/>
+            <menu_item_call
+             label="Use Region Settings"
+             name="Use Region Settings">
+                <menu_item_call.on_click
+                 function="World.EnvSettings"
+                 parameter="region" />
+            </menu_item_call>
         </menu>
 	    
    
@@ -2569,19 +2577,6 @@
             <menu_item_check.on_enable
                  function="Advanced.EnableRenderDeferredOptions" />
           </menu_item_check>
-          <menu_item_check
-                   label="   Global Illumination (experimental)"
-                   name="Global Illumination">
-            <menu_item_check.on_check
-             function="CheckControl"
-             parameter="RenderDeferredGI" />
-            <menu_item_check.on_click
-             function="ToggleControl"
-             parameter="RenderDeferredGI" />
-            <menu_item_check.on_enable
-                 function="Advanced.EnableRenderDeferredOptions" />
-          </menu_item_check>
-
           <menu_item_separator />
 
           <menu_item_check
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index 84e35937980..aebbc51be1f 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -34,69 +34,104 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Width"
-     label_width="40"
-     layout="topleft"
-     left="10"
-     max_val="6016"
-     min_val="32"
-     name="postcard_snapshot_width"
+    <layout_stack
+     animate="false"
+     follows="all"
+     height="275"
+     layout="bottomleft"
+     name="postcard_image_params_ls"
+     left_delta="0"
+     orientation="vertical"
      top_pad="10"
-     width="95" />
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Height"
-     label_width="40"
-     layout="topleft"
-     left_pad="5"
-     max_val="6016"
-     min_val="32"
-     name="postcard_snapshot_height"
-     top_delta="0"
-     width="95" />
-    <check_box
-     bottom_delta="20"
-     follows="left|top"
-     label="Constrain proportions"
-     layout="topleft"
-     left="10"
-     name="postcard_keep_aspect_check" />
-    <slider
-     decimal_digits="0"
-     follows="left|top"
-     height="15"
-     increment="1"
-     initial_value="75"
-     label="Image quality"
-     label_width="80"
-     layout="topleft"
-     left="10"
-     max_val="100"
-     name="image_quality_slider"
-     top_pad="7"
-     width="200" />
-    <text
-     type="string"
-     follows="left|top"
-     font="SansSerifSmall"
-     length="1"
-     height="14"
-     layout="topleft"
-     left_pad="-5"
-     halign="left"
-     name="image_quality_level"
-     top_delta="0"
-     width="60">
-       ([QLVL])
-    </text>
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="60"
+         layout="topleft"
+         left="0"
+         name="postcard_image_size_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="postcard_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="postcard_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+             bottom_delta="20"
+             follows="left|top"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="postcard_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="23"
+         layout="topleft"
+         left="0"
+         name="postcard_image_format_quality_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <slider
+             decimal_digits="0"
+             follows="left|top"
+             height="15"
+             increment="1"
+             initial_value="75"
+             label="Image quality"
+             label_width="80"
+             layout="topleft"
+             left="10"
+             max_val="100"
+             name="image_quality_slider"
+             top_pad="7"
+             width="200" />
+            <text
+             type="string"
+             follows="left|top"
+             font="SansSerifSmall"
+             length="1"
+             height="14"
+             layout="topleft"
+             left_pad="-5"
+             halign="left"
+             name="image_quality_level"
+             top_delta="0"
+             width="60">
+               ([QLVL])
+            </text>
+        </layout_panel>
+    </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index 30403a21dd6..ae0215a5786 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -80,93 +80,128 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Width"
-     label_width="40"
-     layout="topleft"
-     left="10"
-     max_val="6016"
-     min_val="32"
-     name="local_snapshot_width"
-     top_pad="10"
-     width="95" />
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Height"
-     label_width="40"
-     layout="topleft"
-     left_pad="5"
-     max_val="6016"
-     min_val="32"
-     name="local_snapshot_height"
-     top_delta="0"
-     width="95" />
-    <check_box
-     bottom_delta="20"
-     follows="left|top"
-     label="Constrain proportions"
-     layout="topleft"
-     left="10"
-     name="local_keep_aspect_check" />
-    <combo_box
-     follows="left|top"
-     height="23"
-     label="Format"
-     layout="topleft"
+    <layout_stack
+     animate="false"
+     follows="all"
+     height="275"
+     layout="bottomleft"
+     name="local_image_params_ls"
      left_delta="0"
-     name="local_format_combo"
+     orientation="vertical"
      top_pad="10"
-     width="120">
-        <combo_box.item
-         label="PNG (Lossless)"
-         name="PNG"
-         value="PNG" />
-        <combo_box.item
-         label="JPEG"
-         name="JPEG"
-         value="JPEG" />
-        <combo_box.item
-         label="BMP (Lossless)"
-         name="BMP"
-         value="BMP" />
-    </combo_box>
-    <slider
-     decimal_digits="0"
-     follows="left|top"
-     height="15"
-     increment="1"
-     initial_value="75"
-     label="Image quality"
-     label_width="80"
-     layout="topleft"
-     left="10"
-     max_val="100"
-     name="image_quality_slider"
-     top_pad="7"
-     width="200" />
-    <text
-     type="string"
-     follows="left|top"
-     font="SansSerifSmall"
-     length="1"
-     height="14"
-     layout="topleft"
-     left_pad="-5"
-     halign="left"
-     name="image_quality_level"
-     top_delta="0"
-     width="60">
-       ([QLVL])
-    </text>
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="60"
+         layout="topleft"
+         left="0"
+         name="local_image_size_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="local_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="local_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+             bottom_delta="20"
+             follows="left|top"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="local_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="23"
+         layout="topleft"
+         left="0"
+         name="local_image_format_quality_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <combo_box
+             follows="left|top"
+             height="23"
+             label="Format"
+             layout="topleft"
+             left_delta="0"
+             name="local_format_combo"
+             top_pad="0"
+             width="120">
+                <combo_box.item
+                 label="PNG (Lossless)"
+                 name="PNG"
+                 value="PNG" />
+                <combo_box.item
+                 label="JPEG"
+                 name="JPEG"
+                 value="JPEG" />
+                <combo_box.item
+                 label="BMP (Lossless)"
+                 name="BMP"
+                 value="BMP" />
+            </combo_box>
+            <slider
+             decimal_digits="0"
+             follows="left|top"
+             height="15"
+             increment="1"
+             initial_value="75"
+             label="Image quality"
+             label_width="80"
+             layout="topleft"
+             left="10"
+             max_val="100"
+             name="image_quality_slider"
+             top_pad="7"
+             width="200" />
+            <text
+             type="string"
+             follows="left|top"
+             font="SansSerifSmall"
+             length="1"
+             height="14"
+             layout="topleft"
+             left_pad="-5"
+             halign="left"
+             name="image_quality_level"
+             top_delta="0"
+             width="60">
+               ([QLVL])
+            </text>
+        </layout_panel>
+    </layout_stack>
     <button
      follows="right|bottom"
      height="23"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index ee79a4b3b82..91ac9ad6584 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -68,76 +68,111 @@
          name="Custom"
          value="[i-1,i-1]" />
     </combo_box>
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Width"
-     label_width="40"
-     layout="topleft"
-     left="10"
-     max_val="6016"
-     min_val="32"
-     name="profile_snapshot_width"
-     top_pad="10"
-     width="95" />
-    <spinner
-     allow_text_entry="false"
-     decimal_digits="0"
-     follows="left|top"
-     height="20"
-     increment="32"
-     label="Height"
-     label_width="40"
-     layout="topleft"
-     left_pad="5"
-     max_val="6016"
-     min_val="32"
-     name="profile_snapshot_height"
-     top_delta="0"
-     width="95" />
-    <check_box
-     bottom_delta="20"
-     label="Constrain proportions"
-     layout="topleft"
-     left="10"
-     name="profile_keep_aspect_check" />
-    <text
-     length="1"
-     follows="top|left|right"
-     font="SansSerif"
-     height="16"
-     layout="topleft"
-     left="12"
-     name="caption_label"
-     right="-10"
-     top_pad="10"
-     type="string">
-        Caption:
-    </text>
-    <text_editor
+    <layout_stack
+     animate="false"
      follows="all"
-     height="160"
-     layout="topleft"
+     height="270"
+     layout="bottomleft"
+     name="profile_image_params_ls"
      left_delta="0"
-     length="1"
-     max_length="700"
-     name="caption"
-     right="-10"
-     top_pad="5"
-     type="string"
-     word_wrap="true">
-    </text_editor>
-    <check_box
-     follows="left|bottom"
-     initial_value="true"
-     label="Include location"
-     layout="topleft"
-     left_delta="0"
-     name="add_location_cb"
-     top_pad="15" />
+     orientation="vertical"
+     top_pad="10"
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="55"
+         layout="topleft"
+         left="0"
+         name="profile_image_size_lp"
+         user_resize="false" 
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="profile_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="profile_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+             bottom_delta="20"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="profile_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="200"
+         layout="topleft"
+         left="0"
+         name="profile_image_metadata_lp"
+         user_resize="false" 
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <text
+             length="1"
+             follows="top|left|right"
+             font="SansSerif"
+             height="16"
+             layout="topleft"
+             left="0"
+             name="caption_label"
+             right="-10"
+             top_pad="0"
+             type="string">
+                Caption:
+            </text>
+            <text_editor
+             follows="all"
+             height="155"
+             layout="topleft"
+             left_delta="0"
+             length="1"
+             max_length="700"
+             name="caption"
+             right="-10"
+             top_pad="5"
+             type="string"
+             word_wrap="true">
+            </text_editor>
+            <check_box
+             follows="left|bottom"
+             initial_value="true"
+             label="Include location"
+             layout="topleft"
+             left_delta="0"
+             name="add_location_cb"
+             top_pad="15" />
+        </layout_panel>
+    </layout_stack>
     <button
      follows="right|bottom"
      height="23"
diff --git a/indra/newview/skins/minimal/colors.xml b/indra/newview/skins/minimal/colors.xml
deleted file mode 100644
index 097a298ce5c..00000000000
--- a/indra/newview/skins/minimal/colors.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<colors>
-    <color
-     name="MenuBarBgColor"
-     value="0 0 0 0" />
-</colors>
diff --git a/indra/newview/skins/minimal/textures/arrow_keys.png b/indra/newview/skins/minimal/textures/arrow_keys.png
deleted file mode 100644
index f19af59251c46159a0aa6f5ec983a66df961c703..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 6558
zcmV;P8DZv$P)<h;3K|Lk000e1NJLTq0046U003491^@s6{35Ai00009a7bBm000XU
z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag
z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V
z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H
zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T
zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j
zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i
z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf
z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G
zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u
zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm
z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v
zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo
z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t
z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl
zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_
zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0
zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O
zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p
z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc=
zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ
zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h
z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z000ijNkl<Zc-rh;U62*U75+|l-@C8`N?Cta*<Df^5iLz6WePB56v>040WI=lG$xfN
zAL5g-@?t8!n3wnvpYXxgsAWox5ip5>zX4*I@&SKPP)k^FQ9}&7%ffPJx;qauvpaWg
zcTdl~Gj}htL*1IWvzO`V^YwT7oYUvb5YFt4O1_?+7slM&TUGb2&s4za47i_8&b13(
zC+E(3Fv;^fdH&wjHy=>6We?BqXDyg6V8{X_S$^x=FP(F&Er9A?22}K@mLLOowsStr
zg(vg00m$@sN`0qZQ?=A1?VEti`>-5fP5pDRF!`=B=UgA;sN=JinQ(w++avYerGnw1
zN>v6-)4rz-Akjmtbb**0bHh2x9A`l_0gwe$WsX&RO&MQD89+~8k23qSnwfb(vKYwp
z-o{uLJ58$9#6Xn-Ql|cY0<!8whKe2lF$-uK9B$b244}*cs1KM~08K!q_a;EI#?e_l
zXPVTb4M1T4)WlSiVPrFO(f}s=^!23So>fM*&buZSHJeqf35X&Ertn}XS(vFEY)n3(
zf#oK4)4ZBByALKnvq07iz?wj%9A;_@h-n~0hw-FS*UlO~bEa;)0_N!9BTe5&hKFp-
zG_jHc5Wl+j-jVz6`}Jdeef5hHd1<Z97OU<2Olzdgr%5N*K7G1z^pQvYc+aDoH;?A{
znl0dY^!LmKlZbqMN-Hy0ty+C$fB(YE1Q#I2D!pH=6gcOXty;DE%11YE9?P(qrRGed
z2C($^tPAIn#T5~a#%TZqVgw;L7%`MBGpzxo6~a&hk`T2Cky6Lp0O)+sz{AgMQng_a
z@-)*0=U|+nG(@$Ak_v&G)tGUc>5p>E$@6}u#Vw(%H5<xVFk?i)c*M{$Hl-DmYMx5t
zHbsh+GAH6Rr&cZNA!fo60pe0BmNhJ?^c!f#B5sox3{0H$VCJb>rljopy~b@a54UF?
zOb@Ge2GkZc+l4J|(*|PCf!a&VwE3F^fa^Tpu?iO@YLi>;sppd6SPy__n|GS#Pt`JK
zc0<i7+dS#phqF@6<^~bwkePWZwr7l>UQ@F+cZKE<Ok4g@&uy$rLUA$D*D!MbxVjKp
zk^3OezMt95^yrjRST1G~5g23OCC6-Yv_USo-2}4hYPLY<ywzF)<j$8~#^{kFsMSPO
z%q*m0yA9-=%$dVO%S-~HcI7Mt$D42d8#{Ntgl*eiz|_=9aNbpyw52a`AG^MZ4sYD+
zx0dxh9|zpoUaeNcfe$~zuHCyaGBS+m>1k};_5yzVqfH>9vf1IA+p7W4$na2+@(3r%
z%VMTW$gXwBJae8E_-$m(qIv$}oa5Mkk73)kzv0HUYcV)Di0`jkhpDM4yz=Vn;GA`A
z6vb`&CS<qMci#c+Wq>iy$-PKNOdk$=iihiC?EqsOpMCZ@uD<#zTyxF0F@0(p{r&ye
zxZwvlF*%7wBd9tuRYqUAqrWx)tuhfF>ckf5C{pJ^4&k`6?U*fS5QYIpMuu_uiWLY$
z2|yzV0-S&Td04mZ#wvmaSrC$CF`em`hF?*UtGpqbsBKCdYguv=1%S*e+$mC-WnF}J
z0NP?L_Agur#yFH}&PiUhXc3fBWzCs+K&BJ96pB@g*@~3NaST|J$Ao9hlnQ*{5$ejz
z!ZQJDH2)L8q?9wqS#V3R__H~@!oU(`0n^34EQr1ZO2&n7;RzsMukEnKFI}qF#!ORw
zZ1VS(OQd_VX3ZK53@n9|?E$In#&ZH>l5rpmjARADG!-q`>R$4!+ZkYmrxoj}0r9Q(
zu&HfsVP}@1t-VqTVa&#FTy_bhR0x7bdwD^2m26^U7RW^P>YO>##lB=PPzFd7u-Y|e
z7Ey^NYs^)dl?SLvh1JlU@Jv|+qP3ned;lN}f)b`iqrFC$&Ct_^xinqYP!vd8t&7Uc
zkEVhp?Q6~ERb!b7dYFTuRKN%_Ww5u*m0=iG6LK{B=r%^m6qu?2n682)nUPbvZj@Z?
z^ii|cEOQ^1!UIgQTwA2?k0?sR(@LQt9Gld4y3LHNvR19~P_Z_Znk`yNt{rCNr89H0
zu_QuxxF06waOBr}xQcjOZLrjJXST`7$y3l8Qb|C`ZmbGKZ8qO?Ed!*Dm04li7@4he
z$xcmSW^gF9*3VdlYRg;A0$FnyD`}<@+*MgN4bZaH>vj6W!w+A#^754{i7|%ia#RU`
z+J9jGf#2MJ|LcuL!`6;60O?Y(c|eA#Pmns!{?68}7CDZxNev1BV%P3H_b*t`Hz=hf
ztu-krnT|68wALi!)JUy0q5UiY3PXANwbx&J<M$6ew3mnx<JB+pD5ao6sTz%j{@sHQ
zerxRwYp-RDYHbgoxKN3RG!bdWm`;uf(2R4%7}KXtO@F>?*FXRM+Xo(a$1o@oHJq(L
z%T;&G!NwYZ`ln+@_c0dLd+3Vjp><^JOiWCCw({~7_Z<0jYzyb{7_0PQYZ_823@y8O
z;|Kc>Jho)Xl0hP>yst_rjE|4Mape^&e;KngNU>C=_UU=ni<u^0a7L{%B5=XM83R=y
zSq%-PHDoAJuh;vM)0}aN$`YzUQ)vw)C8UgM73%eRA7cz$L~T~pS1A>sH3+DuTp^RY
zVl9af1y)3|mL?bxIOpJumo{oCrRqW{At9k=<8vAW;+%oANVsLCd6ABQluANH29}QR
zLjeG1EGkxtQ&V(_jFc)0MatPwq{z&zX&hA1RTG!5nE(o{0Rn+@2F7_QqgDgZapznT
zV~jxv4l1c|NNa^Kl##V;xiN|dFEL&UKQ$sP5G@MK3}Q-!4%3!%-h#L@(|~eTH=2b@
z<zyfd07c|A`lETQEVV}-vD-N3sH8T@5PVH#(eo6LUYYdFv0CC<fbM$TM}EAySFhRD
z=3C>^gd20Ln&d@-=C?{>71|aD?>KG5w8X{Ho0;%mB`|%M=?x~3zXUeFRk!)Xw_8*#
zbASj#K!IE#xB0D9HCtq{-)R8l0Za2@uXJmx+&)jux>Rm&^}bX$r6<75dm45NPOQxa
zdQNI#?0kQPz$~l@S%;1F1S0`p`}Q3;bm$O-5MMPwy|;FI?)0uXXJCv$YgCrrk=_3H
z<(HVAK8<c`TFyBbqbmAZID*02xVW>CT1{Yld;;5d?8HYOe>@YIu8NgO#TVy%hNazD
z^8}*!@YvW<y!he{96frp%yL3qMCLwV+HyZF`J9AWP2lk1BY6CYCow)gfx!ze1Y=SC
zWZ9r{A@J$g7{<nq&ZyR;@@wC|_YsD&GJ`1T6A|IO^9G;+JoV?N@%{(<QLBkE+SLUB
z)kT<@mt{Sp-uLc(2Twft6jrQQfm_z!3;-A(pTOkgB&MdO$`vRPrl+T|W$QMaIB^18
z2-NF!?B4SR_U?Tf^?G%4=gE_&FgZDiiHQlEKHb0#*I$P<*RIC%&u_)9U3(y9#{<bG
zZ|!2K@T9jBOwKuuA3u(Nyto}xQ&Tv0>=>ST_Aij31Sl#U7#JA9t+%WP=e(2}kT48!
z=_Qxqy?5WobI<)1^}as5yYD?5{Nx}uZMq$du{f``RJ{%mVfUVYVRZB`gy8YOV(9DZ
zLl6YmvGXM?8(N01FJIot9IA3iq<sybyrf-~RkKot7#LWJJMX*$TefUPtyaTr8#ka<
zugA&B(W6Bpqo|yf39U7V2pcxsia$O6BtHCT9~kHO;ilWMd}IVcP=VnU<+0#~>%TYS
z1|@U#%dfnOMT`2ee*H}t86IvM$mjvaO|sVTd!3b4&H5znq8U($k>Mfy;^%kc<jIqG
z`k7}jIWdm@{(dZ2(1&`hR=RAJlBm~fxc#<`Sh8dZuKVt__~zADmCwi)Bd>-93l^Zi
ze<2z{1J7^Sih~Ca;b(W<i7QsF?8x7Z!ITbmTJ0I(sbZ50r;~|Vwjc<xc=2NV^p2n4
z?YG~-`1mBwJ$GqSwN}|~SP+C*y7XM!efM2B=bUp8hO&dU$XhE!nt@?rViH3`L%8|o
zo3Lc@*UHie+1ww8z2Y}#x>D&|z*JE(5`rLr5FD#keFsW)Rz{HjcD6|E1wnudFSsDi
z-)XlBOncu;GFZY;;-bMp3@y7Dp_GNIwM}hinCX+7JA<3Zv8Zf7%ETT30If8nZU(K<
zXjJa!$#CXY5QYJ|u}LYL#&XB)>RH<=1Ew^nTev_K9%iu#$Z(dC3RO%|I{s(lNF>zm
zMbb1hq-uRybSXMjt8^ej!=AmaTt-m30+@0DO%jVj#AzduMpKZeCcte1Q|l<lw5m4K
zYBW2I=n4(1WOj&|8Rh_*%S_*DB?%x<T7zVWC^HZh3RZ!0F5=O~(gn5^HVTR@ea^Yi
zT0vGFV%Aa8H{-m9);g0knAQlLkDr-+*;xpH8bRYrMy#G1%@$NUNmGt$G)6}cy#+uW
zA0Pi@(W3qf;#AR!MiFU1V`}Q;7XZ}g=;&L^moH!4d0%GxV=;Q5v}%0u#ea5Xz*H7v
zs0C2htDAgkPLjQ;Uei_9m-k|Bof9K=J<`T@elFSs{L1-4v{r!yXs#~_(OhHVRRv~J
zwduFjk-_3kC+p_DZ2%s^Ye%rIW1nlc+h*S1@(fC40L@j(XAK^h{7f<csVq0BV9vaD
zr3n@lVxC}qL7mGsZGOAV0P6#ybu~p;fJ~wgrnk77d{K$khgH}fQjsULJf>1XA;YuX
zPTS1W2EL{6Ss<ln;J|4BWf^K?X2L=VcdjRuAk-q@Q3pW!v`Za=sSPfNG=OV!OSCNl
zlzj;{91Klg%r-aL-Y#2&DX#PFuwyRU^nHAcc37{u15S8$DE+V@W?*I+Zx_&>f1@^p
z-3x8%HbC`x1e^B+?t0`JwE-e|3eqNwqF_-0@VeDz9;h}Tk!Jw;nAom|Ap-d+^kuT8
zEJn^nn?8>uEexOw%pz<Bia(mP3gMO&397oyB9AJC!=JReRlXB?Ui5?7xMnA;=v3I<
zZnKEhu06mvUbE=L-l<zKzjfvwIR_$@G}7n6t5(J9GC=C45i$>Ehui-L06G!A|5pQk
Q)Bpeg07*qoM6N<$f&s#9xc~qF

diff --git a/indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Off.png b/indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Off.png
deleted file mode 100644
index b6e9eef891bd5ef3b79e50685c7b0d2922ea6119..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 993
zcmV<710MW|P)<h;3K|Lk000e1NJLTq001HY000*V1^@s6Zt$Jl00004XF*Lt006O%
z3;baP00009a7bBm000ic000ic0Tn1pfB*mh8FWQhbW?9;ba!ELWdKlNX>N2bPDNB8
zb~7$DE;u(kfL#Cp171l)K~zXf#g<7(8(|d3hs0}(R8L+?uYw1?sJQRAZ^gL94Y#PM
zM2%F?szpT*M3OjJCUKIOTBMESV3$K_OTiY}UMz){7TQ}&Z!Lt<5}E$rNMQ~$^Lc6p
zelWcMdvD(NzIopa$DLo7!F6B-%L#%@O;1n1H9b8YT3cJYn+P^GHtumoqtP@mF%h&{
zt@{>>B``8FBK~g{78dSs27}?o`1p8mXlQ6}aBwgo%+Jps(EG7GHZ~R<7#P^QAOXAG
zetL9t^b7o^d&C7U7_0gWo6UA!$mr;(*xTFdV_`O%{aagGZ=%ttq-1-0`;;_Ryp}#Y
zI~$e@!Ip^K-Q7MGCX-1F27^B$k%*)u6bk($jTNt@V^Gcup|*B*b_y(7TU!ITVuy!^
zk`l6!#){X{CnqQO<wE-U`utdtmqlY^qbLYMEF2C?O2|eUD_%>-)Q03jy1Kf2SdoWC
zZEdZ{^L$JcMM(+SNMpro>3Bzjav^A$x4F65#iF{p+P|~26Z3dHk`l6!#){X{X;|b!
z8X6jeii!%i7UkvTp1HZXS7l{oAxuro>2yj;$VM7`UX!n0E;S7k7my2SYHD&<RaNb3
zfrq&9us>~WZO2PXOW!cAk`maycXV_-f=`@$^>V3cJv}}Ce;sk5Ql}P0MMWMQ!(XSS
zrrx8ykJs1N<C~kC5`pi;SxZaH6KEgEhkW&NscGnlPcEdszTSnEIJGD&Ec9Ue9;~je
zo}nvG;dg&{c=#i}NuMe!D<8u4Y-MF7jy%WYtCvenqw_^Bq^_=xFD)%~Xn|Gk=H}-5
z+S}Vt78e)e7`M;ZikAfLzmN^ZJSQLW)yt)(VQK}r5R4vQQc~j3qPV!&QBY9e%FfRA
zBT=-!zyBS!K_YN$zl9zl4L&^i>g7_?=%AAesi~>qu@Z+KXt^^lFOSCqg`Aw61AM3?
zA}cE^KsM6Ihm}W7M`s23HvnhAE|S<;<mcx*Q2oiw%#5T2t$l%RI9TyoI=0-)B_}7F
z(QZ4njFkw5II((nW@cs}BO~KBLHA@MjTNt32u9~xT3XsoDugxvm=K=M3A_gaT1+pd
zkM7Av8Y^B)$BXXeBuO&jAiA28l44FuO0p&B$C-ZEIV#2gE`ci`H4*#;fE)UL4V|HK
P00000NkvXXu0mjf3{Smo

diff --git a/indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Selected_Press.png b/indra/newview/skins/minimal/textures/bottomtray/Speak_Btn_Selected_Press.png
deleted file mode 100644
index 687cb7fb53569a577d619a09ab211290dc909807..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1217
zcmV;y1U~zTP)<h;3K|Lk000e1NJLTq001HY000*V1^@s6Zt$Jl00004XF*Lt006O%
z3;baP00009a7bBm000ic000ic0Tn1pfB*mh8FWQhbW?9;ba!ELWdKlNX>N2bPDNB8
zb~7$DE;u(kfL#Cp1U^YbK~zXf#g=VMTV)i-uPt$3oFRgffeR8kTA&4izQ1$Z(!vUD
zDTa3CmX<MADcu+Y5=a(?y7)#?)MOav6kn#9@q<b0=<Myri<=2<%>dm{v!G!bO$-_n
zO|!_Z&$%`8%k8cD0h;`hlk-34`Ty_JrnwlF{yd0iLku8JY!g_1iJ<J=y~6VK$N0RB
z(h9-PrIlMpaT#x8SJCd@FfNzdUMdpYuF)#i<W0t#suuGXYMW(cs}P%XtAe`fb&SK|
zj8to6w{Vv|Y47!4aUMDNX<L8K!d7ANwJ*xd^<Tm7<Al;`x?$_}UG5wkB>m&VasN}9
z=^Q^sJ~7?AW{ZgLv_$LfKn*>%9X1U;_`KH9v_c1gufcKnz(VKvV4MwNY=Cs0w%)=c
z#gyu!d>W`*&se?%E!#emj(q1e_QrcbmhB<`JUT4ShI=%WFq|v@UHst#RMiJunmSbD
z=lFlPM?#5g`%F6cqKjBge>Kew%gsUG-2UVJ7uaYU3XrO^MX9Ryb130^7!A~_vxO<p
zvh6eJ;0ykA5V_U3v@bx+x<*4WHXQxkr2MUdl;|A}RrxkX12yzO%eK#?gD?1}gX}Xd
zH67}hZ6E22v0*=QfRw&bkP=RFsETQf25RVmmTjL&2Vd}~gGd_jCG$b|taCUJW5XKq
zk&@Goq$<vEsPfk_8mOTMTDE;A9elx`4pNP)u4_E@OXgl;hKYuNCuV#O|61SeyjUH6
zI8_$DkK%<f8mOTMn(=x38<@>>4pSd|!JiKDxKWeTdRxiH!@ejJrYAk;b#Ds()E+f0
z*1YiOFZ@?H)ZUjd8mMbtEc#VDXt<`E=5NAmrgND3;0yl$Du|)S9aDq_8}gH)by-kx
zy?k=VCT|km2tqJ<|6OTNwj@6(ysZfHH(>UE2dOful4`<EnnT_w6L^nnM%kyoDxNC1
zD<6=ri2drTqLDq{3rF|-AnsCLlO099se(;qU;XDWo9P^;KKOz^eItJdiKD>?6X?35
zTA%ZRY)EoLe5!C$`YiuP$xzKIfa;&1Cp#wn5@ujF(>Y9i6eRvn5CgiA4qLpTkBBf~
z3U)-$lb%<59iPa%>pzo>Reo1{Y8M4ajtkf1U4|>5;fGuw!)&H=nEK#bh5XYuk|hWn
zVCwZm!3dsO;kC>OU)o6lN_TTY=Xb{F5NPJVgn-$5LEtq&ge#LukBu}1ks%8PbnUvQ
zbvMORyD7oM4jRd;MU?&--Kr63+4h-qmB$tr;pj$kb90GGjdT&7%n;a*4(mW+m@x$0
zQC(NtjKXD2NLm|a0jQw|8ryCrP337pL6k|1Ac&GeUdd~<7X5-2{kiBnor(Gk=)J8M
zwI16gwaYrEYEJ_-^gzqB$JUoQ%$Lg)wJR7!QQV1%iQ>GxJR&D2XLy@loZ*EXgD@P#
fPQ*iq{O#Z`uskprpa8lU00000NkvXXu0mjfumwaB

diff --git a/indra/newview/skins/minimal/textures/bottomtray/button_separator.png b/indra/newview/skins/minimal/textures/bottomtray/button_separator.png
deleted file mode 100644
index 71ed25f931b519d9d4f2a074b4ce150c5889e9ed..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 153
zcmeAS@N?(olHy`uVBq!ia0vp^OhC-R!3HER>*_fHDVB6cUq=Rpjs4tz5?O(K$r9Iy
zlHmNblJdl&REB`W%)AmkKi3e2GGjecJyXxFKM#P4v^`xMLnOkJpFDc>D?dN~{DA`}
xPyW1r`SNFbW)GG#4c!kC3yO>X^K)?g;AePSDYop*!@D4D44$rjF6*2UngB%VGo%0j

diff --git a/indra/newview/skins/minimal/textures/bottomtray/close_off.png b/indra/newview/skins/minimal/textures/bottomtray/close_off.png
deleted file mode 100644
index 241a24bde904c3a84f9f341858a382abef23330f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 3184
zcmV-$43G1PP)<h;3K|Lk000e1NJLTq000&M000*V1^@s659q(100009a7bBm000XU
z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag
z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V
z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H
zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T
zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j
zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i
z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf
z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G
zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u
zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm
z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v
zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo
z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t
z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl
zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_
zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0
zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O
zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p
z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc=
zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ
zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h
z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z0004-Nkl<Zc-qvI&8pf!97j(+pqGdwU0A#G0n}|>Hi&tEOy1-!`Vd|95%K`y0~nLF
zcB?Po&Q>9Y5RhPIy3&4dbFW}r^asNX!_48&nGemj?a#nh;1kW{JMcww9A`Hgjk=vq
z2Px%UL|xa}@As@$s~@IPs%u#mhr<D-)Lmdr)37WHrBv4hD9e(nsv7Z7mL&itfRyrX
z4VPRvCV*1vZVi`QIFGORCGd8;#kOr6$GOfOk4LgBqu1-bTCx6T#s9W23~^nTG)<9G
zlBOxH>k@`x?Vg()CrN_u``7V!JjVBZk|e1;lbakb77LV8SGe!{#Bod<$G17Is*3aZ
z{NlptbV`<G2qBowW<*g$yWOq@o2L2Oab5B}$MZad5JXXg5CYHh$n*To+wrR7$z*bc
z&gXLggb*mDST2`uJFZI*1b;y<eGmk-;OoC(+qN1Ghn!BQMjpu1(-Z6U`f*QM=Rx`Z
zz@}jsyP_yQwpy)5fJISY7{<=*_xsPA&E}hw@<SsEbp7XGFnHFKQtyEG4Qi1<`fC6T
Weh;P5CNL@h0000<MNUMnLSTYAp84GX

diff --git a/indra/newview/skins/minimal/textures/bottomtray/close_over.png b/indra/newview/skins/minimal/textures/bottomtray/close_over.png
deleted file mode 100644
index 4630cb6dd69960bbf6de23c60014bbd91608d7ae..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 3173
zcmV-r44U(aP)<h;3K|Lk000e1NJLTq000&M000*V1^@s659q(100009a7bBm000XU
z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag
z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V
z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H
zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T
zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j
zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i
z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf
z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G
zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u
zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm
z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v
zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo
z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t
z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl
zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_
zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0
zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O
zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p
z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc=
zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ
zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h
z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z0004yNkl<Zc-pj-v8vlJ6ox<9f{sq(&~(WYBy-migm*)RyvH5-5S{uG8EnWC$ca67
zG<kz8c8MuuOpMgYX>y6fZKL~x5D4izzkUu!1VQi>_zrx*jeY{(#9%O}lv3l#WP-K!
zDWVX9{eI78v#F)Eb{vKw$K%lnI1EFqwPOizKA$nhILV<iCjpExPrL2Z8I)ZWSB^c;
zyLIded@0a5zPHM<q^|3mv%0P+%d+=P7pZsc`1MNDlsJy5stRKaRaFtkF=?9izIju|
zMNy!X0${yfvsf%pN>LO=Z*)S4TkyTE*lxF2Yf(yF_B_wY^Zae?b~>GC+xG6o)oMlC
zwnR~c)|w<q2*a=!ET#Ml7D8OUaIM4Pz;d}HiXyTsBZ?vbk|bd?8vTD1*HEoBzy+RV
z*~2KjN4@wOs<pmx{%~#tL15?ed2h!5Dk&v-o<EM_=^=D|;7af2*yEifec!K|rujS^
z4xIp-ros39N=~QKm)&mn!x;0)(LDY&o6TN?we|z>(P1nG`2A-99QQcJuiY5^00000
LNkvXXu0mjf9@q1&

diff --git a/indra/newview/skins/minimal/textures/bottomtray/close_press.png b/indra/newview/skins/minimal/textures/bottomtray/close_press.png
deleted file mode 100644
index 3ed9c99a26f13d93756eba2ba4dba9c1b3cba9d8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 3259
zcmV;s3`FyZP)<h;3K|Lk000e1NJLTq000&M000*V1^@s659q(100009a7bBm000XU
z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag
z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V
z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H
zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T
zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j
zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i
z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf
z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G
zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u
zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm
z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v
zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo
z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t
z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl
zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_
zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0
zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O
zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p
z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc=
zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ
zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h
z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z0005zNkl<Zc-pj-KaSc!7{%ZG@x~aCNt5IbP^ZlaESu5?uqdF~B6aFixd1LGJPi#O
zaEp{0&R~)zl8rFN!^{?ugO_EOWN|)en$gTpZ{GL4A+~LQ0`L{UM>JF40emLCUT<?e
z9^X?+K`Fh7sFZ?I3XHKI#I|j1Sr$ywYy`aD@3GtMzyYA$Zo@Q97={5t$g7}QYm{XP
z#@GqWImg}I9XRJVDJFzKN(lhJ!Ies__065DSiAx%rCx1A-Q!9euXnQvuu=*DKr6+U
zR+1#hvh2}bmSsqi<k>rwVp_N2e8q8$APA7ADU?!3(-c7vAdcgU=j&E5(=@+WmIcPx
z6DtTI7!HT%cDq<Eml%yka2yBo`5f!@`l1z5%G0<NMFFk#lYq=-Gn8cs-}j-Eg5x+4
zLO=-dtjCAL;ncjBDhxwdmIc>!u~;k+h9O$5*40M7nBhFnF_}!@x-Ntea9tOZ$pm?x
zUj_4eB+mmf9*_S(qbLFZ_`VOVHKx<)#aRE9V$bs)L8B;w5CWd(T~DBG+q%=~z%YzP
zez&qLvE6P#@t=yHC-0W3Gx+&a8dJ;|+ej%tFvc1IN-4n@+wgwBf4^F-z7<9Bt_d)u
t^ygqOxF=fcHvryV8@+!S4gkL%1_0(nK>HnI3RM6A002ovPDHLkV1ly64S@gv

diff --git a/indra/newview/skins/minimal/textures/click_to_move.png b/indra/newview/skins/minimal/textures/click_to_move.png
deleted file mode 100644
index 74e3faa8ffb62e2ce71f1898ef199f692c9b4da4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 8188
zcmXX~byO8!7ah7&q(M@;ySux)TO=f;OS+`<5rXt1q`OO{LApDhfJjPy^IPlt<Gp*=
ztTi*|oV)iv`%J8+x&jtDDLMcESW1er+5iBD3ht#)k->kq1>tjWL339$@&o{kSO5Ls
zfZRM{06^Dpl9AEWbaeA_^K^7`r&5xUp>p?dvv+!L2LQe+`8p1|I>&@!w;NZ|Dlwty
zDsI}ZQK_`0<3kBj-ZE38;VQ>a7cIZm>c^9lLnQnDB?jU1=g@@LTCA9H=u0Sj)Wx5}
zzsAJ<eAo{7>b%f(doc0byeNKHeVN}lh0=$LnW@O5#TSZMDNTvD6+SvNvc1PH8HP^h
z4&b6T+ERNy(ZT_D!J?upG<_&N0G#g}1}e~}2I=D@kAA^9k<KxN3ypy5^GXp^K@BAU
zB>g{2mjROUaH09xZ*_n#h=ApojrA^|$p%<5gdEHPq4{??0dRmxI`wO~FDU@kE4vt3
zz)=LKp3;w#0}MF<0(+GqAz+CO;8ZfOR|LMb0)3OX7!3d_Ccvo`6UhW11^|}dX=#0d
zh#Y`G{;z@P1xqdNAv0L1oCeW$Iw83*6I8YjC<X@Xl#G)~L@WgSR`6E2lI#P1IV9X+
zyf|Bz;{fm_<u#b?<&*CucJ1UO|K}EL3$~M9<QE!i>)q%5DX6<70Bm~&&pfkoG?Ipj
zAcwj<7t^01I+|mA@xG0>Z@`gk2EH7x7+kvlR~xya<o4y|{k^><<soSktDgoz&kh3?
zeFjhO{{@Ra-d=C@?9hdAn}sPL-fazxU#XUoPo<(oSg#!<DLl4fygX9O(F`eBw;M7O
z>}uhE_$-^7aLHXt6Dys{G)zDHV!N}+`hXz5$p?IUCk_{o!d78sgK(q5fNSX0w{r^s
ze>>g!e=(vWggS<APx-u@OFSujp$9_kl~O+dfVnIkyYA0MiBS-VvR}fOze$l@^%Jx9
zA(Qtbt@UF(TJlFo(+v$s<4U93hLU?&GF5+)W{jHnM!{^!@k^3|w@=G4D$O06eL$}b
zTg)Bj-U_v#pRp?p4N>Yl>MJYil^8hdI78acs6;uDchvogi1_hzR6k+}v}jaP_!POc
z<8-O?6e<3SdB6)ro62{jh<pdQKRrfuDR8BSHE4<b!fcjluMi-OkT1rVw)Nu5O(OgP
znf7QR6-(eRI-G_&;;bZz%ZzgN9TB7O487-M9~qRc7i2|Cvl*+Wsm6qkkbcvzM(B*a
zwwbE;LBtP}>qFy5^pU2rqLflJR5eszQmmjNr{l$2K@&hjh|n5fph>GxX?oj%_iu>U
znwu-yP?42(0YB*#2W~)&%#Z*beyj{PLwhp3QhkZ;EdH$gtgANdF>57+SCN!9?Z=9(
za|4P{Ix7{+_sG5cy}>=6J+eLOzb5GU){-Ae?sRq-wST@-CfUc`=iNuP%jTBS`<ko0
zUQwir$CqR*T~pMeU8faY@ru_wS7;)fP)Vh<rZ{7c)RD;X)~W8us{?O6gHk<f+F*9<
zSm7w^2;s^H6D#U<_-Kp+BMF2Uh1h|_hqx|VwTxsgo@7*)Q-BMWeVBuj<ECfG+`=6A
zI^`#NhH}Q+3^Ha8-O8%6s*NfPy-U3@-K0u$ouFEIJszFiO0-{@P`#>rO_&aujzgtL
zMRb)zg`2KKNwCpVEV9v{>Y#>9iPo2Ti`}jfDhwNvMqgHHXDn!xcNpK$+xm&+z>mzG
z*-sRm@nTh#MM5$>$~*>*+L!6}5-7XbAMWzJ)X@$Z%d;+n<2DG+nRb}S%6L`Vx$I1x
zt1`1P4WWuqEvN#lo4@w7Jin}4uG8ot3|necnZcAn!69i9DgRJsS!cZ*y_`@@O!&H%
zy~??itf*7gr`NUoEW4n`JhVX7t$f3;`|zGTh~r83$>qNMS^?7#xe=2Nc@=Y#Sag{0
zgPSM?$LQ*XmW<h;q)e$*hE>*fL`wUN=+}AqM0uP9rxDX#x?PtMmyxe;k>66kRZ%-p
zJImEpYcFFe6HygW9i14TD4tlz;e&{AEpi`14k3$>%~nfeUt`vmik3DzrG`D@GNZGW
zF4st7A)``5J!7**`I`J1`i0J#&T_o+cJ(xMXu*QR;J1sGA1#%wB;WRzkXLJ4Tv~#x
z9IS~PT8C=~&(gZnf;xf{pTtnGqL;Cu6vh<6o=qME!urA+xs!Qk5<$aPna3OshEupx
zOFX+Ruf~{$obq)ba|#Yb4(*=dmof3NDxb#Kv&7jUWFza}yZ4m6u0NP<`_EqILmD9i
zrxmMpXZ&YQXVGhg<Gh7T1x7rc(}Uk-wzT$VBrpmyIGs1EgEeF{!W^0pX*p~-QVePq
zzqOY7RNY#g6N%r5dlc@9?}`d+aBmn{j0^O&es3Mq7<4PJh}@J3p?$G^@qd{C%0ubl
z91vo|q{2+#AMX4Ese3<52(Q}RG%TM=C46a@dM%aospivue+{+c_ut7i)VGJ(lPQx<
z*pZsSM+?&^RtHw`gTa^#k<pO`Q4*isV+=`WxU%?sX4YgpH)Zc-Gi5g*4qO^Sb!^If
z%;Ht-??hJwI(R!IM%e9*#^(+54VB)jkPERh*Ydl*@7a7jy^P+;-@(`oAj;<WZszV+
zG&yh;Sx#8Vj?XHbDXAKxE|~sD3YWQpFoFK>D<AsL=zaqf0}eDCGyF3#OERX+l<I#K
znbrJLf2VZu`OyvYl(O!(M=(?-cd25ju0w<i2y;JDxp0dKcXNfOrX+umuA){;YjHSn
zII#aXR&5vA@I34q-^xLmf%3z-F}WJahz-3(y6i~Tm~oLArNP0@z`l1P_NP!Lw18#e
zbiDEBYO+AydEv_`{s8`VYD;O9iUAvi;X!xxJD~>A4}PoYyRVU0qV$ogMcd+9m|f;I
zpr-~|wZYwQ{nebq%=>?S>TiZ~hGFQT??(o~))r6AGz>Y6Hk+;Pqw>kbU&qGP608zs
zy$)GoT=U&0i+20jo3obQR0$nwx1F+|wLd=CU@I`e&aBEh$ijBTT3%_w+SG44y}prK
z<;a>~T<r{Rk!k<hE85m&SN>yiLPSEhME6SfUYGxDcD>nZ@y>PTj4Yt*hWGdUs!7-F
zllYIGRXsR8wR!t_y9cF*##@Qn*s9~Z%m){<8g-Wsr=tk72u~=q*e#3gzvd}s#dNik
z7Fb{k*rRWHp7YOr*s%Dq^b+$%c4*yY{q~M;(Kc@>v4mGXCInP(qs+beNZ~-i@lHDT
zZ>~H<C-=d`+N48cTzqEXWW)baVf7789<Qj8pYo;d52uymPjhJwf2R`iGxCFi+5fFs
zt`@fh9NJ87zQb`l@4)rio|SuvKNRT_nKb>|=JmH>b^nz?n?Y`!u!YNs*NNzJ+MLE{
zXI^J+ZM&&+`<Z`tbAbKrF<F7Y<oZ>&-v!~z!hC^{*n0P+zuWEb?e!+%dawt>)8ts^
zvJb;qO_xTO#g*i#)UwQa^t^=0^V-t+TFARTpD&j)YYMl>k>OL%Dc4CjGDt}|Nn=r1
zQLq9*aUr1{36H1a$8wn|+o`t&M9;;~W3@zt9Km<<u*J!l?3tphzgcO$E`g;_Cw(xI
zy48_^5z3w)zC2v!SNad9{XT0x6z5+zaWwV<sX`cE9RJl{>r9tFq>-ehy&xiFUq0IK
zu&siAlgdU>TMYpG=>Z@#902~kfa@^;cyj{4i6sCCX9EC{TdKvdJOI3AP?D9>^<DX$
zAMoCEK7UlgXJa?#!uc^S@s&jEr8{Y#q!yzR6DvXH`!8(AE!r6STDZ_pRkh65DTJ^4
zU7`BR>zZgcILaw2)lIK!LRqz-?-eE4wh$XWs(v3!S^^(Lyvnodw-#`VGu7U~L%C`r
zqE7x0SPCVv*lhPXYd;K}Jiis`^^~9S&d;bQD|>s<g6@lY=XB3CF)^X2G@%_r310vw
zj(`}pNe7!bdRHlvsrRQk1mRIu->=f|9m*eNeC#@SioQ7|$7<3VTgl%@UY4EJFl~(K
z+C67)d~}mAb+nj_uSsDJVLrBIS;k+U*_?z>6XE|sD}nbcYt2;0JjyK6?|S^-4sI4I
zeH6yW)z;ST(@lO5_@REFp|q&iK@46HMQq}E9pal^*)~*x7?Ga-i@i*q%bd>$52_BG
zA6`oNjV7LXD*28OMveN&<s_BuEoc<|F`2qo9)9O!@r9eOqh6*3q0&e=MRe;L^F=51
z<s}wzXufWc<VH;8<WEMrZd@(|a(O7YSI$C#4g6GAYtBqfHSV%a)>c+lhL?V4&&S7?
zanxZ>qaw|0#;v7{Zt3#ZTaqv`y@{%1R<Cfaq@)CinokX@0kwpVs>FWQ-w07V3llf4
z*w%Xqv(DdR@G3WBFZp-sf5~8=42^O0=J83S)@3%SDXOeCAP<Z7493mvCQ0<9ms@oH
z+6>{7=!CXEn|cuK4ii~aHyX0m<dzBP>dEQpd6_9JdK1V=X%STGv*<%##}8ZoPWxFw
zmE{nYT0G{fF^k#dr5*M*(_LL_A@uufmjQv?GPJ5nMo(|&Lh!<OEi@uDeBE`_wN*v2
znnvl?UC9>79O&^KhAVPf$s7H>+Ip_9Hg~2(hd;FYp?HRIettgirm=AN{FX;td@_Yr
z!O_hP4B+=i5q^joytTcb!Ouinoe=ic-ya{EI?5T*KX&H(iWaQsF^F{8Rdj}lgh_BX
zOM;J`s)F73I_JvMq)-vYYiVl_AmE6Gj_t!!ad0GYg!~)px<7$pVq=ryC>Y{tlLVlm
z#YF16LME2LH(^I30OfN|zq(b)LWixnLal;va1-TccoPj-<#|c%JUmhr>7;2=+O&rs
zE=!<A>?V?qxi`tRFq2oY5pXg0_x=QOTx%Forz0cs*p#A<ZNvuyS;jfWtW;nHJ8Gx=
zDIpV4bH_v5?pyAH-;8VIySWi0+e8l94DZXFaxaW71LU;a+f5ncJ}tu3{;7&mI#^qO
zs;}o785xNgw$6h3w!&K=n44sVE_M3U8R*SBc$<xq2Tb!OD$;$bg&Ef9?-m)d5`u>}
z$E&NC!5)P;l;_cI+Gff=eg-XbLMAX}&)Tldt;;cQoh@>&G|L<qkbVr7h%4sg;*z4m
zwRChm@@Qk=0A7%WYEh|lz3pN2DT<Gpi`VFCa|zKziSoxVn2oP*_Tyt90&cAAC(px4
zYI(tGeJEUPM)9Xl@C$VoNsF-3l9C8XDoI9yoyUKdS2s7c%97*yAq^?Tj1^UJU{NiL
zoN}$`W6UMijTNJ%?l&)d^JHnP+Axn7c|%4{Kb9Nf@k0{x^72UP4ljKF_;>3X81Qg&
z4{U8wg-KdguGOG#b@uhLvS94|J1p##*PAc*HWM(#*oNeb`lX(nypt}%b!{b+({gln
z-o3lnU3$;Yt2U<i4{Bu6>bn0~<V<ndKwlrZZ$e;m{9<=h$m=M%iHZ<Fy>$003$iDo
z(FuQjt>a~x^%KdxbDaq?b;x6Bea4H9fl*mgQ`*@HDJUo?jWK%U`NPfGWy*?*bmvEt
z;*POMLz-w^Z+JIA)FUY)gFu-S9To-$Vp<=X;j<Z(<t~^ox=Wp+XjyNlO?fn5TU@-X
zgAP8EXdP0^k0CwuhP(Z%rx99J6+U(}TBNiJp=@4uwxzW-ja}j3Hs_b*!onnQjrs?&
ztD?HPq`N!+?Cea%Ns9nJAp03YX@HC?@vuDQs;77TMo*9L=(oFI+spGqWkp5bw)>YV
z=8TLCunf9-`(Y@QmM_mwAm3;enRf75;BZl}$-jL48tx5S(9+c%Iyz!ZOiTnGw{b$Y
zelIuT<6hR3{OCx-4pnsx^}~oB#Kgg|NO?$<rIDq<V>j<YwQPgz@9%^70^xmqeXXmn
zKfAKx&(wRE)+fI8`!z~LRn-(&8_Fb`dc&n=XQJljW{`M0m;XTQ3zB2!sWar3%`7d&
z6f^$b>@758wNDV?XpLY>8XY{CfG}}zOr6|qY?wdawD!VH&(2D#s9*p=K|x)2JMmG+
z54&$(mWW-`LbH40Q-5e@A9s)K7q_)#TXHJW;kOsxzQIIBLk`aq@{9tJ`EzW{sL>va
zJu9Bftt;i`=A(L{c=wUVN~1%P%;Gf<PrK9Gu@EP?dWWfkI_KPvP<J-#dSa1}zbyx&
zu&%DJXJ%&lqp-*@c{KF&$gxpC;eohz#7a{2nYeY^@sdL(TB@sKK%R=<AJKw0!WL>E
zmv=WeH#t<o6G_kgIKkgesOq!h>YPYt9KCYqIn&}(dL#q{h|1@F9334seA|Ez1HvRj
zTUz+5z!R>lEUK!C+u5-ezuQ8PF4ELL^t)Mh$U#5^m<Bt3yug;Ft))WmW|D&Urg={-
z<h0Y>iB4cJFxjqu2M~~O+9oCt?laa;sp{ovr>m`(&kyHhT4s1DJ+ppz^z`)U>FJtU
zT2ijAuFCzBC62tx8X6k%7TiIFj7jGqFAq?3{CKBq8yg#z7FF@5E1k)F5d}3hEb!>o
z{9!d+Ag(a6uqN)84+{d=VOQQWnX`W-8a@q4v&Ed}M)U1n2qGaN`F5MD=L-*m`~qA3
z<fQt^$w>kSzmSlUAbD9u1uB@fOY8aw__hFAIC)^;w<{|jW1f2XHd$sy21!31&(eXm
zg2HIR?ph9Ml;G`c&uzCJLhL-TPmacN;NKq%{~c;o6?1Lxv;Subk&&$}%by=Oy8aAQ
zXAY?5=lt-<7NBcDj$nc}g?pUNBgjys`#v#2Ul8N@{OAXA5<oye05t`KBqmQi6dG^H
zI+Dxh+_oJ>CK!0fNyK3;tEcy#-vpg5lbJoGuuwxu39YoW^zJEmSC}S@WzHKR3?O1R
z{nFU@s&!RON9R>=@0-v@hp9<o>cUE^nCR<qo~dedMbm!XJ!n<Je`Q#1bXactK%1f%
zF*BnD1Yg8k*v?y(GDMb!TlXXz#vs+B{6UwDdH)?u$-g5YX4D!Kau7u_GBQkOk?XDs
zbG)EqSndfD3GOXqDDeHXXc3aXu%KT&Q<1_!9VN*jXF6ctsAXvA*oMQNH73~VS5`@^
zhF3Q@IOyf=4MJB+keq)~0PLw@2q+a*Ro15~&4}<}LgCJhQad7>|FA!Hni=D2%Nqq<
z%_s=wPx@s+NYIaKhgqky@$fH^hV-}aK3L-gj!#VN=Q`IG-CA=z7t?@k17u=^H1!}i
zu1#N6mB-OEwY<E1+j-9eBOBZP4~D|Mq1acLn3y2c`a#b1M`93ZSI7SQdHQkp_JN6&
zwdC73&VAEZ*#Tk`B1qfF^fd1J`Z^fz1PQCK&l&mQWWI^+Aa1hnNoBb{FC87#0f%S#
z)zzHF6mj4<G9kv9>7f(N8NJZpG$v~2`sb-b+9NcNyFXT-`o|R$|6sD-NjOp)ZaRN{
z4(4}RkqrtG1BL3>!h&_PvD3SE++`6C7^v~XpTPSB1hT+3xaQhg&zY!L`Z^ic9rrvs
zD(dL;v=j<u*)KA!jiRQyICTpN7?!p!VvhoaoHS9H2<gAb>=UI}2~Zo2@Gk4A&X8Il
z8dXlD9kp|tn^SLIt`z=yToRL$+j@B5%V`~*oLIZNC;$AZyekS84q11yP(njN0R^P!
z-@hIo&(>m#8Jk*KNU>C|{^Z!Uu3q?egCz3s^whB?hDV3Tgh$`;2E727PDf`ahY&#n
zlI(p@_tmV5=>5@G7JPh+W-6K#RFHaz;Zn3M^n9ftP-tLxgQ>>2Nn$tIv`%6rfpGOs
zxg*CK8s&jpW{V^wB->m4;enTsP1VUEokV$O^}5fayIx*ie_$3bE2xg>(0<Wj11$oZ
zgMvla@Ud4JAVtnHY4wqoSB;h&n@3Pk(ar7LP9;ytjrgD)5x~O28bLRSjEqdr$f)_A
zQ-jeA;Kw3@cvS2ld-Em>sx$FL;Z2ZNu3m>B%Rr_beF%QVnAdE3kF0}3IUHi=`eeS(
zhLVE=0~;F~(;$a6e?fK^J!$jzCIU-N69jAJc2w3}Hsp)-w{PDPlag|?LdMuUleHJU
z-@SXMy;T7dzTF6L`*~u_GGk#eE|!>(plNFQe*6nL1%+8HRHXE#ho1~Qe~?#et^z_r
zLQG;o_nJM6FuqS$2fJWjJZ;@9KwdU5_p@8!dlP)OjTEw}nw<R#ck^yUU<fg}dfawK
zQ!cQ$x;mk&OLVu*kQI#fk;28rg-PK38K2yml&yIjQ#U-Sb*}Gyzy&FKBr0-vLPCNm
z9;5Avkhht`SSA|*5s`+-2x$B+{}HaQ*2-c?2kNtufrjAE!xKm&(BWnBslJLu6cZEU
z<>l1`B|O!}#$1UFQd3qI1vZA=wYu&b<B>@rF^E_F*+^cfrrxzsnSHFC8a3Brr4uPA
z?D9z@=+UtegKg{V9v&XV6cl`}1LTqfkqr3t5gC>rDQ0UTfBaCg;VT?#OVwB)l(n&;
zbzZ3Mw{QHg?!BniNb~W0BXOd|BV^RE9?LH<kUV<Os``MgOh4YC$5aXrJ6b6CQLv__
z1`Ka{dfIZYJKOBI{TH|!KhJ?avB@9n4^{L1g<3qlqxfMp@sAgktCJ^1QBzkpecV|y
zhxkq5r?A@Xi61$cO!kx>yh)bX3RL5kxG=b=!EHNd4`Wus7ME3dC#TAk4mR@%^hjwC
z|7bBrydcm%e5kK4E8!gLHs{!O_ccP{rcFU*P|xc-_VPGwUQ~CUJ}A1m;-{`IYiQv1
z_xA^ux&v-g5$WfstssN4D;R<Yp4M<NzM`LNVd<HfR?Wt!i11BKEt&>8;R2&$Sc_%~
zdS(=1lj`d9y9CE1=?A?Nm%QKvla`id5LxHixXj4Ns928;A_w$FBQh@U-<K2@Tg&0>
zn^gtCU@(=ih!~xAQyu-|y*;|!-CdQA=fS{IMs%=YzF%%Ys#_FsNul$^oLmz^XVD?=
zb((uCEFzM48GNi_0biDhX9#b|7%EOnb=LdxED{!Qh=2lz$`uAHBda~^Agdj<Z=PFU
zpD5~mj7&v&L&q>WCK0$VwWiL{8*tj1CmJF?Y^{hA@lADTdVih{&zA4D81yEf-{E)L
zz*J?Uv1wg3@Zz2+?GVt@I|c;}?7c~&JTCN1(SuT2TK|~=*{@pvQR>Z`UYdHw!l}`f
zX6H&M6cj}P`fOLqQkB-eIiiWzRW&vA3=Gj1CG_k~&Wp7PA7bP}2kzR(6GE5TJ<BsH
zOPdanQ1C)P<3;fADG+9olw1f=5G39Iv+Cw~e?@XHBErPZV$;@}<g?)y-MaByn4X8C
z#aYbRNW#><LZ>fFxP{wYggErbik37gqop;|^v05VaNzt_$JA66oZ|3fIfaCrSam`w
z*YTk9%1%y9c6N54*(8OUPa#KnL9N(bmK!2z6+Vyqj|bhZw-RfPi;Y)So$RWX>P=zb
z!ebN0M~+ek<azUX%kFAz_+4UcIJ+XtZBIzNL~3-fyI%|-b@=;Z-dZ)+xUyL@9kfj-
zFKDlAE-eukX~uv)tjoM^rf>Yx2ay%@x#ERMU0q%2@+|tn_$-=evHP!h644pstn)?>
zFSo&g#aDFh?Q@Q&$9SfDS<tZ`#_8!P=y_+SrzNGN!s<hIM-s`!{CQb!j|&3Mw)?^m
zF5!mPa?-&mp*71WitjK^j1C`-vg?7pW&PQ2r(V#7LF4c0)5A<EP9+EKmk>wB$SW3?
z?UncYUcy;Ta5Y|%F_$-2SD>meGBXcsyQ^Y&IT#nHKXNcIjE2Vh9dV^WMHU0#9#!45
zG4QQJL@5u$am2Tl>TLipigYkHaAunVtt}%ft1akt10OF&jWVXpeAbcr`omEU<8*8V
zj8ydI-@w~p9AoL}*<G$Q2ksZS6*1@vi>&;cvUrN?k?b?P*}#Nv%&`j&)doj~d2ovO
z`t|GH{{HsuLt?~NFT-)fM6b~7+Z=?LV_ZcPX@CB6)nrABeJ0Yx*@cCXdYjQQHT>T&
z*w;F@pY%i*8UHdJ?v-K7EzJayYrzkv^Qtv95*)C8#png^p6BnhdxS(>B<Og=<Um?s
z7E?iTfj=ufTs<)s4i1l~sH(a;HrNIC4iCwC`*YCXdEjU$&@sXk`0GH=_TNm?)ZA>x
zr@OhisSy(LVi(}r!mF|+bih?DRI?2eK6PPmTI$G<6_ql3YF=ycWT@fj=7l)Xdcq8p
z#`isxS>-n8=EA{tczCI$sTsO@I=N&hH>i$7nY(Ryc0I=y`u>F|R`x%6X>Fa`*yt&F
zh2$`Ib2`$c^4d{2@b1s=(7UxmaUT|)-t$pufO;+A<?hs({P|nX1cV=7$9u!?_NWQX
zKzsI6TizlC35k`hZA5J?J2`eVo-Tos{;`Ay&)iO{rxDRH`v_R%BF*pF7`&XEoTs-u
znPJs^o_(8B=%{LQ!R^y5s-6@C^zFw?R};J~EX`G{F)Rhl%uzyfM3LU@rc0+EMJaLk
zArp6g5;K2zCX%MT*9|odFm+JErFhkBY;E`6`HSAVuC|=sfPM8`Q(kh-V~ouL!PR*D
z^|%lQgRzOw%u24b>9M+^BwYa1j>+l-CA@$BJ|@_2jIEXT>AEgNjqCcoz-C}$mLHwm
z1XAqs7Ih5@NqDkx%L@8$<lroLFwE!J%8V+GoLQnDT?BLL2K9eKzaU2ZvYW;b*znyA
z3Ax*j9`SNCQBfHq3VTVjYh=w>>himc`{tLHFY~Rr`5HBu<IU;cYBx}(>z%kzEA{F^
zS>Y>H8`RX*U9*P2oy<4?B64(fC3Le3>dXbG<0a7rY2zjT`@;4%i247U{8TwAdN^u&
oGfXBl)Ji|73SpS;+ou<Rs6w}dPGXr7{JaV%$*IfMN?U&VAG@5P-~a#s

diff --git a/indra/newview/skins/minimal/textures/textures.xml b/indra/newview/skins/minimal/textures/textures.xml
deleted file mode 100644
index e3ed01721a5..00000000000
--- a/indra/newview/skins/minimal/textures/textures.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-<textures version="101">
-  <texture name="Button_Separator" file_name="bottomtray/button_separator.png" preload="true" />
-  <texture name="arrow_keys.png"/>
-  <texture name="click_to_move" file_name="click_to_move.png"/>
-  <texture name="bottomtray_close_off" file_name="bottomtray/close_off.png" preload="true" />
-  <texture name="bottomtray_close_over" file_name="bottomtray/close_over.png" preload="true" />
-  <texture name="bottomtray_close_press" file_name="bottomtray/close_press.png" preload="true" />
-  <texture name="Speak_Btn_Off" file_name="bottomtray/Speak_Btn_Off.png" preload="true" scale.left="4" scale.top="16" scale.right="8" scale.bottom="4" />
-  <texture name="Speak_Btn_Selected_Press" file_name="bottomtray/Speak_Btn_Selected_Press.png" preload="true" scale.left="4" scale.top="16" scale.right="8" scale.bottom="4" />
- </textures>
diff --git a/indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml
deleted file mode 100644
index f95913ef2b9..00000000000
--- a/indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<menu name="ScriptChiclet Menu">
-	<menu_item_call label="Close (TODO: translate to Russian)" name="Close"/>
-</menu>
diff --git a/indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml
deleted file mode 100644
index 2efe6d7e71b..00000000000
--- a/indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<menu name="ScriptChiclet Menu">
-	<menu_item_call label="Close (TODO: translate to Turkish)" name="Close"/>
-</menu>
diff --git a/indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml
deleted file mode 100644
index a0a8520650e..00000000000
--- a/indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<menu name="ScriptChiclet Menu">
-	<menu_item_call label="Close (TODO: translate to Traditional Chinese)" name="Close"/>
-</menu>
diff --git a/indra/newview/skins/minimal/xui/zh_CN/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/zh_CN/menu_script_chiclet.xml
deleted file mode 100644
index 371086c3740..00000000000
--- a/indra/newview/skins/minimal/xui/zh_CN/menu_script_chiclet.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<menu name="ScriptChiclet Menu">
-	<menu_item_call label="Close (TODO: translate to Simplified Chinese)" name="Close"/>
-</menu>
-- 
GitLab


From cc2324d17de664b0dc5f4b3169b232c2c1033433 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 29 Nov 2011 16:35:54 -0800
Subject: [PATCH 309/933] Enabling VBO's for mac by default

---
 indra/newview/featuretable_mac.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 1e2fbc677d5..942c0430816 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -51,7 +51,7 @@ RenderTerrainLODFactor			1	2.0
 RenderTransparentWater			1	1
 RenderTreeLODFactor				1	1.0
 RenderUseImpostors				1	1
-RenderVBOEnable					1	0
+RenderVBOEnable					1	1
 RenderVBOMappingDisable			1	1
 RenderVolumeLODFactor			1	2.0
 UseStartScreen					1	1
-- 
GitLab


From 570d02dc7e41c3e08477e7f759d632db78690eb4 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 29 Nov 2011 16:57:37 -0800
Subject: [PATCH 310/933] Initial merchant outbox button

---
 indra/newview/CMakeLists.txt                  |   2 +
 indra/newview/app_settings/commands.xml       |  10 ++
 indra/newview/llfloateroutbox.cpp             |  68 +++++++++
 indra/newview/llfloateroutbox.h               |  56 ++++++++
 indra/newview/llviewerfloaterreg.cpp          |   2 +
 .../skins/default/textures/textures.xml       |   1 +
 .../default/textures/toolbar_icons/outbox.png | Bin 0 -> 2987 bytes
 .../xui/en/floater_merchant_outbox.xml        | 134 ++++++++++++++++++
 .../skins/default/xui/en/floater_toybox.xml   |  12 +-
 .../newview/skins/default/xui/en/strings.xml  |   2 +
 10 files changed, 281 insertions(+), 6 deletions(-)
 create mode 100644 indra/newview/llfloateroutbox.cpp
 create mode 100644 indra/newview/llfloateroutbox.h
 create mode 100644 indra/newview/skins/default/textures/toolbar_icons/outbox.png
 create mode 100644 indra/newview/skins/default/xui/en/floater_merchant_outbox.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 26e6c485f32..83db4548ded 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -216,6 +216,7 @@ set(viewer_SOURCE_FILES
     llfloaternotificationsconsole.cpp
     llfloaterobjectweights.cpp
     llfloateropenobject.cpp
+    llfloateroutbox.cpp
     llfloaterpay.cpp
     llfloaterperms.cpp
     llfloaterpostprocess.cpp
@@ -789,6 +790,7 @@ set(viewer_HEADER_FILES
     llfloaternotificationsconsole.h
     llfloaterobjectweights.h
     llfloateropenobject.h
+    llfloateroutbox.h
     llfloaterpay.h
     llfloaterperms.h
     llfloaterpostprocess.h
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index a44b895f7bc..c12d22adc32 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -135,6 +135,16 @@
            is_running_function="Floater.IsOpen"
            is_running_parameters="moveview"
            />
+  <command name="outbox"
+           available_in_toybox="true"
+           icon="Command_Outbox_Icon"
+           label_ref="Command_Outbox_Label"
+           tooltip_ref="Command_Outbox_Tooltip"
+           execute_function="Floater.ToggleOrBringToFront"
+           execute_parameters="outbox"
+           is_running_function="Floater.IsOpen"
+           is_running_parameters="outbox"
+           />
   <command name="people"
            available_in_toybox="true"
            icon="Command_People_Icon"
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
new file mode 100644
index 00000000000..8fea3d674e4
--- /dev/null
+++ b/indra/newview/llfloateroutbox.cpp
@@ -0,0 +1,68 @@
+/** 
+ * @file llfloateroutbox.cpp
+ * @brief Implementation of the merchant outbox window
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloateroutbox.h"
+
+#include "llfloaterreg.h"
+#include "lltransientfloatermgr.h"
+
+
+///----------------------------------------------------------------------------
+/// LLFloaterOutbox
+///----------------------------------------------------------------------------
+
+LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
+	: LLFloater(key)
+	, mPanelOutboxInventory(NULL)
+{
+	LLTransientFloaterMgr::getInstance()->addControlView(this);
+}
+
+LLFloaterOutbox::~LLFloaterOutbox()
+{
+	LLTransientFloaterMgr::getInstance()->removeControlView(this);
+}
+
+BOOL LLFloaterOutbox::postBuild()
+{
+	return TRUE;
+}
+
+void LLFloaterOutbox::onOpen(const LLSD& key)
+{
+	//LLFirstUse::useInventory();
+}
+
+void LLFloaterOutbox::onClose(bool app_quitting)
+{
+	LLFloater::onClose(app_quitting);
+	if (mKey.asInteger() > 1)
+	{
+		destroy();
+	}
+}
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
new file mode 100644
index 00000000000..cb5c2be81c4
--- /dev/null
+++ b/indra/newview/llfloateroutbox.h
@@ -0,0 +1,56 @@
+/** 
+ * @file llfloateroutbox.h
+ * @brief LLFloaterOutbox
+ * class definition
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * ABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATEROUTBOX_H
+#define LL_LLFLOATEROUTBOX_H
+
+#include "llfloater.h"
+#include "llfoldertype.h"
+
+class LLInventoryPanel;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLFloaterOutbox
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+class LLFloaterOutbox : public LLFloater
+{
+public:
+	LLFloaterOutbox(const LLSD& key);
+	~LLFloaterOutbox();
+
+	BOOL postBuild();
+
+	// Inherited functionality
+	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/ void onClose(bool app_quitting);
+
+private:
+	LLInventoryPanel* mPanelOutboxInventory;
+};
+
+#endif // LL_LLFLOATEROUTBOX_H
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index acbc5f8fb6f..24070018c27 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -82,6 +82,7 @@
 #include "llfloaternotificationsconsole.h"
 #include "llfloaterobjectweights.h"
 #include "llfloateropenobject.h"
+#include "llfloateroutbox.h"
 #include "llfloaterpay.h"
 #include "llfloaterperms.h"
 #include "llfloaterpostprocess.h"
@@ -237,6 +238,7 @@ void LLViewerFloaterReg::registerFloaters()
 
 	LLFloaterReg::add("object_weights", "floater_object_weights.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterObjectWeights>);
 	LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>);
+	LLFloaterReg::add("outbox", "floater_merchant_outbox.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOutbox>);
 	LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>);
 	LLFloaterPayUtil::registerFloater();
 
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 8702ebde2ab..5da12768812 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -137,6 +137,7 @@ with the same filename but different name
   <texture name="Command_MiniCart_Icon"     file_name="toolbar_icons/mini_cart.png"    preload="true" />
   <texture name="Command_MiniMap_Icon"      file_name="toolbar_icons/mini_map.png"     preload="true" />
   <texture name="Command_Move_Icon"         file_name="toolbar_icons/move.png"         preload="true" />
+  <texture name="Command_Outbox_Icon"       file_name="toolbar_icons/outbox.png"       preload="true" />
   <texture name="Command_People_Icon"       file_name="toolbar_icons/people.png"       preload="true" />
   <texture name="Command_Picks_Icon"        file_name="toolbar_icons/picks.png"        preload="true" />
   <texture name="Command_Places_Icon"       file_name="toolbar_icons/places.png"       preload="true" />
diff --git a/indra/newview/skins/default/textures/toolbar_icons/outbox.png b/indra/newview/skins/default/textures/toolbar_icons/outbox.png
new file mode 100644
index 0000000000000000000000000000000000000000..9fcf46794d1374c08e3b0407515867289a6c3f90
GIT binary patch
literal 2987
zcmV;c3sm%pP)<h;3K|Lk000e1NJLTq000dD000UI1^@s6Z|>B@00009a7bBm000XU
z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag
z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V
z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H
zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T
zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j
zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i
z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf
z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G
zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u
zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm
z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v
zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo
z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t
z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl
zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_
zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0
zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O
zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p
z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc=
zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ
zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h
z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z0002iNkl<Zc-oARQ4Iny42HiF1WW-NIRqeqbASUh-~bdLft&+S065q?kQ*3a4$8yz
z$YmjfCC%1uf4{$zTWU{$16<|9lz*10qN?0d`?{uf-sit!JkTEmPWR^{s%iibND59M
zC`9SrEk*;;5y;iV*8+_|Q~6K}tbsW5p$4`<5>@@E?vL~WA`q;UY~EmX2jo#P;=wK(
zjD(Twd<HHhX$kC%0B`|3u&_oeU|WhD&|A!3K05>J(%#<oxl#H+JK7S#jSEp{ONiAZ
hY=*X_6J?P69smXJZ~w^)%1r<O002ovPDHLkV1h^xhL->U

literal 0
HcmV?d00001

diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..2f8a83c072c
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<floater
+ open_positioning="cascading"
+ can_close="true"
+ can_resize="true"
+ height="400"
+ help_topic="floater_merchant_outbox"
+ min_width="333"
+ min_height="440"
+ name="floater_merchant_outbox"
+ save_rect="true"
+ save_visibility="true"
+ reuse_instance="true"
+ title="MERCHANT OUTBOX"
+ width="333" >
+ <panel
+      follows="all"
+      layout="topleft"
+      left="0"
+      name="marketplace_outbox"
+      class="panel_marketplace_outbox"
+      top="0"
+      label=""
+      height="400"
+      width="330">
+     <string name="OutboxLabelWithArg">Merchant outbox ([NUM])</string>
+     <string name="OutboxLabelNoArg">Merchant outbox</string>
+     <button
+        label="Merchant outbox"
+        font="SansSerifMedium"
+        name="outbox_btn"
+        height="35"
+        width="308"
+        image_unselected="MarketplaceBtn_Off"
+        image_selected="MarketplaceBtn_Selected"
+        halign="left"
+        handle_right_mouse="false"
+        follows="top|left|right"
+        is_toggle="true"
+        tab_stop="false"
+        pad_left="35"
+        top="0"
+        left="10" />
+     <button
+         image_unselected="OutboxPush_Off"
+         image_selected="OutboxPush_Selected"
+         image_hover_selected="OutboxPush_Selected_Over"
+         image_hover_unselected="OutboxPush_Over"
+         image_disabled_selected="OutboxPush_Selected_Disabled"
+         image_disabled="OutboxPush_Disabled"
+         image_pressed="OutboxPush_Press"
+         image_pressed_selected="OutboxPush_Selected_Press"
+         label=""
+         tool_tip="Push to my Marketplace Storefront"
+         is_toggle="false"
+         name="outbox_sync_btn"
+         follows="top|right"
+         tab_stop="false"
+         halign="center"
+         top="6"
+         left="-50"
+         height="23"
+         width="32"
+         enabled="false" />
+     <loading_indicator
+        follows="top|right"
+        name="outbox_sync_indicator"
+        top="6"
+        left="-50"
+        height="23"
+        width="32"
+        images_per_sec="1.15"
+        tab_stop="false"
+        visible="false">
+         <images>
+             <image name="OutboxPush_Progress_1"/>
+             <image name="OutboxPush_Progress_2"/>
+             <image name="OutboxPush_Progress_3"/>
+             <image name="OutboxPush_Progress_4"/>
+             <image name="OutboxPush_Progress_5"/>
+             <image name="OutboxPush_Progress_6"/>
+         </images>
+     </loading_indicator>
+     <panel
+        follows="all"
+        left="10"
+        bottom="400"
+        width="308"
+        top="35"
+        bg_opaque_color="InventoryBackgroundColor"
+        background_visible="true"
+        background_opaque="true"
+        >
+		<panel
+			name="outbox_inventory_placeholder_panel"
+			follows="all"
+			layout="topleft"
+			top="0"
+			left="0"
+			width="308"
+			height="365"
+			bg_opaque_color="InventoryBackgroundColor"
+			background_visible="true"
+			background_opaque="true"
+			>
+			<text
+				name="outbox_inventory_placeholder_title"
+				type="string"
+				follows="all"
+				layout="topleft"
+				top="10"
+				left="0"
+				width="308"
+				height="25"
+				wrap="true"
+				halign="center"
+				font="SansSerifBold">
+				Loading...
+			</text>
+			<text
+				name="outbox_inventory_placeholder_text"
+				type="string"
+				follows="all"
+				layout="topleft"
+				top="35"
+				left="0"
+				width="308"
+				height="130"
+				wrap="true"
+				halign="left" />
+		</panel>
+    </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index 493d44a9cf8..72e6187a14d 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -5,7 +5,7 @@
   can_minimize="false"
   can_resize="false"
   default_tab_group="1"
-  height="330"
+  height="375"
   help_topic="toybox"
   layout="topleft"
   legacy_header_height="18"
@@ -46,7 +46,7 @@
       Buttons will appear as shown or as icon-only depending on each toolbar's settings.
   </text>
   <toolbar
-    bottom="265"
+    bottom="310"
     button_display_mode="icons_with_text"
     follows="all"
     left="20"
@@ -82,11 +82,11 @@
   <panel
     bevel_style="none"
     border="true"
-    bottom="266"
+    bottom="311"
     follows="left|bottom|right"
     left="20"
     right="-20"
-    top="266" />
+    top="311" />
   <button
     follows="left|bottom|right"
     height="23"
@@ -95,7 +95,7 @@
     layout="topleft"
     left="185"
     name="btn_clear_all"
-    top="285"
+    top="330"
     width="130">
     <button.commit_callback function="Toybox.ClearAll" />
   </button>
@@ -107,7 +107,7 @@
     layout="topleft"
     left="335"
     name="btn_restore_defaults"
-    top="285"
+    top="330"
     width="130">
     <button.commit_callback function="Toybox.RestoreDefaults" />
   </button>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index befcc5dd87a..105c6095e6a 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3675,6 +3675,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Marketplace_Label">Marketplace</string>
   <string name="Command_MiniMap_Label">Mini-map</string>
   <string name="Command_Move_Label">Move</string>
+  <string name="Command_Outbox_Label">Merchant outbox</string>
   <string name="Command_People_Label">People</string>
   <string name="Command_Picks_Label">Picks</string>
   <string name="Command_Places_Label">Places</string>
@@ -3700,6 +3701,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Marketplace_Tooltip">Go shopping</string>
   <string name="Command_MiniMap_Tooltip">Show nearby people</string>
   <string name="Command_Move_Tooltip">Moving your avatar</string>
+  <string name="Command_Outbox_Tooltip">Transfer items to your marketplace for sale</string>
   <string name="Command_People_Tooltip">Friends, groups, and nearby people</string>
   <string name="Command_Picks_Tooltip">Places to show as favorites in your profile</string>
   <string name="Command_Places_Tooltip">Places you've saved</string>
-- 
GitLab


From f2f90b6ed8e493a42aff805135527d6a7a345e3e Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 30 Nov 2011 08:03:20 +0200
Subject: [PATCH 311/933] EXP-1636 FIXED Extend menubar label changes to
 floater titles and FUI button labels.

---
 indra/newview/llfloatercamera.cpp             | 21 -------------------
 indra/newview/llfloatercamera.h               |  3 ---
 .../skins/default/xui/da/floater_camera.xml   |  9 --------
 .../skins/default/xui/de/floater_camera.xml   |  9 --------
 .../skins/default/xui/en/floater_avatar.xml   |  2 +-
 .../skins/default/xui/en/floater_camera.xml   | 14 +------------
 .../skins/default/xui/en/floater_moveview.xml |  2 +-
 .../newview/skins/default/xui/en/strings.xml  |  4 ++--
 .../skins/default/xui/es/floater_camera.xml   |  9 --------
 .../skins/default/xui/fr/floater_camera.xml   |  9 --------
 .../skins/default/xui/it/floater_camera.xml   |  9 --------
 .../skins/default/xui/ja/floater_camera.xml   |  9 --------
 .../skins/default/xui/pl/floater_camera.xml   |  9 --------
 .../skins/default/xui/pt/floater_camera.xml   |  9 --------
 .../skins/default/xui/ru/floater_camera.xml   |  9 --------
 .../skins/default/xui/tr/floater_camera.xml   |  9 --------
 .../skins/default/xui/zh/floater_camera.xml   |  9 --------
 17 files changed, 5 insertions(+), 140 deletions(-)

diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index b33dea4890f..313256e5ef2 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -433,26 +433,6 @@ void LLFloaterCamera::setMode(ECameraControlMode mode)
 	updateState();
 }
 
-void LLFloaterCamera::setModeTitle(const ECameraControlMode mode)
-{
-	std::string title; 
-	switch(mode)
-	{
-	case CAMERA_CTRL_MODE_MODES:
-		title = getString("camera_modes_title");
-		break;
-	case CAMERA_CTRL_MODE_PAN:
-		title = getString("pan_mode_title");
-		break;
-	case CAMERA_CTRL_MODE_PRESETS:
-		title = getString("presets_mode_title");
-		break;
-	default:
-		break;
-	}
-	setTitle(title);
-}
-
 void LLFloaterCamera::switchMode(ECameraControlMode mode)
 {
 	setMode(mode);
@@ -532,7 +512,6 @@ void LLFloaterCamera::updateState()
 	{
 		iter->second->setToggleState(iter->first == mCurrMode);
 	}
-	setModeTitle(mCurrMode);
 }
 
 void LLFloaterCamera::updateItemsSelection()
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h
index 4572932853c..4d6d03f22d9 100644
--- a/indra/newview/llfloatercamera.h
+++ b/indra/newview/llfloatercamera.h
@@ -102,9 +102,6 @@ class LLFloaterCamera : public LLFloater
 	/* sets a new mode preserving previous one and updates ui*/
 	void setMode(ECameraControlMode mode);
 
-	/** set title appropriate to passed mode */
-	void setModeTitle(const ECameraControlMode mode);
-
 	/* updates the state (UI) according to the current mode */
 	void updateState();
 
diff --git a/indra/newview/skins/default/xui/da/floater_camera.xml b/indra/newview/skins/default/xui/da/floater_camera.xml
index 5b7ef6db546..b5d5e8bc084 100644
--- a/indra/newview/skins/default/xui/da/floater_camera.xml
+++ b/indra/newview/skins/default/xui/da/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Flyt kamera op og ned, til venstre og højre
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Kamera valg
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Kredsløb zoom panorering
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Forvalg
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Se objekt
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/de/floater_camera.xml b/indra/newview/skins/default/xui/de/floater_camera.xml
index bbf1c8af600..7e9ebdb6435 100644
--- a/indra/newview/skins/default/xui/de/floater_camera.xml
+++ b/indra/newview/skins/default/xui/de/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Kamera nach oben, unten, links und rechts bewegen
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Kameramodi
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Kreisen - Zoomen - Schwenken
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ansichten
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Objekt ansehen
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml
index 6009821f7fa..82c34030082 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar.xml
@@ -15,7 +15,7 @@
  help_topic="avatar"
  save_rect="true"
  save_visibility="true"
- title="AVATAR PICKER"
+ title="CHOOSE AN AVATAR"
  width="700">
     <web_browser
       top="25"
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index e7f52072717..c9b24bf3250 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -13,7 +13,7 @@
  help_topic="camera_floater"
  save_visibility="true"
  single_instance="true"
- title="VIEW"
+ title="CAMERA CONTROLS"
  chrome="true"
  save_rect="true"
  width="228">
@@ -29,18 +29,6 @@
      name="move_tooltip">
         Move Camera Up and Down, Left and Right
     </floater.string>
-    <floater.string
-     name="camera_modes_title">
-        Camera modes
-    </floater.string>
-    <floater.string
-     name="pan_mode_title">
-       Orbit Zoom Pan
-    </floater.string>
-    <floater.string
-     name="presets_mode_title">
-        Preset Views
-    </floater.string>
     <floater.string
      name="free_mode_title">
         View Object
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index e96039a3e15..6ba812abff7 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -16,7 +16,7 @@
  save_visibility="true"
  single_instance="true"
  chrome="true"
- title="MOVE"
+ title="WALK / RUN / FLY"
  width="133">
     <string
      name="walk_forward_tooltip">
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index befcc5dd87a..c25d1f57d6e 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3674,7 +3674,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Map_Label">Map</string>
   <string name="Command_Marketplace_Label">Marketplace</string>
   <string name="Command_MiniMap_Label">Mini-map</string>
-  <string name="Command_Move_Label">Move</string>
+  <string name="Command_Move_Label">Walk / run / fly</string>
   <string name="Command_People_Label">People</string>
   <string name="Command_Picks_Label">Picks</string>
   <string name="Command_Places_Label">Places</string>
@@ -3683,7 +3683,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Search_Label">Search</string>
   <string name="Command_Snapshot_Label">Snapshot</string>
   <string name="Command_Speak_Label">Speak</string>
-  <string name="Command_View_Label">View</string>
+  <string name="Command_View_Label">Camera controls</string>
   <string name="Command_Voice_Label">Voice settings</string>
 
   <string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>
diff --git a/indra/newview/skins/default/xui/es/floater_camera.xml b/indra/newview/skins/default/xui/es/floater_camera.xml
index cdcb9a146b2..f8911f3a4a5 100644
--- a/indra/newview/skins/default/xui/es/floater_camera.xml
+++ b/indra/newview/skins/default/xui/es/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Mover la cámara arriba y abajo, izquierda y derecha
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modos de cámara
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Orbital - Zoom - Panorámica
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Vistas predefinidas
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Centrar el objeto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/fr/floater_camera.xml b/indra/newview/skins/default/xui/fr/floater_camera.xml
index 97ff246c4d7..77d3c2cfe4d 100644
--- a/indra/newview/skins/default/xui/fr/floater_camera.xml
+++ b/indra/newview/skins/default/xui/fr/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Déplacer la caméra vers le haut et le bas, la gauche et la droite
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modes
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Rotation - Zoom - Panoramique
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Préréglages
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Voir l&apos;objet
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/it/floater_camera.xml b/indra/newview/skins/default/xui/it/floater_camera.xml
index be4b8e210d6..7e6ca4307ed 100644
--- a/indra/newview/skins/default/xui/it/floater_camera.xml
+++ b/indra/newview/skins/default/xui/it/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Muovi la telecamera su e giù e a sinistra e destra
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modalità della fotocamera
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Ruota visuale - Ingrandisci - Panoramica
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Visuali predefinite
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Vedi oggetto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ja/floater_camera.xml b/indra/newview/skins/default/xui/ja/floater_camera.xml
index 5d3a0489756..0661e173091 100644
--- a/indra/newview/skins/default/xui/ja/floater_camera.xml
+++ b/indra/newview/skins/default/xui/ja/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		カメラを上下左右に移動
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		カメラモード
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		旋回 - ズーム - 水平・垂直移動
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		事前設定の視野
-	</floater.string>
 	<floater.string name="free_mode_title">
 		オブジェクトを見る
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/pl/floater_camera.xml b/indra/newview/skins/default/xui/pl/floater_camera.xml
index 5b9dd476160..60f3cd0fffd 100644
--- a/indra/newview/skins/default/xui/pl/floater_camera.xml
+++ b/indra/newview/skins/default/xui/pl/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Poruszaj kamerą w dół/górę oraz w prawo/lewo
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Ustawienia
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		W prawo lub w lewo
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ustaw widok
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Zobacz obiekt
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/pt/floater_camera.xml b/indra/newview/skins/default/xui/pt/floater_camera.xml
index 0e4fc1b4558..6b66d017816 100644
--- a/indra/newview/skins/default/xui/pt/floater_camera.xml
+++ b/indra/newview/skins/default/xui/pt/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Mover a Câmera para Cima e para Baixo, para a Esquerda e para a Direita
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modos de câmera
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Pan zoom orbital
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ângulos predefinidos
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Visualizar objeto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ru/floater_camera.xml b/indra/newview/skins/default/xui/ru/floater_camera.xml
index 7a1f530668a..945a63c0eb8 100644
--- a/indra/newview/skins/default/xui/ru/floater_camera.xml
+++ b/indra/newview/skins/default/xui/ru/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Переместить камеру вверх, вниз, влево или вправо
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Режимы камеры
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Вращение, приближение, сдвиг
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Стандартные настройки
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Смотреть на объект
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/tr/floater_camera.xml b/indra/newview/skins/default/xui/tr/floater_camera.xml
index 4161e6ea52a..c92d4e9db49 100644
--- a/indra/newview/skins/default/xui/tr/floater_camera.xml
+++ b/indra/newview/skins/default/xui/tr/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Kamerayı Yukarı ve Aşağı, Sola ve Sağa Hareket Ettir
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Kamera modları
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Yörünge - Yakınlş. - Kamerayı Çvr.
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ön Ayarlı Görünümler
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Nesneyi Göster
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/zh/floater_camera.xml b/indra/newview/skins/default/xui/zh/floater_camera.xml
index f4db20684c5..b75474340c7 100644
--- a/indra/newview/skins/default/xui/zh/floater_camera.xml
+++ b/indra/newview/skins/default/xui/zh/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Move Camera Up and Down, Left and Right
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		攝影機模式
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		環繞縮放平移
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		預設視角
-	</floater.string>
 	<floater.string name="free_mode_title">
 		視角物件
 	</floater.string>
-- 
GitLab


From 9771733ac9d2a624ac5fd4e84d60edffdcfd9ee3 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 30 Nov 2011 08:18:52 +0200
Subject: [PATCH 312/933] EXP-1640 FIXED Fixed weirdly looking Snapshot floater
 in Italian and French locales.

---
 indra/newview/skins/default/xui/fr/floater_snapshot.xml | 2 +-
 indra/newview/skins/default/xui/it/floater_snapshot.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/fr/floater_snapshot.xml b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
index 34d0957b461..365ff77ff94 100644
--- a/indra/newview/skins/default/xui/fr/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="APERÇU DE LA PHOTO" width="247">
+<floater name="Snapshot" title="APERÇU DE LA PHOTO">
 	<floater.string name="unknown">
 		inconnu
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/it/floater_snapshot.xml b/indra/newview/skins/default/xui/it/floater_snapshot.xml
index 5bff19e8d75..f1c5cc4caf7 100644
--- a/indra/newview/skins/default/xui/it/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/it/floater_snapshot.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA" width="247">
+<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA">
 	<floater.string name="unknown">
 		sconosciuto
 	</floater.string>
-- 
GitLab


From 19545f58ad868470ff04b452697161cd57025220 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 30 Nov 2011 08:35:25 +0200
Subject: [PATCH 313/933] EXP-1641 FIXED Snapshot floater doesn't persist
 between sessions anymore to avoid capturing login screen.

---
 indra/newview/skins/default/xui/en/floater_snapshot.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 85f65dedd38..61f2e7e72d7 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -10,7 +10,7 @@
  name="Snapshot"
  help_topic="snapshot"
  save_rect="true"
- save_visibility="true"
+ save_visibility="false"
  title="SNAPSHOT PREVIEW"
  width="470">
     <floater.string
-- 
GitLab


From ff32ef773b19a6d0f7826c7edf7962e2fde492e6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 29 Nov 2011 23:53:28 -0800
Subject: [PATCH 314/933] fix for crash on startup (font system not initialized
 when first creating fonts)

---
 indra/llrender/llfontfreetype.cpp | 7 +++++--
 indra/newview/llviewerwindow.cpp  | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 91c8a37022a..66d4ad2d87d 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -55,7 +55,10 @@ FT_Library gFTLibrary = NULL;
 //static
 void LLFontManager::initClass()
 {
-	gFontManagerp = new LLFontManager;
+	if (!gFontManagerp) 
+	{
+		gFontManagerp = new LLFontManager;
+	}
 }
 
 //static
@@ -136,7 +139,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
 		FT_Done_Face(mFTFace);
 		mFTFace = NULL;
 	}
-
+	
 	int error;
 
 	error = FT_New_Face( gFTLibrary,
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 2479006eeb7..22076417a64 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4745,6 +4745,9 @@ void LLViewerWindow::initFonts(F32 zoom_factor)
 {
 	LLFontGL::destroyAllGL();
 	// Initialize with possibly different zoom factor
+
+	LLFontManager::initClass();
+
 	LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"),
 								mDisplayScale.mV[VX] * zoom_factor,
 								mDisplayScale.mV[VY] * zoom_factor,
-- 
GitLab


From 93dbcb4dc8b22ebbdd7c97854b3559502c68ed43 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 30 Nov 2011 05:26:07 -0500
Subject: [PATCH 315/933] STORM-1719 notifications.xml has two instances where
 a button shows as "Ok" and Not "OK"

---
 doc/contributions.txt                                | 1 +
 indra/newview/skins/default/xui/en/notifications.xml | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..ce1dc07c493 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1719
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e4458f33b17..4e4eea03547 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6939,7 +6939,7 @@ With the following Residents:
 	<usetemplate
      name="okcancelbuttons"
      notext="Cancel"
-     yestext="Ok"/>
+     yestext="OK"/>
   </notification>
   
   <notification
@@ -7135,7 +7135,7 @@ Mute everyone?
     <usetemplate
      ignoretext="Confirm before I mute all participants in a group call"
      name="okcancelignore"
-     yestext="Ok"
+     yestext="OK"
      notext="Cancel">
       <unique/>
     </usetemplate>
-- 
GitLab


From ac762b0426bf5b5e0edd5d725ba6c01a39cb0248 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 30 Nov 2011 19:37:12 +0200
Subject: [PATCH 316/933] EXP-1634 FIXED Removed the "exchange rates" link from
 the L$ Buy Dialog.

---
 indra/newview/skins/default/xui/da/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/de/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/en/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/es/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/fr/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/it/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/ja/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/pl/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/pt/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/ru/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/tr/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/zh/floater_buy_currency.xml | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml
index ec47b2f445b..3c0428b2b08 100644
--- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Indtast beløbet for at se nyeste valutakurs.
diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml
index 38321b79065..e766b622f7b 100644
--- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=de-DE Umtauschrate]
+		[http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung]
 	</text>
 	<text name="exchange_rate_note">
 		Geben Sie den Betrag erneut ein, um die aktuellste Umtauschrate anzuzeigen.
diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
index 49ca6cc8bae..6afa24d04af 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
@@ -224,7 +224,7 @@
      width="300"
      height="30"
      name="currency_links">
-      [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+      [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
     </text>
     <text
      type="string"
diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml
index 43bbf0b70fc..2c8848265f4 100644
--- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php método de pago] | [http://www.secondlife.com/my/account/currency.php moneda] | [http://www.secondlife.com/my/account/exchange_rates.php tipo de cambio]
+		[http://www.secondlife.com/my/account/payment_method_management.php método de pago] | [http://www.secondlife.com/my/account/currency.php moneda]
 	</text>
 	<text name="exchange_rate_note">
 		Vuelve a escribir la cantidad para ver el tipo de cambio más reciente.
diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
index b3acc830789..d9e8e8821df 100644
--- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
@@ -47,7 +47,7 @@ le Lindex...
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=fr-FR taux de change]
+		[http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise]
 	</text>
 	<text name="exchange_rate_note">
 		Saisissez à nouveau le montant pour voir le taux de change actuel.
diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
index 635b56d37a2..d985ad2b3cb 100644
--- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT]L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Riscrivi l&apos;importo per vedere l&apos;ultimo tasso al cambio.
diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
index 22af6e0ea26..e447eefe0e7 100644
--- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP 換算レート]
+		[http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨]
 	</text>
 	<text name="exchange_rate_note">
 		金額を再入力して最新換算レートを確認します。
diff --git a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml
index f2a6579dc37..3e51761b37e 100644
--- a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT]L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php metoda płatności] | [http://www.secondlife.com/my/account/currency.php waluta] | [http://www.secondlife.com/my/account/exchange_rates.php kurs wymiany]
+		[http://www.secondlife.com/my/account/payment_method_management.php metoda płatności] | [http://www.secondlife.com/my/account/currency.php waluta]
 	</text>
 	<text name="exchange_rate_note">
 		Wpisz ponownie kwotę aby zobaczyć ostatni kurs wymiany.
diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
index a737212b50c..b5ba477fe53 100644
--- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Digite o valor novamente para ver o câmbio atual.
diff --git a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
index 7690ff2a6c8..7d34ca32740 100644
--- a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта] | [http://www.secondlife.com/my/account/exchange_rates.php обменный курс]
+		[http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта]
 	</text>
 	<text name="exchange_rate_note">
 		Повторно введите сумму, чтобы увидеть новый обменный курс.
diff --git a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
index 48cd93ccf9c..6608fd72e10 100644
--- a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi | [http://www.secondlife.com/my/account/exchange_rates.php döviz kurları]
+		[http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi
 	</text>
 	<text name="exchange_rate_note">
 		En son döviz kurunu görmek için miktarı yeniden girin.
diff --git a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
index d63e73c6f19..9f6591faf9f 100644
--- a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Re-enter amount to see the latest exchange rate.
-- 
GitLab


From 83c3d378275e4da6f4aa0b148853abf770f73e86 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 30 Nov 2011 11:20:26 -0700
Subject: [PATCH 317/933] trivial: change a log info for memory failure for
 LLImageBase

---
 indra/llimage/llimage.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index c239e3df88c..56e01ac851e 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -195,7 +195,7 @@ U8* LLImageBase::allocateData(S32 size)
 		mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
 		if (!mData)
 		{
-			llwarns << "allocate image data: " << size << llendl;
+			llwarns << "Failed to allocate image data size [" << size << "]" << llendl;
 			size = 0 ;
 			mWidth = mHeight = 0 ;
 			mBadBufferAllocation = true ;
-- 
GitLab


From e6f5a57395a64b8dcfe85f20b0a63402c77a3c5f Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 30 Nov 2011 11:21:22 -0700
Subject: [PATCH 318/933] fix for SH-2668: "ocean" water is always 20m high
 instead of the Region Water Height

---
 indra/newview/llworld.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 6f6e0d23347..676287c0add 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -818,14 +818,11 @@ void LLWorld::updateWaterObjects()
 	max_x = (S32)region_x + range;
 	max_y = (S32)region_y + range;
 
-	F32 height = 0.f;
-	
 	for (region_list_t::iterator iter = mRegionList.begin();
 		 iter != mRegionList.end(); ++iter)
 	{
 		LLViewerRegion* regionp = *iter;
 		LLVOWater* waterp = regionp->getLand().getWaterObj();
-		height += regionp->getWaterHeight();
 		if (waterp)
 		{
 			gObjectList.updateActive(waterp);
@@ -842,6 +839,7 @@ void LLWorld::updateWaterObjects()
 
 	// Now, get a list of the holes
 	S32 x, y;
+	F32 water_height = gAgent.getRegion()->getWaterHeight() + 256.f;
 	for (x = min_x; x <= max_x; x += rwidth)
 	{
 		for (y = min_y; y <= max_y; y += rwidth)
@@ -853,7 +851,7 @@ void LLWorld::updateWaterObjects()
 				waterp->setUseTexture(FALSE);
 				waterp->setPositionGlobal(LLVector3d(x + rwidth/2,
 													 y + rwidth/2,
-													 256.f+DEFAULT_WATER_HEIGHT));
+													 water_height));
 				waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f));
 				gPipeline.createObject(waterp);
 				mHoleWaterObjects.push_back(waterp);
@@ -910,8 +908,7 @@ void LLWorld::updateWaterObjects()
 		}
 
 		waterp->setRegion(gAgent.getRegion());
-		LLVector3d water_pos(water_center_x, water_center_y, 
-			DEFAULT_WATER_HEIGHT+256.f);
+		LLVector3d water_pos(water_center_x, water_center_y, water_height) ;
 		LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f);
 
 		//stretch out to horizon
-- 
GitLab


From 8294179dbc7e2376fa7773a77e536e9a31479b87 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 30 Nov 2011 15:26:09 -0500
Subject: [PATCH 319/933] Added tag 3.2.4-start for changeset 3fe994349fae

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index b863bbe37be..168ff66cf9e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -228,3 +228,4 @@ c4911ec8cd81e676dfd2af438b3e065407a94a7a 3.2.1-start
 80f3e30d8aa4d8f674a48bd742aaa6d8e9eae0b5 3.2.3-start
 a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
 a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
+3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-start
-- 
GitLab


From f5a94e0f8196c5c068995090cd57bb27e97aaac9 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 30 Nov 2011 15:27:00 -0500
Subject: [PATCH 320/933] increment viewer version to 3.2.5

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index b50405421d1..deac3d1780b 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 4;
+const S32 LL_VERSION_PATCH = 5;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From d05e8361ccc60cfc0f269d63a5a0e6b0a06ec7c1 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 30 Nov 2011 15:01:54 -0800
Subject: [PATCH 321/933] sync with viewer-development

---
 indra/newview/skins/default/xui/da/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/de/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/en/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/en/floater_snapshot.xml     | 2 +-
 indra/newview/skins/default/xui/es/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/fr/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/fr/floater_snapshot.xml     | 2 +-
 indra/newview/skins/default/xui/it/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/it/floater_snapshot.xml     | 2 +-
 indra/newview/skins/default/xui/ja/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/pl/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/pt/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/ru/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/tr/floater_buy_currency.xml | 2 +-
 indra/newview/skins/default/xui/zh/floater_buy_currency.xml | 2 +-
 15 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml
index ec47b2f445b..3c0428b2b08 100644
--- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Indtast beløbet for at se nyeste valutakurs.
diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml
index 38321b79065..e766b622f7b 100644
--- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=de-DE Umtauschrate]
+		[http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung]
 	</text>
 	<text name="exchange_rate_note">
 		Geben Sie den Betrag erneut ein, um die aktuellste Umtauschrate anzuzeigen.
diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
index 49ca6cc8bae..6afa24d04af 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
@@ -224,7 +224,7 @@
      width="300"
      height="30"
      name="currency_links">
-      [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+      [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
     </text>
     <text
      type="string"
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 85f65dedd38..61f2e7e72d7 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -10,7 +10,7 @@
  name="Snapshot"
  help_topic="snapshot"
  save_rect="true"
- save_visibility="true"
+ save_visibility="false"
  title="SNAPSHOT PREVIEW"
  width="470">
     <floater.string
diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml
index 43bbf0b70fc..2c8848265f4 100644
--- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php método de pago] | [http://www.secondlife.com/my/account/currency.php moneda] | [http://www.secondlife.com/my/account/exchange_rates.php tipo de cambio]
+		[http://www.secondlife.com/my/account/payment_method_management.php método de pago] | [http://www.secondlife.com/my/account/currency.php moneda]
 	</text>
 	<text name="exchange_rate_note">
 		Vuelve a escribir la cantidad para ver el tipo de cambio más reciente.
diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
index b3acc830789..d9e8e8821df 100644
--- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
@@ -47,7 +47,7 @@ le Lindex...
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=fr-FR taux de change]
+		[http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise]
 	</text>
 	<text name="exchange_rate_note">
 		Saisissez à nouveau le montant pour voir le taux de change actuel.
diff --git a/indra/newview/skins/default/xui/fr/floater_snapshot.xml b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
index 34d0957b461..365ff77ff94 100644
--- a/indra/newview/skins/default/xui/fr/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="APERÇU DE LA PHOTO" width="247">
+<floater name="Snapshot" title="APERÇU DE LA PHOTO">
 	<floater.string name="unknown">
 		inconnu
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
index 635b56d37a2..d985ad2b3cb 100644
--- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT]L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Riscrivi l&apos;importo per vedere l&apos;ultimo tasso al cambio.
diff --git a/indra/newview/skins/default/xui/it/floater_snapshot.xml b/indra/newview/skins/default/xui/it/floater_snapshot.xml
index 5bff19e8d75..f1c5cc4caf7 100644
--- a/indra/newview/skins/default/xui/it/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/it/floater_snapshot.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA" width="247">
+<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA">
 	<floater.string name="unknown">
 		sconosciuto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
index 22af6e0ea26..e447eefe0e7 100644
--- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP 換算レート]
+		[http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨]
 	</text>
 	<text name="exchange_rate_note">
 		金額を再入力して最新換算レートを確認します。
diff --git a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml
index f2a6579dc37..3e51761b37e 100644
--- a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT]L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php metoda płatności] | [http://www.secondlife.com/my/account/currency.php waluta] | [http://www.secondlife.com/my/account/exchange_rates.php kurs wymiany]
+		[http://www.secondlife.com/my/account/payment_method_management.php metoda płatności] | [http://www.secondlife.com/my/account/currency.php waluta]
 	</text>
 	<text name="exchange_rate_note">
 		Wpisz ponownie kwotę aby zobaczyć ostatni kurs wymiany.
diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
index a737212b50c..b5ba477fe53 100644
--- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Digite o valor novamente para ver o câmbio atual.
diff --git a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
index 7690ff2a6c8..7d34ca32740 100644
--- a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта] | [http://www.secondlife.com/my/account/exchange_rates.php обменный курс]
+		[http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта]
 	</text>
 	<text name="exchange_rate_note">
 		Повторно введите сумму, чтобы увидеть новый обменный курс.
diff --git a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
index 48cd93ccf9c..6608fd72e10 100644
--- a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi | [http://www.secondlife.com/my/account/exchange_rates.php döviz kurları]
+		[http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi
 	</text>
 	<text name="exchange_rate_note">
 		En son döviz kurunu görmek için miktarı yeniden girin.
diff --git a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
index d63e73c6f19..9f6591faf9f 100644
--- a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
+		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
 	</text>
 	<text name="exchange_rate_note">
 		Re-enter amount to see the latest exchange rate.
-- 
GitLab


From 0c54cf51db0c1a6e0b2ac91d69b2646570b168eb Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 30 Nov 2011 18:32:28 -0800
Subject: [PATCH 322/933] gcc fix attempt

---
 indra/llxuixml/llinitparam.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 80b6504c4f7..7927f84cba5 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -598,7 +598,7 @@ namespace LLInitParam
 		}
 
 	private:
-		friend BaseBlock;
+		friend class BaseBlock;
 
 		U32		mEnclosingBlockOffset:31;
 		U32		mIsProvided:1;
@@ -736,7 +736,7 @@ namespace LLInitParam
 
 		self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
 		{
-			if (NAME_VALUE_LOOKUP::getValueFromName(name, mValue))
+			if (NAME_VALUE_LOOKUP::getValueFromName(name, *this))
 			{
 				setValueName(name);
 			}
@@ -817,7 +817,7 @@ namespace LLInitParam
 	public:
 		typedef	TypedParam<T, NAME_VALUE_LOOKUP, HAS_MULTIPLE_VALUES, VALUE_IS_BLOCK>		self_t;
 		typedef ParamValue<T, NAME_VALUE_LOOKUP>											param_value_t;
-		typedef param_value_t::value_assignment_t											value_assignment_t;
+		typedef typename param_value_t::value_assignment_t				value_assignment_t;
 		typedef NAME_VALUE_LOOKUP															name_value_lookup_t;
 
 		using param_value_t::operator();
@@ -1261,7 +1261,7 @@ namespace LLInitParam
 			setProvided();
 		}
 
-		void add(typename const name_value_lookup_t::name_t& name)
+		void add(const typename name_value_lookup_t::name_t& name)
 		{
 			value_t value;
 
@@ -1447,7 +1447,7 @@ namespace LLInitParam
 			setProvided();
 		}
 
-		void add(typename const name_value_lookup_t::name_t& name)
+		void add(const typename name_value_lookup_t::name_t& name)
 		{
 			value_t value;
 
-- 
GitLab


From 5535722ea5c2f64a25ca569c930e969f2e989af9 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Thu, 1 Dec 2011 12:31:56 +0000
Subject: [PATCH 323/933] STORM-1708 Linux UI additions

---
 indra/newview/llfilepicker.cpp                 | 14 +++++++++++++-
 indra/newview/skins/default/xui/en/strings.xml |  5 +++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 3cbc4e5648f..d259e024525 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -1197,7 +1197,12 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
 	add_common_filters_to_gtkchooser(gfilter, picker, filtername);
 	return filtername;
 }
-
+ 
+static std::string add_script_filter_to_gtkchooser(GtkWindow *picker)
+{
+	return add_simple_mime_filter_to_gtkchooser(picker,  "text/plain",
+							LLTrans::getString("script_files") + " (*.lsl)");
+}
 
 BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename )
 {
@@ -1263,6 +1268,10 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
 				 LLTrans::getString("compressed_image_files") + " (*.j2c)");
 			suggest_ext = ".j2c";
 			break;
+		case FFSAVE_SCRIPT:
+			caption += add_script_filter_to_gtkchooser(picker);
+			suggest_ext = ".lsl";
+			break;
 		default:;
 			break;
 		}
@@ -1328,6 +1337,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
 		case FFLOAD_IMAGE:
 			filtername = add_imageload_filter_to_gtkchooser(picker);
 			break;
+		case FFLOAD_SCRIPT:
+			filtername = add_script_filter_to_gtkchooser(picker);
+			break;
 		default:;
 			break;
 		}
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index befcc5dd87a..0d26465dfa4 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -427,9 +427,10 @@ Please try logging in again in a minute.</string>
 	<string name="compressed_image_files">Compressed Images</string>
 	<string name="load_files">Load Files</string>
 	<string name="choose_the_directory">Choose Directory</string>
+  <string name="script_files">Scripts</string>
 
-	<!-- LSL Usage Hover Tips -->
-	<!-- NOTE: For now these are set as translate="false", until DEV-40761 is implemented (to internationalize the rest of tooltips in the same window).
+  <!-- LSL Usage Hover Tips -->
+  <!-- NOTE: For now these are set as translate="false", until DEV-40761 is implemented (to internationalize the rest of tooltips in the same window).
              This has no effect on viewer code, but prevents Linden Lab internal localization tool from scraping these strings.  -->
 	<string name="LSLTipSleepTime" translate="false">
 Sleeps script for [SLEEP_TIME] seconds.
-- 
GitLab


From 47e493f5f8ed6b06d4920b7679b1e00c2e3a9229 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 1 Dec 2011 09:49:06 -0500
Subject: [PATCH 324/933] STORM-1721 Set UI Size to Default Option Duplicated
 in Advanced Menu

---
 doc/contributions.txt                              | 1 +
 indra/newview/skins/default/xui/en/menu_viewer.xml | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..ec329b01714 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1721
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index c8c1922bf67..3a581e7e6e8 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1723,12 +1723,6 @@
                  function="Tools.EnableReleaseKeys"
                  parameter="" />
             </menu_item_call>
-            <menu_item_call
-             label="Set UI Size to Default"
-             name="Set UI Size to Default">
-                <menu_item_call.on_click
-                 function="View.DefaultUISize" />
-            </menu_item_call>
             <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
             <menu_item_check
                label="Show Advanced Menu - legacy shortcut"
-- 
GitLab


From 3d02697bdafe0b8f30592a5c9b04336d789599a3 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 1 Dec 2011 18:14:22 +0200
Subject: [PATCH 325/933] EXP-1639 WIP Added debugging messages.

---
 indra/newview/llfloatersnapshot.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index ad571451f32..80fc5fcdfc8 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1416,7 +1416,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
 
 	// *TODO: Separate maximum size for Web images from postcards
-	//lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
+	lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
 
 	LLLocale locale(LLLocale::USER_LOCALE);
 	std::string bytes_string;
@@ -1872,6 +1872,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 			getPreviewView(view)->updateSnapshot(FALSE, TRUE);
 			if(do_update)
 			{
+				lldebugs << "Will update controls" << llendl;
 				updateControls(view);
 				setNeedRefresh(view, true);
 			}
@@ -2427,6 +2428,7 @@ void LLFloaterSnapshot::update()
 	{
 		changed |= LLSnapshotLivePreview::onIdle(*iter);
 	}
+	lldebugs << "changed: " << changed << llendl;
 	if(changed)
 	{
 		inst->impl.updateControls(inst);
-- 
GitLab


From c1e306b83e0dc8c24dc23f32a1df0700ed9bef3c Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 1 Dec 2011 13:15:24 -0500
Subject: [PATCH 326/933] storm-1686: make "Neck" and "Avatar Center" attach
 points available in context menus

---
 indra/newview/character/avatar_lad.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml
index 6641c80b94b..99dbfcae51e 100644
--- a/indra/newview/character/avatar_lad.xml
+++ b/indra/newview/character/avatar_lad.xml
@@ -395,7 +395,7 @@
        
     <attachment_point
        id="39"
-       group="9"
+       group="6"
        pie_slice="1"
        name="Neck"
        joint="mNeck"
@@ -405,7 +405,7 @@
   	
   	<attachment_point
        id="40"
-       group="9"
+       group="6"
        pie_slice="2"
        name="Avatar Center"
        joint="mRoot"
-- 
GitLab


From 770538f992a42cdda091f93e8b318e35372aaad2 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 1 Dec 2011 10:42:15 -0800
Subject: [PATCH 327/933] Build fixes for mac, hopefully Linux too

---
 indra/llui/llhandle.h          |  2 +-
 indra/llxuixml/llinitparam.h   |  2 +-
 indra/llxuixml/llxuiparser.cpp | 24 ++++++++++++------------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/indra/llui/llhandle.h b/indra/llui/llhandle.h
index e6390ee599b..37c657dd922 100644
--- a/indra/llui/llhandle.h
+++ b/indra/llui/llhandle.h
@@ -166,7 +166,7 @@ class LLHandleProvider
 	} 
 
 	template <typename U>
-	typename LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const
+	LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const
 	{
 		LLHandle<U> downcast_handle;
 		downcast_handle.mTombStone = getHandle().mTombStone;
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 7927f84cba5..ab209577609 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -764,7 +764,7 @@ namespace LLInitParam
 		{
 			if (NAME_VALUE_LOOKUP::getValueFromName(val, mValue))
 			{
-				setValueName(val);
+				NAME_VALUE_LOOKUP::setValueName(val);
 			}
 			else
 			{
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 90c2671242a..58654dcc218 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -129,7 +129,7 @@ struct Any : public LLInitParam::Block<Any, Occurs>
 
 struct All : public LLInitParam::Block<All, Occurs>
 {
-	Multiple<Lazy<Element>> elements;
+	Multiple< Lazy<Element> > elements;
 
 	All()
 	:	elements("element")
@@ -140,11 +140,11 @@ struct All : public LLInitParam::Block<All, Occurs>
 
 struct Choice : public LLInitParam::ChoiceBlock<Choice, Occurs>
 {
-	Alternative<Lazy<Element>>	element;
-	Alternative<Lazy<Group>>	group;
-	Alternative<Lazy<Choice>>	choice;
-	Alternative<Lazy<Sequence>>	sequence;
-	Alternative<Lazy<Any>>		any;
+	Alternative< Lazy<Element> >	element;
+	Alternative< Lazy<Group> >		group;
+	Alternative< Lazy<Choice> >		choice;
+	Alternative< Lazy<Sequence> >	sequence;
+	Alternative< Lazy<Any> >		any;
 
 	Choice()
 	:	element("element"),
@@ -158,11 +158,11 @@ struct Choice : public LLInitParam::ChoiceBlock<Choice, Occurs>
 
 struct Sequence : public LLInitParam::ChoiceBlock<Sequence, Occurs>
 {
-	Alternative<Lazy<Element>>	element;
-	Alternative<Lazy<Group>>	group;
-	Alternative<Lazy<Choice>>	choice;
-	Alternative<Lazy<Sequence>>	sequence;
-	Alternative<Lazy<Any>>		any;
+	Alternative< Lazy<Element> >	element;
+	Alternative< Lazy<Group> >		group;
+	Alternative< Lazy<Choice> >		choice;
+	Alternative< Lazy<Sequence> >	sequence;
+	Alternative< Lazy<Any> >		any;
 };
 
 struct GroupContents : public LLInitParam::ChoiceBlock<GroupContents, Occurs>
@@ -247,7 +247,7 @@ struct ComplexType : public LLInitParam::Block<ComplexType, ComplexTypeContents>
 	Optional<bool>					mixed;
 
 	Multiple<Attribute>				attribute;
-	Multiple<Lazy<Element>>			elements;
+	Multiple< Lazy<Element> >			elements;
 
 	ComplexType()
 	:	name("name"),
-- 
GitLab


From 03eca4ac461927e9d053941982d774690ffed176 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 1 Dec 2011 10:44:21 -0800
Subject: [PATCH 328/933] EXP-1588 FIX Floaters do not snap to edge

---
 indra/newview/lltoolbarview.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 5ff0ccfeb21..3872444e8fb 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -530,6 +530,11 @@ void LLToolBarView::draw()
 		}
 	}
 	
+	for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
+	{
+		mToolbars[i]->getParent()->setVisible(mToolbars[i]->hasButtons() || isToolDragged());
+	}
+
 	// Draw drop zones if drop of a tool is active
 	if (isToolDragged())
 	{
-- 
GitLab


From 8aa0ef2636b15e0e8a4e15df3169a17b2d15e8d2 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 1 Dec 2011 12:06:47 -0700
Subject: [PATCH 329/933] fix for SH-2560: Nearby avatar textures fail to load
 and SH-2671: sometimes other avatar textures don't load

---
 indra/newview/llviewertexture.cpp | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 786e2b73b17..b0f5361a798 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -2269,6 +2269,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry:
 		}
 	}
 	mPauseLoadedCallBacks = FALSE ;
+	mLastCallBackActiveTime = sCurrentTime ;
 	if(need_raw)
 	{
 		mSaveRawImage = TRUE ;
@@ -2310,6 +2311,11 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
 {
 	static const F32 MAX_INACTIVE_TIME = 120.f ; //seconds
 
+	if(mPauseLoadedCallBacks)
+	{
+		destroyRawImage();
+		return false; //paused
+	}
 	if (mNeedsCreateTexture)
 	{
 		return false;
@@ -2337,12 +2343,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
 
 		// Remove ourself from the global list of textures with callbacks
 		gTextureList.mCallbackList.erase(this);
-	}
-	if(mPauseLoadedCallBacks)
-	{
-		destroyRawImage();
-		return res; //paused
-	}
+	}	
 
 	S32 gl_discard = getDiscardLevel();
 
@@ -2604,7 +2605,11 @@ bool LLViewerFetchedTexture::needsToSaveRawImage()
 
 void LLViewerFetchedTexture::destroyRawImage()
 {	
-	if (mAuxRawImage.notNull()) sAuxCount--;
+	if (mAuxRawImage.notNull())
+	{
+		sAuxCount--;
+		mAuxRawImage = NULL;
+	}
 
 	if (mRawImage.notNull()) 
 	{
@@ -2618,12 +2623,12 @@ void LLViewerFetchedTexture::destroyRawImage()
 			}		
 			setCachedRawImage() ;
 		}
+		
+		mRawImage = NULL;
+	
+		mIsRawImageValid = FALSE;
+		mRawDiscardLevel = INVALID_DISCARD_LEVEL;
 	}
-
-	mRawImage = NULL;
-	mAuxRawImage = NULL;
-	mIsRawImageValid = FALSE;
-	mRawDiscardLevel = INVALID_DISCARD_LEVEL;
 }
 
 //use the mCachedRawImage to (re)generate the gl texture.
-- 
GitLab


From 95fb0249e9f43d907608cc5840d1f8c0e49981d0 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 1 Dec 2011 16:50:27 -0500
Subject: [PATCH 330/933] LLSD-14: Move LLSD::(outstanding|allocation)Count()
 to free functions. Free functions can be unconditionally compiled into the .o
 file, but conditionally hidden in the header file. Static class methods don't
 have that flexibility: without a declaration in the header file, you can't
 compile a function definition in the .cpp file. That makes it awkward to use
 the same llcommon build for production and for unit tests. Why make the
 function declarations conditional at all? These are debugging functions. They
 break the abstraction, they peek under the covers. Production code should not
 use them. Making them conditional on an #ifdef symbol in the unit-test source
 file means the compiler would reject any use by production code. Put
 differently, it allows us to assert with confidence that only unit tests do
 use them. Put new free functions in (lowercase) llsd namespace so as not to
 clutter global namespace. Tweak the one known consumer (llsd_new_tut.cpp)
 accordingly.

---
 indra/llcommon/llsd.cpp     | 14 ++++++++------
 indra/llcommon/llsd.h       | 30 +++++++++++++++++-------------
 indra/test/llsd_new_tut.cpp | 13 +++++++------
 3 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 1bd5d06d299..08cb7bd2a84 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -91,7 +91,7 @@ class LLSD::Impl
 	bool shared() const							{ return (mUseCount > 1) && (mUseCount != STATIC_USAGE_COUNT); }
 	
 	U32 mUseCount;
-	
+
 public:
 	static void reset(Impl*& var, Impl* impl);
 		///< safely set var to refer to the new impl (possibly shared)
@@ -901,11 +901,6 @@ LLSD&		LLSD::operator[](Integer i)
 const LLSD& LLSD::operator[](Integer i) const
 										{ return safe(impl).ref(i); }
 
-#ifdef LLSD_DEBUG_INFO
-U32 LLSD::allocationCount()				{ return Impl::sAllocationCount; }
-U32 LLSD::outstandingCount()			{ return Impl::sOutstandingCount; }
-#endif
-
 static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
 {
 	// sStorage is used to hold the string representation of the llsd last
@@ -954,6 +949,13 @@ LLSD::array_iterator		LLSD::endArray()		{ return makeArray(impl).endArray(); }
 LLSD::array_const_iterator	LLSD::beginArray() const{ return safe(impl).beginArray(); }
 LLSD::array_const_iterator	LLSD::endArray() const	{ return safe(impl).endArray(); }
 
+namespace llsd
+{
+
+U32 allocationCount()								{ return LLSD::Impl::sAllocationCount; }
+U32 outstandingCount()								{ return LLSD::Impl::sOutstandingCount; }
+
+} // namespace llsd
 
 // Diagnostic dump of contents in an LLSD object
 #ifdef LLSD_DEBUG_INFO
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index 3519b134c20..ae083dd6296 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -389,19 +389,6 @@ class LL_COMMON_API LLSD
 		Impl* impl;
 		friend class LLSD::Impl;
 	//@}
-	
-	/** @name Unit Testing Interface */
-	//@{
-public:
-#ifdef LLSD_DEBUG_INFO
-		/// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
-		/// ENVIRONMENT.
-		///
-		/// These counts track LLSD::Impl (hidden) objects.
-		static U32 allocationCount();	///< how many Impls have been made
-		static U32 outstandingCount();	///< how many Impls are still alive
-#endif
-	//@}
 
 private:
 	/** @name Debugging Interface */
@@ -475,6 +462,23 @@ struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
 
 LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
 
+namespace llsd
+{
+
+/** @name Unit Testing Interface */
+//@{
+#ifdef LLSD_DEBUG_INFO
+	/// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
+	/// ENVIRONMENT.
+	///
+	/// These counts track LLSD::Impl (hidden) objects.
+	LL_COMMON_API U32 allocationCount();	///< how many Impls have been made
+	LL_COMMON_API U32 outstandingCount();	///< how many Impls are still alive
+#endif
+//@}
+
+} // namespace llsd
+
 /** QUESTIONS & TO DOS
 	- Would Binary be more convenient as unsigned char* buffer semantics?
 	- Should Binary be convertible to/from String, and if so how?
diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp
index f332ad0ee2b..b55a562e982 100644
--- a/indra/test/llsd_new_tut.cpp
+++ b/indra/test/llsd_new_tut.cpp
@@ -25,6 +25,7 @@
  * $/LicenseInfo$
  */
 
+#define LLSD_DEBUG_INFO
 #include <tut/tut.hpp>
 #include "linden_common.h"
 #include "lltut.h"
@@ -39,11 +40,11 @@ namespace tut
 	private:
 		U32	mOutstandingAtStart;
 	public:
-		SDCleanupCheck() : mOutstandingAtStart(LLSD::outstandingCount()) { }
+		SDCleanupCheck() : mOutstandingAtStart(llsd::outstandingCount()) { }
 		~SDCleanupCheck()
 		{
 			ensure_equals("SDCleanupCheck",
-				LLSD::outstandingCount(), mOutstandingAtStart);
+				llsd::outstandingCount(), mOutstandingAtStart);
 		}
 	};
 
@@ -57,12 +58,12 @@ namespace tut
 		SDAllocationCheck(const std::string& message, int expectedAllocations)
 			: mMessage(message),
 			mExpectedAllocations(expectedAllocations),
-			mAllocationAtStart(LLSD::allocationCount())
+			mAllocationAtStart(llsd::allocationCount())
 			{ }
 		~SDAllocationCheck()
 		{
 			ensure_equals(mMessage + " SDAllocationCheck",
-				LLSD::allocationCount() - mAllocationAtStart,
+				llsd::allocationCount() - mAllocationAtStart,
 				mExpectedAllocations);
 		}
 	};
@@ -746,7 +747,7 @@ namespace tut
 		{
 			SDAllocationCheck check("shared values test for threaded work", 9);
 
-			//U32 start_llsd_count = LLSD::outstandingCount();
+			//U32 start_llsd_count = llsd::outstandingCount();
 
 			LLSD m = LLSD::emptyMap();
 
@@ -773,7 +774,7 @@ namespace tut
 			m["string_two"] = "string two value";
 			m["string_one_copy"] = m["string_one"];		// 9
 
-			//U32 llsd_object_count = LLSD::outstandingCount();
+			//U32 llsd_object_count = llsd::outstandingCount();
 			//std::cout << "Using " << (llsd_object_count - start_llsd_count) << " LLSD objects" << std::endl;
 
 			//m.dumpStats();
-- 
GitLab


From c9c03ffa0ca21eeb2786920cf9c0cb547be8a468 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 1 Dec 2011 14:52:37 -0700
Subject: [PATCH 331/933] fix for sh-2735: LLCurl causes SL to freeze when
 logout

---
 indra/newview/llappviewer.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9d40a8a60e9..e80475f0960 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1781,6 +1781,7 @@ bool LLAppViewer::cleanup()
 		pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread
 		pending += LLVFSThread::updateClass(0);
 		pending += LLLFSThread::updateClass(0);
+		pending += LLCurl::getCurlThread()->update(1) ;
 		F64 idle_time = idleTimer.getElapsedTimeF64();
 		if(!pending)
 		{
@@ -1792,6 +1793,7 @@ bool LLAppViewer::cleanup()
 			break;
 		}
 	}
+	LLCurl::getCurlThread()->pause() ;
 
 	// Delete workers first
 	// shotdown all worker threads before deleting them in case of co-dependencies
-- 
GitLab


From 587a1a425a8e57139a863d5c4a37de108afa6d40 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Thu, 1 Dec 2011 14:19:52 -0800
Subject: [PATCH 332/933] EXP-1649 FIX (client) Turn off web loading spinner
 until a more visually pleasing one can be defined

---
 autobuild.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index bb6de76d7a5..11c57f43fb9 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1206,9 +1206,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>4b144790799df284f2ebe739a21aa4ec</string>
+              <string>26aa7c367ffadd573f61a6a96f820f80</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245528/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111118.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245988/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111201.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1230,9 +1230,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>60a36c75456eaffc4858bc11df1c49a9</string>
+              <string>d7743d42de9a5e48809dedf4b64e53e4</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245528/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111118.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245988/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111201.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
GitLab


From 57311704c8211e3899dd10e2a8f33ae145ac1916 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 1 Dec 2011 15:07:34 -0800
Subject: [PATCH 333/933] FIX VWR-25381

---
 indra/newview/skins/default/xui/es/panel_navigation_bar.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/es/panel_navigation_bar.xml b/indra/newview/skins/default/xui/es/panel_navigation_bar.xml
index 1b7f5d5a9f4..d36c6283bcf 100644
--- a/indra/newview/skins/default/xui/es/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_navigation_bar.xml
@@ -3,7 +3,7 @@
 	<layout_stack name="nvp_stack">
 		<layout_panel name="navigation_layout_panel">
 			<panel name="navigation_panel">
-				<pull_button name="back_btn" tool_tip="Volver a lo localización anterior"/>
+				<pull_button name="back_btn" tool_tip="Volver a la localización anterior"/>
 				<pull_button name="forward_btn" tool_tip="Ir una localización adelante"/>
 				<button name="home_btn" tool_tip="Teleportar a mi Base"/>
 				<location_input label="Lugar" name="location_combo"/>
-- 
GitLab


From b5346c6b64ce955ed71ddc6f64bc7a864111a8e4 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 1 Dec 2011 15:46:39 -0800
Subject: [PATCH 334/933] SH-2726 FIX -- Texture Console and Debug Console
 inaccessable

* Removed debug view post build step and moved initialization to first draw for proper setup.
---
 indra/newview/lldebugview.cpp | 12 +++++-------
 indra/newview/lldebugview.h   |  2 --
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp
index 92ac336d0db..7d3170cb765 100644
--- a/indra/newview/lldebugview.cpp
+++ b/indra/newview/lldebugview.cpp
@@ -72,13 +72,6 @@ LLDebugView::~LLDebugView()
 	gTextureCategoryView = NULL;
 }
 
-BOOL LLDebugView::postBuild()
-{
-	mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region");
-	
-	return TRUE;
-}
-
 void LLDebugView::init()
 {
 	LLRect r;
@@ -157,6 +150,11 @@ void LLDebugView::init()
 
 void LLDebugView::draw()
 {
+	if (mFloaterSnapRegion == NULL)
+	{
+		mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region");
+	}
+
 	LLRect debug_rect;
 	mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &debug_rect, getParent());
 
diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h
index 33d6a7394f5..5aec77ad627 100644
--- a/indra/newview/lldebugview.h
+++ b/indra/newview/lldebugview.h
@@ -55,8 +55,6 @@ class LLDebugView : public LLView
 	LLDebugView(const Params&);
 	~LLDebugView();
 
-	BOOL postBuild();
-	
 	void init();
 	void draw();
 	
-- 
GitLab


From bf24ffd27a6c5ceb94990442c62dc51565330cb8 Mon Sep 17 00:00:00 2001
From: Simon Linden <simon@lindenlab.com>
Date: Thu, 1 Dec 2011 16:37:51 -0800
Subject: [PATCH 335/933] ER-1473:  fix teleporting in sit mode.  Viewer fix -
 reviewed by Callum

---
 indra/newview/llviewermessage.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index dca5cdd06dc..ad333a71ff1 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3638,6 +3638,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
 	gCacheName->setUpstream(sim);
 */
 
+	// Make sure we're standing
+	gAgent.standUp();
+
 	// now, use the circuit info to tell simulator about us!
 	LL_INFOS("Messaging") << "process_teleport_finish() Enabling "
 			<< sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL;
-- 
GitLab


From 1ed694c210ffa0c648a7b832ac060ffe6eea26ba Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 2 Dec 2011 10:42:46 +0200
Subject: [PATCH 336/933] EXP-1372 FIXED Made minimum height of Appearance and
 Places floaters consistent with other FUI floaters.

---
 indra/newview/skins/default/xui/en/floater_my_appearance.xml | 2 +-
 indra/newview/skins/default/xui/en/floater_places.xml        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
index a40393aed8b..1c4b25a7b02 100644
--- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
@@ -12,7 +12,7 @@
   single_instance="true"
   reuse_instance="true"
   title="APPEARANCE"
-  min_height="260"
+  min_height="440"
   min_width="333"
   width="333">
     <panel
diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml
index 6484b543604..ccceac0a7b2 100644
--- a/indra/newview/skins/default/xui/en/floater_places.xml
+++ b/indra/newview/skins/default/xui/en/floater_places.xml
@@ -11,7 +11,7 @@
   save_rect="true"
   reuse_instance="true"
   title="PLACES"
-  min_height="230"
+  min_height="440"
   min_width="333"
   width="333">
     <panel
-- 
GitLab


From 7226b23366805ae259000df25a622fc98a722d14 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 2 Dec 2011 09:22:27 -0500
Subject: [PATCH 337/933] STORM-591 Made mininum fade time 0.01 seconds to
 prevent divide by zero and negative fade times. Rewrote two blocks of code to
 eliminate early returns.

---
 indra/newview/llpanelnearbymedia.cpp | 20 ++++++++---
 indra/newview/llvieweraudio.cpp      | 50 ++++++++++++++++------------
 2 files changed, 45 insertions(+), 25 deletions(-)

diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 53fc64f089f..c01adc3c356 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -808,14 +808,26 @@ bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled)
 {
 	if (row_id == PARCEL_AUDIO_LIST_ITEM_UUID)
 	{
-		if (disabled) onClickParcelAudioStop();
-		else onClickParcelAudioPlay();
+		if (disabled)
+		{
+			onClickParcelAudioStop();
+		}
+		else
+		{
+			onClickParcelAudioPlay();
+		}
 		return true;
 	}
 	else if (row_id == PARCEL_MEDIA_LIST_ITEM_UUID)
 	{
-		if (disabled) onClickDisableParcelMedia();
-		else onClickEnableParcelMedia();
+		if (disabled)
+		{
+			onClickDisableParcelMedia();
+		}
+		else
+		{
+			onClickEnableParcelMedia();
+		}
 		return true;
 	}
 	else {
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 1e5c742cf9a..f01fe174a44 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -74,11 +74,13 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 	// Record the URI we are going to be switching to	
 	mNextStreamURI = streamURI;
 
-	if (mFadeState == FADE_IDLE)
+	switch (mFadeState)
 	{
+		case FADE_IDLE:
 		// If a stream is playing fade it out first
 		if (!gAudiop->getInternetStreamURL().empty())
 		{
+			// The order of these tests is important, state FADE_OUT will be processed below
 			mFadeState = FADE_OUT;
 		}
 		// Otherwise the new stream can be faded in
@@ -88,21 +90,21 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 			gAudiop->startInternetStream(mNextStreamURI);
 			startFading();
 			registerIdleListener();
-			return;
+			break;
 		}
-	}
 
-	if (mFadeState == FADE_OUT)
-	{
-		startFading();
-		registerIdleListener();
-		return;
-	}
+		case FADE_OUT:
+			startFading();
+			registerIdleListener();
+			break;
 
-	if (mFadeState == FADE_IN)
-	{
-		registerIdleListener();
-		return;
+		case FADE_IN:
+			registerIdleListener();
+			break;
+
+		default:
+			llwarns << "Unknown fading state: " << mFadeState << llendl;
+			break;
 	}
 }
 
@@ -112,13 +114,15 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 // A return of true means we have finished with it and the callback will be deleted.
 bool LLViewerAudio::onIdleUpdate()
 {
+	bool fadeIsFinished = false;
+
 	if (mDone)
 	{
 		//  This should be a rare or never occurring state.
 		if (mFadeState == FADE_IDLE)
 		{
 			deregisterIdleListener();
-			return true; // Stop calling onIdleUpdate
+			fadeIsFinished = true; // Stop calling onIdleUpdate
 		}
 
 		// we have finished the current fade operation
@@ -133,13 +137,12 @@ bool LLViewerAudio::onIdleUpdate()
 				mFadeState = FADE_IN;
 				gAudiop->startInternetStream(mNextStreamURI);
 				startFading();
-				return false;
 			}
 			else
 			{
 				mFadeState = FADE_IDLE;
 				deregisterIdleListener();
-				return true; // Stop calling onIdleUpdate
+				fadeIsFinished = true; // Stop calling onIdleUpdate
 			}
 		}
 		else if (mFadeState == FADE_IN)
@@ -148,18 +151,17 @@ bool LLViewerAudio::onIdleUpdate()
 			{
 				mFadeState = FADE_OUT;
 				startFading();
-				return false;
 			}
 			else
 			{
 				mFadeState = FADE_IDLE;
 				deregisterIdleListener();
-				return true; // Stop calling onIdleUpdate
+				fadeIsFinished = true; // Stop calling onIdleUpdate
 			}
 		}
 	}
 
-	return false;
+	return fadeIsFinished;
 }
 
 void LLViewerAudio::stopInternetStreamWithAutoFade()
@@ -174,8 +176,10 @@ void LLViewerAudio::stopInternetStreamWithAutoFade()
 
 void LLViewerAudio::startFading()
 {
-	const F32 AUDIO_MUSIC_FADE_IN_TIME = 3.0;
-	const F32 AUDIO_MUSIC_FADE_OUT_TIME = 2.0;
+	const F32 AUDIO_MUSIC_FADE_IN_TIME = 3.0f;
+	const F32 AUDIO_MUSIC_FADE_OUT_TIME = 2.0f;
+	// This minimum fade time prevents divide by zero and negative times
+	const F32 AUDIO_MUSIC_MINIMUM_FADE_TIME = 0.01f;
 
 	if(mDone)
 	{
@@ -186,6 +190,10 @@ void LLViewerAudio::startFading()
 		{
 			mFadeTime = AUDIO_MUSIC_FADE_OUT_TIME;
 		}
+
+		// Prevent invalid fade time
+		mFadeTime = llmax(mFadeTime, AUDIO_MUSIC_MINIMUM_FADE_TIME);
+
 		stream_fade_timer.reset();
 		stream_fade_timer.setTimerExpirySec(mFadeTime);
 		mDone = false;
-- 
GitLab


From a8cb28cb2c589a658900243f98c5c017b9a638c8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 2 Dec 2011 09:40:20 -0600
Subject: [PATCH 338/933] SH-1912 Tweak based on QA/resident feedback

---
 .../app_settings/shaders/class1/deferred/softenLightF.glsl     | 3 ++-
 .../newview/app_settings/shaders/class1/deferred/terrainF.glsl | 2 +-
 .../app_settings/shaders/class2/deferred/softenLightF.glsl     | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 267c9bdaa5d..51110ae4df7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -308,7 +308,8 @@ void main()
 
 			//add environmentmap
 			vec3 env_vec = env_mat * refnormpersp;
-			col += textureCube(environmentMap, env_vec).rgb * max(spec.a-diffuse.a-0.2, 0.0); 
+			col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, 
+				max(spec.a-diffuse.a*2.0, 0.0)); 
 		}
 	
 		col = atmosLighting(col);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index e014e53d259..5522e6c41d0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -52,7 +52,7 @@ void main()
 	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
 	
 	gl_FragData[0] = vec4(outColor.rgb, 0.0);
-	gl_FragData[1] = vec4(outColor.rgb*0.2, 0.2);
+	gl_FragData[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
 	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index d905e76df81..97f3063a9e1 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -316,7 +316,8 @@ void main()
 
 			//add environmentmap
 			vec3 env_vec = env_mat * refnormpersp;
-			col += textureCube(environmentMap, env_vec).rgb * max(spec.a-diffuse.a-0.2, 0.0); 
+			col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, 
+				max(spec.a-diffuse.a*2.0, 0.0)); 
 		}
 			
 		col = atmosLighting(col);
-- 
GitLab


From 7359a5f34b0c51421cdb109854b0f305422ed20a Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 2 Dec 2011 19:05:22 +0200
Subject: [PATCH 339/933] EXP-1463 ADDITIONAL FIX (IM chiclets overlay
 Mini-Location bar)

- Don't let chiclet list left side to be out of chiclet_container
---
 indra/newview/llchicletbar.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index 1bd5a571a56..a879651060b 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -353,6 +353,8 @@ void LLChicletBar::fitWithTopInfoBar()
 	if (top_info_bar.getVisible())
 	{
 		S32 delta = top_info_bar.calcScreenRect().mRight - calcScreenRect().mLeft;
+		if (delta < 0 && rect.mLeft < llabs(delta))
+			delta = -rect.mLeft;
 		rect.setLeftTopAndSize(rect.mLeft + delta, rect.mTop, rect.getWidth(), rect.getHeight());
 		width = rect.getWidth() - delta;
 	}
-- 
GitLab


From d58b5342dc7e8f49ab956523a3dc743b89803b3a Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 2 Dec 2011 19:10:08 +0200
Subject: [PATCH 340/933] EXP-1476 FIXED (Moving speak button to empty toolbar
 while incoming/outgoing call dialog is open does not move the dialog as well)
 Reason: A floater can be docked only to a button which is in visible chain,
 the visibility of the button itself is not enough. After the button was added
 to the empty toolbar: mButtonAddSignal is called and the floater tries to
 dock to the button, but the button's parent(mButtonPanel) is yet invisible at
 this moment (so the button is not in visible chain). mButtonPanel visibility
 updates in draw() depending on whether it contains some buttons or not.

Solution:
Updating mButtonPanel visibility right after the button was added, before mButtonAddSignal
---
 indra/llui/lltoolbar.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index e7642ae1901..7f96c1373c2 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -770,6 +770,12 @@ void LLToolBar::updateLayoutAsNeeded()
 	// re-center toolbar buttons
 	mCenteringStack->updateLayout();
 
+	if (!mButtons.empty())
+	{
+		mButtonPanel->setVisible(TRUE);
+		mButtonPanel->setMouseOpaque(TRUE);
+	}
+
 	// don't clear flag until after we've resized ourselves, to avoid laying out every frame
 	mNeedsLayout = false;
 }
-- 
GitLab


From 9cb157dde0ede0e494ec3b37a33e650889ba382c Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 2 Dec 2011 11:02:26 -0800
Subject: [PATCH 341/933] EXP-1654 FIX fast timers does not show entire frame
 when Full bar = Max

---
 indra/newview/llfasttimerview.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 065dc5f4be9..233038daba3 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -105,6 +105,7 @@ void LLFastTimerView::onPause()
 	if (!LLFastTimer::sPauseHistory)
 	{
 		mScrollIndex = 0;
+		LLFastTimer::sResetHistory = true;
 		getChild<LLButton>("pause_btn")->setLabel(getString("pause"));
 	}
 	else
@@ -591,6 +592,7 @@ void LLFastTimerView::draw()
 			{
 				mAvgCountTotal = ticks;
 				mMaxCountTotal = ticks;
+				LLFastTimer::sResetHistory = false;
 			}
 		}
 
-- 
GitLab


From 95bc798693f77460bda0c20df3e1c389d5c762b8 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 2 Dec 2011 11:02:26 -0800
Subject: [PATCH 342/933] EXP-1654 FIX fast timers does not show entire frame
 when Full bar = Max

---
 indra/newview/llfasttimerview.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 065dc5f4be9..233038daba3 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -105,6 +105,7 @@ void LLFastTimerView::onPause()
 	if (!LLFastTimer::sPauseHistory)
 	{
 		mScrollIndex = 0;
+		LLFastTimer::sResetHistory = true;
 		getChild<LLButton>("pause_btn")->setLabel(getString("pause"));
 	}
 	else
@@ -591,6 +592,7 @@ void LLFastTimerView::draw()
 			{
 				mAvgCountTotal = ticks;
 				mMaxCountTotal = ticks;
+				LLFastTimer::sResetHistory = false;
 			}
 		}
 
-- 
GitLab


From 4d5a571da457cf454854d4ebc1ddbd5048fcc53f Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 2 Dec 2011 11:03:09 -0800
Subject: [PATCH 343/933] made slplugin less spammy when it fails to launch

---
 indra/newview/llviewermedia.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 98f4ce58fe1..263d8b41465 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1886,7 +1886,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 	
 	if(plugin_basename.empty())
 	{
-		LL_WARNS("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL;
+		LL_WARNS_ONCE("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL;
 	}
 	else
 	{
@@ -1912,11 +1912,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 		llstat s;
 		if(LLFile::stat(launcher_name, &s))
 		{
-			LL_WARNS("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL;
+			LL_WARNS_ONCE("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL;
 		}
 		else if(LLFile::stat(plugin_name, &s))
 		{
-			LL_WARNS("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
+			LL_WARNS_ONCE("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
 		}
 		else
 		{
-- 
GitLab


From 9a79b6f3306e805227d68c07a151d25b0e70553d Mon Sep 17 00:00:00 2001
From: Ansariel Hiller <none@none>
Date: Fri, 2 Dec 2011 14:37:23 -0500
Subject: [PATCH 344/933] storm-1717: fix avatar names in object details
 floater

---
 doc/contributions.txt              |  1 +
 indra/newview/llfloaterinspect.cpp | 39 +++++++++++++++++++++++++++---
 indra/newview/llfloaterinspect.h   |  4 +++
 3 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 89be96fcf5a..454a1e90ea8 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -171,6 +171,7 @@ Ansariel Hiller
 	VWR-25480
 	VWR-26150
 	STORM-1685
+    STORM-1717
 Aralara Rajal
 Ardy Lay
 	STORM-859
diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp
index a09b9ea235d..cece8d299cc 100644
--- a/indra/newview/llfloaterinspect.cpp
+++ b/indra/newview/llfloaterinspect.cpp
@@ -37,6 +37,7 @@
 #include "llselectmgr.h"
 #include "lltoolcomp.h"
 #include "lltoolmgr.h"
+#include "lltrans.h"
 #include "llviewercontrol.h"
 #include "llviewerobject.h"
 #include "lluictrlfactory.h"
@@ -166,6 +167,15 @@ LLUUID LLFloaterInspect::getSelectedUUID()
 	return LLUUID::null;
 }
 
+void LLFloaterInspect::onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr)
+{
+	if (FloaterPtr)
+	{
+		LLFloaterInspect* floater = (LLFloaterInspect*)FloaterPtr;
+		floater->dirty();
+	}
+}
+
 void LLFloaterInspect::refresh()
 {
 	LLUUID creator_id;
@@ -205,11 +215,32 @@ void LLFloaterInspect::refresh()
 		substitution["datetime"] = (S32) timestamp;
 		LLStringUtil::format (timeStr, substitution);
 
+		const LLUUID& idOwner = obj->mPermissions->getOwner();
+		const LLUUID& idCreator = obj->mPermissions->getCreator();
 		LLAvatarName av_name;
-		LLAvatarNameCache::get(obj->mPermissions->getOwner(), &av_name);
-		owner_name = av_name.getCompleteName();
-		LLAvatarNameCache::get(obj->mPermissions->getCreator(), &av_name);
-		creator_name = av_name.getCompleteName();
+
+		// Only work with the names if we actually get a result
+		// from the name cache. If not, defer setting the
+		// actual name and set a placeholder.
+		if (LLAvatarNameCache::get(idOwner, &av_name))
+		{
+			owner_name = av_name.getCompleteName();
+		}
+		else
+		{
+			owner_name = LLTrans::getString("RetrievingData");
+			LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this));
+		}
+
+		if (LLAvatarNameCache::get(idCreator, &av_name))
+		{
+			creator_name = av_name.getCompleteName();
+		}
+		else
+		{
+			creator_name = LLTrans::getString("RetrievingData");
+			LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this));
+		}
 		
 		row["id"] = obj->getObject()->getID();
 		row["columns"][0]["column"] = "object_name";
diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h
index d9ffdf114b4..7ee83ccdb47 100644
--- a/indra/newview/llfloaterinspect.h
+++ b/indra/newview/llfloaterinspect.h
@@ -29,6 +29,7 @@
 #ifndef LL_LLFLOATERINSPECT_H
 #define LL_LLFLOATERINSPECT_H
 
+#include "llavatarname.h"
 #include "llfloater.h"
 
 //class LLTool;
@@ -53,6 +54,9 @@ class LLFloaterInspect : public LLFloater
 	void onClickCreatorProfile();
 	void onClickOwnerProfile();
 	void onSelectObject();
+
+	static void onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr);
+
 	LLScrollListCtrl* mObjectList;
 protected:
 	// protected members
-- 
GitLab


From 31029babe2f9f6eb3fc3205da93c1eccd7a74ed4 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 2 Dec 2011 11:50:04 -0800
Subject: [PATCH 345/933] EXP-1649 FIX +1 (client) Turn off web loading spinner
 until a more visually pleasing one can be defined

---
 autobuild.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/autobuild.xml b/autobuild.xml
index 11c57f43fb9..9914be68678 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1230,7 +1230,7 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>d7743d42de9a5e48809dedf4b64e53e4</string>
+              <string>270db8568a0c4bab266d98e1a820aec4</string>
               <key>url</key>
               <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245988/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111201.tar.bz2</string>
             </map>
-- 
GitLab


From 4d14bb02b908c37f73e915af811027c1d193b667 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 2 Dec 2011 12:03:24 -0800
Subject: [PATCH 346/933] EXP-1451 FIX -- I want to put my NEARBY CHAT window
 at the bottom left, but then it obscures chatted text.

I repositioned the chat, move and camera floaters.  Chat toasts now start 80 up from the bottom left rather than 10.
---
 indra/llui/lltextparser.cpp                   |   2 -
 indra/newview/CMakeLists.txt                  |   2 -
 indra/newview/app_settings/settings.xml       |  11 -
 indra/newview/app_settings/toolbars.xml       |   2 +-
 indra/newview/llfloaterchat.cpp               | 485 -----------
 indra/newview/llfloaterchat.h                 |  78 --
 indra/newview/llfloaterchatterbox.cpp         | 344 --------
 indra/newview/llfloaterchatterbox.h           |  80 --
 indra/newview/llfloaterfriends.cpp            | 807 ------------------
 indra/newview/llfloaterfriends.h              | 140 ---
 indra/newview/llmenucommands.cpp              |  94 --
 indra/newview/llmenucommands.h                |  37 -
 indra/newview/llnearbychathandler.cpp         |   5 +-
 indra/newview/llviewermenu.cpp                |   2 -
 indra/newview/llvoicevivox.cpp                |   1 -
 .../skins/default/xui/en/floater_camera.xml   |   2 +-
 .../skins/default/xui/en/floater_chat_bar.xml |  10 +-
 .../skins/default/xui/en/floater_moveview.xml |   2 +-
 .../skins/default/xui/en/menu_viewer.xml      |   6 -
 19 files changed, 11 insertions(+), 2099 deletions(-)
 delete mode 100644 indra/newview/llfloaterchat.cpp
 delete mode 100644 indra/newview/llfloaterchat.h
 delete mode 100644 indra/newview/llfloaterchatterbox.cpp
 delete mode 100644 indra/newview/llfloaterchatterbox.h
 delete mode 100644 indra/newview/llfloaterfriends.cpp
 delete mode 100644 indra/newview/llfloaterfriends.h
 delete mode 100644 indra/newview/llmenucommands.cpp
 delete mode 100644 indra/newview/llmenucommands.h

diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp
index a4fe4f6ca8b..8a85f99e0cf 100644
--- a/indra/llui/lltextparser.cpp
+++ b/indra/llui/lltextparser.cpp
@@ -46,8 +46,6 @@ LLTextParser::LLTextParser()
 {}
 
 
-// Moved triggerAlerts() to llfloaterchat.cpp to break llui/llaudio library dependency.
-
 S32 LLTextParser::findPattern(const std::string &text, LLSD highlight)
 {
 	if (!highlight.has("pattern")) return -1;
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 71238a52f75..9368433a9ff 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -316,7 +316,6 @@ set(viewer_SOURCE_FILES
     llmediactrl.cpp
     llmediadataclient.cpp
     llmemoryview.cpp
-    llmenucommands.cpp
     llmeshrepository.cpp
     llmimetypes.cpp
     llmorphview.cpp
@@ -870,7 +869,6 @@ set(viewer_HEADER_FILES
     llmediactrl.h
     llmediadataclient.h
     llmemoryview.h
-    llmenucommands.h
     llmeshrepository.h
     llmimetypes.h
     llmorphview.h
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index dd4c0abaf53..1e07ed8a27c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1562,17 +1562,6 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>ChatVisible</key>
-    <map>
-      <key>Comment</key>
-      <string>Chat bar is visible</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>ChatWindow</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index 8862355bfd0..29c019719de 100644
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -7,8 +7,8 @@
     <command name="destinations"/>
     <command name="people"/>
     <command name="profile"/>
-    <command name="view"/>
     <command name="move"/>
+    <command name="view"/>
     <command name="howto"/>
   </bottom_toolbar>
   <left_toolbar
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
deleted file mode 100644
index 2679dbb78ba..00000000000
--- a/indra/newview/llfloaterchat.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-/** 
- * @file llfloaterchat.cpp
- * @brief LLFloaterChat class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-/**
- * Actually the "Chat History" floater.
- * Should be llfloaterchathistory, not llfloaterchat.
- */
-
-#include "llviewerprecompiledheaders.h"
-
-// project include
-#include "llagent.h"
-#include "llappviewer.h"
-#include "llbutton.h"
-#include "llcheckboxctrl.h"
-#include "llcombobox.h"
-#include "llconsole.h"
-#include "llfloateractivespeakers.h"
-#include "llfloaterchatterbox.h"
-#include "llfloaterreg.h"
-#include "llfloaterscriptdebug.h"
-#include "llkeyboard.h"
-//#include "lllineeditor.h"
-#include "llmutelist.h"
-//#include "llresizehandle.h"
-#include "llchatbar.h"
-#include "llrecentpeople.h"
-#include "llpanelblockedlist.h"
-#include "llslurl.h"
-#include "llstatusbar.h"
-#include "llviewertexteditor.h"
-#include "llviewergesture.h"			// for triggering gestures
-#include "llviewermessage.h"
-#include "llviewerwindow.h"
-#include "llviewercontrol.h"
-#include "lluictrlfactory.h"
-#include "lllogchat.h"
-#include "lltexteditor.h"
-#include "lltextparser.h"
-#include "llweb.h"
-#include "llstylemap.h"
-
-// linden library includes
-#include "llaudioengine.h"
-#include "llchat.h"
-#include "llfontgl.h"
-#include "llrect.h"
-#include "llerror.h"
-#include "llstring.h"
-#include "llwindow.h"
-#include "message.h"
-
-//
-// Constants
-//
-const F32 INSTANT_MSG_SIZE = 8.0f;
-const F32 CHAT_MSG_SIZE = 8.0f;
-
-
-//
-// Global statics
-//
-LLColor4 get_text_color(const LLChat& chat);
-
-//
-// Member Functions
-//
-LLFloaterChat::LLFloaterChat(const LLSD& seed)
-	: LLFloater(seed),
-	  mPanel(NULL)
-{
-	mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL);
-	mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL);
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml");
-
-}
-
-LLFloaterChat::~LLFloaterChat()
-{
-	// Children all cleaned up by default view destructor.
-}
-
-void LLFloaterChat::draw()
-{
-	// enable say and shout only when text available
-		
-	childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel"));
-
-	LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE);
-	if (chat_barp)
-	{
-		chat_barp->refresh();
-	}
-
-	mPanel->refreshSpeakers();
-	LLFloater::draw();
-}
-
-BOOL LLFloaterChat::postBuild()
-{
-	// Hide the chat overlay when our history is visible.
-	setVisibleCallback(boost::bind(&LLFloaterChat::updateConsoleVisibility, this));
-	
-	mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel");
-
-	childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes
-	childSetVisible("Chat History Editor with mute",FALSE);
-	childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this);
-
-	return TRUE;
-}
-
-void LLFloaterChat::updateConsoleVisibility()
-{
-	if(gDisconnected)
-	{
-		return;
-	}
-	// determine whether we should show console due to not being visible
-	gConsole->setVisible( !isInVisibleChain()								// are we not in part of UI being drawn?
-							|| isMinimized()								// are we minimized?
-							|| (getHost() && getHost()->isMinimized() ));	// are we hosted in a minimized floater?
-}
-
-void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color)
-{
-	std::string line = chat.mText;
-	bool prepend_newline = true;
-	if (gSavedSettings.getBOOL("ChatShowTimestamps"))
-	{
-		edit->appendTime(prepend_newline);
-		prepend_newline = false;
-	}
-
-	// If the msg is from an agent (not yourself though),
-	// extract out the sender name and replace it with the hotlinked name.
-	if (chat.mSourceType == CHAT_SOURCE_AGENT &&
-		chat.mFromID != LLUUID::null)
-	{
-		chat.mURL = LLSLURL("agent", chat.mFromID, "inspect").getSLURLString();
-	}
-
-	// If the chat line has an associated url, link it up to the name.
-	if (!chat.mURL.empty()
-		&& (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
-	{
-		std::string start_line = line.substr(0, chat.mFromName.length() + 1);
-		line = line.substr(chat.mFromName.length() + 1);
-		edit->appendText(start_line, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL));
-		edit->blockUndo();
-		prepend_newline = false;
-	}
-	edit->appendText(line, prepend_newline, LLStyle::Params().color(color));
-	edit->blockUndo();
-}
-
-// static
-void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
-{	
-	if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat"))) 
-	{
-		if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT)
-		{
-			LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText);
-		}
-		else
-		{
-			LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText);
-		}
-	}
-	
-	LLColor4 color = get_text_color(chat);
-	
-	if (!log_to_file) color = LLColor4::grey;	//Recap from log file.
-
-	if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
-	{
-		if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE)
-			return;
-		if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)
-		{
-			LLFloaterScriptDebug::addScriptLine(chat.mText,
-												chat.mFromName, 
-												color, 
-												chat.mFromID);
-			return;
-		}
-	}
-	
-	// could flash the chat button in the status bar here. JC
-	LLFloaterChat* chat_floater = LLFloaterChat::getInstance();
-	LLViewerTextEditor*	history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor");
-	LLViewerTextEditor*	history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
-
-	if (!chat.mMuted)
-	{
-		add_timestamped_line(history_editor, chat, color);
-		add_timestamped_line(history_editor_with_mute, chat, color);
-	}
-	else
-	{
-		// desaturate muted chat
-		LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f);
-		add_timestamped_line(history_editor_with_mute, chat, color);
-	}
-	
-	// add objects as transient speakers that can be muted
-	if (chat.mSourceType == CHAT_SOURCE_OBJECT)
-	{
-		chat_floater->mPanel->setSpeaker(chat.mFromID, chat.mFromName, LLSpeaker::STATUS_NOT_IN_CHANNEL, LLSpeaker::SPEAKER_OBJECT);
-	}
-
-	// start tab flashing on incoming text from other users (ignoring system text, etc)
-	if (!chat_floater->isInVisibleChain() && chat.mSourceType == CHAT_SOURCE_AGENT)
-	{
-		LLFloaterChatterBox::getInstance()->setFloaterFlashing(chat_floater, TRUE);
-	}
-}
-
-// static
-void LLFloaterChat::setHistoryCursorAndScrollToEnd()
-{
-	LLViewerTextEditor*	history_editor = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor");
-	LLViewerTextEditor*	history_editor_with_mute = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor with mute");
-	
-	if (history_editor) 
-	{
-		history_editor->setCursorAndScrollToEnd();
-	}
-	if (history_editor_with_mute)
-	{
-		 history_editor_with_mute->setCursorAndScrollToEnd();
-	}
-}
-
-
-//static 
-void LLFloaterChat::onClickMute(void *data)
-{
-	LLFloaterChat* self = (LLFloaterChat*)data;
-
-	LLComboBox*	chatter_combo = self->getChild<LLComboBox>("chatter combobox");
-
-	const std::string& name = chatter_combo->getSimple();
-	LLUUID id = chatter_combo->getCurrentID();
-
-	if (name.empty()) return;
-
-	LLMute mute(id);
-	mute.setFromDisplayName(name);
-	LLMuteList::getInstance()->add(mute);
-	LLPanelBlockedList::showPanelAndSelect(mute.mID);
-}
-
-//static
-void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data)
-{
-	LLFloaterChat* floater = (LLFloaterChat*)data;
-
-
-	//LLCheckBoxCtrl*	
-	BOOL show_mute = floater->getChild<LLCheckBoxCtrl>("show mutes")->get();
-	LLViewerTextEditor*	history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor");
-	LLViewerTextEditor*	history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
-
-	if (!history_editor || !history_editor_with_mute)
-		return;
-
-	//BOOL show_mute = floater->mShowMuteCheckBox->get();
-	if (show_mute)
-	{
-		history_editor->setVisible(FALSE);
-		history_editor_with_mute->setVisible(TRUE);
-		history_editor_with_mute->setCursorAndScrollToEnd();
-	}
-	else
-	{
-		history_editor->setVisible(TRUE);
-		history_editor_with_mute->setVisible(FALSE);
-		history_editor->setCursorAndScrollToEnd();
-	}
-}
-
-// Put a line of chat in all the right places
-void LLFloaterChat::addChat(const LLChat& chat, BOOL local_agent)
-{
-	triggerAlerts(chat.mText);
-
-	// Add the sender to the list of people with which we've recently interacted.
-	// this is not the best place to add _all_ messages to recent list
-	// comment this for now, may remove later on code cleanup
-	//if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull())
-	//	LLRecentPeople::instance().add(chat.mFromID);
-	
-	addChatHistory(chat, true);
-}
-
-// Moved from lltextparser.cpp to break llui/llaudio library dependency.
-//static
-void LLFloaterChat::triggerAlerts(const std::string& text)
-{
-	LLTextParser* parser = LLTextParser::getInstance();
-//    bool spoken=FALSE;
-	for (S32 i=0;i<parser->mHighlights.size();i++)
-	{
-		LLSD& highlight = parser->mHighlights[i];
-		if (parser->findPattern(text,highlight) >= 0 )
-		{
-			if(gAudiop)
-			{
-				if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString())
-				{
-					gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(), 
-						gAgent.getID(),
-						1.f,
-						LLAudioEngine::AUDIO_TYPE_UI,
-						gAgent.getPositionGlobal() );
-				}
-/*				
-				if (!spoken) 
-				{
-					LLTextToSpeech* text_to_speech = NULL;
-					text_to_speech = LLTextToSpeech::getInstance();
-					spoken = text_to_speech->speak((LLString)highlight["voice"],text); 
-				}
- */
-			}
-			if (highlight["flash"])
-			{
-				LLWindow* viewer_window = gViewerWindow->getWindow();
-				if (viewer_window && viewer_window->getMinimized())
-				{
-					viewer_window->flashIcon(5.f);
-				}
-			}
-		}
-	}
-}
-
-LLColor4 get_text_color(const LLChat& chat)
-{
-	LLColor4 text_color;
-
-	if(chat.mMuted)
-	{
-		text_color.setVec(0.8f, 0.8f, 0.8f, 1.f);
-	}
-	else
-	{
-		switch(chat.mSourceType)
-		{
-		case CHAT_SOURCE_SYSTEM:
-			text_color = LLUIColorTable::instance().getColor("SystemChatColor");
-			break;
-		case CHAT_SOURCE_AGENT:
-		    if (chat.mFromID.isNull())
-			{
-				text_color = LLUIColorTable::instance().getColor("SystemChatColor");
-			}
-			else
-			{
-				if(gAgent.getID() == chat.mFromID)
-				{
-					text_color = LLUIColorTable::instance().getColor("UserChatColor");
-				}
-				else
-				{
-					text_color = LLUIColorTable::instance().getColor("AgentChatColor");
-				}
-			}
-			break;
-		case CHAT_SOURCE_OBJECT:
-			if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
-			{
-				text_color = LLUIColorTable::instance().getColor("ScriptErrorColor");
-			}
-			else if ( chat.mChatType == CHAT_TYPE_OWNER )
-			{
-				text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor");
-			}
-			else
-			{
-				text_color = LLUIColorTable::instance().getColor("ObjectChatColor");
-			}
-			break;
-		default:
-			text_color.setToWhite();
-		}
-
-		if (!chat.mPosAgent.isExactlyZero())
-		{
-			LLVector3 pos_agent = gAgent.getPositionAgent();
-			F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
-			F32 dist_near_chat = gAgent.getNearChatRadius();
-			if (distance_squared > dist_near_chat * dist_near_chat)
-			{
-				// diminish far-off chat
-				text_color.mV[VALPHA] = 0.8f;
-			}
-		}
-	}
-
-	return text_color;
-}
-
-//static
-void LLFloaterChat::loadHistory()
-{
-	LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance()); 
-}
-
-//static
-void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , const LLSD& line, void* userdata)
-{
-	switch (type)
-	{
-	case LLLogChat::LOG_EMPTY:
-	case LLLogChat::LOG_END:
-		// *TODO: nice message from XML file here
-		break;
-	case LLLogChat::LOG_LINE:
-	case LLLogChat::LOG_LLSD:
-		{
-			LLChat chat;					
-			chat.mText = line["message"].asString();
-			get_text_color(chat);
-			addChatHistory(chat,  FALSE);
-		}
-		break;
-	default:
-		// nothing
-		break;
-	}
-}
-
-//static
-void* LLFloaterChat::createSpeakersPanel(void* data)
-{
-	return new LLPanelActiveSpeakers(LLLocalSpeakerMgr::getInstance(), TRUE);
-}
-
-//static
-void* LLFloaterChat::createChatPanel(void* data)
-{
-	LLChatBar* chatp = new LLChatBar();
-	return chatp;
-}
-
-// static
-void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata)
-{
-	LLFloaterChat* self = (LLFloaterChat*)userdata;
-
-	self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel"));
-}
-
-//static
- LLFloaterChat* LLFloaterChat::getInstance()
- {
-	 return LLFloaterReg::getTypedInstance<LLFloaterChat>("chat", LLSD()) ;
-	 
- }
diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h
deleted file mode 100644
index fb2aabbfdf7..00000000000
--- a/indra/newview/llfloaterchat.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/** 
- * @file llfloaterchat.h
- * @brief LLFloaterChat class definition
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-/*
- * Actually the "Chat History" floater.
- * Should be llfloaterchathistory, not llfloaterchat.
- */
-
-#ifndef LL_LLFLOATERCHAT_H
-#define LL_LLFLOATERCHAT_H
-
-#include "llfloater.h"
-#include "lllogchat.h"
-
-class LLChat;
-class LLPanelActiveSpeakers;
-class LLLogChat;
-
-class LLFloaterChat : public LLFloater
-{
-public:
-	LLFloaterChat(const LLSD& seed);
-	~LLFloaterChat();
-
-	virtual void draw();
-	virtual BOOL postBuild();
-
-	void updateConsoleVisibility();
-
-	static void setHistoryCursorAndScrollToEnd();
-
-	//  *TODO:Skinning - move these to LLChat (or LLViewerChat?)
-	// Add chat to console and history list.
-	// Color based on source, type, distance.
-	static void addChat(const LLChat& chat, BOOL local_agent = FALSE);
-	// Add chat to history alone.
-	static void addChatHistory(const LLChat& chat, bool log_to_file = true);
-	
-	static void triggerAlerts(const std::string& text);
-
-	static void onClickMute(void *data);
-	static void onClickToggleShowMute(LLUICtrl* caller, void *data);
-	static void onClickToggleActiveSpeakers(void* userdata);
-	static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& line, void* userdata);
-	static void loadHistory();
-	static void* createSpeakersPanel(void* data);
-	static void* createChatPanel(void* data);
-	
-	static LLFloaterChat* getInstance(); // *TODO:Skinning Deprecate
-	
-	LLPanelActiveSpeakers* mPanel;
-	BOOL mScrolledToEnd;
-};
-
-#endif
diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp
deleted file mode 100644
index dc33e45dd46..00000000000
--- a/indra/newview/llfloaterchatterbox.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-/** 
- * @file llfloaterchatterbox.cpp
- * @author Richard
- * @date 2007-05-08
- * @brief Implementation of the chatterbox integrated conversation ui
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloaterreg.h"
-#include "llfloaterchatterbox.h"
-#include "lluictrlfactory.h"
-#include "llfloaterfriends.h"
-#include "llfloatergroups.h"
-#include "llviewercontrol.h"
-#include "llvoicechannel.h"
-#include "llimpanel.h"
-#include "llimview.h"
-
-//
-// LLFloaterMyFriends
-//
-
-LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed)
-	: LLFloater(seed)
-{
-	mFactoryMap["friends_panel"] = LLCallbackMap(LLFloaterMyFriends::createFriendsPanel, NULL);
-	mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL);
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml");
-}
-
-LLFloaterMyFriends::~LLFloaterMyFriends()
-{
-}
-
-BOOL LLFloaterMyFriends::postBuild()
-{
-	return TRUE;
-}
-
-void LLFloaterMyFriends::onOpen(const LLSD& key)
-{
-	if (key.asString() == "friends")
-	{
-		childShowTab("friends_and_groups", "friends_panel");
-	}
-	else if (key.asString() == "groups")
-	{
-		childShowTab("friends_and_groups", "groups_panel");
-	}
-}
-
-//static
-void* LLFloaterMyFriends::createFriendsPanel(void* data)
-{
-	return new LLPanelFriends();
-}
-
-//static
-void* LLFloaterMyFriends::createGroupsPanel(void* data)
-{
-	return new LLPanelGroups();
-}
-
-//static
-LLFloaterMyFriends* LLFloaterMyFriends::getInstance()
-{
-	return LLFloaterReg::getTypedInstance<LLFloaterMyFriends>("contacts", "friends") ;
-}
-
-//
-// LLFloaterChatterBox
-//
-LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed)
-:	LLMultiFloater(seed),
-	mActiveVoiceFloater(NULL)
-{
-	mAutoResize = FALSE;
-
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", FALSE);
-}
-
-LLFloaterChatterBox::~LLFloaterChatterBox()
-{
-}
-
-BOOL LLFloaterChatterBox::postBuild()
-{
-	setVisibleCallback(boost::bind(&LLFloaterChatterBox::onVisibilityChange, this, _2));
-	
-	if (gSavedSettings.getBOOL("ContactsTornOff"))
-	{
-		LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance();
-		if(floater_contacts)
-		{
-			// add then remove to set up relationship for re-attach
-			addFloater(floater_contacts, FALSE);
-			removeFloater(floater_contacts);
-			// reparent to floater view
-			gFloaterView->addChild(floater_contacts);
-		}
-	}
-	else
-	{
-		addFloater(LLFloaterMyFriends::getInstance(), TRUE);
-	}
-
-	mTabContainer->lockTabs();
-	return TRUE;
-}
-
-BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask)
-{
-	if (key == 'W' && mask == MASK_CONTROL)
-	{
-		LLFloater* floater = getActiveFloater();
-		// is user closeable and is system closeable
-		if (floater && floater->canClose())
-		{
-			if (floater->isCloseable())
-			{
-				floater->closeFloater();
-			}
-			else
-			{
-				// close chatterbox window if frontmost tab is reserved, non-closeable tab
-				// such as contacts or near me
-				closeFloater();
-			}
-		}
-		return TRUE;
-	}
-
-	return LLMultiFloater::handleKeyHere(key, mask);
-}
-
-void LLFloaterChatterBox::draw()
-{
-	// clear new im notifications when chatterbox is visible
-	if (!isMinimized()) 
-	{
-		gIMMgr->clearNewIMNotification();
-	}
-	LLFloater* current_active_floater = getCurrentVoiceFloater();
-	// set icon on tab for floater currently associated with active voice channel
-	if(mActiveVoiceFloater != current_active_floater)
-	{
-		// remove image from old floater's tab
-		if (mActiveVoiceFloater)
-		{
-			mTabContainer->setTabImage(mActiveVoiceFloater, "");
-		}
-	}
-
-	// update image on current active tab
-	if (current_active_floater)
-	{
-		LLColor4 icon_color = LLColor4::white;
-		LLVoiceChannel* channelp = LLVoiceChannel::getCurrentVoiceChannel();
-		if (channelp)
-		{
-			if (channelp->isActive())
-			{
-				icon_color = LLColor4::green;
-			}
-			else if (channelp->getState() == LLVoiceChannel::STATE_ERROR)
-			{
-				icon_color = LLColor4::red;
-			}
-			else // active, but not connected
-			{
-				icon_color = LLColor4::yellow;
-			}
-		}
-		mTabContainer->setTabImage(current_active_floater, "active_voice_tab.tga", icon_color);
-	}
-
-	mActiveVoiceFloater = current_active_floater;
-
-	LLMultiFloater::draw();
-}
-
-void LLFloaterChatterBox::onOpen(const LLSD& key)
-{
-	//*TODO:Skinning show the session id associated with key
-	if (key.asString() == "local")
-	{
-	}
-	else if (key.isDefined())
-	{
-		/*LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID());
-		if (impanel)
-		{
-			impanel->openFloater();
-		}*/
-	}
-}
-
-void LLFloaterChatterBox::onVisibilityChange ( const LLSD& new_visibility )
-{
-}
-
-void LLFloaterChatterBox::removeFloater(LLFloater* floaterp)
-{
-	if(!floaterp) return;
-		
-	if (floaterp->getName() == "chat floater")
-	{
-		// only my friends floater now locked
-		mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1);
-		gSavedSettings.setBOOL("ChatHistoryTornOff", TRUE);
-		floaterp->setCanClose(TRUE);
-	}
-	else if (floaterp->getName() == "floater_my_friends")
-	{
-		// only chat floater now locked
-		mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1);
-		gSavedSettings.setBOOL("ContactsTornOff", TRUE);
-		floaterp->setCanClose(TRUE);
-	}
-	LLMultiFloater::removeFloater(floaterp);
-}
-
-void LLFloaterChatterBox::addFloater(LLFloater* floaterp, 
-									BOOL select_added_floater, 
-									LLTabContainer::eInsertionPoint insertion_point)
-{
-	if(!floaterp) return;
-	
-	S32 num_locked_tabs = mTabContainer->getNumLockedTabs();
-
-	// already here
-	if (floaterp->getHost() == this)
-	{
-		openFloater(floaterp->getKey());
-		return;
-	}
-
-	// make sure my friends and chat history both locked when re-attaching chat history
-	if (floaterp->getName() == "chat floater")
-	{
-		mTabContainer->unlockTabs();
-		// add chat history as second tab if contact window is present, first tab otherwise
-		if (getChildView("floater_my_friends"))
-		{
-			// assuming contacts window is first tab, select it
-			mTabContainer->selectFirstTab();
-			// and add ourselves after
-			LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::RIGHT_OF_CURRENT);
-		}
-		else
-		{
-			LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START);
-		}
-		
-		// make sure first two tabs are now locked
-		mTabContainer->lockTabs(num_locked_tabs + 1);
-		gSavedSettings.setBOOL("ChatHistoryTornOff", FALSE);
-		floaterp->setCanClose(FALSE);
-	}
-	else if (floaterp->getName() == "floater_my_friends")
-	{
-		mTabContainer->unlockTabs();
-		// add contacts window as first tab
-		LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START);
-		// make sure first two tabs are now locked
-		mTabContainer->lockTabs(num_locked_tabs + 1);
-		gSavedSettings.setBOOL("ContactsTornOff", FALSE);
-		floaterp->setCanClose(FALSE);
-	}
-	else
-	{
-		LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
-		// openFloater(floaterp->getKey());
-	}
-
-	// make sure active voice icon shows up for new tab
-	if (floaterp == mActiveVoiceFloater)
-	{
-		mTabContainer->setTabImage(floaterp, "active_voice_tab.tga");	
-	}
-}
-
-//static
-LLFloaterChatterBox* LLFloaterChatterBox::getInstance()
-{
-	return LLFloaterReg::getTypedInstance<LLFloaterChatterBox>("communicate", LLSD()) ; 
-}
-
-//static 
-LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater()
-{
-	if (!LLVoiceClient::getInstance()->voiceEnabled())
-	{
-		return NULL;
-	}
-	if (LLVoiceChannelProximal::getInstance() == LLVoiceChannel::getCurrentVoiceChannel())
-	{
-		return NULL;
-	}
-	else
-	{
-		LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance();
-		if(!floater) return NULL;
-		// iterator over all IM tabs (skip friends and near me)
-		for (S32 i = 0; i < floater->getFloaterCount(); i++)
-		{
-			LLPanel* panelp = floater->mTabContainer->getPanelByIndex(i);
-			if (panelp->getName() == "im_floater")
-			{
-				// only LLFloaterIMPanels are called "im_floater"
-				LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)panelp;
-				LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(im_floaterp->getSessionID());
-				if (voice_channel  == LLVoiceChannel::getCurrentVoiceChannel())
-				{
-					return im_floaterp;
-				}
-			}
-		}
-	}
-	return NULL;
-}
diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h
deleted file mode 100644
index 3a8bfe2fa4d..00000000000
--- a/indra/newview/llfloaterchatterbox.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/** 
- * @file llfloaterchatterbox.h
- * @author Richard
- * @date 2007-05-04
- * @brief Integrated friends and group management/communication tool
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFLOATERCHATTERBOX_H
-#define LL_LLFLOATERCHATTERBOX_H
-
-#include "llfloater.h"
-#include "llmultifloater.h"
-#include "llstring.h"
-#include "llimpanel.h"
-
-class LLTabContainer;
-
-class LLFloaterChatterBox : public LLMultiFloater
-{
-public:
-	LLFloaterChatterBox(const LLSD& seed);
-	virtual ~LLFloaterChatterBox();
-	
-	/*virtual*/ BOOL postBuild();
-	/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
-	/*virtual*/ void draw();
-	/*virtual*/ void onOpen(const LLSD& key);
-
-	/*virtual*/ void removeFloater(LLFloater* floaterp);
-	/*virtual*/ void addFloater(LLFloater* floaterp, 
-								BOOL select_added_floater, 
-								LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
-
-	static LLFloaterChatterBox* getInstance(); // *TODO:Skinning Deprecate
-	static LLFloater* getCurrentVoiceFloater();
-	
-protected:
-	void onVisibilityChange ( const LLSD& new_visibility );
-	
-	LLFloater* mActiveVoiceFloater;
-};
-
-
-class LLFloaterMyFriends : public LLFloater
-{
-public:
-	LLFloaterMyFriends(const LLSD& seed);
-	virtual ~LLFloaterMyFriends();
-
-	/*virtual*/ BOOL postBuild();
-	/*virtual*/ void onOpen(const LLSD& key);
-
-	static LLFloaterMyFriends* getInstance(); // *TODO:Skinning Deprecate
-	
-	static void* createFriendsPanel(void* data);
-	static void* createGroupsPanel(void* data);
-};
-
-#endif // LL_LLFLOATERCHATTERBOX_H
diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp
deleted file mode 100644
index f93568d617b..00000000000
--- a/indra/newview/llfloaterfriends.cpp
+++ /dev/null
@@ -1,807 +0,0 @@
-/** 
- * @file llfloaterfriends.cpp
- * @author Phoenix
- * @date 2005-01-13
- * @brief Implementation of the friends floater
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloaterfriends.h"
-
-#include <sstream>
-
-#include "lldir.h"
-
-#include "llagent.h"
-#include "llappviewer.h"	// for gLastVersionChannel
-#include "llfloateravatarpicker.h"
-#include "llviewerwindow.h"
-#include "llbutton.h"
-#include "llavataractions.h"
-#include "llinventorymodel.h"
-#include "llnamelistctrl.h"
-#include "llnotificationsutil.h"
-#include "llresmgr.h"
-#include "llscrolllistctrl.h"
-#include "llscrolllistitem.h"
-#include "llscrolllistcell.h"
-#include "lluictrlfactory.h"
-#include "llmenucommands.h"
-#include "llviewercontrol.h"
-#include "llviewermessage.h"
-#include "lleventtimer.h"
-#include "lltextbox.h"
-#include "llvoiceclient.h"
-
-// *TODO: Move more common stuff to LLAvatarActions?
-
-//Maximum number of people you can select to do an operation on at once.
-#define MAX_FRIEND_SELECT 20
-#define DEFAULT_PERIOD 5.0
-#define RIGHTS_CHANGE_TIMEOUT 5.0
-#define OBSERVER_TIMEOUT 0.5
-
-#define ONLINE_SIP_ICON_NAME "slim_icon_16_viewer.tga"
-
-// simple class to observe the calling cards.
-class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer
-{
-public: 
-	LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater), LLEventTimer(OBSERVER_TIMEOUT)
-	{
-		mEventTimer.stop();
-	}
-	virtual ~LLLocalFriendsObserver()
-	{
-		mFloater = NULL;
-	}
-	virtual void changed(U32 mask)
-	{
-		// events can arrive quickly in bulk - we need not process EVERY one of them -
-		// so we wait a short while to let others pile-in, and process them in aggregate.
-		mEventTimer.start();
-
-		// save-up all the mask-bits which have come-in
-		mMask |= mask;
-	}
-	virtual BOOL tick()
-	{
-		mFloater->updateFriends(mMask);
-
-		mEventTimer.stop();
-		mMask = 0;
-
-		return FALSE;
-	}
-	
-protected:
-	LLPanelFriends* mFloater;
-	U32 mMask;
-};
-
-LLPanelFriends::LLPanelFriends() :
-	LLPanel(),
-	LLEventTimer(DEFAULT_PERIOD),
-	mObserver(NULL),
-	mShowMaxSelectWarning(TRUE),
-	mAllowRightsChange(TRUE),
-	mNumRightsChanged(0)
-{
-	mEventTimer.stop();
-	mObserver = new LLLocalFriendsObserver(this);
-	LLAvatarTracker::instance().addObserver(mObserver);
-	// For notification when SIP online status changes.
-	LLVoiceClient::getInstance()->addObserver(mObserver);
-}
-
-LLPanelFriends::~LLPanelFriends()
-{
-	// For notification when SIP online status changes.
-	LLVoiceClient::getInstance()->removeObserver(mObserver);
-	LLAvatarTracker::instance().removeObserver(mObserver);
-	delete mObserver;
-}
-
-BOOL LLPanelFriends::tick()
-{
-	mEventTimer.stop();
-	mPeriod = DEFAULT_PERIOD;
-	mAllowRightsChange = TRUE;
-	updateFriends(LLFriendObserver::ADD);
-	return FALSE;
-}
-
-void LLPanelFriends::updateFriends(U32 changed_mask)
-{
-	LLUUID selected_id;
-	LLCtrlListInterface *friends_list = childGetListInterface("friend_list");
-	if (!friends_list) return;
-	LLCtrlScrollInterface *friends_scroll = childGetScrollInterface("friend_list");
-	if (!friends_scroll) return;
-	
-	// We kill the selection warning, otherwise we'll spam with warning popups
-	// if the maximum amount of friends are selected
-	mShowMaxSelectWarning = false;
-
-	std::vector<LLUUID> selected_friends = getSelectedIDs();
-	if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
-	{
-		refreshNames(changed_mask);
-	}
-	else if(changed_mask & LLFriendObserver::POWERS)
-	{
-		--mNumRightsChanged;
-		if(mNumRightsChanged > 0)
-		{
-			mPeriod = RIGHTS_CHANGE_TIMEOUT;	
-			mEventTimer.start();
-			mAllowRightsChange = FALSE;
-		}
-		else
-		{
-			tick();
-		}
-	}
-	if(selected_friends.size() > 0)
-	{
-		// only non-null if friends was already found. This may fail,
-		// but we don't really care here, because refreshUI() will
-		// clean up the interface.
-		friends_list->setCurrentByID(selected_id);
-		for(std::vector<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr)
-		{
-			friends_list->setSelectedByValue(*itr, true);
-		}
-	}
-
-	refreshUI();
-	mShowMaxSelectWarning = true;
-}
-
-// virtual
-BOOL LLPanelFriends::postBuild()
-{
-	mFriendsList = getChild<LLScrollListCtrl>("friend_list");
-	mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
-	mFriendsList->setMaximumSelectCallback(boost::bind(&LLPanelFriends::onMaximumSelect));
-	mFriendsList->setCommitOnSelectionChange(TRUE);
-	mFriendsList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
-	childSetCommitCallback("friend_list", onSelectName, this);
-	getChild<LLScrollListCtrl>("friend_list")->setDoubleClickCallback(onClickIM, this);
-
-	U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
-	refreshNames(changed_mask);
-
-	childSetAction("im_btn", onClickIM, this);
-	childSetAction("profile_btn", onClickProfile, this);
-	childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
-	childSetAction("pay_btn", onClickPay, this);
-	childSetAction("add_btn", onClickAddFriend, this);
-	childSetAction("remove_btn", onClickRemove, this);
-
-	setDefaultBtn("im_btn");
-
-	updateFriends(LLFriendObserver::ADD);
-	refreshUI();
-
-	// primary sort = online status, secondary sort = name
-	mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
-	mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);
-
-	return TRUE;
-}
-
-BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)
-{
-	LLAvatarTracker& at = LLAvatarTracker::instance();
-	const LLRelationship* relationInfo = at.getBuddyInfo(agent_id);
-	if(!relationInfo) return FALSE;
-
-	bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(agent_id);
-	bool isOnline = relationInfo->isOnline();
-
-	std::string fullname;
-	BOOL have_name = gCacheName->getFullName(agent_id, fullname);
-	
-	LLSD element;
-	element["id"] = agent_id;
-	LLSD& friend_column = element["columns"][LIST_FRIEND_NAME];
-	friend_column["column"] = "friend_name";
-	friend_column["value"] = fullname;
-	friend_column["font"]["name"] = "SANSSERIF";
-	friend_column["font"]["style"] = "NORMAL";	
-
-	LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS];
-	online_status_column["column"] = "icon_online_status";
-	online_status_column["type"] = "icon";
-	
-	if (isOnline)
-	{
-		friend_column["font"]["style"] = "BOLD";	
-		online_status_column["value"] = "icon_avatar_online.tga";
-	}
-	else if(isOnlineSIP)
-	{
-		friend_column["font"]["style"] = "BOLD";	
-		online_status_column["value"] = ONLINE_SIP_ICON_NAME;
-	}
-
-	LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE];
-	online_column["column"] = "icon_visible_online";
-	online_column["type"] = "checkbox";
-	online_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS);
-
-	LLSD& visible_map_column = element["columns"][LIST_VISIBLE_MAP];
-	visible_map_column["column"] = "icon_visible_map";
-	visible_map_column["type"] = "checkbox";
-	visible_map_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION);
-
-	LLSD& edit_my_object_column = element["columns"][LIST_EDIT_MINE];
-	edit_my_object_column["column"] = "icon_edit_mine";
-	edit_my_object_column["type"] = "checkbox";
-	edit_my_object_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS);
-
-	LLSD& edit_their_object_column = element["columns"][LIST_EDIT_THEIRS];
-	edit_their_object_column["column"] = "icon_edit_theirs";
-	edit_their_object_column["type"] = "checkbox";
-	edit_their_object_column["enabled"] = "";
-	edit_their_object_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS);
-
-	LLSD& update_gen_column = element["columns"][LIST_FRIEND_UPDATE_GEN];
-	update_gen_column["column"] = "friend_last_update_generation";
-	update_gen_column["value"] = have_name ? relationInfo->getChangeSerialNum() : -1;
-
-	mFriendsList->addElement(element, ADD_BOTTOM);
-	return have_name;
-}
-
-// propagate actual relationship to UI.
-// Does not resort the UI list because it can be called frequently. JC
-BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info)
-{
-	if (!info) return FALSE;
-	LLScrollListItem* itemp = mFriendsList->getItem(agent_id);
-	if (!itemp) return FALSE;
-	
-	bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID());
-	bool isOnline = info->isOnline();
-
-	std::string fullname;
-	BOOL have_name = gCacheName->getFullName(agent_id, fullname);
-	
-	// Name of the status icon to use
-	std::string statusIcon;
-	
-	if(isOnline)
-	{
-		statusIcon = "icon_avatar_online.tga";
-	}
-	else if(isOnlineSIP)
-	{
-		statusIcon = ONLINE_SIP_ICON_NAME;
-	}
-
-	itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon);
-	
-	itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname);
-	// render name of online friends in bold text
-	((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL);	
-	itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
-	itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
-	itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));
-	S32 change_generation = have_name ? info->getChangeSerialNum() : -1;
-	itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(change_generation);
-
-	// enable this item, in case it was disabled after user input
-	itemp->setEnabled(TRUE);
-
-	// Do not resort, this function can be called frequently.
-	return have_name;
-}
-
-void LLPanelFriends::refreshRightsChangeList()
-{
-	std::vector<LLUUID> friends = getSelectedIDs();
-	S32 num_selected = friends.size();
-
-	bool can_offer_teleport = num_selected >= 1;
-	bool selected_friends_online = true;
-
-	const LLRelationship* friend_status = NULL;
-	for(std::vector<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr)
-	{
-		friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr);
-		if (friend_status)
-		{
-			if(!friend_status->isOnline())
-			{
-				can_offer_teleport = false;
-				selected_friends_online = false;
-			}
-		}
-		else // missing buddy info, don't allow any operations
-		{
-			can_offer_teleport = false;
-		}
-	}
-	
-	if (num_selected == 0)  // nothing selected
-	{
-		childSetEnabled("im_btn", FALSE);
-		childSetEnabled("offer_teleport_btn", FALSE);
-	}
-	else // we have at least one friend selected...
-	{
-		// only allow IMs to groups when everyone in the group is online
-		// to be consistent with context menus in inventory and because otherwise
-		// offline friends would be silently dropped from the session
-		childSetEnabled("im_btn", selected_friends_online || num_selected == 1);
-		childSetEnabled("offer_teleport_btn", can_offer_teleport);
-	}
-}
-
-struct SortFriendsByID
-{
-	bool operator() (const LLScrollListItem* const a, const LLScrollListItem* const b) const
-	{
-		return a->getValue().asUUID() < b->getValue().asUUID();
-	}
-};
-
-void LLPanelFriends::refreshNames(U32 changed_mask)
-{
-	std::vector<LLUUID> selected_ids = getSelectedIDs();	
-	S32 pos = mFriendsList->getScrollPos();	
-	
-	// get all buddies we know about
-	LLAvatarTracker::buddy_map_t all_buddies;
-	LLAvatarTracker::instance().copyBuddyList(all_buddies);
-
-	BOOL have_names = TRUE;
-
-	if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE))
-	{
-		have_names &= refreshNamesSync(all_buddies);
-	}
-
-	if(changed_mask & LLFriendObserver::ONLINE)
-	{
-		have_names &= refreshNamesPresence(all_buddies);
-	}
-
-	if (!have_names)
-	{
-		mEventTimer.start();
-	}
-	// Changed item in place, need to request sort and update columns
-	// because we might have changed data in a column on which the user
-	// has already sorted. JC
-	mFriendsList->updateSort();
-
-	// re-select items
-	mFriendsList->selectMultiple(selected_ids);
-	mFriendsList->setScrollPos(pos);
-}
-
-BOOL LLPanelFriends::refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies)
-{
-	mFriendsList->deleteAllItems();
-
-	BOOL have_names = TRUE;
-	LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
-
-	for(; buddy_it != all_buddies.end(); ++buddy_it)
-	{
-		have_names &= addFriend(buddy_it->first);
-	}
-
-	return have_names;
-}
-
-BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies)
-{
-	std::vector<LLScrollListItem*> items = mFriendsList->getAllData();
-	std::sort(items.begin(), items.end(), SortFriendsByID());
-
-	LLAvatarTracker::buddy_map_t::const_iterator buddy_it  = all_buddies.begin();
-	std::vector<LLScrollListItem*>::const_iterator item_it = items.begin();
-	BOOL have_names = TRUE;
-
-	while(true)
-	{
-		if(item_it == items.end() || buddy_it == all_buddies.end())
-		{
-			break;
-		}
-
-		const LLUUID & buddy_uuid = buddy_it->first;
-		const LLUUID & item_uuid  = (*item_it)->getValue().asUUID();
-		if(item_uuid == buddy_uuid)
-		{
-			const LLRelationship* info = buddy_it->second;
-			if (!info) 
-			{	
-				++item_it;
-				continue;
-			}
-			
-			S32 last_change_generation = (*item_it)->getColumn(LIST_FRIEND_UPDATE_GEN)->getValue().asInteger();
-			if (last_change_generation < info->getChangeSerialNum())
-			{
-				// update existing item in UI
-				have_names &= updateFriendItem(buddy_it->first, info);
-			}
-
-			++buddy_it;
-			++item_it;
-		}
-		else if(item_uuid < buddy_uuid)
-		{
-			++item_it;
-		}
-		else //if(item_uuid > buddy_uuid)
-		{
-			++buddy_it;
-		}
-	}
-
-	return have_names;
-}
-
-void LLPanelFriends::refreshUI()
-{	
-	BOOL single_selected = FALSE;
-	BOOL multiple_selected = FALSE;
-	int num_selected = mFriendsList->getAllSelected().size();
-	if(num_selected > 0)
-	{
-		single_selected = TRUE;
-		if(num_selected > 1)
-		{
-			multiple_selected = TRUE;		
-		}
-	}
-
-
-	//Options that can only be performed with one friend selected
-	childSetEnabled("profile_btn", single_selected && !multiple_selected);
-	childSetEnabled("pay_btn", single_selected && !multiple_selected);
-
-	//Options that can be performed with up to MAX_FRIEND_SELECT friends selected
-	//(single_selected will always be true in this situations)
-	childSetEnabled("remove_btn", single_selected);
-	childSetEnabled("im_btn", single_selected);
-//	childSetEnabled("friend_rights", single_selected);
-
-	refreshRightsChangeList();
-}
-
-std::vector<LLUUID> LLPanelFriends::getSelectedIDs()
-{
-	LLUUID selected_id;
-	std::vector<LLUUID> friend_ids;
-	std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected();
-	for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
-	{
-		friend_ids.push_back((*itr)->getUUID());
-	}
-	return friend_ids;
-}
-
-// static
-void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
-	if(panelp)
-	{
-		panelp->refreshUI();
-		// check to see if rights have changed
-		panelp->applyRightsToFriends();
-	}
-}
-
-//static
-void LLPanelFriends::onMaximumSelect()
-{
-	LLSD args;
-	args["MAX_SELECT"] = llformat("%d", MAX_FRIEND_SELECT);
-	LLNotificationsUtil::add("MaxListSelectMessage", args);
-};
-
-// static
-void LLPanelFriends::onClickProfile(void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
-	std::vector<LLUUID> ids = panelp->getSelectedIDs();
-	if(ids.size() > 0)
-	{
-		LLUUID agent_id = ids[0];
-		LLAvatarActions::showProfile(agent_id);
-	}
-}
-
-// static
-void LLPanelFriends::onClickIM(void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
-	std::vector<LLUUID> ids = panelp->getSelectedIDs();
-	if(ids.size() > 0)
-	{
-		if(ids.size() == 1)
-		{
-			LLAvatarActions::startIM(ids[0]);
-		}
-		else
-		{
-			LLAvatarActions::startConference(ids);
-		}
-	}
-}
-
-// static
-void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names,
-									const std::vector<LLUUID>& ids)
-{
-	if (names.empty()) return;
-	if (ids.empty()) return;
-	LLAvatarActions::requestFriendshipDialog(ids[0], names[0]);
-}
-
-// static
-void LLPanelFriends::onClickAddFriend(void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-	LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
-	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1,_2), FALSE, TRUE);
-	if (root_floater)
-	{
-		root_floater->addDependentFloater(picker);
-	}
-}
-
-// static
-void LLPanelFriends::onClickRemove(void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-	LLAvatarActions::removeFriendsDialog(panelp->getSelectedIDs());
-}
-
-// static
-void LLPanelFriends::onClickOfferTeleport(void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-	LLAvatarActions::offerTeleport(panelp->getSelectedIDs());
-}
-
-// static
-void LLPanelFriends::onClickPay(void* user_data)
-{
-	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
-	std::vector<LLUUID> ids = panelp->getSelectedIDs();
-	if(ids.size() == 1)
-	{	
-		LLAvatarActions::pay(ids[0]);
-	}
-}
-
-void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
-{
-	if (ids.empty()) return;
-	
-	LLSD args;
-	if(ids.size() > 0)
-	{
-		rights_map_t* rights = new rights_map_t(ids);
-
-		// for single friend, show their name
-		if(ids.size() == 1)
-		{
-			LLUUID agent_id = ids.begin()->first;
-			std::string first, last;
-			if(gCacheName->getName(agent_id, first, last))
-			{
-				args["FIRST_NAME"] = first;
-				args["LAST_NAME"] = last;	
-			}
-			if (command == GRANT)
-			{
-				LLNotificationsUtil::add("GrantModifyRights", 
-					args, 
-					LLSD(), 
-					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
-			}
-			else
-			{
-				LLNotificationsUtil::add("RevokeModifyRights", 
-					args, 
-					LLSD(), 
-					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
-			}
-		}
-		else
-		{
-			if (command == GRANT)
-			{
-				LLNotificationsUtil::add("GrantModifyRightsMultiple", 
-					args, 
-					LLSD(), 
-					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
-			}
-			else
-			{
-				LLNotificationsUtil::add("RevokeModifyRightsMultiple", 
-					args, 
-					LLSD(), 
-					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
-			}
-		}
-	}
-}
-
-bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights)
-{
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-	if(0 == option)
-	{
-		sendRightsGrant(*rights);
-	}
-	else
-	{
-		// need to resync view with model, since user cancelled operation
-		rights_map_t::iterator rights_it;
-		for (rights_it = rights->begin(); rights_it != rights->end(); ++rights_it)
-		{
-			const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(rights_it->first);
-			updateFriendItem(rights_it->first, info);
-		}
-	}
-	refreshUI();
-
-	delete rights;
-	return false;
-}
-
-void LLPanelFriends::applyRightsToFriends()
-{
-	BOOL rights_changed = FALSE;
-
-	// store modify rights separately for confirmation
-	rights_map_t rights_updates;
-
-	BOOL need_confirmation = FALSE;
-	EGrantRevoke confirmation_type = GRANT;
-
-	// this assumes that changes only happened to selected items
-	std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected();
-	for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
-	{
-		LLUUID id = (*itr)->getValue();
-		const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(id);
-		if (buddy_relationship == NULL) continue;
-
-		bool show_online_staus = (*itr)->getColumn(LIST_VISIBLE_ONLINE)->getValue().asBoolean();
-		bool show_map_location = (*itr)->getColumn(LIST_VISIBLE_MAP)->getValue().asBoolean();
-		bool allow_modify_objects = (*itr)->getColumn(LIST_EDIT_MINE)->getValue().asBoolean();
-
-		S32 rights = buddy_relationship->getRightsGrantedTo();
-		if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS) != show_online_staus)
-		{
-			rights_changed = TRUE;
-			if(show_online_staus) 
-			{
-				rights |= LLRelationship::GRANT_ONLINE_STATUS;
-			}
-			else 
-			{
-				// ONLINE_STATUS necessary for MAP_LOCATION
-				rights &= ~LLRelationship::GRANT_ONLINE_STATUS;
-				rights &= ~LLRelationship::GRANT_MAP_LOCATION;
-				// propagate rights constraint to UI
-				(*itr)->getColumn(LIST_VISIBLE_MAP)->setValue(FALSE);
-			}
-		}
-		if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION) != show_map_location)
-		{
-			rights_changed = TRUE;
-			if(show_map_location) 
-			{
-				// ONLINE_STATUS necessary for MAP_LOCATION
-				rights |= LLRelationship::GRANT_MAP_LOCATION;
-				rights |= LLRelationship::GRANT_ONLINE_STATUS;
-				(*itr)->getColumn(LIST_VISIBLE_ONLINE)->setValue(TRUE);
-			}
-			else 
-			{
-				rights &= ~LLRelationship::GRANT_MAP_LOCATION;
-			}
-		}
-		
-		// now check for change in modify object rights, which requires confirmation
-		if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects)
-		{
-			rights_changed = TRUE;
-			need_confirmation = TRUE;
-
-			if(allow_modify_objects)
-			{
-				rights |= LLRelationship::GRANT_MODIFY_OBJECTS;
-				confirmation_type = GRANT;
-			}
-			else
-			{
-				rights &= ~LLRelationship::GRANT_MODIFY_OBJECTS;
-				confirmation_type = REVOKE;
-			}
-		}
-
-		if (rights_changed)
-		{
-			rights_updates.insert(std::make_pair(id, rights));
-			// disable these ui elements until response from server
-			// to avoid race conditions
-			(*itr)->setEnabled(FALSE);
-		}
-	}
-
-	// separately confirm grant and revoke of modify rights
-	if (need_confirmation)
-	{
-		confirmModifyRights(rights_updates, confirmation_type);
-	}
-	else
-	{
-		sendRightsGrant(rights_updates);
-	}
-}
-
-void LLPanelFriends::sendRightsGrant(rights_map_t& ids)
-{
-	if (ids.empty()) return;
-
-	LLMessageSystem* msg = gMessageSystem;
-
-	// setup message header
-	msg->newMessageFast(_PREHASH_GrantUserRights);
-	msg->nextBlockFast(_PREHASH_AgentData);
-	msg->addUUID(_PREHASH_AgentID, gAgent.getID());
-	msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID());
-
-	rights_map_t::iterator id_it;
-	rights_map_t::iterator end_it = ids.end();
-	for(id_it = ids.begin(); id_it != end_it; ++id_it)
-	{
-		msg->nextBlockFast(_PREHASH_Rights);
-		msg->addUUID(_PREHASH_AgentRelated, id_it->first);
-		msg->addS32(_PREHASH_RelatedRights, id_it->second);
-	}
-
-	mNumRightsChanged = ids.size();
-	gAgent.sendReliableMessage();
-}
diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h
deleted file mode 100644
index a303477c95a..00000000000
--- a/indra/newview/llfloaterfriends.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/** 
- * @file llfloaterfriends.h
- * @author Phoenix
- * @date 2005-01-13
- * @brief Declaration of class for displaying the local agent's friends.
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFLOATERFRIENDS_H
-#define LL_LLFLOATERFRIENDS_H
-
-#include "llpanel.h"
-#include "llstring.h"
-#include "lluuid.h"
-#include "lltimer.h"
-#include "llcallingcard.h"
-
-class LLFriendObserver;
-class LLRelationship;
-class LLScrollListItem;
-class LLScrollListCtrl;
-
-/** 
- * @class LLPanelFriends
- * @brief An instance of this class is used for displaying your friends
- * and gives you quick access to all agents which a user relationship.
- *
- * @sa LLFloater
- */
-class LLPanelFriends : public LLPanel, public LLEventTimer
-{
-public:
-	LLPanelFriends();
-	virtual ~LLPanelFriends();
-
-	/** 
-	 * @brief This method either creates or brings to the front the
-	 * current instantiation of this floater. There is only once since
-	 * you can currently only look at your local friends.
-	 */
-	virtual BOOL tick();
-
-	/** 
-	 * @brief This method is called in response to the LLAvatarTracker
-	 * sending out a changed() message.
-	 */
-	void updateFriends(U32 changed_mask);
-
-	virtual BOOL postBuild();
-
-	// *HACK Made public to remove friends from LLAvatarIconCtrl context menu
-	static bool handleRemove(const LLSD& notification, const LLSD& response);
-
-private:
-
-	enum FRIENDS_COLUMN_ORDER
-	{
-		LIST_ONLINE_STATUS,
-		LIST_FRIEND_NAME,
-		LIST_VISIBLE_ONLINE,
-		LIST_VISIBLE_MAP,
-		LIST_EDIT_MINE,
-		LIST_EDIT_THEIRS,
-		LIST_FRIEND_UPDATE_GEN
-	};
-
-	// protected members
-	typedef std::map<LLUUID, S32> rights_map_t;
-	void refreshNames(U32 changed_mask);
-	BOOL refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies);
-	BOOL refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies);
-	void refreshUI();
-	void refreshRightsChangeList();
-	void applyRightsToFriends();
-	BOOL addFriend(const LLUUID& agent_id);	
-	BOOL updateFriendItem(const LLUUID& agent_id, const LLRelationship* relationship);
-
-	typedef enum 
-	{
-		GRANT,
-		REVOKE
-	} EGrantRevoke;
-	void confirmModifyRights(rights_map_t& ids, EGrantRevoke command);
-	void sendRightsGrant(rights_map_t& ids);
-
-	// return empty vector if nothing is selected
-	std::vector<LLUUID> getSelectedIDs();
-
-	// callback methods
-	static void onSelectName(LLUICtrl* ctrl, void* user_data);
-	static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
-	static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
-	static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
-	static void onMaximumSelect();
-
-	static void onClickIM(void* user_data);
-	static void onClickProfile(void* user_data);
-	static void onClickAddFriend(void* user_data);
-	static void onClickRemove(void* user_data);
-
-	static void onClickOfferTeleport(void* user_data);
-	static void onClickPay(void* user_data);
-
-	static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data);
-
-	bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights);
-
-private:
-	// member data
-	LLFriendObserver* mObserver;
-	LLUUID mAddFriendID;
-	std::string mAddFriendName;
-	LLScrollListCtrl* mFriendsList;
-	BOOL mShowMaxSelectWarning;
-	BOOL mAllowRightsChange;
-	S32 mNumRightsChanged;
-};
-
-
-#endif // LL_LLFLOATERFRIENDS_H
diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp
deleted file mode 100644
index 4b7f9432e30..00000000000
--- a/indra/newview/llmenucommands.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/** 
- * @file llmenucommands.cpp
- * @brief Implementations of menu commands.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llmenucommands.h"
-
-#include "imageids.h"
-#include "llfloaterreg.h"
-#include "llfontgl.h"
-#include "llrect.h"
-#include "llerror.h"
-#include "llstring.h"
-#include "message.h"
-
-#include "llagentcamera.h"
-#include "llcallingcard.h"
-#include "llviewercontrol.h"
-//#include "llfirstuse.h"
-#include "llfloaterworldmap.h"
-#include "lllineeditor.h"
-#include "llstatusbar.h"
-#include "llimview.h"
-#include "lltextbox.h"
-#include "llui.h"
-#include "llviewergesture.h"			// for triggering gestures
-#include "llviewermessage.h"
-#include "llviewerparceloverlay.h"
-#include "llviewerregion.h"
-#include "llviewerstats.h"
-#include "lluictrlfactory.h"
-#include "llviewerwindow.h"
-#include "llworld.h"
-#include "llworldmap.h"
-#include "llfocusmgr.h"
-#include "llnearbychatbar.h"
-
-void handle_mouselook(void*)
-{
-	gAgentCamera.changeCameraToMouselook();
-}
-
-
-void handle_chat(void*)
-{
-	// give focus to chatbar if it's open but not focused
-	if (gSavedSettings.getBOOL("ChatVisible") && 
-		gFocusMgr.childHasKeyboardFocus(LLNearbyChatBar::getInstance()->getChatBox()))
-	{
-		LLNearbyChatBar::stopChat();
-	}
-	else
-	{
-		LLNearbyChatBar::startChat(NULL);
-	}
-}
-
-void handle_slash_key(void*)
-{
-	// LLBottomTray::startChat("/");
-	//
-	// Don't do this, it results in a double-slash in the input field.
-	// Another "/" will be automatically typed for us, because the WM_KEYDOWN event
-	// that generated the menu accelerator call (and hence puts focus in
-	// the chat edtior) will be followed by a "/" WM_CHAR character message,
-	// which will type the slash.  Yes, it's weird.  It only matters for
-	// menu accelerators that put input focus into a field.   And Mac works
-	// the same way.  JC
-
-	LLNearbyChatBar::startChat(NULL);
-}
diff --git a/indra/newview/llmenucommands.h b/indra/newview/llmenucommands.h
deleted file mode 100644
index fa845c6f02a..00000000000
--- a/indra/newview/llmenucommands.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/** 
- * @file llmenucommands.h
- * @brief Implementations of menu commands.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLMENUCOMMANDS_H
-#define LL_LLMENUCOMMANDS_H
-
-class LLUUID;
-
-void handle_mouselook(void*);
-void handle_chat(void*);
-void handle_return_key(void*);
-void handle_slash_key(void*);
-
-#endif
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index b8c42a85e61..9c3887377ae 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -63,7 +63,8 @@ class LLNearbyChatScreenChannel: public LLScreenChannelBase
 	typedef std::vector<LLHandle<LLToast> > toast_vec_t;
 	typedef std::list<LLHandle<LLToast> > toast_list_t;
 
-	LLNearbyChatScreenChannel(const Params& p):LLScreenChannelBase(p)
+	LLNearbyChatScreenChannel(const Params& p)
+		: LLScreenChannelBase(p)
 	{
 		mStopProcessing = false;
 
@@ -384,7 +385,7 @@ void LLNearbyChatScreenChannel::arrangeToasts()
 
 	S32 channel_bottom = channel_rect.mBottom;
 
-	S32		bottom = channel_bottom + 10;
+	S32		bottom = channel_bottom + 80;
 	S32		margin = gSavedSettings.getS32("ToastGap");
 
 	//sort active toasts
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index ef41c9104f2..3a1b8d7623d 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -76,7 +76,6 @@
 #include "llinventoryfunctions.h"
 #include "llpanellogin.h"
 #include "llpanelblockedlist.h"
-#include "llmenucommands.h"
 #include "llmoveview.h"
 #include "llparcel.h"
 #include "llrootview.h"
@@ -7992,7 +7991,6 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
 	
 	// World menu
-	commit.add("World.Chat", boost::bind(&handle_chat, (void*)NULL));
 	view_listener_t::addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun");
 	view_listener_t::addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark");
 	view_listener_t::addMenu(new LLWorldPlaceProfile(), "World.PlaceProfile");
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 8ecf4a80b78..3959a021fe2 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -61,7 +61,6 @@
 #include "llviewerwindow.h"
 #include "llviewercamera.h"
 
-#include "llfloaterfriends.h"  //VIVOX, inorder to refresh communicate panel
 #include "llviewernetwork.h"
 #include "llnotificationsutil.h"
 
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index c9b24bf3250..21fcc50f6e3 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  open_positioning="specified"
- specified_left="320"
+ specified_left="458"
  specified_bottom="80"
  legacy_header_height="18"
  can_minimize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 87606c1a2aa..8d0cecdac33 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  open_positioning="specified"
- specified_left="320"
+ specified_left="10"
  specified_bottom="10"
  height="60"
  layout="topleft"
@@ -17,17 +17,17 @@
  can_resize="true"
  default_tab_group="1"
  name="chat_bar"
- width="380">
+ width="300">
     <panel
         top="20"
         class="panel_nearby_chat"
         follow="all"
-        width="380"
+        width="300"
         height="0"
         visible="false"
         filename="panel_nearby_chat.xml"
         name="nearby_chat" />
-    <panel width="380" 
+    <panel width="300" 
            height="31" 
            left="0" 
            bottom="-1" 
@@ -48,7 +48,7 @@
         text_pad_right="25"
         tool_tip="Press Enter to say, Ctrl+Enter to shout"
         top="2"
-        width="335" />
+        width="255" />
       <output_monitor
         auto_update="true"
         follows="right"
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index 6ba812abff7..4d685ac8a99 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  open_positioning="specified"
- specified_left="558"
+ specified_left="320"
  specified_bottom="80"
  legacy_header_height="18"
  can_dock="false"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index eb03545cd73..f5fee9d3848 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -219,12 +219,6 @@
      label="Communicate"
      name="Communicate"
      tear_off="true">
-        <!--menu_item_call
-         label="Chat"
-         name="Chat">
-            <menu_item_call.on_click
-             function="World.Chat" />
-        </menu_item_call-->
         <menu_item_check
          label="Chat..."
          name="Nearby Chat"
-- 
GitLab


From ef0552a090123974682790afdafec68218578113 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 2 Dec 2011 12:33:51 -0800
Subject: [PATCH 347/933] EXP-1642 FIX -- Viewer crash on startup on Mac

Minimum window size setting no longer forces propagation to the OS before root view is initialized.
---
 indra/llwindow/llwindow.cpp      | 14 ++++++++------
 indra/llwindow/llwindow.h        |  2 +-
 indra/newview/llviewerwindow.cpp |  3 ++-
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 4919605afdf..0e17cffc9d5 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -193,20 +193,22 @@ BOOL LLWindow::setSize(LLCoordScreen size)
 
 
 // virtual
-void LLWindow::setMinSize(U32 min_width, U32 min_height)
+void LLWindow::setMinSize(U32 min_width, U32 min_height, bool enforce_immediately)
 {
 	mMinWindowWidth = min_width;
 	mMinWindowHeight = min_height;
 
-	LLCoordScreen cur_size;
-	if (!getMaximized() && getSize(&cur_size))
+	if (enforce_immediately)
 	{
-		if (cur_size.mX < mMinWindowWidth || cur_size.mY < mMinWindowHeight)
+		LLCoordScreen cur_size;
+		if (!getMaximized() && getSize(&cur_size))
 		{
-			setSizeImpl(LLCoordScreen(llmin(cur_size.mX, mMinWindowWidth), llmin(cur_size.mY, mMinWindowHeight)));
+			if (cur_size.mX < mMinWindowWidth || cur_size.mY < mMinWindowHeight)
+			{
+				setSizeImpl(LLCoordScreen(llmin(cur_size.mX, mMinWindowWidth), llmin(cur_size.mY, mMinWindowHeight)));
+			}
 		}
 	}
-
 }
 
 //virtual
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 77a9e88287d..ec41f244651 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -73,7 +73,7 @@ class LLWindow
 	virtual BOOL getSize(LLCoordWindow *size) = 0;
 	virtual BOOL setPosition(LLCoordScreen position) = 0;
 	BOOL setSize(LLCoordScreen size);
-	virtual void setMinSize(U32 min_width, U32 min_height);
+	virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true);
 	virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0;
 	virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
 	virtual BOOL getCursorPosition(LLCoordWindow *position) = 0;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index c38eda5d304..eb72a8657f0 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1597,7 +1597,8 @@ LLViewerWindow::LLViewerWindow(const Params& p)
 		LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL;
 	}
 
-	mWindow->setMinSize(p.min_width, p.min_height);
+	const bool do_not_enforce = false;
+	mWindow->setMinSize(p.min_width, p.min_height, do_not_enforce);  // root view not set 
 	LLCoordScreen scr;
     mWindow->getSize(&scr);
 
-- 
GitLab


From 8f0f4806121b36efe69fc2bdd54610ee6a4319e4 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 2 Dec 2011 14:58:33 -0700
Subject: [PATCH 348/933] fix for SH-2512: Some avatar textures in welcome area
 never load on first visit

---
 indra/newview/llviewertexture.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index b0f5361a798..f4bbc2b0672 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -2309,18 +2309,18 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s
 
 bool LLViewerFetchedTexture::doLoadedCallbacks()
 {
-	static const F32 MAX_INACTIVE_TIME = 120.f ; //seconds
+	static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds
 
-	if(mPauseLoadedCallBacks)
-	{
-		destroyRawImage();
-		return false; //paused
-	}
 	if (mNeedsCreateTexture)
 	{
 		return false;
 	}
-	if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME)
+	if(mPauseLoadedCallBacks)
+	{
+		destroyRawImage();
+		return false; //paused
+	}	
+	if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME && !mIsFetching)
 	{
 		clearCallbackEntryList() ; //remove all callbacks.
 		return false ;
@@ -2343,6 +2343,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
 
 		// Remove ourself from the global list of textures with callbacks
 		gTextureList.mCallbackList.erase(this);
+		return false ;
 	}	
 
 	S32 gl_discard = getDiscardLevel();
-- 
GitLab


From 71974461114d81f818f69a4344ce4071c20f331f Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Sat, 3 Dec 2011 01:19:50 +0200
Subject: [PATCH 349/933] EXP-1506 FIXED updating IM toasts visibility upoon
 mouse over and mouse leave events. The mouse position is checked every frame
 in relation to the toast to catch the mouse leaving the toast "i" button when
 the toast is moved by the screen channel.

The fix is intended to avoid the toasts that don't fade in the following scenario:
1. Have User A Send 4 IM messages to User B: a, b, c, d
2. Have User B hover their mouse over the i on toast c (don't click on it just hover)
3. As the other toasts fade observe toast c moves up to the top and does not fade
---
 indra/newview/lltoast.cpp | 146 ++++++++++++++++++--------------------
 indra/newview/lltoast.h   |   8 +--
 2 files changed, 74 insertions(+), 80 deletions(-)

diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 2d9d3241d8c..c4b226b70b2 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -113,7 +113,8 @@ LLToast::LLToast(const LLToast::Params& p)
 	mHideBtnPressed(false),
 	mIsTip(p.is_tip),
 	mWrapperPanel(NULL),
-	mIsFading(false)
+	mIsFading(false),
+	mIsHovered(false)
 {
 	mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs));
 
@@ -122,8 +123,6 @@ LLToast::LLToast(const LLToast::Params& p)
 	setCanDrag(FALSE);
 
 	mWrapperPanel = getChild<LLPanel>("wrapper_panel");
-	mWrapperPanel->setMouseEnterCallback(boost::bind(&LLToast::onToastMouseEnter, this));
-	mWrapperPanel->setMouseLeaveCallback(boost::bind(&LLToast::onToastMouseLeave, this));
 
 	setBackgroundOpaque(TRUE); // *TODO: obsolete
 	updateTransparency();
@@ -137,8 +136,6 @@ LLToast::LLToast(const LLToast::Params& p)
 	{
 		mHideBtn = getChild<LLButton>("hide_btn");
 		mHideBtn->setClickedCallback(boost::bind(&LLToast::hide,this));
-		mHideBtn->setMouseEnterCallback(boost::bind(&LLToast::onToastMouseEnter, this));
-		mHideBtn->setMouseLeaveCallback(boost::bind(&LLToast::onToastMouseLeave, this));
 	}
 
 	// init callbacks if present
@@ -331,6 +328,55 @@ void LLToast::draw()
 			drawChild(mHideBtn);
 		}
 	}
+
+	updateHoveredState();
+
+	LLToastLifeTimer* timer = getTimer();
+	if (!timer)
+	{
+		return;
+	}
+
+	// Started timer means the mouse had left the toast previously.
+	// If toast is hovered in the current frame we should handle
+	// a mouse enter event.
+	if(timer->getStarted() && mIsHovered)
+	{
+		mOnToastHoverSignal(this, MOUSE_ENTER);
+
+		updateTransparency();
+
+		//toasts fading is management by Screen Channel
+
+		sendChildToFront(mHideBtn);
+		if(mHideBtn && mHideBtn->getEnabled())
+		{
+			mHideBtn->setVisible(TRUE);
+		}
+		mToastMouseEnterSignal(this, getValue());
+	}
+	// Stopped timer means the mouse had entered the toast previously.
+	// If the toast is not hovered in the current frame we should handle
+	// a mouse leave event.
+	else if(!timer->getStarted() && !mIsHovered)
+	{
+		mOnToastHoverSignal(this, MOUSE_LEAVE);
+
+		updateTransparency();
+
+		//toasts fading is management by Screen Channel
+
+		if(mHideBtn && mHideBtn->getEnabled())
+		{
+			if( mHideBtnPressed )
+			{
+				mHideBtnPressed = false;
+				return;
+			}
+			mHideBtn->setVisible(FALSE);
+		}
+		mToastMouseLeaveSignal(this, getValue());
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -378,37 +424,11 @@ void LLToast::setVisible(BOOL show)
 	}
 }
 
-void LLToast::onToastMouseEnter()
+void LLToast::updateHoveredState()
 {
-	LLRect panel_rc = mWrapperPanel->calcScreenRect();
-	LLRect button_rc;
-	if(mHideBtn)
-	{
-		button_rc = mHideBtn->calcScreenRect();
-	}
-
 	S32 x, y;
 	LLUI::getMousePositionScreen(&x, &y);
 
-	if(panel_rc.pointInRect(x, y) || button_rc.pointInRect(x, y))
-	{
-		mOnToastHoverSignal(this, MOUSE_ENTER);
-
-		updateTransparency();
-
-		//toasts fading is management by Screen Channel
-
-		sendChildToFront(mHideBtn);
-		if(mHideBtn && mHideBtn->getEnabled())
-		{
-			mHideBtn->setVisible(TRUE);
-		}
-		mToastMouseEnterSignal(this, getValue());
-	}
-}
-
-void LLToast::onToastMouseLeave()
-{
 	LLRect panel_rc = mWrapperPanel->calcScreenRect();
 	LLRect button_rc;
 	if(mHideBtn)
@@ -416,25 +436,32 @@ void LLToast::onToastMouseLeave()
 		button_rc = mHideBtn->calcScreenRect();
 	}
 
-	S32 x, y;
-	LLUI::getMousePositionScreen(&x, &y);
-
-	mOnToastHoverSignal(this, MOUSE_LEAVE);
+	if (!panel_rc.pointInRect(x, y) && !button_rc.pointInRect(x, y))
+	{
+		// mouse is not over this toast
+		mIsHovered = false;
+		return;
+	}
 
-	updateTransparency();
+	bool is_overlapped_by_other_floater = false;
 
-	//toasts fading is management by Screen Channel
+	const child_list_t* child_list = gFloaterView->getChildList();
 
-	if(mHideBtn && mHideBtn->getEnabled())
+	// find this toast in gFloaterView child list to check whether any floater
+	// with higher Z-order is visible under the mouse pointer overlapping this toast
+	child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
+	if (r_iter != child_list->rend())
 	{
-		if( mHideBtnPressed )
+		// skip this toast and proceed to views above in Z-order
+		for (++r_iter; r_iter != child_list->rend(); ++r_iter)
 		{
-			mHideBtnPressed = false;
-			return;
+			LLView* view = *r_iter;
+			is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
+			if (is_overlapped_by_other_floater) break;
 		}
-		mHideBtn->setVisible(FALSE);
 	}
-	mToastMouseLeaveSignal(this, getValue());
+
+	mIsHovered = !is_overlapped_by_other_floater;
 }
 
 void LLToast::setBackgroundOpaque(BOOL b)
@@ -492,37 +519,6 @@ void LLNotificationsUI::LLToast::startTimer()
 	}
 }
 
-bool LLToast::isHovered()
-{
-	S32 x, y;
-	LLUI::getMousePositionScreen(&x, &y);
-
-	if (!mWrapperPanel->calcScreenRect().pointInRect(x, y))
-	{
-		// mouse is not over this toast
-		return false;
-	}
-
-	bool is_overlapped_by_other_floater = false;
-
-	const child_list_t* child_list = gFloaterView->getChildList();
-
-	// find this toast in gFloaterView child list to check whether any floater
-	// with higher Z-order is visible under the mouse pointer overlapping this toast
-	child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
-	if (r_iter != child_list->rend())
-	{
-		// skip this toast and proceed to views above in Z-order
-		for (++r_iter; r_iter != child_list->rend(); ++r_iter)
-		{
-			LLView* view = *r_iter;
-			is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
-			if (is_overlapped_by_other_floater) break;
-		}
-	}
-	return !is_overlapped_by_other_floater;
-}
-
 //--------------------------------------------------------------------------
 
 BOOL LLToast::handleMouseDown(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 380c2c391ab..77229e7beb5 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -120,7 +120,7 @@ class LLToast : public LLModalDialog
 	/** Start lifetime/fading timer */
 	virtual void startTimer();
 
-	bool isHovered();
+	bool isHovered() { return mIsHovered; }
 
 	// Operating with toasts
 	// insert a panel to a toast
@@ -202,10 +202,7 @@ class LLToast : public LLModalDialog
 	void updateTransparency();
 
 private:
-
-	void onToastMouseEnter();
-
-	void onToastMouseLeave();
+	void updateHoveredState();
 
 	void expire();
 
@@ -236,6 +233,7 @@ class LLToast : public LLModalDialog
 	bool		mIsHidden;  // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849)
 	bool		mIsTip;
 	bool		mIsFading;
+	bool		mIsHovered;
 
 	commit_signal_t mToastMouseEnterSignal;
 	commit_signal_t mToastMouseLeaveSignal;
-- 
GitLab


From 6e2b3fd634b909c534f27898c8658f0029244ff9 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 2 Dec 2011 18:48:43 -0500
Subject: [PATCH 350/933] STORM-1712 Do not sort recent speakers list if mouse
 is hovered over it

---
 doc/contributions.txt               | 1 +
 indra/newview/llparticipantlist.cpp | 9 ++++++++-
 indra/newview/llparticipantlist.h   | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..db77e738457 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1712
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index fb1153980aa..5c95e805ce9 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -468,7 +468,7 @@ void LLParticipantList::setValidateSpeakerCallback(validate_speaker_callback_t c
 
 void LLParticipantList::updateRecentSpeakersOrder()
 {
-	if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder())
+	if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder() && !isHovered())
 	{
 		// Need to update speakers to sort list correctly
 		mSpeakerMgr->update(true);
@@ -477,6 +477,13 @@ void LLParticipantList::updateRecentSpeakersOrder()
 	}
 }
 
+bool LLParticipantList::isHovered()
+{
+	S32 x, y;
+	LLUI::getMousePositionScreen(&x, &y);
+	return mAvatarList->calcScreenRect().pointInRect(x, y);
+}
+
 bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
 {
 	LLUUID uu_id = event->getValue().asUUID();
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index e0b3d42c25d..a001d29b671 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -251,6 +251,8 @@ class LLParticipantList
 	 */
 	void adjustParticipant(const LLUUID& speaker_id);
 
+	bool isHovered();
+
 	LLSpeakerMgr*		mSpeakerMgr;
 	LLAvatarList*		mAvatarList;
 
-- 
GitLab


From 43823c4a8ebd13be8b88c4613499c34495fcd109 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 2 Dec 2011 16:38:53 -0800
Subject: [PATCH 351/933] FIX VWR-17783

---
 indra/newview/skins/default/xui/fr/menu_viewer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 64cd463070a..a9d153c4a69 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -319,7 +319,7 @@
 			<menu_item_check label="Pauser l&apos;avatar" name="AgentPause"/>
 			<menu_item_call label="Activer le journal des messages" name="Enable Message Log"/>
 			<menu_item_call label="Désactiver le journal des messages" name="Disable Message Log"/>
-			<menu_item_check label="Velocity Interpolate Objects" name="Velocity Interpolate Objects"/>
+			<menu_item_check label="Objets d'interpolation de vitesse" name="Velocity Interpolate Objects"/>
 			<menu_item_check label="Interpolation ping des positions des objets" name="Ping Interpolate Object Positions"/>
 			<menu_item_call label="Abandonner un paquet" name="Drop a Packet"/>
 		</menu>
-- 
GitLab


From 7765a525e2dcc5f536e4dcea47968e02aefeb37c Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 2 Dec 2011 16:39:31 -0800
Subject: [PATCH 352/933] FIX VWR-17783 fix html entity

---
 indra/newview/skins/default/xui/fr/menu_viewer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index a9d153c4a69..85382b486e9 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -319,7 +319,7 @@
 			<menu_item_check label="Pauser l&apos;avatar" name="AgentPause"/>
 			<menu_item_call label="Activer le journal des messages" name="Enable Message Log"/>
 			<menu_item_call label="Désactiver le journal des messages" name="Disable Message Log"/>
-			<menu_item_check label="Objets d'interpolation de vitesse" name="Velocity Interpolate Objects"/>
+			<menu_item_check label="Objets d&apos;interpolation de vitesse" name="Velocity Interpolate Objects"/>
 			<menu_item_check label="Interpolation ping des positions des objets" name="Ping Interpolate Object Positions"/>
 			<menu_item_call label="Abandonner un paquet" name="Drop a Packet"/>
 		</menu>
-- 
GitLab


From 677dd0b4a2c27b67076351c8fbfd7c69df043b65 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 2 Dec 2011 16:40:54 -0800
Subject: [PATCH 353/933] FIX VWR-17784

---
 indra/newview/skins/default/xui/fr/menu_viewer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 85382b486e9..78f973a61f7 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -336,7 +336,7 @@
 			<menu_item_check label="Ignorer les paramètres du soleil de la sim" name="Sim Sun Override"/>
 			<menu_item_check label="Balise animée" name="Cheesy Beacon"/>
 			<menu_item_check label="Météo fixe" name="Fixed Weather"/>
-			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
+			<menu_item_call label="Vidage de cache d&apos;objet de la région" name="Dump Region Object Cache"/>
 		</menu>
 		<menu label="Interface" name="UI">
 			<menu_item_call label="Test du navigateur de médias" name="Web Browser Test"/>
-- 
GitLab


From 3193170850ddc0fc3db57d40e9636ec77908dd70 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 5 Dec 2011 05:01:38 -0500
Subject: [PATCH 354/933] STORM-591 Made change per code review request:
 disable audio when teleport progress bar is present Added code to start
 counting the fade in time on login when STATE_STARTED is set

---
 indra/newview/llvieweraudio.cpp     | 46 ++++++++++++++++++++++++++---
 indra/newview/llvieweraudio.h       |  7 +++++
 indra/newview/llviewerparcelmgr.cpp |  3 +-
 3 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index f01fe174a44..2447f5dea8d 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -38,6 +38,9 @@
 #include "llviewermedia.h"
 #include "llprogressview.h"
 #include "llcallbacklist.h"
+#include "llstartup.h"
+#include "llviewerparcelmgr.h"
+#include "llparcel.h"
 
 /////////////////////////////////////////////////////////
 
@@ -45,12 +48,16 @@ LLViewerAudio::LLViewerAudio() :
 	mDone(true),
 	mFadeState(FADE_IDLE),
 	mFadeTime(),
-    mIdleListnerActive(false)
+    mIdleListnerActive(false),
+	mForcedTeleportFade(false)
 {
+	mTeleportFailedConnection = LLViewerParcelMgr::getInstance()->
+		setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this));
 }
 
 LLViewerAudio::~LLViewerAudio()
 {
+	mTeleportFailedConnection.disconnect();
 }
 
 void LLViewerAudio::registerIdleListener()
@@ -108,14 +115,21 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
 	}
 }
 
-// We want onIdleUpdate callback to keep firing whilst we are fading out. Once we have completed the fade
-// out, we switch the stream and start a fade in, and we don't care about idle updates anymore.
 // A return of false from onIdleUpdate means it will be called again next idle update.
 // A return of true means we have finished with it and the callback will be deleted.
 bool LLViewerAudio::onIdleUpdate()
 {
 	bool fadeIsFinished = false;
 
+	// There is a delay in the login sequence between when the parcel information has
+	// arrived and the music stream is started and when the audio system is called to set
+	// initial volume levels.  This code extends the fade time so you hear a full fade in.
+	if ((LLStartUp::getStartupState() < STATE_STARTED))
+	{
+		stream_fade_timer.reset();
+		stream_fade_timer.setTimerExpirySec(mFadeTime);
+	}
+
 	if (mDone)
 	{
 		//  This should be a rare or never occurring state.
@@ -231,6 +245,18 @@ F32 LLViewerAudio::getFadeVolume()
 	return fade_volume;
 }
 
+void LLViewerAudio::onTeleportFailed()
+{
+	if (gAudiop)
+	{
+		LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+		if (parcel)
+		{
+			mNextStreamURI = parcel->getMusicURL();
+		}
+	}
+}
+
 void init_audio() 
 {
 	if (!gAudiop) 
@@ -333,7 +359,19 @@ void audio_update_volume(bool force_update)
 
 	// Streaming Music
 	if (gAudiop) 
-	{		
+	{
+		if (progress_view_visible  && !LLViewerAudio::getInstance()->getForcedTeleportFade())
+		{
+			LLViewerAudio::getInstance()->setForcedTeleportFade(true);
+			LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
+			LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null);
+		}
+
+		if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade() == true)
+		{
+			LLViewerAudio::getInstance()->setForcedTeleportFade(false);
+		}
+
 		F32 music_volume = gSavedSettings.getF32("AudioLevelMusic");
 		BOOL music_muted = gSavedSettings.getBOOL("MuteMusic");
 		F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume();
diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index 26062a2818c..a3da9fc6b8c 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -63,6 +63,9 @@ class LLViewerAudio : public LLSingleton<LLViewerAudio>
 	EFadeState getFadeState() { return mFadeState; }
 	bool isDone() { return mDone; };
 	F32 getFadeVolume();
+	bool getForcedTeleportFade() { return mForcedTeleportFade; };
+	void setForcedTeleportFade(bool fade) { mForcedTeleportFade = fade;} ;
+	void setNextStreamURI(std::string stream) { mNextStreamURI = stream; } ;
 
 private:
 
@@ -72,10 +75,14 @@ class LLViewerAudio : public LLSingleton<LLViewerAudio>
 	EFadeState mFadeState;
 	LLFrameTimer stream_fade_timer;
 	bool mIdleListnerActive;
+	bool mForcedTeleportFade;
+	boost::signals2::connection	mTeleportFailedConnection;
 
 	void registerIdleListener();
 	void deregisterIdleListener() { mIdleListnerActive = false; };
 	void startFading();
+	void onTeleportFailed();
+
 };
 
 #endif //LL_VIEWER_H
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index c18665a3c3d..7ce9672299b 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1729,8 +1729,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
 		// Check for video
 		LLViewerParcelMedia::update(parcel);
 
-		// Then check for music.  Do this last, as there may be a delay waiting for
-		// the stream fading thread to finish.
+		// Then check for music
 		if (gAudiop)
 		{
 			if (parcel)
-- 
GitLab


From 1a6846444f35a89001dffa33d1f76067193165f7 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Mon, 5 Dec 2011 09:26:10 -0500
Subject: [PATCH 355/933] LLSD-14: Optional entry points need conditional decls
 turned on. Changeset 07cd70e75473 moved LLSD::outstandingCount() and
 allocationCount() to free functions so we could turn their visibility on/off
 via LLSD_DEBUG_INFO. But on some platforms, without proper LL_COMMON_API
 declarations visible when we compile llsd.cpp, those free functions lack
 proper linkage directives. Declare LLSD_DEBUG_INFO in llsd.cpp so that when
 the llcommon library is built, the free functions get proper linkage --
 independent of compilations of LLSD consumers.

---
 indra/llcommon/llsd.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 08cb7bd2a84..151eb4084a8 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -24,6 +24,9 @@
  * $/LicenseInfo$
  */
 
+// Must turn on conditional declarations in header file so definitions end up
+// with proper linkage.
+#define LLSD_DEBUG_INFO
 #include "linden_common.h"
 #include "llsd.h"
 
-- 
GitLab


From 09feaac844d67a94ffe8c98a201e1e7f2f84be9a Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 5 Dec 2011 13:23:05 -0700
Subject: [PATCH 356/933] fix for sh-2738: Texture fetching freezes due to
 LLcurl

---
 indra/llcommon/llthread.h  | 11 ++++++--
 indra/llmessage/llcurl.cpp | 54 ++++++++++++++++++--------------------
 2 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 40291a25693..b0a1c9e12b7 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -187,11 +187,18 @@ class LLMutexLock
 	LLMutexLock(LLMutex* mutex)
 	{
 		mMutex = mutex;
-		mMutex->lock();
+
+		if(mMutex)
+		{
+			mMutex->lock();
+		}
 	}
 	~LLMutexLock()
 	{
-		mMutex->unlock();
+		if(mMutex)
+		{
+			mMutex->unlock();
+		}
 	}
 private:
 	LLMutex* mMutex;
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 7ca25d07fce..228f0391327 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -585,37 +585,30 @@ void LLCurl::Multi::unlock()
 
 void LLCurl::Multi::markDead()
 {
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->lock() ;
-	}
-
+	LLMutexLock lock(mDeletionMutexp) ;
+	
 	mDead = TRUE ;
-
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->unlock() ;
-	}
 }
 
 void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 {
-	lock() ;
+	LLMutexLock lock(mMutexp) ;
+
 	mState = state ;
 	if(mState == STATE_READY)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ;
 	}
-	unlock() ;
 }
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
 {
 	ePerformState state ;
 
-	lock() ;
-	state = mState ;
-	unlock() ;
+	{
+		LLMutexLock lock(mMutexp) ;
+		state = mState ;
+	}
 
 	return state ;
 }
@@ -635,13 +628,15 @@ bool LLCurl::Multi::waitToComplete()
 
 	bool completed ;
 
-	lock() ;
-	completed = (STATE_COMPLETED == mState) ;
-	if(!completed)
 	{
-		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
+		LLMutexLock lock(mMutexp) ;
+
+		completed = (STATE_COMPLETED == mState) ;
+		if(!completed)
+		{
+			LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
+		}
 	}
-	unlock() ;
 
 	return completed;
 }
@@ -655,10 +650,8 @@ CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 //return true if dead
 bool LLCurl::Multi::doPerform()
 {
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->lock() ;
-	}
+	LLMutexLock lock(mDeletionMutexp) ;
+	
 	bool dead = mDead ;
 
 	if(mDead)
@@ -675,6 +668,8 @@ bool LLCurl::Multi::doPerform()
 				call_count < MULTI_PERFORM_CALL_REPEAT;
 				call_count++)
 		{
+			LLMutexLock lock(mMutexp) ;
+
 			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
 			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
 			{
@@ -688,11 +683,6 @@ bool LLCurl::Multi::doPerform()
 		setState(STATE_COMPLETED) ;
 	}
 
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->unlock() ;
-	}
-
 	return dead ;
 }
 
@@ -764,6 +754,8 @@ LLCurl::Easy* LLCurl::Multi::allocEasy()
 
 bool LLCurl::Multi::addEasy(Easy* easy)
 {
+	LLMutexLock lock(mMutexp) ;
+
 	CURLMcode mcode = curl_multi_add_handle(mCurlMultiHandle, easy->getCurlHandle());
 	check_curl_multi_code(mcode);
 	//if (mcode != CURLM_OK)
@@ -776,6 +768,8 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
+	LLMutexLock lock(mMutexp) ;
+
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
@@ -791,6 +785,8 @@ void LLCurl::Multi::easyFree(Easy* easy)
 
 void LLCurl::Multi::removeEasy(Easy* easy)
 {
+	LLMutexLock lock(mMutexp) ;
+
 	check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
 	easyFree(easy);
 }
-- 
GitLab


From 591891306366e683416b187207fa2b94bdc263a8 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 5 Dec 2011 13:37:37 -0800
Subject: [PATCH 357/933] First pass at connecting to the new marketplace API

---
 indra/newview/llinventorybridge.cpp           |   2 +-
 indra/newview/llmarketplacefunctions.cpp      |  24 +--
 indra/newview/llmarketplacefunctions.h        |  17 +-
 indra/newview/llpanelmarketplaceoutbox.cpp    | 158 +++++++++++++-----
 indra/newview/llpanelmarketplaceoutbox.h      |  19 ++-
 indra/newview/llsidepanelinventory.cpp        |   2 +-
 indra/newview/llviewermedia.cpp               |  61 -------
 .../skins/default/xui/en/notifications.xml    |  18 +-
 .../default/xui/en/sidepanel_inventory.xml    |   4 +-
 9 files changed, 170 insertions(+), 135 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 0eaa0a46279..017dabe2adb 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -71,7 +71,7 @@
 #include "llwearablelist.h"
 
 // Marketplace outbox current disabled
-#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL
+#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
 typedef std::list<two_uuids_t> two_uuids_list_t;
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 99b03894136..1c189f6ee24 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -50,8 +50,9 @@ std::string getMarketplaceBaseURL()
 		}
 	}
 
-	url += "api/1/users/";
+	url += "api/1/";
 	url += gAgent.getID().getString();
+	url += "/inventory";
 
 	return url;
 }
@@ -60,29 +61,20 @@ std::string getMarketplaceURL_InventoryImport()
 {
 	std::string url = getMarketplaceBaseURL();
 
-	url += "/inventory_import";
-
-	return url;
-}
-
-std::string getMarketplaceURL_UserStatus()
-{
-	std::string url = getMarketplaceBaseURL();
-
-	url += "/user_status";
+	url += "/import";
 
 	return url;
 }
 
 
-static bool gMarketplaceSyncEnabled = true;
+static bool gMarketplaceImportEnabled = true;
 
-bool getMarketplaceSyncEnabled()
+bool getMarketplaceImportEnabled()
 {
-	return gMarketplaceSyncEnabled;
+	return gMarketplaceImportEnabled;
 }
 
-void setMarketplaceSyncEnabled(bool syncEnabled)
+void setMarketplaceImportEnabled(bool importEnabled)
 {
-	gMarketplaceSyncEnabled = syncEnabled;
+	gMarketplaceImportEnabled = importEnabled;
 }
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index e80e6a471cc..fda2fbb935d 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -30,11 +30,20 @@
 
 
 std::string getMarketplaceURL_InventoryImport();
-std::string getMarketplaceURL_UserStatus();
-
-bool getMarketplaceSyncEnabled();
-void setMarketplaceSyncEnabled(bool syncEnabled);
 
+bool getMarketplaceImportEnabled();
+void setMarketplaceImportEnabled(bool syncEnabled);
+
+namespace MarketplaceErrorCodes
+{
+	enum eCodes
+	{
+		IMPORT_DONE = 200,
+		IMPORT_PROCESSING = 202,
+		IMPORT_DONE_WITH_ERRORS = 409,
+		IMPORT_JOB_FAILED = 410,
+	};
+}
 
 #endif // LL_LLMARKETPLACEFUNCTIONS_H
 
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 0ad4d560511..3c8817c199f 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -59,9 +59,12 @@ const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultPara
 LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox(const Params& p)
 	: LLPanel(p)
 	, mInventoryPanel(NULL)
-	, mSyncButton(NULL)
-	, mSyncIndicator(NULL)
-	, mSyncInProgress(false)
+	, mImportButton(NULL)
+	, mImportFrameTimer(0)
+	, mImportGetPending(false)
+	, mImportIndicator(NULL)
+	, mImportInProgress(false)
+	, mOutboxButton(NULL)
 {
 }
 
@@ -81,11 +84,13 @@ BOOL LLPanelMarketplaceOutbox::postBuild()
 
 void LLPanelMarketplaceOutbox::handleLoginComplete()
 {
-	mSyncButton = getChild<LLButton>("outbox_sync_btn");
-	mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this));
-	mSyncButton->setEnabled(getMarketplaceSyncEnabled() && !isOutboxEmpty());
+	mImportButton = getChild<LLButton>("outbox_import_btn");
+	mImportButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onImportButtonClicked, this));
+	mImportButton->setEnabled(getMarketplaceImportEnabled() && !isOutboxEmpty());
 	
-	mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator");
+	mImportIndicator = getChild<LLLoadingIndicator>("outbox_import_indicator");
+	
+	mOutboxButton = getChild<LLButton>("outbox_btn");
 }
 
 void LLPanelMarketplaceOutbox::onFocusReceived()
@@ -164,9 +169,9 @@ bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
 	return (getTotalItemCount() == 0);
 }
 
-bool LLPanelMarketplaceOutbox::isSyncInProgress() const
+bool LLPanelMarketplaceOutbox::isImportInProgress() const
 {
-	return mSyncInProgress;
+	return mImportInProgress;
 }
 
 
@@ -185,25 +190,55 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
 		waitForEventOn(self, "mainloop");
 	}
 
-	outboxPanel->onSyncComplete(true, LLSD::emptyMap());
+	outboxPanel->onImportPostComplete(MarketplaceErrorCodes::IMPORT_DONE, LLSD::emptyMap());
 
 	gTimeDelayDebugFunc = "";
 }
 
 
-class LLInventorySyncResponder : public LLHTTPClient::Responder
+class LLInventoryImportPostResponder : public LLHTTPClient::Responder
 {
 public:
-	LLInventorySyncResponder(LLPanelMarketplaceOutbox * outboxPanel)
+	LLInventoryImportPostResponder(LLPanelMarketplaceOutbox * outboxPanel)
 		: LLCurl::Responder()
 		, mOutboxPanel(outboxPanel)
 	{
 	}
-
+	
 	void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
-		llinfos << "inventory_import complete status: " << status << ", reason: " << reason << llendl;
+		llinfos << "inventory/import post status: " << status << ", reason: " << reason << llendl;
+		
+		if (isGoodStatus(status))
+		{
+			// Complete success
+			llinfos << "success" << llendl;
+		}	
+		else
+		{
+			llwarns << "failed" << llendl;
+		}
+		
+		mOutboxPanel->onImportPostComplete(status, content);
+	}
+
+private:
+	LLPanelMarketplaceOutbox *	mOutboxPanel;	
+};
 
+class LLInventoryImportGetResponder : public LLHTTPClient::Responder
+{
+public:
+	LLInventoryImportGetResponder(LLPanelMarketplaceOutbox * outboxPanel)
+		: LLCurl::Responder()
+		, mOutboxPanel(outboxPanel)
+	{
+	}
+
+	void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		llinfos << "inventory/import get status: " << status << ", reason: " << reason << llendl;
+		
 		if (isGoodStatus(status))
 		{
 			// Complete success
@@ -214,37 +249,67 @@ class LLInventorySyncResponder : public LLHTTPClient::Responder
 			llwarns << "failed" << llendl;
 		}
 
-		mOutboxPanel->onSyncComplete(isGoodStatus(status), content);
+		mOutboxPanel->onImportGetComplete(status, content);
 	}
 
 private:
 	LLPanelMarketplaceOutbox *	mOutboxPanel;
 };
 
-void LLPanelMarketplaceOutbox::onSyncButtonClicked()
+void LLPanelMarketplaceOutbox::onImportButtonClicked()
 {
-	// Get the sync animation going
-	mSyncInProgress = true;
-	updateSyncButtonStatus();
+	// Get the import animation going
+	mImportInProgress = true;
+	mImportFrameTimer = 0;
+
+	updateImportButtonStatus();
 
 	// Make the url for the inventory import request
 	std::string url = getMarketplaceURL_InventoryImport();
 
-	llinfos << "http get:  " << url << llendl;
-	LLHTTPClient::get(url, new LLInventorySyncResponder(this), LLViewerMedia::getHeaders());
+	llinfos << "http post:  " << url << llendl;
+	LLHTTPClient::post(url, LLSD(), new LLInventoryImportPostResponder(this), LLViewerMedia::getHeaders());
 
 	// Set a timer (for testing only)
     //gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
 }
 
-void LLPanelMarketplaceOutbox::onSyncComplete(bool goodStatus, const LLSD& content)
+void LLPanelMarketplaceOutbox::onImportPostComplete(U32 status, const LLSD& content)
 {
-	mSyncInProgress = false;
-	updateSyncButtonStatus();
+	llinfos << "onImportPostComplete status = " << status << llendl;
+	llinfos << "onImportPostComplete content = " << content.asString() << llendl;
+}
+
+void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& content)
+{
+	mImportGetPending = false;	
+	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
+	updateImportButtonStatus();
+	
+	if (!mImportInProgress)
+	{
+		if (status == MarketplaceErrorCodes::IMPORT_DONE)
+		{
+			LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap());
+		}
+		else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
+		{
+			LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
+		}
+		else
+		{
+			llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
+			LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
+		}
+	}
+	
+	return;
+	
+	
 	
 	const LLSD& errors_list = content["errors"];
 
-	if (goodStatus && (errors_list.size() == 0))
+	if (errors_list.size() == 0)
 	{
 		LLNotificationsUtil::add("OutboxUploadComplete", LLSD::emptyMap(), LLSD::emptyMap());
 	}
@@ -287,23 +352,23 @@ void LLPanelMarketplaceOutbox::onSyncComplete(bool goodStatus, const LLSD& conte
 	}
 }
 
-void LLPanelMarketplaceOutbox::updateSyncButtonStatus()
+void LLPanelMarketplaceOutbox::updateImportButtonStatus()
 {
-	if (isSyncInProgress())
+	if (isImportInProgress())
 	{
-		mSyncButton->setVisible(false);
+		mImportButton->setVisible(false);
 
-		mSyncIndicator->setVisible(true);
-		mSyncIndicator->reset();
-		mSyncIndicator->start();
+		mImportIndicator->setVisible(true);
+		mImportIndicator->reset();
+		mImportIndicator->start();
 	}
 	else
 	{
-		mSyncIndicator->stop();
-		mSyncIndicator->setVisible(false);
+		mImportIndicator->stop();
+		mImportIndicator->setVisible(false);
 
-		mSyncButton->setVisible(true);
-		mSyncButton->setEnabled(getMarketplaceSyncEnabled() && !isOutboxEmpty());
+		mImportButton->setVisible(true);
+		mImportButton->setEnabled(getMarketplaceImportEnabled() && !isOutboxEmpty());
 	}
 }
 
@@ -335,17 +400,32 @@ void LLPanelMarketplaceOutbox::draw()
 
 		LLStringUtil::format_map_t args;
 		args["[NUM]"] = item_count_str;
-		getChild<LLButton>("outbox_btn")->setLabel(getString("OutboxLabelWithArg", args));
+		mOutboxButton->setLabel(getString("OutboxLabelWithArg", args));
 	}
 	else
 	{
-		getChild<LLButton>("outbox_btn")->setLabel(getString("OutboxLabelNoArg"));
+		mOutboxButton->setLabel(getString("OutboxLabelNoArg"));
 	}
 	
-	if (!isSyncInProgress())
+	if (!isImportInProgress())
 	{
-		mSyncButton->setEnabled(getMarketplaceSyncEnabled() && not_empty);
+		mImportButton->setEnabled(getMarketplaceImportEnabled() && not_empty);
 	}
+	else
+	{
+		++mImportFrameTimer;
+		
+		if ((mImportFrameTimer % 50 == 0) && !mImportGetPending)
+		{
+			mImportGetPending = true;
+
+			std::string url = getMarketplaceURL_InventoryImport();
+			
+			llinfos << "http get:  " << url << llendl;
+			LLHTTPClient::get(url, new LLInventoryImportGetResponder(this), LLViewerMedia::getHeaders());
+		}
+	}
+
 	
 	LLPanel::draw();
 }
diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h
index c6b4a5abe2f..a776ee09197 100644
--- a/indra/newview/llpanelmarketplaceoutbox.h
+++ b/indra/newview/llpanelmarketplaceoutbox.h
@@ -59,9 +59,10 @@ class LLPanelMarketplaceOutbox : public LLPanel
 	U32 getTotalItemCount() const;
 
 	bool isOutboxEmpty() const;
-	bool isSyncInProgress() const;
+	bool isImportInProgress() const;
 
-	void onSyncComplete(bool goodStatus, const LLSD& content);
+	void onImportPostComplete(U32 status, const LLSD& content);
+	void onImportGetComplete(U32 status, const LLSD& content);
 
 	/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 								   EDragAndDropType cargo_type,
@@ -70,8 +71,8 @@ class LLPanelMarketplaceOutbox : public LLPanel
 								   std::string& tooltip_msg);
 
 protected:
-	void onSyncButtonClicked();
-	void updateSyncButtonStatus();
+	void onImportButtonClicked();
+	void updateImportButtonStatus();
 
 	void handleLoginComplete();
 	void onFocusReceived();
@@ -80,9 +81,13 @@ class LLPanelMarketplaceOutbox : public LLPanel
 private:
 	LLInventoryPanel *		mInventoryPanel;
 
-	LLButton *				mSyncButton;
-	LLLoadingIndicator *	mSyncIndicator;
-	bool					mSyncInProgress;
+	LLButton *				mImportButton;
+	U32						mImportFrameTimer;
+	bool					mImportGetPending;
+	LLLoadingIndicator *	mImportIndicator;
+	bool					mImportInProgress;
+	
+	LLButton *				mOutboxButton;
 };
 
 
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index d556b8523e3..19a81b93bf2 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -69,7 +69,7 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
 #define AUTO_EXPAND_INBOX	0
 
 // Temporarily disabling the outbox until we straighten out the API
-#define ENABLE_MERCHANT_OUTBOX_PANEL		1	// keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+#define ENABLE_MERCHANT_OUTBOX_PANEL		1	// keep in sync with ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
 
 static const char * const INBOX_BUTTON_NAME = "inbox_btn";
 static const char * const OUTBOX_BUTTON_NAME = "outbox_btn";
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index a5bd0223ccc..02d8036666d 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1386,64 +1386,6 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom
 }
 
 
-// This is defined in two files but I don't want to create a dependence between this and llsidepanelinventory
-// just to be able to temporarily disable the outbox.
-#define ENABLE_INVENTORY_DISPLAY_OUTBOX		1	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL, ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
-
-class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
-{
-public:
-	LLInventoryUserStatusResponder()
-		: LLCurl::Responder()
-	{
-	}
-
-	void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (isGoodStatus(status))
-		{
-			std::string merchantStatus = content[gAgent.getID().getString()].asString();
-			llinfos << "Marketplace merchant status: " << merchantStatus << llendl;
-
-			// Save the merchant status before turning on the display
-			gSavedSettings.setString("InventoryMarketplaceUserStatus", merchantStatus);
-
-			// Complete success
-			gSavedSettings.setBOOL("InventoryDisplayInbox", true);
-
-#if ENABLE_INVENTORY_DISPLAY_OUTBOX
-			gSavedSettings.setBOOL("InventoryDisplayOutbox", true);
-#endif
-
-			setMarketplaceSyncEnabled(true);
-		}
-		else if (status == 401)
-		{
-			// API is available for use but OpenID authorization failed
-			gSavedSettings.setBOOL("InventoryDisplayInbox", true);
-
-			setMarketplaceSyncEnabled(false);
-		}
-		else
-		{
-			setMarketplaceSyncEnabled(false);
-
-			// API in unavailable
-			llinfos << "Marketplace API is unavailable -- Inbox may be disabled, status = " << status << ", reason = " << reason << llendl;
-		}
-	}
-};
-
-
-void doOnetimeEarlyHTTPRequests()
-{
-	std::string url = getMarketplaceURL_UserStatus();
-
-	llinfos << "http get: " << url << llendl;
-	LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), LLViewerMedia::getHeaders());
-}
-
-
 LLSD LLViewerMedia::getHeaders()
 {
 	LLSD headers = LLSD::emptyMap();
@@ -1502,9 +1444,6 @@ void LLViewerMedia::setOpenIDCookie()
 		LLHTTPClient::get(profile_url,  
 			new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
 			headers);
-
-		// FUI: No longer perform the user_status query
-		//doOnetimeEarlyHTTPRequests();
 	}
 }
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d925bf8f964..46a6da24504 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -213,9 +213,9 @@ Save changes to current clothing/body part?
 
   <notification
    icon="alertmodal.tga"
-   name="OutboxUploadComplete"
+   name="OutboxImportComplete"
    type="alertmodal">
-Marketplace upload complete.
+Marketplace import complete.
         <usetemplate
          name="okbutton"
          yestext="Hooray!"/>
@@ -223,14 +223,24 @@ Marketplace upload complete.
 
   <notification
    icon="alertmodal.tga"
-   name="OutboxUploadHadErrors"
+   name="OutboxImportHadErrors"
    type="alertmodal">
-Marketplace upload completed with errors!  Please correct the problems in your outbox and retry.  Thanks.
+Marketplace import completed with errors!  Please correct the problems in your outbox and retry.  Thanks.
         <usetemplate
          name="okbutton"
          yestext="Boo!"/>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="OutboxImportFailed"
+   type="alertmodal">
+Marketplace import failed!  Please try again later.  Thanks.
+        <usetemplate
+         name="okbutton"
+         yestext="Rats!"/>
+  </notification>
+
     
 
     <notification
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index b52784d6bc4..9f3c57fa0f7 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -205,7 +205,7 @@
                          label=""
                          tool_tip="Push to my Marketplace Storefront"
                          is_toggle="false"
-                         name="outbox_sync_btn"
+                         name="outbox_import_btn"
                          follows="top|right"
                          tab_stop="false"
                          halign="center"
@@ -216,7 +216,7 @@
                          enabled="false" />
                      <loading_indicator
                         follows="top|right"
-                        name="outbox_sync_indicator"
+                        name="outbox_import_indicator"
                         top="6"
                         left="-50"
                         height="23"
-- 
GitLab


From b4e106ec35920fdc7aa3c98d7de1778ed309c906 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 5 Dec 2011 17:07:40 -0500
Subject: [PATCH 358/933] SH-2747 FIX

---
 indra/newview/llavatariconctrl.cpp | 3 +++
 1 file changed, 3 insertions(+)
 mode change 100644 => 100755 indra/newview/llavatariconctrl.cpp

diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
old mode 100644
new mode 100755
index 42e7decec18..b539ac38ed8
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -75,6 +75,9 @@ void LLAvatarIconIDCache::load	()
 		LLUUID icon_id;
 		LLDate date;
 
+		if (line.length()<=uuid_len*2)
+			continue; // short line, bail out to prevent substr calls throwing exception.
+
 		std::string avatar_id_str = line.substr(0,uuid_len);
 		std::string icon_id_str = line.substr(uuid_len,uuid_len);
 		
-- 
GitLab


From 3236cbd585860f76a14c4837c70cb5823a4fd7d5 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 5 Dec 2011 14:23:49 -0800
Subject: [PATCH 359/933] Windows build fix

---
 indra/newview/llpanelmarketplaceoutbox.cpp | 89 +++++++++++-----------
 1 file changed, 43 insertions(+), 46 deletions(-)

diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 3c8817c199f..6a2bf58701b 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -303,53 +303,50 @@ void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& conte
 		}
 	}
 	
-	return;
-	
-	
-	
-	const LLSD& errors_list = content["errors"];
-
-	if (errors_list.size() == 0)
-	{
-		LLNotificationsUtil::add("OutboxUploadComplete", LLSD::emptyMap(), LLSD::emptyMap());
-	}
-	else
-	{
-		LLNotificationsUtil::add("OutboxUploadHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
-	}
-
-	llinfos << "Marketplace upload llsd:" << llendl;
-	llinfos << ll_pretty_print_sd(content) << llendl;
-	llinfos << llendl;
 
-	const LLSD& imported_list = content["imported"];
-	LLSD::array_const_iterator it = imported_list.beginArray();
-	for ( ; it != imported_list.endArray(); ++it)
-	{
-		LLUUID imported_folder = (*it).asUUID();
-		llinfos << "Successfully uploaded folder " << imported_folder.asString() << " to marketplace." << llendl;
-	}
-
-	for (it = errors_list.beginArray(); it != errors_list.endArray(); ++it)
-	{
-		const LLSD& item_error_map = (*it);
-
-		LLUUID error_folder = item_error_map["folder_id"].asUUID();
-		const std::string& error_string = item_error_map["identifier"].asString();
-		LLUUID error_item = item_error_map["item_id"].asUUID();
-		const std::string& error_item_name = item_error_map["item_name"].asString();
-		const std::string& error_message = item_error_map["message"].asString();
-
-		llinfos << "Error item " << error_folder.asString() << ", " << error_string << ", "
-				<< error_item.asString() << ", " << error_item_name << ", " << error_message << llendl;
-		
-		LLFolderViewFolder * item_folder = mInventoryPanel->getRootFolder()->getFolderByID(error_folder);
-		LLOutboxFolderViewFolder * outbox_item_folder = dynamic_cast<LLOutboxFolderViewFolder *>(item_folder);
-
-		llassert(outbox_item_folder);
-
-		outbox_item_folder->setErrorString(error_string);
-	}
+	//const LLSD& errors_list = content["errors"];
+
+	//if (errors_list.size() == 0)
+	//{
+	//	LLNotificationsUtil::add("OutboxUploadComplete", LLSD::emptyMap(), LLSD::emptyMap());
+	//}
+	//else
+	//{
+	//	LLNotificationsUtil::add("OutboxUploadHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
+	//}
+
+	//llinfos << "Marketplace upload llsd:" << llendl;
+	//llinfos << ll_pretty_print_sd(content) << llendl;
+	//llinfos << llendl;
+
+	//const LLSD& imported_list = content["imported"];
+	//LLSD::array_const_iterator it = imported_list.beginArray();
+	//for ( ; it != imported_list.endArray(); ++it)
+	//{
+	//	LLUUID imported_folder = (*it).asUUID();
+	//	llinfos << "Successfully uploaded folder " << imported_folder.asString() << " to marketplace." << llendl;
+	//}
+
+	//for (it = errors_list.beginArray(); it != errors_list.endArray(); ++it)
+	//{
+	//	const LLSD& item_error_map = (*it);
+
+	//	LLUUID error_folder = item_error_map["folder_id"].asUUID();
+	//	const std::string& error_string = item_error_map["identifier"].asString();
+	//	LLUUID error_item = item_error_map["item_id"].asUUID();
+	//	const std::string& error_item_name = item_error_map["item_name"].asString();
+	//	const std::string& error_message = item_error_map["message"].asString();
+
+	//	llinfos << "Error item " << error_folder.asString() << ", " << error_string << ", "
+	//			<< error_item.asString() << ", " << error_item_name << ", " << error_message << llendl;
+	//	
+	//	LLFolderViewFolder * item_folder = mInventoryPanel->getRootFolder()->getFolderByID(error_folder);
+	//	LLOutboxFolderViewFolder * outbox_item_folder = dynamic_cast<LLOutboxFolderViewFolder *>(item_folder);
+
+	//	llassert(outbox_item_folder);
+
+	//	outbox_item_folder->setErrorString(error_string);
+	//}
 }
 
 void LLPanelMarketplaceOutbox::updateImportButtonStatus()
-- 
GitLab


From 1e2d424f9e82a1d75a4b78b06910400f55c5169a Mon Sep 17 00:00:00 2001
From: Ansariel <none@none>
Date: Mon, 5 Dec 2011 23:35:29 +0100
Subject: [PATCH 360/933] STORM-1713: Mouse pointer flickers when hovering over
 any active/clickable UI item

---
 doc/contributions.txt                 |  1 +
 indra/llwindow/llwindow.cpp           |  1 +
 indra/llwindow/llwindow.h             |  4 +++-
 indra/llwindow/llwindowheadless.h     |  2 +-
 indra/llwindow/llwindowmacosx.cpp     | 26 ++++++++++++++------------
 indra/llwindow/llwindowmacosx.h       |  2 +-
 indra/llwindow/llwindowmesaheadless.h |  2 +-
 indra/llwindow/llwindowsdl.cpp        | 14 ++++++++------
 indra/llwindow/llwindowsdl.h          |  2 +-
 indra/llwindow/llwindowwin32.cpp      | 14 ++++++++------
 indra/llwindow/llwindowwin32.h        |  2 +-
 11 files changed, 40 insertions(+), 30 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..c460986e298 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -171,6 +171,7 @@ Ansariel Hiller
 	VWR-25480
 	VWR-26150
 	STORM-1685
+	STORM-1713
 Aralara Rajal
 Ardy Lay
 	STORM-859
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index dc3a1099b11..9d0d73b81ea 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -108,6 +108,7 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags)
 	  mSupportedResolutions(NULL),
 	  mNumSupportedResolutions(0),
 	  mCurrentCursor(UI_CURSOR_ARROW),
+	  mNextCursor(UI_CURSOR_ARROW),
 	  mCursorHidden(FALSE),
 	  mBusyCount(0),
 	  mIsMouseClipping(FALSE),
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index e8a86a18807..e5fcd19f2c9 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -91,8 +91,9 @@ class LLWindow
 	virtual S32 getBusyCount() const;
 
 	// Sets cursor, may set to arrow+hourglass
-	virtual void setCursor(ECursorType cursor) = 0;
+	virtual void setCursor(ECursorType cursor) { mNextCursor = cursor; };
 	virtual ECursorType getCursor() const;
+	virtual void updateCursor() = 0;
 
 	virtual void captureMouse() = 0;
 	virtual void releaseMouse() = 0;
@@ -181,6 +182,7 @@ class LLWindow
 	LLWindowResolution* mSupportedResolutions;
 	S32			mNumSupportedResolutions;
 	ECursorType	mCurrentCursor;
+	ECursorType	mNextCursor;
 	BOOL		mCursorHidden;
 	S32			mBusyCount;	// how deep is the "cursor busy" stack?
 	BOOL		mIsMouseClipping;  // Is this window currently clipping the mouse
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index ac53e6a86ee..1e911d75478 100644
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -55,7 +55,7 @@ class LLWindowHeadless : public LLWindow
 	/*virtual*/ void showCursorFromMouseMove() {};
 	/*virtual*/ void hideCursorUntilMouseMove() {};
 	/*virtual*/ BOOL isCursorHidden() {return FALSE;};
-	/*virtual*/ void setCursor(ECursorType cursor) {};
+	/*virtual*/ void updateCursor() {};
 	//virtual ECursorType getCursor() { return mCurrentCursor; };
 	/*virtual*/ void captureMouse() {};
 	/*virtual*/ void releaseMouse() {};
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index d116f0dfff2..d4832602a07 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1164,6 +1164,8 @@ void LLWindowMacOSX::gatherInput()
 
 		}
 	}
+	
+	updateCursor();
 }
 
 BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position)
@@ -2841,7 +2843,7 @@ static void initPixmapCursor(int cursorid, int hotspotX, int hotspotY)
 	gCursors[cursorid] = createImageCursor(fullpath.c_str(), hotspotX, hotspotY);
 }
 
-void LLWindowMacOSX::setCursor(ECursorType cursor)
+void LLWindowMacOSX::updateCursor()
 {
 	OSStatus result = noErr;
 
@@ -2849,30 +2851,30 @@ void LLWindowMacOSX::setCursor(ECursorType cursor)
 	{
 		// A drag is in progress...remember the requested cursor and we'll
 		// restore it when it is done
-		mCurrentCursor = cursor;
+		mCurrentCursor = mNextCursor;
 		return;
 	}
 		
-	if (cursor == UI_CURSOR_ARROW
+	if (mNextCursor == UI_CURSOR_ARROW
 		&& mBusyCount > 0)
 	{
-		cursor = UI_CURSOR_WORKING;
+		mNextCursor = UI_CURSOR_WORKING;
 	}
 	
-	if(mCurrentCursor == cursor)
+	if(mCurrentCursor == mNextCursor)
 		return;
 
 	// RN: replace multi-drag cursors with single versions
-	if (cursor == UI_CURSOR_ARROWDRAGMULTI)
+	if (mNextCursor == UI_CURSOR_ARROWDRAGMULTI)
 	{
-		cursor = UI_CURSOR_ARROWDRAG;
+		mNextCursor = UI_CURSOR_ARROWDRAG;
 	}
-	else if (cursor == UI_CURSOR_ARROWCOPYMULTI)
+	else if (mNextCursor == UI_CURSOR_ARROWCOPYMULTI)
 	{
-		cursor = UI_CURSOR_ARROWCOPY;
+		mNextCursor = UI_CURSOR_ARROWCOPY;
 	}
 
-	switch(cursor)
+	switch(mNextCursor)
 	{
 	default:
 	case UI_CURSOR_ARROW:
@@ -2923,7 +2925,7 @@ void LLWindowMacOSX::setCursor(ECursorType cursor)
 	case UI_CURSOR_TOOLSIT:
 	case UI_CURSOR_TOOLBUY:
 	case UI_CURSOR_TOOLOPEN:
-		result = setImageCursor(gCursors[cursor]);
+		result = setImageCursor(gCursors[mNextCursor]);
 		break;
 
 	}
@@ -2933,7 +2935,7 @@ void LLWindowMacOSX::setCursor(ECursorType cursor)
 		InitCursor();
 	}
 
-	mCurrentCursor = cursor;
+	mCurrentCursor = mNextCursor;
 }
 
 ECursorType LLWindowMacOSX::getCursor() const
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 6c9e075a219..1414a7e2a7d 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -67,7 +67,7 @@ class LLWindowMacOSX : public LLWindow
 	/*virtual*/ void showCursorFromMouseMove();
 	/*virtual*/ void hideCursorUntilMouseMove();
 	/*virtual*/ BOOL isCursorHidden();
-	/*virtual*/ void setCursor(ECursorType cursor);
+	/*virtual*/ void updateCursor();
 	/*virtual*/ ECursorType getCursor() const;
 	/*virtual*/ void captureMouse();
 	/*virtual*/ void releaseMouse();
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index fd4bd635e2e..db7cb43754a 100644
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -59,7 +59,7 @@ class LLWindowMesaHeadless : public LLWindow
 	/*virtual*/ void showCursorFromMouseMove() {};
 	/*virtual*/ void hideCursorUntilMouseMove() {};
 	/*virtual*/ BOOL isCursorHidden() {return FALSE;};
-	/*virtual*/ void setCursor(ECursorType cursor) {};
+	/*virtual*/ void updateCursor() {};
 	//virtual ECursorType getCursor() { return mCurrentCursor; };
 	/*virtual*/ void captureMouse() {};
 	/*virtual*/ void releaseMouse() {};
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 8acb52516a1..f8c66974321 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -1920,6 +1920,8 @@ void LLWindowSDL::gatherInput()
 		break;
         }
     }
+	
+	updateCursor();
 
 #if LL_X11
     // This is a good time to stop flashing the icon if our mFlashTimer has
@@ -2006,7 +2008,7 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
 	return sdlcursor;
 }
 
-void LLWindowSDL::setCursor(ECursorType cursor)
+void LLWindowSDL::updateCursor()
 {
 	if (ATIbug) {
 		// cursor-updating is very flaky when this bug is
@@ -2014,11 +2016,11 @@ void LLWindowSDL::setCursor(ECursorType cursor)
 		return;
 	}
 
-	if (mCurrentCursor != cursor)
+	if (mCurrentCursor != mNextCursor)
 	{
-		if (cursor < UI_CURSOR_COUNT)
+		if (mNextCursor < UI_CURSOR_COUNT)
 		{
-			SDL_Cursor *sdlcursor = mSDLCursors[cursor];
+			SDL_Cursor *sdlcursor = mSDLCursors[mNextCursor];
 			// Try to default to the arrow for any cursors that
 			// did not load correctly.
 			if (!sdlcursor && mSDLCursors[UI_CURSOR_ARROW])
@@ -2026,9 +2028,9 @@ void LLWindowSDL::setCursor(ECursorType cursor)
 			if (sdlcursor)
 				SDL_SetCursor(sdlcursor);
 		} else {
-			llwarns << "Tried to set invalid cursor number " << cursor << llendl;
+			llwarns << "Tried to set invalid cursor number " << mNextCursor << llendl;
 		}
-		mCurrentCursor = cursor;
+		mCurrentCursor = mNextCursor;
 	}
 }
 
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index fa544b16cef..fb3b117693d 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -72,7 +72,7 @@ class LLWindowSDL : public LLWindow
 	/*virtual*/ void showCursorFromMouseMove();
 	/*virtual*/ void hideCursorUntilMouseMove();
 	/*virtual*/ BOOL isCursorHidden();
-	/*virtual*/ void setCursor(ECursorType cursor);
+	/*virtual*/ void updateCursor();
 	/*virtual*/ void captureMouse();
 	/*virtual*/ void releaseMouse();
 	/*virtual*/ void setMouseClipping( BOOL b );
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 799f0a3fab1..03fff3d5266 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1667,18 +1667,18 @@ void LLWindowWin32::initCursors()
 
 
 
-void LLWindowWin32::setCursor(ECursorType cursor)
+void LLWindowWin32::updateCursor()
 {
-	if (cursor == UI_CURSOR_ARROW
+	if (mNextCursor == UI_CURSOR_ARROW
 		&& mBusyCount > 0)
 	{
-		cursor = UI_CURSOR_WORKING;
+		mNextCursor = UI_CURSOR_WORKING;
 	}
 
-	if( mCurrentCursor != cursor )
+	if( mCurrentCursor != mNextCursor )
 	{
-		mCurrentCursor = cursor;
-		SetCursor( mCursor[cursor] );
+		mCurrentCursor = mNextCursor;
+		SetCursor( mCursor[mNextCursor] );
 	}
 }
 
@@ -1760,6 +1760,8 @@ void LLWindowWin32::gatherInput()
 
 	mInputProcessingPaused = FALSE;
 
+	updateCursor();
+
 	// clear this once we've processed all mouse messages that might have occurred after
 	// we slammed the mouse position
 	mMousePositionModified = FALSE;
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 387e4cbdb65..84f731a79fb 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -66,7 +66,7 @@ class LLWindowWin32 : public LLWindow
 	/*virtual*/ void showCursorFromMouseMove();
 	/*virtual*/ void hideCursorUntilMouseMove();
 	/*virtual*/ BOOL isCursorHidden();
-	/*virtual*/ void setCursor(ECursorType cursor);
+	/*virtual*/ void updateCursor();
 	/*virtual*/ ECursorType getCursor() const;
 	/*virtual*/ void captureMouse();
 	/*virtual*/ void releaseMouse();
-- 
GitLab


From 01d68a9f1572fba971ace6944a91a85e7c379d1e Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 5 Dec 2011 16:28:13 -0700
Subject: [PATCH 361/933] call LLViewerTexture::isMemoryForTextureLow() less
 often and only for ATI cards.

---
 indra/newview/llviewertexture.cpp | 33 ++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index f4bbc2b0672..addf1147f20 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -420,8 +420,17 @@ F32 texmem_middle_bound_scale = 0.925f;
 //static 
 bool LLViewerTexture::isMemoryForTextureLow()
 {
-	const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
-	const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB
+	const F32 WAIT_TIME = 1.0f ; //second
+	static LLFrameTimer timer ;
+
+	if(timer.getElapsedTimeF32() < WAIT_TIME) //call this once per second.
+	{
+		return false;
+	}
+	timer.reset() ;
+
+	const S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
+	const S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB	
 
 	bool low_mem = false ;
 	if (gGLManager.mHasATIMemInfo)
@@ -433,6 +442,15 @@ bool LLViewerTexture::isMemoryForTextureLow()
 		{
 			low_mem = true ;
 		}
+
+		if(!low_mem) //check main memory, only works for windows.
+		{
+			LLMemory::updateMemoryInfo() ;
+			if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy)
+			{
+				low_mem = true ;
+			}
+		}
 	}
 #if 0  //ignore nVidia cards
 	else if (gGLManager.mHasNVXMemInfo)
@@ -445,16 +463,7 @@ bool LLViewerTexture::isMemoryForTextureLow()
 			low_mem = true ;
 		}
 	}
-#endif
-
-	if(!low_mem) //check main memory, only works for windows.
-	{
-		LLMemory::updateMemoryInfo() ;
-		if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy)
-		{
-			low_mem = true ;
-		}
-	}
+#endif	
 
 	return low_mem ;
 }
-- 
GitLab


From 78233d1bf9930575ee7250257ac68603f41f568a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 5 Dec 2011 17:55:40 -0600
Subject: [PATCH 362/933] SH-2652 WIP -- Add timers to relevant areas, pause
 render pipeline while occlusion queries from previous frame are still pending
 and perform texture decode work.

---
 indra/llcommon/llqueuedthread.cpp    |  4 ++--
 indra/llcommon/llqueuedthread.h      |  4 ++--
 indra/llcommon/llworkerthread.cpp    |  2 +-
 indra/llcommon/llworkerthread.h      |  2 +-
 indra/llimage/llimageworker.cpp      |  2 +-
 indra/llimage/llimageworker.h        |  2 +-
 indra/llmessage/llcurl.cpp           |  2 +-
 indra/llmessage/llcurl.h             |  2 +-
 indra/newview/llappviewer.cpp        |  8 +++++---
 indra/newview/llspatialpartition.cpp | 26 ++++++++++++++++++++++++++
 indra/newview/llspatialpartition.h   |  2 ++
 indra/newview/lltexturecache.cpp     |  2 +-
 indra/newview/lltexturecache.h       |  2 +-
 indra/newview/lltexturefetch.cpp     |  2 +-
 indra/newview/lltexturefetch.h       |  2 +-
 indra/newview/llviewertexture.cpp    | 14 +++++++++++++-
 16 files changed, 60 insertions(+), 18 deletions(-)

diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index 5dee7a3541e..1738c16dea4 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -109,7 +109,7 @@ void LLQueuedThread::shutdown()
 
 // MAIN THREAD
 // virtual
-S32 LLQueuedThread::update(U32 max_time_ms)
+S32 LLQueuedThread::update(F32 max_time_ms)
 {
 	if (!mStarted)
 	{
@@ -122,7 +122,7 @@ S32 LLQueuedThread::update(U32 max_time_ms)
 	return updateQueue(max_time_ms);
 }
 
-S32 LLQueuedThread::updateQueue(U32 max_time_ms)
+S32 LLQueuedThread::updateQueue(F32 max_time_ms)
 {
 	F64 max_time = (F64)max_time_ms * .001;
 	LLTimer timer;
diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h
index 499d13a7920..d3704b0fe22 100644
--- a/indra/llcommon/llqueuedthread.h
+++ b/indra/llcommon/llqueuedthread.h
@@ -173,8 +173,8 @@ class LL_COMMON_API LLQueuedThread : public LLThread
 public:
 	bool waitForResult(handle_t handle, bool auto_complete = true);
 
-	virtual S32 update(U32 max_time_ms);
-	S32 updateQueue(U32 max_time_ms);
+	virtual S32 update(F32 max_time_ms);
+	S32 updateQueue(F32 max_time_ms);
 	
 	void waitOnPending();
 	void printQueueStats();
diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp
index 4988bdf5700..3d05a30ac22 100644
--- a/indra/llcommon/llworkerthread.cpp
+++ b/indra/llcommon/llworkerthread.cpp
@@ -81,7 +81,7 @@ void LLWorkerThread::clearDeleteList()
 }
 
 // virtual
-S32 LLWorkerThread::update(U32 max_time_ms)
+S32 LLWorkerThread::update(F32 max_time_ms)
 {
 	S32 res = LLQueuedThread::update(max_time_ms);
 	// Delete scheduled workers
diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h
index 78a4781d157..be46394d6ef 100644
--- a/indra/llcommon/llworkerthread.h
+++ b/indra/llcommon/llworkerthread.h
@@ -86,7 +86,7 @@ class LL_COMMON_API LLWorkerThread : public LLQueuedThread
 	LLWorkerThread(const std::string& name, bool threaded = true, bool should_pause = false);
 	~LLWorkerThread();
 
-	/*virtual*/ S32 update(U32 max_time_ms);
+	/*virtual*/ S32 update(F32 max_time_ms);
 	
 	handle_t addWorkRequest(LLWorkerClass* workerclass, S32 param, U32 priority = PRIORITY_NORMAL);
 	
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index 28dc3bd3133..ad2eb0f69c5 100644
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -46,7 +46,7 @@ LLImageDecodeThread::~LLImageDecodeThread()
 
 // MAIN THREAD
 // virtual
-S32 LLImageDecodeThread::update(U32 max_time_ms)
+S32 LLImageDecodeThread::update(F32 max_time_ms)
 {
 	LLMutexLock lock(mCreationMutex);
 	for (creation_list_t::iterator iter = mCreationList.begin();
diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h
index c684222fa5f..1bfb0ddfd3f 100644
--- a/indra/llimage/llimageworker.h
+++ b/indra/llimage/llimageworker.h
@@ -78,7 +78,7 @@ class LLImageDecodeThread : public LLQueuedThread
 	handle_t decodeImage(LLImageFormatted* image,
 						 U32 priority, S32 discard, BOOL needs_aux,
 						 Responder* responder);
-	S32 update(U32 max_time_ms);
+	S32 update(F32 max_time_ms);
 
 	// Used by unit tests to check the consistency of the thread instance
 	S32 tut_size();
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 7ca25d07fce..ce0632668cf 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -841,7 +841,7 @@ LLCurlThread::~LLCurlThread()
 {
 }
 
-S32 LLCurlThread::update(U32 max_time_ms)
+S32 LLCurlThread::update(F32 max_time_ms)
 {	
 	return LLQueuedThread::update(max_time_ms);
 }
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index a275db3e53b..2c952794389 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -344,7 +344,7 @@ class LLCurlThread : public LLQueuedThread
 	LLCurlThread(bool threaded = true) ;
 	virtual ~LLCurlThread() ;
 
-	S32 update(U32 max_time_ms);
+	S32 update(F32 max_time_ms);
 
 	void addMulti(LLCurl::Multi* multi) ;
 	void killMulti(LLCurl::Multi* multi) ;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index e80475f0960..9455bf98756 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1345,17 +1345,19 @@ bool LLAppViewer::mainLoop()
 				{
 					S32 work_pending = 0;
 					S32 io_pending = 0;
+					F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f);
+
 					{
 						LLFastTimer ftm(FTM_TEXTURE_CACHE);
- 						work_pending += LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread
+ 						work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
 					}
 					{
 						LLFastTimer ftm(FTM_DECODE);
-	 					work_pending += LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread
+	 					work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
 					}
 					{
 						LLFastTimer ftm(FTM_DECODE);
-	 					work_pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread
+	 					work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
 					}
 
 					{
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 3e16ccf3dac..fb107a302a6 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -28,6 +28,10 @@
 
 #include "llspatialpartition.h"
 
+#include "llappviewer.h"
+#include "lltexturecache.h"
+#include "lltexturefetch.h"
+#include "llimageworker.h"
 #include "llviewerwindow.h"
 #include "llviewerobjectlist.h"
 #include "llvovolume.h"
@@ -1221,6 +1225,7 @@ LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
 	for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
 	{
 		mOcclusionQuery[i] = 0;
+		mOcclusionIssued[i] = 0;
 		mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0;
 		mVisible[i] = 0;
 	}
@@ -1543,6 +1548,8 @@ BOOL LLSpatialGroup::rebound()
 }
 
 static LLFastTimer::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_WAIT("Wait");
+
 void LLSpatialGroup::checkOcclusion()
 {
 	if (LLPipeline::sUseOcclusion > 1)
@@ -1560,6 +1567,22 @@ void LLSpatialGroup::checkOcclusion()
 			if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
 			{
 				glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+
+				if (mOcclusionIssued[LLViewerCamera::sCurCameraID] < gFrameCount)
+				{ //query was issued last frame, wait until it's available
+					S32 max_loop = 1024;
+					LLFastTimer t(FTM_OCCLUSION_WAIT);
+					while (!available && max_loop-- > 0)
+					{
+						F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f);
+						//do some usefu work while we wait
+						LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
+						LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
+						LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
+						
+						glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+					}
+				}
 			}
 			else
 			{
@@ -1679,6 +1702,9 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 					{
 						LLFastTimer t(FTM_PUSH_OCCLUSION_VERTS);
 						
+						//store which frame this query was issued on
+						mOcclusionIssued[LLViewerCamera::sCurCameraID] = gFrameCount;
+
 						{
 							LLFastTimer t(FTM_OCCLUSION_BEGIN_QUERY);
 							glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);					
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index f0c8a372ee3..899547ae4d2 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -396,6 +396,8 @@ class LLSpatialGroup : public LLOctreeListener<LLDrawable>
 
 	U32 mState;
 	U32 mOcclusionState[LLViewerCamera::NUM_CAMERAS];
+	U32 mOcclusionIssued[LLViewerCamera::NUM_CAMERAS];
+
 	S32 mLODHash;
 	static S32 sLODSeed;
 
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index e7a176f4f9f..8632890bbbd 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -760,7 +760,7 @@ LLTextureCache::~LLTextureCache()
 //////////////////////////////////////////////////////////////////////////////
 
 //virtual
-S32 LLTextureCache::update(U32 max_time_ms)
+S32 LLTextureCache::update(F32 max_time_ms)
 {
 	static LLFrameTimer timer ;
 	static const F32 MAX_TIME_INTERVAL = 300.f ; //seconds.
diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h
index 64e3a2658c3..dd0cc9b4bd6 100644
--- a/indra/newview/lltexturecache.h
+++ b/indra/newview/lltexturecache.h
@@ -101,7 +101,7 @@ class LLTextureCache : public LLWorkerThread
 	LLTextureCache(bool threaded);
 	~LLTextureCache();
 
-	/*virtual*/ S32 update(U32 max_time_ms);	
+	/*virtual*/ S32 update(F32 max_time_ms);	
 	
 	void purgeCache(ELLPath location);
 	void setReadOnly(BOOL read_only) ;
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 56dfb61c4f8..f18aa8b4e61 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -2204,7 +2204,7 @@ void LLTextureFetch::commonUpdate()
 
 // MAIN THREAD
 //virtual
-S32 LLTextureFetch::update(U32 max_time_ms)
+S32 LLTextureFetch::update(F32 max_time_ms)
 {
 	static LLCachedControl<F32> band_width(gSavedSettings,"ThrottleBandwidthKBPS");
 
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index d101da1f4be..35df7d816f2 100644
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -55,7 +55,7 @@ class LLTextureFetch : public LLWorkerThread
 
 	class TFRequest;
 	
-	/*virtual*/ S32 update(U32 max_time_ms);	
+	/*virtual*/ S32 update(F32 max_time_ms);	
 	void shutDownTextureCacheThread() ; //called in the main thread after the TextureCacheThread shuts down.
 	void shutDownImageDecodeThread() ;  //called in the main thread after the ImageDecodeThread shuts down.
 
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index b0f5361a798..1863992a221 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -417,9 +417,13 @@ const S32 min_non_tex_system_mem = (128<<20); // 128 MB
 F32 texmem_lower_bound_scale = 0.85f;
 F32 texmem_middle_bound_scale = 0.925f;
 
+static LLFastTimer::DeclareTimer FTM_TEXTURE_MEMORY_CHECK("Memory Check");
+
 //static 
 bool LLViewerTexture::isMemoryForTextureLow()
 {
+	LLFastTimer t(FTM_TEXTURE_MEMORY_CHECK);
+
 	const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
 	const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB
 
@@ -459,6 +463,9 @@ bool LLViewerTexture::isMemoryForTextureLow()
 	return low_mem ;
 }
 
+static LLFastTimer::DeclareTimer FTM_TEXTURE_UPDATE_MEDIA("Media");
+static LLFastTimer::DeclareTimer FTM_TEXTURE_UPDATE_TEST("Test");
+
 //static
 void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity)
 {
@@ -467,9 +474,14 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
 	LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
 	if (tester)
 	{
+		LLFastTimer t(FTM_TEXTURE_UPDATE_TEST);
 		tester->update() ;
 	}
-	LLViewerMediaTexture::updateClass() ;
+
+	{
+		LLFastTimer t(FTM_TEXTURE_UPDATE_MEDIA);
+		LLViewerMediaTexture::updateClass() ;
+	}
 
 	sBoundTextureMemoryInBytes = LLImageGL::sBoundTextureMemoryInBytes;//in bytes
 	sTotalTextureMemoryInBytes = LLImageGL::sGlobalTextureMemoryInBytes;//in bytes
-- 
GitLab


From 1a93abb9013d6960f1ff9eb491480f547c780ff0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 5 Dec 2011 18:55:01 -0600
Subject: [PATCH 363/933] SH-2652 Bump fast timer location.

---
 indra/newview/llviewertexture.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 2e1dc95483b..126d0f75e86 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -423,7 +423,6 @@ static LLFastTimer::DeclareTimer FTM_TEXTURE_MEMORY_CHECK("Memory Check");
 bool LLViewerTexture::isMemoryForTextureLow()
 {
 	const F32 WAIT_TIME = 1.0f ; //second
-	LLFastTimer t(FTM_TEXTURE_MEMORY_CHECK);
 	static LLFrameTimer timer ;
 
 	if(timer.getElapsedTimeF32() < WAIT_TIME) //call this once per second.
@@ -432,6 +431,8 @@ bool LLViewerTexture::isMemoryForTextureLow()
 	}
 	timer.reset() ;
 
+	LLFastTimer t(FTM_TEXTURE_MEMORY_CHECK);
+
 	const S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
 	const S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB	
 
-- 
GitLab


From b89c1ac482eeef7a4ab050186a6c425a5167c504 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 6 Dec 2011 09:53:09 -0500
Subject: [PATCH 364/933] STORM-1727 Dates displayed incorrectly in group
 profile. year "2035"

---
 doc/contributions.txt                   | 1 +
 indra/newview/llpanelgrouplandmoney.cpp | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..aa8f0060445 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1727
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index e66dd5690c2..363443646d5 100644
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -1062,7 +1062,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
 
 	// We don't do time zone corrections of the calculated number of seconds
 	// because we don't have a full time stamp, only a date.
-	substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%A %b %d, %Y", start_date);
+	substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%Y-%m-%d", start_date);
 	LLStringUtil::format (time_str, substitution);
 
 	if ( interval_days != mImplementationp->mIntervalLength || 
@@ -1217,7 +1217,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
 
 		// We don't do time zone corrections of the calculated number of seconds
 		// because we don't have a full time stamp, only a date.
-		substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%A %b %d, %Y", start_date);
+		substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%Y-%m-%d", start_date);
 		LLStringUtil::format (time_str, substitution);
 
 		text = time_str + "\n\n";
-- 
GitLab


From 3e6c522084385e5c40796849b9cefa69e95c981f Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 6 Dec 2011 09:54:59 -0500
Subject: [PATCH 365/933] LLSD-14: Extract remaining conditional LLSD mbrs to
 namespace llsd. Per Monty's code review, it's dubious practice to have a
 class in which certain members are sometimes visible, other times not. If
 these were virtual methods, or non-static data members, the error would be
 obvious -- but even with static data members and non-virtual methods, it
 looks like an ODR violation. Extract conditional methods as free functions,
 as in changeset 07cd70e75473.

---
 indra/llcommon/llsd.cpp | 38 +++++++++++++++-----------------------
 indra/llcommon/llsd.h   | 22 ++++++++--------------
 2 files changed, 23 insertions(+), 37 deletions(-)

diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index 151eb4084a8..e295e3c621d 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -54,23 +54,17 @@ namespace
 using namespace LLSDUnnamedNamespace;
 #endif
 
-
-// Normally undefined
-#ifdef LLSD_DEBUG_INFO
+namespace llsd
+{
 
 // statics
-S32	LLSD::sLLSDAllocationCount = 0;
-S32 LLSD::sLLSDNetObjects = 0;
-
-#define	ALLOC_LLSD_OBJECT			{ sLLSDNetObjects++;	sLLSDAllocationCount++;		}
-#define	FREE_LLSD_OBJECT			{ sLLSDNetObjects--;								}
+S32	sLLSDAllocationCount = 0;
+S32 sLLSDNetObjects = 0;
 
-#else
+} // namespace llsd
 
-#define	ALLOC_LLSD_OBJECT
-#define	FREE_LLSD_OBJECT
-
-#endif
+#define	ALLOC_LLSD_OBJECT			{ llsd::sLLSDNetObjects++;	llsd::sLLSDAllocationCount++;	}
+#define	FREE_LLSD_OBJECT			{ llsd::sLLSDNetObjects--;									}
 
 class LLSD::Impl
 	/**< This class is the abstract base class of the implementation of LLSD
@@ -158,6 +152,8 @@ class LLSD::Impl
 		safe(llsd.impl).calcStats(type_counts, share_counts);
 	}
 
+	static const Impl& getImpl(const LLSD& llsd)	{ return safe(llsd.impl); }
+	static Impl& getImpl(LLSD& llsd)				{ return safe(llsd.impl); }
 
 	static const LLSD& undef();
 	
@@ -452,10 +448,8 @@ namespace
 	{
 		std::cout << "Map size: " << mData.size() << std::endl;
 
-		#ifdef LLSD_DEBUG_INFO
-		std::cout << "LLSD Net Objects: " << LLSD::sLLSDNetObjects << std::endl;
-		std::cout << "LLSD allocations: " << LLSD::sLLSDAllocationCount << std::endl;
-		#endif
+		std::cout << "LLSD Net Objects: " << llsd::sLLSDNetObjects << std::endl;
+		std::cout << "LLSD allocations: " << llsd::sLLSDAllocationCount << std::endl;
 
 		std::cout << "LLSD::Impl Net Objects: " << sOutstandingCount << std::endl;
 		std::cout << "LLSD::Impl allocations: " << sAllocationCount << std::endl;
@@ -958,12 +952,10 @@ namespace llsd
 U32 allocationCount()								{ return LLSD::Impl::sAllocationCount; }
 U32 outstandingCount()								{ return LLSD::Impl::sOutstandingCount; }
 
-} // namespace llsd
-
 // Diagnostic dump of contents in an LLSD object
-#ifdef LLSD_DEBUG_INFO
-void LLSD::dumpStats()	const						{ safe(impl).dumpStats();	}
-#endif
+void dumpStats(const LLSD& llsd)					{ LLSD::Impl::getImpl(llsd).dumpStats(); }
+
+} // namespace llsd
 
 // static
 std::string		LLSD::typeString(Type type)
@@ -982,7 +974,7 @@ std::string		LLSD::typeString(Type type)
 		"Array"
 	};
 
-	if (0 <= type && type < (sizeof(sTypeNameArray)/sizeof(sTypeNameArray[0])))
+	if (0 <= type && type < LL_ARRAY_SIZE(sTypeNameArray))
 	{
 		return sTypeNameArray[type];
 	}
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index ae083dd6296..5eb69059ac6 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -401,20 +401,8 @@ class LL_COMMON_API LLSD
 	//@}
 
 public:
-#ifdef LLSD_DEBUG_INFO
-	void			dumpStats() const;					// Output information on object and usage
-#endif
 
 	static std::string		typeString(Type type);		// Return human-readable type as a string
-
-#ifdef LLSD_DEBUG_INFO
-	/// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
-	/// ENVIRONMENT.
-	///
-	/// These counts track LLSD (public) objects.
-	static S32		sLLSDAllocationCount;		// Number of LLSD objects ever created
-	static S32		sLLSDNetObjects;			// Number of LLSD objects that exist
-#endif
 };
 
 struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
@@ -465,15 +453,21 @@ LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
 namespace llsd
 {
 
+#ifdef LLSD_DEBUG_INFO
 /** @name Unit Testing Interface */
 //@{
-#ifdef LLSD_DEBUG_INFO
-	/// @warn THESE COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
+	LL_COMMON_API void dumpStats(const LLSD&);	///< Output information on object and usage
+
+	/// @warn THE FOLLOWING COUNTS WILL NOT BE ACCURATE IN A MULTI-THREADED
 	/// ENVIRONMENT.
 	///
 	/// These counts track LLSD::Impl (hidden) objects.
 	LL_COMMON_API U32 allocationCount();	///< how many Impls have been made
 	LL_COMMON_API U32 outstandingCount();	///< how many Impls are still alive
+
+	/// These counts track LLSD (public) objects.
+	LL_COMMON_API extern S32 sLLSDAllocationCount;	///< Number of LLSD objects ever created
+	LL_COMMON_API extern S32 sLLSDNetObjects;		///< Number of LLSD objects that exist
 #endif
 //@}
 
-- 
GitLab


From a78894285aebe73025445078ebeba45f262e16e4 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 6 Dec 2011 10:03:26 -0500
Subject: [PATCH 366/933] STORM-1725 Truncation of UI element
 Preferences->General->Busy mode response

---
 doc/contributions.txt                                           | 1 +
 .../newview/skins/default/xui/en/panel_preferences_general.xml  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..4ca2f5aab3c 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1725
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
index 4079a809249..9827180aa72 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
@@ -420,7 +420,7 @@
      follows="left|top"
      height="29"
      layout="topleft"
-     left="50"
+     left="30"
      name="busy_response"
      width="470"
      word_wrap="true">
-- 
GitLab


From fc671fa2b38700b13eb3fdee6d2831404569c1b0 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 6 Dec 2011 10:41:22 -0500
Subject: [PATCH 367/933] STORM-1728 Name truncation in the Region/Estate
 floater -> Covenant tab

---
 doc/contributions.txt                                        | 1 +
 indra/newview/skins/default/xui/en/panel_region_covenant.xml | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..6b2af08fb11 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1728
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/panel_region_covenant.xml b/indra/newview/skins/default/xui/en/panel_region_covenant.xml
index df16f6fd373..112f12500df 100644
--- a/indra/newview/skins/default/xui/en/panel_region_covenant.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_covenant.xml
@@ -57,7 +57,7 @@
      mouse_opaque="false"
      name="estate_name_text"
      top_delta="0"
-     width="150">
+     width="350">
         mainland
     </text>
     <text
@@ -79,7 +79,7 @@
      mouse_opaque="false"
      name="estate_owner_text"
      top_delta="0"
-     width="150">
+     width="350">
         (none)
     </text>
     <text
-- 
GitLab


From 28f86906a6c0675c6335ca7f408c4e0561dafd89 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 6 Dec 2011 11:45:07 -0500
Subject: [PATCH 368/933] STORM-1653 Added affected name to warning message

---
 indra/newview/llviewermessage.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index c92fc5c853a..39c863318bc 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2464,7 +2464,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 
 			if (agent_id.isNull())
 			{
-				LL_WARNS("Messaging") << "buildLegacyName returned null" << LL_ENDL;			
+				LL_WARNS("Messaging") << "buildLegacyName returned null while processing " << original_name << LL_ENDL;
 			}
 			else if (LLMuteList::getInstance()->isMuted(agent_id))
 			{
-- 
GitLab


From c14105e0174c96835cd3bbb81a6451e1f5d7f2db Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Tue, 6 Dec 2011 12:03:48 -0500
Subject: [PATCH 369/933] Added tag DRTVWR-104_3.2.4-beta1, 3.2.4-beta1 for
 changeset 3fe994349fae

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index b863bbe37be..bf9a40bb44d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -228,3 +228,5 @@ c4911ec8cd81e676dfd2af438b3e065407a94a7a 3.2.1-start
 80f3e30d8aa4d8f674a48bd742aaa6d8e9eae0b5 3.2.3-start
 a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
 a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
+3fe994349fae64fc40874bb59db387131eb35a41 DRTVWR-104_3.2.4-beta1
+3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
-- 
GitLab


From 2be10e866056d19f01568fe6f569af7ab9ad7686 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 6 Dec 2011 20:06:44 +0200
Subject: [PATCH 370/933] EXP-1577 FOLLOWUP Implemented new requirements on
 size of profile floaters.

Implemented new requirements from XD: "Profile window should keep last size,
regardless of whether it was own profile or another users'.
If multiple windows open, last one touched is the size we store."
---
 indra/newview/CMakeLists.txt            |  2 +
 indra/newview/app_settings/settings.xml |  8 +--
 indra/newview/llavataractions.cpp       | 20 +------
 indra/newview/llfloaterwebcontent.cpp   | 71 +++++++++++-----------
 indra/newview/llfloaterwebcontent.h     |  1 +
 indra/newview/llfloaterwebprofile.cpp   | 79 +++++++++++++++++++++++++
 indra/newview/llfloaterwebprofile.h     | 59 ++++++++++++++++++
 indra/newview/llviewerfloaterreg.cpp    |  5 +-
 8 files changed, 187 insertions(+), 58 deletions(-)
 create mode 100644 indra/newview/llfloaterwebprofile.cpp
 create mode 100644 indra/newview/llfloaterwebprofile.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 9368433a9ff..6b2fe1e45ae 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -244,6 +244,7 @@ set(viewer_SOURCE_FILES
     llfloaterurlentry.cpp
     llfloatervoiceeffect.cpp
     llfloaterwebcontent.cpp
+    llfloaterwebprofile.cpp
     llfloaterwhitelistentry.cpp
     llfloaterwindowsize.cpp
     llfloaterworldmap.cpp
@@ -797,6 +798,7 @@ set(viewer_HEADER_FILES
     llfloaterurlentry.h
     llfloatervoiceeffect.h
     llfloaterwebcontent.h
+    llfloaterwebprofile.h
     llfloaterwhitelistentry.h
     llfloaterwindowsize.h
     llfloaterworldmap.h
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1e07ed8a27c..8a0ed47bc3a 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13424,10 +13424,10 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-     <key>WebProfileRect</key>
+     <key>WebProfileFloaterRect</key>
     <map>
       <key>Comment</key>
-      <string>Web profile dimensions</string>
+      <string>Web profile floater dimensions</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
@@ -13435,8 +13435,8 @@
       <key>Value</key>
       <array>
         <integer>0</integer>
-        <integer>650</integer>
-        <integer>490</integer>
+        <integer>730</integer>
+        <integer>485</integer>
         <integer>0</integer>
         </array>
         </map>
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 2f331bdab12..8ca621538fa 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -308,20 +308,6 @@ static const char* get_profile_floater_name(const LLUUID& avatar_id)
 	return avatar_id == gAgentID ? "my_profile" : "profile";
 }
 
-static const LLRect& get_preferred_profile_rect(const LLUUID& avatar_id)
-{
-	if (avatar_id == gAgentID &&
-		LLFloaterReg::getInstance(get_profile_floater_name(avatar_id))->hasSavedRect())
-	{
-		return LLRect::null; // no preference, use saved rect
-	}
-
-	// Preferred size for all residents' profiles
-	// and default size for our own profile.
-	static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect");
-	return profile_rect;
-}
-
 static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
 {
 	std::string username = av_name.mUsername;
@@ -334,13 +320,9 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa
 	std::string url = getProfileURL(username);
 
 	// PROFILES: open in webkit window
-	const bool show_chrome = false;
 	LLFloaterWebContent::Params p;
 	p.url(url).
-		id(agent_id.asString()).
-		show_chrome(show_chrome).
-		window_class("profile").
-		preferred_media_size(get_preferred_profile_rect(agent_id));
+		id(agent_id.asString());
 	LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p);
 }
 
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index d6db7aa6ad4..f3beacea4f7 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -128,39 +128,7 @@ bool LLFloaterWebContent::matchesKey(const LLSD& key)
 //static
 LLFloater* LLFloaterWebContent::create( Params p)
 {
-	lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl;
-
-	if (!p.id.isProvided())
-	{
-		p.id = LLUUID::generateNewID().asString();
-	}
-
-	if(p.target().empty() || p.target() == "_blank")
-	{
-		p.target = p.id();
-	}
-
-	S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit");
-	if(browser_window_limit != 0)
-	{
-		// showInstance will open a new window.  Figure out how many web browsers are already open,
-		// and close the least recently opened one if this will put us over the limit.
-
-		LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class);
-		lldebugs << "total instance count is " << instances.size() << llendl;
-
-		for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
-		{
-			lldebugs << "    " << (*iter)->getKey()["target"] << llendl;
-		}
-
-		if(instances.size() >= (size_t)browser_window_limit)
-		{
-			// Destroy the least recently opened instance
-			(*instances.begin())->closeFloater();
-		}
-	}
-
+	preCreate(p);
 	return new LLFloaterWebContent(p);
 }
 
@@ -211,6 +179,43 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
 	setShape(new_rect);	
 }
 
+// static
+void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
+{
+	lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl;
+
+	if (!p.id.isProvided())
+	{
+		p.id = LLUUID::generateNewID().asString();
+	}
+
+	if(p.target().empty() || p.target() == "_blank")
+	{
+		p.target = p.id();
+	}
+
+	S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit");
+	if(browser_window_limit != 0)
+	{
+		// showInstance will open a new window.  Figure out how many web browsers are already open,
+		// and close the least recently opened one if this will put us over the limit.
+
+		LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class);
+		lldebugs << "total instance count is " << instances.size() << llendl;
+
+		for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
+		{
+			lldebugs << "    " << (*iter)->getKey()["target"] << llendl;
+		}
+
+		if(instances.size() >= (size_t)browser_window_limit)
+		{
+			// Destroy the least recently opened instance
+			(*instances.begin())->closeFloater();
+		}
+	}
+}
+
 void LLFloaterWebContent::open_media(const Params& p)
 {
 	// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index 9d90306a9c8..2a2a9e110b0 100644
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -90,6 +90,7 @@ class LLFloaterWebContent :
 	void onEnterAddress();
 	void onPopExternal();
 
+	static void preCreate(Params& p);
 	void open_media(const Params& );
 	void set_current_url(const std::string& url);
 
diff --git a/indra/newview/llfloaterwebprofile.cpp b/indra/newview/llfloaterwebprofile.cpp
new file mode 100644
index 00000000000..7ee7b5172c3
--- /dev/null
+++ b/indra/newview/llfloaterwebprofile.cpp
@@ -0,0 +1,79 @@
+/** 
+ * @file llfloaterwebprofile.cpp
+ * @brief Avatar profile floater.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterwebprofile.h"
+
+#include "llviewercontrol.h"
+
+LLFloaterWebProfile::LLFloaterWebProfile(const Params& key) :
+	LLFloaterWebContent(key)
+{
+}
+
+void LLFloaterWebProfile::onOpen(const LLSD& key)
+{
+	Params p(key);
+	LLFloaterWebContent::onOpen(p);
+	applyPreferredRect();
+}
+
+// virtual
+void LLFloaterWebProfile::handleReshape(const LLRect& new_rect, bool by_user)
+{
+	lldebugs << "handleReshape: " << new_rect << llendl;
+
+	if (by_user && !isMinimized())
+	{
+		lldebugs << "Storing new rect" << llendl;
+		gSavedSettings.setRect("WebProfileFloaterRect", new_rect);
+	}
+
+	LLFloaterWebContent::handleReshape(new_rect, by_user);
+}
+
+LLFloater* LLFloaterWebProfile::create(const LLSD& key)
+{
+	LLFloaterWebContent::Params p(key);
+	preCreate(p);
+	p.show_chrome(false).
+		window_class("profile");
+	return new LLFloaterWebProfile(p);
+}
+
+void LLFloaterWebProfile::applyPreferredRect()
+{
+	const LLRect preferred_rect = gSavedSettings.getRect("WebProfileFloaterRect");
+	lldebugs << "Applying preferred rect: " << preferred_rect << llendl;
+
+	// Don't override position that may have been set by floater stacking code.
+	LLRect new_rect = getRect();
+	new_rect.setLeftTopAndSize(
+		new_rect.mLeft, new_rect.mTop,
+		preferred_rect.getWidth(), preferred_rect.getHeight());
+	setShape(new_rect);
+}
diff --git a/indra/newview/llfloaterwebprofile.h b/indra/newview/llfloaterwebprofile.h
new file mode 100644
index 00000000000..4c355e401b6
--- /dev/null
+++ b/indra/newview/llfloaterwebprofile.h
@@ -0,0 +1,59 @@
+/** 
+ * @file llfloaterwebprofile.h
+ * @brief Avatar profile floater.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERWEBPROFILE_H
+#define LL_LLFLOATERWEBPROFILE_H
+
+#include "llfloaterwebcontent.h"
+#include "llviewermediaobserver.h"
+
+#include <string>
+
+class LLMediaCtrl;
+
+/**
+ * Displays avatar profile web page.
+ */
+class LLFloaterWebProfile
+:	public LLFloaterWebContent
+{
+	LOG_CLASS(LLFloaterWebProfile);
+public:
+	typedef LLFloaterWebContent::Params Params;
+
+	LLFloaterWebProfile(const Params& key);
+
+	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false);
+
+	static LLFloater* create(const LLSD& key);
+
+private:
+	void applyPreferredRect();
+};
+
+#endif  // LL_LLFLOATERWEBPROFILE_H
+
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index acbc5f8fb6f..8406f639df3 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -65,6 +65,7 @@
 #include "llfloaterhardwaresettings.h"
 #include "llfloaterhelpbrowser.h"
 #include "llfloaterwebcontent.h"
+#include "llfloaterwebprofile.h"
 #include "llfloatermediasettings.h"
 #include "llfloaterhud.h"
 #include "llfloaterimagepreview.h"
@@ -285,8 +286,8 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>);
 	LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>);
 	LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>);
-	LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
-	LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);	
+	LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
+	LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
 	LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);	
 
 	
-- 
GitLab


From 22e46e4be76a448a27c59fedfeb84081d6624df8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 6 Dec 2011 12:57:57 -0600
Subject: [PATCH 371/933] Fix for RenderResolutionDivisor no longer working
 correctly.

---
 indra/newview/pipeline.cpp | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 657cdc0e07b..00acc3e5119 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6333,17 +6333,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 	}
 
-	U32 res_mod = RenderResolutionDivisor;
-
 	LLVector2 tc1(0,0);
 	LLVector2 tc2((F32) mScreen.getWidth()*2,
 				  (F32) mScreen.getHeight()*2);
 
-	if (res_mod > 1)
-	{
-		tc2 /= (F32) res_mod;
-	}
-
 	LLFastTimer ftm(FTM_RENDER_BLOOM);
 	gGL.color4f(1,1,1,1);
 	LLGLDepthTest depth(GL_FALSE);
@@ -6807,7 +6800,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				mFXAABuffer.bindTexture(0, channel);
 				gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
 			}
-						
+			
+			gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft;
+			gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom;
+			gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth();
+			gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight();
+			glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]);
+
 			F32 scale_x = (F32) width/mFXAABuffer.getWidth();
 			F32 scale_y = (F32) height/mFXAABuffer.getHeight();
 			shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y);
@@ -6827,11 +6826,6 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 	}
 	else
 	{
-		if (res_mod > 1)
-		{
-			tc2 /= (F32) res_mod;
-		}
-
 		U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1;
 		LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(mask, 0);
 		buff->allocateBuffer(3,0,TRUE);
-- 
GitLab


From a255fadfab359931d591c6a874abbea5fcf13526 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 6 Dec 2011 11:19:58 -0800
Subject: [PATCH 372/933] Updated to trigger a 'get' to establish marketplace
 session cookie when outbox panel created.

---
 indra/newview/llmarketplacefunctions.cpp      |   4 +-
 indra/newview/llpanelmarketplaceoutbox.cpp    | 194 +++++++++++-------
 indra/newview/llpanelmarketplaceoutbox.h      |   6 +-
 indra/newview/llviewermedia.cpp               |   1 +
 .../skins/default/xui/en/notifications.xml    |   2 +-
 5 files changed, 129 insertions(+), 78 deletions(-)

diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 1c189f6ee24..2f8c5bc9ee5 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -52,7 +52,7 @@ std::string getMarketplaceBaseURL()
 
 	url += "api/1/";
 	url += gAgent.getID().getString();
-	url += "/inventory";
+	url += "/inventory/";
 
 	return url;
 }
@@ -61,7 +61,7 @@ std::string getMarketplaceURL_InventoryImport()
 {
 	std::string url = getMarketplaceBaseURL();
 
-	url += "/import";
+	url += "import/";
 
 	return url;
 }
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 6a2bf58701b..99d744891a5 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -140,6 +140,11 @@ LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
 	// Hide the placeholder text
 	outbox_inventory_placeholder->setVisible(FALSE);
 	
+	// Establish marketplace cookies for http client
+	establishMarketplaceSessionCookie();
+	
+	updateImportButtonStatus();
+	
 	return mInventoryPanel;
 }
 
@@ -195,6 +200,28 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
 	gTimeDelayDebugFunc = "";
 }
 
+std::string gImportPollingFunc = "";
+
+void importPoll(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
+{
+	waitForEventOn(self, "mainloop");
+	
+	while (outboxPanel->isImportInProgress())
+	{
+		LLTimer delayTimer;
+		delayTimer.reset();
+		delayTimer.setTimerExpirySec(5.0f);
+		
+		while (!delayTimer.hasExpired())
+		{
+			waitForEventOn(self, "mainloop");
+		}
+		
+		//outboxPanel->
+	}
+	
+	gImportPollingFunc = "";
+}
 
 class LLInventoryImportPostResponder : public LLHTTPClient::Responder
 {
@@ -207,16 +234,16 @@ class LLInventoryImportPostResponder : public LLHTTPClient::Responder
 	
 	void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
-		llinfos << "inventory/import post status: " << status << ", reason: " << reason << llendl;
+		llinfos << "*** Marketplace *** " << "inventory/import post status: " << status << ", reason: " << reason << llendl;
 		
 		if (isGoodStatus(status))
 		{
 			// Complete success
-			llinfos << "success" << llendl;
+			llinfos << "*** Marketplace *** " << "success" << llendl;
 		}	
 		else
 		{
-			llwarns << "failed" << llendl;
+			llwarns << "*** Marketplace *** " << "failed" << llendl;
 		}
 		
 		mOutboxPanel->onImportPostComplete(status, content);
@@ -229,64 +256,119 @@ class LLInventoryImportPostResponder : public LLHTTPClient::Responder
 class LLInventoryImportGetResponder : public LLHTTPClient::Responder
 {
 public:
-	LLInventoryImportGetResponder(LLPanelMarketplaceOutbox * outboxPanel)
+	LLInventoryImportGetResponder(LLPanelMarketplaceOutbox * outboxPanel, bool ignoreResults)
 		: LLCurl::Responder()
+		, mIgnoreResults(ignoreResults)
 		, mOutboxPanel(outboxPanel)
 	{
 	}
 
 	void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
-		llinfos << "inventory/import get status: " << status << ", reason: " << reason << llendl;
+		llinfos << "*** Marketplace *** " << "inventory/import get status: " << status << ", reason: " << reason << llendl;
 		
 		if (isGoodStatus(status))
 		{
 			// Complete success
-			llinfos << "success" << llendl;
+			llinfos << "*** Marketplace *** " << "success" << llendl;
 		}	
 		else
 		{
-			llwarns << "failed" << llendl;
+			llwarns << "*** Marketplace *** " << "failed" << llendl;
 		}
 
-		mOutboxPanel->onImportGetComplete(status, content);
+		mOutboxPanel->onImportGetComplete(status, content, mIgnoreResults);
 	}
 
 private:
+	bool						mIgnoreResults;
 	LLPanelMarketplaceOutbox *	mOutboxPanel;
 };
 
-void LLPanelMarketplaceOutbox::onImportButtonClicked()
+void LLPanelMarketplaceOutbox::importPostTrigger()
 {
-	// Get the import animation going
 	mImportInProgress = true;
 	mImportFrameTimer = 0;
-
-	updateImportButtonStatus();
-
+	
 	// Make the url for the inventory import request
 	std::string url = getMarketplaceURL_InventoryImport();
-
-	llinfos << "http post:  " << url << llendl;
-	LLHTTPClient::post(url, LLSD(), new LLInventoryImportPostResponder(this), LLViewerMedia::getHeaders());
-
+	
+	LLSD headers = LLViewerMedia::getHeaders();
+	headers["Connection"] = "Keep-Alive";
+	
+	llinfos << "*** Marketplace *** " << "http post:  " << url << llendl;
+	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
+	
+	LLHTTPClient::post(url, LLSD(), new LLInventoryImportPostResponder(this), headers);
+	
 	// Set a timer (for testing only)
     //gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
 }
 
+void LLPanelMarketplaceOutbox::importGetTrigger()
+{
+	mImportGetPending = true;
+	
+	std::string url = getMarketplaceURL_InventoryImport();
+	LLSD headers = LLViewerMedia::getHeaders();
+	
+	llinfos << "*** Marketplace *** " << "http get:  " << url << llendl;
+	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
+	
+	const bool do_not_ignore_results = false;
+	
+	LLHTTPClient::get(url, new LLInventoryImportGetResponder(this, do_not_ignore_results), headers);
+}
+
+void LLPanelMarketplaceOutbox::establishMarketplaceSessionCookie()
+{
+	mImportInProgress = true;
+	mImportGetPending = true;
+	
+	std::string url = getMarketplaceURL_InventoryImport();
+	LLSD headers = LLViewerMedia::getHeaders();
+	
+	const bool ignore_results = true;
+	
+	LLHTTPClient::get(url, new LLInventoryImportGetResponder(this, ignore_results), headers);
+}
+
 void LLPanelMarketplaceOutbox::onImportPostComplete(U32 status, const LLSD& content)
 {
-	llinfos << "onImportPostComplete status = " << status << llendl;
-	llinfos << "onImportPostComplete content = " << content.asString() << llendl;
+	llinfos << "*** Marketplace *** " << "status = " << status << llendl;
+	llinfos << "*** Marketplace *** " << "content = " << ll_pretty_print_sd(content) << llendl;
+
+	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
+	updateImportButtonStatus();
+	
+	if (!mImportInProgress)
+	{
+		char status_string[16];
+		sprintf(status_string, "%d", status);
+
+		LLSD subs;
+		subs["ERROR_CODE"] = status_string;
+
+		LLNotificationsUtil::add("OutboxImportFailed", subs, LLSD::emptyMap());
+	}
+
+	// The POST request returns the IMPORT_DONE code on success
+	//if (status == MarketplaceErrorCodes::IMPORT_DONE)
+	//{
+	//	gImportPollingFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox importPoll", boost::bind(&importPoll, _1, this));
+	//}
 }
 
-void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& content)
+void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& content, bool ignoreResults)
 {
+	llinfos << "*** Marketplace *** " << "status = " << status << llendl;
+	llinfos << "*** Marketplace *** " << "content = " << ll_pretty_print_sd(content) << llendl;
+
 	mImportGetPending = false;	
 	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
 	updateImportButtonStatus();
 	
-	if (!mImportInProgress)
+	if (!mImportInProgress && !ignoreResults)
 	{
 		if (status == MarketplaceErrorCodes::IMPORT_DONE)
 		{
@@ -298,55 +380,16 @@ void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& conte
 		}
 		else
 		{
-			llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
+			char status_string[16];
+			sprintf(status_string, "%d", status);
+			
+			LLSD subs;
+			subs["ERROR_CODE"] = status_string;
+			
+			//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
 			LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
 		}
 	}
-	
-
-	//const LLSD& errors_list = content["errors"];
-
-	//if (errors_list.size() == 0)
-	//{
-	//	LLNotificationsUtil::add("OutboxUploadComplete", LLSD::emptyMap(), LLSD::emptyMap());
-	//}
-	//else
-	//{
-	//	LLNotificationsUtil::add("OutboxUploadHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
-	//}
-
-	//llinfos << "Marketplace upload llsd:" << llendl;
-	//llinfos << ll_pretty_print_sd(content) << llendl;
-	//llinfos << llendl;
-
-	//const LLSD& imported_list = content["imported"];
-	//LLSD::array_const_iterator it = imported_list.beginArray();
-	//for ( ; it != imported_list.endArray(); ++it)
-	//{
-	//	LLUUID imported_folder = (*it).asUUID();
-	//	llinfos << "Successfully uploaded folder " << imported_folder.asString() << " to marketplace." << llendl;
-	//}
-
-	//for (it = errors_list.beginArray(); it != errors_list.endArray(); ++it)
-	//{
-	//	const LLSD& item_error_map = (*it);
-
-	//	LLUUID error_folder = item_error_map["folder_id"].asUUID();
-	//	const std::string& error_string = item_error_map["identifier"].asString();
-	//	LLUUID error_item = item_error_map["item_id"].asUUID();
-	//	const std::string& error_item_name = item_error_map["item_name"].asString();
-	//	const std::string& error_message = item_error_map["message"].asString();
-
-	//	llinfos << "Error item " << error_folder.asString() << ", " << error_string << ", "
-	//			<< error_item.asString() << ", " << error_item_name << ", " << error_message << llendl;
-	//	
-	//	LLFolderViewFolder * item_folder = mInventoryPanel->getRootFolder()->getFolderByID(error_folder);
-	//	LLOutboxFolderViewFolder * outbox_item_folder = dynamic_cast<LLOutboxFolderViewFolder *>(item_folder);
-
-	//	llassert(outbox_item_folder);
-
-	//	outbox_item_folder->setErrorString(error_string);
-	//}
 }
 
 void LLPanelMarketplaceOutbox::updateImportButtonStatus()
@@ -380,12 +423,21 @@ U32 LLPanelMarketplaceOutbox::getTotalItemCount() const
 		if (outbox_folder)
 		{
 			item_count += outbox_folder->getFoldersCount();
+			item_count += outbox_folder->getItemsCount();
 		}
 	}
 
 	return item_count;
 }
 
+void LLPanelMarketplaceOutbox::onImportButtonClicked()
+{
+	importPostTrigger();
+	
+	// Get the import animation going
+	updateImportButtonStatus();
+}
+
 void LLPanelMarketplaceOutbox::draw()
 {
 	const U32 item_count = getTotalItemCount();
@@ -414,15 +466,9 @@ void LLPanelMarketplaceOutbox::draw()
 		
 		if ((mImportFrameTimer % 50 == 0) && !mImportGetPending)
 		{
-			mImportGetPending = true;
-
-			std::string url = getMarketplaceURL_InventoryImport();
-			
-			llinfos << "http get:  " << url << llendl;
-			LLHTTPClient::get(url, new LLInventoryImportGetResponder(this), LLViewerMedia::getHeaders());
+			importGetTrigger();
 		}
 	}
-
 	
 	LLPanel::draw();
 }
diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h
index a776ee09197..9cbb9cf21b2 100644
--- a/indra/newview/llpanelmarketplaceoutbox.h
+++ b/indra/newview/llpanelmarketplaceoutbox.h
@@ -62,7 +62,7 @@ class LLPanelMarketplaceOutbox : public LLPanel
 	bool isImportInProgress() const;
 
 	void onImportPostComplete(U32 status, const LLSD& content);
-	void onImportGetComplete(U32 status, const LLSD& content);
+	void onImportGetComplete(U32 status, const LLSD& content, bool ignoreResults);
 
 	/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 								   EDragAndDropType cargo_type,
@@ -77,6 +77,10 @@ class LLPanelMarketplaceOutbox : public LLPanel
 	void handleLoginComplete();
 	void onFocusReceived();
 	void onSelectionChange();
+	
+	void importPostTrigger();
+	void importGetTrigger();
+	void establishMarketplaceSessionCookie();
 
 private:
 	LLInventoryPanel *		mInventoryPanel;
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 02d8036666d..eb7a4aa538c 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1390,6 +1390,7 @@ LLSD LLViewerMedia::getHeaders()
 {
 	LLSD headers = LLSD::emptyMap();
 	headers["Accept"] = "*/*";
+	headers["Content-Type"] = "application/xml";
 	headers["Cookie"] = sOpenIDCookie;
 	headers["User-Agent"] = getCurrentUserAgent();
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 46a6da24504..8d0d76b58ef 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -235,7 +235,7 @@ Marketplace import completed with errors!  Please correct the problems in your o
    icon="alertmodal.tga"
    name="OutboxImportFailed"
    type="alertmodal">
-Marketplace import failed!  Please try again later.  Thanks.
+Marketplace import failed with error [ERROR_CODE]!  Please try again later.  Thanks.
         <usetemplate
          name="okbutton"
          yestext="Rats!"/>
-- 
GitLab


From 1c71b9030062985c307704bdf42925e0c7cb97b6 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 6 Dec 2011 21:43:58 +0200
Subject: [PATCH 373/933] EXP-1651 FIXED Added saving window size after each
 reshape. Fixed broken resize indicator on Linux viewer window (EXP-1580).

---
 indra/llwindow/llwindowsdl.cpp   | 4 ++--
 indra/llwindow/llwindowsdl.h     | 2 +-
 indra/newview/llviewerwindow.cpp | 5 ++++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index aed035569d9..6d593c807e6 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -1034,9 +1034,9 @@ void LLWindowSDL::setMouseClipping( BOOL b )
 }
 
 // virtual
-void LLWindowSDL::setMinSize(U32 min_width, U32 min_height)
+void LLWindowSDL::setMinSize(U32 min_width, U32 min_height, bool enforce_immediately)
 {
-	LLWindow::setMinSize(min_width, min_height);
+	LLWindow::setMinSize(min_width, min_height, enforce_immediately);
 
 #if LL_X11
 	// Set the minimum size limits for X11 window
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index 76019999b11..14bc0b399d7 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -76,7 +76,7 @@ class LLWindowSDL : public LLWindow
 	/*virtual*/ void captureMouse();
 	/*virtual*/ void releaseMouse();
 	/*virtual*/ void setMouseClipping( BOOL b );
-	/*virtual*/	void setMinSize(U32 min_width, U32 min_height);
+	/*virtual*/	void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true);
 
 	/*virtual*/ BOOL isClipboardTextAvailable();
 	/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index eb72a8657f0..31dfa1923c2 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2140,7 +2140,6 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 		sendShapeToSim();
 
 		// store new settings for the mode we are in, regardless
-		// Only save size if not maximized
 		BOOL maximized = mWindow->getMaximized();
 		gSavedSettings.setBOOL("WindowMaximized", maximized);
 
@@ -2150,6 +2149,10 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 			U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
 			// tell the OS specific window code about min window size
 			mWindow->setMinSize(min_window_width, min_window_height);
+
+			// Only save size if not maximized
+			gSavedSettings.setU32("WindowWidth", mWindowRectRaw.getWidth());
+			gSavedSettings.setU32("WindowHeight", mWindowRectRaw.getHeight());
 		}
 
 		LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width);
-- 
GitLab


From 40f9de414fbd5755b7c040f786030157cf083771 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 6 Dec 2011 11:45:21 -0800
Subject: [PATCH 374/933] Added code to set up the marketplace session cookie
 and use it for subsequent posts and gets to the inventory import API

---
 indra/newview/llpanelmarketplaceoutbox.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 99d744891a5..d4b0bead4c0 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -50,6 +50,8 @@
 
 static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
 
+static std::string sMarketplaceCookie;
+
 const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() 
 { 
 	return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceOutbox>(); 
@@ -263,6 +265,15 @@ class LLInventoryImportGetResponder : public LLHTTPClient::Responder
 	{
 	}
 
+	void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		std::string cookie = content["set-cookie"].asString();
+		
+		llinfos << "*** Marketplace *** " << "inventory/import headers set-cookie: " << cookie << llendl;
+		
+		sMarketplaceCookie = cookie;
+	}
+
 	void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		llinfos << "*** Marketplace *** " << "inventory/import get status: " << status << ", reason: " << reason << llendl;
@@ -295,6 +306,7 @@ void LLPanelMarketplaceOutbox::importPostTrigger()
 	
 	LLSD headers = LLViewerMedia::getHeaders();
 	headers["Connection"] = "Keep-Alive";
+	headers["Cookie"] = sMarketplaceCookie;
 	
 	llinfos << "*** Marketplace *** " << "http post:  " << url << llendl;
 	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
@@ -311,6 +323,7 @@ void LLPanelMarketplaceOutbox::importGetTrigger()
 	
 	std::string url = getMarketplaceURL_InventoryImport();
 	LLSD headers = LLViewerMedia::getHeaders();
+	headers["Cookie"] = sMarketplaceCookie;
 	
 	llinfos << "*** Marketplace *** " << "http get:  " << url << llendl;
 	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
-- 
GitLab


From 83cc0becf859275a810da4ce0ccb0d7f8147d614 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 6 Dec 2011 11:51:09 -0800
Subject: [PATCH 375/933] Turning off marketplace logging verbosity by default

---
 indra/newview/llpanelmarketplaceoutbox.cpp | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index d4b0bead4c0..d7e4ed8bec2 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -48,9 +48,14 @@
 #include "llfolderview.h"
 #include "llinventoryfunctions.h"
 
+
+// Turn this on to get a bunch of console output for marketplace API calls, headers and status
+#define DEBUG_MARKETPLACE_HTTP_API	0
+
+
 static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
 
-static std::string sMarketplaceCookie;
+static std::string sMarketplaceCookie = "";
 
 const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() 
 { 
@@ -236,6 +241,7 @@ class LLInventoryImportPostResponder : public LLHTTPClient::Responder
 	
 	void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
+#if DEBUG_MARKETPLACE_HTTP_API
 		llinfos << "*** Marketplace *** " << "inventory/import post status: " << status << ", reason: " << reason << llendl;
 		
 		if (isGoodStatus(status))
@@ -247,6 +253,7 @@ class LLInventoryImportPostResponder : public LLHTTPClient::Responder
 		{
 			llwarns << "*** Marketplace *** " << "failed" << llendl;
 		}
+#endif // DEBUG_MARKETPLACE_HTTP_API
 		
 		mOutboxPanel->onImportPostComplete(status, content);
 	}
@@ -269,13 +276,16 @@ class LLInventoryImportGetResponder : public LLHTTPClient::Responder
 	{
 		std::string cookie = content["set-cookie"].asString();
 		
+#if DEBUG_MARKETPLACE_HTTP_API
 		llinfos << "*** Marketplace *** " << "inventory/import headers set-cookie: " << cookie << llendl;
+#endif // DEBUG_MARKETPLACE_HTTP_API
 		
 		sMarketplaceCookie = cookie;
 	}
 
 	void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
+#if DEBUG_MARKETPLACE_HTTP_API
 		llinfos << "*** Marketplace *** " << "inventory/import get status: " << status << ", reason: " << reason << llendl;
 		
 		if (isGoodStatus(status))
@@ -287,6 +297,7 @@ class LLInventoryImportGetResponder : public LLHTTPClient::Responder
 		{
 			llwarns << "*** Marketplace *** " << "failed" << llendl;
 		}
+#endif // DEBUG_MARKETPLACE_HTTP_API
 
 		mOutboxPanel->onImportGetComplete(status, content, mIgnoreResults);
 	}
@@ -308,8 +319,10 @@ void LLPanelMarketplaceOutbox::importPostTrigger()
 	headers["Connection"] = "Keep-Alive";
 	headers["Cookie"] = sMarketplaceCookie;
 	
+#if DEBUG_MARKETPLACE_HTTP_API
 	llinfos << "*** Marketplace *** " << "http post:  " << url << llendl;
 	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
+#endif // DEBUG_MARKETPLACE_HTTP_API
 	
 	LLHTTPClient::post(url, LLSD(), new LLInventoryImportPostResponder(this), headers);
 	
@@ -325,8 +338,10 @@ void LLPanelMarketplaceOutbox::importGetTrigger()
 	LLSD headers = LLViewerMedia::getHeaders();
 	headers["Cookie"] = sMarketplaceCookie;
 	
+#if DEBUG_MARKETPLACE_HTTP_API
 	llinfos << "*** Marketplace *** " << "http get:  " << url << llendl;
 	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
+#endif // DEBUG_MARKETPLACE_HTTP_API
 	
 	const bool do_not_ignore_results = false;
 	
@@ -348,8 +363,10 @@ void LLPanelMarketplaceOutbox::establishMarketplaceSessionCookie()
 
 void LLPanelMarketplaceOutbox::onImportPostComplete(U32 status, const LLSD& content)
 {
+#if DEBUG_MARKETPLACE_HTTP_API
 	llinfos << "*** Marketplace *** " << "status = " << status << llendl;
 	llinfos << "*** Marketplace *** " << "content = " << ll_pretty_print_sd(content) << llendl;
+#endif // DEBUG_MARKETPLACE_HTTP_API
 
 	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
 	updateImportButtonStatus();
@@ -374,8 +391,10 @@ void LLPanelMarketplaceOutbox::onImportPostComplete(U32 status, const LLSD& cont
 
 void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& content, bool ignoreResults)
 {
+#if DEBUG_MARKETPLACE_HTTP_API
 	llinfos << "*** Marketplace *** " << "status = " << status << llendl;
 	llinfos << "*** Marketplace *** " << "content = " << ll_pretty_print_sd(content) << llendl;
+#endif // DEBUG_MARKETPLACE_HTTP_API
 
 	mImportGetPending = false;	
 	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
-- 
GitLab


From d2a0457777a81c75b18c5eb255e6e02d47f97a80 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 6 Dec 2011 15:35:10 -0800
Subject: [PATCH 376/933] EXP-1664 FIX Toolbars visible in mouselook view and
 when hide all controls selected

---
 indra/newview/lltoolbarview.cpp | 10 +++++-----
 indra/newview/lltoolbarview.h   |  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 3872444e8fb..eccb2cf2f15 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -73,6 +73,7 @@ LLToolBarView::ToolbarSet::ToolbarSet()
 LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
 :	LLUICtrl(p),
 	mDragStarted(false),
+	mShowToolbars(true),
 	mDragToolbarButton(NULL),
 	mToolbarsLoaded(false)
 {
@@ -532,7 +533,9 @@ void LLToolBarView::draw()
 	
 	for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
 	{
-		mToolbars[i]->getParent()->setVisible(mToolbars[i]->hasButtons() || isToolDragged());
+		mToolbars[i]->getParent()->setVisible(mShowToolbars 
+											&& (mToolbars[i]->hasButtons() 
+											|| isToolDragged()));
 	}
 
 	// Draw drop zones if drop of a tool is active
@@ -661,10 +664,7 @@ void LLToolBarView::resetDragTool(LLToolBarButton* toolbarButton)
 
 void LLToolBarView::setToolBarsVisible(bool visible)
 {
-	for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
-	{
-		mToolbars[i]->getParent()->setVisible(visible);
-	}
+	mShowToolbars = visible;
 }
 
 bool LLToolBarView::isModified() const
diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h
index b99e8bc28d6..be66bcae361 100644
--- a/indra/newview/lltoolbarview.h
+++ b/indra/newview/lltoolbarview.h
@@ -129,6 +129,7 @@ class LLToolBarView : public LLUICtrl
 	
 	bool				mDragStarted;
 	LLToolBarButton*	mDragToolbarButton;
+	bool				mShowToolbars;
 };
 
 extern LLToolBarView* gToolBarView;
-- 
GitLab


From 1a18184f50a3c98573ceb06d6ff3ca7bd42f6fc3 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 6 Dec 2011 16:45:30 -0700
Subject: [PATCH 377/933] fix for SH-2526: Second Life client quickly allocates
 all available RAM and crashes

---
 indra/llaudio/llaudioengine.cpp | 23 +++++++++++++++++++----
 indra/llaudio/llaudioengine.h   |  1 +
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp
index 5e540ad8c58..5fa28cb9025 100644
--- a/indra/llaudio/llaudioengine.cpp
+++ b/indra/llaudio/llaudioengine.cpp
@@ -1264,6 +1264,7 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32
 	mSyncSlave(false),
 	mQueueSounds(false),
 	mPlayedOnce(false),
+	mCorrupted(false),
 	mType(type),
 	mChannelp(NULL),
 	mCurrentDatap(NULL),
@@ -1296,16 +1297,25 @@ void LLAudioSource::setChannel(LLAudioChannel *channelp)
 
 void LLAudioSource::update()
 {
+	if(mCorrupted)
+	{
+		return ; //no need to update
+	}
+
 	if (!getCurrentBuffer())
 	{
 		if (getCurrentData())
 		{
 			// Hack - try and load the sound.  Will do this as a callback
 			// on decode later.
-			if (getCurrentData()->load())
+			if (getCurrentData()->load() && getCurrentData()->getBuffer())
 			{
 				play(getCurrentData()->getID());
-			}			
+			}
+			else
+			{
+				mCorrupted = true ;
+			}
 		}
 	}
 }
@@ -1421,6 +1431,11 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
 
 bool LLAudioSource::isDone() const
 {
+	if(mCorrupted)
+	{
+		return true ;
+	}
+
 	const F32 MAX_AGE = 60.f;
 	const F32 MAX_UNPLAYED_AGE = 15.f;
 	const F32 MAX_MUTED_AGE = 11.f;
@@ -1736,7 +1751,7 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
 	}
 }
 
-
+//return false when the audio file is corrupted.
 bool LLAudioData::load()
 {
 	// For now, just assume we're going to use one buffer per audiodata.
@@ -1752,7 +1767,7 @@ bool LLAudioData::load()
 	{
 		// No free buffers, abort.
 		llinfos << "Not able to allocate a new audio buffer, aborting." << llendl;
-		return false;
+		return true;
 	}
 
 	std::string uuid_str;
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h
index 30d24906357..a47ee7ca7ca 100644
--- a/indra/llaudio/llaudioengine.h
+++ b/indra/llaudio/llaudioengine.h
@@ -334,6 +334,7 @@ class LLAudioSource
 	bool			mSyncSlave;
 	bool			mQueueSounds;
 	bool			mPlayedOnce;
+	bool            mCorrupted;
 	S32             mType;
 	LLVector3d		mPositionGlobal;
 	LLVector3		mVelocity;
-- 
GitLab


From 8a23b0c5d777f596f3e7cb011f70addb8dc02367 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 7 Dec 2011 18:36:05 +0200
Subject: [PATCH 378/933] EXP-1639 WIP Cleaning up to improve readability;
 added more debugging messages.

---
 indra/newview/app_settings/settings.xml |  44 ---
 indra/newview/llfloatersnapshot.cpp     | 459 +++++++-----------------
 2 files changed, 128 insertions(+), 375 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9c055bdc5a4..0ad78cc8d23 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10586,39 +10586,6 @@
       <key>Value</key>
       <integer>0</integer>
     </map>  
-    <key>SnapshotLocalLastResolution</key>
-    <map>
-      <key>Comment</key>
-      <string>Take next local snapshot at this resolution</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>SnapshotProfileLastResolution</key>
-    <map>
-      <key>Comment</key>
-      <string>Take next profile snapshot at this resolution</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>SnapshotPostcardLastResolution</key>
-    <map>
-      <key>Comment</key>
-      <string>Take next postcard snapshot at this resolution</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>SnapshotQuality</key>
     <map>
       <key>Comment</key>
@@ -10652,17 +10619,6 @@
       <key>Value</key>
       <string>http://photos.apps.staging.avatarsunited.com/viewer_config</string>
     </map>
-    <key>SnapshotTextureLastResolution</key>
-    <map>
-      <key>Comment</key>
-      <string>Take next texture snapshot at this resolution</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>SpeedTest</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 80fc5fcdfc8..13f544e7849 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -100,9 +100,6 @@ S32 BORDER_WIDTH = 6;
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
 
-static std::string lastSnapshotWidthName(S32 shot_type);
-static std::string lastSnapshotHeightName(S32 shot_type);
-
 static LLDefaultChildRegistry::Register<LLSnapshotFloaterView> r("snapshot_floater_view");
 
 ///----------------------------------------------------------------------------
@@ -138,7 +135,11 @@ class LLSnapshotLivePreview : public LLView
 	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
 	
 	void setSize(S32 w, S32 h);
+	void setWidth(S32 w) { mWidth[mCurImageIndex] = w; }
+	void setHeight(S32 h) { mHeight[mCurImageIndex] = h; }
 	void getSize(S32& w, S32& h) const;
+	S32 getWidth() const { return mWidth[mCurImageIndex]; }
+	S32 getHeight() const { return mHeight[mCurImageIndex]; }
 	S32 getDataSize() const { return mDataSize; }
 	void setMaxImageSize(S32 size) ;
 	S32  getMaxImageSize() {return mMaxImageSize ;}
@@ -155,8 +156,9 @@ class LLSnapshotLivePreview : public LLView
 	LLViewerTexture* getCurrentImage();
 	F32 getImageAspect();
 	F32 getAspect() ;
-	LLRect getImageRect();
-	BOOL isImageScaled();
+	const LLRect& getImageRect() const { return mImageRect[mCurImageIndex]; }
+	BOOL isImageScaled() const { return mImageScaled[mCurImageIndex]; }
+	void setImageScaled(BOOL scaled) { mImageScaled[mCurImageIndex] = scaled; }
 	const LLVector3d& getPosTakenGlobal() const { return mPosTakenGlobal; }
 	
 	void setSnapshotType(ESnapshotType type) { mSnapshotType = type; }
@@ -171,6 +173,7 @@ class LLSnapshotLivePreview : public LLView
 	LLPointer<LLImageFormatted>	getFormattedImage() const { return mFormattedImage; }
 	LLPointer<LLImageRaw>		getEncodedImage() const { return mPreviewImageEncoded; }
 
+	/// Sets size of preview thumbnail image and thhe surrounding rect.
 	BOOL setThumbnailImageSize() ;
 	void generateThumbnailImage(BOOL force_update = FALSE) ;
 	void resetThumbnailImage() { mThumbnailImage = NULL ; }
@@ -299,7 +302,7 @@ LLViewerTexture* LLSnapshotLivePreview::getCurrentImage()
 
 F32 LLSnapshotLivePreview::getAspect()
 {
-	F32 image_aspect_ratio = ((F32)mWidth[mCurImageIndex]) / ((F32)mHeight[mCurImageIndex]);
+	F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
 	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
 
 	if (!mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
@@ -314,7 +317,7 @@ F32 LLSnapshotLivePreview::getAspect()
 
 F32 LLSnapshotLivePreview::getImageAspect()
 {
-	if (!mViewerImage[mCurImageIndex])
+	if (!getCurrentImage())
 	{
 		return 0.f;
 	}
@@ -322,33 +325,25 @@ F32 LLSnapshotLivePreview::getImageAspect()
 	return getAspect() ;	
 }
 
-LLRect LLSnapshotLivePreview::getImageRect()
-{
-	return mImageRect[mCurImageIndex];
-}
-
-BOOL LLSnapshotLivePreview::isImageScaled()
-{
-	return mImageScaled[mCurImageIndex];
-}
-
 void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay) 
 {
-	lldebugs << "updateSnapshot: mSnapshotUpToDate = " << mSnapshotUpToDate << llendl;
-	if (mSnapshotUpToDate)
+	// Invalidate current image.
+	lldebugs << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << llendl;
+	if (getSnapshotUpToDate())
 	{
 		S32 old_image_index = mCurImageIndex;
 		mCurImageIndex = (mCurImageIndex + 1) % 2; 
-		mWidth[mCurImageIndex] = mWidth[old_image_index];
-		mHeight[mCurImageIndex] = mHeight[old_image_index];
+		setWidth(mWidth[old_image_index]);
+		setHeight(mHeight[old_image_index]);
 		mFallAnimTimer.start();		
 	}
 	mSnapshotUpToDate = FALSE; 		
 
+	// Update snapshot source rect depending on whether we keep the aspect ratio.
 	LLRect& rect = mImageRect[mCurImageIndex];
 	rect.set(0, getRect().getHeight(), getRect().getWidth(), 0);
 
-	F32 image_aspect_ratio = ((F32)mWidth[mCurImageIndex]) / ((F32)mHeight[mCurImageIndex]);
+	F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
 	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
 
 	if (mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
@@ -369,13 +364,18 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
 		}
 	}
 
+	// Stop shining animation.
 	mShineAnimTimer.stop();
+
+	// Update snapshot if requested.
 	if (new_snapshot)
 	{
 		mSnapshotDelayTimer.start();
 		mSnapshotDelayTimer.setTimerExpirySec(delay);
 		LLFloaterSnapshot::preUpdate();
 	}
+
+	// Update thumbnail if requested.
 	if(new_thumbnail)
 	{
 		mThumbnailUpToDate = FALSE ;
@@ -435,23 +435,23 @@ void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y)
 //called when the frame is frozen.
 void LLSnapshotLivePreview::draw()
 {
-	if (mViewerImage[mCurImageIndex].notNull() &&
+	if (getCurrentImage() &&
 	    mPreviewImageEncoded.notNull() &&
-	    mSnapshotUpToDate)
+	    getSnapshotUpToDate())
 	{
 		LLColor4 bg_color(0.f, 0.f, 0.3f, 0.4f);
 		gl_rect_2d(getRect(), bg_color);
-		LLRect &rect = mImageRect[mCurImageIndex];
-		LLRect shadow_rect = mImageRect[mCurImageIndex];
+		const LLRect& rect = getImageRect();
+		LLRect shadow_rect = rect;
 		shadow_rect.stretch(BORDER_WIDTH);
 		gl_drop_shadow(shadow_rect.mLeft, shadow_rect.mTop, shadow_rect.mRight, shadow_rect.mBottom, LLColor4(0.f, 0.f, 0.f, mNeedsFlash ? 0.f :0.5f), 10);
 
 		LLColor4 image_color(1.f, 1.f, 1.f, 1.f);
 		gGL.color4fv(image_color.mV);
-		gGL.getTexUnit(0)->bind(mViewerImage[mCurImageIndex]);
+		gGL.getTexUnit(0)->bind(getCurrentImage());
 		// calculate UV scale
-		F32 uv_width = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mWidth[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f);
-		F32 uv_height = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mHeight[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f);
+		F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f);
+		F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f);
 		glPushMatrix();
 		{
 			glTranslatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
@@ -491,6 +491,7 @@ void LLSnapshotLivePreview::draw()
 			mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f));
 		}
 
+		// Draw shining animation if appropriate.
 		if (mShineCountdown > 0)
 		{
 			mShineCountdown--;
@@ -501,6 +502,7 @@ void LLSnapshotLivePreview::draw()
 		}
 		else if (mShineAnimTimer.getStarted())
 		{
+			lldebugs << "Drawing shining animation" << llendl;
 			F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
 			
 			// draw "shine" effect
@@ -545,7 +547,7 @@ void LLSnapshotLivePreview::draw()
 	{
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.color4f(1.f, 1.f, 1.f, 1.f);
-		LLRect outline_rect = mImageRect[mCurImageIndex];
+		const LLRect& outline_rect = getImageRect();
 		gGL.begin(LLRender::QUADS);
 		{
 			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
@@ -577,6 +579,7 @@ void LLSnapshotLivePreview::draw()
 		S32 old_image_index = (mCurImageIndex + 1) % 2;
 		if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME)
 		{
+			lldebugs << "Drawing fall animation" << llendl;
 			F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME;
 			F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f);
 			LLColor4 image_color(1.f, 1.f, 1.f, alpha);
@@ -620,13 +623,14 @@ void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_pare
 	LLView::reshape(width, height, called_from_parent);
 	if (old_rect.getWidth() != width || old_rect.getHeight() != height)
 	{
+		lldebugs << "window reshaped, updating thumbnail" << llendl;
 		updateSnapshot(FALSE, TRUE);
 	}
 }
 
 BOOL LLSnapshotLivePreview::setThumbnailImageSize()
 {
-	if(mWidth[mCurImageIndex] < 10 || mHeight[mCurImageIndex] < 10)
+	if(getWidth() < 10 || getHeight() < 10)
 	{
 		return FALSE ;
 	}
@@ -662,11 +666,11 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
 	S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ;
 	if(!mKeepAspectRatio)
 	{
-		F32 ratio_x = (F32)mWidth[mCurImageIndex] / window_width ;
-		F32 ratio_y = (F32)mHeight[mCurImageIndex] / window_height ;
+		F32 ratio_x = (F32)getWidth() / window_width ;
+		F32 ratio_y = (F32)getHeight() / window_height ;
 
-		//if(mWidth[mCurImageIndex] > window_width ||
-		//	mHeight[mCurImageIndex] > window_height )
+		//if(getWidth() > window_width ||
+		//	getHeight() > window_height )
 		{
 			if(ratio_x > ratio_y)
 			{
@@ -698,11 +702,11 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
 	{
 		return ;
 	}
-	if(mThumbnailUpToDate && !force_update)//already updated
+	if(getThumbnailUpToDate() && !force_update)//already updated
 	{
 		return ;
 	}
-	if(mWidth[mCurImageIndex] < 10 || mHeight[mCurImageIndex] < 10)
+	if(getWidth() < 10 || getHeight() < 10)
 	{
 		return ;
 	}
@@ -750,15 +754,13 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
 BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 {
 	LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview;
-
-#if 1 // XXX tmp
-	if (previewp->mWidth[previewp->mCurImageIndex] == 0 || previewp->mHeight[previewp->mCurImageIndex] == 0)
+	if (previewp->getWidth() == 0 || previewp->getHeight() == 0)
 	{
-		llwarns << "Incorrect dimensions: " << previewp->mWidth[previewp->mCurImageIndex] << "x" << previewp->mHeight[previewp->mCurImageIndex] << llendl;
+		llwarns << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << llendl;
 		return FALSE;
 	}
-#endif
 
+	// If we're in freeze-frame mode and camera has moved, update snapshot.
 	LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin();
 	LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion();
 	if (gSavedSettings.getBOOL("FreezeTime") && 
@@ -768,6 +770,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 		previewp->mCameraRot = new_camera_rot;
 		// request a new snapshot whenever the camera moves, with a time delay
 		BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot");
+		lldebugs << "camera moved, updating thumbnail" << llendl;
 		previewp->updateSnapshot(
 			autosnap, // whether a new snapshot is needed or merely invalidate the existing one
 			FALSE, // or if 1st arg is false, whether to produce a new thumbnail image.
@@ -801,13 +804,13 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 	previewp->setEnabled(FALSE);
 	
 	previewp->getWindow()->incBusyCount();
-	previewp->mImageScaled[previewp->mCurImageIndex] = FALSE;
+	previewp->setImageScaled(FALSE);
 
 	// grab the raw image and encode it into desired format
 	if(gViewerWindow->rawSnapshot(
 							previewp->mPreviewImage,
-							previewp->mWidth[previewp->mCurImageIndex],
-							previewp->mHeight[previewp->mCurImageIndex],
+							previewp->getWidth(),
+							previewp->getHeight(),
 							previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
 							previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE,
 							gSavedSettings.getBOOL("RenderUIInSnapshot"),
@@ -831,7 +834,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 				previewp->mPreviewImage->getComponents());
 		
 			scaled->biasedScaleToPowerOfTwo(512);
-			previewp->mImageScaled[previewp->mCurImageIndex] = TRUE;
+			previewp->setImageScaled(TRUE);
 			if (formatted->encode(scaled, 0.f))
 			{
 				previewp->mDataSize = formatted->getDataSize();
@@ -886,7 +889,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 			{
 				// go ahead and shrink image to appropriate power of 2 for display
 				scaled->biasedScaleToPowerOfTwo(1024);
-				previewp->mImageScaled[previewp->mCurImageIndex] = TRUE;
+				previewp->setImageScaled(TRUE);
 			}
 			else
 			{
@@ -933,14 +936,14 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 void LLSnapshotLivePreview::setSize(S32 w, S32 h)
 {
 	lldebugs << "setSize(" << w << ", " << h << ")" << llendl;
-	mWidth[mCurImageIndex] = w;
-	mHeight[mCurImageIndex] = h;
+	setWidth(w);
+	setHeight(h);
 }
 
 void LLSnapshotLivePreview::getSize(S32& w, S32& h) const
 {
-	w = mWidth[mCurImageIndex];
-	h = mHeight[mCurImageIndex];
+	w = getWidth();
+	h = getHeight();
 }
 
 void LLSnapshotLivePreview::saveTexture()
@@ -959,7 +962,7 @@ void LLSnapshotLivePreview::saveTexture()
 	
 	scaled->biasedScaleToPowerOfTwo(512);
 	lldebugs << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << llendl;
-			
+
 	if (formatted->encode(scaled, 0.0f))
 	{
 		LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE);
@@ -1068,24 +1071,18 @@ class LLFloaterSnapshot::Impl
 	static void onClickMore(void* data) ;
 	static void onClickUICheck(LLUICtrl *ctrl, void* data);
 	static void onClickHUDCheck(LLUICtrl *ctrl, void* data);
-#if 0
-	static void onClickKeepAspectCheck(LLUICtrl *ctrl, void* data);
-#endif
 	static void applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked);
 	static void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE);
 	static void onCommitFreezeFrame(LLUICtrl* ctrl, void* data);
 	static void onCommitLayerTypes(LLUICtrl* ctrl, void*data);
 	static void onImageQualityChange(LLFloaterSnapshot* view, S32 quality_val);
 	static void onImageFormatChange(LLFloaterSnapshot* view);
-#if 0
-	static void onCommitSnapshotType(LLUICtrl* ctrl, void* data);
-	static void onCommitCustomResolution(LLUICtrl *ctrl, void* data);
-#endif
 	static void applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h);
 	static void onSnapshotUploadFinished(bool status);
 	static void onSendingPostcardFinished(bool status);
-	static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ;
 	static BOOL checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value);
+	static void setImageSizeSpinnersValues(LLFloaterSnapshot *view, S32 width, S32 height) ;
+	static void updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed);
 
 	static LLPanelSnapshot* getActivePanel(LLFloaterSnapshot* floater, bool ok_if_not_found = true);
 	static LLSnapshotLivePreview::ESnapshotType getActiveSnapshotType(LLFloaterSnapshot* floater);
@@ -1256,16 +1253,9 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 		previewp->mKeepAspectRatio = TRUE;
 
 		floaterp->getChild<LLComboBox>("profile_size_combo")->setCurrentByIndex(0);
-		gSavedSettings.setS32("SnapshotProfileLastResolution", 0);
-
 		floaterp->getChild<LLComboBox>("postcard_size_combo")->setCurrentByIndex(0);
-		gSavedSettings.setS32("SnapshotPostcardLastResolution", 0);
-
 		floaterp->getChild<LLComboBox>("texture_size_combo")->setCurrentByIndex(0);
-		gSavedSettings.setS32("SnapshotTextureLastResolution", 0);
-
 		floaterp->getChild<LLComboBox>("local_size_combo")->setCurrentByIndex(0);
-		gSavedSettings.setS32("SnapshotLocalLastResolution", 0);
 
 		LLSnapshotLivePreview* previewp = getPreviewView(floaterp);
 		previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
@@ -1349,19 +1339,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 	floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled"));
 #endif
 
-#if 0
-	floater->getChildView("postcard_size_combo")->setVisible( FALSE);
-	floater->getChildView("texture_size_combo")->setVisible( FALSE);
-	floater->getChildView("local_size_combo")->setVisible( FALSE);
-#endif
-
-	floater->getChild<LLComboBox>("profile_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotProfileLastResolution"));
-	floater->getChild<LLComboBox>("postcard_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotPostcardLastResolution"));
-	floater->getChild<LLComboBox>("texture_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotTextureLastResolution"));
-	floater->getChild<LLComboBox>("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution"));
 	floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat"));
-
-	// *TODO: Separate settings for Web images from postcards
 	enableAspectRatioCheckbox(floater, !floater->impl.mAspectRatioCheckOff);
 	setAspectRatioCheckboxValue(floater, gSavedSettings.getBOOL("KeepAspectForSnapshot"));
 	floater->getChildView("layer_types")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL);
@@ -1375,19 +1353,20 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 		// Initialize spinners.
 		if (width_ctrl->getValue().asInteger() == 0)
 		{
-			S32 w = gSavedSettings.getS32(lastSnapshotWidthName(shot_type));
+			S32 w = gViewerWindow->getWindowWidthRaw();
 			lldebugs << "Initializing width spinner (" << width_ctrl->getName() << "): " << w << llendl;
 			width_ctrl->setValue(w);
 		}
 		if (height_ctrl->getValue().asInteger() == 0)
 		{
-			S32 h = gSavedSettings.getS32(lastSnapshotHeightName(shot_type));
+			S32 h = gViewerWindow->getWindowHeightRaw();
 			lldebugs << "Initializing height spinner (" << height_ctrl->getName() << "): " << h << llendl;
 			height_ctrl->setValue(h);
 		}
 
+		// Сlamp snapshot resolution to window size when showing UI or HUD in snapshot.
 		if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot"))
-		{ //clamp snapshot resolution to window size when showing UI or HUD in snapshot
+		{
 			S32 width = gViewerWindow->getWindowWidthRaw();
 			S32 height = gViewerWindow->getWindowHeightRaw();
 
@@ -1441,6 +1420,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 		&& got_bytes
 		&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
 
+	// Update the width and height spinners based on the corresponding resolution combos. (?)
 	switch(shot_type)
 	{
 	  case LLSnapshotLivePreview::SNAPSHOT_WEB:
@@ -1520,6 +1500,7 @@ void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp,
 	if (previewp)
 	{
 		BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot");
+		lldebugs << "updating " << (autosnap ? "snapshot" : "thumbnail") << llendl;
 		previewp->updateSnapshot(autosnap, update_thumbnail, autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f);
 	}
 }
@@ -1532,6 +1513,7 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data)
 	if (previewp && view)
 	{
 		view->impl.setStatus(Impl::STATUS_READY);
+		lldebugs << "updating snapshot" << llendl;
 		previewp->updateSnapshot(TRUE);
 	}
 }
@@ -1559,17 +1541,8 @@ void LLFloaterSnapshot::Impl::onClickMore(void* data)
 	{
 		view->impl.setStatus(Impl::STATUS_READY);
 		gSavedSettings.setBOOL("AdvanceSnapshot", !visible);
-#if 0
-		view->translate( 0, view->getUIWinHeightShort() - view->getUIWinHeightLong() );
-		view->reshape(view->getRect().getWidth(), view->getUIWinHeightLong());
-#endif
 		updateControls(view) ;
 		updateLayout(view) ;
-		// *TODO: redundant?
-		if(getPreviewView(view))
-		{
-			getPreviewView(view)->setThumbnailImageSize() ;
-		}
 	}
 }
 
@@ -1601,16 +1574,6 @@ void LLFloaterSnapshot::Impl::onClickHUDCheck(LLUICtrl *ctrl, void* data)
 	}
 }
 
-#if 0
-// static
-void LLFloaterSnapshot::Impl::onClickKeepAspectCheck(LLUICtrl* ctrl, void* data)
-{
-	LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl;
-	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
-	applyKeepAspectCheck(view, check->get());
-}
-#endif
-
 // static
 void LLFloaterSnapshot::Impl::applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked)
 {
@@ -1625,11 +1588,9 @@ void LLFloaterSnapshot::Impl::applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL
 
 			S32 w, h ;
 			previewp->getSize(w, h) ;
-			if(checkImageSize(previewp, w, h, TRUE, previewp->getMaxImageSize()))
-			{
-				resetSnapshotSizeOnUI(view, w, h) ;
-			}
+			updateSpinners(view, previewp, w, h, TRUE); // may change w and h
 
+			lldebugs << "updating thumbnail" << llendl;
 			previewp->setSize(w, h) ;
 			previewp->updateSnapshot(FALSE, TRUE);
 			checkAutoSnapshot(previewp, TRUE);
@@ -1664,39 +1625,31 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde
 		previewp->mKeepAspectRatio = FALSE ;
 		return ;
 	}
-	
-	if(0 == index) //current window size
-	{
-		view->impl.mAspectRatioCheckOff = true ;
-		enableAspectRatioCheckbox(view, FALSE);
 
-		if(previewp)
-		{
-			previewp->mKeepAspectRatio = TRUE ;
-		}
+	BOOL keep_aspect = FALSE, enable_cb = FALSE;
+
+	if (0 == index) // current window size
+	{
+		enable_cb = FALSE;
+		keep_aspect = TRUE;
 	}
-	else if(-1 == index) //custom
+	else if (-1 == index) // custom
 	{
-		view->impl.mAspectRatioCheckOff = false ;
-		enableAspectRatioCheckbox(view, TRUE);
-
-		if(previewp)
-		{
-			previewp->mKeepAspectRatio = gSavedSettings.getBOOL("KeepAspectForSnapshot") ;
-		}
+		enable_cb = TRUE;
+		keep_aspect = gSavedSettings.getBOOL("KeepAspectForSnapshot");
 	}
-	else
+	else // predefined resolution
 	{
-		view->impl.mAspectRatioCheckOff = true ;
-		enableAspectRatioCheckbox(view, FALSE);
-
-		if(previewp)
-		{
-			previewp->mKeepAspectRatio = FALSE ;
-		}
+		enable_cb = FALSE;
+		keep_aspect = FALSE;
 	}
 
-	return ;
+	view->impl.mAspectRatioCheckOff = !enable_cb;
+	enableAspectRatioCheckbox(view, enable_cb);
+	if (previewp)
+	{
+		previewp->mKeepAspectRatio = keep_aspect;
+	}
 }
 
 // Show/hide upload progress indicators.
@@ -1743,27 +1696,6 @@ void LLFloaterSnapshot::Impl::setFinished(LLFloaterSnapshot* floater, bool finis
 	}
 }
 
-static std::string lastSnapshotWidthName(S32 shot_type)
-{
-	switch (shot_type)
-	{
-	  case LLSnapshotLivePreview::SNAPSHOT_WEB:		 return "LastSnapshotToProfileWidth";
-	  case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailWidth";
-	  case LLSnapshotLivePreview::SNAPSHOT_TEXTURE:  return "LastSnapshotToInventoryWidth";
-	  default:                                       return "LastSnapshotToDiskWidth";
-	}
-}
-static std::string lastSnapshotHeightName(S32 shot_type)
-{
-	switch (shot_type)
-	{
-	  case LLSnapshotLivePreview::SNAPSHOT_WEB:	     return "LastSnapshotToProfileHeight";
-	  case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailHeight";
-	  case LLSnapshotLivePreview::SNAPSHOT_TEXTURE:  return "LastSnapshotToInventoryHeight";
-	  default:                                       return "LastSnapshotToDiskHeight";
-	}
-}
-
 // static
 void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update)
 {
@@ -1776,12 +1708,6 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 		return;
 	}
 
-	// save off all selected resolution values
-	gSavedSettings.setS32("SnapshotProfileLastResolution",  view->getChild<LLComboBox>("profile_size_combo")->getCurrentIndex());
-	gSavedSettings.setS32("SnapshotPostcardLastResolution", view->getChild<LLComboBox>("postcard_size_combo")->getCurrentIndex());
-	gSavedSettings.setS32("SnapshotTextureLastResolution",  view->getChild<LLComboBox>("texture_size_combo")->getCurrentIndex());
-	gSavedSettings.setS32("SnapshotLocalLastResolution",    view->getChild<LLComboBox>("local_size_combo")->getCurrentIndex());
-
 	std::string sdstring = combobox->getSelectedValue();
 	LLSD sdres;
 	std::stringstream sstream(sdstring);
@@ -1805,7 +1731,6 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 		else if (width == -1 || height == -1)
 		{
 			// load last custom value
-#if 1
 			S32 new_width = 0, new_height = 0;
 			LLPanelSnapshot* spanel = getActivePanel(view);
 			if (spanel)
@@ -1816,23 +1741,14 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 			}
 			else
 			{
-				const S32 shot_type = getActiveSnapshotType(view);
-				lldebugs << "Loading saved res for shot_type " << shot_type << llendl;
-				new_width = gSavedSettings.getS32(lastSnapshotWidthName(shot_type));
-				new_height = gSavedSettings.getS32(lastSnapshotHeightName(shot_type));
+				lldebugs << "No custom res chosen, setting preview res from window: "
+					<< gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
+				new_width = gViewerWindow->getWindowWidthRaw();
+				new_height = gViewerWindow->getWindowHeightRaw();
 			}
 
 			llassert(new_width > 0 && new_height > 0);
 			previewp->setSize(new_width, new_height);
-#else
-			LLPanelSnapshot* spanel = getActivePanel(view);
-			if (spanel)
-			{
-				lldebugs << "Setting custom preview res : " << spanel->getTypedPreviewWidth() << "x" << spanel->getTypedPreviewHeight() << llendl;
-				previewp->setSize(spanel->getTypedPreviewWidth(), spanel->getTypedPreviewHeight());
-			}
-			//previewp->setSize(gSavedSettings.getS32(lastSnapshotWidthName()), gSavedSettings.getS32(lastSnapshotHeightName()));
-#endif
 		}
 		else
 		{
@@ -1851,11 +1767,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 			height = llmin(height, gViewerWindow->getWindowHeightRaw());
 		}
 
-		
-		if(checkImageSize(previewp, width, height, TRUE, previewp->getMaxImageSize()))
-		{
-			resetSnapshotSizeOnUI(view, width, height) ;
-		}
+		updateSpinners(view, previewp, width, height, TRUE); // may change width and height
 		
 		if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height)
 		{
@@ -1869,6 +1781,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 
 			// hide old preview as the aspect ratio could be wrong
 			checkAutoSnapshot(previewp, FALSE);
+			lldebugs << "updating thumbnail" << llendl;
 			getPreviewView(view)->updateSnapshot(FALSE, TRUE);
 			if(do_update)
 			{
@@ -1915,93 +1828,29 @@ void LLFloaterSnapshot::Impl::onImageFormatChange(LLFloaterSnapshot* view)
 	if (view)
 	{
 		gSavedSettings.setS32("SnapshotFormat", getImageFormat(view));
+		lldebugs << "image format changed, updating snapshot" << llendl;
 		getPreviewView(view)->updateSnapshot(TRUE);
 		updateControls(view);
 		setNeedRefresh(view, false); // we're refreshing
 	}
 }
 
-#if 0
-//static 
-void LLFloaterSnapshot::Impl::onCommitSnapshotType(LLUICtrl* ctrl, void* data)
-{
-	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;		
-	if (view)
-	{
-		gSavedSettings.setS32("LastSnapshotType", getTypeIndex(view));
-		getPreviewView(view)->updateSnapshot(TRUE);
-		updateControls(view);
-	}
-}
-#endif
-
 // Sets the named size combo to "custom" mode.
 // static
 void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const std::string& comboname)
 {
 	LLComboBox* combo = floater->getChild<LLComboBox>(comboname);
-
 	combo->setCurrentByIndex(combo->getItemCount() - 1); // "custom" is always the last index
-
-	if(comboname == "postcard_size_combo") 
-	{
-		gSavedSettings.setS32("SnapshotPostcardLastResolution", combo->getCurrentIndex());
-	}
-	else if(comboname == "profile_size_combo")
-	{
-		gSavedSettings.setS32("SnapshotProfileLastResolution", combo->getCurrentIndex());
-	}
-	else if(comboname == "texture_size_combo") 
-	{
-		gSavedSettings.setS32("SnapshotTextureLastResolution", combo->getCurrentIndex());
-	}
-	else if(comboname == "local_size_combo") 
-	{
-		gSavedSettings.setS32("SnapshotLocalLastResolution", combo->getCurrentIndex());
-	}
-
 	checkAspectRatio(floater, -1); // -1 means custom
 }
 
-
-
+// Update supplied width and height according to the constrain proportions flag; limit them by max_val.
 //static
 BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value)
 {
 	S32 w = width ;
 	S32 h = height ;
 
-	//if texture, ignore aspect ratio setting, round image size to power of 2.
-#if 0 // Don't round texture sizes; textures are commonly stretched in world, profiles, etc and need to be "squashed" during upload, not cropped here
-	if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType"))
-	{
-		if(width > max_value)
-		{
-			width = max_value ;
-		}
-		if(height > max_value)
-		{
-			height = max_value ;
-		}
-
-		//round to nearest power of 2 based on the direction of movement
-		// i.e. higher power of two if increasing texture resolution
-		if(gSavedSettings.getS32("LastSnapshotToInventoryWidth") < width ||
-			gSavedSettings.getS32("LastSnapshotToInventoryHeight") < height)
-		{
-			// Up arrow pressed
-			width = get_next_power_two(width, MAX_TEXTURE_SIZE) ;
-			height = get_next_power_two(height, MAX_TEXTURE_SIZE) ;
-		}
-		else
-		{
-			// Down or no change
-			width = get_lower_power_two(width, MAX_TEXTURE_SIZE) ;
-			height = get_lower_power_two(height, MAX_TEXTURE_SIZE) ;
-		}
-	}
-	else
-#endif
 	if(previewp && previewp->mKeepAspectRatio)
 	{
 		if(gViewerWindow->getWindowWidthRaw() < 1 || gViewerWindow->getWindowHeightRaw() < 1)
@@ -2037,32 +1886,25 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3
 			}
 		}
 	}
-	else
-	{
-	}
 
 	return (w != width || h != height) ;
 }
 
 //static
-void LLFloaterSnapshot::Impl::resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height)
+void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view, S32 width, S32 height)
 {
 	getWidthSpinner(view)->forceSetValue(width);
 	getHeightSpinner(view)->forceSetValue(height);
-	gSavedSettings.setS32(lastSnapshotWidthName(getActiveSnapshotType(view)), width);
-	gSavedSettings.setS32(lastSnapshotHeightName(getActiveSnapshotType(view)), height);
 }
 
-#if 0
-//static
-void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* data)
+// static
+void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed)
 {
-	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
-	S32 w = llfloor((F32)getWidthSpinner(view)->getValue().asReal());
-	S32 h = llfloor((F32)getHeightSpinner(view)->getValue().asReal());
-	applyCustomResolution(view, w, h);
+	if (checkImageSize(previewp, width, height, is_width_changed, previewp->getMaxImageSize()))
+	{
+		setImageSizeSpinnersValues(view, width, height);
+	}
 }
-#endif
 
 // static
 void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h)
@@ -2070,68 +1912,38 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32
 	bool need_refresh = false;
 
 	lldebugs << "applyCustomResolution(" << w << ", " << h << ")" << llendl;
-	if (view)
+	if (!view) return;
+
+	LLSnapshotLivePreview* previewp = getPreviewView(view);
+	if (previewp)
 	{
-		LLSnapshotLivePreview* previewp = getPreviewView(view);
-		if (previewp)
-		{
-			S32 curw,curh;
-			previewp->getSize(curw, curh);
-			
-			if (w != curw || h != curh)
-			{
-				BOOL update_ = FALSE ;
-				//if to upload a snapshot, process spinner input in a special way.
-#if 0  // Don't round texture sizes; textures are commonly stretched in world, profiles, etc and need to be "squashed" during upload, not cropped here
-				if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType"))
-				{
-					S32 spinner_increment = (S32)((LLSpinCtrl*)ctrl)->getIncrement() ;
-					S32 dw = w - curw ;
-					S32 dh = h - curh ;
-					dw = (dw == spinner_increment) ? 1 : ((dw == -spinner_increment) ? -1 : 0) ;
-					dh = (dh == spinner_increment) ? 1 : ((dh == -spinner_increment) ? -1 : 0) ;
-
-					if(dw)
-					{
-						w = (dw > 0) ? curw << dw : curw >> -dw ;
-						update_ = TRUE ;
-					}
-					if(dh)
-					{
-						h = (dh > 0) ? curh << dh : curh >> -dh ;
-						update_ = TRUE ;
-					}
-				}
-#endif
-				previewp->setMaxImageSize((S32) getWidthSpinner(view)->getMaxValue()) ;
-				
-				// Check image size changes the value of height and width
-				if(checkImageSize(previewp, w, h, w != curw, previewp->getMaxImageSize())
-					|| update_)
-				{
-					resetSnapshotSizeOnUI(view, w, h) ;
-				}
+		S32 curw,curh;
+		previewp->getSize(curw, curh);
 
-				previewp->setSize(w,h);
-				checkAutoSnapshot(previewp, FALSE);
-				previewp->updateSnapshot(FALSE, TRUE);
-				comboSetCustom(view, "profile_size_combo");
-				comboSetCustom(view, "postcard_size_combo");
-				comboSetCustom(view, "texture_size_combo");
-				comboSetCustom(view, "local_size_combo");
-				need_refresh = true;
-			}
-		}
+		if (w != curw || h != curh)
+		{
+			//if to upload a snapshot, process spinner input in a special way.
+			previewp->setMaxImageSize((S32) getWidthSpinner(view)->getMaxValue()) ;
 
-		gSavedSettings.setS32(lastSnapshotWidthName(getActiveSnapshotType(view)), w);
-		gSavedSettings.setS32(lastSnapshotHeightName(getActiveSnapshotType(view)), h);
+			updateSpinners(view, previewp, w, h, w != curw); // may change w and h
 
-		updateControls(view);
-		if (need_refresh)
-		{
-			setNeedRefresh(view, true); // need to do this after updateControls()
+			previewp->setSize(w,h);
+			checkAutoSnapshot(previewp, FALSE);
+			lldebugs << "applied custom resolution, updating thumbnail" << llendl;
+			previewp->updateSnapshot(FALSE, TRUE);
+			comboSetCustom(view, "profile_size_combo");
+			comboSetCustom(view, "postcard_size_combo");
+			comboSetCustom(view, "texture_size_combo");
+			comboSetCustom(view, "local_size_combo");
+			need_refresh = true;
 		}
 	}
+
+	updateControls(view);
+	if (need_refresh)
+	{
+		setNeedRefresh(view, true); // need to do this after updateControls()
+	}
 }
 
 // static
@@ -2187,10 +1999,6 @@ BOOL LLFloaterSnapshot::postBuild()
 		LLWebSharing::instance().init();
 	}
 
-#if 0
-	childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this);
-#endif
-	
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this);
 	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
@@ -2199,31 +2007,18 @@ BOOL LLFloaterSnapshot::postBuild()
 
 	childSetAction("advanced_options_btn", Impl::onClickMore, this);
 
-#if 0
-	childSetCommitCallback("snapshot_width", Impl::onCommitCustomResolution, this);
-	childSetCommitCallback("snapshot_height", Impl::onCommitCustomResolution, this);
-#endif
-
 	childSetCommitCallback("ui_check", Impl::onClickUICheck, this);
 	getChild<LLUICtrl>("ui_check")->setValue(gSavedSettings.getBOOL("RenderUIInSnapshot"));
 
 	childSetCommitCallback("hud_check", Impl::onClickHUDCheck, this);
 	getChild<LLUICtrl>("hud_check")->setValue(gSavedSettings.getBOOL("RenderHUDInSnapshot"));
 
-#if 0
-	childSetCommitCallback("keep_aspect_check", Impl::onClickKeepAspectCheck, this);
-#endif
 	impl.setAspectRatioCheckboxValue(this, gSavedSettings.getBOOL("KeepAspectForSnapshot"));
 
 	childSetCommitCallback("layer_types", Impl::onCommitLayerTypes, this);
 	getChild<LLUICtrl>("layer_types")->setValue("colors");
 	getChildView("layer_types")->setEnabled(FALSE);
 
-#if 0 // leads to crash later if one of the settings values is 0
-	impl.getWidthSpinner(this)->setValue(gSavedSettings.getS32(lastSnapshotWidthName()));
-	impl.getHeightSpinner(this)->setValue(gSavedSettings.getS32(lastSnapshotHeightName()));
-#endif
-
 	getChild<LLUICtrl>("freeze_frame_check")->setValue(gSavedSettings.getBOOL("UseFreezeFrame"));
 	childSetCommitCallback("freeze_frame_check", Impl::onCommitFreezeFrame, this);
 
@@ -2342,6 +2137,7 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
 	LLSnapshotLivePreview* preview = LLFloaterSnapshot::Impl::getPreviewView(this);
 	if(preview)
 	{
+		lldebugs << "opened, updating snapshot" << llendl;
 		preview->updateSnapshot(TRUE);
 	}
 	focusFirstItem(FALSE);
@@ -2423,14 +2219,15 @@ void LLFloaterSnapshot::update()
 		return;
 	
 	BOOL changed = FALSE;
+	lldebugs << "npreviews: " << LLSnapshotLivePreview::sList.size() << llendl;
 	for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin();
 		 iter != LLSnapshotLivePreview::sList.end(); ++iter)
 	{
 		changed |= LLSnapshotLivePreview::onIdle(*iter);
 	}
-	lldebugs << "changed: " << changed << llendl;
 	if(changed)
 	{
+		lldebugs << "changed" << llendl;
 		inst->impl.updateControls(inst);
 	}
 }
-- 
GitLab


From ae8bf629834a1fe2d2707ec631ac1d487dda800a Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 7 Dec 2011 11:26:05 -0800
Subject: [PATCH 379/933] EXP-1673 FIX "Remove minimum window size constraint
 in the Viewer"

---
 indra/newview/app_settings/settings.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1e07ed8a27c..1c46c1e14e3 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12685,7 +12685,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>600</integer>
+      <integer>0</integer>
     </map>
     <key>WindowHeight</key>
     <map>
@@ -12718,7 +12718,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>960</integer>
+      <integer>0</integer>
     </map>
     <key>WindowWidth</key>
     <map>
-- 
GitLab


From afc19140575fb96826b12139d77c5b2174c4713e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 7 Dec 2011 11:47:33 -0800
Subject: [PATCH 380/933] EXP-1652 FIX (Build tool floater size affected by
 viewer window size) force all floaters to have follows flags = FOLLOWS_NONE
 and use llfloaterview::reshape logic instead removed existing follows flags
 from any floater XUI and deprecated the follows parameter for floaters

---
 indra/llui/llfloater.cpp                                    | 6 +++++-
 indra/llui/llfloater.h                                      | 2 ++
 indra/newview/skins/default/xui/en/floater_activeim.xml     | 1 -
 .../newview/skins/default/xui/en/floater_build_options.xml  | 1 -
 indra/newview/skins/default/xui/en/floater_camera.xml       | 1 -
 indra/newview/skins/default/xui/en/floater_color_picker.xml | 1 -
 indra/newview/skins/default/xui/en/floater_event.xml        | 1 -
 indra/newview/skins/default/xui/en/floater_gesture.xml      | 1 -
 indra/newview/skins/default/xui/en/floater_im_session.xml   | 1 -
 .../newview/skins/default/xui/en/floater_live_lsleditor.xml | 1 -
 indra/newview/skins/default/xui/en/floater_lsl_guide.xml    | 1 -
 indra/newview/skins/default/xui/en/floater_map.xml          | 1 -
 indra/newview/skins/default/xui/en/floater_mem_leaking.xml  | 1 -
 indra/newview/skins/default/xui/en/floater_moveview.xml     | 1 -
 .../skins/default/xui/en/floater_preview_notecard.xml       | 1 -
 .../skins/default/xui/en/floater_preview_texture.xml        | 1 -
 indra/newview/skins/default/xui/en/floater_script.xml       | 1 -
 .../skins/default/xui/en/floater_script_debug_panel.xml     | 1 -
 indra/newview/skins/default/xui/en/floater_snapshot.xml     | 1 -
 indra/newview/skins/default/xui/en/floater_stats.xml        | 1 -
 indra/newview/skins/default/xui/en/floater_sys_well.xml     | 1 -
 indra/newview/skins/default/xui/en/floater_tools.xml        | 1 -
 indra/newview/skins/default/xui/en/floater_voice_effect.xml | 1 -
 indra/newview/skins/default/xui/en/panel_toast.xml          | 1 -
 24 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 40b550269ca..33548151fd8 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -195,7 +195,8 @@ LLFloater::Params::Params()
 	dock_pressed_image("dock_pressed_image"),
 	help_pressed_image("help_pressed_image"),
 	open_callback("open_callback"),
-	close_callback("close_callback")
+	close_callback("close_callback"),
+	follows("follows")
 {
 	changeDefault(visible, false);
 }
@@ -2965,6 +2966,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
 	 // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible
 	LLPanel::initFromParams(p);
 
+	// override any follows flags
+	setFollows(FOLLOWS_NONE);
+
 	mTitle = p.title;
 	mShortTitle = p.short_title;
 	applyTitle();
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index c70eb0958db..59b35d206f2 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -156,6 +156,8 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 		
 		Optional<CommitCallbackParam> open_callback,
 									  close_callback;
+
+		Ignored					follows;
 		
 		Params();
 	};
diff --git a/indra/newview/skins/default/xui/en/floater_activeim.xml b/indra/newview/skins/default/xui/en/floater_activeim.xml
index 670c528f083..b79c5d9a197 100644
--- a/indra/newview/skins/default/xui/en/floater_activeim.xml
+++ b/indra/newview/skins/default/xui/en/floater_activeim.xml
@@ -6,7 +6,6 @@
 	title="ACTIVE IM"
 	height="22"
 	width="320"
-	follows="right|bottom"
 	background_visible="true"
 	can_close="true"
 	can_dock="true"
diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml
index afb79170431..35918e9705d 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- follows="right"
  height="198"
  layout="topleft"
  name="build options floater"
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index 21fcc50f6e3..4673c6def59 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -6,7 +6,6 @@
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
- follows="bottom"
  height="164"
  layout="topleft"
  name="camera_floater"
diff --git a/indra/newview/skins/default/xui/en/floater_color_picker.xml b/indra/newview/skins/default/xui/en/floater_color_picker.xml
index 421f3a72c61..e06d10606a3 100644
--- a/indra/newview/skins/default/xui/en/floater_color_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_color_picker.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- follows="left|top"
  height="380"
  layout="topleft"
  name="ColorPicker"
diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml
index 7ed020f8323..cf61b7d24d4 100644
--- a/indra/newview/skins/default/xui/en/floater_event.xml
+++ b/indra/newview/skins/default/xui/en/floater_event.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- follows="all"
  height="400"
  can_resize="true"
  help_topic="event_details"
diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml
index a941734358c..b96a94a849b 100644
--- a/indra/newview/skins/default/xui/en/floater_gesture.xml
+++ b/indra/newview/skins/default/xui/en/floater_gesture.xml
@@ -9,7 +9,6 @@
  help_topic="gestures"
  title="GESTURES"
  background_visible="true"
- follows="all"
  label="Places"
  layout="topleft"
  min_height="350"
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 0ef6709f112..5fe8f3c1147 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -3,7 +3,6 @@
  legacy_header_height="18"
  background_visible="true"
  default_tab_group="1"
- follows="all"
  height="350"
  help_topic="floater_im_box"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
index 1f192f9b280..5cd7cd196dd 100644
--- a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
@@ -4,7 +4,6 @@
  bevel_style="none"
  border_style="line"
  can_resize="true"
- follows="left|top"
  height="580"
  layout="topleft"
  min_height="271"
diff --git a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml
index c9d87f158f4..e9676777f43 100644
--- a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml
+++ b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="left|top"
  height="400"
  layout="topleft"
  min_height="271"
diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml
index 31972d41224..3eeebcf1206 100644
--- a/indra/newview/skins/default/xui/en/floater_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_map.xml
@@ -4,7 +4,6 @@
  can_minimize="true" 
  can_resize="true"
  chrome="true"
- follows="top|right"
  height="200"
  layout="topleft"
  min_height="128"
diff --git a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml
index 28a29c42aac..fb7d09a21eb 100644
--- a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml
+++ b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- follows="left|top"
  height="175"
  layout="topleft"
  name="MemLeak"
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index 4d685ac8a99..065dab04131 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -7,7 +7,6 @@
  can_dock="false"
  can_minimize="true"
  can_close="true"
- follows="bottom"
  height="110"
  layout="topleft"
  name="move_floater"
diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml
index f35628f8e51..be3b2d179d5 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml
@@ -3,7 +3,6 @@
  legacy_header_height="18"
  can_resize="true"
  default_tab_group="1"
- follows="left|top"
  height="361"
  layout="topleft"
  min_height="243"
diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml
index 92d3a6702c1..137e278ddcf 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="left|top"
  height="350"
  layout="topleft"
  min_height="200"
diff --git a/indra/newview/skins/default/xui/en/floater_script.xml b/indra/newview/skins/default/xui/en/floater_script.xml
index 73e6d6147a3..bd4edb81c85 100644
--- a/indra/newview/skins/default/xui/en/floater_script.xml
+++ b/indra/newview/skins/default/xui/en/floater_script.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  background_visible="true"
- follows="left|top|right|bottom"
  height="250"
  layout="topleft"
  name="script_floater"
diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
index ce96ea232e9..b5dd2f97b92 100644
--- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
+++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="left|top|right|bottom"
  height="200"
  layout="topleft"
  name="script"
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 61f2e7e72d7..e71b714f257 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -4,7 +4,6 @@
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
- follows="left|top"
  height="500"
  layout="topleft"
  name="Snapshot"
diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml
index 406114294df..2fd932786bd 100644
--- a/indra/newview/skins/default/xui/en/floater_stats.xml
+++ b/indra/newview/skins/default/xui/en/floater_stats.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="top|right"
  height="400"
  layout="topleft"
  name="Statistics"
diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml
index 9b96a5badc7..ecedb274389 100644
--- a/indra/newview/skins/default/xui/en/floater_sys_well.xml
+++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  bevel_style="in"
- follows="right|bottom"
  layout="topleft"
  name="sys_well_window"
  help_topic="notification_chiclet"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index aa18c6e039c..f9147ea650c 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -2,7 +2,6 @@
 <floater
  open_positioning="cascading"
  legacy_header_height="18"
- follows="left|top|right"
  height="580"
  layout="topleft"
  bg_opaque_image="Window_NoTitle_Foreground"
diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
index 2c754cd8d0f..77fb21e27c5 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
@@ -7,7 +7,6 @@
  help_topic="voice_effects"
  title="VOICE MORPHING"
  background_visible="true"
- follows="all"
  label="Places"
  layout="topleft"
  min_height="360"
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index b9e714dd30c..062c403a26b 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -21,7 +21,6 @@
  width="310"
  left="0"
  top="0"
- follows="right|bottom"
  background_visible="false"
  bg_opaque_image="Toast_Over"
  bg_alpha_image="Toast_Background"
-- 
GitLab


From 494005c66e8627ce4a84f49ec3d2b11fb9949f7b Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 7 Dec 2011 11:49:50 -0800
Subject: [PATCH 381/933] toned down spammy error message when slplugin isn't
 working

---
 indra/newview/llviewermedia.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 263d8b41465..b43e002e0a9 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1955,7 +1955,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 		}
 	}
 	
-	LL_WARNS("Plugin") << "plugin intialization failed for mime type: " << media_type << LL_ENDL;
+	LL_WARNS_ONCE("Plugin") << "plugin intialization failed for mime type: " << media_type << LL_ENDL;
 	LLSD args;
 	args["MIME_TYPE"] = media_type;
 	LLNotificationsUtil::add("NoPlugin", args);
-- 
GitLab


From 9890e5cbed50c8388f8159a73c8ce672a61bd576 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Wed, 7 Dec 2011 21:37:08 +0000
Subject: [PATCH 382/933] STORM-1708 Darwin UI additions

---
 indra/newview/llfilepicker.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index d259e024525..ceb4060bc24 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -625,6 +625,14 @@ Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callB
 								result = false;
 							}
 						}
+						else if (filter == FFLOAD_SCRIPT)
+						{
+							if (fileInfo.filetype != 'LSL ' &&
+								(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("lsl"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) )
+							{
+								result = false;
+							}
+						}
 						
 						if (fileInfo.extension)
 						{
@@ -771,6 +779,12 @@ OSStatus	LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& fi
 			extension = CFSTR(".j2c");
 			break;
 		
+		case FFSAVE_SCRIPT:
+			type = 'LSL ';
+			creator = '\?\?\?\?';
+			extension = CFSTR(".lsl");
+			break;
+		
 		case FFSAVE_ALL:
 		default:
 			type = '\?\?\?\?';
-- 
GitLab


From f9f247c5a6f2f7d3b730244f8fc10c880cdb1bed Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 7 Dec 2011 16:36:26 -0600
Subject: [PATCH 383/933] SH-2084 Don't error out on framebuffer mismatch --
 probably causing a crash when some post-snapshot or minimize/restore
 operation gets out of phase.

---
 indra/llrender/llrendertarget.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 1aa12614ea1..ef2a7395dad 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -457,7 +457,8 @@ void LLRenderTarget::copyContents(LLRenderTarget& source, S32 srcX0, S32 srcY0,
 	gGL.flush();
 	if (!source.mFBO || !mFBO)
 	{
-		llerrs << "Cannot copy framebuffer contents for non FBO render targets." << llendl;
+		llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl;
+		return;
 	}
 
 	
-- 
GitLab


From e0a994d1f298b109dfac4cfd592e631d453f3045 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 7 Dec 2011 15:48:57 -0700
Subject: [PATCH 384/933] fix for SH-2516: Full Bright Geometry Rendering
 Increases Rapidly, Destroying Frame Rate.

---
 indra/newview/llviewertexture.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 126d0f75e86..61236edc86e 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -3163,8 +3163,13 @@ void LLViewerLODTexture::processTextureStats()
 		S32 current_discard = getDiscardLevel();
 		if (sDesiredDiscardBias > 0.0f && mBoostLevel < LLViewerTexture::BOOST_SCULPTED && current_discard >= 0)
 		{
+			if(desired_discard_bias_max <= sDesiredDiscardBias && !mForceToSaveRawImage)
+			{
+				//needs to release texture memory urgently
+				scaleDown() ;
+			}
 			// Limit the amount of GL memory bound each frame
-			if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale &&
+			else if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale &&
 				(!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel))
 			{
 				scaleDown() ;
-- 
GitLab


From e860925818fe9376fa9abb0520680dba986ab42e Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 7 Dec 2011 15:03:45 -0800
Subject: [PATCH 385/933] Crash workaround when opening toats windows after a
 long session.

---
 indra/llui/llview.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 486babb0ab9..d2966fbe989 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1090,6 +1090,11 @@ void LLView::drawChildren()
 		{
 			child_list_reverse_iter_t child = child_iter++;
 			LLView *viewp = *child;
+			
+			if (viewp == NULL)
+			{
+				continue;
+			}
 
 			if (viewp->getVisible() && viewp->getRect().isValid())
 			{
-- 
GitLab


From 35020db3a9310742c9759673e3aa1bbb1d7aa02f Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 7 Dec 2011 15:04:39 -0800
Subject: [PATCH 386/933] Refactored marketplace inventory import HTTP requests
 and surrounding support to remove it from the UI panel code.

---
 indra/newview/llappviewer.cpp              |   4 +
 indra/newview/llmarketplacefunctions.cpp   | 302 ++++++++++++++++++--
 indra/newview/llmarketplacefunctions.h     |  43 ++-
 indra/newview/llpanelmarketplaceoutbox.cpp | 304 +++------------------
 indra/newview/llpanelmarketplaceoutbox.h   |  14 +-
 5 files changed, 362 insertions(+), 305 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index cbaddd74c4a..401e9ef6007 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -45,6 +45,7 @@
 #include "llwindow.h"
 #include "llviewerstats.h"
 #include "llviewerstatsrecorder.h"
+#include "llmarketplacefunctions.h"
 #include "llmd5.h"
 #include "llmeshrepository.h"
 #include "llpumpio.h"
@@ -4393,6 +4394,9 @@ void LLAppViewer::idle()
 
 	// update media focus
 	LLViewerMediaFocus::getInstance()->update();
+	
+	// Update marketplace importer
+	LLMarketplaceInventoryImporter::update();
 
 	// objects and camera should be in sync, do LOD calculations now
 	{
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 2f8c5bc9ee5..b9e02a36b49 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -29,52 +29,312 @@
 #include "llmarketplacefunctions.h"
 
 #include "llagent.h"
+#include "llhttpclient.h"
+#include "llviewermedia.h"
 #include "llviewernetwork.h"
 
 
-std::string getMarketplaceBaseURL()
+//
+// Helpers
+//
+
+namespace LLMarketplaceImport
 {
-	std::string url = "https://marketplace.secondlife.com/";
+	// Basic interface for this namespace
+
+	bool inProgress();
+	bool resultPending();
+	U32 getResultStatus();
+	const LLSD& getResults();
+
+	void establishMarketplaceSessionCookie();
+	void pollStatus();
+	void triggerImport();
+	
+	// Internal state variables
+
+	static std::string sMarketplaceCookie = "";
+	static bool sImportInProgress = false;
+	static bool sImportGetPending = false;
+	static U32 sImportResultStatus = 0;
+	static LLSD sImportResults = LLSD::emptyMap();
+		
+	
+	// Internal helper functions
+	
+	std::string getBaseURL()
+	{
+		std::string url = "https://marketplace.secondlife.com/";
+
+		if (!LLGridManager::getInstance()->isInProductionGrid())
+		{
+			std::string gridLabel = utf8str_tolower(LLGridManager::getInstance()->getGridLabel());
+			
+			if (gridLabel == "damballah")
+			{
+				url = "https://marketplace.secondlife-staging.com/";
+			}
+			else
+			{
+				url = llformat("https://marketplace.%s.lindenlab.com/", gridLabel.c_str());
+			}
+		}
+
+		url += "api/1/";
+		url += gAgent.getID().getString();
+		url += "/inventory/";
+
+		return url;
+	}
+
+	std::string getInventoryImportURL()
+	{
+		std::string url = getBaseURL();
 
-	if (!LLGridManager::getInstance()->isInProductionGrid())
+		url += "import/";
+
+		return url;
+	}
+	
+	// Responders
+	
+	class LLImportPostResponder : public LLHTTPClient::Responder
+	{
+	public:
+		LLImportPostResponder() : LLCurl::Responder() {}
+		
+		void completed(U32 status, const std::string& reason, const LLSD& content)
+		{
+			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
+			sImportResultStatus = status;
+		}
+	};
+	
+	class LLImportGetResponder : public LLHTTPClient::Responder
+	{
+	public:
+		LLImportGetResponder() : LLCurl::Responder() {}
+		
+		void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+		{
+			sMarketplaceCookie = content["set-cookie"].asString();
+		}
+		
+		void completed(U32 status, const std::string& reason, const LLSD& content)
+		{
+			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
+			sImportGetPending = false;
+			sImportResultStatus = status;
+			sImportResults = content;
+		}
+	};
+	
+	// Coroutine testing
+/*
+	std::string gTimeDelayDebugFunc = "";
+	
+	void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
 	{
-		std::string gridLabel = utf8str_tolower(LLGridManager::getInstance()->getGridLabel());
+		waitForEventOn(self, "mainloop");
+		
+		LLTimer delayTimer;
+		delayTimer.reset();
+		delayTimer.setTimerExpirySec(5.0f);
 		
-		if (gridLabel == "damballah")
+		while (!delayTimer.hasExpired())
 		{
-			url = "https://marketplace.secondlife-staging.com/";
+			waitForEventOn(self, "mainloop");
 		}
-		else
+		
+		outboxPanel->onImportPostComplete(MarketplaceErrorCodes::IMPORT_DONE, LLSD::emptyMap());
+		
+		gTimeDelayDebugFunc = "";
+	}
+	
+	std::string gImportPollingFunc = "";
+	
+	void importPoll(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
+	{
+		waitForEventOn(self, "mainloop");
+		
+		while (outboxPanel->isImportInProgress())
 		{
-			url = llformat("https://marketplace.%s.lindenlab.com/", gridLabel.c_str());
+			LLTimer delayTimer;
+			delayTimer.reset();
+			delayTimer.setTimerExpirySec(5.0f);
+			
+			while (!delayTimer.hasExpired())
+			{
+				waitForEventOn(self, "mainloop");
+			}
+			
+			//outboxPanel->
 		}
+		
+		gImportPollingFunc = "";
 	}
+	
+*/	
+	
+	// Basic API
 
-	url += "api/1/";
-	url += gAgent.getID().getString();
-	url += "/inventory/";
+	bool inProgress()
+	{
+		return sImportInProgress;
+	}
+	
+	bool resultPending()
+	{
+		return sImportGetPending;
+	}
+	
+	U32 getResultStatus()
+	{
+		return sImportResultStatus;
+	}
+	
+	const LLSD& getResults()
+	{
+		return sImportResults;
+	}
+	
+	void establishMarketplaceSessionCookie()
+	{
+		sImportInProgress = true;
+		sImportGetPending = true;
+		
+		std::string url = getInventoryImportURL();
+		
+		LLHTTPClient::get(url, new LLImportGetResponder(), LLViewerMedia::getHeaders());
+	}
+	
+	void pollStatus()
+	{
+		sImportGetPending = true;
 
-	return url;
+		std::string url = getInventoryImportURL();
+
+		// Make the headers for the post
+		LLSD headers = LLSD::emptyMap();
+		headers["Accept"] = "*/*";
+		headers["Cookie"] = sMarketplaceCookie;
+		headers["Content-Type"] = "application/xml";
+		headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
+		
+		LLHTTPClient::get(url, new LLImportGetResponder(), headers);
+	}
+	
+	void triggerImport()
+	{
+		sImportInProgress = true;		
+		sImportResultStatus = MarketplaceErrorCodes::IMPORT_PROCESSING;
+		sImportResults = LLSD::emptyMap();
+
+		std::string url = getInventoryImportURL();
+		
+		// Make the headers for the post
+		LLSD headers = LLSD::emptyMap();
+		headers["Accept"] = "*/*";
+		headers["Connection"] = "Keep-Alive";
+		headers["Cookie"] = sMarketplaceCookie;
+		headers["Content-Type"] = "application/xml";
+		headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
+		
+		LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers);
+		
+		// Set a timer (for testing only)
+		//gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
+	}
 }
 
-std::string getMarketplaceURL_InventoryImport()
+
+//
+// Interface class
+//
+
+
+//static
+void LLMarketplaceInventoryImporter::update()
 {
-	std::string url = getMarketplaceBaseURL();
+	if (instanceExists())
+	{
+		LLMarketplaceInventoryImporter::instance().updateImport();
+	}
+}
 
-	url += "import/";
+LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter()
+	: mImportInProgress(false)
+	, mInitialized(false)
+	, mStatusChangedSignal(NULL)
+	, mStatusReportSignal(NULL)
+{
+}
 
-	return url;
+void LLMarketplaceInventoryImporter::initialize()
+{
+	if (!mInitialized)
+	{
+		LLMarketplaceImport::establishMarketplaceSessionCookie();
+	}
 }
 
+boost::signals2::connection LLMarketplaceInventoryImporter::setStatusChangedCallback(const status_changed_signal_t::slot_type& cb)
+{
+	if (mStatusChangedSignal == NULL)
+	{
+		mStatusChangedSignal = new status_changed_signal_t();
+	}
 
-static bool gMarketplaceImportEnabled = true;
+	return mStatusChangedSignal->connect(cb);
+}
 
-bool getMarketplaceImportEnabled()
+boost::signals2::connection LLMarketplaceInventoryImporter::setStatusReportCallback(const status_report_signal_t::slot_type& cb)
 {
-	return gMarketplaceImportEnabled;
+	if (mStatusReportSignal == NULL)
+	{
+		mStatusReportSignal = new status_report_signal_t();
+	}
+
+	return mStatusReportSignal->connect(cb);
 }
 
-void setMarketplaceImportEnabled(bool importEnabled)
+bool LLMarketplaceInventoryImporter::triggerImport()
 {
-	gMarketplaceImportEnabled = importEnabled;
+	LLMarketplaceImport::triggerImport();
+	
+	return LLMarketplaceImport::inProgress();
 }
+
+void LLMarketplaceInventoryImporter::updateImport()
+{
+	const bool in_progress = LLMarketplaceImport::inProgress();
+	
+	if (in_progress && !LLMarketplaceImport::resultPending())
+	{
+		LLMarketplaceImport::pollStatus();
+	}	
+	
+	if (mImportInProgress != in_progress)
+	{
+		mImportInProgress = in_progress;
+		
+		if (mStatusChangedSignal)
+		{
+			(*mStatusChangedSignal)(mImportInProgress);
+		}
+		
+		// If we are no longer in progress, report results
+		if (!mImportInProgress && mStatusReportSignal)
+		{
+			if (mInitialized)
+			{
+				(*mStatusReportSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
+			}
+			else
+			{
+				mInitialized = true;
+			}
+		}
+	}
+}
+
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index fda2fbb935d..5ca0bdfe776 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -29,14 +29,16 @@
 #define LL_LLMARKETPLACEFUNCTIONS_H
 
 
-std::string getMarketplaceURL_InventoryImport();
+#include <llsd.h>
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+#include "llsingleton.h"
 
-bool getMarketplaceImportEnabled();
-void setMarketplaceImportEnabled(bool syncEnabled);
 
 namespace MarketplaceErrorCodes
 {
-	enum eCodes
+	enum eCode
 	{
 		IMPORT_DONE = 200,
 		IMPORT_PROCESSING = 202,
@@ -45,7 +47,38 @@ namespace MarketplaceErrorCodes
 	};
 }
 
-#endif // LL_LLMARKETPLACEFUNCTIONS_H
 
+class LLMarketplaceInventoryImporter
+	: public LLSingleton<LLMarketplaceInventoryImporter>
+{
+public:
+	static void update();
+	
+	LLMarketplaceInventoryImporter();
+	
+	void initialize();
+
+	typedef boost::signals2::signal<void (bool)> status_changed_signal_t;
+	typedef boost::signals2::signal<void (U32, const LLSD&)> status_report_signal_t;
 
+	boost::signals2::connection setStatusChangedCallback(const status_changed_signal_t::slot_type& cb);
+	boost::signals2::connection setStatusReportCallback(const status_report_signal_t::slot_type& cb);
+	
+	bool triggerImport();
+	bool isImportInProgress() const { return mImportInProgress; }
+	
+protected:
+	void updateImport();
+	
+private:
+	bool mImportInProgress;
+	bool mInitialized;
+	
+	status_changed_signal_t *	mStatusChangedSignal;
+	status_report_signal_t *	mStatusReportSignal;
+};
+
+
+
+#endif // LL_LLMARKETPLACEFUNCTIONS_H
 
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index d7e4ed8bec2..e3af7fd9066 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -55,8 +55,6 @@
 
 static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
 
-static std::string sMarketplaceCookie = "";
-
 const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() 
 { 
 	return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceOutbox>(); 
@@ -67,10 +65,7 @@ LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox(const Params& p)
 	: LLPanel(p)
 	, mInventoryPanel(NULL)
 	, mImportButton(NULL)
-	, mImportFrameTimer(0)
-	, mImportGetPending(false)
 	, mImportIndicator(NULL)
-	, mImportInProgress(false)
 	, mOutboxButton(NULL)
 {
 }
@@ -93,7 +88,7 @@ void LLPanelMarketplaceOutbox::handleLoginComplete()
 {
 	mImportButton = getChild<LLButton>("outbox_import_btn");
 	mImportButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onImportButtonClicked, this));
-	mImportButton->setEnabled(getMarketplaceImportEnabled() && !isOutboxEmpty());
+	mImportButton->setEnabled(!isOutboxEmpty());
 	
 	mImportIndicator = getChild<LLLoadingIndicator>("outbox_import_indicator");
 	
@@ -147,286 +142,73 @@ LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
 	// Hide the placeholder text
 	outbox_inventory_placeholder->setVisible(FALSE);
 	
-	// Establish marketplace cookies for http client
-	establishMarketplaceSessionCookie();
+	// Set up marketplace importer
+	LLMarketplaceInventoryImporter::getInstance()->initialize();
+	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLPanelMarketplaceOutbox::importStatusChanged, this, _1));
+	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLPanelMarketplaceOutbox::importReportResults, this, _1, _2));
 	
 	updateImportButtonStatus();
 	
 	return mInventoryPanel;
 }
 
-BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
-								   EDragAndDropType cargo_type,
-								   void* cargo_data,
-								   EAcceptance* accept,
-								   std::string& tooltip_msg)
+void LLPanelMarketplaceOutbox::importReportResults(U32 status, const LLSD& content)
 {
-	BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
-
-	if (!handled && mInventoryPanel && mInventoryPanel->getRootFolder())
+	if (status == MarketplaceErrorCodes::IMPORT_DONE)
 	{
-		handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
-
-		if (handled)
-		{
-			mInventoryPanel->getRootFolder()->setDragAndDropThisFrame();
-		}
+		LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap());
 	}
-
-	return handled;
-}
-
-bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
-{
-	return (getTotalItemCount() == 0);
-}
-
-bool LLPanelMarketplaceOutbox::isImportInProgress() const
-{
-	return mImportInProgress;
-}
-
-
-std::string gTimeDelayDebugFunc = "";
-
-void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
-{
-	waitForEventOn(self, "mainloop");
-
-	LLTimer delayTimer;
-	delayTimer.reset();
-	delayTimer.setTimerExpirySec(5.0f);
-
-	while (!delayTimer.hasExpired())
+	else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
 	{
-		waitForEventOn(self, "mainloop");
+		LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
 	}
-
-	outboxPanel->onImportPostComplete(MarketplaceErrorCodes::IMPORT_DONE, LLSD::emptyMap());
-
-	gTimeDelayDebugFunc = "";
-}
-
-std::string gImportPollingFunc = "";
-
-void importPoll(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
-{
-	waitForEventOn(self, "mainloop");
-	
-	while (outboxPanel->isImportInProgress())
+	else
 	{
-		LLTimer delayTimer;
-		delayTimer.reset();
-		delayTimer.setTimerExpirySec(5.0f);
+		char status_string[16];
+		sprintf(status_string, "%d", status);
 		
-		while (!delayTimer.hasExpired())
-		{
-			waitForEventOn(self, "mainloop");
-		}
+		LLSD subs;
+		subs["ERROR_CODE"] = status_string;
 		
-		//outboxPanel->
+		//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
+		LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
 	}
-	
-	gImportPollingFunc = "";
 }
 
-class LLInventoryImportPostResponder : public LLHTTPClient::Responder
+void LLPanelMarketplaceOutbox::importStatusChanged(bool inProgress)
 {
-public:
-	LLInventoryImportPostResponder(LLPanelMarketplaceOutbox * outboxPanel)
-		: LLCurl::Responder()
-		, mOutboxPanel(outboxPanel)
-	{
-	}
-	
-	void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-#if DEBUG_MARKETPLACE_HTTP_API
-		llinfos << "*** Marketplace *** " << "inventory/import post status: " << status << ", reason: " << reason << llendl;
-		
-		if (isGoodStatus(status))
-		{
-			// Complete success
-			llinfos << "*** Marketplace *** " << "success" << llendl;
-		}	
-		else
-		{
-			llwarns << "*** Marketplace *** " << "failed" << llendl;
-		}
-#endif // DEBUG_MARKETPLACE_HTTP_API
-		
-		mOutboxPanel->onImportPostComplete(status, content);
-	}
-
-private:
-	LLPanelMarketplaceOutbox *	mOutboxPanel;	
-};
+	updateImportButtonStatus();
+}
 
-class LLInventoryImportGetResponder : public LLHTTPClient::Responder
+BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+								   EDragAndDropType cargo_type,
+								   void* cargo_data,
+								   EAcceptance* accept,
+								   std::string& tooltip_msg)
 {
-public:
-	LLInventoryImportGetResponder(LLPanelMarketplaceOutbox * outboxPanel, bool ignoreResults)
-		: LLCurl::Responder()
-		, mIgnoreResults(ignoreResults)
-		, mOutboxPanel(outboxPanel)
-	{
-	}
+	BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 
-	void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	if (!handled && mInventoryPanel && mInventoryPanel->getRootFolder())
 	{
-		std::string cookie = content["set-cookie"].asString();
-		
-#if DEBUG_MARKETPLACE_HTTP_API
-		llinfos << "*** Marketplace *** " << "inventory/import headers set-cookie: " << cookie << llendl;
-#endif // DEBUG_MARKETPLACE_HTTP_API
-		
-		sMarketplaceCookie = cookie;
-	}
+		handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
 
-	void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-#if DEBUG_MARKETPLACE_HTTP_API
-		llinfos << "*** Marketplace *** " << "inventory/import get status: " << status << ", reason: " << reason << llendl;
-		
-		if (isGoodStatus(status))
-		{
-			// Complete success
-			llinfos << "*** Marketplace *** " << "success" << llendl;
-		}	
-		else
+		if (handled)
 		{
-			llwarns << "*** Marketplace *** " << "failed" << llendl;
+			mInventoryPanel->getRootFolder()->setDragAndDropThisFrame();
 		}
-#endif // DEBUG_MARKETPLACE_HTTP_API
-
-		mOutboxPanel->onImportGetComplete(status, content, mIgnoreResults);
-	}
-
-private:
-	bool						mIgnoreResults;
-	LLPanelMarketplaceOutbox *	mOutboxPanel;
-};
-
-void LLPanelMarketplaceOutbox::importPostTrigger()
-{
-	mImportInProgress = true;
-	mImportFrameTimer = 0;
-	
-	// Make the url for the inventory import request
-	std::string url = getMarketplaceURL_InventoryImport();
-	
-	LLSD headers = LLViewerMedia::getHeaders();
-	headers["Connection"] = "Keep-Alive";
-	headers["Cookie"] = sMarketplaceCookie;
-	
-#if DEBUG_MARKETPLACE_HTTP_API
-	llinfos << "*** Marketplace *** " << "http post:  " << url << llendl;
-	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
-#endif // DEBUG_MARKETPLACE_HTTP_API
-	
-	LLHTTPClient::post(url, LLSD(), new LLInventoryImportPostResponder(this), headers);
-	
-	// Set a timer (for testing only)
-    //gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
-}
-
-void LLPanelMarketplaceOutbox::importGetTrigger()
-{
-	mImportGetPending = true;
-	
-	std::string url = getMarketplaceURL_InventoryImport();
-	LLSD headers = LLViewerMedia::getHeaders();
-	headers["Cookie"] = sMarketplaceCookie;
-	
-#if DEBUG_MARKETPLACE_HTTP_API
-	llinfos << "*** Marketplace *** " << "http get:  " << url << llendl;
-	llinfos << "*** Marketplace *** " << "headers: " << ll_pretty_print_sd(headers) << llendl;
-#endif // DEBUG_MARKETPLACE_HTTP_API
-	
-	const bool do_not_ignore_results = false;
-	
-	LLHTTPClient::get(url, new LLInventoryImportGetResponder(this, do_not_ignore_results), headers);
-}
-
-void LLPanelMarketplaceOutbox::establishMarketplaceSessionCookie()
-{
-	mImportInProgress = true;
-	mImportGetPending = true;
-	
-	std::string url = getMarketplaceURL_InventoryImport();
-	LLSD headers = LLViewerMedia::getHeaders();
-	
-	const bool ignore_results = true;
-	
-	LLHTTPClient::get(url, new LLInventoryImportGetResponder(this, ignore_results), headers);
-}
-
-void LLPanelMarketplaceOutbox::onImportPostComplete(U32 status, const LLSD& content)
-{
-#if DEBUG_MARKETPLACE_HTTP_API
-	llinfos << "*** Marketplace *** " << "status = " << status << llendl;
-	llinfos << "*** Marketplace *** " << "content = " << ll_pretty_print_sd(content) << llendl;
-#endif // DEBUG_MARKETPLACE_HTTP_API
-
-	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
-	updateImportButtonStatus();
-	
-	if (!mImportInProgress)
-	{
-		char status_string[16];
-		sprintf(status_string, "%d", status);
-
-		LLSD subs;
-		subs["ERROR_CODE"] = status_string;
-
-		LLNotificationsUtil::add("OutboxImportFailed", subs, LLSD::emptyMap());
 	}
 
-	// The POST request returns the IMPORT_DONE code on success
-	//if (status == MarketplaceErrorCodes::IMPORT_DONE)
-	//{
-	//	gImportPollingFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox importPoll", boost::bind(&importPoll, _1, this));
-	//}
+	return handled;
 }
 
-void LLPanelMarketplaceOutbox::onImportGetComplete(U32 status, const LLSD& content, bool ignoreResults)
+bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
 {
-#if DEBUG_MARKETPLACE_HTTP_API
-	llinfos << "*** Marketplace *** " << "status = " << status << llendl;
-	llinfos << "*** Marketplace *** " << "content = " << ll_pretty_print_sd(content) << llendl;
-#endif // DEBUG_MARKETPLACE_HTTP_API
-
-	mImportGetPending = false;	
-	mImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
-	updateImportButtonStatus();
-	
-	if (!mImportInProgress && !ignoreResults)
-	{
-		if (status == MarketplaceErrorCodes::IMPORT_DONE)
-		{
-			LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap());
-		}
-		else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
-		{
-			LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
-		}
-		else
-		{
-			char status_string[16];
-			sprintf(status_string, "%d", status);
-			
-			LLSD subs;
-			subs["ERROR_CODE"] = status_string;
-			
-			//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
-			LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
-		}
-	}
+	return (getTotalItemCount() == 0);
 }
 
 void LLPanelMarketplaceOutbox::updateImportButtonStatus()
 {
-	if (isImportInProgress())
+	if (LLMarketplaceInventoryImporter::instance().isImportInProgress())
 	{
 		mImportButton->setVisible(false);
 
@@ -440,7 +222,7 @@ void LLPanelMarketplaceOutbox::updateImportButtonStatus()
 		mImportIndicator->setVisible(false);
 
 		mImportButton->setVisible(true);
-		mImportButton->setEnabled(getMarketplaceImportEnabled() && !isOutboxEmpty());
+		mImportButton->setEnabled(!isOutboxEmpty());
 	}
 }
 
@@ -464,7 +246,7 @@ U32 LLPanelMarketplaceOutbox::getTotalItemCount() const
 
 void LLPanelMarketplaceOutbox::onImportButtonClicked()
 {
-	importPostTrigger();
+	LLMarketplaceInventoryImporter::instance().triggerImport();
 	
 	// Get the import animation going
 	updateImportButtonStatus();
@@ -488,19 +270,5 @@ void LLPanelMarketplaceOutbox::draw()
 		mOutboxButton->setLabel(getString("OutboxLabelNoArg"));
 	}
 	
-	if (!isImportInProgress())
-	{
-		mImportButton->setEnabled(getMarketplaceImportEnabled() && not_empty);
-	}
-	else
-	{
-		++mImportFrameTimer;
-		
-		if ((mImportFrameTimer % 50 == 0) && !mImportGetPending)
-		{
-			importGetTrigger();
-		}
-	}
-	
 	LLPanel::draw();
 }
diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h
index 9cbb9cf21b2..6f038118b3b 100644
--- a/indra/newview/llpanelmarketplaceoutbox.h
+++ b/indra/newview/llpanelmarketplaceoutbox.h
@@ -59,10 +59,6 @@ class LLPanelMarketplaceOutbox : public LLPanel
 	U32 getTotalItemCount() const;
 
 	bool isOutboxEmpty() const;
-	bool isImportInProgress() const;
-
-	void onImportPostComplete(U32 status, const LLSD& content);
-	void onImportGetComplete(U32 status, const LLSD& content, bool ignoreResults);
 
 	/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 								   EDragAndDropType cargo_type,
@@ -78,18 +74,14 @@ class LLPanelMarketplaceOutbox : public LLPanel
 	void onFocusReceived();
 	void onSelectionChange();
 	
-	void importPostTrigger();
-	void importGetTrigger();
-	void establishMarketplaceSessionCookie();
-
+	void importReportResults(U32 status, const LLSD& content);
+	void importStatusChanged(bool inProgress);
+	
 private:
 	LLInventoryPanel *		mInventoryPanel;
 
 	LLButton *				mImportButton;
-	U32						mImportFrameTimer;
-	bool					mImportGetPending;
 	LLLoadingIndicator *	mImportIndicator;
-	bool					mImportInProgress;
 	
 	LLButton *				mOutboxButton;
 };
-- 
GitLab


From ea46848821eccfaf27bee43b6ed3181f1818e517 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 7 Dec 2011 15:51:31 -0800
Subject: [PATCH 387/933] sync with viewer-development

---
 indra/newview/skins/default/xui/en/menu_viewer.xml          | 6 ------
 indra/newview/skins/default/xui/en/notifications.xml        | 4 ++--
 .../newview/skins/default/xui/en/panel_region_covenant.xml  | 4 ++--
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index c8c1922bf67..3a581e7e6e8 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1723,12 +1723,6 @@
                  function="Tools.EnableReleaseKeys"
                  parameter="" />
             </menu_item_call>
-            <menu_item_call
-             label="Set UI Size to Default"
-             name="Set UI Size to Default">
-                <menu_item_call.on_click
-                 function="View.DefaultUISize" />
-            </menu_item_call>
             <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
             <menu_item_check
                label="Show Advanced Menu - legacy shortcut"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e4458f33b17..4e4eea03547 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6939,7 +6939,7 @@ With the following Residents:
 	<usetemplate
      name="okcancelbuttons"
      notext="Cancel"
-     yestext="Ok"/>
+     yestext="OK"/>
   </notification>
   
   <notification
@@ -7135,7 +7135,7 @@ Mute everyone?
     <usetemplate
      ignoretext="Confirm before I mute all participants in a group call"
      name="okcancelignore"
-     yestext="Ok"
+     yestext="OK"
      notext="Cancel">
       <unique/>
     </usetemplate>
diff --git a/indra/newview/skins/default/xui/en/panel_region_covenant.xml b/indra/newview/skins/default/xui/en/panel_region_covenant.xml
index df16f6fd373..112f12500df 100644
--- a/indra/newview/skins/default/xui/en/panel_region_covenant.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_covenant.xml
@@ -57,7 +57,7 @@
      mouse_opaque="false"
      name="estate_name_text"
      top_delta="0"
-     width="150">
+     width="350">
         mainland
     </text>
     <text
@@ -79,7 +79,7 @@
      mouse_opaque="false"
      name="estate_owner_text"
      top_delta="0"
-     width="150">
+     width="350">
         (none)
     </text>
     <text
-- 
GitLab


From 1df76279212aef112356570356e4c195490fec3b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 7 Dec 2011 16:37:51 -0800
Subject: [PATCH 388/933] EXP-1675 POTENTIAL FIX -- Changed default min window
 width and height to 0 instead of max size.

Reviewed by Richard.
---
 indra/llwindow/llwindow.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 0e17cffc9d5..de7ce3db776 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -111,8 +111,8 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags)
 	  mCursorHidden(FALSE),
 	  mBusyCount(0),
 	  mIsMouseClipping(FALSE),
-	  mMinWindowWidth(S32_MAX),		// just a sanity check - actual minimum size is stored in settings.xml
-	  mMinWindowHeight(S32_MAX),
+	  mMinWindowWidth(0),
+	  mMinWindowHeight(0),
 	  mSwapMethod(SWAP_METHOD_UNDEFINED),
 	  mHideCursorPermanent(FALSE),
 	  mFlags(flags),
-- 
GitLab


From 468543c944b073af41a3cf7f6dfe73f097c2eb2d Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Thu, 8 Dec 2011 10:33:23 +0000
Subject: [PATCH 389/933] Reverting the changes to default script which leaked
 in from another project ;-)

---
 indra/newview/llpreviewscript.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 0a429269ba7..62603a2e079 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -90,15 +90,15 @@
 const std::string HELLO_LSL =
 	"default\n"
 	"{\n"
-	"	state_entry()\n"
-    "	{\n"
-    "		llOwnerSay(\"Hello, Avatar!\");\n"
-    "	}\n"
+	"    state_entry()\n"
+    "    {\n"
+    "        llSay(0, \"Hello, Avatar!\");\n"
+    "    }\n"
 	"\n"
-	"	touch_start(integer total_number)\n"
-	"	{\n"
-	"		llSay(llDetectedKey(0), \"Touched.\");\n"
-	"	}\n"
+	"    touch_start(integer total_number)\n"
+	"    {\n"
+	"        llSay(0, \"Touched.\");\n"
+	"    }\n"
 	"}\n";
 const std::string HELP_LSL_PORTAL_TOPIC = "LSL_Portal";
 
-- 
GitLab


From 1231c86d2fc1f4a93c97e9c42e58c917f71b6718 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 8 Dec 2011 13:09:55 +0200
Subject: [PATCH 390/933] EXP-1674 FIXED Disabled chrome for profile windows;
 adjusted floater height accordingly.

---
 indra/newview/app_settings/settings.xml | 2 +-
 indra/newview/llfloaterwebprofile.cpp   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 67724831bce..c1a3f8480d3 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13435,7 +13435,7 @@
       <key>Value</key>
       <array>
         <integer>0</integer>
-        <integer>730</integer>
+        <integer>680</integer>
         <integer>485</integer>
         <integer>0</integer>
         </array>
diff --git a/indra/newview/llfloaterwebprofile.cpp b/indra/newview/llfloaterwebprofile.cpp
index 7ee7b5172c3..c41f6f148f3 100644
--- a/indra/newview/llfloaterwebprofile.cpp
+++ b/indra/newview/llfloaterwebprofile.cpp
@@ -38,6 +38,8 @@ LLFloaterWebProfile::LLFloaterWebProfile(const Params& key) :
 void LLFloaterWebProfile::onOpen(const LLSD& key)
 {
 	Params p(key);
+	p.show_chrome(false).
+		window_class("profile");
 	LLFloaterWebContent::onOpen(p);
 	applyPreferredRect();
 }
@@ -60,8 +62,6 @@ LLFloater* LLFloaterWebProfile::create(const LLSD& key)
 {
 	LLFloaterWebContent::Params p(key);
 	preCreate(p);
-	p.show_chrome(false).
-		window_class("profile");
 	return new LLFloaterWebProfile(p);
 }
 
-- 
GitLab


From b9753f83d23b2fa0e139e2f2027d1979a1863f9c Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 8 Dec 2011 14:43:20 +0200
Subject: [PATCH 391/933] EXP-1655 FIXED Text got cut off on Email Settings ->
 Image Quality.

---
 .../newview/skins/default/xui/en/panel_postcard_settings.xml  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index aebbc51be1f..2e0bb88f530 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -113,11 +113,11 @@
              label="Image quality"
              label_width="80"
              layout="topleft"
-             left="10"
+             left="0"
              max_val="100"
              name="image_quality_slider"
              top_pad="7"
-             width="200" />
+             width="190" />
             <text
              type="string"
              follows="left|top"
-- 
GitLab


From 8ba11929456ef471c7916d1b4ac331f4553f2b1d Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 8 Dec 2011 14:48:06 +0200
Subject: [PATCH 392/933] EXP-1657 FIXED Change success/failure message text on
 posting to profile feed.

---
 indra/newview/skins/default/xui/en/floater_snapshot.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 61f2e7e72d7..3f2b94dd73e 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -35,7 +35,7 @@
     </string>
  	<string
  	 name="profile_succeeded_str">
- 	    Profile feed updated!
+ 	    Image uploaded
  	</string>
  	<string
  	 name="postcard_succeeded_str">
@@ -51,7 +51,7 @@
  	</string>
  	<string
  	 name="profile_failed_str">
- 	    Failed to update your Profile Feed.
+ 	    Failed to upload image to your Profile Feed.
  	</string>
  	<string
  	 name="postcard_failed_str">
-- 
GitLab


From f75708a9c8a549da0f243d47cc02208821dab5ef Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 8 Dec 2011 18:48:22 +0200
Subject: [PATCH 393/933] EXP-1598 FIXED (items from a second inventory window
 cannot be shared)

- Now select proper inventory floater (from all opened inventory floaters) to share items from.
---
 indra/newview/llinventorypanel.cpp     | 27 ++++++++++----------------
 indra/newview/llpanelmaininventory.cpp |  9 ++++++++-
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index d06374d2323..80b53d5702a 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1105,30 +1105,23 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
 		return FALSE;
 	}
 
-	LLSidepanelInventory *sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
+	LLSidepanelInventory *inventory_panel =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
 
-	// A. If the inventory side panel floater is open, use that preferably.
-	if (is_inventorysp_active())
-	{
-		// Get the floater's z order to compare it to other inventory floaters' order later.
-		res = sidepanel_inventory->getActivePanel();
-		z_min = gFloaterView->getZOrder(floater_inventory);
-		active_inv_floaterp = floater_inventory;
-	}
-
-	// B. Iterate through the inventory floaters and return whichever is on top.
+	// Iterate through the inventory floaters and return whichever is on top.
 	LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory");
 	for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
 	{
-		LLFloaterInventory* iv = dynamic_cast<LLFloaterInventory*>(*iter);
-		if (iv && iv->getVisible())
+		LLFloaterSidePanelContainer* inventory_floater = dynamic_cast<LLFloaterSidePanelContainer*>(*iter);
+		inventory_panel = inventory_floater->findChild<LLSidepanelInventory>("main_panel");
+
+		if (inventory_floater && inventory_panel && inventory_floater->getVisible())
 		{
-			S32 z_order = gFloaterView->getZOrder(iv);
+			S32 z_order = gFloaterView->getZOrder(inventory_floater);
 			if (z_order < z_min)
 			{
-				res = iv->getPanel();
+				res = inventory_panel->getActivePanel();
 				z_min = z_order;
-				active_inv_floaterp = iv;
+				active_inv_floaterp = inventory_floater;
 			}
 		}
 	}
@@ -1145,7 +1138,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
 	{
 		floater_inventory->openFloater();
 
-		res = sidepanel_inventory->getActivePanel();
+		res = inventory_panel->getActivePanel();
 	}
 
 	return res;
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 9944b51902d..68ef13cd68e 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -28,6 +28,7 @@
 #include "llpanelmaininventory.h"
 
 #include "llagent.h"
+#include "llagentcamera.h"
 #include "llavataractions.h"
 #include "lldndbutton.h"
 #include "lleconomy.h"
@@ -294,7 +295,13 @@ void LLPanelMainInventory::closeAllFolders()
 
 void LLPanelMainInventory::newWindow()
 {
-	LLFloaterInventory::showAgentInventory();
+	static S32 instance_num = 0;
+	instance_num = (instance_num + 1) % S32_MAX;
+
+	if (!gAgentCamera.cameraMouselook())
+	{
+		LLFloaterReg::showTypedInstance<LLFloaterSidePanelContainer>("inventory", LLSD(instance_num));
+	}
 }
 
 void LLPanelMainInventory::doCreate(const LLSD& userdata)
-- 
GitLab


From 42c7daebc0593fbed059c687e723910196fb974f Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 8 Dec 2011 15:33:01 -0800
Subject: [PATCH 394/933] FIX VWR-21237

---
 indra/newview/skins/default/xui/da/strings.xml | 3 +++
 indra/newview/skins/default/xui/es/strings.xml | 3 +++
 indra/newview/skins/default/xui/it/strings.xml | 3 +++
 indra/newview/skins/default/xui/pl/strings.xml | 3 +++
 indra/newview/skins/default/xui/pt/strings.xml | 3 +++
 5 files changed, 15 insertions(+)

diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml
index 165d47c931b..11d100eeff5 100644
--- a/indra/newview/skins/default/xui/da/strings.xml
+++ b/indra/newview/skins/default/xui/da/strings.xml
@@ -560,6 +560,9 @@ Prøv venligst om lidt igen.
 	<string name="mesh">
 		mesh
 	</string>
+	<string name="AvatarEditingAppearance">
+		(Redigering Udseende)
+	</string>
 	<string name="AvatarAway">
 		Væk
 	</string>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 4cae6ce5e86..e3ea4baa6c0 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -586,6 +586,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="mesh">
 		red
 	</string>
+	<string name="AvatarEditingAppearance">
+		(Edición de Apariencia)
+	</string>
 	<string name="AvatarAway">
 		Ausente
 	</string>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index e58ce0cd70c..8f292338251 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -592,6 +592,9 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="mesh">
 		reticolo
 	</string>
+	<string name="AvatarEditingAppearance">
+		(Modifica Aspetto)
+	</string>
 	<string name="AvatarAway">
 		Assente
 	</string>
diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml
index 6a8309cca52..f6dec8536ba 100644
--- a/indra/newview/skins/default/xui/pl/strings.xml
+++ b/indra/newview/skins/default/xui/pl/strings.xml
@@ -423,6 +423,9 @@
 	<string name="symbolic folder link">
 		link folderu
 	</string>
+	<string name="AvatarEditingAppearance">
+		(Edycja WyglÄ…d)
+	</string>
 	<string name="AvatarAway">
 		Åšpi
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index cc61ad76d7a..4535c7aaebd 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -547,6 +547,9 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 	<string name="mesh">
 		mesh
 	</string>
+	<string name="AvatarEditingAppearance">
+		(Edição Aparência)
+	</string>
 	<string name="AvatarAway">
 		Distante
 	</string>
-- 
GitLab


From 86847b753befbca31e4aadeff111acd398f9612d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 8 Dec 2011 15:33:27 -0800
Subject: [PATCH 395/933] fix for build error

---
 indra/llmessage/llsdmessagereader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index 3ab62a8c579..3d8ca2ad9f1 100644
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -294,7 +294,7 @@ S32 getElementSize(const LLSD& llsd)
 	default:                        // TypeLLSDTypeEnd, TypeLLSDNumTypes, etc.
 		return 0;
 	}
-	return 0;
+	//return 0;
 }
 
 //virtual 
-- 
GitLab


From 0e8cd7c9accd48d2eda60f469c38286af27ed129 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 8 Dec 2011 15:36:44 -0800
Subject: [PATCH 396/933] fix for build error (warning for unreachable code)

---
 indra/llmessage/llsdmessagereader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index 3ab62a8c579..3d8ca2ad9f1 100644
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -294,7 +294,7 @@ S32 getElementSize(const LLSD& llsd)
 	default:                        // TypeLLSDTypeEnd, TypeLLSDNumTypes, etc.
 		return 0;
 	}
-	return 0;
+	//return 0;
 }
 
 //virtual 
-- 
GitLab


From ca4eab69b9b1ed42f3128635ef1f278600b59118 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 8 Dec 2011 17:49:56 -0600
Subject: [PATCH 397/933] SH-2680 Bring back blurred edges on objects closer
 than the near focal plane.

---
 .../shaders/class1/deferred/cofF.glsl         |  7 ++--
 .../shaders/class1/deferred/dofCombineF.glsl  |  2 +-
 .../class1/deferred/postDeferredF.glsl        | 40 +++++++++++++++++--
 3 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index 88fe3c3dee3..e612efba61f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -57,7 +57,7 @@ float getDepth(vec2 pos_screen)
 
 float calc_cof(float depth)
 {
-	float sc = abs(depth-focal_distance)/-depth*blur_constant;
+	float sc = (depth-focal_distance)/-depth*blur_constant;
 		
 	sc /= magnification;
 	
@@ -79,9 +79,10 @@ void main()
 	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
 	float sc = calc_cof(depth);
-	sc = min(abs(sc), max_cof);
+	sc = min(sc, max_cof);
+	sc = max(sc, -max_cof);
 	
 	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
 	gl_FragColor.rgb = diff.rgb + bloom.rgb;
-	gl_FragColor.a = sc/max_cof;
+	gl_FragColor.a = sc/max_cof*0.5+0.5;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index 21453aefaa9..01e3505359f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -48,7 +48,7 @@ void main()
 	
 	vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
 
-	float a = min(diff.a * max_cof*res_scale*res_scale, 1.0);
+	float a = min(abs(diff.a*2.0-1.0) * max_cof*res_scale*res_scale, 1.0);
 
 	if (a > 0.25 && a < 0.75)
 	{ //help out the transition a bit
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 4603d99c5e5..18d451bf878 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -42,7 +42,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc)
 {
 	vec4 s = texture2DRect(diffuseRect, tc);
 
-	float sc = s.a*max_cof;
+	float sc = abs(s.a*2.0-1.0)*max_cof;
 
 	if (sc > min_sc) //sampled pixel is more "out of focus" than current sample radius
 	{
@@ -57,6 +57,20 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc)
 	}
 }
 
+void dofSampleNear(inout vec4 diff, inout float w, float min_sc, vec2 tc)
+{
+	vec4 s = texture2DRect(diffuseRect, tc);
+
+	float wg = 0.25;
+
+	// de-weight dull areas to make highlights 'pop'
+	wg += s.r+s.g+s.b;
+
+	diff += wg*s;
+		
+	w += wg;
+}
+
 void main() 
 {
 	vec2 tc = vary_fragcoord.xy;
@@ -66,12 +80,30 @@ void main()
 	{ 
 		float w = 1.0;
 		
-		float sc = diff.a*max_cof;
-				
+		float sc = (diff.a*2.0-1.0)*max_cof;
+			
 		float PI = 3.14159265358979323846264;
 
 		// sample quite uniformly spaced points within a circle, for a circular 'bokeh'		
+		if (sc > 0.5)
+		{
+			while (sc > 0.5)
+			{
+				int its = int(max(1.0,(sc*3.7)));
+				for (int i=0; i<its; ++i)
+				{
+					float ang = sc+i*2*PI/its; // sc is added for rotary perturbance
+					float samp_x = sc*sin(ang);
+					float samp_y = sc*cos(ang);
+					// you could test sample coords against an interesting non-circular aperture shape here, if desired.
+					dofSampleNear(diff, w, sc, vary_fragcoord.xy + vec2(samp_x,samp_y));
+				}
+				sc -= 1.0;
+			}
+		}
+		else if (sc < -0.5)
 		{
+			sc = abs(sc);
 			while (sc > 0.5)
 			{
 				int its = int(max(1.0,(sc*3.7)));
@@ -86,7 +118,7 @@ void main()
 				sc -= 1.0;
 			}
 		}
-		
+
 		diff /= w;
 	}
 		
-- 
GitLab


From 67f1321f31d5988e7b383cfbf4fbd6537f3d2710 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 8 Dec 2011 16:46:30 -0800
Subject: [PATCH 398/933] Initial functional merchant outbox floater

---
 indra/newview/llfloateroutbox.cpp             | 309 +++++++++++++++++-
 indra/newview/llfloateroutbox.h               |  44 ++-
 indra/newview/llmarketplacefunctions.cpp      |   7 +-
 indra/newview/llsidepanelinventory.cpp        |   2 +-
 .../xui/en/floater_merchant_outbox.xml        | 137 ++++----
 5 files changed, 416 insertions(+), 83 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 8fea3d674e4..79cd90ba1c0 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -29,40 +29,333 @@
 #include "llfloateroutbox.h"
 
 #include "llfloaterreg.h"
+#include "llfolderview.h"
+#include "llinventoryobserver.h"
+#include "llinventorypanel.h"
+#include "llloadingindicator.h"
+#include "llmarketplacefunctions.h"
+#include "llnotificationsutil.h"
+#include "lltextbox.h"
 #include "lltransientfloatermgr.h"
+#include "lltrans.h"
+#include "llviewernetwork.h"
 
 
+///----------------------------------------------------------------------------
+/// LLOutboxAddedObserver helper class
+///----------------------------------------------------------------------------
+
+class LLOutboxAddedObserver : public LLInventoryCategoryAddedObserver
+{
+public:
+	LLOutboxAddedObserver(LLFloaterOutbox * outboxFloater)
+		: LLInventoryCategoryAddedObserver()
+		, mOutboxFloater(outboxFloater)
+	{
+	}
+	
+	void done()
+	{
+		for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it)
+		{
+			LLViewerInventoryCategory* added_category = *it;
+			
+			LLFolderType::EType added_category_type = added_category->getPreferredType();
+			
+			if (added_category_type == LLFolderType::FT_OUTBOX)
+			{
+				mOutboxFloater->setupOutbox(added_category->getUUID());
+			}
+		}
+	}
+	
+private:
+	LLFloaterOutbox *	mOutboxFloater;
+};
+
 ///----------------------------------------------------------------------------
 /// LLFloaterOutbox
 ///----------------------------------------------------------------------------
 
 LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
 	: LLFloater(key)
-	, mPanelOutboxInventory(NULL)
+	, mCategoriesObserver(NULL)
+	, mCategoryAddedObserver(NULL)
+	, mOutboxId(LLUUID::null)
+	, mOutboxInventoryPanel(NULL)
+	, mOutboxItemCount(0)
+	, mInventoryDisablePanel(NULL)
+	, mInventoryFolderCountText(NULL)
+	, mInventoryImportInProgress(NULL)
+	, mInventoryPlaceholder(NULL)
+	, mInventoryText(NULL)
+	, mInventoryTitle(NULL)
+	, mImportButton(NULL)
 {
-	LLTransientFloaterMgr::getInstance()->addControlView(this);
 }
 
 LLFloaterOutbox::~LLFloaterOutbox()
 {
-	LLTransientFloaterMgr::getInstance()->removeControlView(this);
+//	delete mCategoriesObserver;
+//	delete mCategoryAddedObserver;
 }
 
 BOOL LLFloaterOutbox::postBuild()
 {
+	mInventoryDisablePanel = getChild<LLView>("outbox_inventory_disable_panel");
+	mInventoryFolderCountText = getChild<LLTextBox>("outbox_folder_count");
+	mInventoryImportInProgress = getChild<LLLoadingIndicator>("import_progress_indicator");
+	mInventoryPlaceholder = getChild<LLView>("outbox_inventory_placeholder_panel");
+	mInventoryText = mInventoryPlaceholder->getChild<LLTextBox>("outbox_inventory_placeholder_text");
+	mInventoryTitle = mInventoryPlaceholder->getChild<LLTextBox>("outbox_inventory_placeholder_title");
+	
+	mImportButton = getChild<LLButton>("outbox_import_btn");
+	mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this));
+
 	return TRUE;
 }
 
 void LLFloaterOutbox::onOpen(const LLSD& key)
 {
-	//LLFirstUse::useInventory();
+	//
+	// Initialize the marketplace import API
+	//
+
+	LLMarketplaceInventoryImporter::getInstance()->initialize();
+	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
+	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
+	
+	//
+	// Look for an outbox and set up the inventory API
+	//
+
+	const bool do_not_create_folder = false;
+	const bool do_not_find_in_library = false;
+	
+	const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library);
+	
+	if (outbox_id.isNull())
+	{
+		// Observe category creation to catch outbox creation
+		mCategoryAddedObserver = new LLOutboxAddedObserver(this);
+		gInventory.addObserver(mCategoryAddedObserver);
+	}
+	else
+	{
+		setupOutbox(outbox_id);
+	}
+	
+	updateView();
+}
+
+void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
+{	
+	llassert(mOutboxId.isNull());
+	llassert(mCategoriesObserver == NULL);
+	
+	mOutboxId = outboxId;
+	
+	// No longer need to observe new category creation
+	if (mCategoryAddedObserver != NULL)
+	{
+		gInventory.removeObserver(mCategoryAddedObserver);
+	}	
+	
+	// Create observer for outbox modifications
+	mCategoriesObserver = new LLInventoryCategoriesObserver();
+	gInventory.addObserver(mCategoriesObserver);
+	
+	mCategoriesObserver->addCategory(mOutboxId, boost::bind(&LLFloaterOutbox::onOutboxChanged, this));
+	
+	//
+	// Set up the outbox inventory view
+	//
+	
+	mOutboxInventoryPanel = 
+		LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_outbox_inventory.xml",
+														  mInventoryPlaceholder->getParent(),
+														  LLInventoryPanel::child_registry_t::instance());
+	
+	llassert(mOutboxInventoryPanel);
+	
+	// Reshape the inventory to the proper size
+	LLRect inventory_placeholder_rect = mInventoryPlaceholder->getRect();
+	mOutboxInventoryPanel->setShape(inventory_placeholder_rect);
+	
+	// Set the sort order newest to oldest
+	mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
+	mOutboxInventoryPanel->getFilter()->markDefault();
+	
+	// Set selection callback for proper update of inventory status buttons
+	//mOutboxInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this));
+	
+	// Set up the note to display when the outbox is empty
+	mOutboxInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems");
+}
+
+void LLFloaterOutbox::updateView()
+{
+	if (mOutboxItemCount > 0)
+	{
+		mOutboxInventoryPanel->setVisible(TRUE);
+		mInventoryPlaceholder->setVisible(FALSE);
+	}
+	else
+	{
+		mOutboxInventoryPanel->setVisible(FALSE);
+		mInventoryPlaceholder->setVisible(TRUE);
+
+		std::string outbox_text;
+		std::string outbox_title;
+		std::string outbox_tooltip;
+		
+		if (mOutboxId.notNull())
+		{
+			outbox_text = LLTrans::getString("InventoryOutboxNoItems");
+			outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle");
+			outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip");
+		}
+		else
+		{
+			//
+			// The string to become a merchant contains 3 URL's which need the domain name patched in.
+			//
+			
+			std::string domain = "secondlife.com";
+			
+			if (!LLGridManager::getInstance()->isInProductionGrid())
+			{
+				std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
+				domain = llformat("%s.lindenlab.com", utf8str_tolower(gridLabel).c_str());
+			}
+			
+			LLStringUtil::format_map_t domain_arg;
+			domain_arg["[DOMAIN_NAME]"] = domain;
+			
+			std::string marketplace_url = LLTrans::getString("MarketplaceURL", domain_arg);
+			std::string marketplace_url_create = LLTrans::getString("MarketplaceURL_CreateStore", domain_arg);
+			std::string marketplace_url_info = LLTrans::getString("MarketplaceURL_LearnMore", domain_arg);
+			
+			LLStringUtil::format_map_t args1, args2, args3;
+			args1["[MARKETPLACE_URL]"] = marketplace_url;
+			args2["[LEARN_MORE_URL]"] = marketplace_url_info;
+			args3["[CREATE_STORE_URL]"] = marketplace_url_create;
+			
+			// NOTE: This is dumb, ridiculous and very finicky.  The order of these is very important
+			//       to have these three string substitutions work properly.
+			outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", args1);
+			LLStringUtil::format(outbox_text, args2);
+			LLStringUtil::format(outbox_text, args3);
+			
+			outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle");
+			outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip");
+		}
+		
+		mInventoryText->setValue(outbox_text);
+		mInventoryTitle->setValue(outbox_title);
+		mInventoryPlaceholder->getParent()->setToolTip(outbox_tooltip);
+	}
+}
+
+BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+										EDragAndDropType cargo_type,
+										void* cargo_data,
+										EAcceptance* accept,
+										std::string& tooltip_msg)
+{
+	// Pass drag and drop to this floater to the outbox inventory control
+
+	S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft;
+	S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom;
+
+	return mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+}
+
+void LLFloaterOutbox::onImportButtonClicked()
+{
+	LLMarketplaceInventoryImporter::instance().triggerImport();
+}
+
+void LLFloaterOutbox::onOutboxChanged()
+{
+	llassert(!mOutboxId.isNull());
+	
+	U32 item_count = 0;
+	
+	const LLFolderViewFolder * outbox_folder = mOutboxInventoryPanel->getRootFolder();
+	
+	if (outbox_folder)
+	{
+		item_count += outbox_folder->getFoldersCount();
+		item_count += outbox_folder->getItemsCount();
+	}
+	
+	mOutboxItemCount = item_count;
+
+	switch (mOutboxItemCount)
+	{
+		case 0:	mInventoryFolderCountText->setText(getString("OutboxFolderCount0"));	break;
+		case 1:	mInventoryFolderCountText->setText(getString("OutboxFolderCount1"));	break;
+		default:
+		{
+			std::string item_count_str = llformat("%d", mOutboxItemCount);
+			
+			LLStringUtil::format_map_t args;
+			args["[NUM]"] = item_count_str;
+
+			mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args));
+			break;
+		}
+	}
+
+	mImportButton->setEnabled(mOutboxItemCount > 0);
+
+	updateView();
 }
 
-void LLFloaterOutbox::onClose(bool app_quitting)
+void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
 {
-	LLFloater::onClose(app_quitting);
-	if (mKey.asInteger() > 1)
+	if (status == MarketplaceErrorCodes::IMPORT_DONE)
+	{
+		LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap());
+	}
+	else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
+	{
+		LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
+	}
+	else
 	{
-		destroy();
+		char status_string[16];
+		sprintf(status_string, "%d", status);
+		
+		LLSD subs;
+		subs["ERROR_CODE"] = status_string;
+		
+		//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
+		LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
 	}
 }
+
+void LLFloaterOutbox::importStatusChanged(bool inProgress)
+{
+	if (inProgress)
+	{
+		mImportButton->setEnabled(false);
+		
+		mInventoryDisablePanel->setVisible(true);
+
+		mInventoryImportInProgress->setVisible(true);
+		mInventoryImportInProgress->reset();
+		mInventoryImportInProgress->start();
+	}
+	else
+	{
+		mImportButton->setEnabled(mOutboxItemCount > 0);
+		
+		mInventoryDisablePanel->setVisible(false);
+
+		mInventoryImportInProgress->stop();
+		mInventoryImportInProgress->setVisible(false);
+	}
+}
+
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index cb5c2be81c4..1e8567ef124 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -31,7 +31,15 @@
 #include "llfloater.h"
 #include "llfoldertype.h"
 
+
+class LLButton;
+class LLInventoryCategoriesObserver;
+class LLInventoryCategoryAddedObserver;
 class LLInventoryPanel;
+class LLLoadingIndicator;
+class LLTextBox;
+class LLView;
+
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLFloaterOutbox
@@ -42,15 +50,43 @@ class LLFloaterOutbox : public LLFloater
 public:
 	LLFloaterOutbox(const LLSD& key);
 	~LLFloaterOutbox();
+	
+	void setupOutbox(const LLUUID& outboxId);
 
+	// virtuals
 	BOOL postBuild();
+	void onOpen(const LLSD& key);
+	BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+						   EDragAndDropType cargo_type,
+						   void* cargo_data,
+						   EAcceptance* accept,
+						   std::string& tooltip_msg);
 
-	// Inherited functionality
-	/*virtual*/ void onOpen(const LLSD& key);
-	/*virtual*/ void onClose(bool app_quitting);
+protected:
+	void importReportResults(U32 status, const LLSD& content);
+	void importStatusChanged(bool inProgress);
+	
+	void onImportButtonClicked();
+	void onOutboxChanged();
+	
+	void updateView();
 
 private:
-	LLInventoryPanel* mPanelOutboxInventory;
+	LLInventoryCategoriesObserver *		mCategoriesObserver;
+	LLInventoryCategoryAddedObserver *	mCategoryAddedObserver;
+
+	LLUUID				mOutboxId;
+	LLInventoryPanel *	mOutboxInventoryPanel;
+	U32					mOutboxItemCount;
+	
+	LLView *				mInventoryDisablePanel;
+	LLTextBox *				mInventoryFolderCountText;
+	LLLoadingIndicator *	mInventoryImportInProgress;
+	LLView *				mInventoryPlaceholder;
+	LLTextBox *				mInventoryText;
+	LLTextBox *				mInventoryTitle;
+	
+	LLButton *		mImportButton;
 };
 
 #endif // LL_LLFLOATEROUTBOX_H
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index b9e02a36b49..9c67c589b85 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -55,6 +55,7 @@ namespace LLMarketplaceImport
 
 	static std::string sMarketplaceCookie = "";
 	static bool sImportInProgress = false;
+	static bool sImportPostPending = false;
 	static bool sImportGetPending = false;
 	static U32 sImportResultStatus = 0;
 	static LLSD sImportResults = LLSD::emptyMap();
@@ -106,6 +107,7 @@ namespace LLMarketplaceImport
 		void completed(U32 status, const std::string& reason, const LLSD& content)
 		{
 			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
+			sImportPostPending = false;
 			sImportResultStatus = status;
 		}
 	};
@@ -185,7 +187,7 @@ namespace LLMarketplaceImport
 	
 	bool resultPending()
 	{
-		return sImportGetPending;
+		return (sImportPostPending || sImportGetPending);
 	}
 	
 	U32 getResultStatus()
@@ -226,7 +228,8 @@ namespace LLMarketplaceImport
 	
 	void triggerImport()
 	{
-		sImportInProgress = true;		
+		sImportInProgress = true;
+		sImportPostPending = true;
 		sImportResultStatus = MarketplaceErrorCodes::IMPORT_PROCESSING;
 		sImportResults = LLSD::emptyMap();
 
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 19a81b93bf2..9c551be2d56 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -926,7 +926,7 @@ U32 LLSidepanelInventory::getSelectedCount()
 	{
 		selection_list = mInventoryPanelInbox->getRootFolder()->getSelectionList();
 
-	count += selection_list.size();
+		count += selection_list.size();
 	}
 
 	if ((count == 0) && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 2f8a83c072c..86e27cbc71c 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -3,90 +3,33 @@
  open_positioning="cascading"
  can_close="true"
  can_resize="true"
- height="400"
+ height="440"
  help_topic="floater_merchant_outbox"
- min_width="333"
- min_height="440"
+ min_width="300"
+ min_height="240"
  name="floater_merchant_outbox"
  save_rect="true"
  save_visibility="true"
  reuse_instance="true"
  title="MERCHANT OUTBOX"
  width="333" >
+ <string name="OutboxFolderCount0">0 folders</string>
+ <string name="OutboxFolderCount1">1 folder</string>
+ <string name="OutboxFolderCountN">[NUM] folders</string>
  <panel
       follows="all"
       layout="topleft"
       left="0"
-      name="marketplace_outbox"
-      class="panel_marketplace_outbox"
       top="0"
       label=""
-      height="400"
-      width="330">
-     <string name="OutboxLabelWithArg">Merchant outbox ([NUM])</string>
-     <string name="OutboxLabelNoArg">Merchant outbox</string>
-     <button
-        label="Merchant outbox"
-        font="SansSerifMedium"
-        name="outbox_btn"
-        height="35"
-        width="308"
-        image_unselected="MarketplaceBtn_Off"
-        image_selected="MarketplaceBtn_Selected"
-        halign="left"
-        handle_right_mouse="false"
-        follows="top|left|right"
-        is_toggle="true"
-        tab_stop="false"
-        pad_left="35"
-        top="0"
-        left="10" />
-     <button
-         image_unselected="OutboxPush_Off"
-         image_selected="OutboxPush_Selected"
-         image_hover_selected="OutboxPush_Selected_Over"
-         image_hover_unselected="OutboxPush_Over"
-         image_disabled_selected="OutboxPush_Selected_Disabled"
-         image_disabled="OutboxPush_Disabled"
-         image_pressed="OutboxPush_Press"
-         image_pressed_selected="OutboxPush_Selected_Press"
-         label=""
-         tool_tip="Push to my Marketplace Storefront"
-         is_toggle="false"
-         name="outbox_sync_btn"
-         follows="top|right"
-         tab_stop="false"
-         halign="center"
-         top="6"
-         left="-50"
-         height="23"
-         width="32"
-         enabled="false" />
-     <loading_indicator
-        follows="top|right"
-        name="outbox_sync_indicator"
-        top="6"
-        left="-50"
-        height="23"
-        width="32"
-        images_per_sec="1.15"
-        tab_stop="false"
-        visible="false">
-         <images>
-             <image name="OutboxPush_Progress_1"/>
-             <image name="OutboxPush_Progress_2"/>
-             <image name="OutboxPush_Progress_3"/>
-             <image name="OutboxPush_Progress_4"/>
-             <image name="OutboxPush_Progress_5"/>
-             <image name="OutboxPush_Progress_6"/>
-         </images>
-     </loading_indicator>
+      height="440"
+      width="333">
      <panel
         follows="all"
         left="10"
         bottom="400"
-        width="308"
-        top="35"
+        width="313"
+        top="0"
         bg_opaque_color="InventoryBackgroundColor"
         background_visible="true"
         background_opaque="true"
@@ -98,7 +41,7 @@
 			top="0"
 			left="0"
 			width="308"
-			height="365"
+			height="400"
 			bg_opaque_color="InventoryBackgroundColor"
 			background_visible="true"
 			background_opaque="true"
@@ -129,6 +72,64 @@
 				wrap="true"
 				halign="left" />
 		</panel>
+    </panel>
+	<panel
+		name="outbox_inventory_disable_panel"
+        follows="all"
+        left="0"
+        bottom="440"
+        width="333"
+        top="0"
+        bg_opaque_color="White_50"
+        background_visible="true"
+        background_opaque="true"
+		visible="false"
+        />
+	<loading_indicator
+		 follows="all"
+		 height="65"
+		 layout="topleft"
+		 left="140"
+		 name="import_progress_indicator"
+		 top="180"
+		 visible="false"
+		 width="45" />
+	<panel
+        follows="bottom|left|right"
+        left="10"
+        bottom="435"
+        width="313"
+        top="405"
+        bg_opaque_color="InventoryBackgroundColor"
+        background_visible="true"
+        background_opaque="true"
+        >
+		<text
+			name="outbox_folder_count"
+			type="string"
+			follows="all"
+			layout="topleft"
+			top="7"
+			left="5"
+			width="100"
+			height="20"
+			wrap="true"
+			halign="left"
+			valign="baseline"
+			font="SansSerifBold" />
+		<button
+			 label="Send to Marketplace"
+			 tool_tip="Push to my Marketplace Storefront"
+			 is_toggle="false"
+			 name="outbox_import_btn"
+			 follows="bottom|right"
+			 tab_stop="false"
+			 halign="center"
+			 top="3"
+			 left="110"
+			 height="25"
+			 width="200"
+			 enabled="false" />
     </panel>
  </panel>
 </floater>
-- 
GitLab


From 0aa2c7343ac2af195e80c8f52b9ef67da785fa00 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 8 Dec 2011 20:36:47 -0800
Subject: [PATCH 399/933] EXP-1512 FIX changing UI size changes cursor position
 in notecards

---
 indra/llui/lltextbase.cpp | 31 ++++++++++++++++++++++++++++++-
 indra/llui/lltextbase.h   |  2 ++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 3b768166f12..1f890b625f5 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -598,7 +598,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
 
 	pos = getEditableIndex(pos, true);
 
-	segment_set_t::iterator seg_iter = getSegIterContaining(pos);
+	segment_set_t::iterator seg_iter = getEditableSegIterContaining(pos);
 
 	LLTextSegmentPtr default_segment;
 
@@ -1510,8 +1510,37 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg
 	}
 }
 
+LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index)
+{
+	segment_set_t::iterator it = getSegIterContaining(index);
+	if (it == mSegments.end()) return it;
+
+	if (!(*it)->canEdit() 
+		&& index == (*it)->getStart() 
+		&& it != mSegments.begin())
+	{
+		it--;
+	}
+	return it;
+}
+
+LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const
+{
+	segment_set_t::const_iterator it = getSegIterContaining(index);
+	if (it == mSegments.end()) return it;
+
+	if (!(*it)->canEdit() 
+		&& index == (*it)->getStart() 
+		&& it != mSegments.begin())
+	{
+		it--;
+	}
+	return it;
+}
+
 LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
 {
+
 	static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment();
 
 	if (index > getLength()) { return mSegments.end(); }
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index b6996019088..0549141b72a 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -461,6 +461,8 @@ class LLTextBase
 	void                			getSegmentAndOffset( S32 startpos, segment_set_t::const_iterator* seg_iter, S32* offsetp ) const;
 	void                			getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg_iter, S32* offsetp );
 	LLTextSegmentPtr    			getSegmentAtLocalPos( S32 x, S32 y, bool hit_past_end_of_line = true);
+	segment_set_t::iterator			getEditableSegIterContaining(S32 index);
+	segment_set_t::const_iterator	getEditableSegIterContaining(S32 index) const;
 	segment_set_t::iterator			getSegIterContaining(S32 index);
 	segment_set_t::const_iterator	getSegIterContaining(S32 index) const;
 	void                			clearSegments();
-- 
GitLab


From 6fd96dd2632c8e94cfda926816fb81faf6f574c5 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 8 Dec 2011 20:37:03 -0800
Subject: [PATCH 400/933] made undo/redo/paste accept key repeat

---
 indra/newview/skins/default/xui/en/menu_edit.xml   | 3 +++
 indra/newview/skins/default/xui/en/menu_viewer.xml | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/menu_edit.xml b/indra/newview/skins/default/xui/en/menu_edit.xml
index fab76c497cf..99061e089a9 100644
--- a/indra/newview/skins/default/xui/en/menu_edit.xml
+++ b/indra/newview/skins/default/xui/en/menu_edit.xml
@@ -6,6 +6,7 @@
   <menu_item_call
    label="Undo"
    name="Undo"
+   allow_key_repeat="true"
    shortcut="control|Z">
     <menu_item_call.on_click
      function="Edit.Undo" />
@@ -15,6 +16,7 @@
   <menu_item_call
    label="Redo"
    name="Redo"
+   allow_key_repeat="true"
    shortcut="control|Y">
     <menu_item_call.on_click
      function="Edit.Redo" />
@@ -43,6 +45,7 @@
   <menu_item_call
    label="Paste"
    name="Paste"
+   allow_key_repeat="true"
    shortcut="control|V">
     <menu_item_call.on_click
      function="Edit.Paste" />
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1834be2d48c..f23d48f8c5f 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1154,6 +1154,7 @@
          enabled="false"
          label="Undo"
          name="Undo"
+         allow_key_repeat="true"
          shortcut="control|Z">
             <on_click
              function="Edit.Undo"
@@ -1165,6 +1166,7 @@
          enabled="false"
          label="Redo"
          name="Redo"
+         allow_key_repeat="true"
          shortcut="control|Y">
             <on_click
              function="Edit.Redo"
-- 
GitLab


From 04d5ba4ab982eed493502dca228134191acb78da Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Fri, 9 Dec 2011 09:51:25 +0000
Subject: [PATCH 401/933] General cleanup of new code (removing commented
 lines, experimetal stuff), adding some comments per RB feedback.

---
 indra/newview/llpreviewscript.cpp             | 15 ++----
 .../newview/skins/default/xui/en/strings.xml  | 52 +++++++++----------
 2 files changed, 30 insertions(+), 37 deletions(-)

diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 62603a2e079..cab30b12952 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1108,19 +1108,12 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask)
 void LLScriptEdCore::onBtnLoadFromFile( void* data )
 {
 	LLScriptEdCore* self = (LLScriptEdCore*) data;
-/*
-	if( self->isDirty())
-	{
-		llwarns << "Script has unsaved changes, loading from disc aborted." << llendl;
-		LLStringBase<char>::format_map_t args;
-		args["[REASON]"] = std::string("Existing script has unsaved changes. You must save this script before loading from disc.");
-		gViewerWindow->alertXml("LoadDiskScriptFailReason", args);		
-		return;
-	}
-*/
+
+	// TODO Maybe add a dialogue warning here if the current file has unsaved changes.
 	LLFilePicker& file_picker = LLFilePicker::instance();
 	if( !file_picker.getOpenFile( LLFilePicker::FFLOAD_SCRIPT ) )
 	{
+		//File picking cancelled by user, so nothing to do.
 		return;
 	}
 
@@ -1147,7 +1140,6 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data )
 	{
 		self->mEditor->selectAll();
 		LLWString script(utf8str_to_wstring(text));
-		LLWStringUtil::replaceTabsWithSpaces(script, self->mEditor->spacesPerTab());
 		self->mEditor->insertText(script);
 	}
 }
@@ -1164,6 +1156,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata )
 		LLFilePicker& file_picker = LLFilePicker::instance();
 		if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) )
 		{
+			//File picking cancelled by user, so nothing to do.
 			return;
 		}
 
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 0d26465dfa4..f962ff0aeef 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -88,7 +88,7 @@ We are very sorry for the inconvenience.</string>
 Logins are currently restricted to employees only.
 Check www.secondlife.com/status for updates.</string>
 	<string name="LoginFailedPremiumOnly">Second Life logins are temporarily restricted in order to make sure that those in-world have the best possible experience.
-	 	
+
 People with free accounts will not be able to access Second Life during this time, to make room for those who have paid for Second Life.</string>
 	<string name="LoginFailedComputerProhibited">Second Life cannot be accessed from this computer.
 If you feel this is an error, please contact
@@ -168,7 +168,7 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
 	<string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
 	<string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
-	
+
 	<!-- tooltips for Urls -->
 	<string name="TooltipHttpUrl">Click to view this web page</string>
 	<string name="TooltipSLURL">Click to view this location's information</string>
@@ -188,7 +188,7 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipObjectIMUrl">Click to view this object's description</string>
 	<string name="TooltipMapUrl">Click to view this location on a map</string>
 	<string name="TooltipSLAPP">Click to run the secondlife:// command</string>
-	<string name="CurrentURL" value=" CurrentURL: [CurrentURL]" />	
+	<string name="CurrentURL" value=" CurrentURL: [CurrentURL]" />
 
 	<!-- text for SLURL labels -->
 	<string name="SLurlLabelTeleport">Teleport to</string>
@@ -427,7 +427,7 @@ Please try logging in again in a minute.</string>
 	<string name="compressed_image_files">Compressed Images</string>
 	<string name="load_files">Load Files</string>
 	<string name="choose_the_directory">Choose Directory</string>
-  <string name="script_files">Scripts</string>
+	<string name="script_files">Scripts</string>
 
   <!-- LSL Usage Hover Tips -->
   <!-- NOTE: For now these are set as translate="false", until DEV-40761 is implemented (to internationalize the rest of tooltips in the same window).
@@ -1951,7 +1951,7 @@ Returns a string with the requested data about the region
   <string name="physics">Physics</string>
   <string name="invalid">invalid</string>
   <string name="none">none</string>
-  
+
   <!-- Not Worn Wearable Types -->
 	<string name="shirt_not_worn">Shirt not worn</string>
 	<string name="pants_not_worn">Pants not worn</string>
@@ -1988,7 +1988,7 @@ Returns a string with the requested data about the region
 
   <!-- Wearable List-->
   <string name="NewWearable">New [WEARABLE_ITEM]</string>
-  
+
 	<!-- LLGroupNotify -->
 	<!-- used in the construction of a Group Notice blue dialog box, buttons, tooltip etc. Seems to be no longer utilized by code in Viewer 2.0 -->
 	<string name="next">Next</string>
@@ -2314,7 +2314,7 @@ Returns a string with the requested data about the region
 	<string name="ScriptLimitsRequestWrongRegion">Error: script information is only available in your current region</string>
 	<string name="ScriptLimitsRequestWaiting">Retrieving information...</string>
 	<string name="ScriptLimitsRequestDontOwnParcel">You do not have permission to examine this parcel</string>
-	
+
 	<string name="SITTING_ON">Sitting On</string>
 	<string name="ATTACH_CHEST">Chest</string>
 	<string name="ATTACH_HEAD">Head</string>
@@ -2354,7 +2354,7 @@ Returns a string with the requested data about the region
 	<string name="ATTACH_HUD_BOTTOM_LEFT">HUD Bottom Left</string>
 	<string name="ATTACH_HUD_BOTTOM">HUD Bottom</string>
 	<string name="ATTACH_HUD_BOTTOM_RIGHT">HUD Bottom Right</string>
-			
+
 	<!-- script editor -->
 	<string name="CursorPos">Line [LINE], Column [COLUMN]</string>
 
@@ -2367,7 +2367,7 @@ Returns a string with the requested data about the region
 
 	<!-- panel contents -->
 	<string name="PanelContentsTooltip">Content of object</string>
-	<string name="PanelContentsNewScript">New Script</string>	
+	<string name="PanelContentsNewScript">New Script</string>
 
   <!-- panel preferences general -->
   <string name="BusyModeResponseDefault">The Resident you messaged is in &apos;busy mode&apos; which means they have requested not to be disturbed.  Your message will still be shown in their IM panel for later viewing.</string>
@@ -2397,7 +2397,7 @@ Returns a string with the requested data about the region
 	<!-- panel classified -->
 	<string name="ClassifiedClicksTxt">Clicks: [TELEPORT] teleport, [MAP] map, [PROFILE] profile</string>
 	<string name="ClassifiedUpdateAfterPublish">(will update after publish)</string>
-  
+
   <!-- panel picks -->
   <string name="NoPicksClassifiedsText">You haven't created any Picks or Classifieds. Click the Plus button below to create a Pick or Classified.</string>
   <string name="NoAvatarPicksClassifiedsText">User has no picks or classifieds</string>
@@ -3274,7 +3274,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     You have blocked this Resident. Sending a message will automatically unblock them.
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3115 issue 'generic' is passed into the gIMMgr::showSessionStartError as a string name.
   Also there are some other places where "generic" is used.
   So, let add string with name="generic" with the same value as "generic_request_error" -->
@@ -3300,7 +3300,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     You are not a session moderator.
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3562 issue 'muted' is passed into the gIMMgr::showSessionStartError as a string name.
   So, let add string with name="muted" with the same value as "muted_error" -->
   <string name="muted">
@@ -3313,12 +3313,12 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     Unable to add users to chat session with [RECIPIENT].
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3562 issue 'message' is passed into the gIMMgr::showSessionStartError as a string name.
   So, let add string with name="message" with the same value as "message_session_event" -->
   <string name="message">
     Unable to send your message to the chat session with [RECIPIENT].
-  </string>  
+  </string>
   <string name="message_session_event">
     Unable to send your message to the chat session with [RECIPIENT].
   </string>
@@ -3326,7 +3326,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     Error while moderating.
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3459 issue 'removed' is passed into the gIMMgr::showSessionStartError as a string name.
   So, let add string with name="removed" with the same value as "removed_from_group" -->
   <string name="removed">
@@ -3347,9 +3347,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	<string name="session_initialization_timed_out_error">
 		The session initialization is timed out
 	</string>
-  
+
   <string name="Home position set.">Home position set.</string>
-  
+
   <string name="voice_morphing_url">http://secondlife.com/landing/voicemorphing</string>
 
   <!-- Financial operations strings -->
@@ -3367,20 +3367,20 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   <string name="to join a group">to join a group</string>
   <string name="to upload">to upload</string>
   <string name="to publish a classified ad">to publish a classified ad</string>
-  
+
   <string name="giving">Giving L$ [AMOUNT]</string>
   <string name="uploading_costs">Uploading costs L$ [AMOUNT]</string>
   <string name="this_costs">This costs L$ [AMOUNT]</string>
   <string name="buying_selected_land">Buying selected land for L$ [AMOUNT]</string>
   <string name="this_object_costs">This object costs L$ [AMOUNT]</string>
-  
+
   <string name="group_role_everyone">Everyone</string>
   <string name="group_role_officers">Officers</string>
   <string name="group_role_owners">Owners</string>
   <string name="group_member_status_online">Online</string>
 
   <string name="uploading_abuse_report">Uploading...
-  
+
 Abuse Report</string>
 
   <!-- names for new inventory items-->
@@ -3474,23 +3474,23 @@ Abuse Report</string>
 
   <!-- birth date format shared by avatar inspector and profile panels -->
   <string name="AvatarBirthDateFormat">[mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt]</string>
-  
+
   <string name="DefaultMimeType">none/none</string>
   <string name="texture_load_dimensions_error">Can't load images larger than [WIDTH]*[HEIGHT]</string>
 
   <!-- language specific white-space characters, delimiters, spacers, item separation symbols -->
   <string name="sentences_separator" value=" "></string>
   <string name="words_separator" value=", "/>
-  
+
   <string name="server_is_down">
 	Despite our best efforts, something unexpected has gone wrong.
 
-	Please check status.secondlifegrid.net to see if there is a known problem with the service.  
+	Please check status.secondlifegrid.net to see if there is a known problem with the service.
         If you continue to experience problems, please check your network and firewall setup.
   </string>
 
-  <!-- overriding datetime formating. 
-	didn't translate if this is not needed for current localization 
+  <!-- overriding datetime formating.
+	didn't translate if this is not needed for current localization
   -->
   <string name="dateTimeWeekdaysNames">Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday</string>
   <string name="dateTimeWeekdaysShortNames">Sun:Mon:Tue:Wed:Thu:Fri:Sat</string>
@@ -3523,7 +3523,7 @@ Abuse Report</string>
   <string name="DeleteItem">Delete selected item?</string>
 
   <string name="EmptyOutfitText">There are no items in this outfit</string>
- 
+
  <!-- External editor status codes -->
  <string name="ExternalEditorNotSet">Select an editor using the ExternalEditor setting.</string>
  <string name="ExternalEditorNotFound">Cannot find the external editor you specified.
-- 
GitLab


From 702410cef75e0cc10258964b86b093f2205ef462 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 9 Dec 2011 17:59:29 +0200
Subject: [PATCH 402/933] EXP-1671 FIXED Enable/disable the translation
 checkbox in the nearby chat floater whenever translation preferences change.

The checkbox is also updated when the nearby chat floater is opened.
---
 indra/newview/llfloatertranslationsettings.cpp |  2 ++
 indra/newview/llnearbychatbar.cpp              | 12 ++++++++++++
 indra/newview/llnearbychatbar.h                |  2 ++
 indra/newview/lltranslate.cpp                  | 18 ++++++++++++++++++
 indra/newview/lltranslate.h                    | 16 ++++++++++++++++
 5 files changed, 50 insertions(+)

diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp
index 959edff713f..428a02e9f05 100644
--- a/indra/newview/llfloatertranslationsettings.cpp
+++ b/indra/newview/llfloatertranslationsettings.cpp
@@ -29,6 +29,7 @@
 #include "llfloatertranslationsettings.h"
 
 // Viewer includes
+#include "llnearbychatbar.h"
 #include "lltranslate.h"
 #include "llviewercontrol.h" // for gSavedSettings
 
@@ -292,5 +293,6 @@ void LLFloaterTranslationSettings::onBtnOK()
 	gSavedSettings.setString("TranslationService", getSelectedService());
 	gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey());
 	gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey());
+	LLNearbyChatBar::getInstance()->enableTranslationCheckbox(LLTranslate::isTranslationConfigured());
 	closeFloater(false);
 }
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 114472ba568..4f8559718f3 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -48,6 +48,7 @@
 #include "llrootview.h"
 #include "llviewerchat.h"
 #include "llnearbychat.h"
+#include "lltranslate.h"
 
 #include "llresizehandle.h"
 
@@ -112,6 +113,12 @@ BOOL LLNearbyChatBar::postBuild()
 	return TRUE;
 }
 
+// virtual
+void LLNearbyChatBar::onOpen(const LLSD& key)
+{
+	enableTranslationCheckbox(LLTranslate::isTranslationConfigured());
+}
+
 bool LLNearbyChatBar::applyRectControl()
 {
 	bool rect_controlled = LLFloater::applyRectControl();
@@ -156,6 +163,11 @@ void LLNearbyChatBar::showHistory()
 	}
 }
 
+void LLNearbyChatBar::enableTranslationCheckbox(BOOL enable)
+{
+	getChild<LLUICtrl>("translate_chat_checkbox")->setEnabled(enable);
+}
+
 void LLNearbyChatBar::draw()
 {
 	displaySpeakingIndicator();
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index e9734899b31..866e07f1234 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -43,6 +43,7 @@ class LLNearbyChatBar :	public LLFloater
 	~LLNearbyChatBar() {}
 
 	virtual BOOL postBuild();
+	/*virtual*/ void onOpen(const LLSD& key);
 
 	static LLNearbyChatBar* getInstance();
 
@@ -60,6 +61,7 @@ class LLNearbyChatBar :	public LLFloater
 	static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
 
 	void showHistory();
+	void enableTranslationCheckbox(BOOL enable);
 	/*virtual*/void setMinimized(BOOL b);
 
 protected:
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 7eb54271f40..c1cc9c7bc4e 100755
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -95,6 +95,12 @@ bool LLGoogleTranslationHandler::parseResponse(
 	return parseTranslation(root, translation, detected_lang);
 }
 
+// virtual
+bool LLGoogleTranslationHandler::isConfigured() const
+{
+	return !getAPIKey().empty();
+}
+
 // static
 void LLGoogleTranslationHandler::parseErrorResponse(
 	const Json::Value& root,
@@ -218,6 +224,12 @@ bool LLBingTranslationHandler::parseResponse(
 	return true;
 }
 
+// virtual
+bool LLBingTranslationHandler::isConfigured() const
+{
+	return !getAPIKey().empty();
+}
+
 // static
 std::string LLBingTranslationHandler::getAPIKey()
 {
@@ -331,6 +343,12 @@ std::string LLTranslate::getTranslateLanguage()
 	return language;
 }
 
+// static
+bool LLTranslate::isTranslationConfigured()
+{
+	return getPreferredHandler().isConfigured();
+}
+
 // static
 const LLTranslationAPIHandler& LLTranslate::getPreferredHandler()
 {
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h
index c2330daa817..424bc14587f 100755
--- a/indra/newview/lltranslate.h
+++ b/indra/newview/lltranslate.h
@@ -89,6 +89,11 @@ class LLTranslationAPIHandler
 		std::string& detected_lang,
 		std::string& err_msg) const = 0;
 
+	/**
+	 * @return if the handler is configured to function properly
+	 */
+	virtual bool isConfigured() const = 0;
+
 	virtual ~LLTranslationAPIHandler() {}
 
 protected:
@@ -115,6 +120,7 @@ class LLGoogleTranslationHandler : public LLTranslationAPIHandler
 		std::string& translation,
 		std::string& detected_lang,
 		std::string& err_msg) const;
+	/*virtual*/ bool isConfigured() const;
 
 private:
 	static void parseErrorResponse(
@@ -148,6 +154,7 @@ class LLBingTranslationHandler : public LLTranslationAPIHandler
 		std::string& translation,
 		std::string& detected_lang,
 		std::string& err_msg) const;
+	/*virtual*/ bool isConfigured() const;
 private:
 	static std::string getAPIKey();
 };
@@ -275,8 +282,17 @@ public :
 	 * @param key       Key to verify.
 	 */
 	static void verifyKey(KeyVerificationReceiverPtr& receiver, const std::string& key);
+
+	/**
+	 * @return translation target language
+	 */
 	static std::string getTranslateLanguage();
 
+	/**
+	 * @return true if translation is configured properly.
+	 */
+	static bool isTranslationConfigured();
+
 private:
 	static const LLTranslationAPIHandler& getPreferredHandler();
 	static const LLTranslationAPIHandler& getHandler(EService service);
-- 
GitLab


From 20bc02d2544320a5ad99c61b8d012608319e3161 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Fri, 9 Dec 2011 12:17:47 -0500
Subject: [PATCH 403/933] Added tag DRTVWR-60_2.7.1-release, 2.7.1-release for
 changeset fe3a8e797307

---
 .hgtags | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.hgtags b/.hgtags
index 7648eb38b07..d0c5e798977 100644
--- a/.hgtags
+++ b/.hgtags
@@ -218,3 +218,7 @@ e440cd1dfbd128d7d5467019e497f7f803640ad6 3.2.0-beta1
 c4911ec8cd81e676dfd2af438b3e065407a94a7a 3.2.1-start
 a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
 a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
+a9abb9633a266c8d2fe62411cfd1c86d32da72bf DRTVWR-60_2.7.1-release
+fe3a8e7973072ea62043c08b19b66626c1a720eb DRTVWR-60_2.7.1-release
+a9abb9633a266c8d2fe62411cfd1c86d32da72bf 2.7.1-release
+fe3a8e7973072ea62043c08b19b66626c1a720eb 2.7.1-release
-- 
GitLab


From 723ce604560f71622d0381e47230b87f07262d99 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 9 Dec 2011 12:23:04 -0600
Subject: [PATCH 404/933] Backed out changeset fafd857891b1

---
 indra/llcommon/llthread.h  | 11 ++------
 indra/llmessage/llcurl.cpp | 54 ++++++++++++++++++++------------------
 2 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index b0a1c9e12b7..40291a25693 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -187,18 +187,11 @@ class LLMutexLock
 	LLMutexLock(LLMutex* mutex)
 	{
 		mMutex = mutex;
-
-		if(mMutex)
-		{
-			mMutex->lock();
-		}
+		mMutex->lock();
 	}
 	~LLMutexLock()
 	{
-		if(mMutex)
-		{
-			mMutex->unlock();
-		}
+		mMutex->unlock();
 	}
 private:
 	LLMutex* mMutex;
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 228f0391327..7ca25d07fce 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -585,30 +585,37 @@ void LLCurl::Multi::unlock()
 
 void LLCurl::Multi::markDead()
 {
-	LLMutexLock lock(mDeletionMutexp) ;
-	
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->lock() ;
+	}
+
 	mDead = TRUE ;
+
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->unlock() ;
+	}
 }
 
 void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 {
-	LLMutexLock lock(mMutexp) ;
-
+	lock() ;
 	mState = state ;
 	if(mState == STATE_READY)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ;
 	}
+	unlock() ;
 }
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
 {
 	ePerformState state ;
 
-	{
-		LLMutexLock lock(mMutexp) ;
-		state = mState ;
-	}
+	lock() ;
+	state = mState ;
+	unlock() ;
 
 	return state ;
 }
@@ -628,15 +635,13 @@ bool LLCurl::Multi::waitToComplete()
 
 	bool completed ;
 
+	lock() ;
+	completed = (STATE_COMPLETED == mState) ;
+	if(!completed)
 	{
-		LLMutexLock lock(mMutexp) ;
-
-		completed = (STATE_COMPLETED == mState) ;
-		if(!completed)
-		{
-			LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
-		}
+		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
 	}
+	unlock() ;
 
 	return completed;
 }
@@ -650,8 +655,10 @@ CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 //return true if dead
 bool LLCurl::Multi::doPerform()
 {
-	LLMutexLock lock(mDeletionMutexp) ;
-	
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->lock() ;
+	}
 	bool dead = mDead ;
 
 	if(mDead)
@@ -668,8 +675,6 @@ bool LLCurl::Multi::doPerform()
 				call_count < MULTI_PERFORM_CALL_REPEAT;
 				call_count++)
 		{
-			LLMutexLock lock(mMutexp) ;
-
 			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
 			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
 			{
@@ -683,6 +688,11 @@ bool LLCurl::Multi::doPerform()
 		setState(STATE_COMPLETED) ;
 	}
 
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->unlock() ;
+	}
+
 	return dead ;
 }
 
@@ -754,8 +764,6 @@ LLCurl::Easy* LLCurl::Multi::allocEasy()
 
 bool LLCurl::Multi::addEasy(Easy* easy)
 {
-	LLMutexLock lock(mMutexp) ;
-
 	CURLMcode mcode = curl_multi_add_handle(mCurlMultiHandle, easy->getCurlHandle());
 	check_curl_multi_code(mcode);
 	//if (mcode != CURLM_OK)
@@ -768,8 +776,6 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
-	LLMutexLock lock(mMutexp) ;
-
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
@@ -785,8 +791,6 @@ void LLCurl::Multi::easyFree(Easy* easy)
 
 void LLCurl::Multi::removeEasy(Easy* easy)
 {
-	LLMutexLock lock(mMutexp) ;
-
 	check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
 	easyFree(easy);
 }
-- 
GitLab


From 50a57ba9fec0435a990338398d5c4f23c5cc91f0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 9 Dec 2011 12:23:04 -0600
Subject: [PATCH 405/933] Backed out changeset fafd857891b1

---
 indra/llcommon/llthread.h  | 11 ++------
 indra/llmessage/llcurl.cpp | 54 ++++++++++++++++++++------------------
 2 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index b0a1c9e12b7..40291a25693 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -187,18 +187,11 @@ class LLMutexLock
 	LLMutexLock(LLMutex* mutex)
 	{
 		mMutex = mutex;
-
-		if(mMutex)
-		{
-			mMutex->lock();
-		}
+		mMutex->lock();
 	}
 	~LLMutexLock()
 	{
-		if(mMutex)
-		{
-			mMutex->unlock();
-		}
+		mMutex->unlock();
 	}
 private:
 	LLMutex* mMutex;
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 228f0391327..7ca25d07fce 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -585,30 +585,37 @@ void LLCurl::Multi::unlock()
 
 void LLCurl::Multi::markDead()
 {
-	LLMutexLock lock(mDeletionMutexp) ;
-	
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->lock() ;
+	}
+
 	mDead = TRUE ;
+
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->unlock() ;
+	}
 }
 
 void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 {
-	LLMutexLock lock(mMutexp) ;
-
+	lock() ;
 	mState = state ;
 	if(mState == STATE_READY)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ;
 	}
+	unlock() ;
 }
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
 {
 	ePerformState state ;
 
-	{
-		LLMutexLock lock(mMutexp) ;
-		state = mState ;
-	}
+	lock() ;
+	state = mState ;
+	unlock() ;
 
 	return state ;
 }
@@ -628,15 +635,13 @@ bool LLCurl::Multi::waitToComplete()
 
 	bool completed ;
 
+	lock() ;
+	completed = (STATE_COMPLETED == mState) ;
+	if(!completed)
 	{
-		LLMutexLock lock(mMutexp) ;
-
-		completed = (STATE_COMPLETED == mState) ;
-		if(!completed)
-		{
-			LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
-		}
+		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
 	}
+	unlock() ;
 
 	return completed;
 }
@@ -650,8 +655,10 @@ CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 //return true if dead
 bool LLCurl::Multi::doPerform()
 {
-	LLMutexLock lock(mDeletionMutexp) ;
-	
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->lock() ;
+	}
 	bool dead = mDead ;
 
 	if(mDead)
@@ -668,8 +675,6 @@ bool LLCurl::Multi::doPerform()
 				call_count < MULTI_PERFORM_CALL_REPEAT;
 				call_count++)
 		{
-			LLMutexLock lock(mMutexp) ;
-
 			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
 			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
 			{
@@ -683,6 +688,11 @@ bool LLCurl::Multi::doPerform()
 		setState(STATE_COMPLETED) ;
 	}
 
+	if(mDeletionMutexp)
+	{
+		mDeletionMutexp->unlock() ;
+	}
+
 	return dead ;
 }
 
@@ -754,8 +764,6 @@ LLCurl::Easy* LLCurl::Multi::allocEasy()
 
 bool LLCurl::Multi::addEasy(Easy* easy)
 {
-	LLMutexLock lock(mMutexp) ;
-
 	CURLMcode mcode = curl_multi_add_handle(mCurlMultiHandle, easy->getCurlHandle());
 	check_curl_multi_code(mcode);
 	//if (mcode != CURLM_OK)
@@ -768,8 +776,6 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
-	LLMutexLock lock(mMutexp) ;
-
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
@@ -785,8 +791,6 @@ void LLCurl::Multi::easyFree(Easy* easy)
 
 void LLCurl::Multi::removeEasy(Easy* easy)
 {
-	LLMutexLock lock(mMutexp) ;
-
 	check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
 	easyFree(easy);
 }
-- 
GitLab


From a7b04c9dd44274b3548402de2f4a9b8bc20e3e50 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 9 Dec 2011 10:31:16 -0800
Subject: [PATCH 406/933] * Removed old inventory window outbox. * Added
 centered progress indicator for outbox.

---
 indra/newview/llfloateroutbox.cpp             |  38 ++-
 indra/newview/llfloateroutbox.h               |   2 +-
 indra/newview/llinventorybridge.cpp           |   2 +-
 indra/newview/llinventorypanel.cpp            |   9 +-
 indra/newview/llpanelmaininventory.cpp        |   2 +-
 indra/newview/llpanelmarketplaceinbox.cpp     |   2 +-
 indra/newview/llpanelmarketplaceoutbox.cpp    |   4 +-
 indra/newview/llsidepanelinventory.cpp        | 272 +-----------------
 indra/newview/llsidepanelinventory.h          |  14 +-
 .../xui/en/floater_merchant_outbox.xml        |  60 ++--
 .../default/xui/en/sidepanel_inventory.xml    | 135 +--------
 11 files changed, 80 insertions(+), 460 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 79cd90ba1c0..6a3eaba0161 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -32,7 +32,6 @@
 #include "llfolderview.h"
 #include "llinventoryobserver.h"
 #include "llinventorypanel.h"
-#include "llloadingindicator.h"
 #include "llmarketplacefunctions.h"
 #include "llnotificationsutil.h"
 #include "lltextbox.h"
@@ -96,15 +95,24 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
 
 LLFloaterOutbox::~LLFloaterOutbox()
 {
-//	delete mCategoriesObserver;
-//	delete mCategoryAddedObserver;
+	if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver))
+	{
+		gInventory.removeObserver(mCategoriesObserver);
+	}
+	delete mCategoriesObserver;
+	
+	if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
+	{
+		gInventory.removeObserver(mCategoryAddedObserver);
+	}
+	delete mCategoryAddedObserver;
 }
 
 BOOL LLFloaterOutbox::postBuild()
 {
 	mInventoryDisablePanel = getChild<LLView>("outbox_inventory_disable_panel");
 	mInventoryFolderCountText = getChild<LLTextBox>("outbox_folder_count");
-	mInventoryImportInProgress = getChild<LLLoadingIndicator>("import_progress_indicator");
+	mInventoryImportInProgress = getChild<LLView>("import_progress_indicator");
 	mInventoryPlaceholder = getChild<LLView>("outbox_inventory_placeholder_panel");
 	mInventoryText = mInventoryPlaceholder->getChild<LLTextBox>("outbox_inventory_placeholder_text");
 	mInventoryTitle = mInventoryPlaceholder->getChild<LLTextBox>("outbox_inventory_placeholder_title");
@@ -264,6 +272,11 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 										std::string& tooltip_msg)
 {
 	// Pass drag and drop to this floater to the outbox inventory control
+	
+	if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress())
+	{
+		return FALSE;
+	}
 
 	S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft;
 	S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom;
@@ -317,11 +330,11 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
 {
 	if (status == MarketplaceErrorCodes::IMPORT_DONE)
 	{
-		LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap());
+		LLNotificationsUtil::add("OutboxImportComplete");
 	}
 	else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
 	{
-		LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
+		LLNotificationsUtil::add("OutboxImportHadErrors");
 	}
 	else
 	{
@@ -329,10 +342,10 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
 		sprintf(status_string, "%d", status);
 		
 		LLSD subs;
-		subs["ERROR_CODE"] = status_string;
+		subs["[ERROR_CODE]"] = status_string;
 		
 		//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
-		LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
+		LLNotificationsUtil::add("OutboxImportFailed", subs);
 	}
 }
 
@@ -343,19 +356,14 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 		mImportButton->setEnabled(false);
 		
 		mInventoryDisablePanel->setVisible(true);
-
 		mInventoryImportInProgress->setVisible(true);
-		mInventoryImportInProgress->reset();
-		mInventoryImportInProgress->start();
 	}
 	else
 	{
-		mImportButton->setEnabled(mOutboxItemCount > 0);
-		
+		mInventoryImportInProgress->setVisible(false);
 		mInventoryDisablePanel->setVisible(false);
 
-		mInventoryImportInProgress->stop();
-		mInventoryImportInProgress->setVisible(false);
+		mImportButton->setEnabled(mOutboxItemCount > 0);
 	}
 }
 
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 1e8567ef124..9b6568c69c4 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -81,7 +81,7 @@ class LLFloaterOutbox : public LLFloater
 	
 	LLView *				mInventoryDisablePanel;
 	LLTextBox *				mInventoryFolderCountText;
-	LLLoadingIndicator *	mInventoryImportInProgress;
+	LLView *				mInventoryImportInProgress;
 	LLView *				mInventoryPlaceholder;
 	LLTextBox *				mInventoryText;
 	LLTextBox *				mInventoryTitle;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 017dabe2adb..33b9af7a789 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -71,7 +71,7 @@
 #include "llwearablelist.h"
 
 // Marketplace outbox current disabled
-#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1	// keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL
+#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
 typedef std::list<two_uuids_t> two_uuids_list_t;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 80b53d5702a..af1d2b8528f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1157,7 +1157,6 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
 		LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id);
 		
 		bool in_inbox = false;
-		bool in_outbox = false;
 		
 		LLViewerInventoryCategory * parent_cat = NULL;
 		
@@ -1173,10 +1172,9 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
 		if (parent_cat)
 		{
 			in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType());
-			in_outbox = (LLFolderType::FT_OUTBOX == parent_cat->getPreferredType());
 		}
 		
-		if (in_inbox || in_outbox)
+		if (in_inbox)
 		{
 			LLSidepanelInventory * sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
 			LLInventoryPanel * inventory_panel = NULL;
@@ -1186,11 +1184,6 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
 				sidepanel_inventory->openInbox();
 				inventory_panel = sidepanel_inventory->getInboxPanel();
 			}
-			else
-			{
-				sidepanel_inventory->openOutbox();
-				inventory_panel = sidepanel_inventory->getOutboxPanel();
-			}
 
 			if (inventory_panel)
 			{
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 68ef13cd68e..374afb90be4 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -593,7 +593,7 @@ void LLPanelMainInventory::onFocusReceived()
 		return;
 	}
 
-	sidepanel_inventory->clearSelections(false, true, true);
+	sidepanel_inventory->clearSelections(false, true);
 }
 
 void LLPanelMainInventory::setFilterTextFromFilter() 
diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp
index 7cb4bbf891d..a5e964f5633 100644
--- a/indra/newview/llpanelmarketplaceinbox.cpp
+++ b/indra/newview/llpanelmarketplaceinbox.cpp
@@ -109,7 +109,7 @@ void LLPanelMarketplaceInbox::onFocusReceived()
 	LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
 	if (sidepanel_inventory)
 	{
-		sidepanel_inventory->clearSelections(true, false, true);
+		sidepanel_inventory->clearSelections(true, false);
 	}
 
 	gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index e3af7fd9066..6c2363eb7fb 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -84,6 +84,8 @@ BOOL LLPanelMarketplaceOutbox::postBuild()
 	return TRUE;
 }
 
+// DO WE NEED THIS FILE AT ALL?
+
 void LLPanelMarketplaceOutbox::handleLoginComplete()
 {
 	mImportButton = getChild<LLButton>("outbox_import_btn");
@@ -100,7 +102,7 @@ void LLPanelMarketplaceOutbox::onFocusReceived()
 	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
 	if (sidepanel_inventory)
 	{
-		sidepanel_inventory->clearSelections(true, true, false);
+		sidepanel_inventory->clearSelections(true, true);
 	}
 }
 
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 9c551be2d56..eade91798bf 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -47,7 +47,6 @@
 #include "lloutfitobserver.h"
 #include "llpanelmaininventory.h"
 #include "llpanelmarketplaceinbox.h"
-#include "llpanelmarketplaceoutbox.h"
 #include "llselectmgr.h"
 #include "llsidepaneliteminfo.h"
 #include "llsidepaneltaskinfo.h"
@@ -68,26 +67,17 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
 // No longer want the inbox panel to auto-expand since it creates issues with the "new" tag time stamp
 #define AUTO_EXPAND_INBOX	0
 
-// Temporarily disabling the outbox until we straighten out the API
-#define ENABLE_MERCHANT_OUTBOX_PANEL		1	// keep in sync with ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
-
 static const char * const INBOX_BUTTON_NAME = "inbox_btn";
-static const char * const OUTBOX_BUTTON_NAME = "outbox_btn";
-
 static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
-static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel";
-
 static const char * const INBOX_OUTBOX_LAYOUT_PANEL_NAME = "inbox_outbox_layout_panel";
 static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel";
 
 static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox";
-static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox";
 
 static const char * const INBOX_OUTBOX_LAYOUT_STACK_NAME = "inbox_outbox_layout_stack";
 static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
 
 static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
-static const char * const MARKETPLACE_OUTBOX_PANEL = "marketplace_outbox";
 
 //
 // Helpers
@@ -116,10 +106,6 @@ class LLInboxOutboxAddedObserver : public LLInventoryCategoryAddedObserver
 					mSidepanelInventory->enableInbox(true);
 					mSidepanelInventory->observeInboxModifications(added_category->getUUID());
 					break;
-				case LLFolderType::FT_OUTBOX:
-					mSidepanelInventory->enableOutbox(true);
-					mSidepanelInventory->observeOutboxModifications(added_category->getUUID());
-					break;
 				default:
 					break;
 			}
@@ -138,10 +124,8 @@ LLSidepanelInventory::LLSidepanelInventory()
 	: LLPanel()
 	, mItemPanel(NULL)
 	, mInventoryPanelInbox(NULL)
-	, mInventoryPanelOutbox(NULL)
 	, mPanelMainInventory(NULL)
 	, mInboxEnabled(false)
-	, mOutboxEnabled(false)
 	, mCategoriesObserver(NULL)
 	, mInboxOutboxAddedObserver(NULL)
 {
@@ -172,15 +156,6 @@ void handleInventoryDisplayInboxChanged()
 	}
 }
 
-void handleInventoryDisplayOutboxChanged()
-{
-	LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
-	if (sidepanel_inventory)
-	{
-		sidepanel_inventory->enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox"));
-	}
-}
-
 BOOL LLSidepanelInventory::postBuild()
 {
 	// UI elements from inventory panel
@@ -255,30 +230,23 @@ BOOL LLSidepanelInventory::postBuild()
 		
 		LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME);
 
-		// Collapse both inbox and outbox panels
+		// Collapse inbox panel
 		inout_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
-		inout_stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true);
 		
 		// Set up button states and callbacks
 		LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME);
-		LLButton * outbox_button = getChild<LLButton>(OUTBOX_BUTTON_NAME);
 
 		inbox_button->setToggleState(false);
-		outbox_button->setToggleState(false);
-
 		inbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this));
-		outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this));
 
-		// Set the inbox and outbox visible based on debug settings (final setting comes from http request below)
+		// Set the inbox visible based on debug settings (final setting comes from http request below)
 		enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
-		enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox"));
 
-		// Trigger callback for after login so we can setup to track inbox and outbox changes after initial inventory load
+		// Trigger callback for after login so we can setup to track inbox changes after initial inventory load
 		LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::updateInboxOutbox, this));
 	}
 
 	gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged));
-	gSavedSettings.getControl("InventoryDisplayOutbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayOutboxChanged));
 
 	// Update the verbs buttons state.
 	updateVerbs();
@@ -289,40 +257,27 @@ BOOL LLSidepanelInventory::postBuild()
 void LLSidepanelInventory::updateInboxOutbox()
 {
 	//
-	// Track inbox and outbox folder changes
+	// Track inbox folder changes
 	//
 
 	const bool do_not_create_folder = false;
 	const bool do_not_find_in_library = false;
 
 	const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library);
-	const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library);
 	
 	// Set up observer to listen for creation of inbox and outbox if at least one of them doesn't exist
-	if (inbox_id.isNull() || outbox_id.isNull())
+	if (inbox_id.isNull())
 	{
 		observeInboxOutboxCreation();
 	}
-
 	// Set up observer for inbox changes, if we have an inbox already
-	if (!inbox_id.isNull())
+	else 
 	{
 		// Enable the display of the inbox if it exists
 		enableInbox(true);
 
 		observeInboxModifications(inbox_id);
 	}
-	
-#if ENABLE_MERCHANT_OUTBOX_PANEL
-	// Set up observer for outbox changes, if we have an outbox already
-	if (!outbox_id.isNull())
-	{
-		// Enable the display of the outbox if it exists
-		enableOutbox(true);
-
-		observeOutboxModifications(outbox_id);
-	}
-#endif
 }
 
 void LLSidepanelInventory::observeInboxOutboxCreation()
@@ -342,7 +297,7 @@ void LLSidepanelInventory::observeInboxOutboxCreation()
 void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID)
 {
 	//
-	// Track inbox and outbox folder changes
+	// Track inbox folder changes
 	//
 	
 	if (inboxID.isNull())
@@ -373,35 +328,6 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID)
 	mInventoryPanelInbox = inbox->setupInventoryPanel();
 }
 
-
-void LLSidepanelInventory::observeOutboxModifications(const LLUUID& outboxID)
-{
-	//
-	// Track outbox folder changes
-	//
-	
-	if (outboxID.isNull())
-	{
-		llwarns << "Attempting to track modifications to non-existant outbox" << llendl;
-		return;
-	}
-	
-	if (mCategoriesObserver == NULL)
-	{
-		mCategoriesObserver = new LLInventoryCategoriesObserver();
-		gInventory.addObserver(mCategoriesObserver);
-	}
-	
-	mCategoriesObserver->addCategory(outboxID, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outboxID));
-	
-	//
-	// Set up the outbox inventory view
-	//
-	
-	LLPanelMarketplaceOutbox * outbox = getChild<LLPanelMarketplaceOutbox>(MARKETPLACE_OUTBOX_PANEL);
-	mInventoryPanelOutbox = outbox->setupInventoryPanel();
-}
-
 void LLSidepanelInventory::enableInbox(bool enabled)
 {
 	mInboxEnabled = enabled;
@@ -414,39 +340,6 @@ void LLSidepanelInventory::enableInbox(bool enabled)
 		LLLayoutPanel * inout_layout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
 
 		inout_layout_panel->setVisible(TRUE);
-		
-		if (mOutboxEnabled)
-		{
-			S32 inbox_min_dim = inbox_layout_panel->getMinDim();
-			S32 outbox_min_dim = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->getMinDim();
-			
-			inout_layout_panel->setMinDim(inbox_min_dim + outbox_min_dim);
-		}
-	}
-}
-
-void LLSidepanelInventory::enableOutbox(bool enabled)
-{
-	mOutboxEnabled = enabled;
-	
-	LLLayoutPanel * outbox_layout_panel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
-	outbox_layout_panel->setVisible(enabled);
-
-	if (mOutboxEnabled)
-	{
-		LLLayoutPanel * inout_layout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
-		
-		inout_layout_panel->setVisible(TRUE);
-		
-		if (mInboxEnabled)
-		{
-			S32 inbox_min_dim = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->getMinDim();
-			S32 outbox_min_dim = outbox_layout_panel->getMinDim();
-			
-			inout_layout_panel->setMinDim(inbox_min_dim + outbox_min_dim);
-		}
-		
-		updateOutboxUserStatus();
 	}
 }
 
@@ -459,30 +352,12 @@ void LLSidepanelInventory::openInbox()
 	}
 }
 
-void LLSidepanelInventory::openOutbox()
-{
-	if (mOutboxEnabled)
-	{
-		getChild<LLButton>(OUTBOX_BUTTON_NAME)->setToggleState(true);
-		onToggleOutboxBtn();
-	}
-}
-
 void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id)
 {
 	// Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting
 	LLInventoryModelBackgroundFetch::instance().start(inbox_id);
 
 #if AUTO_EXPAND_INBOX
-	// If the outbox is expanded, don't auto-expand the inbox
-	if (mOutboxEnabled)
-	{
-		if (getChild<LLButton>(OUTBOX_BUTTON_NAME)->getToggleState())
-		{
-			return;
-		}
-	}
-
 	// Expand the inbox since we have fresh items and the outbox is not expanded
 	if (mInboxEnabled)
 	{
@@ -492,21 +367,9 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id)
 #endif
 }
 
-void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id)
-{
-	// Expand the outbox since we have new items in it
-	if (mOutboxEnabled)
-	{
-		getChild<LLButton>(OUTBOX_BUTTON_NAME)->setToggleState(true);
-		onToggleOutboxBtn();
-	}	
-}
-
-bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel,
-							 LLButton * otherButton, LLLayoutPanel * otherPanel)
+bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel)
 {
 	bool expand = pressedButton->getToggleState();
-	bool otherExpanded = otherButton->getToggleState();
 
 	LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
 	LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME);
@@ -516,27 +379,12 @@ bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLL
 	inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand);
 	inv_stack->collapsePanel(inout_panel, !expand);
 
-	// Collapse other marketplace panel if it is expanded
-	if (expand && otherExpanded)
-	{
-		// Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size
-		pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight());
-
-		inout_stack->collapsePanel(otherPanel, true);
-		otherButton->setToggleState(false);
-	}
-	else
 	{
 		// NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate
 		// properly to the child panels.
 
 		S32 new_height = inout_panel->getRect().getHeight();
 
-		if (otherPanel->getVisible())
-		{
-			new_height -= otherPanel->getMinDim();
-		}
-
 		pressedPanel->reshape(pressedPanel->getRect().getWidth(), new_height);
 	}
 
@@ -550,10 +398,8 @@ void LLSidepanelInventory::onToggleInboxBtn()
 {
 	LLButton* inboxButton = getChild<LLButton>(INBOX_BUTTON_NAME);
 	LLLayoutPanel* inboxPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
-	LLButton* outboxButton = getChild<LLButton>(OUTBOX_BUTTON_NAME);
-	LLLayoutPanel* outboxPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
 
-	const bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel, outboxButton, outboxPanel);
+	const bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel);
 
 	if (inbox_expanded && inboxPanel->isInVisibleChain())
 	{
@@ -561,16 +407,6 @@ void LLSidepanelInventory::onToggleInboxBtn()
 	}
 }
 
-void LLSidepanelInventory::onToggleOutboxBtn()
-{
-	LLButton* inboxButton = getChild<LLButton>(INBOX_BUTTON_NAME);
-	LLLayoutPanel* inboxPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
-	LLButton* outboxButton = getChild<LLButton>(OUTBOX_BUTTON_NAME);
-	LLLayoutPanel* outboxPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME);
-
-	manageInboxOutboxPanels(outboxButton, outboxPanel, inboxButton, inboxPanel);
-}
-
 void LLSidepanelInventory::onOpen(const LLSD& key)
 {
 	LLFirstUse::newInventory(false);
@@ -740,77 +576,6 @@ void LLSidepanelInventory::showInventoryPanel()
 	updateVerbs();
 }
 
-void LLSidepanelInventory::updateOutboxUserStatus()
-{
-	const bool isMerchant = (gSavedSettings.getString("InventoryMarketplaceUserStatus") == "merchant");
-	const bool hasOutbox = !gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false).isNull();
-	
-	LLView * outbox_placeholder = getChild<LLView>("outbox_inventory_placeholder_panel");
-	LLView * outbox_placeholder_parent = outbox_placeholder->getParent();
-	
-	LLTextBox * outbox_title_box = outbox_placeholder->getChild<LLTextBox>("outbox_inventory_placeholder_title");
-	LLTextBox * outbox_text_box = outbox_placeholder->getChild<LLTextBox>("outbox_inventory_placeholder_text");
-
-	std::string outbox_text;
-	std::string outbox_title;
-	std::string outbox_tooltip;
-
-	if (isMerchant)
-	{
-		if (hasOutbox)
-		{
-			outbox_text = LLTrans::getString("InventoryOutboxNoItems");
-			outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle");
-			outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip");
-		}
-		else
-		{
-			outbox_text = LLTrans::getString("InventoryOutboxCreationError");
-			outbox_title = LLTrans::getString("InventoryOutboxCreationErrorTitle");
-			outbox_tooltip = LLTrans::getString("InventoryOutboxCreationErrorTooltip");
-		}
-	}
-	else
-	{
-		//
-		// The string to become a merchant contains 3 URL's which need the domain name patched in.
-		//
-		
-		std::string domain = "secondlife.com";
-		
-		if (!LLGridManager::getInstance()->isInProductionGrid())
-		{
-			std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
-			domain = llformat("%s.lindenlab.com", utf8str_tolower(gridLabel).c_str());
-		}
-		
-		LLStringUtil::format_map_t domain_arg;
-		domain_arg["[DOMAIN_NAME]"] = domain;
-
-		std::string marketplace_url = LLTrans::getString("MarketplaceURL", domain_arg);
-		std::string marketplace_url_create = LLTrans::getString("MarketplaceURL_CreateStore", domain_arg);
-		std::string marketplace_url_info = LLTrans::getString("MarketplaceURL_LearnMore", domain_arg);
-		
-		LLStringUtil::format_map_t args1, args2, args3;
-		args1["[MARKETPLACE_URL]"] = marketplace_url;
-		args2["[LEARN_MORE_URL]"] = marketplace_url_info;
-		args3["[CREATE_STORE_URL]"] = marketplace_url_create;
-		
-		// NOTE: This is dumb, ridiculous and very finicky.  The order of these is very important
-		//       to have these three string substitutions work properly.
-		outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", args1);
-		LLStringUtil::format(outbox_text, args2);
-		LLStringUtil::format(outbox_text, args3);
-
-		outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle");
-		outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip");
-	}
-	
-	outbox_text_box->setValue(outbox_text);
-	outbox_title_box->setValue(outbox_title);
-	outbox_placeholder_parent->setToolTip(outbox_tooltip);
-}
-
 void LLSidepanelInventory::updateVerbs()
 {
 	mInfoBtn->setEnabled(FALSE);
@@ -929,13 +694,6 @@ U32 LLSidepanelInventory::getSelectedCount()
 		count += selection_list.size();
 	}
 
-	if ((count == 0) && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
-	{
-		selection_list = mInventoryPanelOutbox->getRootFolder()->getSelectionList();
-		
-		count += selection_list.size();
-	}
-
 	return count;
 }
 
@@ -957,7 +715,7 @@ BOOL LLSidepanelInventory::isMainInventoryPanelActive() const
 	return mInventoryPanel->getVisible();
 }
 
-void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox, bool clearOutbox)
+void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox)
 {
 	if (clearMain)
 	{
@@ -974,11 +732,6 @@ void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox, bool
 		mInventoryPanelInbox->clearSelection();
 	}
 	
-	if (clearOutbox && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
-	{
-		mInventoryPanelOutbox->clearSelection();
-	}
-	
 	updateVerbs();
 }
 
@@ -991,10 +744,5 @@ std::set<LLUUID> LLSidepanelInventory::getInboxOrOutboxSelectionList()
 		inventory_selected_uuids = mInventoryPanelInbox->getRootFolder()->getSelectionList();
 	}
 	
-	if (inventory_selected_uuids.empty() && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
-	{
-		inventory_selected_uuids = mInventoryPanelOutbox->getRootFolder()->getSelectionList();
-	}
-	
 	return inventory_selected_uuids;
 }
diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h
index 2c6f8070139..915db727d68 100644
--- a/indra/newview/llsidepanelinventory.h
+++ b/indra/newview/llsidepanelinventory.h
@@ -52,19 +52,17 @@ class LLSidepanelInventory : public LLPanel
 public:
 	void observeInboxOutboxCreation();
 	void observeInboxModifications(const LLUUID& inboxID);
-	void observeOutboxModifications(const LLUUID& outboxID);
 
 	/*virtual*/ BOOL postBuild();
 	/*virtual*/ void onOpen(const LLSD& key);
 
 	LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any.
 	LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox; }
-	LLInventoryPanel* getOutboxPanel() const { return mInventoryPanelOutbox; }
 
 	LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; }
 	BOOL isMainInventoryPanelActive() const;
 
-	void clearSelections(bool clearMain, bool clearInbox, bool clearOutbox);
+	void clearSelections(bool clearMain, bool clearInbox);
 	std::set<LLUUID> getInboxOrOutboxSelectionList();
 
 	void showItemInfoPanel();
@@ -75,18 +73,13 @@ class LLSidepanelInventory : public LLPanel
 	bool canShare();
 
 	void onToggleInboxBtn();
-	void onToggleOutboxBtn();
 
 	void enableInbox(bool enabled);
-	void enableOutbox(bool enabled);
 	
 	void openInbox();
-	void openOutbox();
 	
 	bool isInboxEnabled() const { return mInboxEnabled; }
-	bool isOutboxEnabled() const { return mOutboxEnabled; }
 
-	void updateOutboxUserStatus();
 	void updateVerbs();
 
 protected:
@@ -100,9 +93,8 @@ class LLSidepanelInventory : public LLPanel
 	bool canWearSelected(); // check whether selected items can be worn
 
 	void onInboxChanged(const LLUUID& inbox_id);
-	void onOutboxChanged(const LLUUID& outbox_id);
 
-	bool manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel, LLButton * otherButton, LLLayoutPanel * otherPanel);
+	bool manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel);
 
 	//
 	// UI Elements
@@ -110,7 +102,6 @@ class LLSidepanelInventory : public LLPanel
 private:
 	LLPanel*					mInventoryPanel; // Main inventory view
 	LLInventoryPanel*			mInventoryPanelInbox;
-	LLInventoryPanel*			mInventoryPanelOutbox;
 	LLSidepanelItemInfo*		mItemPanel; // Individual item view
 	LLSidepanelTaskInfo*		mTaskPanel; // Individual in-world object view
 	LLPanelMainInventory*		mPanelMainInventory;
@@ -135,7 +126,6 @@ class LLSidepanelInventory : public LLPanel
 	LLButton*					mShopBtn;
 
 	bool						mInboxEnabled;
-	bool						mOutboxEnabled;
 
 	LLInventoryCategoriesObserver* 			mCategoriesObserver;
 	LLInboxOutboxAddedObserver*				mInboxOutboxAddedObserver;
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 86e27cbc71c..f0b29f22484 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -6,7 +6,7 @@
  height="440"
  help_topic="floater_merchant_outbox"
  min_width="300"
- min_height="240"
+ min_height="100"
  name="floater_merchant_outbox"
  save_rect="true"
  save_visibility="true"
@@ -49,7 +49,7 @@
 			<text
 				name="outbox_inventory_placeholder_title"
 				type="string"
-				follows="all"
+				follows="top|left|right"
 				layout="topleft"
 				top="10"
 				left="0"
@@ -63,7 +63,7 @@
 			<text
 				name="outbox_inventory_placeholder_text"
 				type="string"
-				follows="all"
+				follows="top|left|right"
 				layout="topleft"
 				top="35"
 				left="0"
@@ -73,27 +73,6 @@
 				halign="left" />
 		</panel>
     </panel>
-	<panel
-		name="outbox_inventory_disable_panel"
-        follows="all"
-        left="0"
-        bottom="440"
-        width="333"
-        top="0"
-        bg_opaque_color="White_50"
-        background_visible="true"
-        background_opaque="true"
-		visible="false"
-        />
-	<loading_indicator
-		 follows="all"
-		 height="65"
-		 layout="topleft"
-		 left="140"
-		 name="import_progress_indicator"
-		 top="180"
-		 visible="false"
-		 width="45" />
 	<panel
         follows="bottom|left|right"
         left="10"
@@ -116,7 +95,7 @@
 			wrap="true"
 			halign="left"
 			valign="baseline"
-			font="SansSerifBold" />
+			font="SansSerif" />
 		<button
 			 label="Send to Marketplace"
 			 tool_tip="Push to my Marketplace Storefront"
@@ -131,5 +110,36 @@
 			 width="200"
 			 enabled="false" />
     </panel>
+	<panel
+		name="outbox_inventory_disable_panel"
+        follows="all"
+        left="0"
+        bottom="440"
+        width="333"
+        top="0"
+        bg_opaque_color="White_50"
+        background_visible="true"
+        background_opaque="true"
+		visible="false"
+        />
+	<layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
+		<layout_panel />
+		<layout_panel height="45" auto_resize="false">
+			<layout_stack orientation="horizontal" left="0" height="45" top="0" width="333" follows="all">
+				<layout_panel width="0" />
+				<layout_panel width="45" auto_resize="false">
+					<loading_indicator
+						 height="45"
+						 layout="topleft"
+						 left="0"
+						 top="0"
+						 width="45"
+						 />
+				</layout_panel>
+				<layout_panel width="0" />
+			</layout_stack>
+		 </layout_panel>
+		 <layout_panel />
+	</layout_stack>
  </panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 9f3c57fa0f7..0b14fd0459a 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -153,139 +153,8 @@
                     </panel>
                  </panel>
              </layout_panel>
-             <layout_panel
-                 width="330"
-                 layout="topleft"
-                 auto_resize="true"
-                 user_resize="false"
-                 follows="all"
-                 name="outbox_layout_panel"
-                 visible="false"
-                 min_dim="35"
-                 max_dim="200"
-                 expanded_min_dim="90"
-                 height="200">
-                 <panel
-                      follows="all"
-                      layout="topleft"
-                      left="0"
-                      name="marketplace_outbox"
-                      class="panel_marketplace_outbox"
-                      top="0"
-                      label=""
-                      height="200"
-                      width="330">
-                     <string name="OutboxLabelWithArg">Merchant outbox ([NUM])</string>
-                     <string name="OutboxLabelNoArg">Merchant outbox</string>
-                     <button
-                        label="Merchant outbox"
-                        font="SansSerifMedium"
-                        name="outbox_btn"
-                        height="35"
-                        width="308"
-                        image_unselected="MarketplaceBtn_Off"
-                        image_selected="MarketplaceBtn_Selected"
-                        halign="left"
-                        handle_right_mouse="false"
-                        follows="top|left|right"
-                        is_toggle="true"
-                        tab_stop="false"
-                        pad_left="35"
-                        top="0"
-                        left="10" />
-                     <button
-                         image_unselected="OutboxPush_Off"
-                         image_selected="OutboxPush_Selected"
-                         image_hover_selected="OutboxPush_Selected_Over"
-                         image_hover_unselected="OutboxPush_Over"
-                         image_disabled_selected="OutboxPush_Selected_Disabled"
-                         image_disabled="OutboxPush_Disabled"
-                         image_pressed="OutboxPush_Press"
-                         image_pressed_selected="OutboxPush_Selected_Press"
-                         label=""
-                         tool_tip="Push to my Marketplace Storefront"
-                         is_toggle="false"
-                         name="outbox_import_btn"
-                         follows="top|right"
-                         tab_stop="false"
-                         halign="center"
-                         top="6"
-                         left="-50"
-                         height="23"
-                         width="32"
-                         enabled="false" />
-                     <loading_indicator
-                        follows="top|right"
-                        name="outbox_import_indicator"
-                        top="6"
-                        left="-50"
-                        height="23"
-                        width="32"
-                        images_per_sec="1.15"
-                        tab_stop="false"
-                        visible="false">
-                         <images>
-                             <image name="OutboxPush_Progress_1"/>
-                             <image name="OutboxPush_Progress_2"/>
-                             <image name="OutboxPush_Progress_3"/>
-                             <image name="OutboxPush_Progress_4"/>
-                             <image name="OutboxPush_Progress_5"/>
-                             <image name="OutboxPush_Progress_6"/>
-                         </images>
-                     </loading_indicator>
-                     <panel
-                        follows="all"
-                        left="10"
-                        bottom="200"
-                        width="308"
-                        top="35"
-                        bg_opaque_color="InventoryBackgroundColor"
-                        background_visible="true"
-                        background_opaque="true"
-                        >
-						<panel
-							name="outbox_inventory_placeholder_panel"
-							follows="all"
-							layout="topleft"
-							top="0"
-							left="0"
-							width="308"
-							height="165"
-							bg_opaque_color="InventoryBackgroundColor"
-							background_visible="true"
-							background_opaque="true"
-							>
-							<text
-								name="outbox_inventory_placeholder_title"
-								type="string"
-								follows="all"
-								layout="topleft"
-								top="10"
-								left="0"
-								width="308"
-								height="25"
-								wrap="true"
-								halign="center"
-								font="SansSerifBold">
-								Loading...
-							</text>
-							<text
-								name="outbox_inventory_placeholder_text"
-								type="string"
-								follows="all"
-								layout="topleft"
-								top="35"
-								left="0"
-								width="308"
-								height="130"
-								wrap="true"
-								halign="left" />
-						</panel>
-                    </panel>
-                 </panel>
-             </layout_panel>
-						 </layout_stack>
-						 </layout_panel>
+			 </layout_stack>
+			 </layout_panel>
          </layout_stack>
 		<panel
 		     follows="bottom|left|right"
-- 
GitLab


From bfefc1509ffc77ab223a525082ff070c74ee5b61 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Fri, 9 Dec 2011 15:19:21 -0500
Subject: [PATCH 407/933] Added tag DRTVWR-62_2.7.2-release, 2.7.2-release for
 changeset fe3a8e797307

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index bf9a40bb44d..1392b6a8a13 100644
--- a/.hgtags
+++ b/.hgtags
@@ -230,3 +230,5 @@ a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
 a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 3fe994349fae64fc40874bb59db387131eb35a41 DRTVWR-104_3.2.4-beta1
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
+fe3a8e7973072ea62043c08b19b66626c1a720eb DRTVWR-62_2.7.2-release
+fe3a8e7973072ea62043c08b19b66626c1a720eb 2.7.2-release
-- 
GitLab


From 8878a5e561f292a8afcd933eaafb2c4c65b7bf7f Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 9 Dec 2011 12:29:33 -0800
Subject: [PATCH 408/933] * Changed background opacity of outbox and inventory
 to match. * Removed superfluous marketplace layout stack, leftover from
 inbox/outbox in same inventory window.

---
 indra/newview/llavataractions.cpp             |  2 +-
 indra/newview/llfloateroutbox.cpp             | 40 ++++----
 indra/newview/llfloateroutbox.h               |  1 -
 indra/newview/llsidepanelinventory.cpp        | 92 ++++++-------------
 indra/newview/llsidepanelinventory.h          | 14 ++-
 .../xui/en/floater_merchant_outbox.xml        | 20 +---
 .../default/xui/en/panel_main_inventory.xml   |  7 --
 .../default/xui/en/panel_outbox_inventory.xml |  1 -
 .../default/xui/en/sidepanel_inventory.xml    | 50 +++-------
 9 files changed, 69 insertions(+), 158 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 8ca621538fa..e7e098e423b 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -707,7 +707,7 @@ std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
 		LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
 		if (sidepanel_inventory)
 		{
-			inventory_selected_uuids = sidepanel_inventory->getInboxOrOutboxSelectionList();
+			inventory_selected_uuids = sidepanel_inventory->getInboxSelectionList();
 		}
 	}
 
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 6a3eaba0161..619be87187c 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -83,7 +83,6 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
 	, mOutboxId(LLUUID::null)
 	, mOutboxInventoryPanel(NULL)
 	, mOutboxItemCount(0)
-	, mInventoryDisablePanel(NULL)
 	, mInventoryFolderCountText(NULL)
 	, mInventoryImportInProgress(NULL)
 	, mInventoryPlaceholder(NULL)
@@ -110,7 +109,6 @@ LLFloaterOutbox::~LLFloaterOutbox()
 
 BOOL LLFloaterOutbox::postBuild()
 {
-	mInventoryDisablePanel = getChild<LLView>("outbox_inventory_disable_panel");
 	mInventoryFolderCountText = getChild<LLTextBox>("outbox_folder_count");
 	mInventoryImportInProgress = getChild<LLView>("import_progress_indicator");
 	mInventoryPlaceholder = getChild<LLView>("outbox_inventory_placeholder_panel");
@@ -136,21 +134,24 @@ void LLFloaterOutbox::onOpen(const LLSD& key)
 	//
 	// Look for an outbox and set up the inventory API
 	//
-
-	const bool do_not_create_folder = false;
-	const bool do_not_find_in_library = false;
-	
-	const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library);
 	
-	if (outbox_id.isNull())
-	{
-		// Observe category creation to catch outbox creation
-		mCategoryAddedObserver = new LLOutboxAddedObserver(this);
-		gInventory.addObserver(mCategoryAddedObserver);
-	}
-	else
+	if (mOutboxId.isNull())
 	{
-		setupOutbox(outbox_id);
+		const bool do_not_create_folder = false;
+		const bool do_not_find_in_library = false;
+		
+		const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library);
+		
+		if (outbox_id.isNull())
+		{
+			// Observe category creation to catch outbox creation
+			mCategoryAddedObserver = new LLOutboxAddedObserver(this);
+			gInventory.addObserver(mCategoryAddedObserver);
+		}
+		else
+		{
+			setupOutbox(outbox_id);
+		}
 	}
 	
 	updateView();
@@ -164,10 +165,11 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	mOutboxId = outboxId;
 	
 	// No longer need to observe new category creation
-	if (mCategoryAddedObserver != NULL)
+	if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
 	{
 		gInventory.removeObserver(mCategoryAddedObserver);
-	}	
+		delete mCategoryAddedObserver;
+	}
 	
 	// Create observer for outbox modifications
 	mCategoriesObserver = new LLInventoryCategoriesObserver();
@@ -286,6 +288,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 
 void LLFloaterOutbox::onImportButtonClicked()
 {
+	mOutboxInventoryPanel->clearSelection();
+
 	LLMarketplaceInventoryImporter::instance().triggerImport();
 }
 
@@ -355,13 +359,11 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 	{
 		mImportButton->setEnabled(false);
 		
-		mInventoryDisablePanel->setVisible(true);
 		mInventoryImportInProgress->setVisible(true);
 	}
 	else
 	{
 		mInventoryImportInProgress->setVisible(false);
-		mInventoryDisablePanel->setVisible(false);
 
 		mImportButton->setEnabled(mOutboxItemCount > 0);
 	}
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 9b6568c69c4..3d2ce861449 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -79,7 +79,6 @@ class LLFloaterOutbox : public LLFloater
 	LLInventoryPanel *	mOutboxInventoryPanel;
 	U32					mOutboxItemCount;
 	
-	LLView *				mInventoryDisablePanel;
 	LLTextBox *				mInventoryFolderCountText;
 	LLView *				mInventoryImportInProgress;
 	LLView *				mInventoryPlaceholder;
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index eade91798bf..5cda381d102 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -69,12 +69,10 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
 
 static const char * const INBOX_BUTTON_NAME = "inbox_btn";
 static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
-static const char * const INBOX_OUTBOX_LAYOUT_PANEL_NAME = "inbox_outbox_layout_panel";
 static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel";
 
 static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox";
 
-static const char * const INBOX_OUTBOX_LAYOUT_STACK_NAME = "inbox_outbox_layout_stack";
 static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
 
 static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
@@ -83,10 +81,10 @@ static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
 // Helpers
 //
 
-class LLInboxOutboxAddedObserver : public LLInventoryCategoryAddedObserver
+class LLInboxAddedObserver : public LLInventoryCategoryAddedObserver
 {
 public:
-	LLInboxOutboxAddedObserver(LLSidepanelInventory * sidepanelInventory)
+	LLInboxAddedObserver(LLSidepanelInventory * sidepanelInventory)
 		: LLInventoryCategoryAddedObserver()
 		, mSidepanelInventory(sidepanelInventory)
 	{
@@ -127,7 +125,7 @@ LLSidepanelInventory::LLSidepanelInventory()
 	, mPanelMainInventory(NULL)
 	, mInboxEnabled(false)
 	, mCategoriesObserver(NULL)
-	, mInboxOutboxAddedObserver(NULL)
+	, mInboxAddedObserver(NULL)
 {
 	//buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
 }
@@ -140,11 +138,11 @@ LLSidepanelInventory::~LLSidepanelInventory()
 	}
 	delete mCategoriesObserver;
 	
-	if (mInboxOutboxAddedObserver && gInventory.containsObserver(mInboxOutboxAddedObserver))
+	if (mInboxAddedObserver && gInventory.containsObserver(mInboxAddedObserver))
 	{
-		gInventory.removeObserver(mInboxOutboxAddedObserver);
+		gInventory.removeObserver(mInboxAddedObserver);
 	}
-	delete mInboxOutboxAddedObserver;
+	delete mInboxAddedObserver;
 }
 
 void handleInventoryDisplayInboxChanged()
@@ -217,21 +215,16 @@ BOOL LLSidepanelInventory::postBuild()
 		}
 	}
 	
-	// Marketplace inbox/outbox setup
+	// Received items inbox setup
 	{
 		LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
 
 		// Disable user_resize on main inventory panel by default
 		inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false);
-		inv_stack->setPanelUserResize(INBOX_OUTBOX_LAYOUT_PANEL_NAME, false);
-
-		// Collapse marketplace panel by default
-		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME), true);
-		
-		LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME);
+		inv_stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false);
 
 		// Collapse inbox panel
-		inout_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
+		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
 		
 		// Set up button states and callbacks
 		LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME);
@@ -243,7 +236,7 @@ BOOL LLSidepanelInventory::postBuild()
 		enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
 
 		// Trigger callback for after login so we can setup to track inbox changes after initial inventory load
-		LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::updateInboxOutbox, this));
+		LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::updateInbox, this));
 	}
 
 	gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged));
@@ -254,7 +247,7 @@ BOOL LLSidepanelInventory::postBuild()
 	return TRUE;
 }
 
-void LLSidepanelInventory::updateInboxOutbox()
+void LLSidepanelInventory::updateInbox()
 {
 	//
 	// Track inbox folder changes
@@ -265,10 +258,10 @@ void LLSidepanelInventory::updateInboxOutbox()
 
 	const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library);
 	
-	// Set up observer to listen for creation of inbox and outbox if at least one of them doesn't exist
+	// Set up observer to listen for creation of inbox if at least one of them doesn't exist
 	if (inbox_id.isNull())
 	{
-		observeInboxOutboxCreation();
+		observeInboxCreation();
 	}
 	// Set up observer for inbox changes, if we have an inbox already
 	else 
@@ -280,17 +273,17 @@ void LLSidepanelInventory::updateInboxOutbox()
 	}
 }
 
-void LLSidepanelInventory::observeInboxOutboxCreation()
+void LLSidepanelInventory::observeInboxCreation()
 {
 	//
-	// Set up observer to track inbox and outbox folder creation
+	// Set up observer to track inbox folder creation
 	//
 	
-	if (mInboxOutboxAddedObserver == NULL)
+	if (mInboxAddedObserver == NULL)
 	{
-		mInboxOutboxAddedObserver = new LLInboxOutboxAddedObserver(this);
+		mInboxAddedObserver = new LLInboxAddedObserver(this);
 		
-		gInventory.addObserver(mInboxOutboxAddedObserver);
+		gInventory.addObserver(mInboxAddedObserver);
 	}
 }
 
@@ -334,13 +327,6 @@ void LLSidepanelInventory::enableInbox(bool enabled)
 	
 	LLLayoutPanel * inbox_layout_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
 	inbox_layout_panel->setVisible(enabled);
-
-	if (mInboxEnabled)
-	{
-		LLLayoutPanel * inout_layout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
-
-		inout_layout_panel->setVisible(TRUE);
-	}
 }
 
 void LLSidepanelInventory::openInbox()
@@ -358,7 +344,7 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id)
 	LLInventoryModelBackgroundFetch::instance().start(inbox_id);
 
 #if AUTO_EXPAND_INBOX
-	// Expand the inbox since we have fresh items and the outbox is not expanded
+	// Expand the inbox since we have fresh items
 	if (mInboxEnabled)
 	{
 		getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true);
@@ -367,39 +353,19 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id)
 #endif
 }
 
-bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel)
-{
-	bool expand = pressedButton->getToggleState();
-
-	LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
-	LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME);
-	LLLayoutPanel* inout_panel = getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME);
-
-	// Enable user_resize on main inventory panel only when a marketplace box is expanded
-	inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand);
-	inv_stack->collapsePanel(inout_panel, !expand);
-
-	{
-		// NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate
-		// properly to the child panels.
-
-		S32 new_height = inout_panel->getRect().getHeight();
-
-		pressedPanel->reshape(pressedPanel->getRect().getWidth(), new_height);
-	}
-
-	// Expand/collapse the indicated panel
-	inout_stack->collapsePanel(pressedPanel, !expand);
-
-	return expand;
-}
-
 void LLSidepanelInventory::onToggleInboxBtn()
 {
 	LLButton* inboxButton = getChild<LLButton>(INBOX_BUTTON_NAME);
 	LLLayoutPanel* inboxPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
-
-	const bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel);
+	LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
+	
+	const bool inbox_expanded = inboxButton->getToggleState();
+	
+	// Enable user_resize on main inventory panel only when inbox is expanded
+	inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded);
+	
+	// Expand/collapse the indicated panel
+	inv_stack->collapsePanel(inboxPanel, !inbox_expanded);
 
 	if (inbox_expanded && inboxPanel->isInVisibleChain())
 	{
@@ -735,7 +701,7 @@ void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox)
 	updateVerbs();
 }
 
-std::set<LLUUID> LLSidepanelInventory::getInboxOrOutboxSelectionList()
+std::set<LLUUID> LLSidepanelInventory::getInboxSelectionList()
 {
 	std::set<LLUUID> inventory_selected_uuids;
 	
diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h
index 915db727d68..a33607f50d8 100644
--- a/indra/newview/llsidepanelinventory.h
+++ b/indra/newview/llsidepanelinventory.h
@@ -31,7 +31,7 @@
 
 class LLButton;
 class LLFolderViewItem;
-class LLInboxOutboxAddedObserver;
+class LLInboxAddedObserver;
 class LLInventoryCategoriesObserver;
 class LLInventoryItem;
 class LLInventoryPanel;
@@ -47,10 +47,10 @@ class LLSidepanelInventory : public LLPanel
 	virtual ~LLSidepanelInventory();
 
 private:
-	void updateInboxOutbox();
+	void updateInbox();
 	
 public:
-	void observeInboxOutboxCreation();
+	void observeInboxCreation();
 	void observeInboxModifications(const LLUUID& inboxID);
 
 	/*virtual*/ BOOL postBuild();
@@ -63,7 +63,7 @@ class LLSidepanelInventory : public LLPanel
 	BOOL isMainInventoryPanelActive() const;
 
 	void clearSelections(bool clearMain, bool clearInbox);
-	std::set<LLUUID> getInboxOrOutboxSelectionList();
+	std::set<LLUUID> getInboxSelectionList();
 
 	void showItemInfoPanel();
 	void showTaskInfoPanel();
@@ -94,8 +94,6 @@ class LLSidepanelInventory : public LLPanel
 
 	void onInboxChanged(const LLUUID& inbox_id);
 
-	bool manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel);
-
 	//
 	// UI Elements
 	//
@@ -127,8 +125,8 @@ class LLSidepanelInventory : public LLPanel
 
 	bool						mInboxEnabled;
 
-	LLInventoryCategoriesObserver* 			mCategoriesObserver;
-	LLInboxOutboxAddedObserver*				mInboxOutboxAddedObserver;
+	LLInventoryCategoriesObserver* 	mCategoriesObserver;
+	LLInboxAddedObserver*			mInboxAddedObserver;
 };
 
 #endif //LL_LLSIDEPANELINVENTORY_H
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index f0b29f22484..0368601bf4e 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -6,7 +6,7 @@
  height="440"
  help_topic="floater_merchant_outbox"
  min_width="300"
- min_height="100"
+ min_height="200"
  name="floater_merchant_outbox"
  save_rect="true"
  save_visibility="true"
@@ -31,8 +31,6 @@
         width="313"
         top="0"
         bg_opaque_color="InventoryBackgroundColor"
-        background_visible="true"
-        background_opaque="true"
         >
 		<panel
 			name="outbox_inventory_placeholder_panel"
@@ -43,8 +41,6 @@
 			width="308"
 			height="400"
 			bg_opaque_color="InventoryBackgroundColor"
-			background_visible="true"
-			background_opaque="true"
 			>
 			<text
 				name="outbox_inventory_placeholder_title"
@@ -80,8 +76,6 @@
         width="313"
         top="405"
         bg_opaque_color="InventoryBackgroundColor"
-        background_visible="true"
-        background_opaque="true"
         >
 		<text
 			name="outbox_folder_count"
@@ -110,18 +104,6 @@
 			 width="200"
 			 enabled="false" />
     </panel>
-	<panel
-		name="outbox_inventory_disable_panel"
-        follows="all"
-        left="0"
-        bottom="440"
-        width="333"
-        top="0"
-        bg_opaque_color="White_50"
-        background_visible="true"
-        background_opaque="true"
-		visible="false"
-        />
 	<layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
 		<layout_panel />
 		<layout_panel height="45" auto_resize="false">
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index e6c5110999d..3007be7d5e8 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
- background_visible="true"
  default_tab_group="1"
  follows="all"
  height="423"
@@ -51,10 +50,6 @@
    top="18"
    width="303" />
   <tab_container
-     bg_alpha_color="DkGray"
-     bg_opaque_color="DkGray"
-     background_visible="true"
-     background_opaque="true"
      follows="all"
      halign="center"
      height="339"
@@ -71,7 +66,6 @@
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
-     background_opaque="true"
      border="false"
      bevel_style="none"
      follows="all"
@@ -90,7 +84,6 @@
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
-     background_opaque="true"
      border="false"
      bevel_style="none"
      follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index 66117615e42..a3d39e55af5 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -8,7 +8,6 @@
     bg_opaque_color="DkGray2"
     bg_alpha_color="DkGray2"
     background_visible="true"
-    background_opaque="true"
     border="false"
     bevel_style="none"
     show_item_link_overlays="true"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 0b14fd0459a..a26eb23a5dc 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
-	  background_visible="true"
 	  follows="all"
 	  height="570"
 	  label="Things"
@@ -30,7 +29,7 @@
               width="330">
              <layout_panel
                  name="main_inventory_layout_panel"
-								 layout="topleft"
+                 layout="topleft"
                  min_dim="150"
                  width="330"
                  follows="bottom|left|right"
@@ -48,41 +47,18 @@
                       height="300"
                       width="330" />
              </layout_panel>
-					   <layout_panel
+			 <layout_panel
                  width="330"
-								 layout="topleft"
-                 auto_resize="true"
-                 user_resize="false"
-                 follows="bottom|left|right"
-                 name="inbox_outbox_layout_panel"
-                 visible="false"
-                 min_dim="35"
-                 max_dim="235"
-                 expanded_min_dim="125"
-                 height="235">
-							 <layout_stack
-										follows="left|right|top|bottom"
-										layout="topleft"
-										left="0"
-										top="0"
-										orientation="vertical"
-										name="inbox_outbox_layout_stack"
-                    open_time_constant="0.02"
-                    close_time_constant="0.02"
-										height="235"
-										width="330">
-								 <layout_panel
-                 width="330"
-								 layout="topleft"
+				 layout="topleft"
                  auto_resize="true"
                  user_resize="false"
                  follows="left|right|top"
                  name="inbox_layout_panel"
                  visible="false"
                  min_dim="35"
-                 max_dim="200"
+                 max_dim="235"
                  expanded_min_dim="90"
-                 height="200">
+                 height="235">
                  <panel
                       follows="all"
                       layout="topleft"
@@ -91,13 +67,13 @@
                       class="panel_marketplace_inbox"
                       top="0"
                       label=""
-                      height="200"
+                      height="235"
                       width="330">
                      <string name="InboxLabelWithArg">Received items ([NUM])</string>
                      <string name="InboxLabelNoArg">Received items</string>
                      <button
                         label="Received items"
-												font="SansSerifMedium"
+						font="SansSerifMedium"
                         name="inbox_btn"
                         height="35"
                         width="308"
@@ -129,7 +105,7 @@
                      <panel
                         follows="all"
                         left="10"
-                        bottom="200"
+                        bottom="235"
                         width="308"
                         top="35"
                         bg_opaque_color="InventoryBackgroundColor"
@@ -145,7 +121,7 @@
 							top="0"
 							left="0"
 							width="308"
-							height="165"
+							height="200"
 							wrap="true"
 							halign="center">
 							Purchases from the marketplace will be delivered here.
@@ -153,8 +129,6 @@
                     </panel>
                  </panel>
              </layout_panel>
-			 </layout_stack>
-			 </layout_panel>
          </layout_stack>
 		<panel
 		     follows="bottom|left|right"
@@ -275,8 +249,7 @@
 			</layout_stack>
 		</panel>
 	</panel>
-
-<panel
+	<panel
 		 follows="all"
 		 layout="topleft"
 		 left="0"
@@ -289,8 +262,7 @@
 		 visible="false"
 		 width="330">
 	</panel>
-
-<panel
+	<panel
 		 follows="all"
 		 layout="topleft"
 		 left="0"
-- 
GitLab


From 978309c591dbd422cca923eec3d49b35af6ebdab Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 9 Dec 2011 15:52:37 -0800
Subject: [PATCH 409/933] sync with viewer-development

---
 .../skins/default/xui/da/floater_camera.xml   |   9 -
 .../skins/default/xui/da/notifications.xml    |  10 +-
 .../skins/default/xui/da/panel_my_profile.xml |  31 --
 .../skins/default/xui/da/panel_notes.xml      |  35 --
 .../skins/default/xui/da/panel_profile.xml    |  59 ---
 .../default/xui/da/panel_profile_view.xml     |  20 -
 .../skins/default/xui/de/floater_camera.xml   |   9 -
 .../skins/default/xui/de/notifications.xml    |  10 +-
 .../skins/default/xui/de/panel_my_profile.xml |  42 --
 .../skins/default/xui/de/panel_notes.xml      |  35 --
 .../skins/default/xui/de/panel_profile.xml    |  74 ---
 .../default/xui/de/panel_profile_view.xml     |  20 -
 .../default/xui/en/floater_about_land.xml     | 113 ++---
 .../skins/default/xui/en/floater_activeim.xml |   1 -
 .../skins/default/xui/en/floater_avatar.xml   |   2 +-
 .../default/xui/en/floater_build_options.xml  |   1 -
 .../skins/default/xui/en/floater_camera.xml   |  17 +-
 .../skins/default/xui/en/floater_chat_bar.xml |  10 +-
 .../default/xui/en/floater_color_picker.xml   |   1 -
 .../skins/default/xui/en/floater_event.xml    |   1 -
 .../skins/default/xui/en/floater_gesture.xml  |   1 -
 .../default/xui/en/floater_im_session.xml     |   2 +-
 .../default/xui/en/floater_live_lsleditor.xml |   1 -
 .../default/xui/en/floater_lsl_guide.xml      |   1 -
 .../skins/default/xui/en/floater_map.xml      |   1 -
 .../default/xui/en/floater_mem_leaking.xml    |   1 -
 .../skins/default/xui/en/floater_moveview.xml |   5 +-
 .../default/xui/en/floater_my_appearance.xml  |   2 +-
 .../default/xui/en/floater_my_web_profile.xml |   9 +
 .../skins/default/xui/en/floater_people.xml   |   4 -
 .../skins/default/xui/en/floater_places.xml   |   2 +-
 .../xui/en/floater_preview_notecard.xml       |   1 -
 .../xui/en/floater_preview_texture.xml        |   1 -
 .../skins/default/xui/en/floater_script.xml   |   1 -
 .../xui/en/floater_script_debug_panel.xml     |   1 -
 .../skins/default/xui/en/floater_snapshot.xml |   1 -
 .../skins/default/xui/en/floater_stats.xml    |   1 -
 .../skins/default/xui/en/floater_sys_well.xml |   1 -
 .../skins/default/xui/en/floater_tools.xml    |   2 +-
 .../default/xui/en/floater_voice_effect.xml   |   1 -
 .../skins/default/xui/en/menu_viewer.xml      | 327 +++++++------
 .../skins/default/xui/en/notifications.xml    |  10 +-
 .../skins/default/xui/en/panel_my_profile.xml | 146 ------
 .../skins/default/xui/en/panel_notes.xml      | 236 ---------
 .../xui/en/panel_preferences_setup.xml        |   2 +-
 .../skins/default/xui/en/panel_profile.xml    | 458 ------------------
 .../default/xui/en/panel_profile_view.xml     | 162 -------
 .../skins/default/xui/en/panel_toast.xml      |   1 -
 .../newview/skins/default/xui/en/strings.xml  |   4 +-
 .../skins/default/xui/es/floater_camera.xml   |   9 -
 .../skins/default/xui/es/notifications.xml    |  10 +-
 .../skins/default/xui/es/panel_my_profile.xml |  31 --
 .../skins/default/xui/es/panel_notes.xml      |  35 --
 .../skins/default/xui/es/panel_profile.xml    |  70 ---
 .../default/xui/es/panel_profile_view.xml     |  20 -
 .../skins/default/xui/fr/floater_camera.xml   |   9 -
 .../skins/default/xui/fr/notifications.xml    |  10 +-
 .../skins/default/xui/fr/panel_my_profile.xml |  42 --
 .../skins/default/xui/fr/panel_notes.xml      |  35 --
 .../skins/default/xui/fr/panel_profile.xml    |  74 ---
 .../default/xui/fr/panel_profile_view.xml     |  20 -
 .../skins/default/xui/it/floater_camera.xml   |   9 -
 .../skins/default/xui/it/notifications.xml    |  10 +-
 .../skins/default/xui/it/panel_my_profile.xml |  31 --
 .../skins/default/xui/it/panel_notes.xml      |  35 --
 .../skins/default/xui/it/panel_profile.xml    |  70 ---
 .../default/xui/it/panel_profile_view.xml     |  22 -
 .../skins/default/xui/ja/floater_camera.xml   |   9 -
 .../skins/default/xui/ja/notifications.xml    |  10 +-
 .../skins/default/xui/ja/panel_my_profile.xml |  42 --
 .../skins/default/xui/ja/panel_notes.xml      |  35 --
 .../skins/default/xui/ja/panel_profile.xml    |  74 ---
 .../default/xui/ja/panel_profile_view.xml     |  22 -
 .../skins/default/xui/pl/floater_camera.xml   |   9 -
 .../skins/default/xui/pl/notifications.xml    |  10 +-
 .../skins/default/xui/pl/panel_my_profile.xml |  31 --
 .../skins/default/xui/pl/panel_notes.xml      |  35 --
 .../skins/default/xui/pl/panel_profile.xml    |  59 ---
 .../default/xui/pl/panel_profile_view.xml     |  20 -
 .../skins/default/xui/pt/floater_camera.xml   |   9 -
 .../skins/default/xui/pt/notifications.xml    |  10 +-
 .../skins/default/xui/pt/panel_my_profile.xml |  31 --
 .../skins/default/xui/pt/panel_notes.xml      |  35 --
 .../skins/default/xui/pt/panel_profile.xml    |  70 ---
 .../default/xui/pt/panel_profile_view.xml     |  20 -
 .../skins/default/xui/ru/floater_camera.xml   |   9 -
 .../skins/default/xui/ru/notifications.xml    |  10 +-
 .../skins/default/xui/ru/panel_my_profile.xml |  42 --
 .../skins/default/xui/ru/panel_notes.xml      |  35 --
 .../skins/default/xui/ru/panel_profile.xml    |  67 ---
 .../default/xui/ru/panel_profile_view.xml     |  20 -
 .../skins/default/xui/tr/floater_camera.xml   |   9 -
 .../skins/default/xui/tr/notifications.xml    |  10 +-
 .../skins/default/xui/tr/panel_my_profile.xml |  42 --
 .../skins/default/xui/tr/panel_notes.xml      |  35 --
 .../skins/default/xui/tr/panel_profile.xml    |  67 ---
 .../default/xui/tr/panel_profile_view.xml     |  20 -
 .../skins/default/xui/zh/floater_camera.xml   |   9 -
 .../skins/default/xui/zh/notifications.xml    |  10 +-
 .../skins/default/xui/zh/panel_my_profile.xml |  42 --
 .../skins/default/xui/zh/panel_notes.xml      |  35 --
 .../skins/default/xui/zh/panel_profile.xml    |  67 ---
 .../default/xui/zh/panel_profile_view.xml     |  20 -
 103 files changed, 324 insertions(+), 3183 deletions(-)
 delete mode 100644 indra/newview/skins/default/xui/da/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/da/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/da/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/da/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/de/panel_profile_view.xml
 create mode 100644 indra/newview/skins/default/xui/en/floater_my_web_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/en/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/es/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/fr/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/it/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ja/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pl/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/pt/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/ru/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/tr/panel_profile_view.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_my_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_notes.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_profile.xml
 delete mode 100644 indra/newview/skins/default/xui/zh/panel_profile_view.xml

diff --git a/indra/newview/skins/default/xui/da/floater_camera.xml b/indra/newview/skins/default/xui/da/floater_camera.xml
index 5b7ef6db546..b5d5e8bc084 100644
--- a/indra/newview/skins/default/xui/da/floater_camera.xml
+++ b/indra/newview/skins/default/xui/da/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Flyt kamera op og ned, til venstre og højre
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Kamera valg
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Kredsløb zoom panorering
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Forvalg
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Se objekt
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml
index 3ccdfc036a7..cf6f1ccdd9f 100644
--- a/indra/newview/skins/default/xui/da/notifications.xml
+++ b/indra/newview/skins/default/xui/da/notifications.xml
@@ -438,7 +438,7 @@ Tilbyd venskab til [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Ønsker du at fjerne [NAME] fra din venneliste?
+		Ønsker du at fjerne &lt;nolink&gt;[NAME]&lt;/nolink&gt; fra din venneliste?
 	</notification>
 	<notification name="ConfirmItemDeleteHasLinks">
 		Mindst en af genstandene har lænkede genstande der peger på den. Hvis du sletter denne genstand, vil lænkninger ikke virke mere.  Det anbefales kraftigt at fjerne lænkninger først.
@@ -1023,10 +1023,10 @@ Henvis til dette fra en hjemmeside for at give andre nem adgang til denne lokati
 		Erstattet manglende tøj/kropsdele med standard.
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] er logget på
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; er logget på
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] er logget af
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; er logget af
 	</notification>
 	<notification name="AddSelfFriend">
 		Selvom du nok er meget sød, kan du ikke tilføje dig selv som ven.
@@ -1404,10 +1404,10 @@ Prøv igen om lidt.
 (Som udgangspunkt, vil du være i stand til at se den andens online status)
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] accepterede dit tilbud om venskab.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; accepterede dit tilbud om venskab.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] afviste dit tilbud om venskab.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; afviste dit tilbud om venskab.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Tilbud om venskab accepteret.
diff --git a/indra/newview/skins/default/xui/da/panel_my_profile.xml b/indra/newview/skins/default/xui/da/panel_my_profile.xml
deleted file mode 100644
index 94da58389f2..00000000000
--- a/indra/newview/skins/default/xui/da/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Ingen"/>
-	<string name="no_group_text" value="Ingen"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Brugernavn
-						</text>
-						<text name="name_descr_text">
-							Visningsnavn
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Se profil for denne avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_notes.xml b/indra/newview/skins/default/xui/da/panel_notes.xml
deleted file mode 100644
index 7d8097f6ffe..00000000000
--- a/indra/newview/skins/default/xui/da/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Noter &amp; Privatliv" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Min private noter:"/>
-					<text name="status_message2" value="Tillad denne person at:"/>
-					<check_box label="Se min online status" name="status_check"/>
-					<check_box label="Se mig på kortet" name="map_check"/>
-					<check_box label="Editére, slette og tage mine objekter" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboer"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Ã…ben session med personlige beskeder"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Opkald" name="call" tool_tip="Opkald til denne beboer"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Kort" name="show_on_map_btn" tool_tip="Vis denne beboer på kortet"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_profile.xml b/indra/newview/skins/default/xui/da/panel_profile.xml
deleted file mode 100644
index db85eb23a84..00000000000
--- a/indra/newview/skins/default/xui/da/panel_profile.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Ingen"/>
-	<string name="no_group_text" value="Ingen"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Real World:"/>
-					</panel>
-					<text name="title_member_text" value="Beboer siden:"/>
-					<text name="title_acc_status_text" value="Konto status:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(henter)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupper:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboeren"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="Personlig besked" name="im" tool_tip="Ã…ben session med personlig besked"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Opkald" name="call" tool_tip="Opkald til denne beboer"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="â–¼" name="overflow_btn" tool_tip="Betal eller del beholdning med denne beboer"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Redigér profil" name="edit_profile_btn" tool_tip="Redigér din personlige information"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_profile_view.xml b/indra/newview/skins/default/xui/da/panel_profile_view.xml
deleted file mode 100644
index e6e8ca4d102..00000000000
--- a/indra/newview/skins/default/xui/da/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Online
-	</string>
-	<string name="status_offline">
-		Offline
-	</string>
-	<text name="display_name_label" value="Visningsnavn:"/>
-	<text name="solo_username_label" value="Brugernavn:"/>
-	<text name="status" value="Online"/>
-	<text name="user_name_small" value="Se på mig med dette enormt ekstremt super lange navn"/>
-	<button name="copy_to_clipboard" tool_tip="Kopiér til udskriftsholder"/>
-	<text name="user_label" value="Brugernavn:"/>
-	<tab_container name="tabs">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="FAVORITTER" name="panel_picks"/>
-		<panel label="NOTER &amp; PRIVATLIV" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/floater_camera.xml b/indra/newview/skins/default/xui/de/floater_camera.xml
index bbf1c8af600..7e9ebdb6435 100644
--- a/indra/newview/skins/default/xui/de/floater_camera.xml
+++ b/indra/newview/skins/default/xui/de/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Kamera nach oben, unten, links und rechts bewegen
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Kameramodi
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Kreisen - Zoomen - Schwenken
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ansichten
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Objekt ansehen
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index fc38608df5f..72e7ec8eb47 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -992,7 +992,7 @@ Sie sind nicht berechtigt, Land für die aktive Gruppe zu kaufen.
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Möchten Sie [NAME] aus Ihrer Freundesliste entfernen?
+		Möchten Sie &lt;nolink&gt;[NAME]&lt;/nolink&gt; aus Ihrer Freundesliste entfernen?
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2134,10 +2134,10 @@ Hierzu wird Ihr Webbrowser geöffnet.
 		Betreff: [SUBJECT], Nachricht: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] ist online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ist online
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] ist offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ist offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Obwohl Sie ein sehr netter Mensch sind, können Sie sich nicht selbst als Freund hinzufügen.
@@ -2532,10 +2532,10 @@ Versuchen Sie es in einigen Minuten erneut.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] hat Ihr Freundschaftsangebot akzeptiert.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; hat Ihr Freundschaftsangebot akzeptiert.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] hat Ihr Freundschaftsangebot abgelehnt.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; hat Ihr Freundschaftsangebot abgelehnt.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Ihr Freundschaftsangebot wurde angeommen.
diff --git a/indra/newview/skins/default/xui/de/panel_my_profile.xml b/indra/newview/skins/default/xui/de/panel_my_profile.xml
deleted file mode 100644
index 89a4dfdabae..00000000000
--- a/indra/newview/skins/default/xui/de/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=de-DE
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=de
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=de-DE"/>
-	<string name="no_partner_text" value="Keiner"/>
-	<string name="no_group_text" value="Keiner"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Benutzername
-						</text>
-						<text name="name_descr_text">
-							Anzeigename
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Profil zu diesem Avatar anzeigen"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_notes.xml b/indra/newview/skins/default/xui/de/panel_notes.xml
deleted file mode 100644
index ef1961b63d5..00000000000
--- a/indra/newview/skins/default/xui/de/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notizen &amp; Privatsphäre" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Meine Notizen:"/>
-					<text name="status_message2" value="Diese Person kann:"/>
-					<check_box label="meinen Online-Status sehen." name="status_check"/>
-					<check_box label="mich auf der Karte sehen." name="map_check"/>
-					<check_box label="meine Objekte bearbeiten, löschen oder nehmen." name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Freund hinzufügen" name="add_friend" tool_tip="Dem Einwohner die Freundschaft anbieten"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Instant Messenger öffnen"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Anrufen" name="call" tool_tip="Diesen Einwohner anrufen"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Karte" name="show_on_map_btn" tool_tip="Einwohner auf Karte anzeigen"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_profile.xml b/indra/newview/skins/default/xui/de/panel_profile.xml
deleted file mode 100644
index b4c6e671085..00000000000
--- a/indra/newview/skins/default/xui/de/panel_profile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=de-DE
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=de
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=de-DE"/>
-	<string name="no_partner_text" value="Keiner"/>
-	<string name="no_group_text" value="Keiner"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Echtes Leben:"/>
-					</panel>
-					<text name="title_member_text" value="Einwohner seit:"/>
-					<text name="title_acc_status_text" value="Kontostatus:"/>
-					<text_editor name="acc_status_text">
-						Einwohner. Keine Zahlungsinfo archiviert.
-              Linden.
-					</text_editor>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(wird in Datenbank gesucht)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Gruppen:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Freund hinzufügen" name="add_friend" tool_tip="Dem Einwohner die Freundschaft anbieten"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Instant Messenger öffnen"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Anrufen" name="call" tool_tip="Diesen Einwohner anrufen"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="â–¼" name="overflow_btn" tool_tip="Dem Einwohner Geld geben oder Inventar an den Einwohner schicken"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Profil bearbeiten" name="edit_profile_btn" tool_tip="Ihre persönlichen Informationen bearbeiten"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_profile_view.xml b/indra/newview/skins/default/xui/de/panel_profile_view.xml
deleted file mode 100644
index 7e93bd1edee..00000000000
--- a/indra/newview/skins/default/xui/de/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Online
-	</string>
-	<string name="status_offline">
-		Offline
-	</string>
-	<text name="display_name_label" value="Anzeigename:"/>
-	<text name="solo_username_label" value="Benutzername:"/>
-	<text name="status" value="Online"/>
-	<text name="user_name_small" value="Dieser Name ist ein ganz außerordentlich langer Name"/>
-	<button name="copy_to_clipboard" tool_tip="In Zwischenablage kopieren"/>
-	<text name="user_label" value="Benutzername:"/>
-	<tab_container name="tabs" tab_min_width="60">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="AUSWAHL" name="panel_picks"/>
-		<panel label="NOTIZEN &amp; PRIVATSPHÄRE" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 1c7b354221a..4772f744ead 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1208,7 +1208,7 @@ Only large parcels can be listed in search.
             </panel.string>
             <panel.string
              name="see_avs_text">
-                 See and chat with residents on this parcel
+                    Avatars on other parcels can see
             </panel.string>
             <text
              type="string"
@@ -1223,30 +1223,33 @@ Only large parcels can be listed in search.
              width="278">
                 Allow other Residents to:
             </text>
-            <check_box
-             height="16"
-             label="Edit Terrain"
-             layout="topleft"
-             left="14"
-             name="edit land check"
-             tool_tip="If checked, anyone can terraform your land. It is best to leave this unchecked, as you can always edit your own land."
-             top_pad="4"
-             width="147i" />
-            <check_box
+          <text
+           type="string"
+           length="1"
+           follows="left|top"
+           height="16"
+           layout="topleft"
+           left="20"
+           name="allow_label0"
+           width="150">
+            Fly:
+          </text>
+
+          <check_box
              height="16"
-             label="Fly"
+             label="Everyone"
              layout="topleft"
              name="check fly"
              tool_tip="If checked, Residents can fly on your land. If unchecked, they can only fly into and over your land."
-             left_pad="4"
-             width="150" />
+             left_pad="2"
+             width="130" />
             <text
              type="string"
              length="1"
              follows="left|top"
              height="16"
              layout="topleft"
-             left="14"
+             left="20"
              name="allow_label2"
              width="150">
                 Build:
@@ -1271,7 +1274,7 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="14"
+             left="20"
              name="allow_label3"
              width="150">
                 Object Entry:
@@ -1298,7 +1301,7 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="14"
+             left="20"
              name="allow_label4"
              width="150">
                 Run Scripts:
@@ -1319,49 +1322,47 @@ Only large parcels can be listed in search.
              name="check group scripts"
              top_delta="0"
              width="70" />
-           <text
-             type="string"
-             text_color="white"
-             length="1"
-             follows="left|top"
-             height="16"
-             layout="topleft"
-             left="10"
-             name="land_options_label"
-             width="278">
-                Land Options:
-            </text>
-            <check_box
+          <panel
+            bevel_style="none"
+            border="true"
+            top="146"
+            bottom="146"
+            follows="left|bottom|right"
+            left="20"
+            right="-20"/>
+          <check_box
              height="16"
              label="Safe (no damage)"
              layout="topleft"
-             left="14"
+             left="18"
              name="check safe"
              tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled."
-             top_pad="5"
+             top="130"
              width="200" />
             <check_box
              height="16"
              label="No Pushing"
              layout="topleft"
-             left_pad="5"
+             left_pad="35"
              name="PushRestrictCheck"
              tool_tip="Prevents scripts from pushing. Checking this option may be useful for preventing disruptive behavior on your land."
-             top_delta="0"
+             top="130"
              width="119" />
             <check_box
              height="16"
              label="Show Place in Search (L$30/week)"
              layout="topleft"
-             left="14"
+             left="18"
              name="ShowDirectoryCheck"
              tool_tip="Let people see this parcel in search results"
+             top="150"
              width="430" />
             <combo_box
              enabled="false"
              height="23"
              layout="topleft"
-             left="30"
+             left="20"
+             top="194"
              name="land category with adult"
              visible="false"
              width="140">
@@ -1426,7 +1427,8 @@ Only large parcels can be listed in search.
              enabled="false"
              height="23"
              layout="topleft"
-             left="30"
+             left="20"
+             top="194"
              name="land category"
              visible="false"
              width="140">
@@ -1487,11 +1489,11 @@ Only large parcels can be listed in search.
              height="16"
              label="Moderate Content"
              layout="topleft"
-             left="14"
+             left="18"
              name="MatureCheck"
-             top="177"
+             top="170"
              label_text.valign="center" 
-             label_text.v_pad="-5" 
+             label_text.v_pad="-1" 
              tool_tip=" "
              width="200" />
             <text
@@ -1500,18 +1502,19 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="10"
+             left="20"
              name="Snapshot:"
              text_color="white"
-             top="220"
+             top="225"
              width="200">
                 Snapshot:
             </text>
             <texture_picker
              follows="left|top"
+             top_pad="0"
              height="150"
              layout="topleft"
-             left="14"
+             left="20"
              name="snapshot_ctrl"
              fallback_image="default_land_picture.j2c" 
              tool_tip="Click to choose a picture"
@@ -1520,23 +1523,24 @@ Only large parcels can be listed in search.
              type="string"
              length="1"
              follows="left|top"
-             text_color="white"
+             text_color="LtGray"
              height="16"
              layout="topleft"
-             left="230"
-             top="174"
+             left="274"
+             top="166"
              name="allow_label5"
              width="278">
-              Allow Residents on other parcels to:
+              and chat with avatars on this parcel
             </text>
             <check_box
              height="16"
              label="See Avatars"
              follows="top"
              layout="topleft"
-             left="230"
+             left="253"
+             top="150"
              name="SeeAvatarsCheck"
-             tool_tip="Allows residents on other parcels to see and chat with residents on this parcel, and you to see and chat with them."
+             tool_tip="Allows avatars on other parcels to see and chat with avatars on this parcel, and you to see and chat with them."
              width="120" />
             <text
              type="string"
@@ -1544,8 +1548,8 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="230"
-             top="230"
+             left="255"
+             top="282"
              text_color="white"
              name="landing_point"
              word_wrap="true"
@@ -1554,12 +1558,13 @@ Only large parcels can be listed in search.
             </text>
             <button
              follows="right|top"
+             top_pad="0"
              height="23"
              label="Set"
              label_selected="Set"
              layout="topleft"
              name="Set"
-             left="230"
+             left="255"
              tool_tip="Sets the landing point where visitors arrive. Sets to your avatar&apos;s location inside this parcel."
              width="50" />
             <button
@@ -1579,7 +1584,7 @@ Only large parcels can be listed in search.
              follows="left|top"
              height="16"
              layout="topleft"
-             left="230"
+             left="255"
              top_pad="10"
              name="Teleport Routing: "
              width="200">
@@ -1589,7 +1594,7 @@ Only large parcels can be listed in search.
              height="23"
              layout="topleft"
              name="landing type"
-             top_pad="3"
+             top_pad="0"
              tool_tip="Teleport Routing -- select how to handle teleports onto your land"
              width="120">
                 <combo_box.item
diff --git a/indra/newview/skins/default/xui/en/floater_activeim.xml b/indra/newview/skins/default/xui/en/floater_activeim.xml
index 670c528f083..b79c5d9a197 100644
--- a/indra/newview/skins/default/xui/en/floater_activeim.xml
+++ b/indra/newview/skins/default/xui/en/floater_activeim.xml
@@ -6,7 +6,6 @@
 	title="ACTIVE IM"
 	height="22"
 	width="320"
-	follows="right|bottom"
 	background_visible="true"
 	can_close="true"
 	can_dock="true"
diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml
index 6009821f7fa..82c34030082 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar.xml
@@ -15,7 +15,7 @@
  help_topic="avatar"
  save_rect="true"
  save_visibility="true"
- title="AVATAR PICKER"
+ title="CHOOSE AN AVATAR"
  width="700">
     <web_browser
       top="25"
diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml
index afb79170431..35918e9705d 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- follows="right"
  height="198"
  layout="topleft"
  name="build options floater"
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index e7f52072717..4673c6def59 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -1,19 +1,18 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  open_positioning="specified"
- specified_left="320"
+ specified_left="458"
  specified_bottom="80"
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
- follows="bottom"
  height="164"
  layout="topleft"
  name="camera_floater"
  help_topic="camera_floater"
  save_visibility="true"
  single_instance="true"
- title="VIEW"
+ title="CAMERA CONTROLS"
  chrome="true"
  save_rect="true"
  width="228">
@@ -29,18 +28,6 @@
      name="move_tooltip">
         Move Camera Up and Down, Left and Right
     </floater.string>
-    <floater.string
-     name="camera_modes_title">
-        Camera modes
-    </floater.string>
-    <floater.string
-     name="pan_mode_title">
-       Orbit Zoom Pan
-    </floater.string>
-    <floater.string
-     name="presets_mode_title">
-        Preset Views
-    </floater.string>
     <floater.string
      name="free_mode_title">
         View Object
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 87606c1a2aa..8d0cecdac33 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  open_positioning="specified"
- specified_left="320"
+ specified_left="10"
  specified_bottom="10"
  height="60"
  layout="topleft"
@@ -17,17 +17,17 @@
  can_resize="true"
  default_tab_group="1"
  name="chat_bar"
- width="380">
+ width="300">
     <panel
         top="20"
         class="panel_nearby_chat"
         follow="all"
-        width="380"
+        width="300"
         height="0"
         visible="false"
         filename="panel_nearby_chat.xml"
         name="nearby_chat" />
-    <panel width="380" 
+    <panel width="300" 
            height="31" 
            left="0" 
            bottom="-1" 
@@ -48,7 +48,7 @@
         text_pad_right="25"
         tool_tip="Press Enter to say, Ctrl+Enter to shout"
         top="2"
-        width="335" />
+        width="255" />
       <output_monitor
         auto_update="true"
         follows="right"
diff --git a/indra/newview/skins/default/xui/en/floater_color_picker.xml b/indra/newview/skins/default/xui/en/floater_color_picker.xml
index 421f3a72c61..e06d10606a3 100644
--- a/indra/newview/skins/default/xui/en/floater_color_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_color_picker.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- follows="left|top"
  height="380"
  layout="topleft"
  name="ColorPicker"
diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml
index 7ed020f8323..cf61b7d24d4 100644
--- a/indra/newview/skins/default/xui/en/floater_event.xml
+++ b/indra/newview/skins/default/xui/en/floater_event.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- follows="all"
  height="400"
  can_resize="true"
  help_topic="event_details"
diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml
index a941734358c..b96a94a849b 100644
--- a/indra/newview/skins/default/xui/en/floater_gesture.xml
+++ b/indra/newview/skins/default/xui/en/floater_gesture.xml
@@ -9,7 +9,6 @@
  help_topic="gestures"
  title="GESTURES"
  background_visible="true"
- follows="all"
  label="Places"
  layout="topleft"
  min_height="350"
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index cb7d91abb88..5fe8f3c1147 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -3,8 +3,8 @@
  legacy_header_height="18"
  background_visible="true"
  default_tab_group="1"
- follows="all"
  height="350"
+ help_topic="floater_im_box"
  layout="topleft"
  name="panel_im"
  can_dock="false"
diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
index 1f192f9b280..5cd7cd196dd 100644
--- a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
@@ -4,7 +4,6 @@
  bevel_style="none"
  border_style="line"
  can_resize="true"
- follows="left|top"
  height="580"
  layout="topleft"
  min_height="271"
diff --git a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml
index c9d87f158f4..e9676777f43 100644
--- a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml
+++ b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="left|top"
  height="400"
  layout="topleft"
  min_height="271"
diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml
index 31972d41224..3eeebcf1206 100644
--- a/indra/newview/skins/default/xui/en/floater_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_map.xml
@@ -4,7 +4,6 @@
  can_minimize="true" 
  can_resize="true"
  chrome="true"
- follows="top|right"
  height="200"
  layout="topleft"
  min_height="128"
diff --git a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml
index 28a29c42aac..fb7d09a21eb 100644
--- a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml
+++ b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- follows="left|top"
  height="175"
  layout="topleft"
  name="MemLeak"
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index e96039a3e15..065dab04131 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  open_positioning="specified"
- specified_left="558"
+ specified_left="320"
  specified_bottom="80"
  legacy_header_height="18"
  can_dock="false"
  can_minimize="true"
  can_close="true"
- follows="bottom"
  height="110"
  layout="topleft"
  name="move_floater"
@@ -16,7 +15,7 @@
  save_visibility="true"
  single_instance="true"
  chrome="true"
- title="MOVE"
+ title="WALK / RUN / FLY"
  width="133">
     <string
      name="walk_forward_tooltip">
diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
index a40393aed8b..1c4b25a7b02 100644
--- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
@@ -12,7 +12,7 @@
   single_instance="true"
   reuse_instance="true"
   title="APPEARANCE"
-  min_height="260"
+  min_height="440"
   min_width="333"
   width="333">
     <panel
diff --git a/indra/newview/skins/default/xui/en/floater_my_web_profile.xml b/indra/newview/skins/default/xui/en/floater_my_web_profile.xml
new file mode 100644
index 00000000000..df46fc198f2
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_my_web_profile.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater name="floater_my_web_profile"
+         help_topic="web_profile"
+         width="780"
+         height="775"
+         save_rect="true"
+         single_instance="true"
+         reuse_instance="false"
+         filename="floater_web_content.xml"/>
\ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml
index 32dda1b6949..d6d8431150a 100644
--- a/indra/newview/skins/default/xui/en/floater_people.xml
+++ b/indra/newview/skins/default/xui/en/floater_people.xml
@@ -25,10 +25,6 @@
         class="panel_people"
         name="panel_people"
         filename="panel_people.xml"/>
-      <panel
-        class="panel_profile_view"
-        name="panel_profile_view"
-        filename="panel_profile_view.xml"/>
       <panel
         class="panel_group_info_sidetray"
         name="panel_group_info_sidetray"
diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml
index 6484b543604..ccceac0a7b2 100644
--- a/indra/newview/skins/default/xui/en/floater_places.xml
+++ b/indra/newview/skins/default/xui/en/floater_places.xml
@@ -11,7 +11,7 @@
   save_rect="true"
   reuse_instance="true"
   title="PLACES"
-  min_height="230"
+  min_height="440"
   min_width="333"
   width="333">
     <panel
diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml
index f35628f8e51..be3b2d179d5 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml
@@ -3,7 +3,6 @@
  legacy_header_height="18"
  can_resize="true"
  default_tab_group="1"
- follows="left|top"
  height="361"
  layout="topleft"
  min_height="243"
diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml
index 92d3a6702c1..137e278ddcf 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="left|top"
  height="350"
  layout="topleft"
  min_height="200"
diff --git a/indra/newview/skins/default/xui/en/floater_script.xml b/indra/newview/skins/default/xui/en/floater_script.xml
index 73e6d6147a3..bd4edb81c85 100644
--- a/indra/newview/skins/default/xui/en/floater_script.xml
+++ b/indra/newview/skins/default/xui/en/floater_script.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  background_visible="true"
- follows="left|top|right|bottom"
  height="250"
  layout="topleft"
  name="script_floater"
diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
index ce96ea232e9..b5dd2f97b92 100644
--- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
+++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="left|top|right|bottom"
  height="200"
  layout="topleft"
  name="script"
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 61f2e7e72d7..e71b714f257 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -4,7 +4,6 @@
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
- follows="left|top"
  height="500"
  layout="topleft"
  name="Snapshot"
diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml
index 406114294df..2fd932786bd 100644
--- a/indra/newview/skins/default/xui/en/floater_stats.xml
+++ b/indra/newview/skins/default/xui/en/floater_stats.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- follows="top|right"
  height="400"
  layout="topleft"
  name="Statistics"
diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml
index 9b96a5badc7..ecedb274389 100644
--- a/indra/newview/skins/default/xui/en/floater_sys_well.xml
+++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml
@@ -2,7 +2,6 @@
 <floater
  legacy_header_height="18"
  bevel_style="in"
- follows="right|bottom"
  layout="topleft"
  name="sys_well_window"
  help_topic="notification_chiclet"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 1808cab2a5e..f9147ea650c 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -2,7 +2,6 @@
 <floater
  open_positioning="cascading"
  legacy_header_height="18"
- follows="left|top|right"
  height="580"
  layout="topleft"
  bg_opaque_image="Window_NoTitle_Foreground"
@@ -791,6 +790,7 @@
      tab_min_width="40"
      tab_position="top"
      tab_height="25"
+     open_tabs_on_drag_and_drop="true"
      top="173"
      width="295">
 	
diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
index 2c754cd8d0f..77fb21e27c5 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
@@ -7,7 +7,6 @@
  help_topic="voice_effects"
  title="VOICE MORPHING"
  background_visible="true"
- follows="all"
  label="Places"
  layout="topleft"
  min_height="360"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 3a581e7e6e8..1834be2d48c 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -8,14 +8,6 @@
      label="Me"
      name="Me"
      tear_off="true">
-      <menu_item_call
-           label="Dashboard..."
-           name="Manage My Account">
-        <menu_item_call.on_click
-         function="PromptShowURL"
-         name="ManageMyAccount_url"
-         parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
-      </menu_item_call>
       <menu_item_call
        label="Profile..."
        name="Profile">
@@ -31,6 +23,14 @@
         <menu_item_call.on_enable
          function="Edit.EnableCustomizeAvatar" />
       </menu_item_call>
+      <menu_item_call
+       label="Choose an avatar..."
+       name="Avatar Picker">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="avatar" />
+      </menu_item_call>
+      <menu_item_separator/>
       <menu_item_check
          label="Inventory..."
          name="Inventory"
@@ -52,29 +52,28 @@
          function="Inventory.NewWindow"
          parameter="" />
       </menu_item_call>
-      <menu_item_check
-       label="Gestures..."
-       name="Gestures"
-       shortcut="control|G">
-        <menu_item_check.on_check
-         function="Floater.Visible"
-         parameter="gestures" />
-        <menu_item_check.on_click
-         function="Floater.Toggle"
-         parameter="gestures" />
-      </menu_item_check>
-      <menu_item_check
-       label="Voice..."
-       name="ShowVoice"
-       visibility_control="VoiceMorphingEnabled">
-        <menu_item_check.on_check
-         function="Floater.Visible"
-         Parameter="voice_effect" />
-        <menu_item_check.on_click
-         function="Floater.Toggle"
-         parameter="voice_effect" />
-      </menu_item_check>
-
+      <menu_item_call
+       label="Places..."
+       name="Places">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="places" />
+      </menu_item_call>
+      <menu_item_call
+       label="Picks..."
+       name="Picks">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="picks" />
+      </menu_item_call>
+      <menu_item_separator/>
+      <menu_item_call
+       label="Camera Controls..."
+       name="Camera Controls">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="camera" />
+      </menu_item_call>
       <menu
        create_jump_keys="true"
        label="Movement"
@@ -117,6 +116,13 @@
           <menu_item_call.on_click
            function="Tools.StopAllAnimations" />
         </menu_item_call>
+        <menu_item_call
+         label="Walk / run / fly..."
+         name="Stop Animating My Avatar">
+          <menu_item_call.on_click
+           function="Floater.ToggleOrBringToFront"
+           parameter="moveview" />
+        </menu_item_call>
       </menu>
 
       <menu
@@ -163,6 +169,14 @@
         <menu_item_call.on_click
          function="BuyCurrency" />
       </menu_item_call>
+      <menu_item_call
+           label="Account dashboard..."
+           name="Manage My Account">
+        <menu_item_call.on_click
+         function="PromptShowURL"
+         name="ManageMyAccount_url"
+         parameter="WebLaunchJoinNow,http://secondlife.com/account/" />
+      </menu_item_call>
 
       <menu_item_separator/>
 
@@ -205,33 +219,8 @@
      label="Communicate"
      name="Communicate"
      tear_off="true">
-        <menu_item_call
-         label="My Friends"
-         name="My Friends"
-         shortcut="control|shift|F">
-            <menu_item_call.on_click
-             function="SideTray.PanelPeopleTab"
-             parameter="friends_panel" />
-            </menu_item_call>
-        <menu_item_call
-         label="My Groups"
-         name="My Groups"
-         shortcut="control|shift|G">
-            <menu_item_call.on_click
-             function="SideTray.PanelPeopleTab"
-             parameter="groups_panel" />
-        </menu_item_call>
-
-        <menu_item_separator/>
-
-        <!--menu_item_call
-         label="Chat"
-         name="Chat">
-            <menu_item_call.on_click
-             function="World.Chat" />
-        </menu_item_call-->
         <menu_item_check
-         label="Nearby Chat"
+         label="Chat..."
          name="Nearby Chat"
          shortcut="control|H"
          use_mac_ctrl="true">
@@ -242,16 +231,21 @@
              function="Floater.Toggle"
              parameter="chat_bar" />
         </menu_item_check>
-        <menu_item_call
-         label="Nearby People"
-         name="Active Speakers"
-         shortcut="control|shift|A">
-            <menu_item_call.on_click
-             function="SideTray.PanelPeopleTab"
-             parameter="nearby_panel" />
-            </menu_item_call>
         <menu_item_check
-         label="Nearby Voice"
+         label="Speak"
+         name="Speak">
+            <menu_item_check.on_check
+             function="Agent.IsMicrophoneOn"
+             parameter="speak" />
+            <menu_item_check.on_enable
+             function="Agent.IsActionAllowed"
+             parameter="speak" />
+            <menu_item_check.on_click
+             function="Agent.ToggleMicrophone"
+             parameter="speak" />
+        </menu_item_check>
+        <menu_item_check
+         label="Voice settings..."
          name="Nearby Voice">
             <menu_item_check.on_check
              function="Floater.Visible"
@@ -260,12 +254,86 @@
              function="Floater.Toggle"
              parameter="voice_controls" />
         </menu_item_check>
+        <menu_item_check
+         label="Voice morphing..."
+         name="ShowVoice"
+         visibility_control="VoiceMorphingEnabled">
+            <menu_item_check.on_check
+             function="Floater.Visible"
+             parameter="voice_effect" />
+            <menu_item_check.on_click
+             function="Floater.Toggle"
+             parameter="voice_effect" />
+        </menu_item_check>
+        <menu_item_check
+         label="Gestures..."
+         name="Gestures"
+         shortcut="control|G">
+            <menu_item_check.on_check
+             function="Floater.Visible"
+             parameter="gestures" />
+            <menu_item_check.on_click
+             function="Floater.Toggle"
+             parameter="gestures" />
+        </menu_item_check>
+        <menu_item_separator/>
+        <menu_item_call
+         label="Friends"
+         name="My Friends"
+         shortcut="control|shift|F">
+            <menu_item_call.on_click
+             function="SideTray.PanelPeopleTab"
+             parameter="friends_panel" />
+            </menu_item_call>
+        <menu_item_call
+         label="Groups"
+         name="My Groups"
+         shortcut="control|shift|G">
+            <menu_item_call.on_click
+             function="SideTray.PanelPeopleTab"
+             parameter="groups_panel" />
+        </menu_item_call>
+        <menu_item_call
+         label="Nearby people"
+         name="Active Speakers"
+         shortcut="control|shift|A">
+            <menu_item_call.on_click
+              function="SideTray.PanelPeopleTab"
+              parameter="nearby_panel" />
+        </menu_item_call>
     </menu>
     <menu
      create_jump_keys="true"
      label="World"
      name="World"
      tear_off="true">
+        <menu_item_call
+         label="Landmark This Place"
+         name="Create Landmark Here">
+            <menu_item_call.on_click
+             function="World.CreateLandmark" />
+            <menu_item_call.on_enable
+             function="World.EnableCreateLandmark" />
+        </menu_item_call>
+        <menu_item_call
+         label="Destinations..."
+         name="Destinations">
+            <menu_item_call.on_click
+             function="Floater.ToggleOrBringToFront"
+             parameter="destinations" />
+        </menu_item_call>
+        <menu_item_check
+         label="World map"
+         name="World Map"
+         shortcut="control|M"
+         use_mac_ctrl="true">
+            <menu_item_check.on_check
+             function="Floater.Visible"
+             parameter="world_map" />
+            <menu_item_check.on_click
+             function="Floater.Toggle"
+             parameter="world_map" />
+        </menu_item_check>
             <menu_item_check
          label="Mini-map"
          name="Mini-Map"
@@ -276,18 +344,6 @@
             <menu_item_check.on_click
              function="Floater.Toggle"
              parameter="mini_map" />
-        </menu_item_check>
-         <menu_item_check
-         label="World Map"
-         name="World Map"
-         shortcut="control|M"
-         use_mac_ctrl="true">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="world_map" />
-            <menu_item_check.on_click
-             function="Floater.Toggle"
-             parameter="world_map" />
         </menu_item_check>
         <menu_item_check
         label="Search"
@@ -300,6 +356,25 @@
              function="Floater.Toggle"
              parameter="search" />
             </menu_item_check>
+        <menu_item_separator/>
+        <menu_item_call
+         label="Teleport home"
+         name="Teleport Home"
+         shortcut="control|shift|H">
+        <menu_item_call.on_click
+         function="World.TeleportHome" />
+        <menu_item_call.on_enable
+         function="World.EnableTeleportHome" />
+        </menu_item_call>
+            <menu_item_call
+             label="Set home to here"
+             name="Set Home to Here">
+                <menu_item_call.on_click
+                 function="World.SetHomeLocation" />
+                <menu_item_call.on_enable
+                 function="World.EnableSetHomeLocation" />
+            </menu_item_call>
+        <menu_item_separator/>
         <menu_item_call
          label="Snapshot"
          name="Take Snapshot"
@@ -308,82 +383,51 @@
              function="Floater.Show"
              parameter="snapshot" />
         </menu_item_call>
-      <menu_item_call
-             label="Landmark This Place"
-             name="Create Landmark Here">
-                <menu_item_call.on_click
-                 function="World.CreateLandmark" />
-                <menu_item_call.on_enable
-                 function="World.EnableCreateLandmark" />
-            </menu_item_call>
-      <menu
-           create_jump_keys="true"
-           label="Place Profile"
-           name="Land"
-           tear_off="true">
+        <menu_item_separator/>
         <menu_item_call
-         label="Place Profile"
+         label="Place profile"
          layout="topleft"
          name="Place Profile">
             <menu_item_call.on_click
              function="World.PlaceProfile" />
         </menu_item_call>
         <menu_item_call
-         label="About Land"
+         label="About land"
          name="About Land">
             <menu_item_call.on_click
              function="Floater.Show"
              parameter="about_land" />
         </menu_item_call>
         <menu_item_call
-         label="Region/Estate"
+         label="Region / Estate"
          name="Region/Estate">
             <menu_item_call.on_click
              function="Floater.Show"
              parameter="region_info" />
         </menu_item_call>
-        </menu>
+        <menu_item_call
+         label="My land holdings..."
+         name="My Land">
+            <menu_item_call.on_click
+             function="Floater.Show"
+             parameter="land_holdings" />
+        </menu_item_call>
+        <menu_item_call
+         label="Buy this land"
+         name="Buy Land">
+            <menu_item_call.on_click
+             function="Land.Buy" />
+            <menu_item_call.on_enable
+             function="World.EnableBuyLand" />
+            </menu_item_call>
 
         <menu_item_separator/>
 
-        <menu_item_call
-             label="Buy This Land"
-             name="Buy Land">
-                <menu_item_call.on_click
-                 function="Land.Buy" />
-                <menu_item_call.on_enable
-                 function="World.EnableBuyLand" />
-            </menu_item_call>
-        <menu_item_call
-             label="My Land"
-             name="My Land">
-                <menu_item_call.on_click
-                 function="Floater.Show"
-                 parameter="land_holdings" />
-        </menu_item_call>
         <menu
            create_jump_keys="true"
            label="Show"
            name="LandShow"
            tear_off="true">
-         <menu_item_check
-         label="Move Controls"
-         name="Movement Controls">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="moveview" />
-            <menu_item_check.on_click
-             function="World.Toggle.MovementControls" />
-        </menu_item_check>
-        <menu_item_check
-         label="View Controls"
-         name="Camera Controls">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="camera" />
-            <menu_item_check.on_click
-             function="World.Toggle.CameraControls" />
-        </menu_item_check>
           <menu_item_check
              label="Ban Lines"
              name="Ban Lines">
@@ -456,24 +500,6 @@
         </menu>
 
         <menu_item_separator/>
-
-	    <menu_item_call
-	     label="Teleport Home"
-	     name="Teleport Home"
-	     shortcut="control|shift|H">
-		<menu_item_call.on_click
-		 function="World.TeleportHome" />
-		<menu_item_call.on_enable
-		 function="World.EnableTeleportHome" />
-	    </menu_item_call>
-            <menu_item_call
-             label="Set Home to Here"
-             name="Set Home to Here">
-                <menu_item_call.on_click
-                 function="World.SetHomeLocation" />
-                <menu_item_call.on_enable
-                 function="World.EnableSetHomeLocation" />
-            </menu_item_call>
     <!--    <menu_item_check
          label="Show Navigation Bar"
          name="ShowNavbarNavigationPanel">
@@ -496,8 +522,6 @@
         </menu_item_check>
         <menu_item_separator/>-->
 
-        <menu_item_separator/>
-
         <menu
          create_jump_keys="true"
          label="Sun"
@@ -1154,6 +1178,13 @@
      label="Help"
      name="Help"
      tear_off="true">
+        <menu_item_call
+         label="How to..."
+         name="How To">
+            <menu_item_call.on_click
+             function="Help.ToggleHowTo"
+             parameter="" />
+        </menu_item_call>
         <menu_item_call
          label="[SECOND_LIFE] Help"
          name="Second Life Help"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 4e4eea03547..0ba4b84abe4 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2369,7 +2369,7 @@ Would you be my friend?
    name="RemoveFromFriends"
    type="alertmodal">
     <tag>friendship</tag>
-Do you want to remove [NAME] from your Friends List?
+Do you want to remove &lt;nolink&gt;[NAME]&lt;/nolink&gt; from your Friends List?
     <tag>confirm</tag>
     <usetemplate
      name="okcancelbuttons"
@@ -5161,7 +5161,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
    name="FriendOnline"
    type="notifytip">
     <tag>friendship</tag>
-[NAME] is Online
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Online
   </notification>
 
   <notification
@@ -5169,7 +5169,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
    name="FriendOffline"
    type="notifytip">
     <tag>friendship</tag>
-[NAME] is Offline
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Offline
   </notification>
 
   <notification
@@ -6171,7 +6171,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    name="FriendshipAccepted"
    type="offer">
     <tag>friendship</tag>
-[NAME] accepted your friendship offer.
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; accepted your friendship offer.
   </notification>
 
   <notification
@@ -6180,7 +6180,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    persist="true"
    type="notify">
     <tag>friendship</tag>
-[NAME] declined your friendship offer.
+&lt;nolink&gt;[NAME]&lt;/nolink&gt; declined your friendship offer.
   </notification>
   
     <notification
diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml
deleted file mode 100644
index 4bd2235cdae..00000000000
--- a/indra/newview/skins/default/xui/en/panel_my_profile.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- follows="all"
- height="535"
- label="Profile"
- layout="topleft"
- left="0"
- name="panel_profile"
- top="0"
- width="315">
-    <string
-     name="CaptionTextAcctInfo">
-        [ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-    </string>
-    <string
-     name="payment_update_link_url">
-        http://www.secondlife.com/account/billing.php?lang=en
-    </string>
-    <string
-     name="partner_edit_link_url">
-        http://www.secondlife.com/account/partners.php?lang=en
-    </string>
-    <string
-     name="my_account_link_url"
-     value="http://secondlife.com/account" />
-    <string
-     name="no_partner_text"
-     value="None" />
-    <string
-     name="no_group_text"
-     value="None" />
-    <string
-	   name="RegisterDateFormat">
-	   [REG_DATE] ([AGE])
-	  </string>
-    <string
-      name="name_text_args">
-      [NAME]
-    </string>
-    <string
-      name="display_name_text_args">
-      [DISPLAY_NAME]
-    </string>
-  <layout_stack
-     name="layout"
-     orientation="vertical"
-     follows="all"
-     layout="topleft"
-     left="0"
-     top="0"
-     height="510"
-     width="315"
-     border_size="0">
-      <layout_panel
-         name="profile_stack"
-         follows="all"
-         layout="topleft"
-         top="0"
-         left="0"
-         height="492"
-         user_resize="false"
-         width="315">
-        <scroll_container
-         color="DkGray2"
-         follows="all"
-         layout="topleft"
-         left="0"
-         name="profile_scroll"
-         opaque="true"
-         height="488"
-         width="315"
-         top="0">
-          <panel
-                layout="topleft"
-          follows="left|top|right"
-                height="488"
-               name="scroll_content_panel"
-                top="0"
-                left="0"
-                width="297">
-            <panel
-                  follows="left|top|right"
-                  height="117"
-                  layout="topleft"
-                  left="10"
-                  name="second_life_image_panel"
-                  top="0"
-                  width="297">
-
-              <texture_picker
-               allow_no_texture="true"
-               default_image_name="None"
-               enabled="false"
-               fallback_image="Generic_Person_Large"
-               follows="top|left"
-               height="124"
-               layout="topleft"
-               left="3"
-               name="2nd_life_pic"
-               top="10"
-               width="102" />
-
-              <text
-                follows="left|top|right"
-                font="SansSerifLarge"
-                font.style="BOLD"
-                height="15"
-                layout="topleft"
-                left_pad="10"
-                name="display_name_descr_text"
-                text_color="0.7 0.7 0.7 1.0"
-                top_delta="0"
-                width="280" >
-                User name
-                </text>
-
-              <text
-                follows="left|top|right"
-                font.style="BOLD"
-                height="15"
-                layout="topleft"
-                left_delta="0"
-                name="name_descr_text"
-                text_color="0.4 0.4 0.4 1.0"
-                top_delta="20"
-                width="280">
-                Display Name
-              </text>
-
-              <button
-                follows="bottom"
-                height="23"
-                left_delta="0"
-                top_delta="20"
-                label="Profile"
-                name="see_profile_btn"
-                tool_tip="See profile for this avatar"
-                width="120" />
-
-            </panel>
-          </panel>
-        </scroll_container>
-      </layout_panel>
-      </layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml
deleted file mode 100644
index 124b1cfc6be..00000000000
--- a/indra/newview/skins/default/xui/en/panel_notes.xml
+++ /dev/null
@@ -1,236 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- follows="all"
- height="515"
- label="Notes &amp; Privacy"
- layout="topleft"
- left="0"
- name="panel_notes"
- top="0"
- width="313"
->
-    <layout_stack
-     name="layout"
-     orientation="vertical"
-     follows="all"
-     layout="topleft"
-     left="0"
-     top="0"
-     height="517"
-     width="313"
-     border_size="0">
-      <layout_panel
-       name="notes_stack"
-       follows="all"
-       layout="topleft"
-       top="0"
-       left="0"
-       height="450"
-       width="313">
-        <scroll_container
-         color="DkGray2"
-         follows="all"
-         layout="topleft"
-         left="0"
-         name="profile_scroll"
-         opaque="true"
-         height="450"
-         width="313"
-         top="0">
-          <panel
-           height="450"
-           layout="topleft"
-           name="profile_scroll_panel"
-           top="0"
-           left="0"
-           width="303">
-            <text
-             follows="left|top"
-         font.style="BOLD"
-             height="16"
-             layout="topleft"
-             left="11"
-             name="status_message"
-             text_color="white"
-             top="10"
-             value="My private notes:"
-             width="293" />
-            <text_editor
-             follows="left|top"
-             height="120"
-             layout="topleft"
-             left="12"
-             max_length="1000"
-             name="notes_edit"
-             text_color="DkGray"
-             top_pad="3"
-             width="288"
-             word_wrap="true" />
-            <text
-             follows="left|top"
-         font.style="BOLD"
-             height="16"
-             layout="topleft"
-             left="11"
-             name="status_message2"
-             text_color="white"
-             top_pad="20"
-             value="Allow this person to:"
-             width="293" />
-            <check_box
-             enabled="false"
-             height="16"
-             label="See my online status"
-             layout="topleft"
-             left="10"
-             name="status_check"
-             width="293" />
-            <check_box
-             enabled="false"
-             height="16"
-             label="See me on the map"
-             layout="topleft"
-             left="10"
-             name="map_check"
-             width="293" />
-            <check_box
-             enabled="false"
-             height="16"
-             label="Edit, delete or take my objects"
-             layout="topleft"
-             left="10"
-             name="objects_check"
-             width="293" />
-          </panel>
-        </scroll_container>
-      </layout_panel>
-      <layout_panel
-       follows="bottom|left"
-       height="30"
-         layout="topleft"
-         left="0"
-         name="notes_buttons_panel"
-         auto_resize="false"
-         width="313">
-         
-         <layout_stack
-	     	follows="bottom|left|right"
-			height="23"
-			layout="topleft"
-			name="bottom_bar_ls"
-			left="2"
-			orientation="horizontal"
-			top_pad="5"
-			width="309">
-	
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left="0"
-				name="add_friend_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="118">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Add Friend"
-			         layout="topleft"
-			         left="1"
-			         mouse_opaque="false"
-			         name="add_friend"
-			         tool_tip="Offer friendship to the Resident"
-			         top="0"
-			         width="117" />	
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="im_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="22">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="IM"
-			         layout="topleft"
-			         name="im"
-			         tool_tip="Open instant message session"
-			         top="0"
-			         left="1"
-			         width="21" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="call_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="52">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Call"
-			         layout="topleft"
-			         name="call"
-			         tool_tip="Call this Resident"
-			         left="1"
-			         top="0"
-			         use_ellipses="true"
-			         width="51" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="show_on_map_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="46">
-					<button
-			         enabled="false"
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Map"
-			         layout="topleft"
-			         name="show_on_map_btn"
-			         tool_tip="Show the Resident on the map"
-			         top="0"
-			         left="1"
-			         width="45" />
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="teleport_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="81">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Teleport"
-			         layout="topleft"
-			         name="teleport"
-			         tool_tip="Offer teleport"
-			         left="1"
-			         top="0"
-			         width="80" />	
-				</layout_panel>
-		</layout_stack>     
-        </layout_panel>
-    </layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index a7078ce2e10..4aeea8823e6 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -122,7 +122,7 @@
       layout="topleft"
       left_delta="0"
       name="external"
-      value="1"
+      value="true"
       top="0"
       tool_tip="Use the default system web browser for help, web links, etc. Not recommended if running full screen."
       width="480" />
diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml
deleted file mode 100644
index f5a9daa994c..00000000000
--- a/indra/newview/skins/default/xui/en/panel_profile.xml
+++ /dev/null
@@ -1,458 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- follows="all"
- height="430"
- label="Profile"
- layout="topleft"
- left="0"
- name="panel_profile"
- top="0"
- width="317">
-    <string
-     name="CaptionTextAcctInfo">
-        [ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-    </string>
-    <string
-     name="payment_update_link_url">
-        http://www.secondlife.com/account/billing.php?lang=en
-    </string>
-    <string
-     name="partner_edit_link_url">
-        http://www.secondlife.com/account/partners.php?lang=en
-    </string>
-    <string
-     name="my_account_link_url"
-     value="http://secondlife.com/account" />
-    <string
-     name="no_partner_text"
-     value="None" />
-    <string
-     name="no_group_text"
-     value="None" />
-    <string
-	 name="RegisterDateFormat">
-	 [REG_DATE] ([AGE])
-	</string>
-  <string
-  name="name_text_args">
-    [NAME]
-  </string>
-  <string
-    name="display_name_text_args">
-    [DISPLAY_NAME]
-  </string>
-    <layout_stack
-     name="layout"
-     orientation="vertical"
-     follows="all"
-     layout="topleft"
-     left="0"
-     top="0"
-     height="400"
-     width="317"
-     border_size="0">
-      <layout_panel
-         name="profile_stack"
-         follows="all"
-         layout="topleft"
-         top="0"
-         left="0"
-         height="400"
-         width="317">
-        <scroll_container
-         color="DkGray2"
-         follows="all"
-         layout="topleft"
-         left="0"
-         name="profile_scroll"
-         opaque="true"
-         height="400"
-         width="317"
-         top="0">
-          <panel
-                layout="topleft"
-          follows="left|top|right"
-                height="505"
-		min_height="505"
-                name="profile_scroll_panel"
-                top="0"
-                left="0"
-                width="297">
-            <panel
-                  follows="left|top|right"
-                  height="124"
-                  layout="topleft"
-                  left="13"
-                  name="second_life_image_panel"
-                  top="0"
-                  width="297">
-              <texture_picker
-               allow_no_texture="true"
-               default_image_name="None"
-               enabled="false"
-               fallback_image="Generic_Person_Large"
-               follows="top|left"
-               height="124"
-               layout="topleft"
-               left="0"
-               name="2nd_life_pic"
-               top="10"
-               width="102" />
-              <text
-               follows="left|top|right"
-         font.style="BOLD"
-               height="15"
-               layout="topleft"
-               left_pad="10"
-               name="title_sl_descr_text"
-               text_color="white"
-               top_delta="0"
-               value="[SECOND_LIFE]:"
-               width="180" />
-              <expandable_text
-               follows="left|top|right"
-               height="97"
-               layout="topleft"
-               left="107"
-               textbox.max_length="512"
-               textbox.show_context_menu="true"
-               name="sl_description_edit"
-               top_pad="-3"
-               translate="false"
-               width="180"
-               expanded_bg_visible="true"
-               expanded_bg_color="DkGray">
-                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet.Nullamma lesuada mauris sit amet ipsum. adipiscing elit. Ae nean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
-              </expandable_text>
-            </panel>
-            <panel
-             follows="left|top|right"
-             height="124"
-             layout="topleft"
-       top_pad="0"
-             left="13"
-             name="first_life_image_panel"
-             width="297">
-              <texture_picker
-               allow_no_texture="true"
-               default_image_name="None"
-               enabled="false"
-               fallback_image="Generic_Person_Large"
-               follows="top|left"
-               height="124"
-               layout="topleft"
-               left="0"
-               name="real_world_pic"
-               width="102" />
-              <text
-               follows="left|top|right"
-         font.style="BOLD"
-               height="15"
-               layout="topleft"
-               left_pad="10"
-               name="title_rw_descr_text"
-               text_color="white"
-               top_delta="0"
-               value="Real World:"
-               width="180" />
-              <expandable_text
-               follows="left|top|right"
-               height="97"
-               layout="topleft"
-               left="107"
-               textbox.max_length="512"
-               textbox.show_context_menu="true"
-               name="fl_description_edit"
-               top_pad="-3"
-               translate="false"
-               width="180"
-               expanded_bg_visible="true"
-               expanded_bg_color="DkGray">
-                Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
-              </expandable_text>
-            </panel>
-            <text
-              follows="left|top"
-              height="15"
-        font.style="BOLD"
-        font="SansSerifMedium"
-              layout="topleft"
-              left="10"
-              name="homepage_edit"
-              top_pad="0"
-              translate="false"
-              value="http://librarianavengers.org"
-              width="300"
-              word_wrap="false"
-              use_ellipses="true" />
-            <text
-             follows="left|top"
-           font.style="BOLD"
-             height="10"
-             layout="topleft"
-             left="10"
-             name="title_member_text"
-             text_color="white"
-             top_pad="10"
-             value="Resident Since:"
-             width="300" />
-            <text_editor
-             allow_scroll="false"
-             bg_visible="false"
-             follows="left|top"
-             h_pad="0"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="register_date"
-             read_only="true"
-             translate="false"
-             v_pad="0"
-             value="05/31/2376"
-             width="300"
-             word_wrap="true" />
-            <text
-             follows="left|top"
-       font.style="BOLD"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="title_acc_status_text"
-             text_color="white"
-             top_pad="5"
-             value="Account Status:"
-             width="300" />
-            <!-- <text
-         type="string"
-         follows="left|top"
-         font="SansSerifSmall"
-         height="15"
-         layout="topleft"
-         left_pad="10"
-         name="my_account_link"
-         top_delta="0"
-	 value="Go to Dashboard"
-         width="100"/> -->
-            <text_editor
-             allow_scroll="false"
-             bg_visible="false"
-             follows="left|top"
-             h_pad="0"
-             height="28"
-             layout="topleft"
-             left="10"
-             name="acc_status_text"
-             read_only="true"
-             top_pad="0"
-             translate="false"
-             v_pad="0"
-             width="300"
-             word_wrap="true">
-              Resident. No payment info on file.
-              Linden.
-            </text_editor>
-            <text
-             follows="left|top"
-       font.style="BOLD"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="title_partner_text"
-             text_color="white"
-             top_pad="3"
-             value="Partner:"
-             width="300" />
-            <panel
-             follows="left|top"
-             height="15"
-             layout="topleft"
-             left="10"
-             name="partner_data_panel"
-             top_pad="0"
-             width="300">
-              <text
-               follows="left|top"
-               height="10"
-               initial_value="(retrieving)"
-               layout="topleft"
-               left="0"
-               parse_urls="true"
-               name="partner_text"
-               top="0"
-               use_ellipses="true"
-           width="300" />
-            </panel>
-            <text
-             follows="left|top"
-       font.style="BOLD"
-             height="13"
-             layout="topleft"
-             left="10"
-             name="title_groups_text"
-             text_color="white"
-             top_pad="3"
-             value="Groups:"
-             width="300" />
-            <expandable_text
-            follows="all"
-            height="103"
-            layout="topleft"
-            left="7"
-            name="sl_groups"
-            textbox.max_length="512"
-            textbox.show_context_menu="true"
-            top_pad="0"
-            translate="false"
-            width="290"
-            expanded_bg_visible="true"
-            expanded_bg_color="DkGray">
-              Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. Aenean viverra tulip moosetop. Slan de heelish marfnik tooplod. Sum sum to whop de wompam booster copm.
-            </expandable_text>
-          </panel>
-        </scroll_container>
-      </layout_panel>
-           
-</layout_stack>
-
-	<layout_stack
-     name="layout_verb_buttons"
-     orientation="horizontal"
-     follows="bottom|left|right"
-     layout="topleft"
-     left="2"
-     top_pad="1"
-     height="30"
-     width="315"
-     border_size="0">
-     	<layout_panel
-         follows="bottom|left"
-         height="30"
-         layout="topleft"
-         name="profile_buttons_panel"
-         top="0"
-         auto_resize="false"
-         width="317">
-         	
-           <layout_stack
-	     	follows="bottom|left|right"
-			height="23"
-			layout="topleft"
-			name="bottom_bar_ls"
-			left="0"
-			orientation="horizontal"
-			top_pad="5"
-			width="317">
-	
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left="0"
-				name="add_friend_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="121">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Add Friend"
-			         layout="topleft"
-			         left="1"
-			         mouse_opaque="false"
-			         name="add_friend"
-			         tool_tip="Offer friendship to the Resident"
-			         top="0"
-			         width="120" />	
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="im_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="22">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="IM"
-			         layout="topleft"
-			         name="im"
-			         tool_tip="Open instant message session"
-			         top="0"
-			         left="1"
-			         width="21" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="call_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="52">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Call"
-			         layout="topleft"
-			         name="call"
-			         tool_tip="Call this Resident"
-			         left="1"
-			         top="0"
-			         use_ellipses="true"
-			         width="51" />		
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="chat_btn_lp"
-			    user_resize="false" 
-			    auto_resize="true"
-				width="93">
-					<button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="Teleport"
-			         layout="topleft"
-			         name="teleport"
-			         tool_tip="Offer teleport"
-			         left="1"
-			         top="0"
-			         use_ellipses="true"
-			         width="92" />
-				</layout_panel>
-				
-				<layout_panel
-				follows="bottom|left|right"
-				height="23"
-				layout="bottomleft"
-				left_pad="3"
-				name="overflow_btn_lp"
-			    user_resize="false" 
-			    auto_resize="false"
-				width="24">
-					<menu_button
-			         follows="bottom|left|right"
-			         height="23"
-			         label="â–¼"
-			         layout="topleft"
-			         name="overflow_btn"
-			         tool_tip="Pay money to or share inventory with the Resident"
-			         left="1"
-			         top="0"
-			         width="23" />		
-				</layout_panel>
-		</layout_stack>
-      </layout_panel>
-     </layout_stack>
-
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml
deleted file mode 100644
index 646875b52e8..00000000000
--- a/indra/newview/skins/default/xui/en/panel_profile_view.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- background_visible="true"
- follows="all"
- height="570"
- layout="topleft"
- min_height="350"
- name="panel_target_profile"
- left="0"
- width="333">
-  <string
-   name="status_online">
-    Online
-  </string>
-  <string
-   name="status_offline">
-    Offline
-  </string>
-  <button
-   follows="top|left"
-   height="24"
-   image_hover_unselected="BackButton_Over"
-   image_pressed="BackButton_Press"
-   image_unselected="BackButton_Off"
-   layout="topleft"
-   name="back"
-   left="10"
-   tab_stop="false"
-   top="2"
-   width="30"
-   use_draw_context_alpha="false" />
-  <text
-   top="10"
-   follows="top|left"
-   height="13"
-   layout="topleft"
-   left="45"
-   name="display_name_label"
-   text_color="LtGray"
-   value="Display Name:"
-   width="80" />
-  <text
-   top_delta="0"
-   follows="top|left"
-   height="13"
-   layout="topleft"
-   left="45"
-   name="solo_username_label"
-   text_color="LtGray"
-   value="Username:"
-   visible="false" 
-   width="80" />
-  <text
-   follows="top|right"
-   halign="right"
-   height="13"
-   layout="topleft"
-   right="-15"
-   name="status"
-   text_color="LtGray_50"
-   top_delta="0"
-   value="Online"
-   width="150" />
-  <text
-   follows="top|left|right"
-   font="SansSerifBigBold"
-   height="29"
-   layout="topleft"
-   left="45"
-   name="user_name_small"
-   text_color="LtGray"
-   top="22"
-   value="Jack oh look at me this is a super duper long name"
-   use_ellipses="true"
-   word_wrap="true"
-   visible="false"
-   width="255" />
-  <text
-   follows="top|left|right"
-   font="SansSerifHugeBold"
-   height="27"
-   layout="topleft"
-   left="45"
-   name="user_name"
-   text_color="LtGray"
-   translate="false"
-   top="25"
-   value="TestString PleaseIgnore"
-   visible="true"
-   use_ellipses="true"
-   width="258" /> 
-  <button
-         name="copy_to_clipboard"
-         layout="topleft"
-         follows="top|right"
-         image_overlay="Copy"
-         top_delta="0"
-         right="-15"
-         height="21"
-         width="21"
-         tab_stop="false" 
-         tool_tip="Copy to Clipboard"/>
-  <text
-   follows="top|left"
-   height="13"
-   layout="topleft"
-   left="45"
-   name="user_label"
-   text_color="LtGray"
-   top_pad="10" 
-   value="Username:"
-   width="70" />
-  <text
-   follows="top|left"
-   height="20"
-   layout="topleft"
-   left_pad="0"
-   name="user_slid"
-   text_color="EmphasisColor"
-   font="SansSerifBold"
-   top_delta="-2"
-   translate="false"
-   use_ellipses="true"
-   value="teststring.pleaseignore"
-   width="195" 
-   wrap="true "/>
-  <tab_container
-   follows="all"
-   height="489"
-   halign="center"
-   layout="topleft"
-   left="5"
-   min_width="333"
-   name="tabs"
-   tab_min_width="80"
-   tab_height="30"
-   tab_position="top"
-   top_pad="5"
-   width="317">
-    <panel
-     class="panel_profile"
-     filename="panel_profile.xml"
-     label="PROFILE"
-     layout="topleft"
-     help_topic="profile_profile_tab"
-     name="panel_profile" />
-    <panel
-     class="panel_picks"
-     filename="panel_picks.xml"
-     label="PICKS"
-     layout="topleft"
-     help_topic="profile_picks_tab"
-     name="panel_picks" />
-    <panel
-     class="panel_notes"
-     filename="panel_notes.xml"
-     label="NOTES &amp; PRIVACY"
-     layout="topleft"
-     help_topic="profile_notes_tab"
-     name="panel_notes" />
-  </tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index b9e714dd30c..062c403a26b 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -21,7 +21,6 @@
  width="310"
  left="0"
  top="0"
- follows="right|bottom"
  background_visible="false"
  bg_opaque_image="Toast_Over"
  bg_alpha_image="Toast_Background"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index befcc5dd87a..c25d1f57d6e 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3674,7 +3674,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Map_Label">Map</string>
   <string name="Command_Marketplace_Label">Marketplace</string>
   <string name="Command_MiniMap_Label">Mini-map</string>
-  <string name="Command_Move_Label">Move</string>
+  <string name="Command_Move_Label">Walk / run / fly</string>
   <string name="Command_People_Label">People</string>
   <string name="Command_Picks_Label">Picks</string>
   <string name="Command_Places_Label">Places</string>
@@ -3683,7 +3683,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Search_Label">Search</string>
   <string name="Command_Snapshot_Label">Snapshot</string>
   <string name="Command_Speak_Label">Speak</string>
-  <string name="Command_View_Label">View</string>
+  <string name="Command_View_Label">Camera controls</string>
   <string name="Command_Voice_Label">Voice settings</string>
 
   <string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>
diff --git a/indra/newview/skins/default/xui/es/floater_camera.xml b/indra/newview/skins/default/xui/es/floater_camera.xml
index cdcb9a146b2..f8911f3a4a5 100644
--- a/indra/newview/skins/default/xui/es/floater_camera.xml
+++ b/indra/newview/skins/default/xui/es/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Mover la cámara arriba y abajo, izquierda y derecha
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modos de cámara
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Orbital - Zoom - Panorámica
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Vistas predefinidas
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Centrar el objeto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 3fe0072a200..9591b424fce 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -981,7 +981,7 @@ no tienes el permiso de comprar terreno para el grupo que tienes activado actual
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		¿Quieres eliminar a [NAME] de tu lista de amigos?
+		¿Quieres eliminar a &lt;nolink&gt;[NAME]&lt;/nolink&gt; de tu lista de amigos?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2128,10 +2128,10 @@ Al hacerlo se iniciará el navegador web.
 		Asunto: [SUBJECT], Mensaje: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] está conectado
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está conectado
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] está desconectado
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está desconectado
 	</notification>
 	<notification name="AddSelfFriend">
 		Aunque eres muy agradable, no puedes añadirte como amigo a ti mismo.
@@ -2526,10 +2526,10 @@ Por favor, vuelve a intentarlo en unos momentos.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] ha aceptado tu oferta de amistad.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha aceptado tu oferta de amistad.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] ha rehusado tu oferta de amistad.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rehusado tu oferta de amistad.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Aceptado el ofrecimiento de amistad.
diff --git a/indra/newview/skins/default/xui/es/panel_my_profile.xml b/indra/newview/skins/default/xui/es/panel_my_profile.xml
deleted file mode 100644
index 29e5e6f652e..00000000000
--- a/indra/newview/skins/default/xui/es/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="no_partner_text" value="Ninguno/a"/>
-	<string name="no_group_text" value="Ninguno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nombre de usuario
-						</text>
-						<text name="name_descr_text">
-							Nombre mostrado
-						</text>
-						<button label="Perfil" name="see_profile_btn" tool_tip="Ver el perfil de este avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_notes.xml b/indra/newview/skins/default/xui/es/panel_notes.xml
deleted file mode 100644
index 00d4caf4685..00000000000
--- a/indra/newview/skins/default/xui/es/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notas y Privacidad" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Mis notas privadas:"/>
-					<text name="status_message2" value="Permitir que esta persona:"/>
-					<check_box label="Vea si estoy conectado" name="status_check"/>
-					<check_box label="Me vea en el mapa" name="map_check"/>
-					<check_box label="Edite, borre o coja mis objetos" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir una sesión de mensajes instantáneos"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Llamar" name="call" tool_tip="Llamar a este Residente"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mapa" name="show_on_map_btn" tool_tip="Mostrar al Residente en el mapa"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_profile.xml b/indra/newview/skins/default/xui/es/panel_profile.xml
deleted file mode 100644
index 334c0541af9..00000000000
--- a/indra/newview/skins/default/xui/es/panel_profile.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=es-ES
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=es
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=es-ES"/>
-	<string name="no_partner_text" value="Ninguno"/>
-	<string name="no_group_text" value="Ninguno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Mundo real:"/>
-					</panel>
-					<text name="title_member_text" value="Residente desde:"/>
-					<text name="title_acc_status_text" value="Estado de la cuenta:"/>
-					<text name="title_partner_text" value="Compañero/a:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(obteniendo)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupos:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir una sesión de mensajes instantáneos"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Llamar" name="call" tool_tip="Llamar a este Residente"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Pagar dinero al Residente o compartir algo del inventario con él"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Editar el perfil" name="edit_profile_btn" tool_tip="Modificar tu información personal"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_profile_view.xml b/indra/newview/skins/default/xui/es/panel_profile_view.xml
deleted file mode 100644
index cb374dee52f..00000000000
--- a/indra/newview/skins/default/xui/es/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Conectado/a
-	</string>
-	<string name="status_offline">
-		Desconectado/a
-	</string>
-	<text name="display_name_label" value="Nombre mostrado:"/>
-	<text name="solo_username_label" value="Nombre de usuario:"/>
-	<text name="status" value="Conectado/a"/>
-	<text name="user_name_small" value="Jack, ¿has visto esto? Es un nombre larguísimo."/>
-	<button name="copy_to_clipboard" tool_tip="Copiar al portapapeles"/>
-	<text name="user_label" value="Nombre de usuario:"/>
-	<tab_container name="tabs">
-		<panel label="PERFIL" name="panel_profile"/>
-		<panel label="DESTACADOS" name="panel_picks"/>
-		<panel label="NOTAS Y PRIVACIDAD" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/floater_camera.xml b/indra/newview/skins/default/xui/fr/floater_camera.xml
index 97ff246c4d7..77d3c2cfe4d 100644
--- a/indra/newview/skins/default/xui/fr/floater_camera.xml
+++ b/indra/newview/skins/default/xui/fr/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Déplacer la caméra vers le haut et le bas, la gauche et la droite
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modes
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Rotation - Zoom - Panoramique
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Préréglages
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Voir l&apos;objet
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index 31c29029b56..18b9063c008 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -980,7 +980,7 @@ Proposer à [NAME] de devenir votre ami(e) ?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Voulez-vous supprimer [NAME] de votre liste d&apos;amis ?
+		Voulez-vous supprimer &lt;nolink&gt;[NAME]&lt;/nolink&gt; de votre liste d&apos;amis ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2119,10 +2119,10 @@ Cette opération lancera votre navigateur Web.
 		Sujet : [SUBJECT], Message : [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] est en ligne
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; est en ligne
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] est hors ligne
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; est hors ligne
 	</notification>
 	<notification name="AddSelfFriend">
 		Même si vous êtes extrêmement sympathique, vous ne pouvez pas devenir ami avec vous-même.
@@ -2518,10 +2518,10 @@ Veuillez réessayer dans quelques minutes.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] a accepté votre amitié.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; a accepté votre amitié.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] a refusé votre amitié.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; a refusé votre amitié.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Amitié acceptée.
diff --git a/indra/newview/skins/default/xui/fr/panel_my_profile.xml b/indra/newview/skins/default/xui/fr/panel_my_profile.xml
deleted file mode 100644
index 5207c5a28e7..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Aucun"/>
-	<string name="no_group_text" value="Aucun"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nom d&apos;utilisateur
-						</text>
-						<text name="name_descr_text">
-							Nom d&apos;affichage
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Afficher le profil de cet avatar."/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_notes.xml b/indra/newview/skins/default/xui/fr/panel_notes.xml
deleted file mode 100644
index 1b44bc4b73c..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notes/Perso" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Mes notes perso :"/>
-					<text name="status_message2" value="Autoriser cette personne à :"/>
-					<check_box label="Afficher mon statut en ligne" name="status_check"/>
-					<check_box label="Me situer sur la carte" name="map_check"/>
-					<check_box label="Modifier, supprimer ou prendre mes objets" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Devenir amis" name="add_friend" tool_tip="Proposer à ce résident de devenir votre ami"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Ouvrir une session IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Appeler" name="call" tool_tip="Appeler ce résident"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Carte" name="show_on_map_btn" tool_tip="Afficher le résident sur la carte"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_profile.xml b/indra/newview/skins/default/xui/fr/panel_profile.xml
deleted file mode 100644
index 9aa6fe97a1e..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_profile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=fr-FR
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=fr
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=fr-FR"/>
-	<string name="no_partner_text" value="Aucun"/>
-	<string name="no_group_text" value="Aucun"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Vie réelle :"/>
-					</panel>
-					<text name="title_member_text" value="Résident depuis :"/>
-					<text name="title_acc_status_text" value="Statut du compte :"/>
-					<text_editor name="acc_status_text">
-						Résident. Aucune info de paiement enregistrée.
-              Linden.
-					</text_editor>
-					<text name="title_partner_text" value="Partenaire :"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(récupération en cours)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Groupes :"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Devenir amis" name="add_friend" tool_tip="Proposer à ce résident de devenir votre ami"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Ouvrir une session IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Appeler" name="call" tool_tip="Appeler ce résident"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Payer le résident ou partager l&apos;inventaire avec lui"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Modifier le profil" name="edit_profile_btn" tool_tip="Modifier vos informations personnelles"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_profile_view.xml b/indra/newview/skins/default/xui/fr/panel_profile_view.xml
deleted file mode 100644
index 76ba44e8990..00000000000
--- a/indra/newview/skins/default/xui/fr/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		En ligne
-	</string>
-	<string name="status_offline">
-		Hors ligne
-	</string>
-	<text name="display_name_label" value="Nom d&apos;affichage :"/>
-	<text name="solo_username_label" value="Nom d&apos;utilisateur :"/>
-	<text name="status" value="En ligne"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="Copier dans le presse-papiers"/>
-	<text name="user_label" value="Nom d&apos;utilisateur :"/>
-	<tab_container name="tabs">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="FAVORIS" name="panel_picks"/>
-		<panel label="NOTES/PERSO" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/floater_camera.xml b/indra/newview/skins/default/xui/it/floater_camera.xml
index be4b8e210d6..7e6ca4307ed 100644
--- a/indra/newview/skins/default/xui/it/floater_camera.xml
+++ b/indra/newview/skins/default/xui/it/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Muovi la telecamera su e giù e a sinistra e destra
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modalità della fotocamera
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Ruota visuale - Ingrandisci - Panoramica
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Visuali predefinite
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Vedi oggetto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index e19b84912a5..2db0892cd6e 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -978,7 +978,7 @@ Offri l&apos;amicizia a [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Vuoi rimuovere [NAME] dalla lista dei tuoi amici?
+		Vuoi rimuovere &lt;nolink&gt;[NAME]&lt;/nolink&gt; dalla lista dei tuoi amici?
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2125,10 +2125,10 @@ Verrà avviato il browser Web.
 		Oggetto: [SUBJECT], Messaggio: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] è Online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è Online
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] è Offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è Offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Anche se sei molto simpatico, non puoi aggiungere te stesso all&apos;elenco degli amici.
@@ -2520,10 +2520,10 @@ Riprova tra qualche istante.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] ha accettato la tua offerta di amicizia.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha accettato la tua offerta di amicizia.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] ha rifiutato la tua offerta di amicizia.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rifiutato la tua offerta di amicizia.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Offerta di amicizia accettata.
diff --git a/indra/newview/skins/default/xui/it/panel_my_profile.xml b/indra/newview/skins/default/xui/it/panel_my_profile.xml
deleted file mode 100644
index 094b97962f4..00000000000
--- a/indra/newview/skins/default/xui/it/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profilo" name="panel_profile">
-	<string name="no_partner_text" value="Nessuno"/>
-	<string name="no_group_text" value="Nessuno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nome utente
-						</text>
-						<text name="name_descr_text">
-							Nome visualizzato
-						</text>
-						<button label="Profilo" name="see_profile_btn" tool_tip="Visualizza profilo per questo avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_notes.xml b/indra/newview/skins/default/xui/it/panel_notes.xml
deleted file mode 100644
index e1271382778..00000000000
--- a/indra/newview/skins/default/xui/it/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Note e Privacy" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Le mie note private:"/>
-					<text name="status_message2" value="Consenti a questa persona di:"/>
-					<check_box label="Vedere se sono online" name="status_check"/>
-					<check_box label="Vedermi sulla mappa" name="map_check"/>
-					<check_box label="Modificare, eliminare o prendere i miei oggetti" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Aggiungi come amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Chiama" name="call" tool_tip="Chiama questo residente"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mappa" name="show_on_map_btn" tool_tip="Mostra il residente sulla mappa"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleport" name="teleport" tool_tip="Offri teleport"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_profile.xml b/indra/newview/skins/default/xui/it/panel_profile.xml
deleted file mode 100644
index 309937c5a01..00000000000
--- a/indra/newview/skins/default/xui/it/panel_profile.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profilo" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=it-IT
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=it
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=it-IT"/>
-	<string name="no_partner_text" value="Nessuno"/>
-	<string name="no_group_text" value="Nessuno"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Mondo reale:"/>
-					</panel>
-					<text name="title_member_text" value="Residente dal:"/>
-					<text name="title_acc_status_text" value="Stato account:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(recupero)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Gruppi:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Aggiungi come amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Chiama" name="call" tool_tip="Chiama questo residente"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleport" name="teleport" tool_tip="Offri teleport"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="â–¼" name="overflow_btn" tool_tip="Paga del denaro o condividi qualcosa dall&apos;inventario con il residente"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Modifica profilo" name="edit_profile_btn" tool_tip="Modifica le tue informazioni personali"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_profile_view.xml b/indra/newview/skins/default/xui/it/panel_profile_view.xml
deleted file mode 100644
index 409eb5d1f40..00000000000
--- a/indra/newview/skins/default/xui/it/panel_profile_view.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Online
-	</string>
-	<string name="status_offline">
-		Offline
-	</string>
-	<text name="display_name_label" value="Nome visualizzato:"/>
-	<text name="solo_username_label" value="Nome utente:"/>
-	<text name="status" value="Online"/>
-	<text name="user_name_small" value="Jack guarda quanto è lungo questo splendido nome"/>
-	<text name="user_name" value="Jack Linden"/>
-	<button name="copy_to_clipboard" tool_tip="Copia negli appunti"/>
-	<text name="user_label" value="Nome utente:"/>
-	<text name="user_slid" value="jack.linden"/>
-	<tab_container name="tabs">
-		<panel label="PROFILO" name="panel_profile"/>
-		<panel label="LUOGHI CONSIGLIATI" name="panel_picks"/>
-		<panel label="NOTE E PRIVACY" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/floater_camera.xml b/indra/newview/skins/default/xui/ja/floater_camera.xml
index 5d3a0489756..0661e173091 100644
--- a/indra/newview/skins/default/xui/ja/floater_camera.xml
+++ b/indra/newview/skins/default/xui/ja/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		カメラを上下左右に移動
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		カメラモード
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		旋回 - ズーム - 水平・垂直移動
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		事前設定の視野
-	</floater.string>
 	<floater.string name="free_mode_title">
 		オブジェクトを見る
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 85f09b45009..7dfa6d2f7a8 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1010,7 +1010,7 @@ L$ は返金されません。
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		フレンドリストから [NAME] を削除しますか?
+		フレンドリストから &lt;nolink&gt;[NAME]&lt;/nolink&gt; を削除しますか?
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2167,10 +2167,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		件名: [SUBJECT]、メッセージ: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] はオンライン中です
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオンライン中です
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] はオフライン中です
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオフライン中です
 	</notification>
 	<notification name="AddSelfFriend">
 		残念ながら自分自身をフレンド登録することはできません。
@@ -2567,10 +2567,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME]は、フレンド登録を受け入れました。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt;は、フレンド登録を受け入れました。
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME]は、フレンド登録を断りました。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt;は、フレンド登録を断りました。
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		フレンドの登録依頼が承認されました。
diff --git a/indra/newview/skins/default/xui/ja/panel_my_profile.xml b/indra/newview/skins/default/xui/ja/panel_my_profile.xml
deleted file mode 100644
index a0d99ba5a8f..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="プロフィール" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=ja
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/billing.php?lang=ja
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="なし"/>
-	<string name="no_group_text" value="なし"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							ユーザー名
-						</text>
-						<text name="name_descr_text">
-							表示名
-						</text>
-						<button label="プロフィール" name="see_profile_btn" tool_tip="このアバターのプロフィールを表示"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_notes.xml b/indra/newview/skins/default/xui/ja/panel_notes.xml
deleted file mode 100644
index aa6d823c59f..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="メモとプライバシー" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="個人的メモ:"/>
-					<text name="status_message2" value="この人に許可:"/>
-					<check_box label="オンライン状態の確認" name="status_check"/>
-					<check_box label="地図で居場所を確認" name="map_check"/>
-					<check_box label="私のオブジェクトの編集・削除・取得" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="フレンド登録" name="add_friend" tool_tip="フレンド登録を申し出ます"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="インスタントメッセージを開きます"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="コール" name="call" tool_tip="この住人にコールする"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="地図" name="show_on_map_btn" tool_tip="住人を地図上で表示する"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_profile.xml b/indra/newview/skins/default/xui/ja/panel_profile.xml
deleted file mode 100644
index 1acad9f81aa..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_profile.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="プロフィール" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=ja-JP
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=ja
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=ja-JP"/>
-	<string name="no_partner_text" value="なし"/>
-	<string name="no_group_text" value="なし"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="現実世界:"/>
-					</panel>
-					<text name="title_member_text" value="住人登録:"/>
-					<text name="title_acc_status_text" value="アカウントの状態:"/>
-					<text_editor name="acc_status_text">
-						住人。 支払情報未登録。
-              リンデン。
-					</text_editor>
-					<text name="title_partner_text" value="パートナー:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(取得中)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="グループ:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="フレンド登録" name="add_friend" tool_tip="フレンド登録を申し出ます"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="インスタントメッセージを開きます"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="コール" name="call" tool_tip="この住人にコールする"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="住人にお金を渡すか持ち物を共有します"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="プロフィールの編集" name="edit_profile_btn" tool_tip="個人的な情報を編集します"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_profile_view.xml b/indra/newview/skins/default/xui/ja/panel_profile_view.xml
deleted file mode 100644
index 5cb65757731..00000000000
--- a/indra/newview/skins/default/xui/ja/panel_profile_view.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		オンライン
-	</string>
-	<string name="status_offline">
-		オフライン
-	</string>
-	<text name="display_name_label" value="表示名:"/>
-	<text name="solo_username_label" value="ユーザー名:"/>
-	<text name="status" value="オンライン"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<text name="user_name" value="Jack Linden"/>
-	<button name="copy_to_clipboard" tool_tip="クリップボードにコピー"/>
-	<text name="user_label" value="ユーザー名:"/>
-	<text name="user_slid" value="jack.linden"/>
-	<tab_container name="tabs">
-		<panel label="プロフィール" name="panel_profile"/>
-		<panel label="ピック" name="panel_picks"/>
-		<panel label="メモとプライバシー" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/floater_camera.xml b/indra/newview/skins/default/xui/pl/floater_camera.xml
index 5b9dd476160..60f3cd0fffd 100644
--- a/indra/newview/skins/default/xui/pl/floater_camera.xml
+++ b/indra/newview/skins/default/xui/pl/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Poruszaj kamerą w dół/górę oraz w prawo/lewo
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Ustawienia
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		W prawo lub w lewo
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ustaw widok
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Zobacz obiekt
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index 7d3225ea317..e1fb6dd3f14 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -946,7 +946,7 @@ Zaproponować znajomość [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Czy chcesz usunąć [NAME] z listy znajomych?
+		Czy chcesz usunąć &lt;nolink&gt;[NAME]&lt;/nolink&gt; z listy znajomych?
 		<usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2078,10 +2078,10 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t
 		Temat: [SUBJECT], Treść: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] jest w Second Life
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; jest w Second Life
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] opuszcza Second Life
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; opuszcza Second Life
 	</notification>
 	<notification name="AddSelfFriend">
 		Nie możesz dodać siebie do listy znajomych.
@@ -2458,10 +2458,10 @@ Spróbuj ponowanie za kilka minut.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		Twoja propozycja znajomości została przyjęta przez [NAME].
+		Twoja propozycja znajomości została przyjęta przez &lt;nolink&gt;[NAME]&lt;/nolink&gt;.
 	</notification>
 	<notification name="FriendshipDeclined">
-		Twoja propozycja znajomości została odrzucona przez [NAME].
+		Twoja propozycja znajomości została odrzucona przez &lt;nolink&gt;[NAME]&lt;/nolink&gt;.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Propozycja znajomości została zaakceptowana.
diff --git a/indra/newview/skins/default/xui/pl/panel_my_profile.xml b/indra/newview/skins/default/xui/pl/panel_my_profile.xml
deleted file mode 100644
index cdc833241d6..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Żadne"/>
-	<string name="no_group_text" value="Żadne"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nazwa użytkownika
-						</text>
-						<text name="name_descr_text">
-							Wyświetlana nazwa
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Zobacz profil tego awatara"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_notes.xml b/indra/newview/skins/default/xui/pl/panel_notes.xml
deleted file mode 100644
index 571171d64c7..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notatki &amp; Prywatność" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Notatki:"/>
-					<text name="status_message2" value="Pozwól tej osobie na:"/>
-					<check_box label="Widzenie mojego statusu" name="status_check"/>
-					<check_box label="Lokalizowanie mnie na mapie" name="map_check"/>
-					<check_box label="Edytowanie, kasowanie lub zabieranie moich obiektów" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Dodaj do Znajomych" name="add_friend" tool_tip="Zaoferuj znajomość Rezydentowi"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Dzwoń" name="call" tool_tip="Zadzwoń do Rezydenta"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mapa" name="show_on_map_btn" tool_tip="Pokaż Rezydenta na mapie"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_profile.xml b/indra/newview/skins/default/xui/pl/panel_profile.xml
deleted file mode 100644
index 77dd951bc42..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_profile.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="no_partner_text" value="Brak"/>
-	<string name="no_group_text" value="Żadne"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Życie#1:"/>
-					</panel>
-					<text name="title_member_text" value="Urodziny:"/>
-					<text name="title_acc_status_text" value="Konto:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(przetwarzanie)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupy:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Poznaj" name="add_friend" tool_tip="Zaproponuj znajomość Rezydentowi"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Dzwoń" name="call" tool_tip="Zadzwoń do tego Rezydenta"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Zapłać lub udostępnij obiekt Rezydentowi"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Edytuj profil" name="edit_profile_btn" tool_tip="Edytuj informacje o sobie"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_profile_view.xml b/indra/newview/skins/default/xui/pl/panel_profile_view.xml
deleted file mode 100644
index 1fd6bc1d109..00000000000
--- a/indra/newview/skins/default/xui/pl/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Obecnie w SL
-	</string>
-	<string name="status_offline">
-		Nieaktywny
-	</string>
-	<text name="display_name_label" value="Wyświetlana nazwa:"/>
-	<text name="solo_username_label" value="Nazwa użytkownika:"/>
-	<text name="status" value="Obecnie w SL"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="Kopiuj do schowka"/>
-	<text name="user_label" value="Nazwa użytkownika:"/>
-	<tab_container name="tabs">
-		<panel label="PROFIL" name="panel_profile"/>
-		<panel label="ULUBIONE" name="panel_picks"/>
-		<panel label="NOTATKI &amp; PRYWATNOŚĆ" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/floater_camera.xml b/indra/newview/skins/default/xui/pt/floater_camera.xml
index 0e4fc1b4558..6b66d017816 100644
--- a/indra/newview/skins/default/xui/pt/floater_camera.xml
+++ b/indra/newview/skins/default/xui/pt/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Mover a Câmera para Cima e para Baixo, para a Esquerda e para a Direita
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Modos de câmera
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Pan zoom orbital
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ângulos predefinidos
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Visualizar objeto
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 4bd9f86e0f9..d3547beeb36 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -973,7 +973,7 @@ Oferecer amizade para [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Remover [NAME] da sua lista de amigos?
+		Remover &lt;nolink&gt;[NAME]&lt;/nolink&gt; da sua lista de amigos?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Remover"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2109,10 +2109,10 @@ Isso abrirá o seu navegador.
 		Assunto: [SUBJECT], Mensagem: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] está online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está online
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] está offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; está offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Você é o máximo! Mesmo assim, não dá para adicionar a si mesmo(a) como amigo(a).
@@ -2501,10 +2501,10 @@ Cada um pode ver o status do outro (definição padrão).
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] aceitou seu convite de amizade.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; aceitou seu convite de amizade.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] recusou seu convite de amizade
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; recusou seu convite de amizade
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Oferta de amizada aceita.
diff --git a/indra/newview/skins/default/xui/pt/panel_my_profile.xml b/indra/newview/skins/default/xui/pt/panel_my_profile.xml
deleted file mode 100644
index aa15a2445d2..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_my_profile.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="no_partner_text" value="Nenhum"/>
-	<string name="no_group_text" value="Nenhum"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Nome de usuário
-						</text>
-						<text name="name_descr_text">
-							Nome de tela
-						</text>
-						<button label="Perfil" name="see_profile_btn" tool_tip="Ver o perfil deste avatar"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_notes.xml b/indra/newview/skins/default/xui/pt/panel_notes.xml
deleted file mode 100644
index c15e838b34f..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Anotações e Privacidade" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Minhas anotações privadas:"/>
-					<text name="status_message2" value="Deixar esta pessoa:"/>
-					<check_box label="Ver meu status" name="status_check"/>
-					<check_box label="Ver minha localização no mapa" name="map_check"/>
-					<check_box label="Pegar, editar ou excluir objetos meus" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ligar" name="call" tool_tip="Ligar para este residente"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Mapa" name="show_on_map_btn" tool_tip="Exibir o residente no mapa"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_profile.xml b/indra/newview/skins/default/xui/pt/panel_profile.xml
deleted file mode 100644
index 075ef55dee5..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_profile.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Perfil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=pt-BR
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=pt
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=pt-BR"/>
-	<string name="no_partner_text" value="Ninguém"/>
-	<string name="no_group_text" value="Nenhum"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Mundo real:"/>
-					</panel>
-					<text name="title_member_text" value="Residente desde:"/>
-					<text name="title_acc_status_text" value="Conta:"/>
-					<text name="title_partner_text" value="Parceiro(a):"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(pesquisando)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Grupos:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ligar" name="call" tool_tip="Ligar para este residente"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Pagar ou compartilhar inventário com o residente"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-		<layout_panel name="profile_me_buttons_panel">
-			<button label="Editar perfil" name="edit_profile_btn" tool_tip="Editar dados pessoais"/>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_profile_view.xml b/indra/newview/skins/default/xui/pt/panel_profile_view.xml
deleted file mode 100644
index d81ee08e6cf..00000000000
--- a/indra/newview/skins/default/xui/pt/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Conectado
-	</string>
-	<string name="status_offline">
-		Desconectado
-	</string>
-	<text name="display_name_label" value="Nome de tela:"/>
-	<text name="solo_username_label" value="Nome de usuário:"/>
-	<text name="status" value="Conectado"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="Copiar para área de transferência"/>
-	<text name="user_label" value="Nome de usuário:"/>
-	<tab_container name="tabs">
-		<panel label="PERFIL" name="panel_profile"/>
-		<panel label="DESTAQUES" name="panel_picks"/>
-		<panel label="ANOTAÇÕES E PRIVACIDADE" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/floater_camera.xml b/indra/newview/skins/default/xui/ru/floater_camera.xml
index 7a1f530668a..945a63c0eb8 100644
--- a/indra/newview/skins/default/xui/ru/floater_camera.xml
+++ b/indra/newview/skins/default/xui/ru/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Переместить камеру вверх, вниз, влево или вправо
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Режимы камеры
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Вращение, приближение, сдвиг
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Стандартные настройки
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Смотреть на объект
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index d43d9071641..1be14160ed1 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -979,7 +979,7 @@
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Удалить жителя [NAME] из вашего списка друзей?
+		Удалить жителя &lt;nolink&gt;[NAME]&lt;/nolink&gt; из вашего списка друзей?
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2119,10 +2119,10 @@ http://secondlife.com/download.
 		Раздел: [SUBJECT], сообщение: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] в сети
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; в сети
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] не в сети
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; не в сети
 	</notification>
 	<notification name="AddSelfFriend">
 		Вы лучше всех, но нельзя добавить в друзья себя самого.
@@ -2518,10 +2518,10 @@ http://secondlife.com/download.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] принял(а) ваше предложение дружить.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; принял(а) ваше предложение дружить.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] отклонил(а) ваше предложение дружить.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; отклонил(а) ваше предложение дружить.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Предложение дружить принято.
diff --git a/indra/newview/skins/default/xui/ru/panel_my_profile.xml b/indra/newview/skins/default/xui/ru/panel_my_profile.xml
deleted file mode 100644
index 9117bfec188..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Профиль" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Нет"/>
-	<string name="no_group_text" value="Нет"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Имя пользователя
-						</text>
-						<text name="name_descr_text">
-							Экранное имя
-						</text>
-						<button label="Профиль" name="see_profile_btn" tool_tip="Посмотреть профиль этого аватара"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_notes.xml b/indra/newview/skins/default/xui/ru/panel_notes.xml
deleted file mode 100644
index aa743833492..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Заметки и приватность" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Мои личные заметки:"/>
-					<text name="status_message2" value="Разрешить этому жителю:"/>
-					<check_box label="Видеть мой статус в сети" name="status_check"/>
-					<check_box label="Видеть меня на карте" name="map_check"/>
-					<check_box label="Редактировать, удалять или брать мои объекты" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Добавить в друзья" name="add_friend" tool_tip="Предложить дружбу этому жителю"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Начать сеанс IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Звонок" name="call" tool_tip="Позвонить этому жителю"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Карта" name="show_on_map_btn" tool_tip="Показать жителя на карте"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Телепортация" name="teleport" tool_tip="Предложить телепортацию"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_profile.xml b/indra/newview/skins/default/xui/ru/panel_profile.xml
deleted file mode 100644
index fab57d678cf..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_profile.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Профиль" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Нет"/>
-	<string name="no_group_text" value="Нет"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Реальный мир:"/>
-					</panel>
-					<text name="title_member_text" value="Обитатель SL с:"/>
-					<text name="title_acc_status_text" value="Статус аккаунта:"/>
-					<text name="title_partner_text" value="Партнер:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(получение информации)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Группы:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="В друзья" name="add_friend" tool_tip="Предложить дружбу этому жителю"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="Начать сеанс IM"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Звонок" name="call" tool_tip="Позвонить этому жителю"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Телепортация" name="teleport" tool_tip="Предложить телепортацию"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Заплатить жителю или поделиться с ним вещами"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_profile_view.xml b/indra/newview/skins/default/xui/ru/panel_profile_view.xml
deleted file mode 100644
index c97c5afc018..00000000000
--- a/indra/newview/skins/default/xui/ru/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Онлайн
-	</string>
-	<string name="status_offline">
-		Оффлайн
-	</string>
-	<text name="display_name_label" value="Экранное имя:"/>
-	<text name="solo_username_label" value="Имя пользователя:"/>
-	<text name="status" value="Онлайн"/>
-	<text name="user_name_small" value="Взгляни-ка, друг, какое длиннющее имя"/>
-	<button name="copy_to_clipboard" tool_tip="Копировать в буфер обмена"/>
-	<text name="user_label" value="Имя пользователя:"/>
-	<tab_container name="tabs">
-		<panel label="ПРОФИЛЬ" name="panel_profile"/>
-		<panel label="ПОДБОРКА" name="panel_picks"/>
-		<panel label="ЗАМЕТКИ И ДОСТУП" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/floater_camera.xml b/indra/newview/skins/default/xui/tr/floater_camera.xml
index 4161e6ea52a..c92d4e9db49 100644
--- a/indra/newview/skins/default/xui/tr/floater_camera.xml
+++ b/indra/newview/skins/default/xui/tr/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Kamerayı Yukarı ve Aşağı, Sola ve Sağa Hareket Ettir
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		Kamera modları
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		Yörünge - Yakınlş. - Kamerayı Çvr.
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		Ön Ayarlı Görünümler
-	</floater.string>
 	<floater.string name="free_mode_title">
 		Nesneyi Göster
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index b62ff01ab96..6908f6867fa 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -979,7 +979,7 @@ Etkin grubunuz adına arazi satın almak için gerekli izne sahip değilsiniz.
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		[NAME] adlı kişiyi Arkadaş Listenizden çıkarmak istiyor musunuz?
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; adlı kişiyi Arkadaş Listenizden çıkarmak istiyor musunuz?
 		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2119,10 +2119,10 @@ Bu adımda web tarayıcınızın başlatılacağına dikkat edin.
 		Konu: [SUBJECT], Ä°leti: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] Çevrimiçi
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; Çevrimiçi
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] Çevrimdışı
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; Çevrimdışı
 	</notification>
 	<notification name="AddSelfFriend">
 		Çok iyi biri olduğunuza eminiz fakat kendinizi arkadaş olarak ekleyemezsiniz.
@@ -2518,10 +2518,10 @@ Lütfen biraz sonra tekrar deneyin.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] arkadaşlık teklifinizi kabul etti.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; arkadaşlık teklifinizi kabul etti.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] arkadaşlık teklifinizi reddetti.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; arkadaşlık teklifinizi reddetti.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Arkadaşlık teklifi kabul edildi.
diff --git a/indra/newview/skins/default/xui/tr/panel_my_profile.xml b/indra/newview/skins/default/xui/tr/panel_my_profile.xml
deleted file mode 100644
index fc0b9b6e032..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Hiçbiri"/>
-	<string name="no_group_text" value="Hiçbiri"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							Kullanıcı adı
-						</text>
-						<text name="name_descr_text">
-							Görüntü Adı
-						</text>
-						<button label="Profil" name="see_profile_btn" tool_tip="Bu avatar profiline bak"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_notes.xml b/indra/newview/skins/default/xui/tr/panel_notes.xml
deleted file mode 100644
index ff5b60996ab..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notlar ve Gizlilik" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="Özel notlarım:"/>
-					<text name="status_message2" value="Bu kiÅŸiye ÅŸu izinler verilsin:"/>
-					<check_box label="Çevrimiçi durumumu görme" name="status_check"/>
-					<check_box label="Beni haritada görme" name="map_check"/>
-					<check_box label="Nesnelerimi düzenleme, silme veya alma" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Arkadaş Ekle" name="add_friend" tool_tip="Sakine arkadaşlık öner"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="Aİ" name="im" tool_tip="Anlık ileti oturumu aç"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ara" name="call" tool_tip="Bu Sakini ara"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="Harita" name="show_on_map_btn" tool_tip="Sakini haritada göster"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="Işınla" name="teleport" tool_tip="Işınlama teklif et"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_profile.xml b/indra/newview/skins/default/xui/tr/panel_profile.xml
deleted file mode 100644
index 4b7a9645373..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_profile.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Profil" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="Hiçbiri"/>
-	<string name="no_group_text" value="Hiçbiri"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="Gerçek Dünya:"/>
-					</panel>
-					<text name="title_member_text" value="Ne Zamandan Beri SL Sakini:"/>
-					<text name="title_acc_status_text" value="Hesap Durumu:"/>
-					<text name="title_partner_text" value="Partner:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(alınıyor)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="Gruplar:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="Arkadaş Ekle" name="add_friend" tool_tip="Sakine arkadaşlık öner"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="Aİ" name="im" tool_tip="Anlık ileti oturumu aç"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="Ara" name="call" tool_tip="Bu Sakini ara"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="Işınla" name="teleport" tool_tip="Işınlama teklif et"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="Sakine para öde veya envanteri paylaş"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_profile_view.xml b/indra/newview/skins/default/xui/tr/panel_profile_view.xml
deleted file mode 100644
index 17c5002bd75..00000000000
--- a/indra/newview/skins/default/xui/tr/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		Çevrimiçi
-	</string>
-	<string name="status_offline">
-		Çevrimdışı
-	</string>
-	<text name="display_name_label" value="Ekran Adı:"/>
-	<text name="solo_username_label" value="Kullanıcı Adı:"/>
-	<text name="status" value="Çevrimiçi"/>
-	<text name="user_name_small" value="Bak arkadaşım bu çok uzun bir ad"/>
-	<button name="copy_to_clipboard" tool_tip="Panoya Kopyala"/>
-	<text name="user_label" value="Kullanıcı Adı:"/>
-	<tab_container name="tabs">
-		<panel label="PROFÄ°L" name="panel_profile"/>
-		<panel label="SEÇMELER" name="panel_picks"/>
-		<panel label="NOTLAR &amp; GÄ°ZLÄ°LÄ°K" name="panel_notes"/>
-	</tab_container>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/floater_camera.xml b/indra/newview/skins/default/xui/zh/floater_camera.xml
index f4db20684c5..b75474340c7 100644
--- a/indra/newview/skins/default/xui/zh/floater_camera.xml
+++ b/indra/newview/skins/default/xui/zh/floater_camera.xml
@@ -9,15 +9,6 @@
 	<floater.string name="move_tooltip">
 		Move Camera Up and Down, Left and Right
 	</floater.string>
-	<floater.string name="camera_modes_title">
-		攝影機模式
-	</floater.string>
-	<floater.string name="pan_mode_title">
-		環繞縮放平移
-	</floater.string>
-	<floater.string name="presets_mode_title">
-		預設視角
-	</floater.string>
 	<floater.string name="free_mode_title">
 		視角物件
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index 2d309a2af0b..17ff6288a5f 100644
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -966,7 +966,7 @@ Offer friendship to [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Do you want to remove [NAME] from your Friends List?
+		Do you want to remove &lt;nolink&gt;[NAME]&lt;/nolink&gt; from your Friends List?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -2109,10 +2109,10 @@ Link to this from a web page to give others easy access to this location, or try
 		Topic: [SUBJECT], Message: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] 上線
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; 上線
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] 離線
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; 離線
 	</notification>
 	<notification name="AddSelfFriend">
 		Although you&apos;re very nice, you can&apos;t add yourself as a friend.
@@ -2491,10 +2491,10 @@ Please try again in a few moments.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		[NAME] accepted your friendship offer.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; accepted your friendship offer.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] 謝絕你的交友邀請。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; 謝絕你的交友邀請。
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		交友邀請被接受。
diff --git a/indra/newview/skins/default/xui/zh/panel_my_profile.xml b/indra/newview/skins/default/xui/zh/panel_my_profile.xml
deleted file mode 100644
index 79817d7be9e..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_my_profile.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="檔案" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="ç„¡"/>
-	<string name="no_group_text" value="ç„¡"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="scroll_content_panel">
-					<panel name="second_life_image_panel">
-						<text name="display_name_descr_text">
-							User name
-						</text>
-						<text name="name_descr_text">
-							顯示名稱
-						</text>
-						<button label="檔案" name="see_profile_btn" tool_tip="察看這位化身的檔案"/>
-					</panel>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_notes.xml b/indra/newview/skins/default/xui/zh/panel_notes.xml
deleted file mode 100644
index 875c6bb3284..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_notes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Notes &amp; Privacy" name="panel_notes">
-	<layout_stack name="layout">
-		<layout_panel name="notes_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<text name="status_message" value="My private notes:"/>
-					<text name="status_message2" value="允許這個人可以:"/>
-					<check_box label="看到我上線狀態" name="status_check"/>
-					<check_box label="在地圖上看見我" name="map_check"/>
-					<check_box label="邊輯,刪除或取下我的物件" name="objects_check"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-		<layout_panel name="notes_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="加為朋友" name="add_friend" tool_tip="向這個居民提出交友邀請"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="開啟即時訊息會話"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="通話" name="call" tool_tip="與這位居民通話"/>
-				</layout_panel>
-				<layout_panel name="show_on_map_btn_lp">
-					<button label="地圖" name="show_on_map_btn" tool_tip="在地圖上顯示這個居民"/>
-				</layout_panel>
-				<layout_panel name="teleport_btn_lp">
-					<button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_profile.xml b/indra/newview/skins/default/xui/zh/panel_profile.xml
deleted file mode 100644
index 502449ac3ab..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_profile.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="檔案" name="panel_profile">
-	<string name="CaptionTextAcctInfo">
-		[ACCTTYPE]
-[PAYMENTINFO] [AGEVERIFICATION]
-	</string>
-	<string name="payment_update_link_url">
-		http://www.secondlife.com/account/billing.php?lang=en
-	</string>
-	<string name="partner_edit_link_url">
-		http://www.secondlife.com/account/partners.php?lang=en
-	</string>
-	<string name="my_account_link_url" value="http://secondlife.com/account"/>
-	<string name="no_partner_text" value="ç„¡"/>
-	<string name="no_group_text" value="ç„¡"/>
-	<string name="RegisterDateFormat">
-		[REG_DATE] ([AGE])
-	</string>
-	<string name="name_text_args">
-		[NAME]
-	</string>
-	<string name="display_name_text_args">
-		[DISPLAY_NAME]
-	</string>
-	<layout_stack name="layout">
-		<layout_panel name="profile_stack">
-			<scroll_container name="profile_scroll">
-				<panel name="profile_scroll_panel">
-					<panel name="second_life_image_panel">
-						<text name="title_sl_descr_text" value="[SECOND_LIFE]:"/>
-					</panel>
-					<panel name="first_life_image_panel">
-						<text name="title_rw_descr_text" value="真實世界:"/>
-					</panel>
-					<text name="title_member_text" value="成為居民自:"/>
-					<text name="title_acc_status_text" value="帳戶狀態:"/>
-					<text name="title_partner_text" value="配偶:"/>
-					<panel name="partner_data_panel">
-						<text initial_value="(檢索中)" name="partner_text"/>
-					</panel>
-					<text name="title_groups_text" value="群組:"/>
-				</panel>
-			</scroll_container>
-		</layout_panel>
-	</layout_stack>
-	<layout_stack name="layout_verb_buttons">
-		<layout_panel name="profile_buttons_panel">
-			<layout_stack name="bottom_bar_ls">
-				<layout_panel name="add_friend_btn_lp">
-					<button label="加為朋友" name="add_friend" tool_tip="發出交友邀請給這居民"/>
-				</layout_panel>
-				<layout_panel name="im_btn_lp">
-					<button label="IM" name="im" tool_tip="開啟即時訊息會話"/>
-				</layout_panel>
-				<layout_panel name="call_btn_lp">
-					<button label="通話" name="call" tool_tip="與這位居民通話"/>
-				</layout_panel>
-				<layout_panel name="chat_btn_lp">
-					<button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/>
-				</layout_panel>
-				<layout_panel name="overflow_btn_lp">
-					<menu_button label="▼" name="overflow_btn" tool_tip="支付金錢,或分享收納區給居民"/>
-				</layout_panel>
-			</layout_stack>
-		</layout_panel>
-	</layout_stack>
-</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_profile_view.xml b/indra/newview/skins/default/xui/zh/panel_profile_view.xml
deleted file mode 100644
index 2684287692f..00000000000
--- a/indra/newview/skins/default/xui/zh/panel_profile_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="panel_target_profile">
-	<string name="status_online">
-		上線
-	</string>
-	<string name="status_offline">
-		離線
-	</string>
-	<text name="display_name_label" value="顯示名稱:"/>
-	<text name="solo_username_label" value="使用者名稱:"/>
-	<text name="status" value="上線"/>
-	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
-	<button name="copy_to_clipboard" tool_tip="覆製到剪貼簿"/>
-	<text name="user_label" value="使用者名稱:"/>
-	<tab_container name="tabs">
-		<panel label="檔案" name="panel_profile"/>
-		<panel label="精選地點" name="panel_picks"/>
-		<panel label="NOTES &amp; PRIVACY" name="panel_notes"/>
-	</tab_container>
-</panel>
-- 
GitLab


From 18bc70e74fd7a3a4d16dc6c4cfd5e7e795e94bd0 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 9 Dec 2011 15:57:40 -0800
Subject: [PATCH 410/933] FIX VWR-27811

---
 .../default/xui/fr/floater_object_weights.xml    | 14 +++++++-------
 .../default/xui/fr/floater_preview_animation.xml |  4 ++--
 .../skins/default/xui/fr/floater_stats.xml       | 16 ++++++++--------
 .../skins/default/xui/fr/floater_tools.xml       |  2 +-
 .../skins/default/xui/fr/floater_toybox.xml      |  8 ++++----
 .../skins/default/xui/fr/menu_group_plus.xml     |  2 +-
 .../skins/default/xui/fr/menu_inventory.xml      |  2 +-
 .../xui/fr/menu_people_nearby_view_sort.xml      |  2 +-
 .../skins/default/xui/fr/menu_toolbars.xml       |  2 +-
 .../newview/skins/default/xui/fr/menu_viewer.xml |  2 +-
 .../skins/default/xui/fr/notifications.xml       |  4 ++--
 .../default/xui/fr/panel_preferences_move.xml    | 10 +++++-----
 .../default/xui/fr/panel_preferences_privacy.xml |  2 +-
 .../default/xui/fr/panel_prim_media_controls.xml |  8 ++++----
 .../skins/default/xui/fr/panel_status_bar.xml    |  8 ++++----
 15 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/indra/newview/skins/default/xui/fr/floater_object_weights.xml b/indra/newview/skins/default/xui/fr/floater_object_weights.xml
index f1b063a3da5..2667188308c 100644
--- a/indra/newview/skins/default/xui/fr/floater_object_weights.xml
+++ b/indra/newview/skins/default/xui/fr/floater_object_weights.xml
@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="object_weights" title="AVANCÉ">
 	<floater.string name="nothing_selected" value="--"/>
-	<text name="selected_text" value="SELECTIONNÉ"/>
+	<text name="selected_text" value="SÉLECTION"/>
 	<text name="objects" value="--"/>
 	<text name="objects_label" value="Objets"/>
 	<text name="prims" value="--"/>
 	<text name="prims_label" value="Prims"/>
-	<text name="weights_of_selected_text" value="POIDS DES OBJETS SELECTIONNÉS"/>
+	<text name="weights_of_selected_text" value="POIDS DE LA SÉLECTION"/>
 	<text name="download" value="--"/>
-	<text name="download_label" value="Télécharger"/>
+	<text name="download_label" value="Téléchargement"/>
 	<text name="physics" value="--"/>
-	<text name="physics_label" value="Propriétés physiques"/>
+	<text name="physics_label" value="Physique"/>
 	<text name="server" value="--"/>
 	<text name="server_label" value="Serveur"/>
 	<text name="display" value="--"/>
-	<text name="display_label" value="Afficher"/>
+	<text name="display_label" value="Affichage"/>
 	<text name="land_impacts_text" value="IMPACTS SUR LE TERRAIN"/>
 	<text name="selected" value="--"/>
 	<text name="selected_label" value="Sélection"/>
 	<text name="rezzed_on_land" value="--"/>
-	<text name="rezzed_on_land_label" value="Rezzé sur le terrain"/>
+	<text name="rezzed_on_land_label" value="Rezzés sur le terrain"/>
 	<text name="remaining_capacity" value="--"/>
 	<text name="remaining_capacity_label" value="Capacité restante"/>
 	<text name="total_capacity" value="--"/>
 	<text name="total_capacity_label" value="Capacité totale"/>
-	<text name="help_SLURL" value="[secondlife:///app/help/object_weights What is all this?...]"/>
+	<text name="help_SLURL" value="[secondlife:///app/help/object_weights De quoi s&apos;agit-il ?...]"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_preview_animation.xml b/indra/newview/skins/default/xui/fr/floater_preview_animation.xml
index a9407abfde3..fdd2ac8beb6 100644
--- a/indra/newview/skins/default/xui/fr/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/fr/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		Description :
 	</text>
-	<button label="Jouer dans Second Life" label_selected="Stop" name="Anim play btn" tool_tip="Lire cette animation de façon à ce que les autres puissent la voir" width="131"/>
-	<button label="Jouer localement" label_selected="Stop" left="160" name="Anim audition btn" tool_tip="Lire cette animation de façon à ce que vous soyez la seule personne à pouvoir la voir" width="120"/>
+	<button label="Exécuter dans Second Life" label_selected="Stop" name="Anim play btn" tool_tip="Lire cette animation de façon à ce que les autres puissent la voir" width="131"/>
+	<button label="Exécuter localement" label_selected="Stop" left="160" name="Anim audition btn" tool_tip="Lire cette animation de façon à ce que vous soyez la seule personne à pouvoir la voir" width="120"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_stats.xml b/indra/newview/skins/default/xui/fr/floater_stats.xml
index a74a338bd71..2ce2e6dcd55 100644
--- a/indra/newview/skins/default/xui/fr/floater_stats.xml
+++ b/indra/newview/skins/default/xui/fr/floater_stats.xml
@@ -38,7 +38,7 @@
 			<stat_view label="Simulateur" name="sim">
 				<stat_bar label="Dilatation temporelle" name="simtimedilation"/>
 				<stat_bar label="FPS sim" name="simfps"/>
-				<stat_bar label="Propriétés physiques FPS" name="simphysicsfps"/>
+				<stat_bar label="FPS physique" name="simphysicsfps"/>
 				<stat_view label="Détails des propriétés physiques" name="physicsdetail">
 					<stat_bar label="Objets fixés" name="physicspinnedtasks"/>
 					<stat_bar label="Objets LOD faibles" name="physicslodtasks"/>
@@ -53,17 +53,17 @@
 				<stat_bar label="Événements de scripts" name="simscripteps"/>
 				<stat_bar label="Paquets en entrée" name="siminpps"/>
 				<stat_bar label="Paquets en sortie" name="simoutpps"/>
-				<stat_bar label="En attente des téléchargements" name="simpendingdownloads"/>
-				<stat_bar label="En attente des chargements" name="simpendinguploads"/>
+				<stat_bar label="Téléchargements en attente" name="simpendingdownloads"/>
+				<stat_bar label="Chargements en attente" name="simpendinguploads"/>
 				<stat_bar label="Total Unacked Bytes" name="simtotalunackedbytes"/>
 				<stat_view label="Temps (ms)" name="simperf">
-					<stat_bar label="Durée du cadre totale" name="simframemsec"/>
+					<stat_bar label="Durée totale de l'image" name="simframemsec"/>
 					<stat_bar label="Durée nette" name="simnetmsec"/>
-					<stat_bar label="Durée physique" name="simsimphysicsmsec"/>
-					<stat_bar label="Durée de la simulation" name="simsimothermsec"/>
-					<stat_bar label="Durée de l&apos;avatar" name="simagentmsec"/>
+					<stat_bar label="Durée sim (physique)" name="simsimphysicsmsec"/>
+					<stat_bar label="Durée sim (autre)" name="simsimothermsec"/>
+					<stat_bar label="Durée des avatars" name="simagentmsec"/>
 					<stat_bar label="Durée des images" name="simimagesmsec"/>
-					<stat_bar label="Durée du script" name="simscriptmsec"/>
+					<stat_bar label="Durée des scripts" name="simscriptmsec"/>
 					<stat_bar label="Temps d&apos;inactivité" name="simsparemsec"/>
 					<stat_view label="Détails Temps (ms)" name="timedetails">
 						<stat_bar label="Etape propr. physiques" name="simsimphysicsstepmsec"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml
index 1ecf47f2e5e..af5678ff0e7 100644
--- a/indra/newview/skins/default/xui/fr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/fr/floater_tools.xml
@@ -106,7 +106,7 @@
 		Aucune sélection effectuée.
 	</text>
 	<text name="remaining_capacity">
-		[CAPACITY_STRING] [secondlife:///app/openfloater/object_weights More info]
+		[CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Plus d'infos]
 	</text>
 	<tab_container name="Object Info Tabs">
 		<panel label="Général" name="General">
diff --git a/indra/newview/skins/default/xui/fr/floater_toybox.xml b/indra/newview/skins/default/xui/fr/floater_toybox.xml
index e6fa212c650..33aea6bb2d8 100644
--- a/indra/newview/skins/default/xui/fr/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/fr/floater_toybox.xml
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="PERSONNALISER LA BARRE D&apos;OUTILS">
+<floater name="Toybox" title="PERSONNALISER LES BARRES D&apos;OUTILS">
 	<text name="toybox label 1">
-		Ajouter ou supprimer des boutons en les faisant glisser vers les barres d&apos;outils ou à partir de ces dernières.
+		Ajouter ou supprimer des boutons : les faire glisser vers ou depuis les barres d&apos;outils.
 	</text>
 	<text name="toybox label 2">
-		Les boutons s&apos;afficheront comme indiqué ou comme des icônes, en fonction des paramètres de chaque barre d&apos;outils.
+		Ils s&apos;afficheront comme indiqué ou comme des icônes, selon les paramètres de barre d&apos;outils.
 	</text>
-	<button label="Restaurer les choix par défaut" label_selected="Restaurer les choix par défaut" name="btn_restore_defaults"/>
+	<button label="Valeurs par défaut" label_selected="Valeurs par défaut" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/menu_group_plus.xml b/indra/newview/skins/default/xui/fr/menu_group_plus.xml
index 0db5afedc79..ad76f11d797 100644
--- a/indra/newview/skins/default/xui/fr/menu_group_plus.xml
+++ b/indra/newview/skins/default/xui/fr/menu_group_plus.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu name="menu_group_plus">
-	<menu_item_call label="Rejoindre des groupes..." name="item_join"/>
+	<menu_item_call label="Rejoindre un groupe..." name="item_join"/>
 	<menu_item_call label="Nouveau groupe..." name="item_new"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml
index 53df8d11da0..403111c4ded 100644
--- a/indra/newview/skins/default/xui/fr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml
@@ -71,7 +71,7 @@
 	<menu_item_call label="Jouer dans Second Life" name="Animation Play"/>
 	<menu_item_call label="Jouer localement" name="Animation Audition"/>
 	<menu_item_call label="Envoyer un message instantané" name="Send Instant Message"/>
-	<menu_item_call label="Offrir de téléporter..." name="Offer Teleport..."/>
+	<menu_item_call label="Proposer une téléportation..." name="Offer Teleport..."/>
 	<menu_item_call label="Démarrer le chat conférence" name="Conference Chat"/>
 	<menu_item_call label="Activer" name="Activate"/>
 	<menu_item_call label="Désactiver" name="Deactivate"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml
index 0aad174fbdb..8bb466b8d6e 100644
--- a/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml
+++ b/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml
@@ -5,5 +5,5 @@
 	<menu_item_check label="Trier par distance" name="sort_distance"/>
 	<menu_item_check label="Afficher les icônes des résidents" name="view_icons"/>
 	<menu_item_check label="Afficher la carte" name="view_map"/>
-	<menu_item_call label="Afficher les résidents et les objets interdits" name="show_blocked_list"/>
+	<menu_item_call label="Afficher les résidents et les objets ignorés" name="show_blocked_list"/>
 </toggleable_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_toolbars.xml b/indra/newview/skins/default/xui/fr/menu_toolbars.xml
index bbfbe4b9ed4..d3e9f927704 100644
--- a/indra/newview/skins/default/xui/fr/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/fr/menu_toolbars.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
 	<menu_item_call label="Choisir les boutons..." name="Chose Buttons"/>
-	<menu_item_check label="Icônes et étiquettes" name="icons_with_text"/>
+	<menu_item_check label="Icônes et libellés" name="icons_with_text"/>
 	<menu_item_check label="Icônes uniquement" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 78f973a61f7..e2cb1f999d4 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -24,7 +24,7 @@
 		<menu_item_call label="Acheter des L$" name="Buy and Sell L$"/>
 		<menu_item_call label="Préférences..." name="Preferences"/>
 		<menu_item_call label="Barres d&apos;outils..." name="Toolbars"/>
-		<menu_item_call label="Cacher tous les contrôles" name="Hide UI"/>
+		<menu_item_call label="Masquer tous les contrôles" name="Hide UI"/>
 		<menu_item_call label="Quitter [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Communiquer" name="Communicate">
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index 18b9063c008..d8d79d8ddef 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -3046,8 +3046,8 @@ Cliquez sur un point dans le monde et faites glisser votre souris pour faire tou
 		<usetemplate name="okcancelbuttons" notext="Ne pas quitter" yestext="Quitter"/>
 	</notification>
 	<notification label="" name="ConfirmHideUI">
-		Cette action cachera tous les objets des menus et boutons. Pour les récupérer, cliquez de nouveau sur [SHORTCUT].
-		<usetemplate ignoretext="Confimer avant de cacher l&apos;interface" name="okcancelignore" notext="Annuler" yestext="OK"/>
+		Cette action masquera tous les boutons et articles de menu. Pour les récupérer, cliquez de nouveau sur [SHORTCUT].
+		<usetemplate ignoretext="Confirmer avant de masquer l&apos;interface" name="okcancelignore" notext="Annuler" yestext="OK"/>
 	</notification>
 	<global name="UnsupportedGLRequirements">
 		Vous semblez ne pas avoir le matériel requis pour utiliser [APP_NAME]. [APP_NAME] requiert une carte graphique OpenGL avec une prise en charge du multitexturing. Si vous avez une telle carte, assurez-vous que vous avez aussi les pilotes les plus récents pour la carte, ainsi que les service packs et les patchs pour votre système d&apos;exploitation.
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_move.xml b/indra/newview/skins/default/xui/fr/panel_preferences_move.xml
index efb520bfd38..94d7322b228 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_move.xml
@@ -24,16 +24,16 @@
 		Clic simple sur le terrain :
 	</text>
 	<combo_box name="single_click_action_combo">
-		<combo_box.item label="Pas d&apos;action" name="0"/>
-		<combo_box.item label="Bouger vers le point cliqué" name="1"/>
+		<combo_box.item label="Aucune action" name="0"/>
+		<combo_box.item label="Déplacement vers le clic" name="1"/>
 	</combo_box>
 	<text name="double_click_action_lbl">
 		Double-clic sur le terrain :
 	</text>
 	<combo_box name="double_click_action_combo">
-		<combo_box.item label="Pas d&apos;action" name="0"/>
-		<combo_box.item label="Bouger vers le point cliqué" name="1"/>
-		<combo_box.item label="Téléporter vers le point cliqué" name="2"/>
+		<combo_box.item label="Aucune action" name="0"/>
+		<combo_box.item label="Déplacement vers le double clic" name="1"/>
+		<combo_box.item label="Téléportation vers le double clic" name="2"/>
 	</combo_box>
 	<button label="Autres accessoires" name="joystick_setup_button"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
index b122db95027..cf1a374da68 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
@@ -20,7 +20,7 @@
 	<check_box label="Inclure la date et l&apos;heure pour chaque ligne du journal de chat" name="show_timestamps_check_im"/>
 	<check_box label="Inclure la date dans le nom du fichier journal" name="logfile_name_datestamp"/>
 	<text name="log_path_desc">
-		Emplacement des journaux :
+		Emplacement journaux :
 	</text>
 	<line_editor left="308" name="log_path_string" right="-20"/>
 	<button label="Parcourir" label_selected="Parcourir" name="log_path_button" width="150"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml
index f16fcebd023..ad744b77608 100644
--- a/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml
@@ -13,10 +13,10 @@
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
-			<button name="back_btn" tool_tip="Naviguer en arrière"/>
+			<button name="back_btn" tool_tip="Précédente"/>
 		</layout_panel>
 		<layout_panel name="fwd">
-			<button name="fwd_btn" tool_tip="Naviguer vers l&apos;avant"/>
+			<button name="fwd_btn" tool_tip="Suivante"/>
 		</layout_panel>
 		<layout_panel name="home">
 			<button name="home_btn" tool_tip="Page d&apos;accueil"/>
@@ -34,7 +34,7 @@
 			<button name="play_btn" tool_tip="Lire le média"/>
 		</layout_panel>
 		<layout_panel name="pause">
-			<button name="pause_btn" tool_tip="Pauser le média"/>
+			<button name="pause_btn" tool_tip="Mettre le média sur pause"/>
 		</layout_panel>
 		<layout_panel name="media_address">
 			<line_editor name="media_address_url" tool_tip="URL du média"/>
@@ -48,7 +48,7 @@
 			</layout_stack>
 		</layout_panel>
 		<layout_panel name="media_play_position">
-			<slider_bar initial_value="0.5" name="media_play_slider" tool_tip="Progrès de la lecture du film"/>
+			<slider_bar initial_value="0.5" name="media_play_slider" tool_tip="Progression de la lecture du film"/>
 		</layout_panel>
 		<layout_panel name="skip_back">
 			<button name="skip_back_btn" tool_tip="Reculer"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
index e836c24a949..ac61eb7e52e 100644
--- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
@@ -17,12 +17,12 @@
 	</panel.string>
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
-		<button label="Achat de L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$"/>
-		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life"/>
+		<button label="Acheter L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$."/>
+		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life."/>
 	</panel>
 	<text name="TimeText" tool_tip="Heure actuelle (Pacifique)">
 		00h00 PST
 	</text>
-	<button name="media_toggle_btn" tool_tip="Arrêter tous les médias (musique, vidéo, pages web)"/>
-	<button name="volume_btn" tool_tip="Contrôle du volume global"/>
+	<button name="media_toggle_btn" tool_tip="Arrêter tous les médias (musique, vidéo, pages web)."/>
+	<button name="volume_btn" tool_tip="Régler le volume global."/>
 </panel>
-- 
GitLab


From cc92db1f353de96f6d27863b92671b2d847536f4 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 9 Dec 2011 16:19:03 -0800
Subject: [PATCH 411/933] Moved outbox import confirmations to window shades on
 the merchant outbox floater, rather than modal dialogs.

---
 indra/llui/llwindowshade.cpp                  |  5 ++
 indra/llui/llwindowshade.h                    |  2 +
 indra/newview/llfloateroutbox.cpp             | 61 ++++++++++++++++++-
 indra/newview/llfloateroutbox.h               |  8 +++
 indra/newview/llnotificationhandler.h         | 10 ++-
 indra/newview/llnotificationmanager.cpp       |  2 +
 .../skins/default/textures/textures.xml       | 19 +-----
 .../skins/default/xui/en/notifications.xml    | 35 +++++++----
 8 files changed, 112 insertions(+), 30 deletions(-)

diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index cf762022155..b21c088a1fa 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -297,6 +297,11 @@ void LLWindowShade::hide()
 	setMouseOpaque(false);
 }
 
+bool LLWindowShade::isShown() const
+{
+	return getChildRef<LLLayoutPanel>("notification_area").getVisible();
+}
+
 void LLWindowShade::onCloseNotification()
 {
 	LLNotifications::instance().cancel(mNotification);
diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h
index 09ffc2cd54b..cb8f223a84e 100644
--- a/indra/llui/llwindowshade.h
+++ b/indra/llui/llwindowshade.h
@@ -48,6 +48,8 @@ class LLWindowShade : public LLUICtrl
 	void show();
 	/*virtual*/ void draw();
 	void hide();
+	
+	bool isShown() const;
 
 private:
 	friend class LLUICtrlFactory;
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 619be87187c..8d64214e8c6 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -33,11 +33,32 @@
 #include "llinventoryobserver.h"
 #include "llinventorypanel.h"
 #include "llmarketplacefunctions.h"
+#include "llnotificationhandler.h"
 #include "llnotificationsutil.h"
 #include "lltextbox.h"
 #include "lltransientfloatermgr.h"
 #include "lltrans.h"
 #include "llviewernetwork.h"
+#include "llwindowshade.h"
+
+
+///----------------------------------------------------------------------------
+/// LLOutboxNotification class
+///----------------------------------------------------------------------------
+
+bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& notify)
+{
+	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+
+	if (notification)
+	{
+		LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance<LLFloaterOutbox>("outbox");
+
+		outbox_floater->showNotification(notification);
+	}
+
+	return false;
+}
 
 
 ///----------------------------------------------------------------------------
@@ -89,6 +110,7 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
 	, mInventoryText(NULL)
 	, mInventoryTitle(NULL)
 	, mImportButton(NULL)
+	, mWindowShade(NULL)
 {
 }
 
@@ -121,6 +143,16 @@ BOOL LLFloaterOutbox::postBuild()
 	return TRUE;
 }
 
+void LLFloaterOutbox::onClose(bool app_quitting)
+{
+	if (mWindowShade)
+	{
+		delete mWindowShade;
+
+		mWindowShade = NULL;
+	}
+}
+
 void LLFloaterOutbox::onOpen(const LLSD& key)
 {
 	//
@@ -275,7 +307,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 {
 	// Pass drag and drop to this floater to the outbox inventory control
 	
-	if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress())
+	if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || 
+		(mWindowShade && mWindowShade->isShown()))
 	{
 		return FALSE;
 	}
@@ -369,3 +402,29 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 	}
 }
 
+void LLFloaterOutbox::showNotification(LLNotificationPtr notify)
+{
+	if (mWindowShade)
+	{
+		delete mWindowShade;
+	}
+	
+	LLRect floater_rect = getLocalRect();
+	floater_rect.mTop -= getHeaderHeight();
+	floater_rect.stretch(-5, 0);
+	
+	LLWindowShade::Params params;
+	params.name = "notification_shade";
+	params.rect = floater_rect;
+	params.follows.flags = FOLLOWS_ALL;
+	params.notification = notify;
+	params.modal = true;
+	params.can_close = false;
+	params.text_color = LLColor4::white;
+	
+	mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
+	
+	addChild(mWindowShade);
+	mWindowShade->show();
+}
+
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 3d2ce861449..80234346757 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -30,6 +30,7 @@
 
 #include "llfloater.h"
 #include "llfoldertype.h"
+#include "llnotificationptr.h"
 
 
 class LLButton;
@@ -37,8 +38,10 @@ class LLInventoryCategoriesObserver;
 class LLInventoryCategoryAddedObserver;
 class LLInventoryPanel;
 class LLLoadingIndicator;
+class LLNotification;
 class LLTextBox;
 class LLView;
+class LLWindowShade;
 
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -55,12 +58,15 @@ class LLFloaterOutbox : public LLFloater
 
 	// virtuals
 	BOOL postBuild();
+	void onClose(bool app_quitting);
 	void onOpen(const LLSD& key);
 	BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 						   EDragAndDropType cargo_type,
 						   void* cargo_data,
 						   EAcceptance* accept,
 						   std::string& tooltip_msg);
+	
+	void showNotification(LLNotificationPtr notify);
 
 protected:
 	void importReportResults(U32 status, const LLSD& content);
@@ -86,6 +92,8 @@ class LLFloaterOutbox : public LLFloater
 	LLTextBox *				mInventoryTitle;
 	
 	LLButton *		mImportButton;
+	
+	LLWindowShade *	mWindowShade;
 };
 
 #endif // LL_LLFLOATEROUTBOX_H
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 28a69f23736..23dbb6b047c 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -283,9 +283,17 @@ class LLBrowserNotification : public LLSingleton<LLBrowserNotification>
 {
 public:
 	virtual bool processNotification(const LLSD& notify);
+};
 	
+/**
+ * Handler for outbox notifications
+ */
+class LLOutboxNotification : public LLSingleton<LLOutboxNotification>
+{
+public:
+	virtual bool processNotification(const LLSD& notify);
 };
-
+	
 class LLHandlerUtil
 {
 public:
diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index 69882271282..6105eff8ea6 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -62,6 +62,7 @@ void LLNotificationManager::init()
 	LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "offer"));
 	LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint"));
 	LLNotificationChannel::buildChannel("Browser", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "browser"));
+	LLNotificationChannel::buildChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"));
   
 	LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
 	LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
@@ -72,6 +73,7 @@ void LLNotificationManager::init()
 	LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
 	LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
 	LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
+	LLNotifications::instance().getChannel("Outbox")->connectChanged(boost::bind(&LLOutboxNotification::processNotification, LLOutboxNotification::getInstance(), _1));
 
 	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["notifytip"] =  boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 5da12768812..e4a8622a4b4 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -387,22 +387,9 @@ with the same filename but different name
   <texture name="OptionsMenu_Off" file_name="icons/OptionsMenu_Off.png" preload="false" />
   <texture name="OptionsMenu_Press" file_name="icons/OptionsMenu_Press.png" preload="false" />
 
-  <texture name="OutboxPush_Disabled" file_name="icons/OutboxPush_Disabled.png" preload="true" />
-  <texture name="OutboxPush_Off" file_name="icons/OutboxPush_Off.png" preload="true" />
-  <texture name="OutboxPush_On" file_name="icons/OutboxPush_On.png" preload="true" />
-  <texture name="OutboxPush_On_Over" file_name="icons/OutboxPush_On_Over.png" preload="true" />
-  <texture name="OutboxPush_Over" file_name="icons/OutboxPush_Over.png" preload="true" />
-  <texture name="OutboxPush_Press" file_name="icons/OutboxPush_Press.png" preload="true" />
-  <texture name="OutboxPush_Progress_1" file_name="icons/OutboxPush_Progress_1.png" preload="true" />
-  <texture name="OutboxPush_Progress_2" file_name="icons/OutboxPush_Progress_2.png" preload="true" />
-  <texture name="OutboxPush_Progress_3" file_name="icons/OutboxPush_Progress_3.png" preload="true" />
-  <texture name="OutboxPush_Progress_4" file_name="icons/OutboxPush_Progress_4.png" preload="true" />
-  <texture name="OutboxPush_Progress_5" file_name="icons/OutboxPush_Progress_5.png" preload="true" />
-  <texture name="OutboxPush_Progress_6" file_name="icons/OutboxPush_Progress_6.png" preload="true" />
-  <texture name="OutboxPush_Selected" file_name="icons/OutboxPush_Selected.png" preload="true" />
-  <texture name="OutboxPush_Selected_Disabled" file_name="icons/OutboxPush_Selected_Disabled.png" preload="true" />
-  <texture name="OutboxPush_Selected_Over" file_name="icons/OutboxPush_Selected_Over.png" preload="true" />
-  <texture name="OutboxPush_Selected_Press" file_name="icons/OutboxPush_Selected_Press.png" preload="true" />
+  <texture name="OutboxStatus_Success" file_name="green_checkmark.png" preload="false" />
+  <texture name="OutboxStatus_Warning" file_name="icons/pop_up_caution.png" preload="false" />
+  <texture name="OutboxStatus_Error" file_name="red_x.png" preload="false" />
 
   <texture name="PanOrbit_Off" file_name="bottomtray/PanOrbit_Off.png" preload="false" />
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 8d0d76b58ef..b174d514215 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -212,33 +212,44 @@ Save changes to current clothing/body part?
     </notification>
 
   <notification
-   icon="alertmodal.tga"
+   icon="OutboxStatus_Success"
    name="OutboxImportComplete"
-   type="alertmodal">
-Marketplace import complete.
+   type="outbox">
+Success
+
+All folders were successfully sent to the Marketplace.
+
         <usetemplate
          name="okbutton"
-         yestext="Hooray!"/>
+         yestext="OK"/>
   </notification>
 
   <notification
-   icon="alertmodal.tga"
+   icon="OutboxStatus_Warning"
    name="OutboxImportHadErrors"
-   type="alertmodal">
-Marketplace import completed with errors!  Please correct the problems in your outbox and retry.  Thanks.
+   type="outbox">
+Some folders did not transfer
+
+Errors occurred when some folders were sent to the Marketplace.  Those folders are still in your Merchant Outbox.  See the error log for more information.
+
         <usetemplate
          name="okbutton"
-         yestext="Boo!"/>
+         yestext="OK"/>
   </notification>
 
   <notification
-   icon="alertmodal.tga"
+   icon="OutboxStatus_Error"
    name="OutboxImportFailed"
-   type="alertmodal">
-Marketplace import failed with error [ERROR_CODE]!  Please try again later.  Thanks.
+   type="outbox">
+Transfer failed
+
+No folders were sent to the Marketplace because of a system or network error.  Try again later.
+
+Error [ERROR_CODE]
+
         <usetemplate
          name="okbutton"
-         yestext="Rats!"/>
+         yestext="OK"/>
   </notification>
 
     
-- 
GitLab


From 6114ce2d27a3c776a59d1f09ad05d9b2f100a35d Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Mon, 12 Dec 2011 13:32:23 +0200
Subject: [PATCH 412/933] EXP-1672 FIXED Added check for LLChicletBar instance
 existence not to create a new one when viewer exits. Could not reproduce the
 crash. This is a possible fix for EXP-1672. The message before the crash in
 all client logs was: "WARNING: LLSingleton<class LLChicletBar>::getInstance:
 Trying to access deleted singleton class LLChicletBar creating new instance"

---
 indra/newview/llchiclet.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index a0763749032..9626b936908 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -296,6 +296,13 @@ void LLIMWellChiclet::createMenu()
 
 void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
 {
+	// The singleton class LLChicletBar instance might be already deleted
+	// so don't create a new one.
+	if (!LLChicletBar::instanceExists())
+	{
+		return;
+	}
+
 	const LLUUID& session_id = session_data["session_id"];
 	const S32 counter = LLChicletBar::getInstance()->getTotalUnreadIMCount();
 	const bool im_not_visible = !LLFloaterReg::instanceVisible("im_container")
-- 
GitLab


From a03b3aaa60c4b9101d344eed70ddbbf14888ff48 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 12 Dec 2011 08:51:16 -0500
Subject: [PATCH 413/933] STORM-1731 Ad-hoc confererence block failing.
 Residents using it to start massive multi-sim conferences, used as a griefing
 tool.

---
 doc/contributions.txt      |  1 +
 indra/newview/llimview.cpp | 55 ++++++++++++++++++++++++++------------
 2 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..e68029b011f 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	STORM-1731
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ed4bb727cd7..daef307601b 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2403,15 +2403,6 @@ void LLIMMgr::addMessage(
 	bool link_name) // If this is true, then we insert the name and link it to a profile
 {
 	LLUUID other_participant_id = target_id;
-
-	// don't process muted IMs
-	if (LLMuteList::getInstance()->isMuted(
-			other_participant_id,
-			LLMute::flagTextChat) && !LLMuteList::getInstance()->isLinden(from))
-	{
-		return;
-	}
-
 	LLUUID new_session_id = session_id;
 	if (new_session_id.isNull())
 	{
@@ -2452,10 +2443,25 @@ void LLIMMgr::addMessage(
 			LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str());
 		}
 
+		// Logically it would make more sense to reject the session sooner, in another area of the
+		// code, but the session has to be established inside the server before it can be left.
+		if (LLMuteList::getInstance()->isMuted(other_participant_id) && !LLMuteList::getInstance()->isLinden(from))
+		{
+			llwarns << "Leaving IM session from initiating muted resident " << from << llendl;
+			if(!gIMMgr->leaveSession(new_session_id))
+			{
+				llwarns << "Session " << new_session_id << " does not exist." << llendl;
+			}
+			return;
+		}
+
 		make_ui_sound("UISndNewIncomingIMSession");
 	}
 
-	LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
+	if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat))
+	{
+		LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
+	}
 }
 
 void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args)
@@ -2661,12 +2667,6 @@ void LLIMMgr::inviteToSession(
 	const std::string& session_handle,
 	const std::string& session_uri)
 {
-	//ignore invites from muted residents
-	if (LLMuteList::getInstance()->isMuted(caller_id))
-	{
-		return;
-	}
-
 	std::string notify_box_type;
 	// voice invite question is different from default only for group call (EXT-7118)
 	std::string question_type = "VoiceInviteQuestionDefault";
@@ -2712,6 +2712,22 @@ void LLIMMgr::inviteToSession(
 	payload["notify_box_type"] = notify_box_type;
 	payload["question_type"] = question_type;
 	
+	if (voice_invite &&
+		"VoiceInviteQuestionDefault" == question_type &&
+		LLMuteList::getInstance()->isMuted(caller_id) &&
+		!LLMuteList::getInstance()->isLinden(caller_name))
+	{
+		llwarns << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
+		LLIncomingCallDialog::processCallResponse(1, payload);
+		return;
+	}
+
+	//ignore invites from muted residents
+	if (LLMuteList::getInstance()->isMuted(caller_id))
+	{
+		return;
+	}
+
 	LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id);
 	if (channelp && channelp->callStarted())
 	{
@@ -3234,7 +3250,7 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode
 			chat.mFromID = from_id;
 			chat.mFromName = name;
 
-			if (!is_linden && (is_busy || is_muted))
+			if (!is_linden && is_busy)
 			{
 				return;
 			}
@@ -3266,6 +3282,11 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode
 				ll_vector3_from_sd(message_params["position"]),
 				true);
 
+			if (LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat))
+			{
+				return;
+			}
+
 			//K now we want to accept the invitation
 			std::string url = gAgent.getRegion()->getCapability(
 				"ChatSessionRequest");
-- 
GitLab


From 22ef5853ffb768960003f1e0af3ff6d0027daeb3 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 12 Dec 2011 10:02:28 -0500
Subject: [PATCH 414/933] Added tag 3.2.5-start for changeset 8a44ff3d2104

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ef171d5d68e..539efb0ffc4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -231,3 +231,4 @@ a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-start
 3fe994349fae64fc40874bb59db387131eb35a41 DRTVWR-104_3.2.4-beta1
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
+8a44ff3d2104269ce76145c2772cf1bdff2a2abe 3.2.5-start
-- 
GitLab


From dbc91a7fac9513bdd879c5c2dc82208e08eaad2d Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 12 Dec 2011 10:03:06 -0500
Subject: [PATCH 415/933] increment viewer version to 3.2.6

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index deac3d1780b..ec378761c28 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 5;
+const S32 LL_VERSION_PATCH = 6;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From f2d2e7e489613769ca40cc838630b20c854942a5 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 12 Dec 2011 11:32:34 -0500
Subject: [PATCH 416/933] STORM-1731 Changes per RB comments: changed llwarns
 to llinfos, added check so you cannot mute a Linden

---
 indra/newview/llimview.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index daef307601b..f96e7f2cc32 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2450,7 +2450,7 @@ void LLIMMgr::addMessage(
 			llwarns << "Leaving IM session from initiating muted resident " << from << llendl;
 			if(!gIMMgr->leaveSession(new_session_id))
 			{
-				llwarns << "Session " << new_session_id << " does not exist." << llendl;
+				llinfos << "Session " << new_session_id << " does not exist." << llendl;
 			}
 			return;
 		}
@@ -2673,6 +2673,9 @@ void LLIMMgr::inviteToSession(
 
 	BOOL ad_hoc_invite = FALSE;
 	BOOL voice_invite = FALSE;
+	bool is_linden = LLMuteList::getInstance()->isLinden(caller_name);
+
+
 	if(type == IM_SESSION_P2P_INVITE)
 	{
 		//P2P is different...they only have voice invitations
@@ -2715,15 +2718,15 @@ void LLIMMgr::inviteToSession(
 	if (voice_invite &&
 		"VoiceInviteQuestionDefault" == question_type &&
 		LLMuteList::getInstance()->isMuted(caller_id) &&
-		!LLMuteList::getInstance()->isLinden(caller_name))
+		!is_linden)
 	{
-		llwarns << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
+		llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
 		LLIncomingCallDialog::processCallResponse(1, payload);
 		return;
 	}
 
 	//ignore invites from muted residents
-	if (LLMuteList::getInstance()->isMuted(caller_id))
+	if (LLMuteList::getInstance()->isMuted(caller_id) && !is_linden)
 	{
 		return;
 	}
-- 
GitLab


From 2c9db624fb6a463efbd8a208d6d7f3bae72c0211 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 12 Dec 2011 14:48:36 -0500
Subject: [PATCH 417/933] STORM-1731 Adjusted if muted logic slightly

---
 indra/newview/llimview.cpp | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index f96e7f2cc32..a856bd0bdc6 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2714,20 +2714,15 @@ void LLIMMgr::inviteToSession(
 	payload["session_uri"] = session_uri;
 	payload["notify_box_type"] = notify_box_type;
 	payload["question_type"] = question_type;
-	
-	if (voice_invite &&
-		"VoiceInviteQuestionDefault" == question_type &&
-		LLMuteList::getInstance()->isMuted(caller_id) &&
-		!is_linden)
-	{
-		llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
-		LLIncomingCallDialog::processCallResponse(1, payload);
-		return;
-	}
 
 	//ignore invites from muted residents
 	if (LLMuteList::getInstance()->isMuted(caller_id) && !is_linden)
 	{
+		if (voice_invite && "VoiceInviteQuestionDefault" == question_type)
+		{
+			llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
+			LLIncomingCallDialog::processCallResponse(1, payload);
+		}
 		return;
 	}
 
-- 
GitLab


From 40a74eb5b77493e66587a01b6655d405c75e3a59 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 12 Dec 2011 12:32:22 -0800
Subject: [PATCH 418/933] EXP-1711 FIX LLWindowShade doesn't stack multiple
 notifications

---
 indra/llui/lllayoutstack.h                 |   3 +-
 indra/llui/llpanel.h                       |   2 +
 indra/llui/llwindowshade.cpp               | 207 +++++++++++++--------
 indra/llui/llwindowshade.h                 |  10 +-
 indra/newview/llmediactrl.cpp              |  46 ++---
 indra/newview/llpanelprimmediacontrols.cpp |   3 +-
 6 files changed, 163 insertions(+), 108 deletions(-)

diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index ede6149a800..3b308a359d1 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -191,13 +191,12 @@ friend class LLUICtrlFactory;
 		return min_dim;
 	}
 
+	F32 getCollapseFactor();
 	void setOrientation(LLLayoutStack::ELayoutOrientation orientation) { mOrientation = orientation; }
 
 protected:
 	LLLayoutPanel(const Params& p);
 	
-	F32 getCollapseFactor();
-
 	bool	mExpandedMinDimSpecified;
 	S32		mExpandedMinDim;
 	
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index cd339382263..f6202010202 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -135,6 +135,8 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder
 	const LLColor4&	getBackgroundColor() const { return mBgOpaqueColor; }
 	void			setTransparentColor(const LLColor4& color) { mBgAlphaColor = color; }
 	const LLColor4& getTransparentColor() const { return mBgAlphaColor; }
+	void			setBackgroundImage(LLUIImage* image) { mBgOpaqueImage = image; }
+	void			setTransparentImage(LLUIImage* image) { mBgAlphaImage = image; }
 	LLPointer<LLUIImage> getBackgroundImage() const { return mBgOpaqueImage; }
 	LLPointer<LLUIImage> getTransparentImage() const { return mBgAlphaImage; }
 	LLColor4		getBackgroundImageOverlay() { return mBgOpaqueImageOverlay; }
diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index cf762022155..0b4cfe68a65 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -37,6 +37,8 @@
 const S32 MIN_NOTIFICATION_AREA_HEIGHT = 30;
 const S32 MAX_NOTIFICATION_AREA_HEIGHT = 100;
 
+static LLDefaultChildRegistry::Register<LLWindowShade> r("window_shade");
+
 LLWindowShade::Params::Params()
 :	bg_image("bg_image"),
 	modal("modal", false),
@@ -48,7 +50,6 @@ LLWindowShade::Params::Params()
 
 LLWindowShade::LLWindowShade(const LLWindowShade::Params& params)
 :	LLUICtrl(params),
-	mNotification(params.notification),
 	mModal(params.modal),
 	mFormHeight(0),
 	mTextColor(params.text_color)
@@ -72,7 +73,7 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 	addChild(stackp);
 
 	LLLayoutPanel::Params panel_p;
-	panel_p.rect = LLRect(0, 30, 800, 0);
+	panel_p.rect = LLRect(0, MIN_NOTIFICATION_AREA_HEIGHT, 800, 0);
 	panel_p.name = "notification_area";
 	panel_p.visible = false;
 	panel_p.user_resize = false;
@@ -107,11 +108,11 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 
 	LLIconCtrl::Params icon_p;
 	icon_p.name = "notification_icon";
-	icon_p.rect = LLRect(5, 23, 21, 8);
+	icon_p.rect = LLRect(5, 25, 21, 10);
 	panel->addChild(LLUICtrlFactory::create<LLIconCtrl>(icon_p));
 
 	LLTextBox::Params text_p;
-	text_p.rect = LLRect(31, 20, panel->getRect().getWidth() - 5, 0);
+	text_p.rect = LLRect(31, 23, panel->getRect().getWidth() - 5, 3);
 	text_p.follows.flags = FOLLOWS_ALL;
 	text_p.text_color = mTextColor;
 	text_p.font = LLFontGL::getFontSansSerifSmall();
@@ -125,41 +126,132 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 	panel_p.auto_resize = false;
 	panel_p.user_resize = false;
 	panel_p.name="form_elements";
-	panel_p.rect = LLRect(0, 30, 130, 0);
+	panel_p.rect = LLRect(0, MIN_NOTIFICATION_AREA_HEIGHT, 130, 0);
 	LLLayoutPanel* form_elements_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
 	stackp->addChild(form_elements_panel);
 
-	if (params.can_close)
+	panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
+	panel_p.auto_resize = false;
+	panel_p.user_resize = false;
+	panel_p.rect = LLRect(0, MIN_NOTIFICATION_AREA_HEIGHT, 25, 0);
+	panel_p.name = "close_panel";
+	LLLayoutPanel* close_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
+	stackp->addChild(close_panel);
+
+	LLButton::Params button_p;
+	button_p.name = "close_notification";
+	button_p.rect = LLRect(5, 23, 21, 7);
+	button_p.image_color.control="DkGray_66";
+	button_p.image_unselected.name="Icon_Close_Foreground";
+	button_p.image_selected.name="Icon_Close_Press";
+	button_p.click_callback.function = boost::bind(&LLWindowShade::onCloseNotification, this);
+
+	close_panel->addChild(LLUICtrlFactory::create<LLButton>(button_p));
+	
+	close_panel->setVisible(params.can_close);
+}
+
+void LLWindowShade::draw()
+{
+	LLRect message_rect = getChild<LLTextBox>("notification_text")->getTextBoundingRect();
+
+	LLLayoutPanel* notification_area = getChild<LLLayoutPanel>("notification_area");
+
+	notification_area->reshape(notification_area->getRect().getWidth(), 
+		llclamp(message_rect.getHeight() + 15, 
+				llmin(mFormHeight, MAX_NOTIFICATION_AREA_HEIGHT),
+				MAX_NOTIFICATION_AREA_HEIGHT));
+
+	LLUICtrl::draw();
+
+	while(!mNotifications.empty() && !mNotifications.back()->isActive())
+	{
+		mNotifications.pop_back();
+		// go ahead and hide 
+		hide();
+	}
+
+	if (mNotifications.empty())
+	{
+		hide();
+	}
+	else if (notification_area->getCollapseFactor() < 0.01f)
+	{
+		displayLatestNotification();
+	}
+
+	if (!notification_area->getVisible() && (notification_area->getCollapseFactor() < 0.001f))
+	{
+		getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(false);
+		setMouseOpaque(false);
+	}
+}
+
+void LLWindowShade::hide()
+{
+	getChildRef<LLLayoutPanel>("notification_area").setVisible(false);
+}
+
+void LLWindowShade::onCloseNotification()
+{
+	if (!mNotifications.empty())
+		LLNotifications::instance().cancel(mNotifications.back());
+}
+
+void LLWindowShade::onClickIgnore(LLUICtrl* ctrl)
+{
+	LLNotificationPtr notify = getCurrentNotification();
+	if (!notify) return;
+
+	bool check = ctrl->getValue().asBoolean();
+	if (notify->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN)
 	{
-		panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
-		panel_p.auto_resize = false;
-		panel_p.user_resize = false;
-		panel_p.rect = LLRect(0, 30, 25, 0);
-		LLLayoutPanel* close_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
-		stackp->addChild(close_panel);
-
-		LLButton::Params button_p;
-		button_p.name = "close_notification";
-		button_p.rect = LLRect(5, 23, 21, 7);
-		button_p.image_color.control="DkGray_66";
-		button_p.image_unselected.name="Icon_Close_Foreground";
-		button_p.image_selected.name="Icon_Close_Press";
-		button_p.click_callback.function = boost::bind(&LLWindowShade::onCloseNotification, this);
-
-		close_panel->addChild(LLUICtrlFactory::create<LLButton>(button_p));
+		// question was "show again" so invert value to get "ignore"
+		check = !check;
 	}
+	notify->setIgnored(check);
+}
+
+void LLWindowShade::onClickNotificationButton(const std::string& name)
+{
+	LLNotificationPtr notify = getCurrentNotification();
+	if (!notify) return;
 
-	LLSD payload = mNotification->getPayload();
+	mNotificationResponse[name] = true;
 
-	LLNotificationFormPtr formp = mNotification->getForm();
+	notify->respond(mNotificationResponse);
+}
+
+void LLWindowShade::onEnterNotificationText(LLUICtrl* ctrl, const std::string& name)
+{
+	mNotificationResponse[name] = ctrl->getValue().asString();
+}
+
+void LLWindowShade::show(LLNotificationPtr notification)
+{
+	mNotifications.push_back(notification);
+
+	displayLatestNotification();
+}
+
+void LLWindowShade::displayLatestNotification()
+{
+	if (mNotifications.empty()) return;
+
+	LLNotificationPtr notification = mNotifications.back();
+
+	LLSD payload = notification->getPayload();
+
+	LLNotificationFormPtr formp = notification->getForm();
 	LLLayoutPanel& notification_area = getChildRef<LLLayoutPanel>("notification_area");
-	notification_area.getChild<LLUICtrl>("notification_icon")->setValue(mNotification->getIcon());
-	notification_area.getChild<LLUICtrl>("notification_text")->setValue(mNotification->getMessage());
-	notification_area.getChild<LLUICtrl>("notification_text")->setToolTip(mNotification->getMessage());
+	notification_area.getChild<LLUICtrl>("notification_icon")->setValue(notification->getIcon());
+	notification_area.getChild<LLUICtrl>("notification_text")->setValue(notification->getMessage());
+	notification_area.getChild<LLUICtrl>("notification_text")->setToolTip(notification->getMessage());
 
 	LLNotificationForm::EIgnoreType ignore_type = formp->getIgnoreType(); 
 	LLLayoutPanel& form_elements = notification_area.getChildRef<LLLayoutPanel>("form_elements");
 	form_elements.deleteAllChildren();
+	form_elements.reshape(form_elements.getRect().getWidth(), MIN_NOTIFICATION_AREA_HEIGHT);
 
 	const S32 FORM_PADDING_HORIZONTAL = 10;
 	const S32 FORM_PADDING_VERTICAL = 3;
@@ -229,7 +321,7 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 			label_p.v_pad = 5;
 			LLTextBox* textbox = LLUICtrlFactory::create<LLTextBox>(label_p);
 			textbox->reshapeToFitText();
-			textbox->reshape(textbox->getRect().getWidth(), form_elements.getRect().getHeight() - 2 * FORM_PADDING_VERTICAL); 
+			textbox->reshape(textbox->getRect().getWidth(), MIN_NOTIFICATION_AREA_HEIGHT - 2 * FORM_PADDING_VERTICAL); 
 			form_elements.addChild(textbox);
 			cur_x = textbox->getRect().mRight + FORM_PADDING_HORIZONTAL;
 
@@ -249,7 +341,7 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 		}
 	}
 
-	mFormHeight = form_elements.getRect().getHeight() - (cur_y - FORM_PADDING_VERTICAL) + WIDGET_HEIGHT;
+	mFormHeight = form_elements.getRect().getHeight() - (cur_y - WIDGET_HEIGHT - FORM_PADDING_VERTICAL);
 	form_elements.reshape(form_width, mFormHeight);
 	form_elements.setMinDim(form_width);
 
@@ -261,68 +353,33 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 	{
 		(*it)->translate(0, delta_y);
 	}
-}
 
-void LLWindowShade::show()
-{
 	getChildRef<LLLayoutPanel>("notification_area").setVisible(true);
 	getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(mModal);
 
 	setMouseOpaque(mModal);
 }
 
-void LLWindowShade::draw()
+void LLWindowShade::setBackgroundImage(LLUIImage* image)
 {
-	LLRect message_rect = getChild<LLTextBox>("notification_text")->getTextBoundingRect();
-
-	LLLayoutPanel* notification_area = getChild<LLLayoutPanel>("notification_area");
-
-	notification_area->reshape(notification_area->getRect().getWidth(), 
-		llclamp(message_rect.getHeight() + 10, 
-				llmin(mFormHeight, MAX_NOTIFICATION_AREA_HEIGHT),
-				MAX_NOTIFICATION_AREA_HEIGHT));
-
-	LLUICtrl::draw();
-	if (mNotification && !mNotification->isActive())
-	{
-		hide();
-	}
+	getChild<LLLayoutPanel>("notification_area")->setTransparentImage(image);
 }
 
-void LLWindowShade::hide()
+void LLWindowShade::setTextColor(LLColor4 color)
 {
-	getChildRef<LLLayoutPanel>("notification_area").setVisible(false);
-	getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(false);
-
-	setMouseOpaque(false);
+	getChild<LLTextBox>("notification_text")->setColor(color);
 }
 
-void LLWindowShade::onCloseNotification()
+void LLWindowShade::setCanClose(bool can_close)
 {
-	LLNotifications::instance().cancel(mNotification);
+	getChildView("close_panel")->setVisible(can_close);
 }
 
-void LLWindowShade::onClickIgnore(LLUICtrl* ctrl)
+LLNotificationPtr LLWindowShade::getCurrentNotification()
 {
-	bool check = ctrl->getValue().asBoolean();
-	if (mNotification && mNotification->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN)
+	if (mNotifications.empty())
 	{
-		// question was "show again" so invert value to get "ignore"
-		check = !check;
+		return LLNotificationPtr();
 	}
-	mNotification->setIgnored(check);
-}
-
-void LLWindowShade::onClickNotificationButton(const std::string& name)
-{
-	if (!mNotification) return;
-
-	mNotificationResponse[name] = true;
-
-	mNotification->respond(mNotificationResponse);
-}
-
-void LLWindowShade::onEnterNotificationText(LLUICtrl* ctrl, const std::string& name)
-{
-	mNotificationResponse[name] = ctrl->getValue().asString();
-}
+	return mNotifications.back();
+}
\ No newline at end of file
diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h
index 09ffc2cd54b..1dcab4e32ff 100644
--- a/indra/llui/llwindowshade.h
+++ b/indra/llui/llwindowshade.h
@@ -36,7 +36,6 @@ class LLWindowShade : public LLUICtrl
 public:
 	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
 	{
-		Mandatory<LLNotificationPtr>	notification;
 		Optional<LLUIImage*>			bg_image;
 		Optional<LLUIColor>				text_color;
 		Optional<bool>					modal,
@@ -45,11 +44,16 @@ class LLWindowShade : public LLUICtrl
 		Params();
 	};
 
-	void show();
+	void show(LLNotificationPtr);
 	/*virtual*/ void draw();
 	void hide();
+	void setBackgroundImage(LLUIImage* image);
+	void setTextColor(LLColor4 color);
+	void setCanClose(bool can_close);
 
 private:
+	void displayLatestNotification();
+	LLNotificationPtr getCurrentNotification();
 	friend class LLUICtrlFactory;
 
 	LLWindowShade(const Params& p);
@@ -60,7 +64,7 @@ class LLWindowShade : public LLUICtrl
 	void onEnterNotificationText(LLUICtrl* ctrl, const std::string& name);
 	void onClickIgnore(LLUICtrl* ctrl);
 
-	LLNotificationPtr	mNotification;
+	std::vector<LLNotificationPtr>	mNotifications;
 	LLSD				mNotificationResponse;
 	bool				mModal;
 	S32					mFormHeight;
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 74fa5d350a3..7650fe92296 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -133,10 +133,15 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
 		navigateHome();
 	}
 		
-	// FIXME: How do we create a bevel now?
-//	LLRect border_rect( 0, getRect().getHeight() + 2, getRect().getWidth() + 2, 0 );
-//	mBorder = new LLViewBorder( std::string("web control border"), border_rect, LLViewBorder::BEVEL_IN );
-//	addChild( mBorder );
+	LLWindowShade::Params params;
+	params.name = "notification_shade";
+	params.rect = getLocalRect();
+	params.follows.flags = FOLLOWS_ALL;
+	params.modal = true;
+
+	mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
+
+	addChild(mWindowShade);
 }
 
 LLMediaCtrl::~LLMediaCtrl()
@@ -1092,39 +1097,28 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response)
 
 void LLMediaCtrl::showNotification(LLNotificationPtr notify)
 {
-	delete mWindowShade;
+	LLWindowShade* shade = getChild<LLWindowShade>("notification_shade");
 
-	LLWindowShade::Params params;
-	params.name = "notification_shade";
-	params.rect = getLocalRect();
-	params.follows.flags = FOLLOWS_ALL;
-	params.notification = notify;
-	params.modal = true;
-	//HACK: don't hardcode this
 	if (notify->getIcon() == "Popup_Caution")
 	{
-		params.bg_image.name = "Yellow_Gradient";
-		params.text_color = LLColor4::black;
+		shade->setBackgroundImage(LLUI::getUIImage("Yellow_Gradient"));
+		shade->setTextColor(LLColor4::black);
+		shade->setCanClose(true);
 	}
-	else
-	//HACK: another one since XUI doesn't support what we need right now
-	if (notify->getName() == "AuthRequest")
+	else if (notify->getName() == "AuthRequest")
 	{
-		params.bg_image.name = "Yellow_Gradient";
-		params.text_color = LLColor4::black;
-		params.can_close = false;
+		shade->setBackgroundImage(LLUI::getUIImage("Yellow_Gradient"));
+		shade->setTextColor(LLColor4::black);
+		shade->setCanClose(false);
 	}
 	else
 	{
 		//HACK: make this a property of the notification itself, "cancellable"
-		params.can_close = false;
-		params.text_color.control = "LabelTextColor";
+		shade->setCanClose(false);
+		shade->setTextColor(LLUIColorTable::instance().getColor("LabelTextColor"));
 	}
 
-	mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
-
-	addChild(mWindowShade);
-	mWindowShade->show();
+	mWindowShade->show(notify);
 }
 
 void LLMediaCtrl::hideNotification()
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 933b40ec791..39c0628cbe0 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -1351,7 +1351,6 @@ void LLPanelPrimMediaControls::showNotification(LLNotificationPtr notify)
 	LLWindowShade::Params params;
 	params.rect = mMediaRegion->getLocalRect();
 	params.follows.flags = FOLLOWS_ALL;
-	params.notification = notify;
 
 	//HACK: don't hardcode this
 	if (notify->getIcon() == "Popup_Caution")
@@ -1369,7 +1368,7 @@ void LLPanelPrimMediaControls::showNotification(LLNotificationPtr notify)
 	mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
 
 	mMediaRegion->addChild(mWindowShade);
-	mWindowShade->show();
+	mWindowShade->show(notify);
 }
 
 void LLPanelPrimMediaControls::hideNotification()
-- 
GitLab


From e826cbd90750fd38565e4e44390948f36254cf1f Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 12 Dec 2011 15:02:52 -0800
Subject: [PATCH 419/933] EXP-1682 FIX EXP-1683 FIX EXP-1705 FIX EXP-1707 FIX

* Outbox folder count now uses inventory API directly rather than inventory folder view for folder count and item status
* Asynchronous fetches are triggered for the outbox content when the window is opened and when it receives focus
* Marketplace URL's for empty and non-merchant outbox view have been updated
* "Copy to Merchant Outbox" and "Delete" context menu items should be fully functional now with item counts, etc.
---
 indra/newview/llfloateroutbox.cpp             | 135 +++++++++---------
 indra/newview/llfloateroutbox.h               |  10 +-
 indra/newview/llmarketplacefunctions.cpp      | 101 ++++++++-----
 indra/newview/llmarketplacefunctions.h        |   4 +
 .../newview/skins/default/xui/en/strings.xml  |  24 +++-
 5 files changed, 162 insertions(+), 112 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 8d64214e8c6..b10ef0ba646 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -30,6 +30,7 @@
 
 #include "llfloaterreg.h"
 #include "llfolderview.h"
+#include "llinventorymodelbackgroundfetch.h"
 #include "llinventoryobserver.h"
 #include "llinventorypanel.h"
 #include "llmarketplacefunctions.h"
@@ -139,6 +140,8 @@ BOOL LLFloaterOutbox::postBuild()
 	
 	mImportButton = getChild<LLButton>("outbox_import_btn");
 	mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this));
+	
+	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterOutbox::onFocusReceived, this));
 
 	return TRUE;
 }
@@ -187,10 +190,30 @@ void LLFloaterOutbox::onOpen(const LLSD& key)
 	}
 	
 	updateView();
+	
+	//
+	// Trigger fetch of outbox contents
+	//
+	
+	fetchOutboxContents();
+}
+
+void LLFloaterOutbox::onFocusReceived()
+{
+	fetchOutboxContents();
+}
+
+void LLFloaterOutbox::fetchOutboxContents()
+{
+	if (mOutboxId.notNull())
+	{
+		LLInventoryModelBackgroundFetch::instance().start(mOutboxId);
+	}
 }
 
 void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
-{	
+{
+	llassert(outboxId.notNull());
 	llassert(mOutboxId.isNull());
 	llassert(mCategoriesObserver == NULL);
 	
@@ -228,15 +251,47 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
 	mOutboxInventoryPanel->getFilter()->markDefault();
 	
-	// Set selection callback for proper update of inventory status buttons
-	//mOutboxInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this));
+	fetchOutboxContents();
+}
+
+void LLFloaterOutbox::updateItemCount()
+{
+	S32 item_count = 0;
+
+	if (mOutboxId.notNull())
+	{
+		LLInventoryModel::cat_array_t * cats;
+		LLInventoryModel::item_array_t * items;
+		gInventory.getDirectDescendentsOf(mOutboxId, cats, items);
+
+		item_count = cats->count() + items->count();
+	}
+	
+	mOutboxItemCount = item_count;
+
+	switch (mOutboxItemCount)
+	{
+		case 0:	mInventoryFolderCountText->setText(getString("OutboxFolderCount0"));	break;
+		case 1:	mInventoryFolderCountText->setText(getString("OutboxFolderCount1"));	break;
+		default:
+		{
+			std::string item_count_str = llformat("%d", mOutboxItemCount);
+			
+			LLStringUtil::format_map_t args;
+			args["[NUM]"] = item_count_str;
+			
+			mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args));
+			break;
+		}
+	}
 	
-	// Set up the note to display when the outbox is empty
-	mOutboxInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems");
+	mImportButton->setEnabled(mOutboxItemCount > 0);
 }
 
 void LLFloaterOutbox::updateView()
 {
+	updateItemCount();
+
 	if (mOutboxItemCount > 0)
 	{
 		mOutboxInventoryPanel->setVisible(TRUE);
@@ -251,44 +306,17 @@ void LLFloaterOutbox::updateView()
 		std::string outbox_title;
 		std::string outbox_tooltip;
 		
+		LLStringUtil::format_map_t subs = getMarketplaceStringSubstitutions();
+		
 		if (mOutboxId.notNull())
 		{
-			outbox_text = LLTrans::getString("InventoryOutboxNoItems");
+			outbox_text = LLTrans::getString("InventoryOutboxNoItems", subs);
 			outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle");
 			outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip");
 		}
 		else
 		{
-			//
-			// The string to become a merchant contains 3 URL's which need the domain name patched in.
-			//
-			
-			std::string domain = "secondlife.com";
-			
-			if (!LLGridManager::getInstance()->isInProductionGrid())
-			{
-				std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
-				domain = llformat("%s.lindenlab.com", utf8str_tolower(gridLabel).c_str());
-			}
-			
-			LLStringUtil::format_map_t domain_arg;
-			domain_arg["[DOMAIN_NAME]"] = domain;
-			
-			std::string marketplace_url = LLTrans::getString("MarketplaceURL", domain_arg);
-			std::string marketplace_url_create = LLTrans::getString("MarketplaceURL_CreateStore", domain_arg);
-			std::string marketplace_url_info = LLTrans::getString("MarketplaceURL_LearnMore", domain_arg);
-			
-			LLStringUtil::format_map_t args1, args2, args3;
-			args1["[MARKETPLACE_URL]"] = marketplace_url;
-			args2["[LEARN_MORE_URL]"] = marketplace_url_info;
-			args3["[CREATE_STORE_URL]"] = marketplace_url_create;
-			
-			// NOTE: This is dumb, ridiculous and very finicky.  The order of these is very important
-			//       to have these three string substitutions work properly.
-			outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", args1);
-			LLStringUtil::format(outbox_text, args2);
-			LLStringUtil::format(outbox_text, args3);
-			
+			outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", subs);
 			outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle");
 			outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip");
 		}
@@ -306,7 +334,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 										std::string& tooltip_msg)
 {
 	// Pass drag and drop to this floater to the outbox inventory control
-	
+
 	if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || 
 		(mWindowShade && mWindowShade->isShown()))
 	{
@@ -329,37 +357,8 @@ void LLFloaterOutbox::onImportButtonClicked()
 void LLFloaterOutbox::onOutboxChanged()
 {
 	llassert(!mOutboxId.isNull());
-	
-	U32 item_count = 0;
-	
-	const LLFolderViewFolder * outbox_folder = mOutboxInventoryPanel->getRootFolder();
-	
-	if (outbox_folder)
-	{
-		item_count += outbox_folder->getFoldersCount();
-		item_count += outbox_folder->getItemsCount();
-	}
-	
-	mOutboxItemCount = item_count;
-
-	switch (mOutboxItemCount)
-	{
-		case 0:	mInventoryFolderCountText->setText(getString("OutboxFolderCount0"));	break;
-		case 1:	mInventoryFolderCountText->setText(getString("OutboxFolderCount1"));	break;
-		default:
-		{
-			std::string item_count_str = llformat("%d", mOutboxItemCount);
-			
-			LLStringUtil::format_map_t args;
-			args["[NUM]"] = item_count_str;
-
-			mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args));
-			break;
-		}
-	}
-
-	mImportButton->setEnabled(mOutboxItemCount > 0);
 
+	fetchOutboxContents();
 	updateView();
 }
 
@@ -384,6 +383,8 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
 		//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
 		LLNotificationsUtil::add("OutboxImportFailed", subs);
 	}
+	
+	updateView();
 }
 
 void LLFloaterOutbox::importStatusChanged(bool inProgress)
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 80234346757..5222db1142a 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -58,8 +58,6 @@ class LLFloaterOutbox : public LLFloater
 
 	// virtuals
 	BOOL postBuild();
-	void onClose(bool app_quitting);
-	void onOpen(const LLSD& key);
 	BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 						   EDragAndDropType cargo_type,
 						   void* cargo_data,
@@ -69,12 +67,20 @@ class LLFloaterOutbox : public LLFloater
 	void showNotification(LLNotificationPtr notify);
 
 protected:
+	void fetchOutboxContents();
+
 	void importReportResults(U32 status, const LLSD& content);
 	void importStatusChanged(bool inProgress);
 	
+	void onClose(bool app_quitting);
+	void onOpen(const LLSD& key);
+
+	void onFocusReceived();
+
 	void onImportButtonClicked();
 	void onOutboxChanged();
 	
+	void updateItemCount();
 	void updateView();
 
 private:
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 9c67c589b85..225bb059c96 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -30,6 +30,7 @@
 
 #include "llagent.h"
 #include "llhttpclient.h"
+#include "lltrans.h"
 #include "llviewermedia.h"
 #include "llviewernetwork.h"
 
@@ -38,6 +39,59 @@
 // Helpers
 //
 
+static std::string getMarketplaceDomain()
+{
+	std::string domain = "secondlife.com";
+	
+	if (!LLGridManager::getInstance()->isInProductionGrid())
+	{
+		const std::string& grid_label = LLGridManager::getInstance()->getGridLabel();
+		const std::string& grid_label_lower = utf8str_tolower(grid_label);
+		
+		if (grid_label_lower == "damballah")
+		{
+			domain = "secondlife-staging.com";
+		}
+		else
+		{
+			domain = llformat("%s.lindenlab.com", grid_label_lower.c_str());
+		}
+	}
+	
+	return domain;
+}
+
+static std::string getMarketplaceURL(const std::string& urlStringName)
+{
+	LLStringUtil::format_map_t domain_arg;
+	domain_arg["[MARKETPLACE_DOMAIN_NAME]"] = getMarketplaceDomain();
+	
+	std::string marketplace_url = LLTrans::getString(urlStringName, domain_arg);
+	
+	return marketplace_url;
+}
+
+LLStringUtil::format_map_t getMarketplaceStringSubstitutions()
+{
+	std::string marketplace_url = getMarketplaceURL("MarketplaceURL");
+	std::string marketplace_url_create = getMarketplaceURL("MarketplaceURL_CreateStore");
+	std::string marketplace_url_dashboard = getMarketplaceURL("MarketplaceURL_Dashboard");
+	std::string marketplace_url_info = getMarketplaceURL("MarketplaceURL_LearnMore");
+	
+	LLStringUtil::format_map_t agent_map;
+	agent_map["[AGENT_ID]"] = gAgent.getID().getString();
+	
+	LLStringUtil::format(marketplace_url_dashboard, agent_map);
+	
+	LLStringUtil::format_map_t marketplace_sub_map;
+	marketplace_sub_map["[MARKETPLACE_URL]"] = marketplace_url;
+	marketplace_sub_map["[MARKETPLACE_CREATE_STORE_URL]"] = marketplace_url_create;
+	marketplace_sub_map["[MARKETPLACE_LEARN_MORE_URL]"] = marketplace_url_info;
+	marketplace_sub_map["[MARKETPLACE_DASHBOARD_URL]"] = marketplace_url_dashboard;
+	
+	return marketplace_sub_map;
+}
+
 namespace LLMarketplaceImport
 {
 	// Basic interface for this namespace
@@ -61,42 +115,6 @@ namespace LLMarketplaceImport
 	static LLSD sImportResults = LLSD::emptyMap();
 		
 	
-	// Internal helper functions
-	
-	std::string getBaseURL()
-	{
-		std::string url = "https://marketplace.secondlife.com/";
-
-		if (!LLGridManager::getInstance()->isInProductionGrid())
-		{
-			std::string gridLabel = utf8str_tolower(LLGridManager::getInstance()->getGridLabel());
-			
-			if (gridLabel == "damballah")
-			{
-				url = "https://marketplace.secondlife-staging.com/";
-			}
-			else
-			{
-				url = llformat("https://marketplace.%s.lindenlab.com/", gridLabel.c_str());
-			}
-		}
-
-		url += "api/1/";
-		url += gAgent.getID().getString();
-		url += "/inventory/";
-
-		return url;
-	}
-
-	std::string getInventoryImportURL()
-	{
-		std::string url = getBaseURL();
-
-		url += "import/";
-
-		return url;
-	}
-	
 	// Responders
 	
 	class LLImportPostResponder : public LLHTTPClient::Responder
@@ -200,6 +218,17 @@ namespace LLMarketplaceImport
 		return sImportResults;
 	}
 	
+	static std::string getInventoryImportURL()
+	{
+		std::string url = getMarketplaceURL("MarketplaceURL");
+		
+		url += "api/1/";
+		url += gAgent.getID().getString();
+		url += "/inventory/import/";
+		
+		return url;
+	}
+	
 	void establishMarketplaceSessionCookie()
 	{
 		sImportInProgress = true;
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index 5ca0bdfe776..f501f1ee8b6 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -34,6 +34,10 @@
 #include <boost/signals2.hpp>
 
 #include "llsingleton.h"
+#include "llstring.h"
+
+
+LLStringUtil::format_map_t getMarketplaceStringSubstitutions();
 
 
 namespace MarketplaceErrorCodes
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index b8d5f93320e..7dd965de846 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2029,18 +2029,28 @@ Returns a string with the requested data about the region
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
 	<string name="InventoryInboxNoItems">When you purchase or otherwise receive an item, it will appear here so you can drag it to a folder in your inventory, or delete it if you do not wish to keep it.</string>
-	<string name="MarketplaceURL">http://marketplace.[DOMAIN_NAME]</string>
-	<string name="MarketplaceURL_CreateStore">http://marketplace.[DOMAIN_NAME]/create_store</string>
-	<string name="MarketplaceURL_LearnMore">http://marketplace.[DOMAIN_NAME]/learn_more</string>
+	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]</string>
+	<string name="MarketplaceURL_CreateStore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/create_store</string>
+	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/[AGENT_ID]/store/dashboard</string>
+	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
 	<string name="InventoryOutboxCreationErrorTitle">Your Merchant Outbox is not properly configured</string>
 	<string name="InventoryOutboxCreationErrorTooltip">Merchant Outbox configuration error</string>
 	<string name="InventoryOutboxCreationError">Please contact Customer Service to correct the problem.</string>
-	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace</string>
+	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace.</string>
 	<string name="InventoryOutboxNotMerchantTooltip">Become a merchant!</string>
-	<string name="InventoryOutboxNotMerchant">[[MARKETPLACE_URL] The Second Life Marketplace] offers more than one million virtual products for sale, all of them created by Residents. You, too, can sell items you create, as well as some of the items you have purchased. It’s easy and setup is free.  [[LEARN_MORE_URL] Learn more] or [[CREATE_STORE_URL] create a store] on the Marketplace to get started.</string>
-	<string name="InventoryOutboxNoItemsTitle">A new way to send items to the Marketplace</string>
+	<string name="InventoryOutboxNotMerchant">
+	The Second Life Marketplace offers more than one million virtual products for sale, all of them created by Residents like you.  You too can create items and sell them on the Marketplace.  Creating a store is easy and free of charge.
+	
+	[[MARKETPLACE_URL] Visit the Marketplace]
+	[[MARKETPLACE_LEARN_MORE_URL] Learn more about creating a store]
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">Your outbox is empty.</string>
 	<string name="InventoryOutboxNoItemsTooltip">Drag and drop items here to prepare them for sale on the Marketplace</string>
-	<string name="InventoryOutboxNoItems">Drag items or folders that you wish to sell into this area.  A copy of the item will appear, leaving your inventory unchanged, unless you have dragged a no-copy item.  When you are ready to send the items to the Marketplace, click the Upload button. Once your items have been moved to your Marketplace Inventory, they will disappear from this folder.</string>
+	<string name="InventoryOutboxNoItems">
+	Drag folders to this area.  When you are ready to send them to the Marketplace for sale, click the "Send to Marketplace" button below.
+	
+	[[MARKETPLACE_DASHBOARD_URL] Go to your Merchant Dashboard]
+	</string>
 
 	<string name="Marketplace Error None">No errors</string>
 	<string name="Marketplace Error Not Merchant">Error: Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string>
-- 
GitLab


From 2b2a03b3c5e983f6dee85602a41acaf4d515a4db Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 12 Dec 2011 17:12:47 -0600
Subject: [PATCH 420/933] SH-2511 Fix for bumpmapped objects flickering.

---
 indra/newview/lldrawpoolbump.cpp | 79 +++++++++++++++-----------------
 1 file changed, 38 insertions(+), 41 deletions(-)

diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index b696b90d847..b58efe62ab6 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1036,51 +1036,48 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
 	llassert( (bump_code == BE_BRIGHTNESS) || (bump_code == BE_DARKNESS) );
 
 	LLViewerTexture* bump = NULL;
-	const F32 BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD = 1000;
-	if( src_image->getMaxVirtualSize() > BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD )
-	{
-		bump_image_map_t* entries_list = NULL;
-		void (*callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL;
+	
+	bump_image_map_t* entries_list = NULL;
+	void (*callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL;
 
-		switch( bump_code )
-		{
-		case BE_BRIGHTNESS:
-			entries_list = &mBrightnessEntries;
-			callback_func = LLBumpImageList::onSourceBrightnessLoaded;
-			break;
-		case BE_DARKNESS:
-			entries_list = &mDarknessEntries;
-			callback_func = LLBumpImageList::onSourceDarknessLoaded;
-			break;
-		default:
-			llassert(0);
-			return NULL;
-		}
+	switch( bump_code )
+	{
+	case BE_BRIGHTNESS:
+		entries_list = &mBrightnessEntries;
+		callback_func = LLBumpImageList::onSourceBrightnessLoaded;
+		break;
+	case BE_DARKNESS:
+		entries_list = &mDarknessEntries;
+		callback_func = LLBumpImageList::onSourceDarknessLoaded;
+		break;
+	default:
+		llassert(0);
+		return NULL;
+	}
 
-		bump_image_map_t::iterator iter = entries_list->find(src_image->getID());
-		if (iter != entries_list->end() && iter->second.notNull())
-		{
-			bump = iter->second;
-		}
-		else
-		{
-			LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
-			raw->clear(0x77, 0x77, 0xFF, 0xFF);
+	bump_image_map_t::iterator iter = entries_list->find(src_image->getID());
+	if (iter != entries_list->end() && iter->second.notNull())
+	{
+		bump = iter->second;
+	}
+	else
+	{
+		LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
+		raw->clear(0x77, 0x77, 0xFF, 0xFF);
 
-			(*entries_list)[src_image->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
-			bump = (*entries_list)[src_image->getID()]; // In case callback was called immediately and replaced the image
-		}
+		(*entries_list)[src_image->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
+		bump = (*entries_list)[src_image->getID()]; // In case callback was called immediately and replaced the image
+	}
 
-		if (!src_image->hasCallbacks())
-		{ //if image has no callbacks but resolutions don't match, trigger raw image loaded callback again
-			if (src_image->getWidth() != bump->getWidth() ||
-				src_image->getHeight() != bump->getHeight())// ||
-				//(LLPipeline::sRenderDeferred && bump->getComponents() != 4))
-			{
-				src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
-				src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL );
-				src_image->forceToSaveRawImage(0) ;
-			}
+	if (!src_image->hasCallbacks())
+	{ //if image has no callbacks but resolutions don't match, trigger raw image loaded callback again
+		if (src_image->getWidth() != bump->getWidth() ||
+			src_image->getHeight() != bump->getHeight())// ||
+			//(LLPipeline::sRenderDeferred && bump->getComponents() != 4))
+		{
+			src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
+			src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL );
+			src_image->forceToSaveRawImage(0) ;
 		}
 	}
 
-- 
GitLab


From 35feb03d27036f82a6bca60c1be8d864de990646 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 12 Dec 2011 15:50:10 -0800
Subject: [PATCH 421/933] EXP-1711 FIX LLWindowShade doesn't stack multiple
 notifications added configurable shade color to window_shade

---
 indra/llui/llwindowshade.cpp                                | 3 ++-
 indra/llui/llwindowshade.h                                  | 3 ++-
 indra/newview/skins/default/xui/en/widgets/window_shade.xml | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/widgets/window_shade.xml

diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index 0b4cfe68a65..1e8b47de29b 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -43,6 +43,7 @@ LLWindowShade::Params::Params()
 :	bg_image("bg_image"),
 	modal("modal", false),
 	text_color("text_color"),
+	shade_color("shade_color"),
 	can_close("can_close", true)
 {
 	changeDefault(mouse_opaque, false);
@@ -90,7 +91,7 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
 	panel_p.name = "background_area";
 	panel_p.mouse_opaque = false;
 	panel_p.background_visible = false;
-	panel_p.bg_alpha_color = LLColor4(0.f, 0.f, 0.f, 0.2f);
+	panel_p.bg_alpha_color = params.shade_color;
 	LLLayoutPanel* dummy_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
 	stackp->addChild(dummy_panel);
 
diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h
index 1dcab4e32ff..1ae84028dd0 100644
--- a/indra/llui/llwindowshade.h
+++ b/indra/llui/llwindowshade.h
@@ -37,7 +37,8 @@ class LLWindowShade : public LLUICtrl
 	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
 	{
 		Optional<LLUIImage*>			bg_image;
-		Optional<LLUIColor>				text_color;
+		Optional<LLUIColor>				text_color,
+										shade_color;
 		Optional<bool>					modal,
 										can_close;
 
diff --git a/indra/newview/skins/default/xui/en/widgets/window_shade.xml b/indra/newview/skins/default/xui/en/widgets/window_shade.xml
new file mode 100644
index 00000000000..23eb2f13fb8
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/window_shade.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<window_shade shade_color="0 0 0 0.5"/>
-- 
GitLab


From e859c3446b5c631fe0a9806434aa19b64a0d9113 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 12 Dec 2011 16:06:22 -0800
Subject: [PATCH 422/933] Added missing line end to satisfy coding policy

---
 indra/llui/llwindowshade.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index 1e8b47de29b..ae8b30b1ba2 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -383,4 +383,5 @@ LLNotificationPtr LLWindowShade::getCurrentNotification()
 		return LLNotificationPtr();
 	}
 	return mNotifications.back();
-}
\ No newline at end of file
+}
+
-- 
GitLab


From d3f06b296203c08c900c4e569ce5df0ac2f27715 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 12 Dec 2011 17:04:58 -0800
Subject: [PATCH 423/933] Fixed marketplace URL trailing '/' and updated to
 latest window shade code from viewer-experience

---
 indra/newview/llfloateroutbox.cpp              | 4 ++--
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index b10ef0ba646..972e1e8cdc4 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -418,14 +418,14 @@ void LLFloaterOutbox::showNotification(LLNotificationPtr notify)
 	params.name = "notification_shade";
 	params.rect = floater_rect;
 	params.follows.flags = FOLLOWS_ALL;
-	params.notification = notify;
 	params.modal = true;
 	params.can_close = false;
+	params.shade_color = LLColor4::white % 0.25f;
 	params.text_color = LLColor4::white;
 	
 	mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
 	
 	addChild(mWindowShade);
-	mWindowShade->show();
+	mWindowShade->show(notify);
 }
 
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 7dd965de846..3c7465cd7cf 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2029,7 +2029,7 @@ Returns a string with the requested data about the region
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
 	<string name="InventoryInboxNoItems">When you purchase or otherwise receive an item, it will appear here so you can drag it to a folder in your inventory, or delete it if you do not wish to keep it.</string>
-	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]</string>
+	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
 	<string name="MarketplaceURL_CreateStore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/create_store</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/[AGENT_ID]/store/dashboard</string>
 	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
-- 
GitLab


From 7f85f6be6af92868faeaf38b60accd3a3ab4491a Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 12 Dec 2011 20:07:34 -0500
Subject: [PATCH 424/933] VWR-27832 L$ Transfer failures show alert as if
 successful

---
 doc/contributions.txt                            |  1 +
 indra/newview/llviewermessage.cpp                | 16 +++++++++++-----
 .../skins/default/xui/en/notifications.xml       |  9 +++++++++
 indra/newview/skins/default/xui/en/strings.xml   |  4 ++++
 4 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..6a99c5787ee 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	VWR-27832
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ad333a71ff1..2f2c7110734 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5206,6 +5206,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
 	BOOL is_dest_group = FALSE;
     S32 amount = 0;
     std::string item_description;
+	BOOL success = FALSE;
 
     msg->getS32("TransactionInfo", "TransactionType", transaction_type);
     msg->getUUID("TransactionInfo", "SourceID", source_id);
@@ -5214,6 +5215,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
 	msg->getBOOL("TransactionInfo", "IsDestGroup", is_dest_group);
     msg->getS32("TransactionInfo", "Amount", amount);
     msg->getString("TransactionInfo", "ItemDescription", item_description);
+	msg->getBOOL("MoneyData", "TransactionSuccess", success);
     LL_INFOS("Money") << "MoneyBalanceReply source " << source_id 
 		<< " dest " << dest_id
 		<< " type " << transaction_type
@@ -5275,28 +5277,32 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
 		{
 			if (dest_id.notNull())
 			{
-				message = LLTrans::getString("you_paid_ldollars", args);
+				message = success ? LLTrans::getString("you_paid_ldollars", args) :
+									LLTrans::getString("you_paid_failure_ldollars", args);
 			}
 			else
 			{
 				// transaction fee to the system, eg, to create a group
-				message = LLTrans::getString("you_paid_ldollars_no_name", args);
+				message = success ? LLTrans::getString("you_paid_ldollars_no_name", args) :
+									LLTrans::getString("you_paid_failure_ldollars_no_name", args);
 			}
 		}
 		else
 		{
 			if (dest_id.notNull())
 			{
-				message = LLTrans::getString("you_paid_ldollars_no_reason", args);
+				message = success ? LLTrans::getString("you_paid_ldollars_no_reason", args) :
+									LLTrans::getString("you_paid_failure_ldollars_no_reason", args);
 			}
 			else
 			{
 				// no target, no reason, you just paid money
-				message = LLTrans::getString("you_paid_ldollars_no_info", args);
+				message = success ? LLTrans::getString("you_paid_ldollars_no_info", args) :
+									LLTrans::getString("you_paid_failure_ldollars_no_info", args);
 			}
 		}
 		final_args["MESSAGE"] = message;
-		notification = "PaymentSent";
+		notification = success ? "PaymentSent" : "PaymentFailure";
 	}
 	else {
 		// ...someone paid you
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 0ba4b84abe4..a7705c8bac7 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5516,6 +5516,15 @@ Please select at least one type of content to search (General, Moderate, or Adul
 [MESSAGE]
   </notification>
 
+  <notification
+   icon="notify.tga"
+   name="PaymentFailure"
+   persist="true"
+   type="notify">
+    <tag>funds</tag>
+[MESSAGE]
+  </notification>
+
    <!-- EventNotification couldn't be persist since server decide is it necessary to notify 
    user about subscribed event via LLEventNotifier-->
   <notification
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c25d1f57d6e..877c2e5c349 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3358,6 +3358,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   <string name="you_paid_ldollars_no_info">You paid L$[AMOUNT].</string>
   <string name="you_paid_ldollars_no_reason">You paid [NAME] L$[AMOUNT].</string>
   <string name="you_paid_ldollars_no_name">You paid L$[AMOUNT] [REASON].</string>
+  <string name="you_paid_failure_ldollars">You failed to pay [NAME] L$[AMOUNT] [REASON].</string>
+  <string name="you_paid_failure_ldollars_no_info">You failed to pay L$[AMOUNT].</string>
+  <string name="you_paid_failure_ldollars_no_reason">You failed to pay [NAME] L$[AMOUNT].</string>
+  <string name="you_paid_failure_ldollars_no_name">You failed to pay L$[AMOUNT] [REASON].</string>
   <string name="for item">for [ITEM]</string>
   <string name="for a parcel of land">for a parcel of land</string>
   <string name="for a land access pass">for a land access pass</string>
-- 
GitLab


From 181eaa8196d19d5d0c1db17fe27bd2bdee11525b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 12 Dec 2011 17:22:47 -0800
Subject: [PATCH 425/933] EXP-1648 FIX

* Merchant outbox no longer crashes for non-merchants.
* Folder count is hidden for non-merchants.
* Drag and drop to merchant outbox floater is disabled for non-merchants.
---
 indra/newview/llfloateroutbox.cpp             | 38 +++++++++++--------
 .../newview/skins/default/xui/en/strings.xml  |  1 +
 2 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 972e1e8cdc4..b15380d4274 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -269,22 +269,25 @@ void LLFloaterOutbox::updateItemCount()
 	
 	mOutboxItemCount = item_count;
 
-	switch (mOutboxItemCount)
+	if (mOutboxInventoryPanel)
 	{
-		case 0:	mInventoryFolderCountText->setText(getString("OutboxFolderCount0"));	break;
-		case 1:	mInventoryFolderCountText->setText(getString("OutboxFolderCount1"));	break;
-		default:
+		switch (mOutboxItemCount)
 		{
-			std::string item_count_str = llformat("%d", mOutboxItemCount);
-			
-			LLStringUtil::format_map_t args;
-			args["[NUM]"] = item_count_str;
-			
-			mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args));
-			break;
+			case 0:	mInventoryFolderCountText->setText(getString("OutboxFolderCount0"));	break;
+			case 1:	mInventoryFolderCountText->setText(getString("OutboxFolderCount1"));	break;
+			default:
+			{
+				std::string item_count_str = llformat("%d", mOutboxItemCount);
+				
+				LLStringUtil::format_map_t args;
+				args["[NUM]"] = item_count_str;
+				
+				mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args));
+				break;
+			}
 		}
 	}
-	
+
 	mImportButton->setEnabled(mOutboxItemCount > 0);
 }
 
@@ -299,7 +302,11 @@ void LLFloaterOutbox::updateView()
 	}
 	else
 	{
-		mOutboxInventoryPanel->setVisible(FALSE);
+		if (mOutboxInventoryPanel)
+		{
+			mOutboxInventoryPanel->setVisible(FALSE);
+		}
+
 		mInventoryPlaceholder->setVisible(TRUE);
 
 		std::string outbox_text;
@@ -335,8 +342,9 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 {
 	// Pass drag and drop to this floater to the outbox inventory control
 
-	if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || 
-		(mWindowShade && mWindowShade->isShown()))
+	if ((mOutboxInventoryPanel == NULL) ||
+		(mWindowShade && mWindowShade->isShown()) ||
+		LLMarketplaceInventoryImporter::getInstance()->isImportInProgress())
 	{
 		return FALSE;
 	}
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3c7465cd7cf..d8da56d338f 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2042,6 +2042,7 @@ Returns a string with the requested data about the region
 	The Second Life Marketplace offers more than one million virtual products for sale, all of them created by Residents like you.  You too can create items and sell them on the Marketplace.  Creating a store is easy and free of charge.
 	
 	[[MARKETPLACE_URL] Visit the Marketplace]
+
 	[[MARKETPLACE_LEARN_MORE_URL] Learn more about creating a store]
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">Your outbox is empty.</string>
-- 
GitLab


From aba090ab9027e5a5c1e9eb114ecca12b9eafa978 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Tue, 13 Dec 2011 17:27:54 +0200
Subject: [PATCH 426/933] EXP-1599 FIXED (Sharing multiple selected inventory
 folders only shares one folder (no warning for user))

- In case of sharing multiple folders, make the confirmation dialog contain a warning that only one folder can be shared at a time.
---
 indra/newview/llavataractions.cpp             | 19 +++++++++++++++++-
 .../skins/default/xui/en/notifications.xml    | 20 +++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 8ca621538fa..7abecc643b4 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -680,12 +680,29 @@ namespace action_give_inventory
 		std::string items;
 		build_items_string(inventory_selected_uuids, items);
 
+		int folders_count = 0;
+		std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin();
+
+		//traverse through selected inventory items and count folders among them
+		for ( ; it != inventory_selected_uuids.end() && folders_count <=1 ; ++it)
+		{
+			LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
+			if (NULL != inv_cat)
+			{
+				folders_count++;
+			}
+		}
+
+		// EXP-1599
+		// In case of sharing multiple folders, make the confirmation
+		// dialog contain a warning that only one folder can be shared at a time.
+		std::string notification = (folders_count > 1) ? "ShareFolderConfirmation" : "ShareItemsConfirmation";
 		LLSD substitutions;
 		substitutions["RESIDENTS"] = residents;
 		substitutions["ITEMS"] = items;
 		LLShareInfo::instance().mAvatarNames = avatar_names;
 		LLShareInfo::instance().mAvatarUuids = avatar_uuids;
-		LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, LLSD(), &give_inventory_cb);
+		LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb);
 	}
 }
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 0ba4b84abe4..5b985c99814 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6942,6 +6942,26 @@ With the following Residents:
      yestext="OK"/>
   </notification>
   
+  <notification
+   icon="notifytip.tga"
+   name="ShareFolderConfirmation"
+   type="alertmodal">
+Only one folder at a time can be shared.
+
+Are you sure you want to share the following items:
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+With the following Residents:
+
+[RESIDENTS]
+  <tag>confirm</tag>
+	<usetemplate
+     name="okcancelbuttons"
+     notext="Cancel"
+     yestext="Ok"/>
+  </notification>
+  
   <notification
    icon="notifytip.tga"
    name="ItemsShared"
-- 
GitLab


From 9fcdec3e34d689ccfb74fb4905fa975f5819270a Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 13 Dec 2011 11:15:01 -0800
Subject: [PATCH 427/933] EXP-1679 FIX -- Collapse links that are dragged to
 the outbox

* Links are automatically tracked back to their source when dragged to the outbox
* Worn items are now allowed into the outbox
---
 indra/newview/llinventorybridge.cpp    | 25 ++++++++--
 indra/newview/llinventoryfunctions.cpp | 63 ++++++++++++++++----------
 2 files changed, 61 insertions(+), 27 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 33b9af7a789..3f12e8b1d3e 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -72,6 +72,7 @@
 
 // Marketplace outbox current disabled
 #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1
+#define BLOCK_WORN_ITEMS_IN_OUTBOX 0
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
 typedef std::list<two_uuids_t> two_uuids_list_t;
@@ -1101,6 +1102,8 @@ BOOL LLInvFVBridge::canListOnMarketplace() const
 BOOL LLInvFVBridge::canListOnMarketplaceNow() const
 {
 #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+
+#if BLOCK_WORN_ITEMS_IN_OUTBOX
 	if (get_is_item_worn(mUUID))
 	{
 		return FALSE;
@@ -1112,6 +1115,7 @@ BOOL LLInvFVBridge::canListOnMarketplaceNow() const
 	{
 		return FALSE;
 	}
+#endif // BLOCK_WORN_ITEMS_IN_OUTBOX
 
 	return TRUE;
 #else
@@ -1787,19 +1791,32 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
 
 static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_msg)
 {
-	bool worn = get_is_item_worn(inv_item->getUUID());
+	// Collapse links directly to items/folders
+	LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
+	LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem();
+	if (linked_item != NULL)
+	{
+		inv_item = linked_item;
+	}
+	
 	bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
 
 	if (!allow_transfer)
 	{
 		tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer");
+		return false;
 	}
-	else if(worn)
+
+#if BLOCK_WORN_ITEMS_IN_OUTBOX
+	bool worn = get_is_item_worn(inv_item->getUUID());
+	if (worn)
 	{
 		tooltip_msg = LLTrans::getString("TooltipOutboxWorn");
+		return false;
 	}
-	
-	return !worn && allow_transfer;
+#endif
+
+	return true;
 }
 
 
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 5fb3f15cd59..7040fef65e3 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -595,32 +595,49 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 
 void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder)
 {
-	if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
+	// Collapse links directly to items/folders
+	LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
+	LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory();
+	if (linked_category != NULL)
 	{
-		// when moving item directly into outbox create folder with that name
-		if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
-		{
-			dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName());
-			gInventory.notifyObservers();
-		}
-
-		copy_inventory_item(
-			gAgent.getID(),
-			inv_item->getPermissions().getOwner(),
-			inv_item->getUUID(),
-			dest_folder,
-			inv_item->getName(),
-			LLPointer<LLInventoryCallback>(NULL));
+		copy_folder_to_outbox(linked_category, dest_folder, top_level_folder);
 	}
 	else
-	{	
-		LLSD args;
-		args["ITEM_NAME"] = inv_item->getName();
-		LLSD payload;
-		payload["item_id"] = inv_item->getUUID();
-		payload["dest_folder_id"] = dest_folder;
-		payload["top_level_folder"] = top_level_folder;
-		LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2));
+	{
+		LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem();
+		if (linked_item != NULL)
+		{
+			inv_item = (LLInventoryItem *) linked_item;
+		}
+		
+		// Check for copy permissions
+		if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
+		{
+			// when moving item directly into outbox create folder with that name
+			if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
+			{
+				dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName());
+				gInventory.notifyObservers();
+			}
+			
+			copy_inventory_item(
+								gAgent.getID(),
+								inv_item->getPermissions().getOwner(),
+								inv_item->getUUID(),
+								dest_folder,
+								inv_item->getName(),
+								LLPointer<LLInventoryCallback>(NULL));
+		}
+		else
+		{	
+			LLSD args;
+			args["ITEM_NAME"] = inv_item->getName();
+			LLSD payload;
+			payload["item_id"] = inv_item->getUUID();
+			payload["dest_folder_id"] = dest_folder;
+			payload["top_level_folder"] = top_level_folder;
+			LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2));
+		}
 	}
 }
 
-- 
GitLab


From 2f14bed8b2610f53c28881a9e2e19fd7a0be51fa Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 13 Dec 2011 11:40:36 -0800
Subject: [PATCH 428/933] EXP-1714 FIX -- Add rename option to context menu on
 outbox folders

---
 indra/newview/llinventorybridge.cpp | 95 ++++++++++++++---------------
 1 file changed, 47 insertions(+), 48 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3f12e8b1d3e..aabe851f790 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -617,7 +617,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 		}
 	}
 
-	// Don't allow items to be pasted directly into the COF or the inbox
+	// Don't allow items to be pasted directly into the COF or the inbox/outbox
 	if (!isCOFFolder() && !isInboxFolder() && !isOutboxFolder())
 	{
 		items.push_back(std::string("Paste"));
@@ -2892,6 +2892,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	}
 	else if(isOutboxFolder())
 	{
+		mItems.push_back(std::string("Rename"));
 		mItems.push_back(std::string("Delete"));
 	}
 	else if(isAgentInventory()) // do not allow creating in library
@@ -3741,29 +3742,29 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	menuentry_vec_t items;
 	menuentry_vec_t disabled_items;
 
-	if(isItemInTrash())
-	{
-		addTrashContextMenuOptions(items, disabled_items);
-	}	
-	else if(isOutboxFolder())
+	if (isOutboxFolder())
 	{
 		items.push_back(std::string("Delete"));
 	}
 	else
 	{
-		items.push_back(std::string("Share"));
-		if (!canShare())
+		if (isItemInTrash())
 		{
-			disabled_items.push_back(std::string("Share"));
-		}
-		items.push_back(std::string("Sound Open"));
-		items.push_back(std::string("Properties"));
+			addTrashContextMenuOptions(items, disabled_items);
+		}	
+		else
+		{
+			items.push_back(std::string("Share"));
+			if (!canShare())
+			{
+				disabled_items.push_back(std::string("Share"));
+			}
+			items.push_back(std::string("Sound Open"));
+			items.push_back(std::string("Properties"));
 
-		getClipboardEntries(true, items, disabled_items, flags);
-	}
+			getClipboardEntries(true, items, disabled_items, flags);
+		}
 
-	if (!isOutboxFolder())
-	{
 		items.push_back(std::string("Sound Separator"));
 		items.push_back(std::string("Sound Play"));
 	}
@@ -3799,29 +3800,29 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	menuentry_vec_t disabled_items;
 
 	lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl;
-	if(isItemInTrash())
-	{
-		addTrashContextMenuOptions(items, disabled_items);
-	}	
-	else if(isOutboxFolder())
+	if(isOutboxFolder())
 	{
 		items.push_back(std::string("Delete"));
 	}
 	else
 	{
-		items.push_back(std::string("Share"));
-		if (!canShare())
+		if(isItemInTrash())
 		{
-			disabled_items.push_back(std::string("Share"));
-		}
-		items.push_back(std::string("Landmark Open"));
-		items.push_back(std::string("Properties"));
+			addTrashContextMenuOptions(items, disabled_items);
+		}	
+		else
+		{
+			items.push_back(std::string("Share"));
+			if (!canShare())
+			{
+				disabled_items.push_back(std::string("Share"));
+			}
+			items.push_back(std::string("Landmark Open"));
+			items.push_back(std::string("Properties"));
 
-		getClipboardEntries(true, items, disabled_items, flags);
-	}
+			getClipboardEntries(true, items, disabled_items, flags);
+		}
 
-	if (!isOutboxFolder())
-	{
 		items.push_back(std::string("Landmark Separator"));
 		items.push_back(std::string("About Landmark"));
 	}
@@ -4354,36 +4355,35 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	menuentry_vec_t disabled_items;
 
 	lldebugs << "LLAnimationBridge::buildContextMenu()" << llendl;
-	if(isItemInTrash())
-	{
-		addTrashContextMenuOptions(items, disabled_items);
-	}	
-	else if(isOutboxFolder())
+	if(isOutboxFolder())
 	{
 		items.push_back(std::string("Delete"));
 	}
 	else
 	{
-		items.push_back(std::string("Share"));
-		if (!canShare())
+		if(isItemInTrash())
 		{
-			disabled_items.push_back(std::string("Share"));
-		}
-		items.push_back(std::string("Animation Open"));
-		items.push_back(std::string("Properties"));
+			addTrashContextMenuOptions(items, disabled_items);
+		}	
+		else
+		{
+			items.push_back(std::string("Share"));
+			if (!canShare())
+			{
+				disabled_items.push_back(std::string("Share"));
+			}
+			items.push_back(std::string("Animation Open"));
+			items.push_back(std::string("Properties"));
 
-		getClipboardEntries(true, items, disabled_items, flags);
-	}
+			getClipboardEntries(true, items, disabled_items, flags);
+		}
 
-	if (!isOutboxFolder())
-	{
 		items.push_back(std::string("Animation Separator"));
 		items.push_back(std::string("Animation Play"));
 		items.push_back(std::string("Animation Audition"));
 	}
 
 	hide_context_entries(menu, items, disabled_items);
-
 }
 
 // virtual
@@ -5377,7 +5377,6 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		getClipboardEntries(true, items, disabled_items, flags);
 	}
 
-
 	hide_context_entries(menu, items, disabled_items);
 }
 
-- 
GitLab


From 4e92846cd5ca304537ef3105a880f0c14ba02e3c Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 13 Dec 2011 14:37:20 -0600
Subject: [PATCH 429/933] SH-1427 Fix for redundantly applying light intensity
 to deferred lights.

---
 indra/newview/pipeline.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 00acc3e5119..8449e74fb6e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7452,8 +7452,7 @@ void LLPipeline::renderDeferredLighting()
 					F32 s = volume->getLightRadius()*1.5f;
 
 					LLColor3 col = volume->getLightColor();
-					col *= volume->getLightIntensity();
-
+					
 					if (col.magVecSquared() < 0.001f)
 					{
 						continue;
@@ -7566,8 +7565,7 @@ void LLPipeline::renderDeferredLighting()
 					setupSpotLight(gDeferredSpotLightProgram, drawablep);
 					
 					LLColor3 col = volume->getLightColor();
-					col *= volume->getLightIntensity();
-
+					
 					//vertex positions are encoded so the 3 bits of their vertex index 
 					//correspond to their axis facing, with bit position 3,2,1 matching
 					//axis facing x,y,z, bit set meaning positive facing, bit clear 
@@ -7676,8 +7674,7 @@ void LLPipeline::renderDeferredLighting()
 					setupSpotLight(gDeferredMultiSpotLightProgram, drawablep);
 
 					LLColor3 col = volume->getLightColor();
-					col *= volume->getLightIntensity();
-
+					
 					gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v);
 					gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s);
 					gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
-- 
GitLab


From ac94b66a08b469b02d4cfe41341beaab0a8443ab Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 13 Dec 2011 15:58:34 -0500
Subject: [PATCH 430/933] storm-1729: ensure that cpu id has no leading or
 trailing spaces for ease of comparison and formatting

---
 indra/llcommon/llsys.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index d781687175e..19075afa688 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -608,6 +608,7 @@ LLCPUInfo::LLCPUInfo()
 		out << " (" << mCPUMHz << " MHz)";
 	}
 	mCPUString = out.str();
+	LLStringUtil::trim(mCPUString);
 }
 
 bool LLCPUInfo::hasAltivec() const
-- 
GitLab


From a96271e3c2958a95040a1348934bd3f056f374ab Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 13 Dec 2011 13:09:53 -0800
Subject: [PATCH 431/933] EXP-1716 FIX -- Merchant outbox drag and drop always
 creates new folder

* Items dragged to child folder now appear under that folder rather than in new separate top-level folder.
---
 indra/newview/llinventorybridge.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index aabe851f790..3d20b99c9be 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3461,7 +3461,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			}
 			else if (move_is_into_outbox && !move_is_from_outbox)
 			{
-				copy_item_to_outbox(inv_item, outbox_id, LLUUID::null);
+				copy_item_to_outbox(inv_item, mUUID, LLUUID::null);
 			}
 			// NORMAL or TRASH folder
 			// (move the item, restamp if into trash)
-- 
GitLab


From 0c0ff35d19969cc762dce510a4d5ee4649d96a24 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 13 Dec 2011 13:11:55 -0800
Subject: [PATCH 432/933] EXP-1551 FIX Ability to toggle button flashing added
 "EnableButtonFlashing" setting

---
 indra/llui/llbutton.cpp                 | 18 +++++++++++++-----
 indra/llui/lltabcontainer.cpp           | 13 +++++++------
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 93d8282aa74..f0d92d597a7 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -589,15 +589,23 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
 // virtual
 void LLButton::draw()
 {
+	static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true);
 	F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
 	bool flash = FALSE;
 
-	if( mFlashing )
+	if( mFlashing)
 	{
-		F32 elapsed = mFlashingTimer.getElapsedTimeF32();
-		S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f);
-		// flash on or off?
-		flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f);
+		if ( sEnableButtonFlashing)
+		{
+			F32 elapsed = mFlashingTimer.getElapsedTimeF32();
+			S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f);
+			// flash on or off?
+			flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f);
+		}
+		else
+		{ // otherwise just highlight button in flash color
+			flash = true;
+		}
 	}
 
 	bool pressed_by_keyboard = FALSE;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index d5f87073810..5fc2cc350dc 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -98,24 +98,25 @@ class LLCustomButtonIconCtrl : public LLButton
 {
 public:
 	struct Params
-	: public LLInitParam::Block<Params, LLButton::Params>
+	:	public LLInitParam::Block<Params, LLButton::Params>
 	{
 		// LEFT, RIGHT, TOP, BOTTOM paddings of LLIconCtrl in this class has same value
 		Optional<S32>					icon_ctrl_pad;
 
-		Params():
-		icon_ctrl_pad("icon_ctrl_pad", 1)
+		Params()
+		:	icon_ctrl_pad("icon_ctrl_pad", 1)
 		{}
 	};
 
 protected:
 	friend class LLUICtrlFactory;
-	LLCustomButtonIconCtrl(const Params& p):
-		LLButton(p),
+
+	LLCustomButtonIconCtrl(const Params& p)
+	:	LLButton(p),
 		mIcon(NULL),
 		mIconAlignment(LLFontGL::HCENTER),
 		mIconCtrlPad(p.icon_ctrl_pad)
-		{}
+	{}
 
 public:
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index aa8ad53a3d2..1ea623791d6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1150,6 +1150,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>EnableButtonFlashing</key>
+    <map>
+      <key>Comment</key>
+      <string>Allow UI to flash buttons to get your attention</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
     <key>ButtonHPad</key>
     <map>
       <key>Comment</key>
-- 
GitLab


From 2dc7df91ade45d8952473f7de5068e8705440e29 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 13 Dec 2011 15:23:55 -0600
Subject: [PATCH 433/933] SH-2743 Fix for shader compiler error on some GL 3.x
 implementations.

---
 indra/llrender/llshadermgr.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index ac9dc9544d5..85c4bab7a98 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -579,7 +579,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		text[count++] = strdup("#define ATTRIBUTE attribute\n");
 		text[count++] = strdup("#define VARYING varying\n");
 	}
-	else if (version < 3.f)
+	else if (version < 3.3f)
 	{
 		//set version to 1.20
 		text[count++] = strdup("#version 120\n");
-- 
GitLab


From d7fabfee19e536dd8df356fd4531437ccb3630d5 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 13 Dec 2011 13:56:41 -0800
Subject: [PATCH 434/933] EXP-1715 FIX -- Merchant outbox drag and drop has
 offset between mouse position and selected folder EXP-1717 FIX -- Drag and
 drop within the outbox can result in an item created at the top level of the
 outbox

Folders are now created for items dragged around within the merchant outbox if their drop target is the top level outbox inventory panel itself.
---
 indra/newview/llfloateroutbox.cpp      | 22 ++++++++++++++--------
 indra/newview/llinventorybridge.cpp    |  4 ++++
 indra/newview/llinventoryfunctions.cpp | 21 ++++++++++++++++++---
 indra/newview/llinventoryfunctions.h   |  1 +
 4 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index b15380d4274..eb11933368d 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -248,7 +248,7 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	mOutboxInventoryPanel->setShape(inventory_placeholder_rect);
 	
 	// Set the sort order newest to oldest
-	mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
+	mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME);	
 	mOutboxInventoryPanel->getFilter()->markDefault();
 	
 	fetchOutboxContents();
@@ -340,19 +340,25 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 										EAcceptance* accept,
 										std::string& tooltip_msg)
 {
-	// Pass drag and drop to this floater to the outbox inventory control
-
 	if ((mOutboxInventoryPanel == NULL) ||
 		(mWindowShade && mWindowShade->isShown()) ||
 		LLMarketplaceInventoryImporter::getInstance()->isImportInProgress())
 	{
 		return FALSE;
 	}
-
-	S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft;
-	S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom;
-
-	return mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+	
+	BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL);
+	
+	// Pass drag and drop to this floater to the outbox inventory control if no other children handle it
+	if (!handled)
+	{
+		S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft;
+		S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom;
+		
+		handled = mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+	}
+	
+	return handled;
 }
 
 void LLFloaterOutbox::onImportButtonClicked()
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3d20b99c9be..4bc846faebb 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3463,6 +3463,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			{
 				copy_item_to_outbox(inv_item, mUUID, LLUUID::null);
 			}
+			else if (move_is_into_outbox && move_is_from_outbox)
+			{
+				move_item_within_outbox(inv_item, mUUID);
+			}
 			// NORMAL or TRASH folder
 			// (move the item, restamp if into trash)
 			else
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 7040fef65e3..6c5325620eb 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -588,7 +588,6 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 				parent = next_parent;
 			}
 		}
-
 	}
 }
 
@@ -620,8 +619,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 				gInventory.notifyObservers();
 			}
 			
-			copy_inventory_item(
-								gAgent.getID(),
+			copy_inventory_item(gAgent.getID(),
 								inv_item->getPermissions().getOwner(),
 								inv_item->getUUID(),
 								dest_folder,
@@ -641,6 +639,23 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 	}
 }
 
+void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder)
+{
+	// when moving item directly into outbox create folder with that name
+	if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
+	{
+		dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName());
+		gInventory.notifyObservers();
+	}
+	
+	LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
+
+	change_item_parent(&gInventory,
+					   viewer_inv_item,
+					   dest_folder,
+					   false);
+}
+
 void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder)
 {
 	LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName());
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 7b452537f83..9f0ee0571a6 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -75,6 +75,7 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
 void append_path(const LLUUID& id, std::string& path);
 
 void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder);
+void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder);
 
 void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder);
 
-- 
GitLab


From d8aa31d10a89aa826cc549594c083a054a2ad967 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Tue, 13 Dec 2011 16:59:12 -0500
Subject: [PATCH 435/933] Added tag DRTVWR-103_3.2.4-release, 3.2.4-release for
 changeset bd6bcde25844

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 1392b6a8a13..c2c93097a3a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -232,3 +232,5 @@ a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
 fe3a8e7973072ea62043c08b19b66626c1a720eb DRTVWR-62_2.7.2-release
 fe3a8e7973072ea62043c08b19b66626c1a720eb 2.7.2-release
+bd6bcde2584491fd9228f1fa51c4575f4e764e19 DRTVWR-103_3.2.4-release
+bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
-- 
GitLab


From bb39e3fa3cc2cd9617d63b93bcf1d6da364cd917 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 13 Dec 2011 16:42:14 -0800
Subject: [PATCH 436/933] EXP-1718 FIX -- Drag and drop within the outbox can
 result in folders being out of order

* Outbox updates now result in a resort to keep drag and drop items and folders properly sorted
* New icon for merchant outbox
* New behavior to accept drag and drop files over the entire merchant outbox floater
---
 indra/newview/llfloateroutbox.cpp             |  38 ++++++++++++------
 indra/newview/llfolderview.cpp                |   6 +--
 .../default/textures/toolbar_icons/outbox.png | Bin 2987 -> 1521 bytes
 3 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index eb11933368d..984f47abb0b 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -158,14 +158,6 @@ void LLFloaterOutbox::onClose(bool app_quitting)
 
 void LLFloaterOutbox::onOpen(const LLSD& key)
 {
-	//
-	// Initialize the marketplace import API
-	//
-
-	LLMarketplaceInventoryImporter::getInstance()->initialize();
-	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
-	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
-	
 	//
 	// Look for an outbox and set up the inventory API
 	//
@@ -224,6 +216,7 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	{
 		gInventory.removeObserver(mCategoryAddedObserver);
 		delete mCategoryAddedObserver;
+		mCategoryAddedObserver = NULL;
 	}
 	
 	// Create observer for outbox modifications
@@ -252,6 +245,14 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	mOutboxInventoryPanel->getFilter()->markDefault();
 	
 	fetchOutboxContents();
+	
+	//
+	// Initialize the marketplace import API
+	//
+	
+	LLMarketplaceInventoryImporter::getInstance()->initialize();
+	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
+	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
 }
 
 void LLFloaterOutbox::updateItemCount()
@@ -350,12 +351,20 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 	BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL);
 	
 	// Pass drag and drop to this floater to the outbox inventory control if no other children handle it
-	if (!handled)
+	if (!handled || (*accept == ACCEPT_NO))
 	{
-		S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft;
-		S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom;
+		S32 local_x;
+		S32 local_y;
+		
+		LLFolderView * outbox_root_folder = mOutboxInventoryPanel->getRootFolder();
+		localPointToOtherView(x, y, &local_x, &local_y, outbox_root_folder);
 		
-		handled = mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+		const LLRect& outbox_rect = outbox_root_folder->getRect();
+
+		local_x = llclamp(local_x, outbox_rect.mLeft + 1, outbox_rect.mRight - 1);
+		local_y = llclamp(local_y, outbox_rect.mBottom + 1, outbox_rect.mTop - 1);
+
+		handled = outbox_root_folder->LLFolderViewFolder::handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 	}
 	
 	return handled;
@@ -371,6 +380,11 @@ void LLFloaterOutbox::onImportButtonClicked()
 void LLFloaterOutbox::onOutboxChanged()
 {
 	llassert(!mOutboxId.isNull());
+	
+	if (mOutboxInventoryPanel)
+	{
+		mOutboxInventoryPanel->requestSort();
+	}
 
 	fetchOutboxContents();
 	updateView();
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 6ec2598e447..b8515c2953a 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1945,9 +1945,9 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 	if (!handled)
 	{
 		if (getListener()->getUUID().notNull())
-	{
-		handled = LLFolderViewFolder::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
-	}
+		{
+			handled = LLFolderViewFolder::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+		}
 		else
 		{
 			if (!mFolders.empty())
diff --git a/indra/newview/skins/default/textures/toolbar_icons/outbox.png b/indra/newview/skins/default/textures/toolbar_icons/outbox.png
index 9fcf46794d1374c08e3b0407515867289a6c3f90..0f3db1c47c7861a8eb6e4337fde23357b17be16d 100644
GIT binary patch
delta 1518
zcmV<K1rhqI7x4>!iBL{Q4GJ0x0000DNk~Le0000I0000I2nGNE09MY9R{#J4?rB3q
zP)S2WAW(8|W@&6?004Lag;dXL6G0UIHg2iVA_!V*4zhTVB1u`RXhqaE{Sjho4BH>J
zMUZ4ON!D&Q>+UACrHJI>(JJ0W?V$(%fF64AWG_mET16;--m55Lp%*Rj&2CJ#rRu=W
ze)HZp?|pA}-vAAA(lqse1mq3JQlb%QY<xm${D=UKq6tAXB~{z(P9z3FgLC<N=h%7=
zfm>F?d;52?cdeSzwweco{XpPHn%OF_?-y|jSrP(>Jl~-y$8-qa<Jj`-k2y|xc)_&~
zD?P+nB78u9H7(A6O}JCdCDTBINH~=BaZ)~<*Nc?b9S3P{X2!@6y-$#)yUgyZVxgQ)
z_70G}o%DWAv)(?!A;Jq8tv^P%jh^+4)j#54;iTrohCLh@HT3vk6}K9x_%*^5Ul2_v
zqEvC&E)DURuKiZ>N`i2ZILc&UfOA?%PuEOt__~LG1$`#h6R+ZTR#D-3j}vF!)ZOnz
z+5)dI4jl{{44Mr{P!L4~VVJN`K!!XTF*LGrKO?IK8<Tr7btG!LbYeuYL3=jbJ-1P$
z-8}v%B5{;MwFr{@LH;VQ$xr2Z`O93e*jD$Ht(%&<^58qg<(at}9@o>z<8w`3e3jI8
zlUGN7maKVtyqfG9KkQeRG3J6bkHmAZ`|&MbmCTnZj1<M=RrBgggmqdmH{YLZe>*+m
zF3&Et)^n|ii#JxAmuLNINc--pyp!ft`A=T;@%(4a#AD(qF(!73=OKxg#V+xZ*h{Mm
z;$UsZ2%VLNDbj6``Xtq0V4A%3FI_)dc)dn{e+>0elo`y@REhV0!YX7mow*Kg`j6Yk
z{1@c+iszpw0xxXf$eFrrQ*rMQp=G6RbFKmxztMg0wr*>qemMLDSUjs1tx`3gAiMz_
zc87W%=qZ@fmX^&qQim*`le+23Vp7ad+e1=P*Cp3wOBS=4RbuIO*qPHEZXBUGLifZW
zr%Gj$`mga3u>G)7`T49;*?vwM)`6G$Z@|3$MZkEAiIE`}e*&pVL_t(I5tUR+t5Q)E
zKIiyIvCu0bf(DM{3L>|_21(#Rn)DYg&YL$6l5iG54I)Sp<01&rL}w;y*2Fj<WS~MA
zKJYOy-;Z-n-#S-KMF)4mX79b$cfP&WxA!`%BuUKLSj;rYA+a#>BQCFL+Qi6zXe<B<
zI0>{m44&94f8nRYgxxq1ZTEs8TrQW(%lUjh;9x{AiISjDD9*H6?RU&U;CBf&Su(_a
zfuUQiR*#fQWvJ8XREou7UZ>ODrW2;q>CA4o>s&6^^M1d7cQ%`S)Mzv#gm?_9;+hOu
zbaBeouoq|}ilRK$YuUF2VZrnK6HKHbM>7XT69$vdf9IpQT<!yv1TF?d1Y(F6x^tCE
zB@>IqULx}$;p_GK<8rzD080^rB{o?k5b*$o2?UdU>yW%|wOY+UAn+FD-ys0X)0#}C
z_sL}PA>q08Ei)F2MeB4r=?0G)#3s!k+4Na9oBfnZrGD!5dY8xJdE<7w&q!?9kc~JR
zjYznoe}+;?*jvcNhXY-~VDO$wrIO5M^Zj@{{*E--8q)s%7Pj8K1;rPrLc}xCfLyMi
z-EN!ri1t1?*pT2vg6sbZ;rU1;@|06>e`~c`)$jL5x237oY7VKM)CeRiXkmm_ue@F_
zV=x%X?N<ADC=~jP*cT$A>*K1`>d@hE^ldiVf2P0S#&xW(Zaf}OOQli^t|o>RcpZE%
z!r^cekUuhzz>P*Dvsf&mv_59NUhmgnFnEpFgyM-rg4%`2WHK6>mAI`R5bnZiwfb-p
zGnq^_&z`mn{R4oLj7H-*-s(9tl5o3o=p^@?&*z&#KbF0^x-u0C1uyzYjiwaPV@i72
zM7st*9U!8aMGz{w-7cF>r`yBf@Efv`!F%1m`|(ZJBsM+5lMnF}A&NmV*X>1^f3lCY
UJV$j)g#Z8m07*qoM6N<$f_a1I?*IS*

literal 2987
zcmV;c3sm%pP)<h;3K|Lk000e1NJLTq000dD000UI1^@s6Z|>B@00009a7bBm000XU
z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag
z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V
z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H
zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T
zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j
zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i
z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf
z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G
zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u
zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm
z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v
zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo
z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t
z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl
zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_
zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0
zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O
zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p
z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc=
zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ
zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h
z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z0002iNkl<Zc-oARQ4Iny42HiF1WW-NIRqeqbASUh-~bdLft&+S065q?kQ*3a4$8yz
z$YmjfCC%1uf4{$zTWU{$16<|9lz*10qN?0d`?{uf-sit!JkTEmPWR^{s%iibND59M
zC`9SrEk*;;5y;iV*8+_|Q~6K}tbsW5p$4`<5>@@E?vL~WA`q;UY~EmX2jo#P;=wK(
zjD(Twd<HHhX$kC%0B`|3u&_oeU|WhD&|A!3K05>J(%#<oxl#H+JK7S#jSEp{ONiAZ
hY=*X_6J?P69smXJZ~w^)%1r<O002ovPDHLkV1h^xhL->U

-- 
GitLab


From bff737ebefdfeeb17a81e1c3c4741d3e9aab2862 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 13 Dec 2011 17:03:25 -0800
Subject: [PATCH 437/933] EXP-1724 FIX -- Merchant outbox needs to be available
 from the Me menu

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1834be2d48c..3c98f8e8925 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -164,11 +164,18 @@
       <menu_item_separator/>
 
       <menu_item_call
-         label="Buy L$"
+         label="Buy L$..."
          name="Buy and Sell L$">
         <menu_item_call.on_click
          function="BuyCurrency" />
       </menu_item_call>
+      <menu_item_call
+         label="Merchant Outbox..."
+         name="MerchantOutbox">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="outbox" />
+      </menu_item_call>
       <menu_item_call
            label="Account dashboard..."
            name="Manage My Account">
-- 
GitLab


From 82f043c3338fdcf35e42dbe2ed512eb39808b90e Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 14 Dec 2011 15:26:13 +0200
Subject: [PATCH 438/933] EXP-1639 FIXED Fixed a resolution rounding error.

The error sometimes led to the following issues with maximized viewer window on MS Windows:
* displaying incorrect resolution
* failure to update snapshot
---
 indra/newview/llfloatersnapshot.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 13f544e7849..b7145d43f64 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -333,8 +333,7 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
 	{
 		S32 old_image_index = mCurImageIndex;
 		mCurImageIndex = (mCurImageIndex + 1) % 2; 
-		setWidth(mWidth[old_image_index]);
-		setHeight(mHeight[old_image_index]);
+		setSize(mWidth[old_image_index], mHeight[old_image_index]);
 		mFallAnimTimer.start();		
 	}
 	mSnapshotUpToDate = FALSE; 		
@@ -1447,7 +1446,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 
 	if (previewp)
 	{
-		lldebugs << "Setting snapshot type (" << shot_type << "), format (" << shot_format << ")" << llendl;
 		previewp->setSnapshotType(shot_type);
 		previewp->setSnapshotFormat(shot_format);
 		previewp->setSnapshotBufferType(layer_type);
@@ -1460,6 +1458,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 		info["have-snapshot"] = got_snap;
 		current_panel->updateControls(info);
 	}
+	lldebugs << "finished updating controls" << llendl;
 }
 
 // static
@@ -1696,6 +1695,7 @@ void LLFloaterSnapshot::Impl::setFinished(LLFloaterSnapshot* floater, bool finis
 	}
 }
 
+// Apply a new resolution selected from the given combobox.
 // static
 void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update)
 {
@@ -1864,11 +1864,11 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3
 		//change another value proportionally
 		if(isWidthChanged)
 		{
-			height = (S32)(width / aspect_ratio) ;
+			height = llround(width / aspect_ratio) ;
 		}
 		else
 		{
-			width = (S32)(height * aspect_ratio) ;
+			width = llround(height * aspect_ratio) ;
 		}
 
 		//bound w/h by the max_value
-- 
GitLab


From 6cefa466361e37df8082f86a21a954199fbf14a4 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 14 Dec 2011 17:12:40 +0200
Subject: [PATCH 439/933] EXP-1635 FIXED Made it clear that inventory snapshots
 are limited to 512x512 px.

---
 indra/newview/llfloatersnapshot.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index b7145d43f64..6532a27b9d3 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -832,7 +832,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 				previewp->mPreviewImage->getHeight(),
 				previewp->mPreviewImage->getComponents());
 		
-			scaled->biasedScaleToPowerOfTwo(512);
+			scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
 			previewp->setImageScaled(TRUE);
 			if (formatted->encode(scaled, 0.f))
 			{
@@ -959,7 +959,7 @@ void LLSnapshotLivePreview::saveTexture()
 												  mPreviewImage->getHeight(),
 												  mPreviewImage->getComponents());
 	
-	scaled->biasedScaleToPowerOfTwo(512);
+	scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
 	lldebugs << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << llendl;
 
 	if (formatted->encode(scaled, 0.0f))
@@ -1738,6 +1738,13 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 				lldebugs << "Loading typed res from panel " << spanel->getName() << llendl;
 				new_width = spanel->getTypedPreviewWidth();
 				new_height = spanel->getTypedPreviewHeight();
+
+				// Limit custom size for inventory snapshots to 512x512 px.
+				if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
+				{
+					new_width = llmin(new_width, MAX_TEXTURE_SIZE);
+					new_height = llmin(new_height, MAX_TEXTURE_SIZE);
+				}
 			}
 			else
 			{
-- 
GitLab


From eb7b43fb558d66eb08b7a06ffdd578bfe94e5eb8 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 14 Dec 2011 13:21:48 -0500
Subject: [PATCH 440/933] STORM-1733 Menu entry Release Keys is in
 Advanced->Shortcuts sub-menu but has no shortcut

---
 doc/contributions.txt                         |  1 +
 .../skins/default/xui/en/menu_viewer.xml      | 24 +++++++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..203f7d7f9f9 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	STORM-1733
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1834be2d48c..0aa5c72f2a5 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1713,7 +1713,17 @@
              function="ToggleControl"
              parameter="MouseSmooth" />
         </menu_item_check>
-
+            <menu_item_call
+             enabled="false"
+             label="Release Keys"
+             name="Release Keys">
+                <menu_item_call.on_click
+                 function="Tools.ReleaseKeys"
+                 parameter="" />
+                <menu_item_call.on_enable
+                 function="Tools.EnableReleaseKeys"
+                 parameter="" />
+            </menu_item_call>
         <menu_item_separator/>
 
         <menu
@@ -1743,17 +1753,7 @@
              function="Floater.Toggle"
              parameter="search" />
             </menu_item_check>
-            <menu_item_call
-             enabled="false"
-             label="Release Keys"
-             name="Release Keys">
-                <menu_item_call.on_click
-                 function="Tools.ReleaseKeys"
-                 parameter="" />
-                <menu_item_call.on_enable
-                 function="Tools.EnableReleaseKeys"
-                 parameter="" />
-            </menu_item_call>
+
             <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
             <menu_item_check
                label="Show Advanced Menu - legacy shortcut"
-- 
GitLab


From fdc223287ce25ffcb8a43936633eac2eac19b728 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 14 Dec 2011 13:58:46 -0500
Subject: [PATCH 441/933] STORM-1734 Update contributions.txt with Storm jira
 number

---
 doc/contributions.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 6a99c5787ee..d2a73dfd229 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,7 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
-	VWR-27832
+	STORM-1734
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
-- 
GitLab


From 1e0f11df87b9a612e58d53b5d5617d8112917b56 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 14 Dec 2011 13:52:43 -0800
Subject: [PATCH 442/933] sync with viewer-development

---
 indra/newview/skins/default/xui/en/floater_snapshot.xml       | 4 ++--
 .../newview/skins/default/xui/en/panel_postcard_settings.xml  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index e71b714f257..0c38283d597 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -34,7 +34,7 @@
     </string>
  	<string
  	 name="profile_succeeded_str">
- 	    Profile feed updated!
+ 	    Image uploaded
  	</string>
  	<string
  	 name="postcard_succeeded_str">
@@ -50,7 +50,7 @@
  	</string>
  	<string
  	 name="profile_failed_str">
- 	    Failed to update your Profile Feed.
+ 	    Failed to upload image to your Profile Feed.
  	</string>
  	<string
  	 name="postcard_failed_str">
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index aebbc51be1f..2e0bb88f530 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -113,11 +113,11 @@
              label="Image quality"
              label_width="80"
              layout="topleft"
-             left="10"
+             left="0"
              max_val="100"
              name="image_quality_slider"
              top_pad="7"
-             width="200" />
+             width="190" />
             <text
              type="string"
              follows="left|top"
-- 
GitLab


From 399f8dd1913530488744046794a74d6c7e61ffa3 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 14 Dec 2011 14:37:38 -0800
Subject: [PATCH 443/933] EXP-1723 -- Improved drag and drop behavior for
 outbox floater.

---
 indra/newview/llfloateroutbox.cpp   | 36 +++++++++++++-------
 indra/newview/llfolderviewitem.cpp  | 52 +++++++++++++++++------------
 indra/newview/llfolderviewitem.h    |  5 +++
 indra/newview/llinventorybridge.cpp | 10 +-----
 indra/newview/llinventorybridge.h   |  2 --
 5 files changed, 61 insertions(+), 44 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 984f47abb0b..725e521e58c 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -30,6 +30,7 @@
 
 #include "llfloaterreg.h"
 #include "llfolderview.h"
+#include "llinventorybridge.h"
 #include "llinventorymodelbackgroundfetch.h"
 #include "llinventoryobserver.h"
 #include "llinventorypanel.h"
@@ -348,23 +349,34 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 		return FALSE;
 	}
 	
-	BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL);
+	LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+	BOOL handled = (handled_view != NULL);
 	
-	// Pass drag and drop to this floater to the outbox inventory control if no other children handle it
+	// Pass all drag and drop for this floater to the outbox inventory control
 	if (!handled || (*accept == ACCEPT_NO))
 	{
-		S32 local_x;
-		S32 local_y;
+		// Always assume we are going to move the drag and drop operation to the outbox root folder
+		bool move_to_root = true;
 		
-		LLFolderView * outbox_root_folder = mOutboxInventoryPanel->getRootFolder();
-		localPointToOtherView(x, y, &local_x, &local_y, outbox_root_folder);
-		
-		const LLRect& outbox_rect = outbox_root_folder->getRect();
-
-		local_x = llclamp(local_x, outbox_rect.mLeft + 1, outbox_rect.mRight - 1);
-		local_y = llclamp(local_y, outbox_rect.mBottom + 1, outbox_rect.mTop - 1);
+		// If the inventory panel is visible, then only override it to the outbox root if we're outside the inventory panel
+		// (otherwise the inventory panel itself will handle the drag and drop operation, without any override)
+		if (mOutboxInventoryPanel->getVisible())
+		{
+			S32 inv_x, inv_y;
+			localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel);
+			
+			const LLRect& inv_rect = mOutboxInventoryPanel->getRect();
 
-		handled = outbox_root_folder->LLFolderViewFolder::handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+			move_to_root = !inv_rect.pointInRect(inv_x, inv_y);
+		}
+		
+		// Handle the drag and drop directly to the root of the outbox
+		if (move_to_root)
+		{
+			LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder();
+			
+			handled = root_folder->handleDragAndDropToRoot(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+		}
 	}
 	
 	return handled;
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index f27fd035dbc..526800d4bef 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -2276,33 +2276,16 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask,
 										   EAcceptance* accept,
 										   std::string& tooltip_msg)
 {
-	LLFolderView* root_view = getRoot();
-
 	BOOL handled = FALSE;
-	if(mIsOpen)
+
+	if (mIsOpen)
 	{
-		handled = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type,
-			cargo_data, accept, tooltip_msg) != NULL;
+		handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL);
 	}
 
 	if (!handled)
 	{
-		BOOL accepted = mListener && mListener->dragOrDrop(mask, drop,cargo_type,cargo_data, tooltip_msg);
-
-		if (accepted) 
-		{
-			mDragAndDropTarget = TRUE;
-			*accept = ACCEPT_YES_MULTI;
-		}
-		else 
-		{
-			*accept = ACCEPT_NO;
-		}
-
-		if (!drop && accepted)
-		{
-			root_view->autoOpenTest(this);
-		}
+		handleDragAndDropToRoot(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 
 		lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFolderViewFolder" << llendl;
 	}
@@ -2310,6 +2293,33 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask,
 	return TRUE;
 }
 
+BOOL LLFolderViewFolder::handleDragAndDropToRoot(MASK mask,
+												 BOOL drop,
+												 EDragAndDropType cargo_type,
+												 void* cargo_data,
+												 EAcceptance* accept,
+												 std::string& tooltip_msg)
+{
+	BOOL accepted = mListener && mListener->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg);
+	
+	if (accepted) 
+	{
+		mDragAndDropTarget = TRUE;
+		*accept = ACCEPT_YES_MULTI;
+	}
+	else 
+	{
+		*accept = ACCEPT_NO;
+	}
+	
+	if (!drop && accepted)
+	{
+		getRoot()->autoOpenTest(this);
+	}
+	
+	return TRUE;
+}
+
 
 BOOL LLFolderViewFolder::handleRightMouseDown( S32 x, S32 y, MASK mask )
 {
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 3433e3f7f3a..02461fb1444 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -547,6 +547,11 @@ class LLFolderViewFolder : public LLFolderViewItem
 		void* cargo_data,
 		EAcceptance* accept,
 		std::string& tooltip_msg);
+	BOOL handleDragAndDropToRoot(MASK mask, BOOL drop,
+								 EDragAndDropType cargo_type,
+								 void* cargo_data,
+								 EAcceptance* accept,
+								 std::string& tooltip_msg);
 	virtual void draw();
 
 	time_t getCreationDate() const;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 4bc846faebb..d6b520d75ed 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1820,14 +1820,6 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m
 }
 
 
-
-void LLFolderBridge::dropFolderToOutbox(LLInventoryCategory* inv_cat)
-{
-	copy_folder_to_outbox(inv_cat, getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false), inv_cat->getUUID());	
-}
-
-
-
 int get_folder_levels(LLInventoryCategory* inv_cat)
 {
 	LLInventoryModel::cat_array_t* cats;
@@ -2046,7 +2038,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else if (move_is_into_outbox && !move_is_from_outbox)
 			{
-				dropFolderToOutbox(inv_cat);
+				copy_folder_to_outbox(inv_cat, mUUID, inv_cat->getUUID());
 			}
 			else
 			{
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 2d625befb4c..126a28f74c9 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -306,8 +306,6 @@ class LLFolderBridge : public LLInvFVBridge
 
 	void dropToFavorites(LLInventoryItem* inv_item);
 	void dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
-	void dropToOutbox(LLInventoryItem* inv_item);
-	void dropFolderToOutbox(LLInventoryCategory* inv_cat);
 
 	//--------------------------------------------------------------------
 	// Messy hacks for handling folder options
-- 
GitLab


From d39b276b3c1b664c9cdec1c3bb06f83ce53476de Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 14 Dec 2011 14:38:28 -0800
Subject: [PATCH 444/933] FIX VWR-22392

---
 indra/newview/skins/default/xui/da/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/de/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/es/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/fr/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/it/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/ja/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/pl/menu_viewer.xml | 1 +
 indra/newview/skins/default/xui/pt/menu_viewer.xml | 1 +
 8 files changed, 8 insertions(+)

diff --git a/indra/newview/skins/default/xui/da/menu_viewer.xml b/indra/newview/skins/default/xui/da/menu_viewer.xml
index c2f7d26dc97..ba183066865 100644
--- a/indra/newview/skins/default/xui/da/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/da/menu_viewer.xml
@@ -121,6 +121,7 @@
 			<menu_item_call label="Model..." name="Upload Model"/>
 			<menu_item_call label="Model Wizard..." name="Upload Model Wizard"/>
 			<menu_item_call label="Mange (L$[COST] pr. fil)..." name="Bulk Upload"/>
+			<menu_item_call label="Sæt standardværdier for upload rettigheder" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Fortyd" name="Undo"/>
 		<menu_item_call label="Gendan" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index e6135aa100a..90b2cfbc41d 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -140,6 +140,7 @@
 			<menu_item_call label="Animation ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modell..." name="Upload Model"/>
 			<menu_item_call label="Mehrfach-Upload ([COST] L$ pro Datei)..." name="Bulk Upload"/>
+			<menu_item_call label="Hochlade-Berechtigungen (Standard) festlegen" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Rückgängig" name="Undo"/>
 		<menu_item_call label="Wiederholen" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index 0714e7f2c6b..f5cc2b9389e 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -140,6 +140,7 @@
 			<menu_item_call label="Animación ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modelo..." name="Upload Model"/>
 			<menu_item_call label="Masivo ([COST] L$ por archivo)..." name="Bulk Upload"/>
+			<menu_item_call label="Configurar los permisos por defecto de subida" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Deshacer" name="Undo"/>
 		<menu_item_call label="Rehacer" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index e2cb1f999d4..d3b48639e02 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -140,6 +140,7 @@
 			<menu_item_call label="Animation ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modèle..." name="Upload Model"/>
 			<menu_item_call label="Lot ([COST] L$ par fichier)..." name="Bulk Upload"/>
+			<menu_item_call label="Définir les droits de chargement par défaut" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Annuler" name="Undo"/>
 		<menu_item_call label="Refaire" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index 815f6f58ed7..8792a0fc195 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -140,6 +140,7 @@
 			<menu_item_call label="Animazione ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modella..." name="Upload Model"/>
 			<menu_item_call label="In blocco ([COST] L$ per file)..." name="Bulk Upload"/>
+			<menu_item_call label="Definisci diritti di caricamento predefiniti" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Annulla" name="Undo"/>
 		<menu_item_call label="Ripeti" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index b9dbb81c0ad..125e9bb2267 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -140,6 +140,7 @@
 			<menu_item_call label="アニメーション(L$[COST])..." name="Upload Animation"/>
 			<menu_item_call label="モデル" name="Upload Model"/>
 			<menu_item_call label="一括 (ファイルにつきL$[COST])..." name="Bulk Upload"/>
+			<menu_item_call label="デフォルトのアップロード権限を設定" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="元に戻す" name="Undo"/>
 		<menu_item_call label="やり直し" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml
index fe4662c5a24..c072ea9b5af 100644
--- a/indra/newview/skins/default/xui/pl/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml
@@ -119,6 +119,7 @@
 			<menu_item_call label="dźwięk (L$[COST])..." name="Upload Sound"/>
 			<menu_item_call label="animacjÄ™ (L$[COST])..." name="Upload Animation"/>
 			<menu_item_call label="zbiór plików (L$[COST] za jeden plik)..." name="Bulk Upload"/>
+			<menu_item_call label="Ustaw domyślne pozwolenia ładowania" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Cofnij" name="Undo"/>
 		<menu_item_call label="Ponów" name="Redo"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index 9b5711d4028..4ee96239659 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -140,6 +140,7 @@
 			<menu_item_call label="Animação (L$[COST])..." name="Upload Animation"/>
 			<menu_item_call label="Modelar..." name="Upload Model"/>
 			<menu_item_call label="Volume (L$[COST] por arquivo)..." name="Bulk Upload"/>
+			<menu_item_call label="Autorizações de upload padrão" name="perm prefs"/>
 		</menu>
 		<menu_item_call label="Desfazer" name="Undo"/>
 		<menu_item_call label="Repetir" name="Redo"/>
-- 
GitLab


From 821c964230ffc17ebf94f2d6af31eed226110267 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 14 Dec 2011 17:44:10 -0500
Subject: [PATCH 445/933] STORM-1736 Cropped buttons in the bottom of the
 Ad-hoc floater

---
 doc/contributions.txt                                       | 1 +
 indra/newview/skins/default/xui/en/floater_im_session.xml   | 2 +-
 .../skins/default/xui/en/panel_adhoc_control_panel.xml      | 6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..12eeab06280 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	STORM-1736
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 5fe8f3c1147..a2739a8339f 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -3,7 +3,7 @@
  legacy_header_height="18"
  background_visible="true"
  default_tab_group="1"
- height="350"
+ height="355"
  help_topic="floater_im_box"
  layout="topleft"
  name="panel_im"
diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
index e70abc0975e..93cafd4a53e 100644
--- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
@@ -58,7 +58,7 @@
              label="Call"
              name="call_btn"
              width="130"
-             top="5" />
+             top="0" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -75,7 +75,7 @@
              height="20"
              label="Leave Call"
              name="end_call_btn"
-             top="5"/>
+             top="0"/>
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -92,7 +92,7 @@
              height="20"
              label="Voice Controls"
              name="voice_ctrls_btn"
-             top="5"
+             top="0"
              use_ellipses="true" />
         </layout_panel>
     </layout_stack>
-- 
GitLab


From 190b9985c6eee3b515f1bfa0fef28478f3d3ad46 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 14 Dec 2011 14:57:34 -0800
Subject: [PATCH 446/933] FIX VWR-22449

---
 indra/newview/skins/default/xui/es/floater_buy_land.xml    | 2 +-
 indra/newview/skins/default/xui/es/panel_region_estate.xml | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/skins/default/xui/es/floater_buy_land.xml b/indra/newview/skins/default/xui/es/floater_buy_land.xml
index 9d33b69de9f..005fe90318a 100644
--- a/indra/newview/skins/default/xui/es/floater_buy_land.xml
+++ b/indra/newview/skins/default/xui/es/floater_buy_land.xml
@@ -160,7 +160,7 @@ para cubrir esta parcela.
 		Podrá o no unirse o dividirse.
 	</text>
 	<text name="covenant_text">
-		Debes aceptar el Contrato del Estado:
+		Debes aceptar el Contrato del estado:
 	</text>
 	<text left="470" name="covenant_timestamp_text"/>
 	<text_editor name="covenant_editor">
diff --git a/indra/newview/skins/default/xui/es/panel_region_estate.xml b/indra/newview/skins/default/xui/es/panel_region_estate.xml
index c51c3815d11..3d0de4f083d 100644
--- a/indra/newview/skins/default/xui/es/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_estate.xml
@@ -10,7 +10,7 @@
 		(desconocido)
 	</text>
 	<text name="owner_text">
-		Propietario del Estado:
+		Propietario del estado:
 	</text>
 	<text name="estate_owner">
 		(desconocido)
@@ -39,7 +39,7 @@
 	</string>
 	<button label="?" name="abuse_email_address_help"/>
 	<button label="Aplicar" name="apply_btn"/>
-	<button label="Expulsar a un Residente del Estado..." name="kick_user_from_estate_btn"/>
+	<button label="Expulsar a un Residente del estado..." name="kick_user_from_estate_btn"/>
 	<button label="Enviar un mensaje al estado..." name="message_estate_btn"/>
 	<text name="estate_manager_label">
 		Administradores del estado:
-- 
GitLab


From 0c5c88ff674d59a46712a7313a1b5a00d225326d Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 14 Dec 2011 15:18:59 -0800
Subject: [PATCH 447/933] FIX VWR-23635

---
 indra/newview/skins/default/xui/pt/inspect_avatar.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/pt/inspect_avatar.xml b/indra/newview/skins/default/xui/pt/inspect_avatar.xml
index a199c58c152..19244d9b279 100644
--- a/indra/newview/skins/default/xui/pt/inspect_avatar.xml
+++ b/indra/newview/skins/default/xui/pt/inspect_avatar.xml
@@ -5,10 +5,10 @@
 -->
 <floater name="inspect_avatar">
 	<string name="Subtitle">
-		[IDADE]
+		[AGE]
 	</string>
 	<string name="Details">
-		[PERFIL_SL]
+		[SL_PROFILE]
 	</string>
 	<text name="user_details">
 		This is my second life description and I really think it is great. But for some reason my description is super extra long because I like to talk a whole lot
-- 
GitLab


From 9fa68f0da363cd3c20dbb079f5d2901a45dfea5f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 14 Dec 2011 17:55:36 -0600
Subject: [PATCH 448/933] SH-2743 Fix for shader compiler error on some GL 3.x
 implementations.

---
 indra/llrender/llglslshader.cpp                |  2 +-
 indra/llrender/llglslshader.h                  |  1 +
 indra/llrender/llshadermgr.cpp                 | 18 ++++++++++++------
 .../shaders/class1/deferred/alphaSkinnedV.glsl |  3 ---
 indra/newview/llviewershadermgr.cpp            |  5 ++++-
 5 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 5a6f3d8292c..6b2852670a4 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -66,7 +66,7 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2)
 LLShaderFeatures::LLShaderFeatures()
 : calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false),
 hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false),
-hasGamma(false), hasLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false),
+hasGamma(false), hasLighting(false), isAlphaLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false),
 hasAlphaMask(false)
 {
 }
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 2a6c050eac9..00b4b0dbd40 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -36,6 +36,7 @@ class LLShaderFeatures
 	bool calculatesLighting;
 	bool calculatesAtmospherics;
 	bool hasLighting; // implies no transport (it's possible to have neither though)
+	bool isAlphaLighting; // indicates lighting shaders need not be linked in (lighting performed directly in alpha shader to match deferred lighting functions)
 	bool isShiny;
 	bool isFullbright; // implies no lighting
 	bool isSpecular;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 85c4bab7a98..1a03aeebb7d 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -107,10 +107,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 			{
 				return FALSE;
 			}
-			
-			if (!shader->attachObject("lighting/sumLightsSpecularV.glsl"))
+		
+			if (!features->isAlphaLighting)
 			{
-				return FALSE;
+				if (!shader->attachObject("lighting/sumLightsSpecularV.glsl"))
+				{
+					return FALSE;
+				}
 			}
 			
 			if (!shader->attachObject("lighting/lightSpecularV.glsl"))
@@ -125,9 +128,12 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				return FALSE;
 			}
 			
-			if (!shader->attachObject("lighting/sumLightsV.glsl"))
+			if (!features->isAlphaLighting)
 			{
-				return FALSE;
+				if (!shader->attachObject("lighting/sumLightsV.glsl"))
+				{
+					return FALSE;
+				}
 			}
 			
 			if (!shader->attachObject("lighting/lightV.glsl"))
@@ -296,7 +302,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 				}
 				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
-		}		
+		}
 	}
 	
 	// NOTE order of shader object attaching is VERY IMPORTANT!!!
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index b09441f7eb9..0170ad4b55f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -30,7 +30,6 @@ ATTRIBUTE vec3 normal;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 mat4 getObjectSkinnedTransform();
 void calcAtmospherics(vec3 inPositionEye);
 
@@ -38,8 +37,6 @@ float calcDirectionalLight(vec3 n, vec3 l);
 
 vec3 atmosAmbient(vec3 light);
 vec3 atmosAffectDirectionalLight(float lightIntensity);
-vec3 scaleDownLight(vec3 light);
-vec3 scaleUpLight(vec3 light);
 
 VARYING vec3 vary_position;
 VARYING vec3 vary_ambient;
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index bddc07b395c..5de363e03cc 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1103,11 +1103,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	{
 		gDeferredSkinnedAlphaProgram.mName = "Deferred Skinned Alpha Shader";
 		gDeferredSkinnedAlphaProgram.mFeatures.hasObjectSkinning = true;
-		gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.calculatesAtmospherics = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.hasGamma = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.hasAtmospherics = true;
+		gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true;
+		gDeferredSkinnedAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.disableTextureIndex = true;
 		gDeferredSkinnedAlphaProgram.mShaderFiles.clear();
 		gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
@@ -1235,6 +1236,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAlphaProgram.mFeatures.hasGamma = true;
 		gDeferredAlphaProgram.mFeatures.hasAtmospherics = true;
 		gDeferredAlphaProgram.mFeatures.hasLighting = true;
+		gDeferredAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels
 		if (mVertexShaderLevel[SHADER_DEFERRED] < 1)
 		{
@@ -1398,6 +1400,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarAlphaProgram.mFeatures.hasGamma = true;
 		gDeferredAvatarAlphaProgram.mFeatures.hasAtmospherics = true;
 		gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true;
+		gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true;
 		gDeferredAvatarAlphaProgram.mShaderFiles.clear();
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB));
-- 
GitLab


From 6d520dcc1c92118a96f3968dd5ae8114ca282bce Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 14 Dec 2011 16:54:21 -0800
Subject: [PATCH 449/933] WIP VWR-23642

---
 indra/newview/skins/default/xui/pt/menu_viewer.xml | 8 ++++----
 indra/newview/skins/default/xui/pt/strings.xml     | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index 4ee96239659..5ff2d49ac1a 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -96,7 +96,7 @@
 		</menu>
 		<menu_item_call label="Link" name="Link"/>
 		<menu_item_call label="Desconectar links" name="Unlink"/>
-		<menu_item_check label="Edit Linked Parts" name="Edit Linked Parts"/>
+		<menu_item_check label="Editar partes linkadas" name="Edit Linked Parts"/>
 		<menu label="Selecionar partes conectadas" name="Select Linked Parts">
 			<menu_item_call label="Selecionar próxima parte" name="Select Next Part"/>
 			<menu_item_call label="Selecionar parte anterior" name="Select Previous Part"/>
@@ -110,7 +110,7 @@
 			<menu_item_call label="Pegar" name="Menu Object Take"/>
 			<menu_item_call label="Pegar uma cópia" name="Take Copy"/>
 			<menu_item_call label="Salvar no meu inventário" name="Save Object Back to My Inventory"/>
-			<menu_item_call label="Save Back to Object Contents" name="Save Object Back to Object Contents"/>
+			<menu_item_call label="Salvar objeto de volta aos conteúdos do objeto" name="Save Object Back to Object Contents"/>
 			<menu_item_call label="Devolver objeto" name="Return Object back to Owner"/>
 		</menu>
 		<menu label="Scripts" name="Scripts">
@@ -166,7 +166,7 @@
 		</menu>
 		<menu label="Realces e visibilidade" name="Highlighting and Visibility">
 			<menu_item_check label="Efeito baliza piscando" name="Cheesy Beacon"/>
-			<menu_item_check label="Hide Particles" name="Hide Particles"/>
+			<menu_item_check label="Esconder partículas" name="Hide Particles"/>
 			<menu_item_check label="Ocultar seleções" name="Hide Selected"/>
 			<menu_item_check label="Realçar transparentes" name="Highlight Transparent"/>
 			<menu_item_check label="Mostrar anexos HUD" name="Show HUD Attachments"/>
@@ -184,7 +184,7 @@
 			<menu_item_check label="Volume" name="Volume"/>
 			<menu_item_check label="Grama" name="Grass"/>
 			<menu_item_check label="Nuvens" name="Clouds"/>
-			<menu_item_check label="Particles" name="Particles"/>
+			<menu_item_check label="Partículas" name="Particles"/>
 			<menu_item_check label="Elevação" name="Bump"/>
 		</menu>
 		<menu label="Recursos de renderização" name="Rendering Features">
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 4535c7aaebd..6b4835e8193 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -3886,16 +3886,16 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		[NAME] lhe pagou L$ [AMOUNT]
 	</string>
 	<string name="you_paid_ldollars">
-		You pagou L$[AMOUNT] por [REASON] a [NAME].
+		Você pagou L$[AMOUNT] por [REASON] a [NAME].
 	</string>
 	<string name="you_paid_ldollars_no_info">
 		Você acaba de pagar L$[AMOUNT].
 	</string>
 	<string name="you_paid_ldollars_no_reason">
-		You pagou L$[AMOUNT] a [NAME].
+		Você pagou L$[AMOUNT] a [NAME].
 	</string>
 	<string name="you_paid_ldollars_no_name">
-		You pagou L$[AMOUNT] por [REASON].
+		Você pagou L$[AMOUNT] por [REASON].
 	</string>
 	<string name="for item">
 		por [ITEM]
-- 
GitLab


From 90e6336b27ae962052a68ec17205e7b1f87bdb4e Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 15 Dec 2011 09:51:26 -0800
Subject: [PATCH 450/933] EXP-1725 FIX -- Carriage return or tab characters
 shown in Outbox text on Windows

* Removed tabs from outbox strings.
---
 indra/newview/skins/default/xui/en/strings.xml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index d8da56d338f..b83571a1067 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2039,18 +2039,18 @@ Returns a string with the requested data about the region
 	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace.</string>
 	<string name="InventoryOutboxNotMerchantTooltip">Become a merchant!</string>
 	<string name="InventoryOutboxNotMerchant">
-	The Second Life Marketplace offers more than one million virtual products for sale, all of them created by Residents like you.  You too can create items and sell them on the Marketplace.  Creating a store is easy and free of charge.
-	
-	[[MARKETPLACE_URL] Visit the Marketplace]
+The Second Life Marketplace offers more than one million virtual products for sale, all of them created by Residents like you.  You too can create items and sell them on the Marketplace.  Creating a store is easy and free of charge.
+
+[[MARKETPLACE_URL] Visit the Marketplace]
 
-	[[MARKETPLACE_LEARN_MORE_URL] Learn more about creating a store]
+[[MARKETPLACE_LEARN_MORE_URL] Learn more about creating a store]
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">Your outbox is empty.</string>
 	<string name="InventoryOutboxNoItemsTooltip">Drag and drop items here to prepare them for sale on the Marketplace</string>
 	<string name="InventoryOutboxNoItems">
-	Drag folders to this area.  When you are ready to send them to the Marketplace for sale, click the "Send to Marketplace" button below.
-	
-	[[MARKETPLACE_DASHBOARD_URL] Go to your Merchant Dashboard]
+Drag folders to this area.  When you are ready to send them to the Marketplace for sale, click the "Send to Marketplace" button below.
+
+[[MARKETPLACE_DASHBOARD_URL] Go to your Merchant Dashboard]
 	</string>
 
 	<string name="Marketplace Error None">No errors</string>
-- 
GitLab


From a94a923240ba6e9928010432e1e815ea69edd6b7 Mon Sep 17 00:00:00 2001
From: Alissa Sabre <none@none>
Date: Thu, 15 Dec 2011 15:19:50 -0500
Subject: [PATCH 451/933] storm-1723: fix character display when a lot of
 different characters are used

---
 doc/contributions.txt       |  1 +
 indra/llrender/llfontgl.cpp | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..d7d1ab6a708 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -159,6 +159,7 @@ Alissa Sabre
 	VWR-12620
 	VWR-12789
 	SNOW-322
+    STORM-1723
 Alliez Mysterio
 Angus Boyd
 	VWR-592
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 607473d4166..82e8227ffe5 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -304,6 +304,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 		S32 next_bitmap_num = fgi->mBitmapNum;
 		if (next_bitmap_num != bitmap_num)
 		{
+			// Actually draw the queued glyphs before switching their texture;
+			// otherwise the queued glyphs will be taken from wrong textures.
+			if (glyph_count > 0)
+			{
+				gGL.begin(LLRender::QUADS);
+				{
+					gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4);
+				}
+				gGL.end();
+				glyph_count = 0;
+			}
+
 			bitmap_num = next_bitmap_num;
 			LLImageGL *font_image = font_bitmap_cache->getImageGL(bitmap_num);
 			gGL.getTexUnit(0)->bind(font_image);
-- 
GitLab


From 2e564abcd682c348de3a2d3a50ef58df545c143b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 15 Dec 2011 14:26:42 -0800
Subject: [PATCH 452/933] EXP-1730 FIX EXP-1731 FIX EXP-1735 FIX EXP-1736 FIX
 EXP-1737 FIX EXP-1738 FIX EXP-1739 FIX

* Users can no longer drag and drop items to the outbox from in world, notecards or the library.
* Drag and drop now blocks the creation of hierarchies that are too deep, too many folders or contain too many items.
* Settings now exist to specify drag and drop limitations to the outbox, named:
       InventoryOutboxMaxFolderDepth (4)
       InventoryOutboxMaxFolderCount (20)
       InventoryOutboxMaxItemCount (200)
---
 indra/newview/app_settings/settings.xml       |  32 ++-
 indra/newview/llinventorybridge.cpp           | 208 +++++++++++++-----
 indra/newview/llinventorymodel.cpp            |  32 +++
 indra/newview/llinventorymodel.h              |   3 +
 .../newview/skins/default/xui/en/strings.xml  |   2 +
 5 files changed, 214 insertions(+), 63 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index aa8ad53a3d2..a6d859aab2c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4260,16 +4260,38 @@
 		<key>Value</key>
 		<integer>0</integer>
 	</map>
-    <key>InventoryMarketplaceUserStatus</key>
+    <key>InventoryOutboxMaxFolderCount</key>
     <map>
       <key>Comment</key>
-      <string>Marketplace user status.</string>
+      <string>Maximum number of subfolders allowed in a listing in the merchant outbox.</string>
       <key>Persist</key>
-      <integer>1</integer>
+      <integer>0</integer>
       <key>Type</key>
-      <string>String</string>
+      <string>U32</string>
       <key>Value</key>
-      <string />
+      <integer>20</integer>
+    </map>
+    <key>InventoryOutboxMaxFolderDepth</key>
+    <map>
+      <key>Comment</key>
+      <string>Maximum number of nested levels of subfolders allowed in a listing in the merchant outbox.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>4</integer>
+    </map>
+    <key>InventoryOutboxMaxItemCount</key>
+    <map>
+      <key>Comment</key>
+      <string>Maximum number of items allowed in a listing in the merchant outbox.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>200</integer>
     </map>
     <key>InventorySortOrder</key>
     <map>
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d6b520d75ed..26e7dab2703 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1815,7 +1815,7 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m
 		return false;
 	}
 #endif
-
+	
 	return true;
 }
 
@@ -1874,28 +1874,28 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	if (!isAgentAvatarValid()) return FALSE;
 	if (!isAgentInventory()) return FALSE; // cannot drag categories into library
 
+	const LLUUID &cat_id = inv_cat->getUUID();
+	const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
+	const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+	
+	const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
+	const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); 
+	const BOOL move_is_from_outbox = model->isObjectDescendentOf(cat_id, outbox_id);
 
 	// check to make sure source is agent inventory, and is represented there.
 	LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
-	const BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL)
+	const BOOL is_agent_inventory = (model->getCategory(cat_id) != NULL)
 		&& (LLToolDragAndDrop::SOURCE_AGENT == source);
 
-	const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
-	const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
-
 	BOOL accept = FALSE;
 	if (is_agent_inventory)
 	{
-		const LLUUID &cat_id = inv_cat->getUUID();
 		const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false);
 		const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
-		const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
 
 		const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id);
 		const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT);
 		const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
-		const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); 
-		const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_cat->getUUID(), outbox_id);
 
 		//--------------------------------------------------------------------------------
 		// Determine if folder can be moved.
@@ -1950,24 +1950,58 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		}
 		if (move_is_into_outbox)
 		{
-			for (S32 i=0; i < descendent_items.count(); ++i)
+			int nested_folder_levels = (get_folder_path_length(outbox_id, mUUID) - 1) + get_folder_levels(inv_cat);
+			
+			if (nested_folder_levels >= gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"))
 			{
-				LLInventoryItem* item = descendent_items[i];
-				if (!can_move_to_outbox(item, tooltip_msg))
-				{
-					is_movable = FALSE;
-					break; 
-				}
+				tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels");
+				is_movable = FALSE;
 			}
+			else
+			{
+				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
+				
+				int existing_item_count = 0;
+				int existing_folder_count = 0;
+				
+				if (master_folder != NULL)
+				{
+					LLInventoryModel::cat_array_t existing_categories;
+					LLInventoryModel::item_array_t existing_items;
 
-			int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
+					gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
+					
+					existing_item_count = existing_items.count();
+					existing_folder_count = existing_categories.count();
+				}
 
-			if (nested_folder_levels > 4)
-			{
-				tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels");
-				is_movable = FALSE;
+				const int nested_folder_count = existing_folder_count + descendent_categories.count();
+				const int nested_item_count = existing_item_count + descendent_items.count();
+				
+				if (nested_folder_count >= gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
+				{
+					tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders");
+					is_movable = FALSE;
+				}
+				else if (nested_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
+				{
+					tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects");
+					is_movable = FALSE;
+				}
+				
+				if (is_movable == TRUE);
+				{
+					for (S32 i=0; i < descendent_items.count(); ++i)
+					{
+						LLInventoryItem* item = descendent_items[i];
+						if (!can_move_to_outbox(item, tooltip_msg))
+						{
+							is_movable = FALSE;
+							break; 
+						}
+					}
+				}
 			}
-			
 		}
 
 		// 
@@ -2008,7 +2042,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 						// Recursively create links in target outfit.
 						LLInventoryModel::cat_array_t cats;
 						LLInventoryModel::item_array_t items;
-						gInventory.collectDescendents(inv_cat->getUUID(), cats, items, LLInventoryModel::EXCLUDE_TRASH);
+						gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
 						LLAppearanceMgr::instance().linkAll(mUUID,items,NULL);
 					}
 				}
@@ -2026,7 +2060,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 						const std::string empty_description = "";
 						link_inventory_item(
 							gAgent.getID(),
-							inv_cat->getUUID(),
+							cat_id,
 							mUUID,
 							inv_cat->getName(),
 							empty_description,
@@ -2038,13 +2072,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else if (move_is_into_outbox && !move_is_from_outbox)
 			{
-				copy_folder_to_outbox(inv_cat, mUUID, inv_cat->getUUID());
+				copy_folder_to_outbox(inv_cat, mUUID, cat_id);
 			}
 			else
 			{
-				if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
+				if (gInventory.isObjectDescendentOf(cat_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
 				{
-					set_dad_inbox_object(inv_cat->getUUID());
+					set_dad_inbox_object(cat_id);
 				}
 
 				// Reparent the folder and restamp children if it's moving
@@ -2059,15 +2093,28 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	}
 	else if (LLToolDragAndDrop::SOURCE_WORLD == source)
 	{
-		// content category has same ID as object itself
-		LLUUID object_id = inv_cat->getUUID();
-		LLUUID category_id = mUUID;
-		accept = move_inv_category_world_to_agent(object_id, category_id, drop);
+		if (move_is_into_outbox)
+		{
+			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			accept = FALSE;
+		}
+		else
+		{
+			accept = move_inv_category_world_to_agent(cat_id, mUUID, drop);
+		}
 	}
 	else if (LLToolDragAndDrop::SOURCE_LIBRARY == source)
 	{
-		// Accept folders that contain complete outfits.
-		accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(inv_cat->getUUID());
+		if (move_is_into_outbox)
+		{
+			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNoTransferLibrary");
+			accept = FALSE;
+		}
+		else
+		{
+			// Accept folders that contain complete outfits.
+			accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(cat_id);
+		}		
 
 		if (accept && drop)
 		{
@@ -3317,8 +3364,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 {
 	LLInventoryModel* model = getInventoryModel();
 
-	if(!model || !inv_item) return FALSE;
-	if(!isAgentInventory()) return FALSE; // cannot drag into library
+	if (!model || !inv_item) return FALSE;
+	if (!isAgentInventory()) return FALSE; // cannot drag into library
 	if (!isAgentAvatarValid()) return FALSE;
 
 	const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
@@ -3386,10 +3433,14 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		accept = TRUE;
 
 		if (!is_movable) 
+		{
 			accept = FALSE;
-		if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites)
+		}
+		else if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites)
+		{
 			accept = FALSE;
-		if (move_is_into_current_outfit || move_is_into_outfit)
+		}
+		else if (move_is_into_current_outfit || move_is_into_outfit)
 		{
 			accept = can_move_to_outfit(inv_item, move_is_into_current_outfit);
 		}
@@ -3400,9 +3451,32 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		else if (move_is_into_outbox)
 		{
 			accept = can_move_to_outbox(inv_item, tooltip_msg);
+			
+			if (accept)
+			{
+				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
+				
+				int existing_item_count = 0;
+				
+				if (master_folder != NULL)
+				{
+					LLInventoryModel::cat_array_t existing_categories;
+					LLInventoryModel::item_array_t existing_items;
+					
+					gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
+					
+					existing_item_count = existing_items.count();
+				}
+				
+				if (existing_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
+				{
+					tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects");
+					accept = FALSE;
+				}
+			}
 		}
 
-		if(accept && drop)
+		if (accept && drop)
 		{
 			if (inv_item->getType() == LLAssetType::AT_GESTURE
 				&& LLGestureMgr::instance().isGestureActive(inv_item->getUUID()) && move_is_into_trash)
@@ -3451,13 +3525,16 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			{
 				dropToOutfit(inv_item, move_is_into_current_outfit);
 			}
-			else if (move_is_into_outbox && !move_is_from_outbox)
+			else if (move_is_into_outbox)
 			{
-				copy_item_to_outbox(inv_item, mUUID, LLUUID::null);
-			}
-			else if (move_is_into_outbox && move_is_from_outbox)
-			{
-				move_item_within_outbox(inv_item, mUUID);
+				if (move_is_from_outbox)
+				{
+					move_item_within_outbox(inv_item, mUUID);
+				}
+				else
+				{
+					copy_item_to_outbox(inv_item, mUUID, LLUUID::null);
+				}
 			}
 			// NORMAL or TRASH folder
 			// (move the item, restamp if into trash)
@@ -3478,7 +3555,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 
 			// 
 			//--------------------------------------------------------------------------------
-
 		}
 	}
 	else if (LLToolDragAndDrop::SOURCE_WORLD == source)
@@ -3487,7 +3563,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		// anonymous objects, it would be possible to bypass
 		// permissions.
 		object = gObjectList.findObject(inv_item->getParentUUID());
-		if(!object)
+		if (!object)
 		{
 			llinfos << "Object not found for drop." << llendl;
 			return FALSE;
@@ -3497,10 +3573,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		// move/copy this item.
 		LLPermissions perm(inv_item->getPermissions());
 		BOOL is_move = FALSE;
-		if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
+		if ((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
 			&& perm.allowTransferTo(gAgent.getID())))
 			// || gAgent.isGodlike())
-
 		{
 			accept = TRUE;
 		}
@@ -3516,7 +3591,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		// Don't allow placing an original item into Current Outfit or an outfit folder
 		// because they must contain only links to wearable items.
 		// *TODO: Probably we should create a link to an item if it was dragged to outfit or COF.
-		if(move_is_into_current_outfit || move_is_into_outfit)
+		if (move_is_into_current_outfit || move_is_into_outfit)
 		{
 			accept = FALSE;
 		}
@@ -3527,8 +3602,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		{
 			accept = FALSE;
 		}
-
-		if(drop && accept)
+		else if (move_is_into_outbox)
+		{
+			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			accept = FALSE;
+		}
+		
+		if (accept && drop)
 		{
 			LLMoveInv* move_inv = new LLMoveInv;
 			move_inv->mObjectID = inv_item->getParentUUID();
@@ -3550,15 +3630,22 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 				LLNotifications::instance().forceResponse(params, 0);
 			}
 		}
-
 	}
 	else if(LLToolDragAndDrop::SOURCE_NOTECARD == source)
 	{
-		// Don't allow placing an original item from a notecard to Current Outfit or an outfit folder
-		// because they must contain only links to wearable items.
-		accept = !(move_is_into_current_outfit || move_is_into_outfit);
-
-		if(accept && drop)
+		if (move_is_into_outbox)
+		{
+			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			accept = FALSE;
+		}
+		else
+		{
+			// Don't allow placing an original item from a notecard to Current Outfit or an outfit folder
+			// because they must contain only links to wearable items.
+			accept = !(move_is_into_current_outfit || move_is_into_outfit);
+		}
+		
+		if (accept && drop)
 		{
 			copy_inventory_from_notecard(mUUID,  // Drop to the chosen destination folder
 										 LLToolDragAndDrop::getInstance()->getObjectID(),
@@ -3573,7 +3660,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		{
 			accept = TRUE;
 
-			if (move_is_into_current_outfit || move_is_into_outfit)
+			if (move_is_into_outbox)
+			{
+				tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+				accept = FALSE;
+			}
+			else if (move_is_into_current_outfit || move_is_into_outfit)
 			{
 				accept = can_move_to_outfit(inv_item, move_is_into_current_outfit);
 			}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index dc25689fa3f..2fb9c538571 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -217,6 +217,38 @@ const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(cons
 	return NULL;
 }
 
+//
+// Search up the parent chain until we get to the specified parent, then return the first child category under it
+//
+const LLViewerInventoryCategory* LLInventoryModel::getFirstDescendantOf(const LLUUID& master_parent_id, const LLUUID& obj_id) const
+{
+	if (master_parent_id == obj_id)
+	{
+		return NULL;
+	}
+
+	const LLViewerInventoryCategory* current_cat = getCategory(obj_id);
+
+	if (current_cat == NULL)
+	{
+		current_cat = getCategory(getObject(obj_id)->getParentUUID());
+	}
+	
+	while (current_cat != NULL)
+	{
+		const LLUUID& current_parent_id = current_cat->getParentUUID();
+		
+		if (current_parent_id == master_parent_id)
+		{
+			return current_cat;
+		}
+		
+		current_cat = getCategory(current_parent_id);
+	}
+
+	return NULL;
+}
+
 // Get the object by id. Returns NULL if not found.
 LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const
 {
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 340c1b0c22d..1740c4151de 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -238,6 +238,9 @@ class LLInventoryModel
 	
 	// Get whatever special folder this object is a child of, if any.
 	const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const;
+	
+	// Get first descendant of the child object under the specified parent
+	const LLViewerInventoryCategory *getFirstDescendantOf(const LLUUID& master_parent_id, const LLUUID& obj_id) const;
 
 	// Get the object by id. Returns NULL if not found.
 	//   NOTE: Use the pointer returned for read operations - do
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index b83571a1067..0d9a7e5c417 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -165,8 +165,10 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]: "/>
 	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred to another user.</string>
+	<string name="TooltipOutboxNotInInventory">You can only transfer objects in your inventory to your merchant outbox.</string>
 	<string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
 	<string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
+	<string name="TooltipOutboxTooManyFolders">This folder has too many subfolders. Reorganize the interior to a maximum of 20 folders.</string>
 	<string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
 	
 	<!-- tooltips for Urls -->
-- 
GitLab


From b6af1b47f15992b60ddb4c718f03ae6d2040cc19 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 15 Dec 2011 15:09:02 -0800
Subject: [PATCH 453/933] Windows build fix and fixes for off-by-1 errors in
 limitations

---
 indra/newview/llinventorybridge.cpp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 26e7dab2703..64b5a9debaf 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1950,9 +1950,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		}
 		if (move_is_into_outbox)
 		{
-			int nested_folder_levels = (get_folder_path_length(outbox_id, mUUID) - 1) + get_folder_levels(inv_cat);
+			int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
 			
-			if (nested_folder_levels >= gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"))
+			if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"))
 			{
 				tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels");
 				is_movable = FALSE;
@@ -1962,7 +1962,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
 				int existing_item_count = 0;
-				int existing_folder_count = 0;
+				int existing_folder_count = 1;  // +1 for this folder being dragged now
 				
 				if (master_folder != NULL)
 				{
@@ -1971,25 +1971,25 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 
 					gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
 					
-					existing_item_count = existing_items.count();
-					existing_folder_count = existing_categories.count();
+					existing_item_count += existing_items.count();
+					existing_folder_count += existing_categories.count();
 				}
 
 				const int nested_folder_count = existing_folder_count + descendent_categories.count();
 				const int nested_item_count = existing_item_count + descendent_items.count();
 				
-				if (nested_folder_count >= gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
+				if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
 				{
 					tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders");
 					is_movable = FALSE;
 				}
-				else if (nested_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
+				else if (nested_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
 				{
 					tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects");
 					is_movable = FALSE;
 				}
 				
-				if (is_movable == TRUE);
+				if (is_movable == TRUE)
 				{
 					for (S32 i=0; i < descendent_items.count(); ++i)
 					{
@@ -3456,7 +3456,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			{
 				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
-				int existing_item_count = 0;
+				int existing_item_count = 1; // +1 for this item being dragged now
 				
 				if (master_folder != NULL)
 				{
@@ -3465,10 +3465,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 					
 					gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
 					
-					existing_item_count = existing_items.count();
+					existing_item_count += existing_items.count();
 				}
 				
-				if (existing_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
+				if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
 				{
 					tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects");
 					accept = FALSE;
-- 
GitLab


From da94592d00ae5099c181050c7415a91ae0bff4f6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 15 Dec 2011 15:39:54 -0800
Subject: [PATCH 454/933] dummy commit to fix TeamCity

---
 indra/newview/skins/paths.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/paths.xml b/indra/newview/skins/paths.xml
index e6d68488ea0..3c0da041c77 100644
--- a/indra/newview/skins/paths.xml
+++ b/indra/newview/skins/paths.xml
@@ -1,4 +1,4 @@
-<paths>
+<paths> 
 	<directory>
     <subdir>xui</subdir>
     <subdir>en</subdir>
-- 
GitLab


From f1edfc73efa526735b2a80d47e2381a2b46295df Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 15 Dec 2011 16:21:35 -0800
Subject: [PATCH 455/933] EXP-1726 FIX -- Rename option present in context menu
 when selecting multiple folders in Outbox

---
 indra/newview/llinventorybridge.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 64b5a9debaf..adf1d6254db 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2933,10 +2933,15 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	{
 		mItems.push_back(std::string("Rename"));
 		mItems.push_back(std::string("Delete"));
+		
+		if ((flags & FIRST_SELECTED_ITEM) == 0)
+		{
+			mDisabledItems.push_back(std::string("Rename"));
+		}
 	}
 	else if(isAgentInventory()) // do not allow creating in library
 	{
-		LLViewerInventoryCategory *cat =  getCategory();
+		LLViewerInventoryCategory *cat = getCategory();
 		// BAP removed protected check to re-enable standard ops in untyped folders.
 		// Not sure what the right thing is to do here.
 		if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT))
-- 
GitLab


From 4ec112bfce19d4bf09ef79b3b3195dda24148730 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 15 Dec 2011 21:39:48 -0700
Subject: [PATCH 456/933] fix for SH-2738 and SH-2777, might also help SH-2723:
 heap corruption SH-2738: Texture fetching freezes due to LLcurl SH-2777:
 viewer crashed on logout in LLCurl::Easy::releaseEasyHandle

---
 indra/llcommon/llthread.h  |  7 +++--
 indra/llmessage/llcurl.cpp | 63 +++++++++++++++++++++++---------------
 indra/llmessage/llcurl.h   |  2 ++
 3 files changed, 45 insertions(+), 27 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 40291a25693..f0e0de6173a 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -187,11 +187,14 @@ class LLMutexLock
 	LLMutexLock(LLMutex* mutex)
 	{
 		mMutex = mutex;
-		mMutex->lock();
+		
+		if(mMutex)
+			mMutex->lock();
 	}
 	~LLMutexLock()
 	{
-		mMutex->unlock();
+		if(mMutex)
+			mMutex->unlock();
 	}
 private:
 	LLMutex* mMutex;
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index ce0632668cf..874f4673ca1 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -219,11 +219,15 @@ namespace boost
 
 std::set<CURL*> LLCurl::Easy::sFreeHandles;
 std::set<CURL*> LLCurl::Easy::sActiveHandles;
+LLMutex* LLCurl::Easy::sHandleMutexp = NULL ;
 
 //static
 CURL* LLCurl::Easy::allocEasyHandle()
 {
 	CURL* ret = NULL;
+
+	LLMutexLock lock(sHandleMutexp) ;
+
 	if (sFreeHandles.empty())
 	{
 		ret = curl_easy_init();
@@ -251,6 +255,7 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle)
 		llerrs << "handle cannot be NULL!" << llendl;
 	}
 
+	LLMutexLock lock(sHandleMutexp) ;
 	if (sActiveHandles.find(handle) != sActiveHandles.end())
 	{
 		sActiveHandles.erase(handle);
@@ -519,7 +524,8 @@ LLCurl::Multi::Multi()
 	  mState(STATE_READY),
 	  mDead(FALSE),
 	  mMutexp(NULL),
-	  mDeletionMutexp(NULL)
+	  mDeletionMutexp(NULL),
+	  mEasyMutexp(NULL)
 {
 	mCurlMultiHandle = curl_multi_init();
 	if (!mCurlMultiHandle)
@@ -534,6 +540,7 @@ LLCurl::Multi::Multi()
 	{
 		mMutexp = new LLMutex(NULL) ;
 		mDeletionMutexp = new LLMutex(NULL) ;
+		mEasyMutexp = new LLMutex(NULL) ;
 	}
 	LLCurl::getCurlThread()->addMulti(this) ;
 
@@ -563,6 +570,8 @@ LLCurl::Multi::~Multi()
 	mMutexp = NULL ;
 	delete mDeletionMutexp ;
 	mDeletionMutexp = NULL ;
+	delete mEasyMutexp ;
+	mEasyMutexp = NULL ;
 
 	--gCurlMultiCount;
 }
@@ -585,17 +594,9 @@ void LLCurl::Multi::unlock()
 
 void LLCurl::Multi::markDead()
 {
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->lock() ;
-	}
-
+	LLMutexLock lock(mDeletionMutexp) ;
+	
 	mDead = TRUE ;
-
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->unlock() ;
-	}
 }
 
 void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
@@ -655,10 +656,8 @@ CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 //return true if dead
 bool LLCurl::Multi::doPerform()
 {
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->lock() ;
-	}
+	LLMutexLock lock(mDeletionMutexp) ;
+	
 	bool dead = mDead ;
 
 	if(mDead)
@@ -675,6 +674,7 @@ bool LLCurl::Multi::doPerform()
 				call_count < MULTI_PERFORM_CALL_REPEAT;
 				call_count++)
 		{
+			LLMutexLock lock(mMutexp) ;
 			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
 			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
 			{
@@ -688,11 +688,6 @@ bool LLCurl::Multi::doPerform()
 		setState(STATE_COMPLETED) ;
 	}
 
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->unlock() ;
-	}
-
 	return dead ;
 }
 
@@ -743,19 +738,21 @@ S32 LLCurl::Multi::process()
 
 LLCurl::Easy* LLCurl::Multi::allocEasy()
 {
-	Easy* easy = 0;
+	Easy* easy = 0;	
 
 	if (mEasyFreeList.empty())
-	{
+	{		
 		easy = Easy::getEasy();
 	}
 	else
 	{
+		LLMutexLock lock(mEasyMutexp) ;
 		easy = *(mEasyFreeList.begin());
 		mEasyFreeList.erase(easy);
 	}
 	if (easy)
 	{
+		LLMutexLock lock(mEasyMutexp) ;
 		mEasyActiveList.insert(easy);
 		mEasyActiveMap[easy->getCurlHandle()] = easy;
 	}
@@ -764,6 +761,7 @@ LLCurl::Easy* LLCurl::Multi::allocEasy()
 
 bool LLCurl::Multi::addEasy(Easy* easy)
 {
+	LLMutexLock lock(mMutexp) ;
 	CURLMcode mcode = curl_multi_add_handle(mCurlMultiHandle, easy->getCurlHandle());
 	check_curl_multi_code(mcode);
 	//if (mcode != CURLM_OK)
@@ -776,22 +774,30 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
+	mEasyMutexp->lock() ;
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
+
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
-	{
-		easy->resetState();
+	{		
 		mEasyFreeList.insert(easy);
+		mEasyMutexp->unlock() ;
+
+		easy->resetState();
 	}
 	else
 	{
+		mEasyMutexp->unlock() ;
 		delete easy;
 	}
 }
 
 void LLCurl::Multi::removeEasy(Easy* easy)
 {
-	check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
+	{
+		LLMutexLock lock(mMutexp) ;
+		check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
+	}
 	easyFree(easy);
 }
 
@@ -1290,6 +1296,10 @@ void LLCurl::initClass(bool multi_threaded)
 #endif
 
 	sCurlThread = new LLCurlThread(multi_threaded) ;
+	if(multi_threaded)
+	{
+		Easy::sHandleMutexp = new LLMutex(NULL) ;
+	}
 }
 
 void LLCurl::cleanupClass()
@@ -1319,6 +1329,9 @@ void LLCurl::cleanupClass()
 
 	Easy::sFreeHandles.clear();
 
+	delete Easy::sHandleMutexp ;
+	Easy::sHandleMutexp = NULL ;
+
 	llassert(Easy::sActiveHandles.empty());
 }
 
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 2c952794389..eb814bc608c 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -253,6 +253,7 @@ class LLCurl::Easy
 
 	static std::set<CURL*> sFreeHandles;
 	static std::set<CURL*> sActiveHandles;
+	static LLMutex*        sHandleMutexp ;
 };
 
 class LLCurl::Multi
@@ -316,6 +317,7 @@ class LLCurl::Multi
 	BOOL mDead ;
 	LLMutex* mMutexp ;
 	LLMutex* mDeletionMutexp ;
+	LLMutex* mEasyMutexp ;
 };
 
 class LLCurlThread : public LLQueuedThread
-- 
GitLab


From efec138037d7271effd89536d824bec270985909 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 15 Dec 2011 21:39:48 -0700
Subject: [PATCH 457/933] fix for SH-2738 and SH-2777, might also help SH-2723:
 heap corruption SH-2738: Texture fetching freezes due to LLcurl SH-2777:
 viewer crashed on logout in LLCurl::Easy::releaseEasyHandle

---
 indra/llcommon/llthread.h  |  7 +++--
 indra/llmessage/llcurl.cpp | 63 +++++++++++++++++++++++---------------
 indra/llmessage/llcurl.h   |  2 ++
 3 files changed, 45 insertions(+), 27 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 40291a25693..f0e0de6173a 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -187,11 +187,14 @@ class LLMutexLock
 	LLMutexLock(LLMutex* mutex)
 	{
 		mMutex = mutex;
-		mMutex->lock();
+		
+		if(mMutex)
+			mMutex->lock();
 	}
 	~LLMutexLock()
 	{
-		mMutex->unlock();
+		if(mMutex)
+			mMutex->unlock();
 	}
 private:
 	LLMutex* mMutex;
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 7ca25d07fce..d86bf7a0a11 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -219,11 +219,15 @@ namespace boost
 
 std::set<CURL*> LLCurl::Easy::sFreeHandles;
 std::set<CURL*> LLCurl::Easy::sActiveHandles;
+LLMutex* LLCurl::Easy::sHandleMutexp = NULL ;
 
 //static
 CURL* LLCurl::Easy::allocEasyHandle()
 {
 	CURL* ret = NULL;
+
+	LLMutexLock lock(sHandleMutexp) ;
+
 	if (sFreeHandles.empty())
 	{
 		ret = curl_easy_init();
@@ -251,6 +255,7 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle)
 		llerrs << "handle cannot be NULL!" << llendl;
 	}
 
+	LLMutexLock lock(sHandleMutexp) ;
 	if (sActiveHandles.find(handle) != sActiveHandles.end())
 	{
 		sActiveHandles.erase(handle);
@@ -519,7 +524,8 @@ LLCurl::Multi::Multi()
 	  mState(STATE_READY),
 	  mDead(FALSE),
 	  mMutexp(NULL),
-	  mDeletionMutexp(NULL)
+	  mDeletionMutexp(NULL),
+	  mEasyMutexp(NULL)
 {
 	mCurlMultiHandle = curl_multi_init();
 	if (!mCurlMultiHandle)
@@ -534,6 +540,7 @@ LLCurl::Multi::Multi()
 	{
 		mMutexp = new LLMutex(NULL) ;
 		mDeletionMutexp = new LLMutex(NULL) ;
+		mEasyMutexp = new LLMutex(NULL) ;
 	}
 	LLCurl::getCurlThread()->addMulti(this) ;
 
@@ -563,6 +570,8 @@ LLCurl::Multi::~Multi()
 	mMutexp = NULL ;
 	delete mDeletionMutexp ;
 	mDeletionMutexp = NULL ;
+	delete mEasyMutexp ;
+	mEasyMutexp = NULL ;
 
 	--gCurlMultiCount;
 }
@@ -585,17 +594,9 @@ void LLCurl::Multi::unlock()
 
 void LLCurl::Multi::markDead()
 {
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->lock() ;
-	}
-
+	LLMutexLock lock(mDeletionMutexp) ;
+	
 	mDead = TRUE ;
-
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->unlock() ;
-	}
 }
 
 void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
@@ -655,10 +656,8 @@ CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 //return true if dead
 bool LLCurl::Multi::doPerform()
 {
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->lock() ;
-	}
+	LLMutexLock lock(mDeletionMutexp) ;
+	
 	bool dead = mDead ;
 
 	if(mDead)
@@ -675,6 +674,7 @@ bool LLCurl::Multi::doPerform()
 				call_count < MULTI_PERFORM_CALL_REPEAT;
 				call_count++)
 		{
+			LLMutexLock lock(mMutexp) ;
 			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
 			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
 			{
@@ -688,11 +688,6 @@ bool LLCurl::Multi::doPerform()
 		setState(STATE_COMPLETED) ;
 	}
 
-	if(mDeletionMutexp)
-	{
-		mDeletionMutexp->unlock() ;
-	}
-
 	return dead ;
 }
 
@@ -743,19 +738,21 @@ S32 LLCurl::Multi::process()
 
 LLCurl::Easy* LLCurl::Multi::allocEasy()
 {
-	Easy* easy = 0;
+	Easy* easy = 0;	
 
 	if (mEasyFreeList.empty())
-	{
+	{		
 		easy = Easy::getEasy();
 	}
 	else
 	{
+		LLMutexLock lock(mEasyMutexp) ;
 		easy = *(mEasyFreeList.begin());
 		mEasyFreeList.erase(easy);
 	}
 	if (easy)
 	{
+		LLMutexLock lock(mEasyMutexp) ;
 		mEasyActiveList.insert(easy);
 		mEasyActiveMap[easy->getCurlHandle()] = easy;
 	}
@@ -764,6 +761,7 @@ LLCurl::Easy* LLCurl::Multi::allocEasy()
 
 bool LLCurl::Multi::addEasy(Easy* easy)
 {
+	LLMutexLock lock(mMutexp) ;
 	CURLMcode mcode = curl_multi_add_handle(mCurlMultiHandle, easy->getCurlHandle());
 	check_curl_multi_code(mcode);
 	//if (mcode != CURLM_OK)
@@ -776,22 +774,30 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
+	mEasyMutexp->lock() ;
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
+
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
-	{
-		easy->resetState();
+	{		
 		mEasyFreeList.insert(easy);
+		mEasyMutexp->unlock() ;
+
+		easy->resetState();
 	}
 	else
 	{
+		mEasyMutexp->unlock() ;
 		delete easy;
 	}
 }
 
 void LLCurl::Multi::removeEasy(Easy* easy)
 {
-	check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
+	{
+		LLMutexLock lock(mMutexp) ;
+		check_curl_multi_code(curl_multi_remove_handle(mCurlMultiHandle, easy->getCurlHandle()));
+	}
 	easyFree(easy);
 }
 
@@ -1290,6 +1296,10 @@ void LLCurl::initClass(bool multi_threaded)
 #endif
 
 	sCurlThread = new LLCurlThread(multi_threaded) ;
+	if(multi_threaded)
+	{
+		Easy::sHandleMutexp = new LLMutex(NULL) ;
+	}
 }
 
 void LLCurl::cleanupClass()
@@ -1319,6 +1329,9 @@ void LLCurl::cleanupClass()
 
 	Easy::sFreeHandles.clear();
 
+	delete Easy::sHandleMutexp ;
+	Easy::sHandleMutexp = NULL ;
+
 	llassert(Easy::sActiveHandles.empty());
 }
 
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index a275db3e53b..5d54b5fe12f 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -253,6 +253,7 @@ class LLCurl::Easy
 
 	static std::set<CURL*> sFreeHandles;
 	static std::set<CURL*> sActiveHandles;
+	static LLMutex*        sHandleMutexp ;
 };
 
 class LLCurl::Multi
@@ -316,6 +317,7 @@ class LLCurl::Multi
 	BOOL mDead ;
 	LLMutex* mMutexp ;
 	LLMutex* mDeletionMutexp ;
+	LLMutex* mEasyMutexp ;
 };
 
 class LLCurlThread : public LLQueuedThread
-- 
GitLab


From 16778677868620874b8b042f6c62712c9d28f2fb Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 16 Dec 2011 10:43:57 -0800
Subject: [PATCH 458/933] EXP-1738 FIX EXP-1739 FIX

* Initial pass to block drag and drop of multiple items when resultant outbox folder would contain too many items or folders.
---
 indra/newview/llinventorybridge.cpp | 5 +++--
 indra/newview/lltooldraganddrop.h   | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index adf1d6254db..ff980955e02 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -60,6 +60,7 @@
 #include "llpreviewtexture.h"
 #include "llselectmgr.h"
 #include "llsidepanelappearance.h"
+#include "lltooldraganddrop.h"
 #include "lltrans.h"
 #include "llviewerassettype.h"
 #include "llviewerfoldertype.h"
@@ -1962,7 +1963,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
 				int existing_item_count = 0;
-				int existing_folder_count = 1;  // +1 for this folder being dragged now
+				int existing_folder_count = LLToolDragAndDrop::instance().getCargoIDsCount();
 				
 				if (master_folder != NULL)
 				{
@@ -3461,7 +3462,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			{
 				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
-				int existing_item_count = 1; // +1 for this item being dragged now
+				int existing_item_count = LLToolDragAndDrop::instance().getCargoIDsCount();
 				
 				if (master_folder != NULL)
 				{
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index 92f007a2518..273d23d1a0f 100644
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -86,6 +86,8 @@ class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop>
 	EAcceptance getLastAccept() { return mLastAccept; }
 
 	boost::signals2::connection setEndDragCallback( const enddrag_signal_t::slot_type& cb ) { return mEndDragSignal.connect(cb); }
+	
+	uuid_vec_t::size_type getCargoIDsCount() const { return mCargoIDs.size(); }
 
 protected:
 	enum EDropTarget
-- 
GitLab


From 16b6a472477bd389771fe4022e425f77ca85c2bd Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 16 Dec 2011 15:07:04 -0800
Subject: [PATCH 459/933] EXP-1742 FIX -- Clicking IM notification or receiving
 multiple IM notifications in quick succession crashes to desktop

* Moved toast logic for mouse hover out of the draw call to avoid chain of callbacks that lead to reordering of the draw list while we are iterating over it.
---
 indra/newview/llappviewer.cpp |   2 +
 indra/newview/lltoast.cpp     | 146 +++++++++++++++++++---------------
 indra/newview/lltoast.h       |   8 +-
 3 files changed, 89 insertions(+), 67 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b45f9c55fba..0861fe85a84 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -75,6 +75,7 @@
 //#include "llfirstuse.h"
 #include "llrender.h"
 #include "llteleporthistory.h"
+#include "lltoast.h"
 #include "lllocationhistory.h"
 #include "llfasttimerview.h"
 #include "llvector4a.h"
@@ -4051,6 +4052,7 @@ void LLAppViewer::idle()
 	LLFrameTimer::updateFrameTime();
 	LLFrameTimer::updateFrameCount();
 	LLEventTimer::updateClass();
+	LLNotificationsUI::LLToast::updateClass();
 	LLCriticalDamp::updateInterpolants();
 	LLMortician::updateClass();
 	LLFilePickerThread::clearDead();  //calls LLFilePickerThread::notify()
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index c4b226b70b2..da691a2d0c3 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -140,7 +140,9 @@ LLToast::LLToast(const LLToast::Params& p)
 
 	// init callbacks if present
 	if(!p.on_delete_toast().empty())
+	{
 		mOnDeleteToastSignal.connect(p.on_delete_toast());
+	}
 }
 
 void LLToast::reshape(S32 width, S32 height, BOOL called_from_parent)
@@ -236,7 +238,9 @@ void LLToast::setCanFade(bool can_fade)
 { 
 	mCanFade = can_fade; 
 	if(!mCanFade)
+	{
 		mTimer->stop();
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -328,55 +332,6 @@ void LLToast::draw()
 			drawChild(mHideBtn);
 		}
 	}
-
-	updateHoveredState();
-
-	LLToastLifeTimer* timer = getTimer();
-	if (!timer)
-	{
-		return;
-	}
-
-	// Started timer means the mouse had left the toast previously.
-	// If toast is hovered in the current frame we should handle
-	// a mouse enter event.
-	if(timer->getStarted() && mIsHovered)
-	{
-		mOnToastHoverSignal(this, MOUSE_ENTER);
-
-		updateTransparency();
-
-		//toasts fading is management by Screen Channel
-
-		sendChildToFront(mHideBtn);
-		if(mHideBtn && mHideBtn->getEnabled())
-		{
-			mHideBtn->setVisible(TRUE);
-		}
-		mToastMouseEnterSignal(this, getValue());
-	}
-	// Stopped timer means the mouse had entered the toast previously.
-	// If the toast is not hovered in the current frame we should handle
-	// a mouse leave event.
-	else if(!timer->getStarted() && !mIsHovered)
-	{
-		mOnToastHoverSignal(this, MOUSE_LEAVE);
-
-		updateTransparency();
-
-		//toasts fading is management by Screen Channel
-
-		if(mHideBtn && mHideBtn->getEnabled())
-		{
-			if( mHideBtnPressed )
-			{
-				mHideBtnPressed = false;
-				return;
-			}
-			mHideBtn->setVisible(FALSE);
-		}
-		mToastMouseLeaveSignal(this, getValue());
-	}
 }
 
 //--------------------------------------------------------------------------
@@ -440,28 +395,80 @@ void LLToast::updateHoveredState()
 	{
 		// mouse is not over this toast
 		mIsHovered = false;
-		return;
 	}
+	else
+	{
+		bool is_overlapped_by_other_floater = false;
 
-	bool is_overlapped_by_other_floater = false;
-
-	const child_list_t* child_list = gFloaterView->getChildList();
+		const child_list_t* child_list = gFloaterView->getChildList();
 
-	// find this toast in gFloaterView child list to check whether any floater
-	// with higher Z-order is visible under the mouse pointer overlapping this toast
-	child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
-	if (r_iter != child_list->rend())
-	{
-		// skip this toast and proceed to views above in Z-order
-		for (++r_iter; r_iter != child_list->rend(); ++r_iter)
+		// find this toast in gFloaterView child list to check whether any floater
+		// with higher Z-order is visible under the mouse pointer overlapping this toast
+		child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this);
+		if (r_iter != child_list->rend())
 		{
-			LLView* view = *r_iter;
-			is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
-			if (is_overlapped_by_other_floater) break;
+			// skip this toast and proceed to views above in Z-order
+			for (++r_iter; r_iter != child_list->rend(); ++r_iter)
+			{
+				LLView* view = *r_iter;
+				is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y);
+				if (is_overlapped_by_other_floater)
+				{
+					break;
+				}
+			}
 		}
+
+		mIsHovered = !is_overlapped_by_other_floater;
 	}
 
-	mIsHovered = !is_overlapped_by_other_floater;
+	LLToastLifeTimer* timer = getTimer();
+	
+	if (timer)
+	{	
+		// Started timer means the mouse had left the toast previously.
+		// If toast is hovered in the current frame we should handle
+		// a mouse enter event.
+		if(timer->getStarted() && mIsHovered)
+		{
+			mOnToastHoverSignal(this, MOUSE_ENTER);
+			
+			updateTransparency();
+			
+			//toasts fading is management by Screen Channel
+			
+			sendChildToFront(mHideBtn);
+			if(mHideBtn && mHideBtn->getEnabled())
+			{
+				mHideBtn->setVisible(TRUE);
+			}
+			
+			mToastMouseEnterSignal(this, getValue());
+		}
+		// Stopped timer means the mouse had entered the toast previously.
+		// If the toast is not hovered in the current frame we should handle
+		// a mouse leave event.
+		else if(!timer->getStarted() && !mIsHovered)
+		{
+			mOnToastHoverSignal(this, MOUSE_LEAVE);
+			
+			updateTransparency();
+			
+			//toasts fading is management by Screen Channel
+			
+			if(mHideBtn && mHideBtn->getEnabled())
+			{
+				if( mHideBtnPressed )
+				{
+					mHideBtnPressed = false;
+					return;
+				}
+				mHideBtn->setVisible(FALSE);
+			}
+			
+			mToastMouseLeaveSignal(this, getValue());
+		}
+	}
 }
 
 void LLToast::setBackgroundOpaque(BOOL b)
@@ -553,3 +560,14 @@ S32	LLToast::notifyParent(const LLSD& info)
 
 	return LLModalDialog::notifyParent(info);
 }
+
+//static
+void LLToast::updateClass()
+{
+	for (LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances(); iter != LLInstanceTracker<LLToast>::endInstances(); ) 
+	{
+		LLToast& toast = *iter++;
+		
+		toast.updateHoveredState();
+	}
+}
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 77229e7beb5..0b067289350 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -27,7 +27,7 @@
 #ifndef LL_LLTOAST_H
 #define LL_LLTOAST_H
 
-
+#include "llinstancetracker.h"
 #include "llpanel.h"
 #include "llmodaldialog.h"
 #include "lleventtimer.h"
@@ -69,7 +69,7 @@ private :
  * Represents toast pop-up.
  * This is a parent view for all toast panels.
  */
-class LLToast : public LLModalDialog
+class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 {
 	friend class LLToastLifeTimer;
 public:
@@ -102,6 +102,8 @@ class LLToast : public LLModalDialog
 
 		Params();
 	};
+	
+	static void updateClass();
 
 	LLToast(const LLToast::Params& p);
 	virtual ~LLToast();
@@ -221,7 +223,7 @@ class LLToast : public LLModalDialog
 
 	F32			mToastLifetime; // in seconds
 	F32			mToastFadingTime; // in seconds
-
+	
 	LLPanel*		mPanel;
 	LLButton*		mHideBtn;
 
-- 
GitLab


From c0b4ec6fe72d703191b28749cfd30262d131b245 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 16 Dec 2011 17:43:30 -0600
Subject: [PATCH 460/933] SH-2694 Fix for FPS drop when mousing over flexi
 objects (don't use an octree for flexi raycast)

---
 indra/llmath/lloctree.h              | 36 ++++++------
 indra/llmath/llvolume.cpp            | 85 ++++++++++++++++++++++++----
 indra/newview/llspatialpartition.cpp | 26 +++++----
 3 files changed, 111 insertions(+), 36 deletions(-)

diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 3c1ae45d686..1b11e83b4af 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -80,8 +80,8 @@ class LLOctreeNode : public LLTreeNode<T>
 	typedef LLOctreeTraveler<T>									oct_traveler;
 	typedef LLTreeTraveler<T>									tree_traveler;
 	typedef typename std::set<LLPointer<T> >					element_list;
-	typedef typename std::set<LLPointer<T> >::iterator			element_iter;
-	typedef typename std::set<LLPointer<T> >::const_iterator	const_element_iter;
+	typedef typename element_list::iterator						element_iter;
+	typedef typename element_list::const_iterator	const_element_iter;
 	typedef typename std::vector<LLTreeListener<T>*>::iterator	tree_listener_iter;
 	typedef typename std::vector<LLOctreeNode<T>* >				child_list;
 	typedef LLTreeNode<T>		BaseType;
@@ -114,6 +114,8 @@ class LLOctreeNode : public LLTreeNode<T>
 			mOctant = ((oct_node*) mParent)->getOctant(mCenter);
 		}
 
+		mElementCount = 0;
+
 		clearChildren();
 	}
 
@@ -219,11 +221,11 @@ class LLOctreeNode : public LLTreeNode<T>
 	void accept(oct_traveler* visitor)				{ visitor->visit(this); }
 	virtual bool isLeaf() const						{ return mChild.empty(); }
 	
-	U32 getElementCount() const						{ return mData.size(); }
+	U32 getElementCount() const						{ return mElementCount; }
 	element_list& getData()							{ return mData; }
 	const element_list& getData() const				{ return mData; }
 	
-	U32 getChildCount()	const						{ return mChild.size(); }
+	U32 getChildCount()	const						{ return mChildCount; }
 	oct_node* getChild(U32 index)					{ return mChild[index]; }
 	const oct_node* getChild(U32 index) const		{ return mChild[index]; }
 	child_list& getChildren()						{ return mChild; }
@@ -300,17 +302,13 @@ class LLOctreeNode : public LLTreeNode<T>
 			if ((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius()) ||
 				(data->getBinRadius() > getSize()[0] &&	parent && parent->getElementCount() >= gOctreeMaxCapacity))) 
 			{ //it belongs here
-#if LL_OCTREE_PARANOIA_CHECK
 				//if this is a redundant insertion, error out (should never happen)
-				if (mData.find(data) != mData.end())
-				{
-					llwarns << "Redundant octree insertion detected. " << data << llendl;
-					return false;
-				}
-#endif
+				llassert(mData.find(data) == mData.end());
 
 				mData.insert(data);
 				BaseType::insert(data);
+
+				mElementCount = mData.size();
 				return true;
 			}
 			else
@@ -346,6 +344,8 @@ class LLOctreeNode : public LLTreeNode<T>
 				{
 					mData.insert(data);
 					BaseType::insert(data);
+
+					mElementCount = mData.size();
 					return true;
 				}
 
@@ -399,6 +399,7 @@ class LLOctreeNode : public LLTreeNode<T>
 		if (mData.find(data) != mData.end())
 		{	//we have data
 			mData.erase(data);
+			mElementCount = mData.size();
 			notifyRemoval(data);
 			checkAlive();
 			return true;
@@ -436,6 +437,7 @@ class LLOctreeNode : public LLTreeNode<T>
         if (mData.find(data) != mData.end())
 		{
 			mData.erase(data);
+			mElementCount = mData.size();
 			notifyRemoval(data);
 			llwarns << "FOUND!" << llendl;
 			checkAlive();
@@ -452,7 +454,7 @@ class LLOctreeNode : public LLTreeNode<T>
 	void clearChildren()
 	{
 		mChild.clear();
-
+		mChildCount = 0;
 		U32* foo = (U32*) mChildMap;
 		foo[0] = foo[1] = 0xFFFFFFFF;
 	}
@@ -512,9 +514,10 @@ class LLOctreeNode : public LLTreeNode<T>
 		}
 #endif
 
-		mChildMap[child->getOctant()] = (U8) mChild.size();
+		mChildMap[child->getOctant()] = mChildCount;
 
 		mChild.push_back(child);
+		++mChildCount;
 		child->setParent(this);
 
 		if (!silent)
@@ -534,21 +537,20 @@ class LLOctreeNode : public LLTreeNode<T>
 			oct_listener* listener = getOctListener(i);
 			listener->handleChildRemoval(this, getChild(index));
 		}
-
 		
-
 		if (destroy)
 		{
 			mChild[index]->destroy();
 			delete mChild[index];
 		}
 		mChild.erase(mChild.begin() + index);
+		--mChildCount;
 
 		//rebuild child map
 		U32* foo = (U32*) mChildMap;
 		foo[0] = foo[1] = 0xFFFFFFFF;
 
-		for (U32 i = 0; i < mChild.size(); ++i)
+		for (U32 i = 0; i < mChildCount; ++i)
 		{
 			mChildMap[mChild[i]->getOctant()] = i;
 		}
@@ -601,8 +603,10 @@ class LLOctreeNode : public LLTreeNode<T>
 
 	child_list mChild;
 	U8 mChildMap[8];
+	U32 mChildCount;
 
 	element_list mData;
+	U32 mElementCount;
 		
 }; 
 
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index da0fa329633..0c6cf1dfae1 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -4617,18 +4617,83 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en
 				genBinormals(i);
 			}
 
-			if (!face.mOctree)
-			{
-				face.createOctree();
-			}
-			
-			//LLVector4a* p = (LLVector4a*) face.mPositions;
+			if (isUnique())
+			{ //don't bother with an octree for flexi volumes
+				U32 tri_count = face.mNumIndices/3;
+
+				for (U32 j = 0; j < tri_count; ++j)
+				{
+					U16 idx0 = face.mIndices[j*3+0];
+					U16 idx1 = face.mIndices[j*3+1];
+					U16 idx2 = face.mIndices[j*3+2];
 
-			LLOctreeTriangleRayIntersect intersect(start, dir, &face, &closest_t, intersection, tex_coord, normal, bi_normal);
-			intersect.traverse(face.mOctree);
-			if (intersect.mHitFace)
+					const LLVector4a& v0 = face.mPositions[idx0];
+					const LLVector4a& v1 = face.mPositions[idx1];
+					const LLVector4a& v2 = face.mPositions[idx2];
+				
+					F32 a,b,t;
+
+					if (LLTriangleRayIntersect(v0, v1, v2,
+							start, dir, a, b, t))
+					{
+						if ((t >= 0.f) &&      // if hit is after start
+							(t <= 1.f) &&      // and before end
+							(t < closest_t))   // and this hit is closer
+						{
+							closest_t = t;
+							hit_face = i;
+
+							if (intersection != NULL)
+							{
+								LLVector4a intersect = dir;
+								intersect.mul(closest_t);
+								intersect.add(start);
+								intersection->set(intersect.getF32ptr());
+							}
+
+
+							if (tex_coord != NULL)
+							{
+								LLVector2* tc = (LLVector2*) face.mTexCoords;
+								*tex_coord = ((1.f - a - b)  * tc[idx0] +
+									a              * tc[idx1] +
+									b              * tc[idx2]);
+
+							}
+
+							if (normal!= NULL)
+							{
+								LLVector4* norm = (LLVector4*) face.mNormals;
+
+								*normal		= ((1.f - a - b)  * LLVector3(norm[idx0]) + 
+									a              * LLVector3(norm[idx1]) +
+									b              * LLVector3(norm[idx2]));
+							}
+
+							if (bi_normal != NULL)
+							{
+								LLVector4* binormal = (LLVector4*) face.mBinormals;
+								*bi_normal = ((1.f - a - b)  * LLVector3(binormal[idx0]) + 
+										a              * LLVector3(binormal[idx1]) +
+										b              * LLVector3(binormal[idx2]));
+							}
+						}
+					}
+				}
+			}
+			else
 			{
-				hit_face = i;
+				if (!face.mOctree)
+				{
+					face.createOctree();
+				}
+			
+				LLOctreeTriangleRayIntersect intersect(start, dir, &face, &closest_t, intersection, tex_coord, normal, bi_normal);
+				intersect.traverse(face.mOctree);
+				if (intersect.mHitFace)
+				{
+					hit_face = i;
+				}
 			}
 		}		
 	}
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index fb107a302a6..900f126049c 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -3775,11 +3775,7 @@ void renderRaycast(LLDrawable* drawablep)
 				for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
 				{
 					const LLVolumeFace& face = volume->getVolumeFace(i);
-					if (!face.mOctree)
-					{
-						((LLVolumeFace*) &face)->createOctree(); 
-					}
-
+					
 					gGL.pushMatrix();
 					gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);					
 					gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
@@ -3802,9 +3798,6 @@ void renderRaycast(LLDrawable* drawablep)
 					LLVector4a dir;
 					dir.setSub(enda, starta);
 
-					F32 t = 1.f;
-
-					LLRenderOctreeRaycast render(starta, dir, &t);
 					gGL.flush();
 					glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);				
 
@@ -3816,8 +3809,21 @@ void renderRaycast(LLDrawable* drawablep)
 						gGL.syncMatrices();
 						glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
 					}
-						
-					render.traverse(face.mOctree);
+					
+					if (!volume->isUnique())
+					{
+						F32 t = 1.f;
+
+						if (!face.mOctree)
+						{
+							((LLVolumeFace*) &face)->createOctree(); 
+						}
+
+						LLRenderOctreeRaycast render(starta, dir, &t);
+					
+						render.traverse(face.mOctree);
+					}
+
 					gGL.popMatrix();		
 					glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 				}
-- 
GitLab


From 5b6fe3a8388ae8f3b0e49899a1ff4a0b5aca35fd Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 16 Dec 2011 16:35:21 -0800
Subject: [PATCH 461/933] EXP-1730 FIX -- Library items can be dragged and
 dropped to Outbox floater and folders are not created for items

* Updated to proper tooltip string
---
 indra/newview/llinventorybridge.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index ff980955e02..3f12067048b 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2108,7 +2108,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	{
 		if (move_is_into_outbox)
 		{
-			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNoTransferLibrary");
+			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
 			accept = FALSE;
 		}
 		else
-- 
GitLab


From 399bd5643cdec65b98b76556b16e3a00df6db1b2 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sat, 17 Dec 2011 13:27:20 -0500
Subject: [PATCH 462/933] STORM-653 As a user i would like to be able to see
 the available number of attachments and remaining free slots.

---
 doc/contributions.txt                              |  1 +
 indra/newview/llcofwearables.cpp                   | 14 ++++++++++++++
 indra/newview/llcofwearables.h                     |  2 ++
 .../skins/default/xui/en/panel_cof_wearables.xml   |  1 +
 indra/newview/skins/default/xui/en/strings.xml     |  1 +
 5 files changed, 19 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..24743777f79 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	STORM-653
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 54598f90c83..e9c7a3fa039 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -328,6 +328,19 @@ BOOL LLCOFWearables::postBuild()
 	return LLPanel::postBuild();
 }
 
+void LLCOFWearables::setAttachmentsTitle()
+{
+	if (mAttachmentsTab)
+	{
+		U32 free_slots = MAX_AGENT_ATTACHMENTS - mAttachments->size();
+
+		LLStringUtil::format_map_t args_attachments;
+		args_attachments["[COUNT]"] = llformat ("%d", free_slots);
+		std::string attachments_title = LLTrans::getString("Attachments remain", args_attachments);
+		mAttachmentsTab->setTitle(attachments_title);
+	}
+}
+
 void LLCOFWearables::onSelectionChange(LLFlatListView* selected_list)
 {
 	if (!selected_list) return;
@@ -490,6 +503,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel
 	{
 		mAttachments->sort();
 		mAttachments->notify(REARRANGE); //notifying the parent about the list's size change (cause items were added with rearrange=false)
+		setAttachmentsTitle();
 	}
 	else
 	{
diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h
index 1f8d6d0c94e..9957d6a64e1 100644
--- a/indra/newview/llcofwearables.h
+++ b/indra/newview/llcofwearables.h
@@ -91,6 +91,8 @@ class LLCOFWearables : public LLPanel
 	 */
 	void selectClothing(LLWearableType::EType clothing_type);
 
+	void setAttachmentsTitle();
+
 protected:
 
 	void populateAttachmentsAndBodypartsLists(const LLInventoryModel::item_array_t& cof_items);
diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
index beea53437a8..aa8e3d07a6e 100644
--- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
+++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
@@ -37,6 +37,7 @@
              top="0"
              width="311" />
         </accordion_tab>
+         <!-- The Attachments title is overwritten by the definition of "Attachments remain" in strings.xml -->
         <accordion_tab
          layout="topleft"
          name="tab_attachments"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c25d1f57d6e..30697278c3a 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2133,6 +2133,7 @@ Returns a string with the requested data about the region
 	<string name="InvFolder All">All</string>
 
 	<string name="no_attachments">No attachments worn</string>
+    <string name="Attachments remain">Attachments ([COUNT] slots remain)</string>
 
 	<!-- inventory FVBridge -->
 	<!--  This is used in llpanelinventory.cpp when constructing a context menu for an item for Sale  -->
-- 
GitLab


From 5226629883b20dcf105f78c5633124d1f57fd399 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sun, 18 Dec 2011 10:29:05 -0500
Subject: [PATCH 463/933] STORM-1737 panel_edit_skin.xml uses confusing
 historical terminology

---
 doc/contributions.txt                                |  1 +
 indra/newview/llpaneleditwearable.cpp                |  6 +++---
 .../newview/skins/default/xui/en/panel_edit_skin.xml | 12 ++++++------
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..69a9cfd37b4 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	STORM-1737
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index b73d97e4c41..03404e816b1 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -356,9 +356,9 @@ LLEditWearableDictionary::ColorSwatchCtrls::ColorSwatchCtrls()
 
 LLEditWearableDictionary::TextureCtrls::TextureCtrls()
 {
-        addEntry ( TEX_HEAD_BODYPAINT,  new PickerControlEntry (TEX_HEAD_BODYPAINT,  "Head Tattoos", LLUUID::null, TRUE ));
-        addEntry ( TEX_UPPER_BODYPAINT, new PickerControlEntry (TEX_UPPER_BODYPAINT, "Upper Tattoos", LLUUID::null, TRUE ));
-        addEntry ( TEX_LOWER_BODYPAINT, new PickerControlEntry (TEX_LOWER_BODYPAINT, "Lower Tattoos", LLUUID::null, TRUE ));
+        addEntry ( TEX_HEAD_BODYPAINT,  new PickerControlEntry (TEX_HEAD_BODYPAINT,  "Head", LLUUID::null, TRUE ));
+        addEntry ( TEX_UPPER_BODYPAINT, new PickerControlEntry (TEX_UPPER_BODYPAINT, "Upper Body", LLUUID::null, TRUE ));
+        addEntry ( TEX_LOWER_BODYPAINT, new PickerControlEntry (TEX_LOWER_BODYPAINT, "Lower Body", LLUUID::null, TRUE ));
         addEntry ( TEX_HAIR, new PickerControlEntry (TEX_HAIR, "Texture", LLUUID( gSavedSettings.getString( "UIImgDefaultHairUUID" ) ), FALSE ));
         addEntry ( TEX_EYES_IRIS, new PickerControlEntry (TEX_EYES_IRIS, "Iris", LLUUID( gSavedSettings.getString( "UIImgDefaultEyesUUID" ) ), FALSE ));
         addEntry ( TEX_UPPER_SHIRT, new PickerControlEntry (TEX_UPPER_SHIRT, "Fabric", LLUUID( gSavedSettings.getString( "UIImgDefaultShirtUUID" ) ), FALSE ));
diff --git a/indra/newview/skins/default/xui/en/panel_edit_skin.xml b/indra/newview/skins/default/xui/en/panel_edit_skin.xml
index 45591ba2ad7..b61f65a3d16 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_skin.xml
@@ -27,10 +27,10 @@
         default_image_name="Default"
         follows="left|top"
         height="80"
-        label="Head Tattoos"
+        label="Head"
         layout="topleft"
         left="25"
-        name="Head Tattoos"
+        name="Head"
         tool_tip="Click to choose a picture"
         top="10"
         width="74" >
@@ -43,10 +43,10 @@
         default_image_name="Default"
         follows="left|top"
         height="80"
-        label="Upper Tattoos"
+        label="Upper body"
         layout="topleft"
         left_pad="20"
-        name="Upper Tattoos"
+        name="Upper Body"
         tool_tip="Click to choose a picture"
         top="10"
         width="74" >
@@ -59,10 +59,10 @@
         default_image_name="Default"
         follows="left|top"
         height="80"
-        label="Lower Tattoos"
+        label="Lower body"
         layout="topleft"
         left_pad="20"
-        name="Lower Tattoos"
+        name="Lower Body"
         tool_tip="Click to choose a picture"
         top="10"
         width="74" >
-- 
GitLab


From 97a2663cf9fc28a9b651d423f4eb0e506b3c507d Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 19 Dec 2011 11:25:14 -0800
Subject: [PATCH 464/933] EXP-1745 FIX -- removed the merchant outbox from the
 toolbox

---
 indra/newview/app_settings/commands.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index c12d22adc32..1d1d39c786b 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -136,7 +136,7 @@
            is_running_parameters="moveview"
            />
   <command name="outbox"
-           available_in_toybox="true"
+           available_in_toybox="false"
            icon="Command_Outbox_Icon"
            label_ref="Command_Outbox_Label"
            tooltip_ref="Command_Outbox_Tooltip"
-- 
GitLab


From 4c8d00d1d368df2d34d6e7ac9732820a56e21999 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 19 Dec 2011 15:25:39 -0500
Subject: [PATCH 465/933] update build params for oz viewer-trial build

---
 BuildParams | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/BuildParams b/BuildParams
index 3f5d6f8c6b6..c0513978537 100644
--- a/BuildParams
+++ b/BuildParams
@@ -145,6 +145,17 @@ oz_viewer-devreview.codeticket_add_context = false
 oz_viewer-devreview.build_enforce_coding_policy = true
 oz_viewer-devreview.email = oz@lindenlab.com
 
+oz_viewer-trial.build_debug_release_separately = true
+oz_viewer-trial.codeticket_add_context = false
+oz_viewer-trial.build_enforce_coding_policy = true
+oz_viewer-trial.email = oz@lindenlab.com
+
+oz_viewer-beta-review.build_debug_release_separately = true
+oz_viewer-beta-review.codeticket_add_context = false
+oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
+oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
+oz_viewer-beta-review.email = oz@lindenlab.com
+
 oz_project-1.build_debug_release_separately = true
 oz_project-1.codeticket_add_context = false
 oz_project-1.email = oz@lindenlab.com
@@ -157,15 +168,6 @@ oz_project-3.email = oz@lindenlab.com
 oz_project-4.build_debug_release_separately = true
 oz_project-4.codeticket_add_context = false
 oz_project-4.email = oz@lindenlab.com
-oz_project-5.build_debug_release_separately = true
-oz_project-5.codeticket_add_context = false
-oz_project-5.email = oz@lindenlab.com
-
-oz_viewer-beta-review.build_debug_release_separately = true
-oz_viewer-beta-review.codeticket_add_context = false
-oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
-oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
-oz_viewer-beta-review.email = oz@lindenlab.com
 
 # =================================================================
 # asset delivery 2010 projects
-- 
GitLab


From 58f9982fbc94ed2f039f0cd32579fa572f87e8ba Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 19 Dec 2011 15:35:38 -0600
Subject: [PATCH 466/933] SH-2738 Add comment documenting need to not make main
 thread wait on curl_multi_perform

---
 indra/llmessage/llcurl.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 874f4673ca1..20f0c6c6026 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -675,6 +675,10 @@ bool LLCurl::Multi::doPerform()
 				call_count++)
 		{
 			LLMutexLock lock(mMutexp) ;
+
+			//WARNING: curl_multi_perform will block for many hundreds of milliseconds
+			// NEVER call this from the main thread, and NEVER allow the main thread to 
+			// wait on a mutex held by this thread while curl_multi_perform is executing
 			CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q);
 			if (CURLM_CALL_MULTI_PERFORM != code || q == 0)
 			{
-- 
GitLab


From ac01fb0e0378476fd572ba24151d73840f119519 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 19 Dec 2011 13:55:53 -0800
Subject: [PATCH 467/933] EXP-1683 FIX -- Add main inventory context menu
 option Copy To Outbox

* The logic to determine whether or not the "Copy to Merchant Outbox" item is available is now tied to drag and drop functionality.
---
 indra/newview/llinventorybridge.cpp | 33 +++++++++++++++++------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3f12067048b..d8e0529501b 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1102,26 +1102,33 @@ BOOL LLInvFVBridge::canListOnMarketplace() const
 
 BOOL LLInvFVBridge::canListOnMarketplaceNow() const
 {
+	BOOL can_list = FALSE;
+	
 #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
 
-#if BLOCK_WORN_ITEMS_IN_OUTBOX
-	if (get_is_item_worn(mUUID))
-	{
-		return FALSE;
-	}
+	const LLInventoryObject* obj = getInventoryObject();
 
-	// Loop through all items worn by avatar and check to see if they are descendants
-	// of the item we are trying to list on the marketplace
-	if (get_is_parent_to_worn_item(mUUID))
+	if (obj)
 	{
-		return FALSE;
+		// Get outbox id
+		const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+		LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id);
+
+		if (outbox_itemp)
+		{
+			MASK mask = 0x0;
+			BOOL drop = FALSE;
+			EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType());
+			void * cargo_data = (void *) obj;
+			std::string tooltip_msg;
+			
+			can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg);
+		}
 	}
-#endif // BLOCK_WORN_ITEMS_IN_OUTBOX
 
-	return TRUE;
-#else
-	return FALSE;
 #endif
+
+	return can_list;
 }
 
 
-- 
GitLab


From a0929f39caba9c2b7be8184f217c8e2a811857eb Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 19 Dec 2011 13:58:36 -0800
Subject: [PATCH 468/933] EXP-1170 FIX -- Right click context menu to Copy to
 Outbox shown if user is not a merchant

* The context menu option is no longer shown if the user does not have an outbox.
---
 indra/newview/llinventorybridge.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d8e0529501b..7665ad6e88e 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1087,6 +1087,12 @@ BOOL LLInvFVBridge::canListOnMarketplace() const
 	{
 		return FALSE;
 	}
+	
+	const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+	if (outbox_id.isNull())
+	{
+		return FALSE;
+	}
 
 	LLViewerInventoryItem * item = model->getItem(mUUID);
 	if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
-- 
GitLab


From 43e3603cd763f5f501c8c5dc008d8a00d0744c53 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 19 Dec 2011 16:55:21 -0600
Subject: [PATCH 469/933] SH-2738 Don't lock unless we really need to

---
 indra/llmessage/llcurl.cpp | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index d86bf7a0a11..988c12d6fb5 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -612,13 +612,7 @@ void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
 {
-	ePerformState state ;
-
-	lock() ;
-	state = mState ;
-	unlock() ;
-
-	return state ;
+	return mState;
 }
 	
 bool LLCurl::Multi::isCompleted() 
@@ -636,14 +630,12 @@ bool LLCurl::Multi::waitToComplete()
 
 	bool completed ;
 
-	lock() ;
 	completed = (STATE_COMPLETED == mState) ;
 	if(!completed)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
 	}
-	unlock() ;
-
+	
 	return completed;
 }
 
-- 
GitLab


From 5affaf264da937cdf825bf174c3905a6063b5336 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 19 Dec 2011 16:55:21 -0600
Subject: [PATCH 470/933] SH-2738 Don't lock unless we really need to

---
 indra/llmessage/llcurl.cpp | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 20f0c6c6026..05f3869a11e 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -612,13 +612,7 @@ void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
 {
-	ePerformState state ;
-
-	lock() ;
-	state = mState ;
-	unlock() ;
-
-	return state ;
+	return mState;
 }
 	
 bool LLCurl::Multi::isCompleted() 
@@ -636,14 +630,12 @@ bool LLCurl::Multi::waitToComplete()
 
 	bool completed ;
 
-	lock() ;
 	completed = (STATE_COMPLETED == mState) ;
 	if(!completed)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
 	}
-	unlock() ;
-
+	
 	return completed;
 }
 
-- 
GitLab


From 6c26fdea4d62f723c3bdbec9ded032e6d77301b8 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 19 Dec 2011 16:46:26 -0800
Subject: [PATCH 471/933] EXP-1741 FIX -- Learn more link goes to page not
 found from Outbox for user that is not a merchant an Agni EXP-1746 FIX --
 Update Outbox messaging EXP-1748 FIX -- Close down on messaging with Spinner
 MKT-3403 support -- viewer tooltips updated to match errors in marketplace

* Copy has been updated to match the design per Leo and Brooke
* Marketplace URL's have also been updated
* The outbox floater now reports a status string in the existing folder count control
---
 indra/newview/llfloateroutbox.cpp             | 43 ++++++++++++++-----
 indra/newview/llfloateroutbox.h               | 23 +++++-----
 indra/newview/llinventorybridge.cpp           |  2 +-
 .../xui/en/floater_merchant_outbox.xml        | 12 +++---
 .../newview/skins/default/xui/en/strings.xml  | 37 +++++++---------
 5 files changed, 68 insertions(+), 49 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 725e521e58c..239ba7ad4d8 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -103,15 +103,16 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
 	: LLFloater(key)
 	, mCategoriesObserver(NULL)
 	, mCategoryAddedObserver(NULL)
-	, mOutboxId(LLUUID::null)
-	, mOutboxInventoryPanel(NULL)
-	, mOutboxItemCount(0)
+	, mImportBusy(false)
+	, mImportButton(NULL)
 	, mInventoryFolderCountText(NULL)
 	, mInventoryImportInProgress(NULL)
 	, mInventoryPlaceholder(NULL)
 	, mInventoryText(NULL)
 	, mInventoryTitle(NULL)
-	, mImportButton(NULL)
+	, mOutboxId(LLUUID::null)
+	, mOutboxInventoryPanel(NULL)
+	, mOutboxItemCount(0)
 	, mWindowShade(NULL)
 {
 }
@@ -251,12 +252,22 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	// Initialize the marketplace import API
 	//
 	
+	mImportBusy = true;
+	setStatusString(getString("OutboxInitializing"));
+
 	LLMarketplaceInventoryImporter::getInstance()->initialize();
 	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
 	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
 }
 
-void LLFloaterOutbox::updateItemCount()
+void LLFloaterOutbox::setStatusString(const std::string& statusString)
+{
+	llassert(mInventoryFolderCountText != NULL);
+
+	mInventoryFolderCountText->setText(statusString);
+}
+
+void LLFloaterOutbox::updateFolderCount()
 {
 	S32 item_count = 0;
 
@@ -275,8 +286,8 @@ void LLFloaterOutbox::updateItemCount()
 	{
 		switch (mOutboxItemCount)
 		{
-			case 0:	mInventoryFolderCountText->setText(getString("OutboxFolderCount0"));	break;
-			case 1:	mInventoryFolderCountText->setText(getString("OutboxFolderCount1"));	break;
+			case 0:	setStatusString(getString("OutboxFolderCount0"));	break;
+			case 1:	setStatusString(getString("OutboxFolderCount1"));	break;
 			default:
 			{
 				std::string item_count_str = llformat("%d", mOutboxItemCount);
@@ -284,7 +295,7 @@ void LLFloaterOutbox::updateItemCount()
 				LLStringUtil::format_map_t args;
 				args["[NUM]"] = item_count_str;
 				
-				mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args));
+				setStatusString(getString("OutboxFolderCountN", args));
 				break;
 			}
 		}
@@ -295,7 +306,10 @@ void LLFloaterOutbox::updateItemCount()
 
 void LLFloaterOutbox::updateView()
 {
-	updateItemCount();
+	if (!mImportBusy)
+	{
+		updateFolderCount();
+	}
 
 	if (mOutboxItemCount > 0)
 	{
@@ -431,15 +445,22 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 {
 	if (inProgress)
 	{
-		mImportButton->setEnabled(false);
+		if (!mImportBusy)
+		{
+			setStatusString(getString("OutboxImporting"));
+		}
 		
+		mImportBusy = true;
+		mImportButton->setEnabled(false);
 		mInventoryImportInProgress->setVisible(true);
 	}
 	else
 	{
+		mImportBusy = false;
+		mImportButton->setEnabled(mOutboxItemCount > 0);
 		mInventoryImportInProgress->setVisible(false);
 
-		mImportButton->setEnabled(mOutboxItemCount > 0);
+		updateView();
 	}
 }
 
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 5222db1142a..5cb487be648 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -80,25 +80,28 @@ class LLFloaterOutbox : public LLFloater
 	void onImportButtonClicked();
 	void onOutboxChanged();
 	
-	void updateItemCount();
+	void setStatusString(const std::string& statusString);
+	
+	void updateFolderCount();
 	void updateView();
 
 private:
 	LLInventoryCategoriesObserver *		mCategoriesObserver;
 	LLInventoryCategoryAddedObserver *	mCategoryAddedObserver;
-
+	
+	bool			mImportBusy;
+	LLButton *		mImportButton;
+	
+	LLTextBox *		mInventoryFolderCountText;
+	LLView *		mInventoryImportInProgress;
+	LLView *		mInventoryPlaceholder;
+	LLTextBox *		mInventoryText;
+	LLTextBox *		mInventoryTitle;
+	
 	LLUUID				mOutboxId;
 	LLInventoryPanel *	mOutboxInventoryPanel;
 	U32					mOutboxItemCount;
 	
-	LLTextBox *				mInventoryFolderCountText;
-	LLView *				mInventoryImportInProgress;
-	LLView *				mInventoryPlaceholder;
-	LLTextBox *				mInventoryText;
-	LLTextBox *				mInventoryTitle;
-	
-	LLButton *		mImportButton;
-	
 	LLWindowShade *	mWindowShade;
 };
 
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 7665ad6e88e..4e26f099784 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -73,7 +73,7 @@
 
 // Marketplace outbox current disabled
 #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1
-#define BLOCK_WORN_ITEMS_IN_OUTBOX 0
+#define BLOCK_WORN_ITEMS_IN_OUTBOX 1
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
 typedef std::list<two_uuids_t> two_uuids_list_t;
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 0368601bf4e..eb68339022b 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -16,6 +16,8 @@
  <string name="OutboxFolderCount0">0 folders</string>
  <string name="OutboxFolderCount1">1 folder</string>
  <string name="OutboxFolderCountN">[NUM] folders</string>
+ <string name="OutboxImporting">Sending items...</string>
+ <string name="OutboxInitializing">Initializing...</string>
  <panel
       follows="all"
       layout="topleft"
@@ -82,13 +84,13 @@
 			type="string"
 			follows="all"
 			layout="topleft"
-			top="7"
+			top="10"
 			left="5"
-			width="100"
+			width="150"
 			height="20"
 			wrap="true"
 			halign="left"
-			valign="baseline"
+			valign="bottom"
 			font="SansSerif" />
 		<button
 			 label="Send to Marketplace"
@@ -99,9 +101,9 @@
 			 tab_stop="false"
 			 halign="center"
 			 top="3"
-			 left="110"
+			 left="160"
 			 height="25"
-			 width="200"
+			 width="150"
 			 enabled="false" />
     </panel>
 	<layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 0d9a7e5c417..18ca3033e99 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -164,12 +164,13 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipLand">Land:</string>
 	<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]: "/>
-	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred to another user.</string>
-	<string name="TooltipOutboxNotInInventory">You can only transfer objects in your inventory to your merchant outbox.</string>
-	<string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
-	<string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
-	<string name="TooltipOutboxTooManyFolders">This folder has too many subfolders. Reorganize the interior to a maximum of 20 folders.</string>
-	<string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
+
+	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred.</string>
+	<string name="TooltipOutboxNotInInventory">Your merchant outbox can only accept items directly from your inventory</string>
+	<string name="TooltipOutboxWorn">You can not put items you are wearing into your merchant outbox</string>
+	<string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds 3</string>
+	<string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds 20</string>
+	<string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds 200</string>
 	
 	<!-- tooltips for Urls -->
 	<string name="TooltipHttpUrl">Click to view this web page</string>
@@ -2032,33 +2033,25 @@ Returns a string with the requested data about the region
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
 	<string name="InventoryInboxNoItems">When you purchase or otherwise receive an item, it will appear here so you can drag it to a folder in your inventory, or delete it if you do not wish to keep it.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
-	<string name="MarketplaceURL_CreateStore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/create_store</string>
-	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/[AGENT_ID]/store/dashboard</string>
+	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
+	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
 	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
-	<string name="InventoryOutboxCreationErrorTitle">Your Merchant Outbox is not properly configured</string>
-	<string name="InventoryOutboxCreationErrorTooltip">Merchant Outbox configuration error</string>
-	<string name="InventoryOutboxCreationError">Please contact Customer Service to correct the problem.</string>
 	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace.</string>
-	<string name="InventoryOutboxNotMerchantTooltip">Become a merchant!</string>
+	<string name="InventoryOutboxNotMerchantTooltip"></string>
 	<string name="InventoryOutboxNotMerchant">
-The Second Life Marketplace offers more than one million virtual products for sale, all of them created by Residents like you.  You too can create items and sell them on the Marketplace.  Creating a store is easy and free of charge.
-
-[[MARKETPLACE_URL] Visit the Marketplace]
-
-[[MARKETPLACE_LEARN_MORE_URL] Learn more about creating a store]
+If you'd like to become a merchant, you'll need to [[MARKETPLACE_CREATE_STORE_URL] create a Marketplace store].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">Your outbox is empty.</string>
-	<string name="InventoryOutboxNoItemsTooltip">Drag and drop items here to prepare them for sale on the Marketplace</string>
+	<string name="InventoryOutboxNoItemsTooltip"></string>
 	<string name="InventoryOutboxNoItems">
-Drag folders to this area.  When you are ready to send them to the Marketplace for sale, click the "Send to Marketplace" button below.
-
-[[MARKETPLACE_DASHBOARD_URL] Go to your Merchant Dashboard]
+Drag folders to this area and click "Send to Marketplace" to list them for sale on the [[MARKETPLACE_DASHBOARD_URL] Marketplace].
 	</string>
 
 	<string name="Marketplace Error None">No errors</string>
 	<string name="Marketplace Error Not Merchant">Error: Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string>
 	<string name="Marketplace Error Empty Folder">Error: This folder has no contents.</string>
-	<string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products.  To fix this error, login to the marketplace website and reduce your unassociated item count.</string>
+	<string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products.  To fix this error, log in to the marketplace website and reduce your unassociated item count.</string>
+
 	<string name="Marketplace Error Object Limit">Error: This item contains too many objects.  Fix this error by placing objects together in boxes to reduce the total count to less than 200.</string>
 	<string name="Marketplace Error Folder Depth">Error: This item contains too many levels of nested folders.  Reorganize it to a maximum of 3 levels of nested folders.</string>
 	<string name="Marketplace Error Unsellable Item">Error: This item can not be sold on the marketplace.</string>
-- 
GitLab


From 744484699cec728f60463755d409fbde681429ea Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 19 Dec 2011 17:29:17 -0800
Subject: [PATCH 472/933] EXP-1749 FIX -- Merchant outbox import completion
 messages are to be modal dialogs

* Merchant outbox completion messages now shown as modal dialogs rather than window shades.
---
 indra/newview/llfloateroutbox.cpp             | 42 ++++++++++++++-----
 indra/newview/llfloateroutbox.h               |  2 +-
 .../skins/default/xui/en/notifications.xml    |  4 +-
 3 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 239ba7ad4d8..b97cc54dd1e 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -36,6 +36,7 @@
 #include "llinventorypanel.h"
 #include "llmarketplacefunctions.h"
 #include "llnotificationhandler.h"
+#include "llnotificationmanager.h"
 #include "llnotificationsutil.h"
 #include "lltextbox.h"
 #include "lltransientfloatermgr.h"
@@ -43,6 +44,8 @@
 #include "llviewernetwork.h"
 #include "llwindowshade.h"
 
+#define USE_WINDOWSHADE_DIALOGS	0
+
 
 ///----------------------------------------------------------------------------
 /// LLOutboxNotification class
@@ -50,14 +53,9 @@
 
 bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& notify)
 {
-	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
-
-	if (notification)
-	{
-		LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance<LLFloaterOutbox>("outbox");
-
-		outbox_floater->showNotification(notification);
-	}
+	LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance<LLFloaterOutbox>("outbox");
+	
+	outbox_floater->showNotification(notify);
 
 	return false;
 }
@@ -413,6 +411,7 @@ void LLFloaterOutbox::onOutboxChanged()
 	}
 
 	fetchOutboxContents();
+
 	updateView();
 }
 
@@ -464,8 +463,19 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 	}
 }
 
-void LLFloaterOutbox::showNotification(LLNotificationPtr notify)
+void LLFloaterOutbox::showNotification(const LLSD& notify)
 {
+	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+	
+	if (!notification)
+	{
+		llerrs << "Unable to find outbox notification!" << notify.asString() << llendl;
+		
+		return;
+	}
+
+#if USE_WINDOWSHADE_DIALOGS
+
 	if (mWindowShade)
 	{
 		delete mWindowShade;
@@ -487,6 +497,18 @@ void LLFloaterOutbox::showNotification(LLNotificationPtr notify)
 	mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
 	
 	addChild(mWindowShade);
-	mWindowShade->show(notify);
+	mWindowShade->show(notification);
+	
+#else
+	
+	LLNotificationsUI::LLEventHandler * handler =
+		LLNotificationsUI::LLNotificationManager::instance().getHandlerForNotification("alertmodal");
+	
+	LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast<LLNotificationsUI::LLSysHandler *>(handler);
+	llassert(sys_handler);
+	
+	sys_handler->processNotification(notify);
+	
+#endif
 }
 
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 5cb487be648..cc4a7207ca8 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -64,7 +64,7 @@ class LLFloaterOutbox : public LLFloater
 						   EAcceptance* accept,
 						   std::string& tooltip_msg);
 	
-	void showNotification(LLNotificationPtr notify);
+	void showNotification(const LLSD& notify);
 
 protected:
 	void fetchOutboxContents();
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 871a9d4a1da..858764006f6 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -203,8 +203,8 @@ Save changes to current clothing/body part?
    icon="alertmodal.tga"
      name="ConfirmNoCopyToOutbox"
      type="alertmodal">
-        You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item?
-        [ITEM_NAME]
+You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item?
+[ITEM_NAME]
         <usetemplate
          name="okcancelbuttons"
          notext="No"
-- 
GitLab


From cfc6ac76e1c700c0810629b005f45747c4144867 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 20 Dec 2011 11:04:10 -0700
Subject: [PATCH 473/933] more tuning of llcurl code targeting crashes like
 SH-2777.

---
 indra/llmessage/llcurl.cpp | 43 ++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 11 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 988c12d6fb5..2b351d351ef 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -603,11 +603,12 @@ void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 {
 	lock() ;
 	mState = state ;
+	unlock() ;
+
 	if(mState == STATE_READY)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ;
-	}
-	unlock() ;
+	}	
 }
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
@@ -628,9 +629,7 @@ bool LLCurl::Multi::waitToComplete()
 		return true ;
 	}
 
-	bool completed ;
-
-	completed = (STATE_COMPLETED == mState) ;
+	bool completed = (STATE_COMPLETED == mState) ;
 	if(!completed)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
@@ -641,6 +640,8 @@ bool LLCurl::Multi::waitToComplete()
 
 CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 {
+	LLMutexLock lock(mMutexp) ;
+
 	CURLMsg* curlmsg = curl_multi_info_read(mCurlMultiHandle, msgs_in_queue);
 	return curlmsg;
 }
@@ -702,10 +703,19 @@ S32 LLCurl::Multi::process()
 		if (msg->msg == CURLMSG_DONE)
 		{
 			U32 response = 0;
-			easy_active_map_t::iterator iter = mEasyActiveMap.find(msg->easy_handle);
-			if (iter != mEasyActiveMap.end())
+			Easy* easy = NULL ;
+
+			{
+				LLMutexLock lock(mEasyMutexp) ;
+				easy_active_map_t::iterator iter = mEasyActiveMap.find(msg->easy_handle);
+				if (iter != mEasyActiveMap.end())
+				{
+					easy = iter->second;
+				}
+			}
+
+			if(easy)
 			{
-				Easy* easy = iter->second;
 				response = easy->report(msg->data.result);
 				removeEasy(easy);
 			}
@@ -766,20 +776,31 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
-	mEasyMutexp->lock() ;
+	if(mEasyMutexp)
+	{
+		mEasyMutexp->lock() ;
+	}
+
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
 
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
 	{		
 		mEasyFreeList.insert(easy);
-		mEasyMutexp->unlock() ;
+		
+		if(mEasyMutexp)
+		{
+			mEasyMutexp->unlock() ;
+		}
 
 		easy->resetState();
 	}
 	else
 	{
-		mEasyMutexp->unlock() ;
+		if(mEasyMutexp)
+		{
+			mEasyMutexp->unlock() ;
+		}
 		delete easy;
 	}
 }
-- 
GitLab


From 1620ad6d00a77b2089e0ae5f6de30f9a954c6167 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 20 Dec 2011 11:04:10 -0700
Subject: [PATCH 474/933] more tuning of llcurl code targeting crashes like
 SH-2777.

---
 indra/llmessage/llcurl.cpp | 43 ++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 11 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 05f3869a11e..5027e8fa84f 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -603,11 +603,12 @@ void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
 {
 	lock() ;
 	mState = state ;
+	unlock() ;
+
 	if(mState == STATE_READY)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_NORMAL) ;
-	}
-	unlock() ;
+	}	
 }
 
 LLCurl::Multi::ePerformState LLCurl::Multi::getState()
@@ -628,9 +629,7 @@ bool LLCurl::Multi::waitToComplete()
 		return true ;
 	}
 
-	bool completed ;
-
-	completed = (STATE_COMPLETED == mState) ;
+	bool completed = (STATE_COMPLETED == mState) ;
 	if(!completed)
 	{
 		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
@@ -641,6 +640,8 @@ bool LLCurl::Multi::waitToComplete()
 
 CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
 {
+	LLMutexLock lock(mMutexp) ;
+
 	CURLMsg* curlmsg = curl_multi_info_read(mCurlMultiHandle, msgs_in_queue);
 	return curlmsg;
 }
@@ -706,10 +707,19 @@ S32 LLCurl::Multi::process()
 		if (msg->msg == CURLMSG_DONE)
 		{
 			U32 response = 0;
-			easy_active_map_t::iterator iter = mEasyActiveMap.find(msg->easy_handle);
-			if (iter != mEasyActiveMap.end())
+			Easy* easy = NULL ;
+
+			{
+				LLMutexLock lock(mEasyMutexp) ;
+				easy_active_map_t::iterator iter = mEasyActiveMap.find(msg->easy_handle);
+				if (iter != mEasyActiveMap.end())
+				{
+					easy = iter->second;
+				}
+			}
+
+			if(easy)
 			{
-				Easy* easy = iter->second;
 				response = easy->report(msg->data.result);
 				removeEasy(easy);
 			}
@@ -770,20 +780,31 @@ bool LLCurl::Multi::addEasy(Easy* easy)
 
 void LLCurl::Multi::easyFree(Easy* easy)
 {
-	mEasyMutexp->lock() ;
+	if(mEasyMutexp)
+	{
+		mEasyMutexp->lock() ;
+	}
+
 	mEasyActiveList.erase(easy);
 	mEasyActiveMap.erase(easy->getCurlHandle());
 
 	if (mEasyFreeList.size() < EASY_HANDLE_POOL_SIZE)
 	{		
 		mEasyFreeList.insert(easy);
-		mEasyMutexp->unlock() ;
+		
+		if(mEasyMutexp)
+		{
+			mEasyMutexp->unlock() ;
+		}
 
 		easy->resetState();
 	}
 	else
 	{
-		mEasyMutexp->unlock() ;
+		if(mEasyMutexp)
+		{
+			mEasyMutexp->unlock() ;
+		}
 		delete easy;
 	}
 }
-- 
GitLab


From 5dc8e44c767f839e3d2d1d926bfdeee969f2492e Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 20 Dec 2011 20:44:38 +0200
Subject: [PATCH 475/933] EXP-1499 FIXED Added some NULL checks in
 notifications UI code to avoid a crash on exit.

The crash happened if connection timed out while there were unread object inventory offers.
---
 indra/newview/llchiclet.cpp       |  6 ++++++
 indra/newview/llscriptfloater.cpp | 11 +++++++++--
 indra/newview/llsyswellwindow.cpp | 13 ++++++++++++-
 indra/newview/llsyswellwindow.h   |  1 +
 4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index a0763749032..045c9017bec 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -250,6 +250,12 @@ LLIMWellChiclet::LLIMWellChiclet(const Params& p)
 
 LLIMWellChiclet::~LLIMWellChiclet()
 {
+	LLIMWellWindow* im_well_window = LLIMWellWindow::findInstance();
+	if (im_well_window)
+	{
+		im_well_window->setSysWellChiclet(NULL);
+	}
+
 	LLIMMgr::getInstance()->removeSessionObserver(this);
 }
 
diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 85a7e752715..6f98be1cb87 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -408,9 +408,16 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
 	}
 
 	// remove related chiclet
-	LLChicletBar::getInstance()->getChicletPanel()->removeChiclet(notification_id);
+	if (LLChicletBar::instanceExists())
+	{
+		LLChicletBar::getInstance()->getChicletPanel()->removeChiclet(notification_id);
+	}
 
-	LLIMWellWindow::getInstance()->removeObjectRow(notification_id);
+	LLIMWellWindow* im_well_window = LLIMWellWindow::findInstance();
+	if (im_well_window)
+	{
+		im_well_window->removeObjectRow(notification_id);
+	}
 
 	mNotifications.erase(notification_id);
 
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 3aa6a3b7e5b..0cb6c850122 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -159,6 +159,7 @@ void LLSysWellWindow::setVisible(BOOL visible)
 	LLTransientDockableFloater::setVisible(visible);
 
 	// update notification channel state	
+	initChannel(); // make sure the channel still exists
 	if(mChannel)
 	{
 		mChannel->updateShowToastsState();
@@ -598,6 +599,13 @@ LLIMWellWindow* LLIMWellWindow::getInstance(const LLSD& key /*= LLSD()*/)
 	return LLFloaterReg::getTypedInstance<LLIMWellWindow>("im_well_window", key);
 }
 
+
+// static
+LLIMWellWindow* LLIMWellWindow::findInstance(const LLSD& key /*= LLSD()*/)
+{
+	return LLFloaterReg::findTypedInstance<LLIMWellWindow>("im_well_window", key);
+}
+
 BOOL LLIMWellWindow::postBuild()
 {
 	BOOL rv = LLSysWellWindow::postBuild();
@@ -751,7 +759,10 @@ void LLIMWellWindow::removeObjectRow(const LLUUID& notification_id)
 {
 	if (mMessageList->removeItemByValue(notification_id))
 	{
-		mSysWellChiclet->updateWidget(isWindowEmpty());
+		if (mSysWellChiclet)
+		{
+			mSysWellChiclet->updateWidget(isWindowEmpty());
+		}
 	}
 	else
 	{
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index 52e53705059..272e9cfcb12 100644
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -153,6 +153,7 @@ class LLIMWellWindow : public LLSysWellWindow, LLIMSessionObserver, LLInitClass<
 	~LLIMWellWindow();
 
 	static LLIMWellWindow* getInstance(const LLSD& key = LLSD());
+	static LLIMWellWindow* findInstance(const LLSD& key = LLSD());
 	static void initClass() { getInstance(); }
 
 	/*virtual*/ BOOL postBuild();
-- 
GitLab


From 11e192d9a72274d24e2a50799904c7a64ab33e27 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 20 Dec 2011 11:43:02 -0800
Subject: [PATCH 476/933] EXP-1738 FIX -- Disable drag and drop to folders in
 the outbox that would create a hierarchy that contains too many folders
 EXP-1743 FIX -- Tooltip errors given when dragging and dropping folders onto
 themselves in Merchant Outbox

* Top level folder now reflected in folder count for total folders
* Earlier rejections now honored in drag and drop code so outbox-specific tooltips only show up when appropriate
---
 indra/newview/llinventorybridge.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 4e26f099784..2ff6563a097 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1918,9 +1918,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		BOOL is_movable = TRUE;
 		if (LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType()))
 			is_movable = FALSE;
-		if (move_is_into_outfit)
+		else if (move_is_into_outfit)
 			is_movable = FALSE;
-		if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE))
+		else if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE))
 			is_movable = FALSE;
 		LLInventoryModel::cat_array_t descendent_categories;
 		LLInventoryModel::item_array_t descendent_items;
@@ -1935,7 +1935,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 				break;
 			}
 		}
-		if (move_is_into_trash)
+		if (is_movable && move_is_into_trash)
 		{
 			for (S32 i=0; i < descendent_items.count(); ++i)
 			{
@@ -1947,7 +1947,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 				}
 			}
 		}
-		if (move_is_into_landmarks)
+		if (is_movable && move_is_into_landmarks)
 		{
 			for (S32 i=0; i < descendent_items.count(); ++i)
 			{
@@ -1962,7 +1962,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 				}
 			}
 		}
-		if (move_is_into_outbox)
+		if (is_movable && move_is_into_outbox)
 		{
 			int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
 			
@@ -1976,7 +1976,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
 				int existing_item_count = 0;
-				int existing_folder_count = LLToolDragAndDrop::instance().getCargoIDsCount();
+				int existing_folder_count = 1 + LLToolDragAndDrop::instance().getCargoIDsCount();  // +1 for master folder
 				
 				if (master_folder != NULL)
 				{
-- 
GitLab


From ec06aa129f839cc98aaa8006d6467241281da9fa Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 20 Dec 2011 15:02:21 -0700
Subject: [PATCH 477/933] add mutex to protect curl_multi-init()

---
 indra/llmessage/llcurl.cpp | 19 ++++++++++++++++---
 indra/llmessage/llcurl.h   |  3 +++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 2b351d351ef..f5696307668 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -517,7 +517,7 @@ void LLCurl::Easy::prepRequest(const std::string& url,
 }
 
 ////////////////////////////////////////////////////////////////////////////
-
+LLMutex* LLCurl::Multi::sMultiInitMutexp = NULL ;
 LLCurl::Multi::Multi()
 	: mQueued(0),
 	  mErrorCount(0),
@@ -527,11 +527,11 @@ LLCurl::Multi::Multi()
 	  mDeletionMutexp(NULL),
 	  mEasyMutexp(NULL)
 {
-	mCurlMultiHandle = curl_multi_init();
+	mCurlMultiHandle = initMulti();
 	if (!mCurlMultiHandle)
 	{
 		llwarns << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl;
-		mCurlMultiHandle = curl_multi_init();
+		mCurlMultiHandle = initMulti();
 	}
 	
 	llassert_always(mCurlMultiHandle);	
@@ -576,6 +576,13 @@ LLCurl::Multi::~Multi()
 	--gCurlMultiCount;
 }
 
+CURLM* LLCurl::Multi::initMulti()
+{
+	LLMutexLock lock(sMultiInitMutexp) ;
+
+	return curl_multi_init() ;
+}
+
 void LLCurl::Multi::lock()
 {
 	if(mMutexp)
@@ -853,11 +860,17 @@ void LLCurlThread::CurlRequest::finishRequest(bool completed)
 LLCurlThread::LLCurlThread(bool threaded) :
 	LLQueuedThread("curlthread", threaded)
 {
+	if(!LLCurl::Multi::sMultiInitMutexp)
+	{
+		LLCurl::Multi::sMultiInitMutexp = new LLMutex(NULL) ;
+	}
 }
 	
 //virtual 
 LLCurlThread::~LLCurlThread() 
 {
+	delete LLCurl::Multi::sMultiInitMutexp ;
+	LLCurl::Multi::sMultiInitMutexp = NULL ;
 }
 
 S32 LLCurlThread::update(U32 max_time_ms)
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 5d54b5fe12f..705cdcbbcc5 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -299,6 +299,7 @@ class LLCurl::Multi
 	S32 mQueued;
 	S32 mErrorCount;
 	
+	static CURLM* initMulti() ;
 private:
 	void easyFree(LLCurl::Easy*);
 	
@@ -318,6 +319,8 @@ class LLCurl::Multi
 	LLMutex* mMutexp ;
 	LLMutex* mDeletionMutexp ;
 	LLMutex* mEasyMutexp ;
+
+	static LLMutex* sMultiInitMutexp ;
 };
 
 class LLCurlThread : public LLQueuedThread
-- 
GitLab


From 2a3b7f295fa82d5d4826cfd912fd07ebbe5f9c21 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 20 Dec 2011 14:41:30 -0800
Subject: [PATCH 478/933] EXP-1755 FIX -- Can move items to Merchant Outbox
 during Outbox synch using Copy to Merchant Outbox context menu

* "Copy to Merchant Outbox" context menu option no longer available when marketplace import is in progress.
---
 indra/newview/llinventorybridge.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 2ff6563a097..96c527859c8 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -53,6 +53,7 @@
 #include "llinventorymodel.h"
 #include "llinventorymodelbackgroundfetch.h"
 #include "llinventorypanel.h"
+#include "llmarketplacefunctions.h"
 #include "llnotifications.h"
 #include "llnotificationsutil.h"
 #include "llpreviewanim.h"
@@ -1132,6 +1133,15 @@ BOOL LLInvFVBridge::canListOnMarketplaceNow() const
 		}
 	}
 
+	// Do not allow listing while import is in progress
+	if (LLMarketplaceInventoryImporter::instanceExists())
+	{
+		if (LLMarketplaceInventoryImporter::instance().isImportInProgress())
+		{
+			can_list = FALSE;
+		}
+	}
+
 #endif
 
 	return can_list;
-- 
GitLab


From 52fab641041ed1ba409a03fee77a0cdaec86dea2 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 20 Dec 2011 16:16:49 -0800
Subject: [PATCH 479/933] * Added "InventoryOutboxLogging" debug setting to log
 merchant outbox related web API calls.  Each message begins with the tag
 "SLM".

---
 indra/newview/app_settings/settings.xml       | 11 ++++++
 indra/newview/llmarketplacefunctions.cpp      | 39 ++++++++++++++++++-
 .../xui/en/floater_merchant_outbox.xml        |  2 +-
 3 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c51197bbf13..e5bb6861232 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4271,6 +4271,17 @@
 		<key>Value</key>
 		<integer>0</integer>
 	</map>
+	<key>InventoryOutboxLogging</key>
+	<map>
+		<key>Comment</key>
+		<string>Enable debug output associated with the Merchant Outbox.</string>
+		<key>Persist</key>
+		<integer>1</integer>
+		<key>Type</key>
+		<string>Boolean</string>
+		<key>Value</key>
+		<integer>0</integer>
+	</map>
     <key>InventoryOutboxMaxFolderCount</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 225bb059c96..9a83c5fcb7d 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -31,6 +31,7 @@
 #include "llagent.h"
 #include "llhttpclient.h"
 #include "lltrans.h"
+#include "llviewercontrol.h"
 #include "llviewermedia.h"
 #include "llviewernetwork.h"
 
@@ -108,12 +109,13 @@ namespace LLMarketplaceImport
 	// Internal state variables
 
 	static std::string sMarketplaceCookie = "";
+	static LLSD sImportId = LLSD::emptyMap();
 	static bool sImportInProgress = false;
 	static bool sImportPostPending = false;
 	static bool sImportGetPending = false;
 	static U32 sImportResultStatus = 0;
 	static LLSD sImportResults = LLSD::emptyMap();
-		
+
 	
 	// Responders
 	
@@ -124,9 +126,17 @@ namespace LLMarketplaceImport
 		
 		void completed(U32 status, const std::string& reason, const LLSD& content)
 		{
+			if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+			{
+				llinfos << " SLM POST status: " << status << llendl;
+				llinfos << " SLM POST reason: " << reason << llendl;
+				llinfos << " SLM POST content: " << content.asString() << llendl;
+			}
+
 			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
 			sImportPostPending = false;
 			sImportResultStatus = status;
+			sImportId = content;
 		}
 	};
 	
@@ -142,6 +152,13 @@ namespace LLMarketplaceImport
 		
 		void completed(U32 status, const std::string& reason, const LLSD& content)
 		{
+			if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+			{
+				llinfos << " SLM GET status: " << status << llendl;
+				llinfos << " SLM GET reason: " << reason << llendl;
+				llinfos << " SLM GET content: " << content.asString() << llendl;
+			}
+
 			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
 			sImportGetPending = false;
 			sImportResultStatus = status;
@@ -236,6 +253,11 @@ namespace LLMarketplaceImport
 		
 		std::string url = getInventoryImportURL();
 		
+		if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+		{
+			llinfos << " SLM GET: " << url << llendl;
+		}
+
 		LLHTTPClient::get(url, new LLImportGetResponder(), LLViewerMedia::getHeaders());
 	}
 	
@@ -245,18 +267,26 @@ namespace LLMarketplaceImport
 
 		std::string url = getInventoryImportURL();
 
+		url += sImportId.asString();
+
 		// Make the headers for the post
 		LLSD headers = LLSD::emptyMap();
 		headers["Accept"] = "*/*";
 		headers["Cookie"] = sMarketplaceCookie;
-		headers["Content-Type"] = "application/xml";
+		headers["Content-Type"] = "application/llsd+xml";
 		headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
 		
+		if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+		{
+			llinfos << " SLM GET: " << url << llendl;
+		}
+
 		LLHTTPClient::get(url, new LLImportGetResponder(), headers);
 	}
 	
 	void triggerImport()
 	{
+		sImportId = LLSD::emptyMap();
 		sImportInProgress = true;
 		sImportPostPending = true;
 		sImportResultStatus = MarketplaceErrorCodes::IMPORT_PROCESSING;
@@ -272,6 +302,11 @@ namespace LLMarketplaceImport
 		headers["Content-Type"] = "application/xml";
 		headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
 		
+		if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+		{
+			llinfos << " SLM POST: " << url << llendl;
+		}
+
 		LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers);
 		
 		// Set a timer (for testing only)
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index eb68339022b..02394e8ac3d 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -16,7 +16,7 @@
  <string name="OutboxFolderCount0">0 folders</string>
  <string name="OutboxFolderCount1">1 folder</string>
  <string name="OutboxFolderCountN">[NUM] folders</string>
- <string name="OutboxImporting">Sending items...</string>
+ <string name="OutboxImporting">Sending folders...</string>
  <string name="OutboxInitializing">Initializing...</string>
  <panel
       follows="all"
-- 
GitLab


From 1a5194264451371270a7d94d528c2102be25c503 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 20 Dec 2011 16:50:23 -0800
Subject: [PATCH 480/933] sync with viewer-development

---
 .../default/xui/en/floater_im_session.xml     |  2 +-
 .../skins/default/xui/en/menu_viewer.xml      | 24 +++++++++----------
 .../skins/default/xui/en/notifications.xml    |  9 +++++++
 .../xui/en/panel_adhoc_control_panel.xml      |  6 ++---
 .../default/xui/en/panel_cof_wearables.xml    |  1 +
 .../skins/default/xui/en/panel_edit_skin.xml  | 12 +++++-----
 .../newview/skins/default/xui/en/strings.xml  |  5 ++++
 7 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 5fe8f3c1147..a2739a8339f 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -3,7 +3,7 @@
  legacy_header_height="18"
  background_visible="true"
  default_tab_group="1"
- height="350"
+ height="355"
  help_topic="floater_im_box"
  layout="topleft"
  name="panel_im"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1834be2d48c..0aa5c72f2a5 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1713,7 +1713,17 @@
              function="ToggleControl"
              parameter="MouseSmooth" />
         </menu_item_check>
-
+            <menu_item_call
+             enabled="false"
+             label="Release Keys"
+             name="Release Keys">
+                <menu_item_call.on_click
+                 function="Tools.ReleaseKeys"
+                 parameter="" />
+                <menu_item_call.on_enable
+                 function="Tools.EnableReleaseKeys"
+                 parameter="" />
+            </menu_item_call>
         <menu_item_separator/>
 
         <menu
@@ -1743,17 +1753,7 @@
              function="Floater.Toggle"
              parameter="search" />
             </menu_item_check>
-            <menu_item_call
-             enabled="false"
-             label="Release Keys"
-             name="Release Keys">
-                <menu_item_call.on_click
-                 function="Tools.ReleaseKeys"
-                 parameter="" />
-                <menu_item_call.on_enable
-                 function="Tools.EnableReleaseKeys"
-                 parameter="" />
-            </menu_item_call>
+
             <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
             <menu_item_check
                label="Show Advanced Menu - legacy shortcut"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 0ba4b84abe4..a7705c8bac7 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5516,6 +5516,15 @@ Please select at least one type of content to search (General, Moderate, or Adul
 [MESSAGE]
   </notification>
 
+  <notification
+   icon="notify.tga"
+   name="PaymentFailure"
+   persist="true"
+   type="notify">
+    <tag>funds</tag>
+[MESSAGE]
+  </notification>
+
    <!-- EventNotification couldn't be persist since server decide is it necessary to notify 
    user about subscribed event via LLEventNotifier-->
   <notification
diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
index e70abc0975e..93cafd4a53e 100644
--- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
@@ -58,7 +58,7 @@
              label="Call"
              name="call_btn"
              width="130"
-             top="5" />
+             top="0" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -75,7 +75,7 @@
              height="20"
              label="Leave Call"
              name="end_call_btn"
-             top="5"/>
+             top="0"/>
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -92,7 +92,7 @@
              height="20"
              label="Voice Controls"
              name="voice_ctrls_btn"
-             top="5"
+             top="0"
              use_ellipses="true" />
         </layout_panel>
     </layout_stack>
diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
index beea53437a8..aa8e3d07a6e 100644
--- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
+++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
@@ -37,6 +37,7 @@
              top="0"
              width="311" />
         </accordion_tab>
+         <!-- The Attachments title is overwritten by the definition of "Attachments remain" in strings.xml -->
         <accordion_tab
          layout="topleft"
          name="tab_attachments"
diff --git a/indra/newview/skins/default/xui/en/panel_edit_skin.xml b/indra/newview/skins/default/xui/en/panel_edit_skin.xml
index 45591ba2ad7..b61f65a3d16 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_skin.xml
@@ -27,10 +27,10 @@
         default_image_name="Default"
         follows="left|top"
         height="80"
-        label="Head Tattoos"
+        label="Head"
         layout="topleft"
         left="25"
-        name="Head Tattoos"
+        name="Head"
         tool_tip="Click to choose a picture"
         top="10"
         width="74" >
@@ -43,10 +43,10 @@
         default_image_name="Default"
         follows="left|top"
         height="80"
-        label="Upper Tattoos"
+        label="Upper body"
         layout="topleft"
         left_pad="20"
-        name="Upper Tattoos"
+        name="Upper Body"
         tool_tip="Click to choose a picture"
         top="10"
         width="74" >
@@ -59,10 +59,10 @@
         default_image_name="Default"
         follows="left|top"
         height="80"
-        label="Lower Tattoos"
+        label="Lower body"
         layout="topleft"
         left_pad="20"
-        name="Lower Tattoos"
+        name="Lower Body"
         tool_tip="Click to choose a picture"
         top="10"
         width="74" >
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c25d1f57d6e..9752a07b666 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2133,6 +2133,7 @@ Returns a string with the requested data about the region
 	<string name="InvFolder All">All</string>
 
 	<string name="no_attachments">No attachments worn</string>
+    <string name="Attachments remain">Attachments ([COUNT] slots remain)</string>
 
 	<!-- inventory FVBridge -->
 	<!--  This is used in llpanelinventory.cpp when constructing a context menu for an item for Sale  -->
@@ -3358,6 +3359,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   <string name="you_paid_ldollars_no_info">You paid L$[AMOUNT].</string>
   <string name="you_paid_ldollars_no_reason">You paid [NAME] L$[AMOUNT].</string>
   <string name="you_paid_ldollars_no_name">You paid L$[AMOUNT] [REASON].</string>
+  <string name="you_paid_failure_ldollars">You failed to pay [NAME] L$[AMOUNT] [REASON].</string>
+  <string name="you_paid_failure_ldollars_no_info">You failed to pay L$[AMOUNT].</string>
+  <string name="you_paid_failure_ldollars_no_reason">You failed to pay [NAME] L$[AMOUNT].</string>
+  <string name="you_paid_failure_ldollars_no_name">You failed to pay L$[AMOUNT] [REASON].</string>
   <string name="for item">for [ITEM]</string>
   <string name="for a parcel of land">for a parcel of land</string>
   <string name="for a land access pass">for a land access pass</string>
-- 
GitLab


From 2455a4bb00b399e5cd5f22e9b177ca2aeaad2ba2 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 21 Dec 2011 14:09:56 +0200
Subject: [PATCH 481/933] EXP-1695 FIXED currency format in Group Profile >
 Land/Asset and New Group.

---
 indra/newview/llpanelgrouplandmoney.cpp             |  3 +--
 .../skins/default/xui/en/panel_group_general.xml    | 13 +++++++++++--
 indra/newview/skins/default/xui/en/strings.xml      |  2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index e66dd5690c2..b6c0c2ee24c 100644
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -1447,8 +1447,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
 
 		text.append(time_str);
 		text.append(".\n\n");
-		text.append(llformat("%-23sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance ));
-		text.append(1, '\n');
+		text.append(llformat("%-24s %6d L$\n\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance ));
 	}
 
 	// [DEV-29503] Hide the individual info since
diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml
index 38b680ba865..adde982c60c 100644
--- a/indra/newview/skins/default/xui/en/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_general.xml
@@ -225,13 +225,22 @@ Hover your mouse over the options for more help.
          height="23"
          increment="1"
          label_width="15"
-         label="L$"
          layout="topleft"
          max_val="99999"
          left="30"
          name="spin_enrollment_fee"
          tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked."
-         width="170" />
+         width="150" />
+        <text
+         follows="left|top"
+         type="string"
+         height="16"
+         left_pad="2"
+         name="currency_label"
+         top_delta="5"
+         width="18">
+         L$
+        </text>
         <combo_box
          follows="left|top"
          height="23"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c25d1f57d6e..ac5b027ea1c 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2271,7 +2271,7 @@ Returns a string with the requested data about the region
 	<string name="NextStipendDay"       value="The next stipend day is " />
 	<string name="GroupPlanningDate">[mthnum,datetime,utc]/[day,datetime,utc]/[year,datetime,utc]</string>
 	<string name="GroupIndividualShare" value="                      Group       Individual Share" />
-	<string name="GroupColumn"          value="                      Group" />
+	<string name="GroupColumn"          value="Group" />
 	<string name="Balance">Balance</string>
 	<string name="Credits">Credits</string>
 	<string name="Debits">Debits</string>
-- 
GitLab


From 0ccf2b5a1c08c897326c0ce47caa48e30ec4b5fa Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 21 Dec 2011 14:10:02 +0200
Subject: [PATCH 482/933] EXP-1693 FIXED the date localization in Item Profile
 window, Voice Morphs window and in scroll list widget in general. - Added a
 customizable date format string to be used for scroll list cell of "date"
 type. - The date localization does not change the value of a scroll list cell
 changing only its string representation. - Added using localized week days
 and month names from strings.xml for all locales not only Ja and Pl as it was
 before. - Changed the date format in Item Profile window (French locale) as
 noted in the issue description. - For this fix the French locale still needs
 the localization of the following strings in strings.xml: 	<string
 name="dateTimeWeekdaysNames"> 	<string name="dateTimeWeekdaysShortNames"> 
 <string name="dateTimeMonthNames"> 	<string
 name="dateTimeMonthShortNames"> 	<string name="dateTimeDayFormat"> 
 <string name="dateTimeAM"> 	<string name="dateTimePM">

---
 indra/llcommon/llstring.cpp                   |  5 ++++
 indra/llui/llscrolllistcell.cpp               | 10 +++++++-
 indra/newview/llappviewer.cpp                 | 23 +++++++------------
 .../newview/skins/default/xui/en/strings.xml  |  3 +++
 .../default/xui/fr/sidepanel_item_info.xml    |  2 +-
 5 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index e7fe6568085..1193a4ef8db 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -1122,6 +1122,11 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
 		struct tm * gmt = gmtime (&loc_seconds);
 		replacement = LLStringOps::sMonthList[gmt->tm_mon];
 	}
+	else if(LLStringOps::sMonthShortList.size() == 12 && code == "%b")
+	{
+		struct tm * gmt = gmtime (&loc_seconds);
+		replacement = LLStringOps::sMonthShortList[gmt->tm_mon];
+	}
 	else if( !LLStringOps::sDayFormat.empty() && code == "%d" )
 	{
 		struct tm * gmt = gmtime (&loc_seconds);
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 9d25c7180dd..786e18b1878 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -29,6 +29,8 @@
 
 #include "llscrolllistcell.h"
 
+#include "lltrans.h"
+
 #include "llcheckboxctrl.h"
 #include "llui.h"	// LLUIImage
 #include "lluictrlfactory.h"
@@ -428,7 +430,13 @@ LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p)
 void LLScrollListDate::setValue(const LLSD& value)
 {
 	mDate = value.asDate();
-	LLScrollListText::setValue(mDate.asRFC1123());
+
+	std::string date_str = LLTrans::getString("ScrollListCellDateFormat");
+	LLSD substitution;
+	substitution["datetime"] = mDate.secondsSinceEpoch();
+	LLStringUtil::format(date_str, substitution);
+
+	LLScrollListText::setValue(date_str);
 }
 
 const LLSD LLScrollListDate::getValue() const
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b45f9c55fba..9595e82a076 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1043,21 +1043,14 @@ bool LLAppViewer::init()
 
 	LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
 
-	//EXT-7013 - On windows for some locale (Japanese) standard 
-	//datetime formatting functions didn't support some parameters such as "weekday".
-	//Names for days and months localized in xml are also useful for Polish locale(STORM-107).
-	std::string language = gSavedSettings.getString("Language");
-	if(language == "ja" || language == "pl")
-	{
-		LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
-		LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
-		LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
-		LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
-		LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
-
-		LLStringOps::sAM = LLTrans::getString("dateTimeAM");
-		LLStringOps::sPM = LLTrans::getString("dateTimePM");
-	}
+	LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
+	LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
+	LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
+	LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
+	LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
+
+	LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+	LLStringOps::sPM = LLTrans::getString("dateTimePM");
 
 	LLAgentLanguage::init();
 
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index ac5b027ea1c..e31fd167bc5 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3498,6 +3498,9 @@ Abuse Report</string>
   <string name="dateTimeDayFormat">[MDAY]</string>
   <string name="dateTimeAM">AM</string>
   <string name="dateTimePM">PM</string>
+  
+  <!-- Format string for displaying a localized date in a scroll list cell of type "date" -->
+  <string name="ScrollListCellDateFormat">[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]</string>
 
   <!--  currency formatting -->
   <string name="LocalEstimateUSD">US$ [AMOUNT]</string>
diff --git a/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml b/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml
index 95649d39348..0b5333fc80e 100644
--- a/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml
+++ b/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml
@@ -13,7 +13,7 @@
 		Le propriétaire peut :
 	</panel.string>
 	<panel.string name="acquiredDate">
-		[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
+		[wkday,datetime,local] [day,datetime,local] [mth,datetime,local] [year,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local]
 	</panel.string>
 	<panel.string name="origin_inventory">
 		(inventaire)
-- 
GitLab


From 5546041301a67da6e471a433b29374bc75a4f0d0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 21 Dec 2011 15:55:14 -0600
Subject: [PATCH 483/933] SH-2794 WIP -- work on getting glMapBuffer and
 friends to behave

---
 indra/llrender/llvertexbuffer.cpp       |  52 ++++---
 indra/llrender/llvertexbuffer.h         |  22 +--
 indra/newview/llface.cpp                | 194 ++++++++++++++++++------
 indra/newview/llfloatermodelpreview.cpp |  12 +-
 indra/newview/llvosurfacepatch.cpp      |   2 +-
 5 files changed, 199 insertions(+), 83 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 20a450fbfb2..f8c2a558202 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -148,7 +148,7 @@ U32 wpo2(U32 i)
 	return r;
 }
 
-U8* LLVBOPool::allocate(U32& name, U32 size)
+volatile U8* LLVBOPool::allocate(U32& name, U32 size)
 {
 	llassert(nhpo2(size) == size);
 
@@ -159,7 +159,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size)
 		mFreeList.resize(i+1);
 	}
 
-	U8* ret = NULL;
+	volatile U8* ret = NULL;
 
 	if (mFreeList[i].empty())
 	{
@@ -188,7 +188,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size)
 	return ret;
 }
 
-void LLVBOPool::release(U32 name, U8* buffer, U32 size)
+void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
 {
 	llassert(nhpo2(size) == size);
 
@@ -221,7 +221,7 @@ void LLVBOPool::cleanup()
 
 			if (r.mClientData)
 			{
-				ll_aligned_free_16(r.mClientData);
+				ll_aligned_free_16((void*) r.mClientData);
 			}
 
 			l.pop_front();
@@ -1042,7 +1042,7 @@ void LLVertexBuffer::destroyGLBuffer()
 		}
 		else
 		{
-			FREE_MEM(sPrivatePoolp, mMappedData) ;
+			FREE_MEM(sPrivatePoolp, (void*) mMappedData) ;
 			mMappedData = NULL;
 			mEmpty = TRUE;
 		}
@@ -1063,7 +1063,7 @@ void LLVertexBuffer::destroyGLIndices()
 		}
 		else
 		{
-			FREE_MEM(sPrivatePoolp, mMappedIndexData) ;
+			FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData) ;
 			mMappedIndexData = NULL;
 			mEmpty = TRUE;
 		}
@@ -1282,8 +1282,11 @@ bool expand_region(LLVertexBuffer::MappedRegion& region, S32 index, S32 count)
 	return true;
 }
 
+static LLFastTimer::DeclareTimer FTM_VBO_MAP_BUFFER_RANGE("VBO Map Range");
+static LLFastTimer::DeclareTimer FTM_VBO_MAP_BUFFER("VBO Map");
+
 // Map for data access
-U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range)
+volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range)
 {
 	bindGLBuffer(true);
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER);
@@ -1346,13 +1349,14 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 			}
 			else
 			{
-				U8* src = NULL;
+				volatile U8* src = NULL;
 				waitFence();
 				if (gGLManager.mHasMapBufferRange)
 				{
 					if (map_range)
 					{
 #ifdef GL_ARB_map_buffer_range
+						LLFastTimer t(FTM_VBO_MAP_BUFFER_RANGE);
 						S32 offset = mOffsets[type] + sTypeSize[type]*index;
 						S32 length = (sTypeSize[type]*count+0xF) & ~0xF;
 						src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length, 
@@ -1376,6 +1380,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 							}
 						}
 
+						LLFastTimer t(FTM_VBO_MAP_BUFFER);
 						src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, 
 							GL_MAP_WRITE_BIT | 
 							GL_MAP_FLUSH_EXPLICIT_BIT);
@@ -1403,7 +1408,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 
 				llassert(src != NULL);
 
-				mMappedData = LL_NEXT_ALIGNED_ADDRESS<U8>(src);
+				mMappedData = LL_NEXT_ALIGNED_ADDRESS<volatile U8>(src);
 				mAlignedOffset = mMappedData - src;
 			
 				stop_glerror();
@@ -1458,7 +1463,11 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
 	}
 }
 
-U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
+
+static LLFastTimer::DeclareTimer FTM_VBO_MAP_INDEX_RANGE("IBO Map Range");
+static LLFastTimer::DeclareTimer FTM_VBO_MAP_INDEX("IBO Map");
+
+volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER);
 	bindGLIndices(true);
@@ -1530,13 +1539,14 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 			}
 			else
 			{
-				U8* src = NULL;
+				volatile U8* src = NULL;
 				waitFence();
 				if (gGLManager.mHasMapBufferRange)
 				{
 					if (map_range)
 					{
 #ifdef GL_ARB_map_buffer_range
+						LLFastTimer t(FTM_VBO_MAP_INDEX_RANGE);
 						S32 offset = sizeof(U16)*index;
 						S32 length = sizeof(U16)*count;
 						src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, 
@@ -1548,6 +1558,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 					else
 					{
 #ifdef GL_ARB_map_buffer_range
+						LLFastTimer t(FTM_VBO_MAP_INDEX);
 						src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices, 
 							GL_MAP_WRITE_BIT | 
 							GL_MAP_FLUSH_EXPLICIT_BIT);
@@ -1569,6 +1580,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 				}
 				else
 				{
+					LLFastTimer t(FTM_VBO_MAP_INDEX);
 					map_range = false;
 					src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
 				}
@@ -1619,6 +1631,8 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_VBO_UNMAP("VBO Unmap");
+
 void LLVertexBuffer::unmapBuffer()
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER);
@@ -1627,6 +1641,8 @@ void LLVertexBuffer::unmapBuffer()
 		return ; //nothing to unmap
 	}
 
+	LLFastTimer t(FTM_VBO_UNMAP);
+
 	bool updated_all = false ;
 
 	if (mMappedData && mVertexLocked)
@@ -1644,7 +1660,7 @@ 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, mMappedData+offset);
+					glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedData+offset);
 					stop_glerror();
 				}
 
@@ -1653,7 +1669,7 @@ void LLVertexBuffer::unmapBuffer()
 			else
 			{
 				stop_glerror();
-				glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), mMappedData);
+				glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), (U8*) mMappedData);
 				stop_glerror();
 			}
 		}
@@ -1708,7 +1724,7 @@ 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, mMappedIndexData+offset);
+					glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedIndexData+offset);
 					stop_glerror();
 				}
 
@@ -1717,7 +1733,7 @@ void LLVertexBuffer::unmapBuffer()
 			else
 			{
 				stop_glerror();
-				glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), mMappedIndexData);
+				glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), (U8*) mMappedIndexData);
 				stop_glerror();
 			}
 		}
@@ -1778,7 +1794,7 @@ template <class T,S32 type> struct VertexBufferStrider
 	{
 		if (type == LLVertexBuffer::TYPE_INDEX)
 		{
-			U8* ptr = vbo.mapIndexBuffer(index, count, map_range);
+			volatile U8* ptr = vbo.mapIndexBuffer(index, count, map_range);
 
 			if (ptr == NULL)
 			{
@@ -1794,7 +1810,7 @@ template <class T,S32 type> struct VertexBufferStrider
 		{
 			S32 stride = LLVertexBuffer::sTypeSize[type];
 
-			U8* ptr = vbo.mapVertexBuffer(type, index, count, map_range);
+			volatile U8* ptr = vbo.mapVertexBuffer(type, index, count, map_range);
 
 			if (ptr == NULL)
 			{
@@ -2109,7 +2125,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER);
 	stop_glerror();
-	U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
+	volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
 
 	/*if ((data_mask & mTypeMask) != data_mask)
 	{
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 3e6f6a959ae..5b93a0389f8 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -60,10 +60,10 @@ class LLVBOPool
 	U32 mType;
 
 	//size MUST be a power of 2
-	U8* allocate(U32& name, U32 size);
+	volatile U8* allocate(U32& name, U32 size);
 	
 	//size MUST be the size provided to allocate that returned the given name
-	void release(U32 name, U8* buffer, U32 size);
+	void release(U32 name, volatile U8* buffer, U32 size);
 	
 	//destroy all records in mFreeList
 	void cleanup();
@@ -72,7 +72,7 @@ class LLVBOPool
 	{
 	public:
 		U32 mGLName;
-		U8* mClientData;
+		volatile U8* mClientData;
 	};
 
 	typedef std::list<Record> record_list_t;
@@ -208,8 +208,8 @@ class LLVertexBuffer : public LLRefCount
 	LLVertexBuffer(U32 typemask, S32 usage);
 	
 	// map for data access
-	U8*		mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range);
-	U8*		mapIndexBuffer(S32 index, S32 count, bool map_range);
+	volatile U8*		mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range);
+	volatile U8*		mapIndexBuffer(S32 index, S32 count, bool map_range);
 
 	// set for rendering
 	virtual void	setBuffer(U32 data_mask); 	// calls  setupVertexBuffer() if data_mask is not 0
@@ -244,14 +244,14 @@ class LLVertexBuffer : public LLRefCount
 	S32 getNumVerts() const					{ return mNumVerts; }
 	S32 getNumIndices() const				{ return mNumIndices; }
 	
-	U8* getIndicesPointer() const			{ return useVBOs() ? (U8*) mAlignedIndexOffset : mMappedIndexData; }
-	U8* getVerticesPointer() const			{ return useVBOs() ? (U8*) mAlignedOffset : mMappedData; }
+	volatile U8* getIndicesPointer() const			{ return useVBOs() ? (U8*) mAlignedIndexOffset : mMappedIndexData; }
+	volatile U8* getVerticesPointer() const			{ return useVBOs() ? (U8*) mAlignedOffset : mMappedData; }
 	U32 getTypeMask() const					{ return mTypeMask; }
 	bool hasDataType(S32 type) const		{ return ((1 << type) & getTypeMask()); }
 	S32 getSize() const;
 	S32 getIndicesSize() const				{ return mIndicesSize; }
-	U8* getMappedData() const				{ return mMappedData; }
-	U8* getMappedIndices() const			{ return mMappedIndexData; }
+	volatile U8* getMappedData() const				{ return mMappedData; }
+	volatile U8* getMappedIndices() const			{ return mMappedIndexData; }
 	S32 getOffset(S32 type) const			{ return mOffsets[type]; }
 	S32 getUsage() const					{ return mUsage; }
 
@@ -278,8 +278,8 @@ class LLVertexBuffer : public LLRefCount
 	U32		mGLIndices;		// GL IBO handle
 	U32		mGLArray;		// GL VAO handle
 	
-	U8*		mMappedData;	// pointer to currently mapped data (NULL if unmapped)
-	U8*		mMappedIndexData;	// pointer to currently mapped indices (NULL if unmapped)
+	volatile U8* mMappedData;	// pointer to currently mapped data (NULL if unmapped)
+	volatile U8* mMappedIndexData;	// pointer to currently mapped indices (NULL if unmapped)
 	BOOL	mVertexLocked;			// if TRUE, vertex buffer is being or has been written to in client memory
 	BOOL	mIndexLocked;			// if TRUE, index buffer is being or has been written to in client memory
 	BOOL	mFinal;			// if TRUE, buffer can not be mapped again
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 6dbeae6677f..941b8db2cf5 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -693,6 +693,49 @@ static void xform(LLVector2 &tex_coord, F32 cosAng, F32 sinAng, F32 offS, F32 of
 	tex_coord.mV[1] = t;
 }
 
+// Transform the texture coordinates for this face.
+static void xform4a(LLVector4a &tex_coord, const LLVector4a& trans, const LLVector4Logical& mask, const LLVector4a& rot0, const LLVector4a& rot1, const LLVector4a& offset, const LLVector4a& scale) 
+{
+	//tex coord is two coords, <s0, t0, s1, t1>
+	LLVector4a st;
+
+	// Texture transforms are done about the center of the face.
+	st.setAdd(tex_coord, trans);
+	
+	// Handle rotation
+	LLVector4a rot_st;
+		
+	// <s0 * cosAng, s0*-sinAng, s1*cosAng, s1*-sinAng>
+	LLVector4a s0;
+	s0.splat(st, 0);
+	LLVector4a s1;
+	s1.splat(st, 2);
+	LLVector4a ss;
+	ss.setSelectWithMask(mask, s1, s0);
+
+	LLVector4a a; 
+	a.setMul(rot0, ss);
+	
+	// <t0*sinAng, t0*cosAng, t1*sinAng, t1*cosAng>
+	LLVector4a t0;
+	t0.splat(st, 1);
+	LLVector4a t1;
+	t1.splat(st, 3);
+	LLVector4a tt;
+	tt.setSelectWithMask(mask, t1, t0);
+
+	LLVector4a b;
+	b.setMul(rot1, tt);
+		
+	st.setAdd(a,b);
+
+	// Then scale
+	st.mul(scale);
+
+	// Then offset
+	tex_coord.setAdd(st, offset);
+}
+
 
 bool less_than_max_mag(const LLVector4a& vec)
 {
@@ -1060,6 +1103,16 @@ static LLFastTimer::DeclareTimer FTM_FACE_GEOM_EMISSIVE("Emissive");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_BINORMAL("Binormal");
 static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index");
+static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX_TAIL("Tail");
+static LLFastTimer::DeclareTimer FTM_FACE_POSITION_STORE("Pos");
+static LLFastTimer::DeclareTimer FTM_FACE_TEXTURE_INDEX_STORE("TexIdx");
+static LLFastTimer::DeclareTimer FTM_FACE_POSITION_PAD("Pad");
+static LLFastTimer::DeclareTimer FTM_FACE_TEX_DEFAULT("Default");
+static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK("Quick");
+static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_NO_XFORM("No Xform");
+static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_XFORM("Xform");
+
+static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_PLANAR("Quick Planar");
 
 BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 							   const S32 &f,
@@ -1104,16 +1157,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	}
 
 	LLStrider<LLVector3> vert;
-	LLVector4a* vertices = NULL;
 	LLStrider<LLVector2> tex_coords;
 	LLStrider<LLVector2> tex_coords2;
-	LLVector4a* normals = NULL;
 	LLStrider<LLVector3> norm;
 	LLStrider<LLColor4U> colors;
-	LLVector4a* binormals = NULL;
 	LLStrider<LLVector3> binorm;
 	LLStrider<U16> indicesp;
-	LLVector4a* weights = NULL;
 	LLStrider<LLVector4> wght;
 
 	BOOL full_rebuild = force_rebuild || mDrawablep->isState(LLDrawable::REBUILD_VOLUME);
@@ -1202,7 +1251,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		LLFastTimer t(FTM_FACE_GEOM_INDEX);
 		mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex, mIndicesCount, map_range);
 
-		__m128i* dst = (__m128i*) indicesp.get();
+		volatile __m128i* dst = (__m128i*) indicesp.get();
 		__m128i* src = (__m128i*) vf.mIndices;
 		__m128i offset = _mm_set1_epi16(index_offset);
 
@@ -1211,12 +1260,17 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		for (S32 i = 0; i < end; i++)
 		{
 			__m128i res = _mm_add_epi16(src[i], offset);
-			_mm_storeu_si128(dst+i, res);
+			_mm_storeu_si128((__m128i*) dst++, res);
 		}
 
-		for (S32 i = end*8; i < num_indices; ++i)
 		{
-			indicesp[i] = vf.mIndices[i]+index_offset;
+			LLFastTimer t(FTM_FACE_GEOM_INDEX_TAIL);
+			U16* idx = (U16*) dst;
+
+			for (S32 i = end*8; i < num_indices; ++i)
+			{
+				*idx++ = vf.mIndices[i]+index_offset;
+			}
 		}
 
 		if (map_range)
@@ -1373,19 +1427,48 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 			if (texgen != LLTextureEntry::TEX_GEN_PLANAR)
 			{
+				LLFastTimer t(FTM_FACE_TEX_QUICK);
 				if (!do_tex_mat)
 				{
 					if (!do_xform)
 					{
+						LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
 						LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
 					}
 					else
 					{
-						for (S32 i = 0; i < num_vertices; i++)
+						LLFastTimer t(FTM_FACE_TEX_QUICK_XFORM);
+						F32* dst = (F32*) tex_coords.get();
+						LLVector4a* src = (LLVector4a*) vf.mTexCoords;
+
+						LLVector4a trans;
+						trans.splat(-0.5f);
+
+						LLVector4a rot0;
+						rot0.set(cos_ang, -sin_ang, cos_ang, -sin_ang);
+
+						LLVector4a rot1;
+						rot1.set(sin_ang, cos_ang, sin_ang, cos_ang);
+
+						LLVector4a scale;
+						scale.set(ms, mt, ms, mt);
+
+						LLVector4a offset;
+						offset.set(os+0.5f, ot+0.5f, os+0.5f, ot+0.5f);
+
+						LLVector4Logical mask;
+						mask.clear();
+						mask.setElement<2>();
+						mask.setElement<3>();
+
+						U32 count = num_vertices/2 + num_vertices%2;
+
+						for (S32 i = 0; i < count; i++)
 						{	
-							LLVector2 tc(vf.mTexCoords[i]);
-							xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
-							*tex_coords++ = tc;	
+							LLVector4a res = *src++;
+							xform4a(res, trans, mask, rot0, rot1, offset, scale);
+							res.store4a(dst);
+							dst += 4;
 						}
 					}
 				}
@@ -1407,6 +1490,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 			}
 			else
 			{ //no bump, no atlas, tex gen planar
+				LLFastTimer t(FTM_FACE_TEX_QUICK_PLANAR);
 				if (do_tex_mat)
 				{
 					for (S32 i = 0; i < num_vertices; i++)
@@ -1451,6 +1535,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		}
 		else
 		{ //either bump mapped or in atlas, just do the whole expensive loop
+			LLFastTimer t(FTM_FACE_TEX_DEFAULT);
 			mVertexBuffer->getTexCoord0Strider(tex_coords, mGeomIndex, mGeomCount, map_range);
 
 			std::vector<LLVector2> bump_tc;
@@ -1642,44 +1727,55 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		llassert(num_vertices > 0);
 		
 		mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range);
-		vertices = (LLVector4a*) vert.get();
-	
+			
+
 		LLMatrix4a mat_vert;
 		mat_vert.loadu(mat_vert_in);
 
 		LLVector4a* src = vf.mPositions;
-		LLVector4a* dst = vertices;
+		volatile F32* dst = (volatile F32*) vert.get();
 
-		LLVector4a* end = dst+num_vertices;
-		do
-		{	
-			mat_vert.affineTransform(*src++, *dst++);
-		}
-		while(dst < end);
+		volatile F32* end = dst+num_vertices*4;
+		LLVector4a res;
 
-		F32 index = (F32) (mTextureIndex < 255 ? mTextureIndex : 0);
+		LLVector4a texIdx;
 
+		F32 index = (F32) (mTextureIndex < 255 ? mTextureIndex : 0);
 		llassert(index <= LLGLSLShader::sIndexedTextureChannels-1);
-		F32 *index_dst = (F32*) vertices;
-		F32 *index_end = (F32*) end;
 
-		index_dst += 3;
-		index_end += 3;
-		do
+		LLVector4Logical mask;
+		mask.clear();
+		mask.setElement<3>();
+		
+		texIdx.set(0,0,0,index);
+
 		{
-			*index_dst = index;
-			index_dst += 4;
+			LLFastTimer t(FTM_FACE_POSITION_STORE);
+			LLVector4a tmp;
+
+			do
+			{	
+				mat_vert.affineTransform(*src++, res);
+				tmp.setSelectWithMask(mask, texIdx, res);
+				tmp.store4a((F32*) dst);
+				dst += 4;
+			}
+			while(dst < end);
 		}
-		while (index_dst < index_end);
-		
-		S32 aligned_pad_vertices = mGeomCount - num_vertices;
-		LLVector4a* last_vec = end - 1;
-		while (aligned_pad_vertices > 0)
+
 		{
-			--aligned_pad_vertices;
-			*dst++ = *last_vec;
+			LLFastTimer t(FTM_FACE_POSITION_PAD);
+			S32 aligned_pad_vertices = mGeomCount - num_vertices;
+			res.set(res[0], res[1], res[2], 0.f);
+
+			while (aligned_pad_vertices > 0)
+			{
+				--aligned_pad_vertices;
+				res.store4a((F32*) dst);
+				dst += 4;
+			}
 		}
-		
+
 		if (map_range)
 		{
 			mVertexBuffer->flush();
@@ -1690,14 +1786,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	{
 		LLFastTimer t(FTM_FACE_GEOM_NORMAL);
 		mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range);
-		normals = (LLVector4a*) norm.get();
+		F32* normals = (F32*) norm.get();
 	
 		for (S32 i = 0; i < num_vertices; i++)
 		{	
 			LLVector4a normal;
 			mat_normal.rotate(vf.mNormals[i], normal);
 			normal.normalize3fast();
-			normals[i] = normal;
+			normal.store4a(normals);
+			normals += 4;
 		}
 
 		if (map_range)
@@ -1710,14 +1807,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	{
 		LLFastTimer t(FTM_FACE_GEOM_BINORMAL);
 		mVertexBuffer->getBinormalStrider(binorm, mGeomIndex, mGeomCount, map_range);
-		binormals = (LLVector4a*) binorm.get();
+		F32* binormals = (F32*) binorm.get();
 		
 		for (S32 i = 0; i < num_vertices; i++)
 		{	
 			LLVector4a binormal;
 			mat_normal.rotate(vf.mBinormals[i], binormal);
 			binormal.normalize3fast();
-			binormals[i] = binormal;
+			binormal.store4a(binormals);
+			binormals += 4;
 		}
 
 		if (map_range)
@@ -1730,8 +1828,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	{
 		LLFastTimer t(FTM_FACE_GEOM_WEIGHTS);
 		mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, map_range);
-		weights = (LLVector4a*) wght.get();
-		LLVector4a::memcpyNonAliased16((F32*) weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32));
+		F32* weights = (F32*) wght.get();
+		LLVector4a::memcpyNonAliased16(weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32));
 		if (map_range)
 		{
 			mVertexBuffer->flush();
@@ -1750,7 +1848,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		
 		src.loadua((F32*) vec);
 
-		LLVector4a* dst = (LLVector4a*) colors.get();
+		F32* dst = (F32*) colors.get();
 		S32 num_vecs = num_vertices/4;
 		if (num_vertices%4 > 0)
 		{
@@ -1759,7 +1857,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		for (S32 i = 0; i < num_vecs; i++)
 		{	
-			dst[i] = src;
+			src.store4a(dst);
+			dst += 4;
 		}
 
 		if (map_range)
@@ -1789,7 +1888,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		
 		src.loadua((F32*) vec);
 
-		LLVector4a* dst = (LLVector4a*) emissive.get();
+		F32* dst = (F32*) emissive.get();
 		S32 num_vecs = num_vertices/4;
 		if (num_vertices%4 > 0)
 		{
@@ -1798,7 +1897,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		for (S32 i = 0; i < num_vecs; i++)
 		{	
-			dst[i] = src;
+			src.store4a(dst);
+			dst += 4;
 		}
 
 		if (map_range)
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 64bdcccd9f0..9122e5a8f5e 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3969,7 +3969,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 				U32 num_indices = mVertexBuffer[5][mdl][i]->getNumIndices();
 				if (num_indices > 2)
 				{
-					glodInsertElements(mObject[mdl], i, GL_TRIANGLES, num_indices, GL_UNSIGNED_SHORT, mVertexBuffer[5][mdl][i]->getIndicesPointer(), 0, 0.f);
+					glodInsertElements(mObject[mdl], i, GL_TRIANGLES, num_indices, GL_UNSIGNED_SHORT, (U8*) mVertexBuffer[5][mdl][i]->getIndicesPointer(), 0, 0.f);
 				}
 				tri_count += num_indices/3;
 				stop_gloderror();
@@ -4083,14 +4083,14 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 				{
 					buff->allocateBuffer(sizes[i*2+1], sizes[i*2], true);
 					buff->setBuffer(type_mask);
-					glodFillElements(mObject[base], names[i], GL_UNSIGNED_SHORT, buff->getIndicesPointer());
+					glodFillElements(mObject[base], names[i], GL_UNSIGNED_SHORT, (U8*) buff->getIndicesPointer());
 					stop_gloderror();
 				}
 				else
 				{ //this face was eliminated, create a dummy triangle (one vertex, 3 indices, all 0)
 					buff->allocateBuffer(1, 3, true);
-					memset(buff->getMappedData(), 0, buff->getSize());
-					memset(buff->getIndicesPointer(), 0, buff->getIndicesSize());
+					memset((U8*) buff->getMappedData(), 0, buff->getSize());
+					memset((U8*) buff->getIndicesPointer(), 0, buff->getIndicesSize());
 				}
 
 				buff->validateRange(0, buff->getNumVerts()-1, buff->getNumIndices(), 0);
@@ -4880,8 +4880,8 @@ void LLModelPreview::addEmptyFace( LLModel* pTarget )
 	LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(type_mask, 0);
 	
 	buff->allocateBuffer(1, 3, true);
-	memset( buff->getMappedData(), 0, buff->getSize() );
-	memset( buff->getIndicesPointer(), 0, buff->getIndicesSize() );
+	memset( (U8*) buff->getMappedData(), 0, buff->getSize() );
+	memset( (U8*) buff->getIndicesPointer(), 0, buff->getIndicesSize() );
 		
 	buff->validateRange( 0, buff->getNumVerts()-1, buff->getNumIndices(), 0 );
 		
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index c3a2e6a712b..bf6158eeaff 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -65,7 +65,7 @@ class LLVertexBufferTerrain : public LLVertexBuffer
 			return;
 		}
 
-		U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
+		volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
 
 		//assume tex coords 2 and 3 are present
 		U32 type_mask = mTypeMask | MAP_TEXCOORD2 | MAP_TEXCOORD3;
-- 
GitLab


From ef08cd9dc619f692ce4e13ba1268c117a75ab2bf Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Wed, 21 Dec 2011 17:55:12 -0500
Subject: [PATCH 484/933] Added tag DRTVWR-106_3.2.5-beta1, 3.2.5-beta1 for
 changeset 3d2d5d244c63

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 539efb0ffc4..97e0cc033c1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -232,3 +232,5 @@ a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 3fe994349fae64fc40874bb59db387131eb35a41 DRTVWR-104_3.2.4-beta1
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
 8a44ff3d2104269ce76145c2772cf1bdff2a2abe 3.2.5-start
+3d2d5d244c6398a4214c666d5dd3965b0918709a DRTVWR-106_3.2.5-beta1
+3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
-- 
GitLab


From 7fe5cbc5c2c288214a94c2c243cea08f30d815f3 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 22 Dec 2011 10:44:49 -0700
Subject: [PATCH 485/933] trivial: some debug code for SH-2623:
 [PUBLIC_JIRA_USERS][crashhunters] crash at
 LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *)

---
 indra/newview/llviewertexturelist.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index cddf7dcfea9..089f45ca899 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -534,6 +534,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
 	S32 count = mImageList.erase(image) ;
 	if(count != 1) 
 	{
+		llinfos << image->getID() << llendl ;
 		llerrs << "Error happens when remove image from mImageList: " << count << llendl ;
 	}
       
@@ -919,6 +920,8 @@ void LLViewerTextureList::decodeAllImages(F32 max_time)
 		image_list.push_back(imagep);
 		imagep->setInImageList(FALSE) ;
 	}
+
+	llassert_always(image_list.size() == mImageList.size()) ;
 	mImageList.clear();
 	for (std::vector<LLPointer<LLViewerFetchedTexture> >::iterator iter = image_list.begin();
 		 iter != image_list.end(); ++iter)
-- 
GitLab


From 62e77147b21bba59e7eda992f7f9c9052b6098d1 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 22 Dec 2011 23:27:56 +0200
Subject: [PATCH 486/933] EXP-1632 FIXED Added checking for valid agent avatar
 before selecting the avatar gender and loading the initial outfit.

---
 indra/newview/llstartup.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 36d6ff3ef2b..7e02a41e7e1 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2026,7 +2026,7 @@ bool idle_startup()
 		const F32 wearables_time = wearables_timer.getElapsedTimeF32();
 		const F32 MAX_WEARABLES_TIME = 10.f;
 
-		if (!gAgent.isGenderChosen())
+		if (!gAgent.isGenderChosen() && isAgentAvatarValid())
 		{
 			// No point in waiting for clothing, we don't even
 			// know what gender we are.  Pop a dialog to ask and
@@ -2541,6 +2541,12 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
 		gender = SEX_FEMALE;
 	}
 
+	if (!isAgentAvatarValid())
+	{
+		llwarns << "Trying to load an initial outfit for an invalid agent avatar" << llendl;
+		return;
+	}
+
 	gAgentAvatarp->setSex(gender);
 
 	// try to find the outfit - if not there, create some default
-- 
GitLab


From f6281d0d869c7f7248edcac015d48ae09a82b7ff Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 23 Dec 2011 14:18:01 +0200
Subject: [PATCH 487/933] EXP-1744 FIXED URL-like group display name was shown
 as hyperlink in the Leave Group confirmation dialog.

---
 indra/newview/skins/default/xui/de/notifications.xml | 2 +-
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 indra/newview/skins/default/xui/es/notifications.xml | 2 +-
 indra/newview/skins/default/xui/fr/notifications.xml | 2 +-
 indra/newview/skins/default/xui/it/notifications.xml | 2 +-
 indra/newview/skins/default/xui/ja/notifications.xml | 2 +-
 indra/newview/skins/default/xui/pl/notifications.xml | 2 +-
 indra/newview/skins/default/xui/pt/notifications.xml | 2 +-
 indra/newview/skins/default/xui/ru/notifications.xml | 2 +-
 indra/newview/skins/default/xui/tr/notifications.xml | 2 +-
 indra/newview/skins/default/xui/zh/notifications.xml | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index 72e7ec8eb47..a5fcd3e0b41 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -1443,7 +1443,7 @@ Zur Installation des Updates muss [APP_NAME] neu gestartet werden.
 		<usetemplate ignoretext="Bestätigen, bevor Objekte an Ihre Eigentümer zurückgegeben werden" name="okcancelignore" notext="Abbrechen" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Sie sind Mitglied der Gruppe [GROUP].
+		Sie sind Mitglied der Gruppe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Diese Gruppe verlassen?
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 5b985c99814..b90acffbc91 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3409,7 +3409,7 @@ Are you sure you want to return the selected objects to their owners? Transferab
    icon="alert.tga"
    name="GroupLeaveConfirmMember"
    type="alert">
-You are currently a member of the group [GROUP].
+You are currently a member of the group &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Leave Group?
     <tag>group</tag>
     <tag>confirm</tag>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 9591b424fce..0de56f9b6da 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -1437,7 +1437,7 @@ Debemos reiniciar [APP_NAME] para instalar la actualización.
 		<usetemplate ignoretext="Confirmar antes de devolver objetos a sus propietarios." name="okcancelignore" notext="Cancelar" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Actualmente, eres miembro del grupo [GROUP].
+		Actualmente, eres miembro del grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 ¿Dejar el grupo?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index d8d79d8ddef..be6f1f8c310 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -1428,7 +1428,7 @@ Version [VERSION]
 		<usetemplate ignoretext="Confirmer avant de rendre les objets à leurs propriétaires" name="okcancelignore" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Vous êtes actuellement membre du groupe [GROUP].
+		Vous êtes actuellement membre du groupe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Quitter le groupe ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index 2db0892cd6e..fce027da0c9 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -1432,7 +1432,7 @@ Per installare l&apos;aggiornamento è necessario riavviare [APP_NAME].
 		<usetemplate ignoretext="Conferma prima di restituire gli oggetti ai relativi proprietari" name="okcancelignore" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Sei attualmente un membro del gruppo [GROUP].
+		Sei attualmente un membro del gruppo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Vuoi lasciare il gruppo?
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 7dfa6d2f7a8..141f2c8071a 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1467,7 +1467,7 @@ http://secondlife.com/download から最新バージョンをダウンロード
 		<usetemplate ignoretext="オブジェクトを所有者に返却する前の確認" name="okcancelignore" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		現在あなたは [GROUP] のメンバーです。
+		現在あなたは &lt;nolink&gt;[GROUP]&lt;/nolink&gt; のメンバーです。
 このグループを抜けますか?
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index e1fb6dd3f14..01942936422 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -1385,7 +1385,7 @@ W celu instalacji aktualizacji musi zostać wykonany restart [APP_NAME].
 		<usetemplate ignoretext="Potwierdź zanim zwrócisz obiekty do ich właścicieli" name="okcancelignore" notext="Anuluj" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Jesteś członkiem grupy [GROUP].
+		Jesteś członkiem grupy &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Chcesz opuścić grupę?
 		<usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index d3547beeb36..b53ebeb1361 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -1419,7 +1419,7 @@ Para instalar a atualização, será preciso reiniciar o [APP_NAME].
 		<usetemplate ignoretext="Confirmar antes de devolver objetos a seus donos" name="okcancelignore" notext="Cancelar" yestext="Retornar"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Você é atualmente um membro do grupo [GROUP].
+		Você é atualmente um membro do grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Sair do grupo?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Sair"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index 1be14160ed1..f121743fe92 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -1431,7 +1431,7 @@ http://secondlife.com/download.
 		<usetemplate ignoretext="Подтверждать перед возвратом объектов владельцам" name="okcancelignore" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Вы являетесь участником группы [GROUP].
+		Вы являетесь участником группы &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Хотите покинуть группу?
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index 6908f6867fa..c0dc67ed345 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -1431,7 +1431,7 @@ Güncellemeyi kurmak için [APP_NAME] uygulamasını yeniden başlatmalısınız
 		<usetemplate ignoretext="Nesneleri sahiplerine iade etmeden önce doğrulama iste" name="okcancelignore" notext="İptal" yestext="Tamam"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Şu anda [GROUP] grubunun bir üyesisiniz.
+		Şu anda &lt;nolink&gt;[GROUP]&lt;/nolink&gt; grubunun bir üyesisiniz.
 Gruptan ayrılmak istiyor musunuz?
 		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index 17ff6288a5f..3fa8ff3f781 100644
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -1418,7 +1418,7 @@ We must restart [APP_NAME] to install the update.
 		<usetemplate ignoretext="在我退回物件給它們的擁有者前確認" name="okcancelignore" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		你目前是 [GROUP] 群組的成員。
+		你目前是 &lt;nolink&gt;[GROUP]&lt;/nolink&gt; 群組的成員。
 是否要離開群組?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
-- 
GitLab


From 4c4543a464ff9e59909404983b5c4ebac71df3b2 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 23 Dec 2011 17:44:59 +0200
Subject: [PATCH 488/933] EXP-1732 FIXED "Refresh to Save" message displayed in
 auto-refresh mode.

---
 indra/newview/llfloatersnapshot.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 1b3290d5a8f..1fac8624ccf 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1490,6 +1490,12 @@ void LLFloaterSnapshot::Impl::setNeedRefresh(LLFloaterSnapshot* floater, bool ne
 {
 	if (!floater) return;
 
+	// Don't display the "Refresh to save" message if we're in auto-refresh mode.
+	if (gSavedSettings.getBOOL("AutoSnapshot"))
+	{
+		need = false;
+	}
+
 	floater->mRefreshLabel->setVisible(need);
 	floater->impl.mNeedRefresh = need;
 }
-- 
GitLab


From 8a3aa3f6cac3da0ee962dac211580a7987a4fc31 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 23 Dec 2011 12:06:36 -0500
Subject: [PATCH 489/933] STORM-1790 Provide a Develop sub-menu to change the
 default logging level co-authored with Zi Ree

---
 doc/contributions.txt                         |  2 +
 indra/llcommon/llerror.cpp                    |  6 +++
 indra/llcommon/llerrorcontrol.h               |  1 +
 indra/newview/llviewermenu.cpp                | 27 ++++++++++
 .../skins/default/xui/en/menu_login.xml       | 53 ++++++++++++++++++-
 .../skins/default/xui/en/menu_viewer.xml      | 51 ++++++++++++++++++
 6 files changed, 139 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 1a3fc680bc8..5eea015ae45 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -603,6 +603,7 @@ Jonathan Yap
 	STORM-653
 	STORM-1737
 	STORM-1733
+	STORM-1790
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
@@ -1254,6 +1255,7 @@ Zi Ree
 	VWR-1140
 	VWR-24017
 	VWR-25588
+	STORM-1790
 Zipherius Turas
 	VWR-76
 	VWR-77
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index c35799bbb91..e4381dbbd64 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -617,6 +617,12 @@ namespace LLError
 		s.defaultLevel = level;
 	}
 
+	ELevel getDefaultLevel()
+	{
+		Settings& s = Settings::get();
+		return s.defaultLevel;
+	}
+
 	void setFunctionLevel(const std::string& function_name, ELevel level)
 	{
 		Globals& g = Globals::get();
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h
index fb75d45e2c9..ed9de002f56 100644
--- a/indra/llcommon/llerrorcontrol.h
+++ b/indra/llcommon/llerrorcontrol.h
@@ -75,6 +75,7 @@ namespace LLError
 	
 	LL_COMMON_API void setPrintLocation(bool);
 	LL_COMMON_API void setDefaultLevel(LLError::ELevel);
+	LL_COMMON_API ELevel getDefaultLevel();
 	LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel);
 	LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel);
 	LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 3a1b8d7623d..0104d35e53a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2203,6 +2203,30 @@ class LLAdvancedEnableToggleHackedGodmode : public view_listener_t
 //// Advanced menu
 ////-------------------------------------------------------------------
 
+
+//////////////////
+// DEVELOP MENU //
+//////////////////
+
+class LLDevelopCheckLoggingLevel : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		U32 level = userdata.asInteger();
+		return (static_cast<LLError::ELevel>(level) == LLError::getDefaultLevel());
+	}
+};
+
+class LLDevelopSetLoggingLevel : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		U32 level = userdata.asInteger();
+		LLError::setDefaultLevel(static_cast<LLError::ELevel>(level));
+		return true;
+	}
+};
+
 //////////////////
 // ADMIN MENU   //
 //////////////////
@@ -8195,6 +8219,9 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus");
 	view_listener_t::addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus");
 
+	// Develop >Set logging level
+	view_listener_t::addMenu(new LLDevelopCheckLoggingLevel(), "Develop.CheckLoggingLevel");
+	view_listener_t::addMenu(new LLDevelopSetLoggingLevel(), "Develop.SetLoggingLevel");
 
 	// Admin >Object
 	view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy");
diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index 8ac1ac9e093..101e104eabf 100644
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -174,7 +174,58 @@
          function="Advanced.WebContentTest"
          parameter="http://google.com"/>
       </menu_item_call>
-      <menu_item_check
+      <menu
+       create_jump_keys="true"
+       label="Set Logging Level"
+       name="Set Logging Level"
+       tear_off="true">
+        <menu_item_check
+          label="Debug">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="0" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="0" />
+        </menu_item_check>
+        <menu_item_check
+          label="Info">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="1" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="1" />
+        </menu_item_check>
+        <menu_item_check
+          label="Warning">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="2" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="2" />
+        </menu_item_check>
+        <menu_item_check
+          label="Error">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="3" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="3" />
+        </menu_item_check>
+        <menu_item_check
+          label="None">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="4" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="4" />
+        </menu_item_check>
+      </menu>
+     <menu_item_check
         label="Show Grid Picker"
         name="Show Grid Picker"
         visible="false" 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 0aa5c72f2a5..0df123e1407 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3367,6 +3367,57 @@
              function="ToggleControl"
              parameter="ShowConsoleWindow" />
         </menu_item_check>
+        <menu
+         create_jump_keys="true"
+         label="Set Logging Level"
+         name="Set Logging Level"
+         tear_off="true">
+          <menu_item_check
+            label="Debug">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="0" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="0" />
+          </menu_item_check>
+          <menu_item_check
+            label="Info">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="1" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="1" />
+          </menu_item_check>
+          <menu_item_check
+            label="Warning">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="2" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="2" />
+          </menu_item_check>
+          <menu_item_check
+            label="Error">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="3" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="3" />
+          </menu_item_check>
+          <menu_item_check
+            label="None">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="4" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="4" />
+          </menu_item_check>
+       </menu>
 
         <menu_item_separator/>
 
-- 
GitLab


From 8cf297ab48cb1c13cb76c462e1c3eed572b12738 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 23 Dec 2011 20:16:48 +0200
Subject: [PATCH 490/933] EXP-1762 FIXED Pre-select current window resolution.

---
 indra/newview/llfloatersnapshot.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 1fac8624ccf..56d53ebdf0a 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -2052,6 +2052,13 @@ BOOL LLFloaterSnapshot::postBuild()
 	gFloaterView->removeChild(this);
 	gSnapshotFloaterView->addChild(this);
 
+	// Pre-select "Current Window" resolution.
+	getChild<LLComboBox>("profile_size_combo")->selectNthItem(0);
+	getChild<LLComboBox>("postcard_size_combo")->selectNthItem(0);
+	getChild<LLComboBox>("texture_size_combo")->selectNthItem(0);
+	getChild<LLComboBox>("local_size_combo")->selectNthItem(0);
+	getChild<LLComboBox>("local_format_combo")->selectNthItem(0);
+
 	impl.mPreviewHandle = previewp->getHandle();
 	impl.updateControls(this);
 	impl.updateLayout(this);
-- 
GitLab


From 032a5e45728597106e07d2d22de3799aaaaf4923 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Sun, 25 Dec 2011 23:09:32 +0000
Subject: [PATCH 491/933] Replacing file filter for windows that was mistakenly
 removed.

---
 indra/newview/llfilepicker.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index ceb4060bc24..8024755e866 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -502,6 +502,14 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename)
 			L"Compressed Images (*.j2c)\0*.j2c\0" \
 			L"\0";
 		break;
+	case FFSAVE_SCRIPT:
+		if (filename.empty())
+		{
+			wcsncpy( mFilesW,L"untitled.lsl", FILENAME_BUFFER_SIZE);
+		}
+		mOFN.lpstrDefExt = L"txt";
+		mOFN.lpstrFilter = L"LSL Files (*.lsl)\0*.lsl\0" L"\0";
+		break;
 	default:
 		return FALSE;
 	}
-- 
GitLab


From 1a537bb194279f448d343f83b653e1c200bb9041 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Mon, 26 Dec 2011 15:57:42 +0200
Subject: [PATCH 492/933] EXP-1618 (Serious truncation in top-right status bar
 "Buy $S" and "Shop" buttons in many languages)

- Adjusted width of "shop" button in all locales. Had to override width parameter in xml files of all locales. If to set one value with extra room space for all locales it will look rather ugly for many locales including EN.
---
 indra/newview/skins/default/xui/de/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/en/panel_status_bar.xml | 3 +--
 indra/newview/skins/default/xui/es/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/fr/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/it/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/ja/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/pt/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/ru/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/tr/panel_status_bar.xml | 2 +-
 9 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml
index d34fcf70bc3..2493d60df66 100644
--- a/indra/newview/skins/default/xui/de/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Klicken, um L$-Guthaben zu aktualisieren" value="20 L$"/>
 		<button label="L$ kaufen" name="buyL" tool_tip="Hier klicken, um mehr L$ zu kaufen"/>
-		<button label="Einkaufen" name="goShop" tool_tip="Second Life-Marktplatz öffnen"/>
+		<button label="Einkaufen" name="goShop" tool_tip="Second Life-Marktplatz öffnen" width="85"/>
 	</panel>
 	<text name="TimeText" tool_tip="Aktuelle Zeit (Pazifik)">
 		24:00 H PST
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index 3239c4e531f..d453a970e75 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -70,7 +70,7 @@
      pad_bottom="2"
      tool_tip="Click to buy more L$"
      top="0"
-     width="55" />
+     width="80" />
     <button
      halign="left"
      font="SansSerifSmall"
@@ -87,7 +87,6 @@
      left_pad="0"
      label_shadow="true"
      name="goShop"
-     pad_right="0"
      pad_bottom="2"
      tool_tip="Open Second Life Marketplace"
      top="0"
diff --git a/indra/newview/skins/default/xui/es/panel_status_bar.xml b/indra/newview/skins/default/xui/es/panel_status_bar.xml
index d43790c8c6f..79b2c32b236 100644
--- a/indra/newview/skins/default/xui/es/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Pulsa para comprar más L$"/>
-		<button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life"/>
+		<button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life" width="80"/>
 	</panel>
 	<text name="TimeText" tool_tip="Hora actual (Pacífico)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
index ac61eb7e52e..c0d59a3182d 100644
--- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
 		<button label="Acheter L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$."/>
-		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life."/>
+		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life." width="75"/>
 	</panel>
 	<text name="TimeText" tool_tip="Heure actuelle (Pacifique)">
 		00h00 PST
diff --git a/indra/newview/skins/default/xui/it/panel_status_bar.xml b/indra/newview/skins/default/xui/it/panel_status_bar.xml
index fadaa575ea7..4abc90113f4 100644
--- a/indra/newview/skins/default/xui/it/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/it/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Clicca per aggiornare il tuo saldo in L$" value="L$ 20"/>
 		<button label="Acquista L$" name="buyL" tool_tip="Clicca per acquistare più L$"/>
-		<button label="Acquisti" name="goShop" tool_tip="Apri Mercato Second Life"/>
+		<button label="Acquisti" name="goShop" tool_tip="Apri Mercato Second Life" width="75"/>
 	</panel>
 	<text name="TimeText" tool_tip="Orario attuale (Pacifico)">
 		24:00, ora del Pacifico
diff --git a/indra/newview/skins/default/xui/ja/panel_status_bar.xml b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
index 93689b81af7..4fb876f690b 100644
--- a/indra/newview/skins/default/xui/ja/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/>
 		<button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/>
-		<button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"/>
+		<button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"  width="40"/>
 	</panel>
 	<text name="TimeText" tool_tip="現在時刻(太平洋)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/pt/panel_status_bar.xml b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
index d5a3258ddc1..22853f0643c 100644
--- a/indra/newview/skins/default/xui/pt/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Atualizar saldo de L$" value="L$20"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Comprar mais L$"/>
-		<button label="Comprar" name="goShop" tool_tip="Abrir Mercado do Second Life"/>
+		<button label="Comprar" name="goShop" tool_tip="Abrir Mercado do Second Life" width="80"/>
 	</panel>
 	<text name="TimeText" tool_tip="Hora atual (Pacífico)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/ru/panel_status_bar.xml b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
index 68222441966..babe5811ace 100644
--- a/indra/newview/skins/default/xui/ru/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Щелкните для обновления вашего баланса L$" value="L$20"/>
 		<button label="Купить L$" name="buyL" tool_tip="Щелкните для покупки L$"/>
-		<button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life"/>
+		<button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life" width="121"/>
 	</panel>
 	<text name="TimeText" tool_tip="Текущее время (тихоокеанское)">
 		00:00 (тихоокеанское время)
diff --git a/indra/newview/skins/default/xui/tr/panel_status_bar.xml b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
index 63726b94e21..81c304a5d80 100644
--- a/indra/newview/skins/default/xui/tr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="L$ bakiyenizi yenilemek için buraya tıklayın" value="L$20"/>
 		<button label="L$ Satın Al" name="buyL" tool_tip="Daha fazla L$ satın almak için tıklayın"/>
-		<button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç"/>
+		<button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç" width="95"/>
 	</panel>
 	<text name="TimeText" tool_tip="Geçerli zaman (Pasifik)">
 		24:00 AM PST
-- 
GitLab


From 969e9b3315f017ce178bc996a1cc025164d5ee69 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Mon, 26 Dec 2011 16:01:13 +0200
Subject: [PATCH 493/933] EXP-1621 FIXED (Duplicated XUI ID:
 panel_snapshot_postcard.xml)

- Removed duplicated parameters
---
 .../skins/default/xui/en/panel_snapshot_postcard.xml      | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
index d8ff043444b..ebba292a935 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
@@ -16,14 +16,6 @@
      name="upload_message">
         Sending...
     </string>
-    <string
-     name="default_subject">
-        Postcard from [SECOND_LIFE].
-    </string>
-    <string
-     name="default_message">
-        Check this out!
-    </string>
     <icon
      follows="top|left"
      height="18"
-- 
GitLab


From 6c1219a5e419215f5df260c8dc4b24b10fc4d6fb Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Mon, 26 Dec 2011 20:53:41 +0200
Subject: [PATCH 494/933] EXP-1624 FIXED ([TRANSLATED BUT IN EN] tooltip for
 chat floater in English: Shows/hides nearby chat log)

Reason:
- Panel name was missed in other locales.

Solution:
- Added panel name to other locales.
---
 indra/newview/skins/default/xui/de/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/en/floater_chat_bar.xml | 1 +
 indra/newview/skins/default/xui/es/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/fr/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/it/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/ja/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/pt/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/ru/floater_chat_bar.xml | 2 +-
 indra/newview/skins/default/xui/tr/floater_chat_bar.xml | 2 +-
 9 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/indra/newview/skins/default/xui/de/floater_chat_bar.xml b/indra/newview/skins/default/xui/de/floater_chat_bar.xml
index dc5a7cd6819..2464a55665e 100644
--- a/indra/newview/skins/default/xui/de/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/de/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT IN DER NÄHE">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Zum Chatten hier klicken." name="chat_box" tool_tip="Eingabetaste zum Sprechen, Strg+Eingabe zum Rufen"/>
 		<button name="show_nearby_chat" tool_tip="Chatprotokoll in der Nähe ein-/ausblenden"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 8d0cecdac33..675f78d911a 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -30,6 +30,7 @@
     <panel width="300" 
            height="31" 
            left="0" 
+           name="bottom_panel"
            bottom="-1" 
            follows="left|right|bottom" 
            tab_group="1">
diff --git a/indra/newview/skins/default/xui/es/floater_chat_bar.xml b/indra/newview/skins/default/xui/es/floater_chat_bar.xml
index 5e5ef616b8d..2e948050570 100644
--- a/indra/newview/skins/default/xui/es/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/es/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Pulsa aquí para chatear." name="chat_box" tool_tip="Pulsa Enter para decirlo o Ctrl+Enter para gritarlo"/>
 		<button name="show_nearby_chat" tool_tip="Muestra o esconde el registro del chat"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
index 88a2fb669b8..c7d27c05895 100644
--- a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT PRÈS DE MOI">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Cliquer ici pour chatter." name="chat_box" tool_tip="Appuyer sur Entrée pour dire, Ctrl-Entrée pour crier"/>
 		<button name="show_nearby_chat" tool_tip="Affiche/Masque le journal de chats près de vous"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/it/floater_chat_bar.xml b/indra/newview/skins/default/xui/it/floater_chat_bar.xml
index 6c5c8fbea0f..94c85b50c81 100644
--- a/indra/newview/skins/default/xui/it/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/it/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT NEI DINTORNI">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Clicca qui per la chat." name="chat_box" tool_tip="Premi Invio per parlare, Ctrl+Invio per gridare"/>
 		<button name="show_nearby_chat" tool_tip="Mostra/Nasconde il registro della chat nei dintorni"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
index 9735afb101e..504cea5931b 100644
--- a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="近くのチャット">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="ここをクリックしてチャットを開始します。" name="chat_box" tool_tip="Enter キーを押して話し、Ctrl + Enter キーで叫びます。"/>
 		<button name="show_nearby_chat" tool_tip="近くのチャットログを表示・非表示"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/pt/floater_chat_bar.xml b/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
index c089ab93f2b..72016c6b406 100644
--- a/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="BATE-PAPO LOCAL">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Clique aqui para bater papo." name="chat_box" tool_tip="Tecle Enter para falar, Ctrl+Enter para gritar"/>
 		<button name="show_nearby_chat" tool_tip="Mostra/oculta o histórico do bate-papo local"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
index eceab1775a5..79b7b033fb6 100644
--- a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="ЛОКАЛЬНЫЙ ЧАТ">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Щелкните здесь для общения." name="chat_box" tool_tip="Нажмите Enter, чтобы сказать, Ctrl+Enter, чтобы прокричать"/>
 		<button name="show_nearby_chat" tool_tip="Показать/скрыть лог локального чата"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
index d2385e6be39..dee17b7bc4c 100644
--- a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="YAKINDAKÄ° SOHBET">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Sohbet etmek için buraya tıklayın." name="chat_box" tool_tip="Söylemek için Enter, bağırmak için Ctrl+Enter yapın"/>
 		<button name="show_nearby_chat" tool_tip="yakın sohbet günlüğünü gösterir/gizler"/>
 	</panel>
-- 
GitLab


From 681ecc0d0fea674e1fd495198d0aa0ea4a4ddf4f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 28 Dec 2011 18:35:00 +0200
Subject: [PATCH 495/933] EXP-1593 FIXED Navbar was displayed after exitting
 hide contorls mode, even if disabled via settings.

Apparently, the way we showed/hid the panels was wrong.
---
 indra/newview/llviewerwindow.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 31dfa1923c2..b73be4ed435 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -130,6 +130,7 @@
 #include "llmorphview.h"
 #include "llmoveview.h"
 #include "llnavigationbar.h"
+#include "llpaneltopinfobar.h"
 #include "llpopupview.h"
 #include "llpreviewtexture.h"
 #include "llprogressview.h"
@@ -5001,8 +5002,8 @@ void LLViewerWindow::setUIVisibility(bool visible)
 		gToolBarView->setToolBarsVisible(visible);
 	}
 
-	mRootView->getChildView("topinfo_bar_container")->setVisible(visible);
-	mRootView->getChildView("nav_bar_container")->setVisible(visible);
+	LLNavigationBar::getInstance()->setVisible(visible ? gSavedSettings.getBOOL("ShowNavbarNavigationPanel") : FALSE);
+	LLPanelTopInfoBar::getInstance()->setVisible(visible? gSavedSettings.getBOOL("ShowMiniLocationPanel") : FALSE);
 	mRootView->getChildView("status_bar_container")->setVisible(visible);
 }
 
-- 
GitLab


From 0380372a54e98f582fbe995537f4c5e0ec700865 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 30 Dec 2011 16:30:26 +0200
Subject: [PATCH 496/933] EXP-1523 WIP Defensive fix for a crash at
 LLFolderView::onItemsRemovalConfirmation().

---
 indra/newview/llfolderview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 6ec2598e447..637ffd4d2ce 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1058,7 +1058,7 @@ void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LL
 		for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
 		{
 			item = *item_it;
-			if(item->isRemovable())
+			if (item && item->isRemovable())
 			{
 				items.push_back(item);
 			}
-- 
GitLab


From cbeaf3d7a0dd7bdb739b8e72addd41410940a8f5 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 30 Dec 2011 18:32:04 +0200
Subject: [PATCH 497/933] EXP-1586 FIXED (Nearby chat window no longer persists
 between viewer startups)

- Visibility state of chat floater is saved between sessions
- Also visibility state of chat history in nearby chat floater is saved too
---
 indra/newview/llnearbychatbar.cpp             | 25 +++++++++++++++++++
 indra/newview/llnearbychatbar.h               |  5 ++++
 .../skins/default/xui/en/floater_chat_bar.xml |  1 +
 3 files changed, 31 insertions(+)

diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index eec09653841..cb08ca8862c 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -109,6 +109,17 @@ BOOL LLNearbyChatBar::postBuild()
 	mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator");
 	mOutputMonitor->setVisible(FALSE);
 
+	gSavedSettings.declareBOOL("nearbychat_history_visibility", mNearbyChat->getVisible(), "Visibility state of nearby chat history", TRUE);
+
+	// If mVisibilityControl is not empty it means that the visibility state of floater is saved between sessions,
+	// i.e. save_visibility="true" for this floater.
+	// So if we need to restore visibility state of floater we also need to restore visibility state of nearby chat history.
+	if (!mVisibilityControl.empty())
+	{
+		// restore visibility of nearby chat history
+		mNearbyChat->setVisible(gSavedSettings.getBOOL("nearbychat_history_visibility"));
+	}
+
 	// Register for font change notifications
 	LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1));
 
@@ -141,6 +152,18 @@ bool LLNearbyChatBar::applyRectControl()
 	return rect_controlled;
 }
 
+void LLNearbyChatBar::saveChatHistoryVisibility()
+{
+	// save visibility state of nearby chat history panel if
+	// visibility of nearby chat floater is saved, i.e. save_visisbility="true"
+	// (if save_visisbility="true", mVisibilityControl == "floater_vis_chat_bar")
+	if (mVisibilityControl.size() > 1)
+	{
+		// save visibility of nearby chat history
+		gSavedSettings.setBOOL("nearbychat_history_visibility", mNearbyChat->getVisible());
+	}
+}
+
 void LLNearbyChatBar::onChatFontChange(LLFontGL* fontp)
 {
 	// Update things with the new font whohoo
@@ -413,6 +436,8 @@ void LLNearbyChatBar::onToggleNearbyChatPanel()
 		enableResizeCtrls(true);
 		storeRectControl();
 	}
+
+	saveChatHistoryVisibility();
 }
 
 void LLNearbyChatBar::setMinimized(BOOL b)
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index baf12a06ea0..84040b8aab2 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -92,6 +92,11 @@ class LLNearbyChatBar :	public LLFloater
 	LLLocalSpeakerMgr*		mSpeakerMgr;
 
 	S32 mExpandedHeight;
+private:
+
+	// Saves visibility of chat history panel
+	// if save_visibility="true"
+	void saveChatHistoryVisibility();
 };
 
 #endif
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 675f78d911a..63992462b34 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -9,6 +9,7 @@
  single_instance="true"
  title="NEARBY CHAT"
  save_rect="true"
+ save_visibility="true"
  can_close="true"
  can_minimize="true"
  help_topic="chat_bar"
-- 
GitLab


From ed431700ed7ddd57a3629a3cd6bfb9c39b6105e0 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 30 Dec 2011 22:31:19 +0200
Subject: [PATCH 498/933] EXP-1756 FIXED setting user defined window size via
 floater Window Size.

---
 indra/llwindow/llwindow.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 1351bed5473..2e9e31bfea1 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -186,8 +186,8 @@ BOOL LLWindow::setSize(LLCoordScreen size)
 {
 	if (!getMaximized())
 	{
-		size.mX = llmin(size.mX, mMinWindowWidth);
-		size.mY = llmin(size.mY, mMinWindowHeight);
+		size.mX = llmax(size.mX, mMinWindowWidth);
+		size.mY = llmax(size.mY, mMinWindowHeight);
 	}
 	return setSizeImpl(size);
 }
-- 
GitLab


From 3861249a749c99c2a7b05d15ef82f8ff21453d05 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 3 Jan 2012 09:41:16 -0800
Subject: [PATCH 499/933] use lazy deletion of views via die() method to avoid
 some potential crashes

---
 indra/llui/llmenugl.cpp                  |  7 ++++++-
 indra/llui/llview.cpp                    |  6 ++++++
 indra/newview/llfavoritesbar.cpp         |  4 ++--
 indra/newview/llfloatercolorpicker.cpp   |  2 +-
 indra/newview/llfloatersnapshot.cpp      |  2 +-
 indra/newview/llfolderview.cpp           |  4 ++--
 indra/newview/llgrouplist.cpp            |  2 +-
 indra/newview/llpanelpeople.cpp          | 10 +++++-----
 indra/newview/llpanelprofile.cpp         |  2 +-
 indra/newview/llpanelteleporthistory.cpp |  2 +-
 10 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index cb237fca7c8..95ecbb1c947 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -947,9 +947,14 @@ LLMenuItemBranchGL::LLMenuItemBranchGL(const LLMenuItemBranchGL::Params& p)
 
 LLMenuItemBranchGL::~LLMenuItemBranchGL()
 {
-	delete mBranchHandle.get();
+	if (mBranchHandle.get())
+	{
+		mBranchHandle.get()->die();
+	}
 }
 
+
+
 // virtual
 LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse) const
 {
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 486babb0ab9..15293817736 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -121,6 +121,7 @@ LLView::Params::Params()
 
 LLView::LLView(const LLView::Params& p)
 :	mVisible(p.visible),
+	mInDraw(false),
 	mName(p.name),
 	mParentView(NULL),
 	mReshapeFlags(FOLLOWS_NONE),
@@ -281,6 +282,8 @@ void LLView::moveChildToBackOfTabGroup(LLUICtrl* child)
 // virtual
 bool LLView::addChild(LLView* child, S32 tab_group)
 {
+	llassert_always(mInDraw == false);
+
 	if (!child)
 	{
 		return false;
@@ -330,6 +333,7 @@ bool LLView::addChildInBack(LLView* child, S32 tab_group)
 // remove the specified child from the view, and set it's parent to NULL.
 void LLView::removeChild(LLView* child)
 {
+	llassert_always(mInDraw == false);
 	//llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs
 	if (child->mParentView == this) 
 	{
@@ -1081,6 +1085,7 @@ void LLView::draw()
 
 void LLView::drawChildren()
 {
+	mInDraw = true;
 	if (!mChildList.empty())
 	{
 		LLView* rootp = LLUI::getRootView();		
@@ -1119,6 +1124,7 @@ void LLView::drawChildren()
 		}
 		--sDepth;
 	}
+	mInDraw = false;
 }
 
 void LLView::dirtyRect()
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 4f2fd474880..f4b6dc2c816 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -405,8 +405,8 @@ LLFavoritesBarCtrl::~LLFavoritesBarCtrl()
 {
 	gInventory.removeObserver(this);
 
-	delete mOverflowMenuHandle.get();
-	delete mContextMenuHandle.get();
+	if (mOverflowMenuHandle.get()) mOverflowMenuHandle.get()->die();
+	if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
 }
 
 BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 659e52271af..05d73c24167 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -271,7 +271,7 @@ void LLFloaterColorPicker::destroyUI ()
 	if ( mSwatchView )
 	{
 		this->removeChild ( mSwatchView );
-		delete mSwatchView;
+		mSwatchView->die();;
 		mSwatchView = NULL;
 	}
 }
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 1b3290d5a8f..2dd031b5d34 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1977,7 +1977,7 @@ LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)
 // Destroys the object
 LLFloaterSnapshot::~LLFloaterSnapshot()
 {
-	delete impl.mPreviewHandle.get();
+	if (impl.mPreviewHandle.get()) impl.mPreviewHandle.get()->die();
 
 	//unfreeze everything else
 	gSavedSettings.setBOOL("FreezeTime", FALSE);
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 6ec2598e447..20fe85472fe 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -299,7 +299,7 @@ LLFolderView::~LLFolderView( void )
 	mAutoOpenItems.removeAllNodes();
 	gIdleCallbacks.deleteFunction(idle, this);
 
-	delete mPopupMenuHandle.get();
+	if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
 
 	mAutoOpenItems.removeAllNodes();
 	clearSelection();
@@ -1969,7 +1969,7 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 void LLFolderView::deleteAllChildren()
 {
 	closeRenamer();
-	delete mPopupMenuHandle.get();
+	if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
 	mPopupMenuHandle = LLHandle<LLView>();
 	mScrollContainer = NULL;
 	mRenameItem = NULL;
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index f7ed1116cbd..bbf66ca7503 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -95,7 +95,7 @@ LLGroupList::LLGroupList(const Params& p)
 LLGroupList::~LLGroupList()
 {
 	gAgent.removeListener(this);
-	delete mContextMenuHandle.get();
+	if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
 }
 
 // virtual
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index d5e289e6e6a..9c46f04abfd 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -526,11 +526,11 @@ LLPanelPeople::~LLPanelPeople()
 		LLVoiceClient::getInstance()->removeObserver(this);
 	}
 
-	delete mGroupPlusMenuHandle.get();
-	delete mNearbyViewSortMenuHandle.get();
-	delete mFriendsViewSortMenuHandle.get();
-	delete mGroupsViewSortMenuHandle.get();
-	delete mRecentViewSortMenuHandle.get();
+	if (mGroupPlusMenuHandle.get()) mGroupPlusMenuHandle.get()->die();
+	if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
+	if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
+	if (mGroupsViewSortMenuHandle.get()) mGroupsViewSortMenuHandle.get()->die();
+	if (mRecentViewSortMenuHandle.get()) mRecentViewSortMenuHandle.get()->die();
 
 }
 
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index b1eeabb0282..e2e70067737 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -177,7 +177,7 @@ LLPanelProfile::ChildStack::~ChildStack()
 			LLView* viewp = *it;
 			if (viewp)
 			{
-				delete viewp;
+				viewp->die();
 			}
 		}
 		mStack.pop_back();
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index d3543daff08..1f1cccad856 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -388,7 +388,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
 LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
 {
 	LLTeleportHistoryFlatItemStorage::instance().purge();
-	delete mGearMenuHandle.get();
+	if (mGearMenuHandle.get()) mGearMenuHandle.get()->die();
 	mTeleportHistoryChangedConnection.disconnect();
 }
 
-- 
GitLab


From 1b1ad93c5d341eb564a7e6fc1ae9298473d8a98e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 3 Jan 2012 12:21:30 -0800
Subject: [PATCH 500/933] EXP-1512 FIX changing UI size changes cursor position
 in notecards fixed case where adding text between 2 consecutive newlines
 created gibberish

---
 indra/llui/lltextbase.cpp | 15 +++++++++++++--
 indra/llui/llview.h       |  2 ++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1f890b625f5..0040be45c71 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1513,6 +1513,8 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg
 LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index)
 {
 	segment_set_t::iterator it = getSegIterContaining(index);
+	segment_set_t::iterator orig_it = it;
+
 	if (it == mSegments.end()) return it;
 
 	if (!(*it)->canEdit() 
@@ -1520,13 +1522,18 @@ LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32
 		&& it != mSegments.begin())
 	{
 		it--;
+		if ((*it)->canEdit())
+		{
+			return it;
+		}
 	}
-	return it;
+	return orig_it;
 }
 
 LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const
 {
 	segment_set_t::const_iterator it = getSegIterContaining(index);
+	segment_set_t::const_iterator orig_it = it;
 	if (it == mSegments.end()) return it;
 
 	if (!(*it)->canEdit() 
@@ -1534,8 +1541,12 @@ LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaini
 		&& it != mSegments.begin())
 	{
 		it--;
+		if ((*it)->canEdit())
+		{
+			return it;
+		}
 	}
-	return it;
+	return orig_it;
 }
 
 LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index f21fb37e182..f1fac5f69ce 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -612,6 +612,8 @@ class LLView
 
 	S32			mNextInsertionOrdinal;
 
+	bool		mInDraw;
+
 	static LLWindow* sWindow;	// All root views must know about their window.
 
 	typedef std::map<std::string, LLView*> default_widget_map_t;
-- 
GitLab


From 377a9ab9ac3b098492cbd010f3091c713ac6dc83 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 4 Jan 2012 14:50:15 +0200
Subject: [PATCH 501/933] EXP-1586 ADDITIONAL FIX (Nearby chat window no longer
 persists between viewer startups)

- Got rid of confusing conditions.
---
 indra/newview/llnearbychatbar.cpp | 23 ++---------------------
 indra/newview/llnearbychatbar.h   |  5 -----
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index cb08ca8862c..4512c14b7a8 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -111,14 +111,7 @@ BOOL LLNearbyChatBar::postBuild()
 
 	gSavedSettings.declareBOOL("nearbychat_history_visibility", mNearbyChat->getVisible(), "Visibility state of nearby chat history", TRUE);
 
-	// If mVisibilityControl is not empty it means that the visibility state of floater is saved between sessions,
-	// i.e. save_visibility="true" for this floater.
-	// So if we need to restore visibility state of floater we also need to restore visibility state of nearby chat history.
-	if (!mVisibilityControl.empty())
-	{
-		// restore visibility of nearby chat history
-		mNearbyChat->setVisible(gSavedSettings.getBOOL("nearbychat_history_visibility"));
-	}
+	mNearbyChat->setVisible(gSavedSettings.getBOOL("nearbychat_history_visibility"));
 
 	// Register for font change notifications
 	LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1));
@@ -152,18 +145,6 @@ bool LLNearbyChatBar::applyRectControl()
 	return rect_controlled;
 }
 
-void LLNearbyChatBar::saveChatHistoryVisibility()
-{
-	// save visibility state of nearby chat history panel if
-	// visibility of nearby chat floater is saved, i.e. save_visisbility="true"
-	// (if save_visisbility="true", mVisibilityControl == "floater_vis_chat_bar")
-	if (mVisibilityControl.size() > 1)
-	{
-		// save visibility of nearby chat history
-		gSavedSettings.setBOOL("nearbychat_history_visibility", mNearbyChat->getVisible());
-	}
-}
-
 void LLNearbyChatBar::onChatFontChange(LLFontGL* fontp)
 {
 	// Update things with the new font whohoo
@@ -437,7 +418,7 @@ void LLNearbyChatBar::onToggleNearbyChatPanel()
 		storeRectControl();
 	}
 
-	saveChatHistoryVisibility();
+	gSavedSettings.setBOOL("nearbychat_history_visibility", mNearbyChat->getVisible());
 }
 
 void LLNearbyChatBar::setMinimized(BOOL b)
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index 84040b8aab2..baf12a06ea0 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -92,11 +92,6 @@ class LLNearbyChatBar :	public LLFloater
 	LLLocalSpeakerMgr*		mSpeakerMgr;
 
 	S32 mExpandedHeight;
-private:
-
-	// Saves visibility of chat history panel
-	// if save_visibility="true"
-	void saveChatHistoryVisibility();
 };
 
 #endif
-- 
GitLab


From ce6bd89ca4fbc3d1d75725e8cfc8857e21052107 Mon Sep 17 00:00:00 2001
From: Ima Mechanique <none@none>
Date: Wed, 4 Jan 2012 15:16:35 +0000
Subject: [PATCH 502/933] Changes per Oz's suggestion on RB.

---
 indra/newview/llpreviewscript.cpp | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index cab30b12952..88727bf59b4 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1154,18 +1154,15 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata )
 	if( self->mSaveCallback )
 	{
 		LLFilePicker& file_picker = LLFilePicker::instance();
-		if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) )
+		if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) )
 		{
-			//File picking cancelled by user, so nothing to do.
-			return;
+			std::string filename = file_picker.getFirstFile();
+			std::string scriptText=self->mEditor->getText();
+			std::ofstream fout(filename.c_str());
+			fout<<(scriptText);
+			fout.close();
+			self->mSaveCallback( self->mUserdata, FALSE );
 		}
-
-		std::string filename = file_picker.getFirstFile();
-		std::string scriptText=self->mEditor->getText();
-		std::ofstream fout(filename.c_str());
-		fout<<(scriptText);
-		fout.close();
-		self->mSaveCallback( self->mUserdata, FALSE );
 	}
 }
 
@@ -1187,8 +1184,7 @@ bool LLScriptEdCore::enableSaveToFileMenu(void* userdata)
 bool LLScriptEdCore::enableLoadFromFileMenu(void* userdata)
 {
 	LLScriptEdCore* self = (LLScriptEdCore*)userdata;
-	if (!self || !self->mEditor) return FALSE;
-	return self->mEditor->canLoadOrSaveToFile();
+	return (self && self->mEditor) ? self->mEditor->canLoadOrSaveToFile() : FALSE;
 }
 
 /// ---------------------------------------------------------------------------
-- 
GitLab


From 94ad019ce3387b9c5207fe3207933697059dd2dd Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 4 Jan 2012 14:14:23 -0700
Subject: [PATCH 503/933] fix for SH-2823 and SH-2824: crash in curl:
 LLBufferArray::countAfter() and LLBufferArray::copyIntoBuffers reviewed by
 vir

---
 indra/llmessage/llurlrequest.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index a3a2b2b1b8c..261e57e79e4 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -64,7 +64,7 @@ class LLURLRequestDetail
 	~LLURLRequestDetail();
 	std::string mURL;
 	LLCurlEasyRequest* mCurlRequest;
-	LLBufferArray* mResponseBuffer;
+	LLIOPipe::buffer_ptr_t mResponseBuffer;
 	LLChannelDescriptors mChannels;
 	U8* mLastRead;
 	U32 mBodyLimit;
@@ -75,7 +75,6 @@ class LLURLRequestDetail
 
 LLURLRequestDetail::LLURLRequestDetail() :
 	mCurlRequest(NULL),
-	mResponseBuffer(NULL),
 	mLastRead(NULL),
 	mBodyLimit(0),
 	mByteAccumulator(0),
@@ -90,7 +89,6 @@ LLURLRequestDetail::~LLURLRequestDetail()
 {
 	LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
 	delete mCurlRequest;
-	mResponseBuffer = NULL;
 	mLastRead = NULL;
 }
 
@@ -326,7 +324,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 
 		// *FIX: bit of a hack, but it should work. The configure and
 		// callback method expect this information to be ready.
-		mDetail->mResponseBuffer = buffer.get();
+		mDetail->mResponseBuffer = buffer;
 		mDetail->mChannels = channels;
 		if(!configure())
 		{
-- 
GitLab


From 912833bafa9a59734432787158e36b66ee9586aa Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 4 Jan 2012 14:04:32 -0800
Subject: [PATCH 504/933] EXP-1738 FIX -- Disable drag and drop to folders in
 the outbox that would create a hierarchy that contains too many folders

* Updated drag and drop to correctly handle moving to and from outbox as opposed to within the outbox when dealing with
  folder and item count limitations related to depth and total folder count.
---
 indra/newview/llfloateroutbox.cpp             |   2 +-
 indra/newview/llfolderviewitem.cpp            |  14 +--
 indra/newview/llfolderviewitem.h              |  10 +-
 indra/newview/llinventorybridge.cpp           | 101 ++++++++++++++----
 indra/newview/lltooldraganddrop.cpp           |   2 +
 .../newview/skins/default/xui/en/strings.xml  |   3 +
 6 files changed, 96 insertions(+), 36 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index b97cc54dd1e..8ccebb36dc2 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -387,7 +387,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 		{
 			LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder();
 			
-			handled = root_folder->handleDragAndDropToRoot(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+			handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 		}
 	}
 	
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 526800d4bef..dc42bb148dc 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -2285,7 +2285,7 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask,
 
 	if (!handled)
 	{
-		handleDragAndDropToRoot(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+		handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 
 		lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFolderViewFolder" << llendl;
 	}
@@ -2293,12 +2293,12 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask,
 	return TRUE;
 }
 
-BOOL LLFolderViewFolder::handleDragAndDropToRoot(MASK mask,
-												 BOOL drop,
-												 EDragAndDropType cargo_type,
-												 void* cargo_data,
-												 EAcceptance* accept,
-												 std::string& tooltip_msg)
+BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask,
+													   BOOL drop,
+													   EDragAndDropType cargo_type,
+													   void* cargo_data,
+													   EAcceptance* accept,
+													   std::string& tooltip_msg)
 {
 	BOOL accepted = mListener && mListener->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg);
 	
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 02461fb1444..0f8c3edef82 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -547,11 +547,11 @@ class LLFolderViewFolder : public LLFolderViewItem
 		void* cargo_data,
 		EAcceptance* accept,
 		std::string& tooltip_msg);
-	BOOL handleDragAndDropToRoot(MASK mask, BOOL drop,
-								 EDragAndDropType cargo_type,
-								 void* cargo_data,
-								 EAcceptance* accept,
-								 std::string& tooltip_msg);
+	BOOL handleDragAndDropToThisFolder(MASK mask, BOOL drop,
+									   EDragAndDropType cargo_type,
+									   void* cargo_data,
+									   EAcceptance* accept,
+									   std::string& tooltip_msg);
 	virtual void draw();
 
 	time_t getCreationDate() const;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 96c527859c8..c94deed5e2a 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1926,23 +1926,47 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		//
 
 		BOOL is_movable = TRUE;
-		if (LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType()))
+
+		if (is_movable && (mUUID == cat_id))
+		{
+			is_movable = FALSE;
+			tooltip_msg = LLTrans::getString("TooltipDragOntoSelf");
+		}
+		if (is_movable && (model->isObjectDescendentOf(mUUID, cat_id)))
+		{
+			is_movable = FALSE;
+			tooltip_msg = LLTrans::getString("TooltipDragOntoOwnChild");
+		}
+		if (is_movable && LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType()))
+		{
 			is_movable = FALSE;
-		else if (move_is_into_outfit)
+			// tooltip?
+		}
+		if (is_movable && move_is_into_outfit)
+		{
 			is_movable = FALSE;
-		else if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE))
+			// tooltip?
+		}
+		if (is_movable && (mUUID == model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE)))
+		{
 			is_movable = FALSE;
+			// tooltip?
+		}
+		
 		LLInventoryModel::cat_array_t descendent_categories;
 		LLInventoryModel::item_array_t descendent_items;
-		gInventory.collectDescendents(cat_id, descendent_categories, descendent_items, FALSE);
-		for (S32 i=0; i < descendent_categories.count(); ++i)
+		if (is_movable)
 		{
-			LLInventoryCategory* category = descendent_categories[i];
-			if(LLFolderType::lookupIsProtectedType(category->getPreferredType()))
+			model->collectDescendents(cat_id, descendent_categories, descendent_items, FALSE);
+			for (S32 i=0; i < descendent_categories.count(); ++i)
 			{
-				// Can't move "special folders" (e.g. Textures Folder).
-				is_movable = FALSE;
-				break;
+				LLInventoryCategory* category = descendent_categories[i];
+				if(LLFolderType::lookupIsProtectedType(category->getPreferredType()))
+				{
+					// Can't move "special folders" (e.g. Textures Folder).
+					is_movable = FALSE;
+					break;
+				}
 			}
 		}
 		if (is_movable && move_is_into_trash)
@@ -1974,7 +1998,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		}
 		if (is_movable && move_is_into_outbox)
 		{
-			int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
+			const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
 			
 			if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"))
 			{
@@ -1983,23 +2007,56 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else
 			{
-				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
-				
+				int dragged_folder_count = descendent_categories.count();
 				int existing_item_count = 0;
-				int existing_folder_count = 1 + LLToolDragAndDrop::instance().getCargoIDsCount();  // +1 for master folder
+				int existing_folder_count = 0;
+				
+				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
 				if (master_folder != NULL)
 				{
+					if (model->isObjectDescendentOf(cat_id, master_folder->getUUID()))
+					{
+						// Don't use count because we're already inside the same category anyway
+						dragged_folder_count = 0;
+					}
+					else
+					{
+						existing_folder_count = 1; // Include the master folder in the count!
+
+						// If we're in the drop operation as opposed to the drag without drop, we are doing a
+						// single category at a time so don't block based on the total amount of cargo data items
+						if (drop)
+						{
+							dragged_folder_count += 1;
+						}
+						else
+						{
+							// NOTE: The cargo id's count is a total of categories AND items but we err on the side of
+							//       prevention rather than letting too many folders into the hierarchy of the outbox,
+							//       when we're dragging the item to a new parent
+							dragged_folder_count += LLToolDragAndDrop::instance().getCargoIDsCount();
+						}
+					}
+					
+					// Tally the total number of categories and items inside the master folder
+
 					LLInventoryModel::cat_array_t existing_categories;
 					LLInventoryModel::item_array_t existing_items;
 
-					gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
+					model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
 					
-					existing_item_count += existing_items.count();
 					existing_folder_count += existing_categories.count();
+					existing_item_count += existing_items.count();
+				}
+				else
+				{
+					// Assume a single category is being dragged to the outbox since we evaluate one at a time
+					// when not putting them under a parent item.
+					dragged_folder_count += 1;
 				}
 
-				const int nested_folder_count = existing_folder_count + descendent_categories.count();
+				const int nested_folder_count = existing_folder_count + dragged_folder_count;
 				const int nested_item_count = existing_item_count + descendent_items.count();
 				
 				if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
@@ -2031,10 +2088,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		// 
 		//--------------------------------------------------------------------------------
 
-		accept = is_movable
-			&& (mUUID != cat_id)								// Can't move a folder into itself
-			&& (mUUID != inv_cat->getParentUUID())				// Avoid moves that would change nothing
-			&& !(model->isObjectDescendentOf(mUUID, cat_id));	// Avoid circularity
+		accept = is_movable;
+
 		if (accept && drop)
 		{
 			// Look for any gestures and deactivate them
@@ -2066,7 +2121,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 						// Recursively create links in target outfit.
 						LLInventoryModel::cat_array_t cats;
 						LLInventoryModel::item_array_t items;
-						gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
+						model->collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
 						LLAppearanceMgr::instance().linkAll(mUUID,items,NULL);
 					}
 				}
@@ -2100,7 +2155,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else
 			{
-				if (gInventory.isObjectDescendentOf(cat_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
+				if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
 				{
 					set_dad_inbox_object(cat_id);
 				}
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 6910b8eced6..6338ea477ce 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -626,6 +626,8 @@ BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, MASK mask)
 void LLToolDragAndDrop::handleDeselect()
 {
 	mToolTipMsg.clear();
+
+	LLToolTipMgr::instance().blockToolTips();
 }
 
 // protected
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 18ca3033e99..6672d479a20 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -172,6 +172,9 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds 20</string>
 	<string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds 200</string>
 	
+	<string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string>
+	<string name="TooltipDragOntoSelf">You can't move a folder into itself</string>
+	
 	<!-- tooltips for Urls -->
 	<string name="TooltipHttpUrl">Click to view this web page</string>
 	<string name="TooltipSLURL">Click to view this location's information</string>
-- 
GitLab


From e326b1e0fa8ccae7f62e4d028bd9cfeade2ff9d7 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Wed, 4 Jan 2012 17:41:54 -0500
Subject: [PATCH 505/933] Added tag DRTVWR-106_3.2.5-beta1, 3.2.5-beta1 for
 changeset 3d2d5d244c63

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 539efb0ffc4..97e0cc033c1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -232,3 +232,5 @@ a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 3fe994349fae64fc40874bb59db387131eb35a41 DRTVWR-104_3.2.4-beta1
 3fe994349fae64fc40874bb59db387131eb35a41 3.2.4-beta1
 8a44ff3d2104269ce76145c2772cf1bdff2a2abe 3.2.5-start
+3d2d5d244c6398a4214c666d5dd3965b0918709a DRTVWR-106_3.2.5-beta1
+3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
-- 
GitLab


From b99dfa7d468b37f19b8cc08a5d00b2eceddbfbb1 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Wed, 4 Jan 2012 17:42:40 -0500
Subject: [PATCH 506/933] Added tag DRTVWR-107_3.2.5-beta2, 3.2.5-beta2 for
 changeset 65a2c1c8d855

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 97e0cc033c1..90566e16e8f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -234,3 +234,5 @@ a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 8a44ff3d2104269ce76145c2772cf1bdff2a2abe 3.2.5-start
 3d2d5d244c6398a4214c666d5dd3965b0918709a DRTVWR-106_3.2.5-beta1
 3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
+65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
+65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
-- 
GitLab


From 990b5aea2b92ac8c06651ad94db9506a42ba1be0 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 4 Jan 2012 17:34:11 -0800
Subject: [PATCH 507/933] EXP-1769 FIX -- Crash in ASSERT (mInDraw == false) -
 can trigger with selecting build tool

* Fixed build window to not fail assert at construction time.
---
 indra/newview/llfloatermediasettings.cpp | 11 +++++++----
 indra/newview/llfloatertools.cpp         |  4 +---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp
index b5f1b967df7..895e16adef7 100644
--- a/indra/newview/llfloatermediasettings.cpp
+++ b/indra/newview/llfloatermediasettings.cpp
@@ -212,10 +212,13 @@ void LLFloaterMediaSettings::commitFields()
 //static 
 void LLFloaterMediaSettings::clearValues( bool editable)
 {
-	// clean up all panels before updating
-	sInstance->mPanelMediaSettingsGeneral	 ->clearValues(sInstance->mPanelMediaSettingsGeneral,  editable);
-	sInstance->mPanelMediaSettingsSecurity	 ->clearValues(sInstance->mPanelMediaSettingsSecurity,	editable);
-	sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions,  editable);	
+	if (sInstance)
+	{
+		// clean up all panels before updating
+		sInstance->mPanelMediaSettingsGeneral	 ->clearValues(sInstance->mPanelMediaSettingsGeneral,  editable);
+		sInstance->mPanelMediaSettingsSecurity	 ->clearValues(sInstance->mPanelMediaSettingsSecurity,	editable);
+		sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions,  editable);
+	}
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 1008b4a6e4c..bd5b5f4eb0c 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -529,7 +529,7 @@ void LLFloaterTools::refresh()
 	mPanelLandInfo->refresh();
 
 	// Refresh the advanced weights floater
-	LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::getTypedInstance<LLFloaterObjectWeights>("object_weights");
+	LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::findTypedInstance<LLFloaterObjectWeights>("object_weights");
 	if(object_weights_floater && object_weights_floater->getVisible())
 	{
 		object_weights_floater->refresh();
@@ -1409,9 +1409,7 @@ bool LLFloaterTools::deleteMediaConfirm(const LLSD& notification, const LLSD& re
 //
 void LLFloaterTools::clearMediaSettings()
 {
-	LLFloaterMediaSettings::getInstance();
 	LLFloaterMediaSettings::clearValues(false);
-
 }
 
 //////////////////////////////////////////////////////////////////////////////
-- 
GitLab


From 9c8f6ba6a51b799d16e89e995bbcf3b0dcc15c62 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 4 Jan 2012 17:37:57 -0800
Subject: [PATCH 508/933] Modified CRASH assert to not occur in release mode
 per Richard

---
 indra/llui/llview.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 15293817736..542f57ee5fd 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -282,7 +282,8 @@ void LLView::moveChildToBackOfTabGroup(LLUICtrl* child)
 // virtual
 bool LLView::addChild(LLView* child, S32 tab_group)
 {
-	llassert_always(mInDraw == false);
+	// NOTE: Changed this to not crash in release mode
+	llassert(mInDraw == false);
 
 	if (!child)
 	{
-- 
GitLab


From ce1f95bade2eeec5732d3275bb54fd1612ab03fb Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 4 Jan 2012 21:06:54 -0700
Subject: [PATCH 509/933] trivial: debug code for SH-2828: [crashhunters] Crash
 in LLRefCount::unref(), bad stacks

---
 indra/newview/llviewerwindow.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 31dfa1923c2..29f951da93d 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1956,33 +1956,42 @@ void LLViewerWindow::shutdownViews()
 	// clean up warning logger
 	LLError::removeRecorder(RecordToChatConsole::getInstance());
 
+	llinfos << "Warning logger is cleaned." << llendl ;
+
 	delete mDebugText;
 	mDebugText = NULL;
 	
+	llinfos << "DebugText deleted." << llendl ;
+
 	// Cleanup global views
 	if (gMorphView)
 	{
 		gMorphView->setVisible(FALSE);
 	}
+	llinfos << "Global views cleaned." << llendl ;
 
 	// DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open
 	// will crump with LL_ERRS.
 	LLModalDialog::shutdownModals();
-	
+	llinfos << "LLModalDialog shut down." << llendl; 
+
 	// destroy the nav bar, not currently part of gViewerWindow
 	// *TODO: Make LLNavigationBar part of gViewerWindow
 	if (LLNavigationBar::instanceExists())
 	{
 		delete LLNavigationBar::getInstance();
 	}
+	llinfos << "LLNavigationBar destroyed." << llendl ;
 
 	// destroy menus after instantiating navbar above, as it needs
 	// access to gMenuHolder
 	cleanup_menus();
+	llinfos << "menus destroyed." << llendl ;
 
 	// Delete all child views.
 	delete mRootView;
 	mRootView = NULL;
+	llinfos << "RootView deleted." << llendl ;
 
 	// Automatically deleted as children of mRootView.  Fix the globals.
 	gStatusBar = NULL;
-- 
GitLab


From 263fd1345875eb0389e2ed0a8cbeb4e458a2d007 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 5 Jan 2012 10:57:09 -0800
Subject: [PATCH 510/933] Removed unused code for old outbox error reporting

---
 .../llpanelmarketplaceoutboxinventory.cpp     | 99 +------------------
 .../llpanelmarketplaceoutboxinventory.h       | 26 +----
 .../en/widgets/outbox_folder_view_folder.xml  | 10 --
 3 files changed, 8 insertions(+), 127 deletions(-)

diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
index ed1206aec82..1dd68b77585 100644
--- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
@@ -46,50 +46,6 @@ static LLDefaultChildRegistry::Register<LLOutboxInventoryPanel> r1("outbox_inven
 static LLDefaultChildRegistry::Register<LLOutboxFolderViewFolder> r2("outbox_folder_view_folder");
 
 
-//
-// Marketplace errors
-//
-
-enum
-{
-	MKTERR_NONE = 0,
-
-	MKTERR_NOT_MERCHANT,
-	MKTERR_FOLDER_EMPTY,
-	MKTERR_UNASSOCIATED_PRODUCTS,
-	MKTERR_OBJECT_LIMIT,
-	MKTERR_FOLDER_DEPTH,
-	MKTERR_UNSELLABLE_ITEM,
-	MKTERR_INTERNAL_IMPORT,
-
-	MKTERR_COUNT
-};
-
-static const std::string MARKETPLACE_ERROR_STRINGS[MKTERR_COUNT] =
-{
-	"NO_ERROR",
-	"NOT_MERCHANT_ERROR",
-	"FOLDER_EMPTY_ERROR",
-	"UNASSOCIATED_PRODUCTS_ERROR",
-	"OBJECT_LIMIT_ERROR",
-	"FOLDER_DEPTH_ERROR",
-	"UNSELLABLE_ITEM_FOUND",
-	"INTERNAL_IMPORT_ERROR",
-};
-
-static const std::string MARKETPLACE_ERROR_NAMES[MKTERR_COUNT] =
-{
-	"Marketplace Error None",
-	"Marketplace Error Not Merchant",
-	"Marketplace Error Empty Folder",
-	"Marketplace Error Unassociated Products",
-	"Marketplace Error Object Limit",
-	"Marketplace Error Folder Depth",
-	"Marketplace Error Unsellable Item",
-	"Marketplace Error Internal Import",
-};
-
-
 //
 // LLOutboxInventoryPanel Implementation
 //
@@ -206,63 +162,18 @@ LLFolderViewItem * LLOutboxInventoryPanel::createFolderViewItem(LLInvFVBridge *
 
 LLOutboxFolderViewFolder::LLOutboxFolderViewFolder(const Params& p)
 	: LLFolderViewFolder(p)
-	, LLBadgeOwner(getHandle())
-	, mError(0)
-{
-	initBadgeParams(p.error_badge());
-}
-
-LLOutboxFolderViewFolder::~LLOutboxFolderViewFolder()
 {
 }
 
-// virtual
-void LLOutboxFolderViewFolder::draw()
-{
-	if (!badgeHasParent())
-	{
-		addBadgeToParentPanel();
-	}
-	
-	setBadgeVisibility(hasError());
-
-	LLFolderViewFolder::draw();
-}
-
-void LLOutboxFolderViewFolder::setErrorString(const std::string& errorString)
-{
-	S32 error_code = MKTERR_NONE;
-
-	for (S32 i = 1; i < MKTERR_COUNT; ++i)
-	{
-		if (MARKETPLACE_ERROR_STRINGS[i] == errorString)
-		{
-			error_code = i;
-			break;
-		}
-	}
-
-	setError(error_code);
-}
-
-void LLOutboxFolderViewFolder::setError(S32 errorCode)
-{
-	mError = errorCode;
-
-	if (hasError())
-	{
-		setToolTip(LLTrans::getString(MARKETPLACE_ERROR_NAMES[mError]));
-	}
-	else
-	{
-		setToolTip(LLStringExplicit(""));
-	}
-}
-
 //
 // LLOutboxFolderViewItem Implementation
 //
 
+LLOutboxFolderViewItem::LLOutboxFolderViewItem(const Params& p)
+	: LLFolderViewItem(p)
+{
+}
+
 BOOL LLOutboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
 {
 	return TRUE;
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h
index 346680a79d9..167f371f0ec 100644
--- a/indra/newview/llpanelmarketplaceoutboxinventory.h
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.h
@@ -28,7 +28,6 @@
 #define LL_OUTBOXINVENTORYPANEL_H
 
 
-#include "llbadgeowner.h"
 #include "llinventorypanel.h"
 #include "llfolderviewitem.h"
 
@@ -53,41 +52,22 @@ class LLOutboxInventoryPanel : public LLInventoryPanel
 };
 
 
-class LLOutboxFolderViewFolder : public LLFolderViewFolder, public LLBadgeOwner
+class LLOutboxFolderViewFolder : public LLFolderViewFolder
 {
 public:
 	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
 	{
-		Optional<LLBadge::Params>	error_badge;
-		
-		Params()
-			: error_badge("error_badge")
-		{
-		}
+		Params() {}
 	};
 	
 	LLOutboxFolderViewFolder(const Params& p);
-	~LLOutboxFolderViewFolder();
-
-	void draw();
-
-	void setErrorString(const std::string& errorString);
-	void setError(S32 errorCode);
-	
-	bool hasError() const { return (mError != 0); }
-
-protected:
-	S32 mError;
 };
 
 
 class LLOutboxFolderViewItem : public LLFolderViewItem
 {
 public:
-	LLOutboxFolderViewItem(const Params& p)
-		: LLFolderViewItem(p)
-	{
-	}
+	LLOutboxFolderViewItem(const Params& p);
 
 	// virtual
 	BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
index 07929961075..d19c47f54f3 100644
--- a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
@@ -6,14 +6,4 @@
   item_top_pad="4"
   selection_image="Rounded_Square"
   >
-  <error_badge 
-    label=" " 
-    label_offset_horiz="-1"
-    location="right" 
-    padding_horiz="12.5" 
-    padding_vert="2"
-    location_offset_hcenter="-23"
-    image="Error_Tag_Background"
-    image_color="Black"
-    />
 </outbox_folder_view_folder>
-- 
GitLab


From 26998a5e387edca7d89159673c3dc8cd1a8d7539 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 5 Jan 2012 12:42:58 -0800
Subject: [PATCH 511/933] EXP-1753 FIX -- Open Merchant Outbox floater when
 user selects copy to Merchant Outbox context menu option in Inventory

* Modified "copy to merchant outbox" and "move to merchant outbox" context menu actions to also open the merchant outbox floater
* Changed context menu behavior to always preserve disabled menu items on multiselect rather than occasionally ignoring it
---
 indra/newview/llinventorybridge.cpp    | 24 ++++++++++++------------
 indra/newview/llinventorybridge.h      |  3 +--
 indra/newview/llinventoryfunctions.cpp | 15 ++++++++++-----
 3 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c94deed5e2a..3b6dad7f5cb 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -465,14 +465,13 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 
 void hide_context_entries(LLMenuGL& menu, 
 						  const menuentry_vec_t &entries_to_show,
-						  const menuentry_vec_t &disabled_entries,
-						  BOOL append) // If append is TRUE, then new enabled entries 
+						  const menuentry_vec_t &disabled_entries) // If append is TRUE, then new enabled entries 
 {
 	const LLView::child_list_t *list = menu.getChildList();
 
 	// For removing double separators or leading separator.  Start at true so that
 	// if the first element is a separator, it will not be shown.
-	BOOL is_previous_entry_separator = TRUE;
+	bool is_previous_entry_separator = true;
 
 	for (LLView::child_list_t::const_iterator itor = list->begin(); 
 		 itor != list->end(); 
@@ -496,6 +495,7 @@ void hide_context_entries(LLMenuGL& menu,
 			if (*itor2 == name)
 			{
 				found = true;
+				break;
 			}
 		}
 
@@ -503,9 +503,8 @@ void hide_context_entries(LLMenuGL& menu,
 		// between two separators).
 		if (found)
 		{
-			const BOOL is_entry_separator = (dynamic_cast<LLMenuItemSeparatorGL *>(menu_item) != NULL);
-			if (is_entry_separator && is_previous_entry_separator)
-				found = false;
+			const bool is_entry_separator = (dynamic_cast<LLMenuItemSeparatorGL *>(menu_item) != NULL);
+			found = !(is_entry_separator && is_previous_entry_separator);
 			is_previous_entry_separator = is_entry_separator;
 		}
 		
@@ -523,15 +522,13 @@ void hide_context_entries(LLMenuGL& menu,
 			// A bit of a hack so we can remember that some UI element explicitly set this to be visible
 			// so that some other UI element from multi-select doesn't later set this invisible.
 			menu_item->pushVisible(TRUE);
-			if (append)
-			{
-				menu_item->setEnabled(TRUE);
-			}
+
 			for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2)
 			{
 				if (*itor2 == name)
 				{
 					menu_item->setEnabled(FALSE);
+					break;
 				}
 			}
 		}
@@ -2946,7 +2943,7 @@ void LLFolderBridge::folderOptionsMenu()
 	LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get());
 	if (menup)
 	{
-		hide_context_entries(*menup, mItems, mDisabledItems, TRUE);
+		hide_context_entries(*menup, mItems, mDisabledItems);
 
 		// Reposition the menu, in case we're adding items to an existing menu.
 		menup->needsArrange();
@@ -3025,11 +3022,14 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		// Not sure what the right thing is to do here.
 		if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT))
 		{
-			if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox
+			if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox or outbox
 			{
 				// Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694.
 				if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat))
+				{
 					mItems.push_back(std::string("New Folder"));
+				}
+
 				mItems.push_back(std::string("New Script"));
 				mItems.push_back(std::string("New Note"));
 				mItems.push_back(std::string("New Gesture"));
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 126a28f74c9..447d781f482 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -648,7 +648,6 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 // are set as enabled.
 void hide_context_entries(LLMenuGL& menu, 
 						  const menuentry_vec_t &entries_to_show, 
-						  const menuentry_vec_t &disabled_entries,
-						  BOOL append = FALSE);
+						  const menuentry_vec_t &disabled_entries);
 
 #endif // LL_LLINVENTORYBRIDGE_H
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 6c5325620eb..e8efac1ebfb 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -530,6 +530,11 @@ void show_item_original(const LLUUID& item_uuid)
 	}
 }
 
+void open_outbox()
+{
+	LLFloaterReg::showInstance("outbox");
+}
+
 void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 {
 	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -588,6 +593,8 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 				parent = next_parent;
 			}
 		}
+		
+		open_outbox();
 	}
 }
 
@@ -625,6 +632,8 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 								dest_folder,
 								inv_item->getName(),
 								LLPointer<LLInventoryCallback>(NULL));
+
+			open_outbox();
 		}
 		else
 		{	
@@ -682,11 +691,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold
 		copy_folder_to_outbox(category, new_folder_id, top_level_folder);
 	}
 
-	// delete the folder if we have emptied it
-	//if (cat_array->empty() && item_array->empty())
-	//{
-	//	remove_category(inventory_model, inv_cat->getUUID());
-	//}
+	open_outbox();
 }
 
 ///----------------------------------------------------------------------------
-- 
GitLab


From b0db21a8ae93283acc99491b9b14c2e8f1a35395 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 5 Jan 2012 15:40:27 -0800
Subject: [PATCH 512/933] EXP-1754 FIX -- Search text shown in Outbox floater
 after marketplace synch if all items removed.

* Added a setting to determine whether or not to display the standard empty inventory message.
  The message is on by default but turned off for the merchant outbox inventory panel.
---
 indra/newview/llfolderview.cpp                |  5 +--
 indra/newview/llfolderview.h                  |  2 ++
 indra/newview/llinventorypanel.cpp            |  2 ++
 indra/newview/llinventorypanel.h              |  3 ++
 .../llpanelmarketplaceoutboxinventory.cpp     | 31 -------------------
 .../xui/en/widgets/outbox_inventory_panel.xml |  2 +-
 6 files changed, 11 insertions(+), 34 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 0af20f5de57..6cc136f58b3 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -172,6 +172,7 @@ LLFolderView::Params::Params()
 	title("title"),
 	use_label_suffix("use_label_suffix"),
 	allow_multiselect("allow_multiselect", true),
+	show_empty_message("show_empty_message", true),
 	show_load_status("show_load_status", true),
 	use_ellipses("use_ellipses", false)
 {
@@ -185,6 +186,7 @@ LLFolderView::LLFolderView(const Params& p)
 	mScrollContainer( NULL ),
 	mPopupMenuHandle(),
 	mAllowMultiSelect(p.allow_multiselect),
+	mShowEmptyMessage(p.show_empty_message),
 	mShowFolderHierarchy(FALSE),
 	mSourceID(p.task_id),
 	mRenameItem( NULL ),
@@ -932,7 +934,7 @@ void LLFolderView::draw()
 		mStatusText.clear();
 		mStatusTextBox->setVisible( FALSE );
 	}
-	else
+	else if (mShowEmptyMessage)
 	{
 		if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration())
 		{
@@ -966,7 +968,6 @@ void LLFolderView::draw()
 			// See EXT-7564, EXT-7047.
 			arrangeFromRoot();
 		}
-		
 	}
 
 	// skip over LLFolderViewFolder::draw since we don't want the folder icon, label, 
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 8af01e9102b..2da70f019c8 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -75,6 +75,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 		Optional<std::string>   title;
 		Optional<bool>			use_label_suffix,
 								allow_multiselect,
+								show_empty_message,
 								show_load_status,
 								use_ellipses;
 
@@ -282,6 +283,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	selected_items_t				mSelectedItems;
 	BOOL							mKeyboardSelection;
 	BOOL							mAllowMultiSelect;
+	BOOL							mShowEmptyMessage;
 	BOOL							mShowFolderHierarchy;
 	LLUUID							mSourceID;
 
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index af1d2b8528f..382569fa3a3 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -132,6 +132,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
 	mAcceptsDragAndDrop(p.accepts_drag_and_drop),
 	mAllowMultiSelect(p.allow_multi_select),
 	mShowItemLinkOverlays(p.show_item_link_overlays),
+	mShowEmptyMessage(p.show_empty_message),
 	mShowLoadStatus(p.show_load_status),
 	mViewsInitialized(false),
 	mInvFVBridgeBuilder(NULL)
@@ -617,6 +618,7 @@ LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool u
 	p.listener =  bridge;
 	p.use_label_suffix = useLabelSuffix;
 	p.allow_multiselect = mAllowMultiSelect;
+	p.show_empty_message = mShowEmptyMessage;
 	p.show_load_status = mShowLoadStatus;
 
 	return LLUICtrlFactory::create<LLFolderView>(p);
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 2a243271153..8279163762f 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -84,6 +84,7 @@ class LLInventoryPanel : public LLPanel
 		Optional<Filter>					filter;
 		Optional<std::string>               start_folder;
 		Optional<bool>						use_label_suffix;
+		Optional<bool>						show_empty_message;
 		Optional<bool>						show_load_status;
 		Optional<LLScrollContainer::Params>	scroll;
 		Optional<bool>						accepts_drag_and_drop;
@@ -96,6 +97,7 @@ class LLInventoryPanel : public LLPanel
 			filter("filter"),
 			start_folder("start_folder"),
 			use_label_suffix("use_label_suffix", true),
+			show_empty_message("show_empty_message", true),
 			show_load_status("show_load_status"),
 			scroll("scroll"),
 			accepts_drag_and_drop("accepts_drag_and_drop")
@@ -188,6 +190,7 @@ class LLInventoryPanel : public LLPanel
 	BOOL						mAcceptsDragAndDrop;
 	BOOL 						mAllowMultiSelect;
 	BOOL 						mShowItemLinkOverlays; // Shows link graphic over inventory item icons
+	BOOL						mShowEmptyMessage;
 	BOOL						mShowLoadStatus;
 
 	LLFolderView*				mFolderRoot;
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
index 1dd68b77585..c14a0c83790 100644
--- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
@@ -67,37 +67,6 @@ void LLOutboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& par
 	
 	LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
 	
-	// leslie -- temporary HACK to work around sim not creating outbox with proper system folder type
-	if (root_id.isNull())
-	{
-		std::string start_folder_name(params.start_folder());
-		
-		LLInventoryModel::cat_array_t* cats;
-		LLInventoryModel::item_array_t* items;
-		
-		gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items);
-		
-		if (cats)
-		{
-			for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it)
-			{
-				LLInventoryCategory* cat = *cat_it;
-				
-				if (cat->getName() == start_folder_name)
-				{
-					root_id = cat->getUUID();
-					break;
-				}
-			}
-		}
-		
-		if (root_id == LLUUID::null)
-		{
-			llwarns << "No category found that matches outbox inventory panel start_folder: " << start_folder_name << llendl;
-		}
-	}
-	// leslie -- end temporary HACK
-	
 	if (root_id == LLUUID::null)
 	{
 		llwarns << "Outbox inventory panel has no root folder!" << llendl;
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
index e3f20728196..3964569da24 100644
--- a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_inventory_panel show_load_status="false" />
+<outbox_inventory_panel show_empty_message="false" show_load_status="false" />
-- 
GitLab


From af32a74b77ffc2110de821e0159de8eb5aa0f454 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 5 Jan 2012 16:30:15 -0800
Subject: [PATCH 513/933] EXP-1757 FIX -- Merchant Outbox shows as empty when
 first opening/initializing even when populated

* Updated merchant outbox floater to not wait for initialization to complete before displaying outbox inventory contents.
---
 indra/newview/CMakeLists.txt               |   2 -
 indra/newview/llfloateroutbox.cpp          |  13 +-
 indra/newview/llfloateroutbox.h            |   1 +
 indra/newview/llpanelmarketplaceoutbox.cpp | 276 ---------------------
 indra/newview/llpanelmarketplaceoutbox.h   |  91 -------
 5 files changed, 10 insertions(+), 373 deletions(-)
 delete mode 100644 indra/newview/llpanelmarketplaceoutbox.cpp
 delete mode 100644 indra/newview/llpanelmarketplaceoutbox.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 0a4874ae926..78cd33210fb 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -372,7 +372,6 @@ set(viewer_SOURCE_FILES
     llpanelmaininventory.cpp
     llpanelmarketplaceinbox.cpp
     llpanelmarketplaceinboxinventory.cpp
-    llpanelmarketplaceoutbox.cpp
     llpanelmarketplaceoutboxinventory.cpp
     llpanelmediasettingsgeneral.cpp
     llpanelmediasettingspermissions.cpp
@@ -922,7 +921,6 @@ set(viewer_HEADER_FILES
     llpanelmaininventory.h
     llpanelmarketplaceinbox.h
     llpanelmarketplaceinboxinventory.h
-    llpanelmarketplaceoutbox.h
     llpanelmarketplaceoutboxinventory.h
     llpanelmediasettingsgeneral.h
     llpanelmediasettingspermissions.h
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 8ccebb36dc2..6ecf7155882 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -280,6 +280,14 @@ void LLFloaterOutbox::updateFolderCount()
 	
 	mOutboxItemCount = item_count;
 
+	if (!mImportBusy)
+	{
+		updateFolderCountStatus();
+	}
+}
+
+void LLFloaterOutbox::updateFolderCountStatus()
+{
 	if (mOutboxInventoryPanel)
 	{
 		switch (mOutboxItemCount)
@@ -304,10 +312,7 @@ void LLFloaterOutbox::updateFolderCount()
 
 void LLFloaterOutbox::updateView()
 {
-	if (!mImportBusy)
-	{
-		updateFolderCount();
-	}
+	updateFolderCount();
 
 	if (mOutboxItemCount > 0)
 	{
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index cc4a7207ca8..6b4021807cb 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -83,6 +83,7 @@ class LLFloaterOutbox : public LLFloater
 	void setStatusString(const std::string& statusString);
 	
 	void updateFolderCount();
+	void updateFolderCountStatus();
 	void updateView();
 
 private:
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
deleted file mode 100644
index 6c2363eb7fb..00000000000
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/** 
- * @file llpanelmarketplaceoutbox.cpp
- * @brief Panel for marketplace outbox
- *
-* $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llpanelmarketplaceoutbox.h"
-#include "llpanelmarketplaceoutboxinventory.h"
-
-#include "llappviewer.h"
-#include "llbutton.h"
-#include "llcoros.h"
-#include "lleventcoro.h"
-#include "llfloatersidepanelcontainer.h"
-#include "llinventorypanel.h"
-#include "llloadingindicator.h"
-#include "llmarketplacefunctions.h"
-#include "llnotificationsutil.h"
-#include "llpanelmarketplaceinbox.h"
-#include "llsdutil.h"
-#include "llsidepanelinventory.h"
-#include "lltimer.h"
-#include "llviewernetwork.h"
-#include "llagent.h"
-#include "llviewermedia.h"
-#include "llfolderview.h"
-#include "llinventoryfunctions.h"
-
-
-// Turn this on to get a bunch of console output for marketplace API calls, headers and status
-#define DEBUG_MARKETPLACE_HTTP_API	0
-
-
-static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
-
-const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() 
-{ 
-	return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceOutbox>(); 
-}
-
-// protected
-LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox(const Params& p)
-	: LLPanel(p)
-	, mInventoryPanel(NULL)
-	, mImportButton(NULL)
-	, mImportIndicator(NULL)
-	, mOutboxButton(NULL)
-{
-}
-
-LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox()
-{
-}
-
-// virtual
-BOOL LLPanelMarketplaceOutbox::postBuild()
-{
-	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceOutbox::handleLoginComplete, this));
-	
-	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this));
-
-	return TRUE;
-}
-
-// DO WE NEED THIS FILE AT ALL?
-
-void LLPanelMarketplaceOutbox::handleLoginComplete()
-{
-	mImportButton = getChild<LLButton>("outbox_import_btn");
-	mImportButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onImportButtonClicked, this));
-	mImportButton->setEnabled(!isOutboxEmpty());
-	
-	mImportIndicator = getChild<LLLoadingIndicator>("outbox_import_indicator");
-	
-	mOutboxButton = getChild<LLButton>("outbox_btn");
-}
-
-void LLPanelMarketplaceOutbox::onFocusReceived()
-{
-	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
-	if (sidepanel_inventory)
-	{
-		sidepanel_inventory->clearSelections(true, true);
-	}
-}
-
-void LLPanelMarketplaceOutbox::onSelectionChange()
-{
-	LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
-	if (sidepanel_inventory)
-	{
-		sidepanel_inventory->updateVerbs();
-	}
-}
-
-LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
-{
-	LLView * outbox_inventory_placeholder = getChild<LLView>("outbox_inventory_placeholder_panel");
-	LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent();
-	
-	mInventoryPanel = 
-		LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_outbox_inventory.xml",
-														  outbox_inventory_parent,
-														  LLInventoryPanel::child_registry_t::instance());
-	
-	llassert(mInventoryPanel);
-	
-	// Reshape the inventory to the proper size
-	LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect();
-	mInventoryPanel->setShape(inventory_placeholder_rect);
-	
-	// Set the sort order newest to oldest
-	mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
-	mInventoryPanel->getFilter()->markDefault();
-
-	// Set selection callback for proper update of inventory status buttons
-	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this));
-	
-	// Set up the note to display when the outbox is empty
-	mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems");
-	
-	// Hide the placeholder text
-	outbox_inventory_placeholder->setVisible(FALSE);
-	
-	// Set up marketplace importer
-	LLMarketplaceInventoryImporter::getInstance()->initialize();
-	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLPanelMarketplaceOutbox::importStatusChanged, this, _1));
-	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLPanelMarketplaceOutbox::importReportResults, this, _1, _2));
-	
-	updateImportButtonStatus();
-	
-	return mInventoryPanel;
-}
-
-void LLPanelMarketplaceOutbox::importReportResults(U32 status, const LLSD& content)
-{
-	if (status == MarketplaceErrorCodes::IMPORT_DONE)
-	{
-		LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap());
-	}
-	else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
-	{
-		LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap());
-	}
-	else
-	{
-		char status_string[16];
-		sprintf(status_string, "%d", status);
-		
-		LLSD subs;
-		subs["ERROR_CODE"] = status_string;
-		
-		//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
-		LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap());
-	}
-}
-
-void LLPanelMarketplaceOutbox::importStatusChanged(bool inProgress)
-{
-	updateImportButtonStatus();
-}
-
-BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
-								   EDragAndDropType cargo_type,
-								   void* cargo_data,
-								   EAcceptance* accept,
-								   std::string& tooltip_msg)
-{
-	BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
-
-	if (!handled && mInventoryPanel && mInventoryPanel->getRootFolder())
-	{
-		handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
-
-		if (handled)
-		{
-			mInventoryPanel->getRootFolder()->setDragAndDropThisFrame();
-		}
-	}
-
-	return handled;
-}
-
-bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
-{
-	return (getTotalItemCount() == 0);
-}
-
-void LLPanelMarketplaceOutbox::updateImportButtonStatus()
-{
-	if (LLMarketplaceInventoryImporter::instance().isImportInProgress())
-	{
-		mImportButton->setVisible(false);
-
-		mImportIndicator->setVisible(true);
-		mImportIndicator->reset();
-		mImportIndicator->start();
-	}
-	else
-	{
-		mImportIndicator->stop();
-		mImportIndicator->setVisible(false);
-
-		mImportButton->setVisible(true);
-		mImportButton->setEnabled(!isOutboxEmpty());
-	}
-}
-
-U32 LLPanelMarketplaceOutbox::getTotalItemCount() const
-{
-	U32 item_count = 0;
-
-	if (mInventoryPanel)
-	{
-		const LLFolderViewFolder * outbox_folder = mInventoryPanel->getRootFolder();
-
-		if (outbox_folder)
-		{
-			item_count += outbox_folder->getFoldersCount();
-			item_count += outbox_folder->getItemsCount();
-		}
-	}
-
-	return item_count;
-}
-
-void LLPanelMarketplaceOutbox::onImportButtonClicked()
-{
-	LLMarketplaceInventoryImporter::instance().triggerImport();
-	
-	// Get the import animation going
-	updateImportButtonStatus();
-}
-
-void LLPanelMarketplaceOutbox::draw()
-{
-	const U32 item_count = getTotalItemCount();
-	const bool not_empty = (item_count > 0);
-
-	if (not_empty)
-	{
-		std::string item_count_str = llformat("%d", item_count);
-
-		LLStringUtil::format_map_t args;
-		args["[NUM]"] = item_count_str;
-		mOutboxButton->setLabel(getString("OutboxLabelWithArg", args));
-	}
-	else
-	{
-		mOutboxButton->setLabel(getString("OutboxLabelNoArg"));
-	}
-	
-	LLPanel::draw();
-}
diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h
deleted file mode 100644
index 6f038118b3b..00000000000
--- a/indra/newview/llpanelmarketplaceoutbox.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/** 
- * @file llpanelmarketplaceoutbox.h
- * @brief Panel for marketplace outbox
- *
-* $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLPANELMARKETPLACEOUTBOX_H
-#define LL_LLPANELMARKETPLACEOUTBOX_H
-
-#include "llpanel.h"
-
-
-class LLButton;
-class LLInventoryPanel;
-class LLLoadingIndicator;
-
-
-class LLPanelMarketplaceOutbox : public LLPanel
-{
-public:
-	
-	struct Params :	public LLInitParam::Block<Params, LLPanel::Params>
-	{};
-	
-	LOG_CLASS(LLPanelMarketplaceOutbox);
-
-	// RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8
-	static const LLPanelMarketplaceOutbox::Params& getDefaultParams();
-	
-	LLPanelMarketplaceOutbox(const Params& p = getDefaultParams());
-	~LLPanelMarketplaceOutbox();
-
-	/*virtual*/ BOOL postBuild();
-
-	/*virtual*/ void draw();
-
-	LLInventoryPanel * setupInventoryPanel();
-
-	U32 getTotalItemCount() const;
-
-	bool isOutboxEmpty() const;
-
-	/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
-								   EDragAndDropType cargo_type,
-								   void* cargo_data,
-								   EAcceptance* accept,
-								   std::string& tooltip_msg);
-
-protected:
-	void onImportButtonClicked();
-	void updateImportButtonStatus();
-
-	void handleLoginComplete();
-	void onFocusReceived();
-	void onSelectionChange();
-	
-	void importReportResults(U32 status, const LLSD& content);
-	void importStatusChanged(bool inProgress);
-	
-private:
-	LLInventoryPanel *		mInventoryPanel;
-
-	LLButton *				mImportButton;
-	LLLoadingIndicator *	mImportIndicator;
-	
-	LLButton *				mOutboxButton;
-};
-
-
-#endif //LL_LLPANELMARKETPLACEOUTBOX_H
-
-- 
GitLab


From 141089327649f9b89be4ac9cc2b50f56eee62a48 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 5 Jan 2012 21:26:06 -0700
Subject: [PATCH 514/933] fix for SH-2829: [crashhunters] Crash in
 LLWearable::importFile()/LLOverrideBakedTextureUpdate::LLOverrideBakedTextureUpdate()

---
 indra/newview/llagentwearablesfetch.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index 1edc96e1652..4097ff707c6 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -111,6 +111,12 @@ void LLInitialWearablesFetch::add(InitialWearableData &data)
 
 void LLInitialWearablesFetch::processContents()
 {
+	if(!gAgentAvatarp) //no need to process wearables if the agent avatar is deleted.
+	{
+		delete this;
+		return ;
+	}
+
 	// Fetch the wearable items from the Current Outfit Folder
 	LLInventoryModel::cat_array_t cat_array;
 	LLInventoryModel::item_array_t wearable_array;
-- 
GitLab


From 837e38d8195b2928648c9c383bea1b3f1cf68fa5 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 5 Jan 2012 21:26:35 -0700
Subject: [PATCH 515/933] trivial: debug code for SH-2827: [crashhunters] Crash
 in LLPipeline::generateWaterReflection()

---
 indra/llrender/llrender.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index cd827f5091e..03a9884c2bc 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1434,6 +1434,8 @@ void LLRender::loadIdentity()
 	flush();
 
 	{
+		llassert_always(mMatrixMode < NUM_MATRIX_MODES) ;
+
 		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
 		mMatHash[mMatrixMode]++;
 	}
-- 
GitLab


From bd3a652eabf09a5843a6a0b8a9f60c4b402ecce5 Mon Sep 17 00:00:00 2001
From: Aura Linden <aura@lindenlab.com>
Date: Fri, 6 Jan 2012 07:46:53 -0500
Subject: [PATCH 516/933] Add capability-based create folder routine for more
 reliable inventory, with fix for copy and wear

---
 indra/newview/llfloateropenobject.cpp | 60 +++++++++++++++---
 indra/newview/llfloateropenobject.h   | 11 ++++
 indra/newview/llinventorybridge.cpp   | 13 ++--
 indra/newview/llinventorymodel.cpp    | 87 ++++++++++++++++++++++++++-
 indra/newview/llinventorymodel.h      |  4 +-
 indra/newview/llviewerregion.cpp      |  1 +
 6 files changed, 155 insertions(+), 21 deletions(-)

diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index 8b6619def2f..4bfef8b45fa 100644
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -162,26 +162,66 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
 	{
 		parent_category_id = gInventory.getRootFolderID();
 	}
+	
+	LLCategoryCreate* cat_data = new LLCategoryCreate(object_id, wear);
+	
 	LLUUID category_id = gInventory.createNewCategory(parent_category_id, 
-		LLFolderType::FT_NONE, 
-		name);
+													  LLFolderType::FT_NONE, 
+													  name,
+													  callbackCreateInventoryCategory,
+													  (void*)cat_data);
+
+	//If we get a null category ID, we are using a capability in createNewCategory and we will
+	//handle the following in the callbackCreateInventoryCategory routine.
+	if ( category_id.notNull() )
+	{
+		delete cat_data;
+		
+		LLCatAndWear* data = new LLCatAndWear;
+		data->mCatID = category_id;
+		data->mWear = wear;
+		data->mFolderResponded = false;
+
+		// Copy and/or move the items into the newly created folder.
+		// Ignore any "you're going to break this item" messages.
+		BOOL success = move_inv_category_world_to_agent(object_id, category_id, TRUE,
+														callbackMoveInventory, 
+														(void*)data);
+		if (!success)
+		{
+			delete data;
+			data = NULL;
 
-	LLCatAndWear* data = new LLCatAndWear;
-	data->mCatID = category_id;
-	data->mWear = wear;
+			LLNotificationsUtil::add("OpenObjectCannotCopy");
+		}
+	}
+}
 
+// static
+void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, void* data)
+{
+	LLCategoryCreate* cat_data = (LLCategoryCreate*)data;
+	
+	LLUUID category_id = result["folder_id"].asUUID();
+	LLCatAndWear* wear_data = new LLCatAndWear;
+
+	wear_data->mCatID = category_id;
+	wear_data->mWear = cat_data->mWear;
+	wear_data->mFolderResponded = true;
+	
 	// Copy and/or move the items into the newly created folder.
 	// Ignore any "you're going to break this item" messages.
-	BOOL success = move_inv_category_world_to_agent(object_id, category_id, TRUE,
+	BOOL success = move_inv_category_world_to_agent(cat_data->mObjectID, category_id, TRUE,
 													callbackMoveInventory, 
-													(void*)data);
+													(void*)wear_data);
 	if (!success)
 	{
-		delete data;
-		data = NULL;
-
+		delete wear_data;
+		wear_data = NULL;
+		
 		LLNotificationsUtil::add("OpenObjectCannotCopy");
 	}
+	delete cat_data;	
 }
 
 // static
diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h
index 0706e99f164..bf7fe69c656 100644
--- a/indra/newview/llfloateropenobject.h
+++ b/indra/newview/llfloateropenobject.h
@@ -45,10 +45,20 @@ class LLFloaterOpenObject
 	
 	void dirty();
 	
+	class LLCategoryCreate
+	{
+		public:
+			LLCategoryCreate(LLUUID object_id, bool wear) : mObjectID(object_id), mWear(wear) {}
+		public:
+			LLUUID mObjectID;
+			bool mWear;
+	};
+	
 	struct LLCatAndWear
 	{
 		LLUUID mCatID;
 		bool mWear;
+		bool mFolderResponded;
 	};
 
 protected:
@@ -62,6 +72,7 @@ class LLFloaterOpenObject
 
 	void onClickMoveToInventory();
 	void onClickMoveAndWear();
+	static void callbackCreateInventoryCategory(const LLSD& result, void* data);
 	static void callbackMoveInventory(S32 result, void* data);
 
 private:
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 0c092e9a561..eaf9b53eb91 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2305,15 +2305,15 @@ void LLRightClickInventoryFetchDescendentsObserver::done()
 class LLInventoryCopyAndWearObserver : public LLInventoryObserver
 {
 public:
-	LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count) :
-		mCatID(cat_id), mContentsCount(count), mFolderAdded(FALSE) {}
+	LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count, bool folder_added=false) :
+		mCatID(cat_id), mContentsCount(count), mFolderAdded(folder_added) {}
 	virtual ~LLInventoryCopyAndWearObserver() {}
 	virtual void changed(U32 mask);
 
 protected:
 	LLUUID mCatID;
 	int    mContentsCount;
-	BOOL   mFolderAdded;
+	bool   mFolderAdded;
 };
 
 
@@ -2341,7 +2341,6 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask)
 		if (mFolderAdded)
 		{
 			LLViewerInventoryCategory* category = gInventory.getCategory(mCatID);
-
 			if (NULL == category)
 			{
 				llwarns << "gInventory.getCategory(" << mCatID
@@ -3188,13 +3187,13 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response
 
 	if(option == 0 && object)
 	{
-		if (cat_and_wear && cat_and_wear->mWear)
+		if (cat_and_wear && cat_and_wear->mWear) // && !cat_and_wear->mFolderResponded)
 		{
 			LLInventoryObject::object_list_t inventory_objects;
 			object->getInventoryContents(inventory_objects);
 			int contents_count = inventory_objects.size()-1; //subtract one for containing folder
-
-			LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count);
+			LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count, cat_and_wear->mFolderResponded);
+			
 			gInventory.addObserver(inventoryObserver);
 		}
 
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index dc25689fa3f..568ec4c5e20 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -377,14 +377,67 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
 	return rv;
 }
 
+class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder
+{
+public:
+	LLCreateInventoryCategoryResponder(LLInventoryModel* model, 
+									   void (*callback)(const LLSD&, void*),
+									   void* user_data) :
+										mModel(model),
+										mCallback(callback), 
+										mData(user_data) 
+	{
+	}
+	
+	virtual void error(U32 status, const std::string& reason)
+	{
+		LL_WARNS("InvAPI") << "CreateInventoryCategory failed.   status = " << status << ", reasion = \"" << reason << "\"" << LL_ENDL;
+	}
+	
+	virtual void result(const LLSD& content)
+	{
+		//Server has created folder.
+		
+		LLUUID category_id = content["folder_id"].asUUID();
+		
+		
+		// Add the category to the internal representation
+		LLPointer<LLViewerInventoryCategory> cat =
+		new LLViewerInventoryCategory( category_id, 
+									  content["parent_id"].asUUID(),
+									  (LLFolderType::EType)content["type"].asInteger(),
+									  content["name"].asString(), 
+									  gAgent.getID() );
+		cat->setVersion(LLViewerInventoryCategory::VERSION_INITIAL);
+		cat->setDescendentCount(0);
+		LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1);
+		mModel->accountForUpdate(update);
+		mModel->updateCategory(cat);
+		
+		if (mCallback && mData)
+		{
+			mCallback(content, mData);
+		}
+		
+	}
+	
+private:
+	void (*mCallback)(const LLSD&, void*);
+	void* mData;
+	LLInventoryModel* mModel;
+};
+
 // Convenience function to create a new category. You could call
 // updateCategory() with a newly generated UUID category, but this
 // version will take care of details like what the name should be
 // based on preferred type. Returns the UUID of the new category.
 LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
 										   LLFolderType::EType preferred_type,
-										   const std::string& pname)
+										   const std::string& pname,
+										   void (*callback)(const LLSD&, void*),	//Default to NULL
+										   void* user_data)							//Default to NULL
 {
+	
 	LLUUID id;
 	if(!isInventoryUsable())
 	{
@@ -408,6 +461,35 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
 	{
 		name.assign(LLViewerFolderType::lookupNewCategoryName(preferred_type));
 	}
+	
+	if ( callback && user_data )  //callback required for acked message.
+	{
+		LLViewerRegion* viewer_region = gAgent.getRegion();
+		std::string url;
+		if ( viewer_region )
+			url = viewer_region->getCapability("CreateInventoryCategory");
+		
+		if (!url.empty())
+		{
+			//Let's use the new capability.
+			
+			LLSD request, body;
+			body["folder_id"] = id;
+			body["parent_id"] = parent_id;
+			body["type"] = (LLSD::Integer) preferred_type;
+			body["name"] = name;
+			
+			request["message"] = "CreateInventoryCategory";
+			request["payload"] = body;
+			
+	//		viewer_region->getCapAPI().post(request);
+			LLHTTPClient::post(
+							   url,
+							   body,
+							   new LLCreateInventoryCategoryResponder(this, callback, user_data) );
+			return LLUUID::null;
+		}
+	}
 
 	// Add the category to the internal representation
 	LLPointer<LLViewerInventoryCategory> cat =
@@ -1087,7 +1169,6 @@ void LLInventoryModel::notifyObservers()
 		 iter != mObservers.end(); )
 	{
 		LLInventoryObserver* observer = *iter;
-		
 		observer->changed(mModifyMask);
 
 		// safe way to increment since changed may delete entries! (@!##%@!@&*!)
@@ -2574,7 +2655,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
 				<< titem->getParentUUID() << llendl;
 		U32 callback_id;
 		msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id);
-		if(titem->getUUID().notNull())
+		if(titem->getUUID().notNull() ) // && callback_id.notNull() )
 		{
 			items.push_back(titem);
 			cblist.push_back(InventoryCallbackInfo(callback_id, titem->getUUID()));
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 340c1b0c22d..0a564d353a0 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -360,7 +360,9 @@ class LLInventoryModel
 	// name based on type, pass in a NULL to the 'name' parameter.
 	LLUUID createNewCategory(const LLUUID& parent_id,
 							 LLFolderType::EType preferred_type,
-							 const std::string& name);
+							 const std::string& name,
+							 void (*callback)(const LLSD&, void*) = NULL,
+							 void* user_data = NULL );
 protected:
 	// Internal methods that add inventory and make sure that all of
 	// the internal data structures are consistent. These methods
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index ed943964f9a..e3cb985ddb3 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1493,6 +1493,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("AvatarPickerSearch");
 	capabilityNames.append("ChatSessionRequest");
 	capabilityNames.append("CopyInventoryFromNotecard");
+	capabilityNames.append("CreateInventoryCategory");
 	capabilityNames.append("DispatchRegionInfo");
 	capabilityNames.append("EstateChangeInfo");
 	capabilityNames.append("EventQueueGet");
-- 
GitLab


From 377e35af14ec8e6aa689a9aa9817705b4d699e83 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 6 Jan 2012 09:19:10 -0800
Subject: [PATCH 517/933] looking for better fix to EXP-1695 [I18N] [INCORRECT
 CURRENCY LAYOUT/FORMAT] - Currency in  Group Profile > Land/Asset and New
 Group (French viewer) Backed out changeset: c01a6186b15c

---
 indra/newview/llpanelgrouplandmoney.cpp             |  3 ++-
 .../skins/default/xui/en/panel_group_general.xml    | 13 ++-----------
 indra/newview/skins/default/xui/en/strings.xml      |  2 +-
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index b6c0c2ee24c..e66dd5690c2 100644
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -1447,7 +1447,8 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
 
 		text.append(time_str);
 		text.append(".\n\n");
-		text.append(llformat("%-24s %6d L$\n\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance ));
+		text.append(llformat("%-23sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance ));
+		text.append(1, '\n');
 	}
 
 	// [DEV-29503] Hide the individual info since
diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml
index adde982c60c..38b680ba865 100644
--- a/indra/newview/skins/default/xui/en/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_general.xml
@@ -225,22 +225,13 @@ Hover your mouse over the options for more help.
          height="23"
          increment="1"
          label_width="15"
+         label="L$"
          layout="topleft"
          max_val="99999"
          left="30"
          name="spin_enrollment_fee"
          tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked."
-         width="150" />
-        <text
-         follows="left|top"
-         type="string"
-         height="16"
-         left_pad="2"
-         name="currency_label"
-         top_delta="5"
-         width="18">
-         L$
-        </text>
+         width="170" />
         <combo_box
          follows="left|top"
          height="23"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 2ae56bc7292..492e51e0fd9 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2272,7 +2272,7 @@ Returns a string with the requested data about the region
 	<string name="NextStipendDay"       value="The next stipend day is " />
 	<string name="GroupPlanningDate">[mthnum,datetime,utc]/[day,datetime,utc]/[year,datetime,utc]</string>
 	<string name="GroupIndividualShare" value="                      Group       Individual Share" />
-	<string name="GroupColumn"          value="Group" />
+	<string name="GroupColumn"          value="                      Group" />
 	<string name="Balance">Balance</string>
 	<string name="Credits">Credits</string>
 	<string name="Debits">Debits</string>
-- 
GitLab


From 757a955bd700eb4f838762dcbe789a77ee052064 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 6 Jan 2012 12:07:52 -0800
Subject: [PATCH 518/933] Looking for better fix to EXP-1693 - date
 localization

Backed out changeset: 4f3024e9d629
---
 indra/llcommon/llstring.cpp                   |  5 ----
 indra/llui/llscrolllistcell.cpp               | 10 +-------
 indra/newview/llappviewer.cpp                 | 23 ++++++++++++-------
 .../newview/skins/default/xui/en/strings.xml  |  3 ---
 .../default/xui/fr/sidepanel_item_info.xml    |  2 +-
 5 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 1193a4ef8db..e7fe6568085 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -1122,11 +1122,6 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
 		struct tm * gmt = gmtime (&loc_seconds);
 		replacement = LLStringOps::sMonthList[gmt->tm_mon];
 	}
-	else if(LLStringOps::sMonthShortList.size() == 12 && code == "%b")
-	{
-		struct tm * gmt = gmtime (&loc_seconds);
-		replacement = LLStringOps::sMonthShortList[gmt->tm_mon];
-	}
 	else if( !LLStringOps::sDayFormat.empty() && code == "%d" )
 	{
 		struct tm * gmt = gmtime (&loc_seconds);
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 786e18b1878..9d25c7180dd 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -29,8 +29,6 @@
 
 #include "llscrolllistcell.h"
 
-#include "lltrans.h"
-
 #include "llcheckboxctrl.h"
 #include "llui.h"	// LLUIImage
 #include "lluictrlfactory.h"
@@ -430,13 +428,7 @@ LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p)
 void LLScrollListDate::setValue(const LLSD& value)
 {
 	mDate = value.asDate();
-
-	std::string date_str = LLTrans::getString("ScrollListCellDateFormat");
-	LLSD substitution;
-	substitution["datetime"] = mDate.secondsSinceEpoch();
-	LLStringUtil::format(date_str, substitution);
-
-	LLScrollListText::setValue(date_str);
+	LLScrollListText::setValue(mDate.asRFC1123());
 }
 
 const LLSD LLScrollListDate::getValue() const
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 33d4563feb5..0861fe85a84 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1044,14 +1044,21 @@ bool LLAppViewer::init()
 
 	LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
 
-	LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
-	LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
-	LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
-	LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
-	LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
-
-	LLStringOps::sAM = LLTrans::getString("dateTimeAM");
-	LLStringOps::sPM = LLTrans::getString("dateTimePM");
+	//EXT-7013 - On windows for some locale (Japanese) standard 
+	//datetime formatting functions didn't support some parameters such as "weekday".
+	//Names for days and months localized in xml are also useful for Polish locale(STORM-107).
+	std::string language = gSavedSettings.getString("Language");
+	if(language == "ja" || language == "pl")
+	{
+		LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
+		LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
+		LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
+		LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
+		LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
+
+		LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+		LLStringOps::sPM = LLTrans::getString("dateTimePM");
+	}
 
 	LLAgentLanguage::init();
 
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 492e51e0fd9..9752a07b666 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3503,9 +3503,6 @@ Abuse Report</string>
   <string name="dateTimeDayFormat">[MDAY]</string>
   <string name="dateTimeAM">AM</string>
   <string name="dateTimePM">PM</string>
-  
-  <!-- Format string for displaying a localized date in a scroll list cell of type "date" -->
-  <string name="ScrollListCellDateFormat">[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]</string>
 
   <!--  currency formatting -->
   <string name="LocalEstimateUSD">US$ [AMOUNT]</string>
diff --git a/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml b/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml
index 0b5333fc80e..95649d39348 100644
--- a/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml
+++ b/indra/newview/skins/default/xui/fr/sidepanel_item_info.xml
@@ -13,7 +13,7 @@
 		Le propriétaire peut :
 	</panel.string>
 	<panel.string name="acquiredDate">
-		[wkday,datetime,local] [day,datetime,local] [mth,datetime,local] [year,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local]
+		[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
 	</panel.string>
 	<panel.string name="origin_inventory">
 		(inventaire)
-- 
GitLab


From 60df5e51dc977e28507b3446d649eac67556c050 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 6 Jan 2012 13:01:17 -0800
Subject: [PATCH 519/933] EXP-1220 GROUNDWORK -- Create context menu entry to
 allow import of selected item(s)

* Added a context menu for "Send to Marketplace" but disabled the code to show it
  until we decide to move forward with this feature.
* Made some progress unifying the context menu in the outbox for different types
  of items.  (mesh, audio, etc.)
---
 indra/newview/llinventorybridge.cpp           | 77 ++++++++++++++++---
 indra/newview/llinventorybridge.h             |  4 +
 .../skins/default/xui/en/menu_inventory.xml   |  8 ++
 3 files changed, 77 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3b6dad7f5cb..70553ca6765 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -74,6 +74,7 @@
 
 // Marketplace outbox current disabled
 #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1
+#define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0
 #define BLOCK_WORN_ITEMS_IN_OUTBOX 1
 
 typedef std::pair<LLUUID, LLUUID> two_uuids_t;
@@ -130,6 +131,11 @@ bool isMarketplaceCopyAction(const std::string& action)
 	return (("copy_to_outbox" == action) || ("move_to_outbox" == action));
 }
 
+bool isMarketplaceSendAction(const std::string& action)
+{
+	return ("send_to_marketplace" == action);
+}
+
 // +=================================================+
 // |        LLInvFVBridge                            |
 // +=================================================+
@@ -657,7 +663,7 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	}	
 	else if(isOutboxFolder())
 	{
-		items.push_back(std::string("Delete"));
+		addOutboxContextMenuOptions(flags, items, disabled_items);
 	}
 	else
 	{
@@ -734,6 +740,32 @@ void LLInvFVBridge::addOpenRightClickMenuOption(menuentry_vec_t &items)
 		items.push_back(std::string("Open"));
 }
 
+void LLInvFVBridge::addOutboxContextMenuOptions(U32 flags,
+												menuentry_vec_t &items,
+												menuentry_vec_t &disabled_items)
+{
+	items.push_back(std::string("Rename"));
+	items.push_back(std::string("Delete"));
+	
+	if ((flags & FIRST_SELECTED_ITEM) == 0)
+	{
+		disabled_items.push_back(std::string("Rename"));
+	}
+	
+#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
+	if (isOutboxFolderDirectParent())
+	{
+		items.push_back(std::string("Marketplace Separator"));
+		items.push_back(std::string("Marketplace Send"));
+		
+		if ((flags & FIRST_SELECTED_ITEM) == 0)
+		{
+			disabled_items.push_back(std::string("Marketplace Send"));
+		}
+	}
+#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
+}
+
 // *TODO: remove this
 BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
 {
@@ -854,6 +886,22 @@ BOOL LLInvFVBridge::isOutboxFolder() const
 	return gInventory.isObjectDescendentOf(mUUID, outbox_id);
 }
 
+BOOL LLInvFVBridge::isOutboxFolderDirectParent() const
+{
+	BOOL outbox_is_parent = FALSE;
+	
+	const LLInventoryCategory *cat = gInventory.getCategory(mUUID);
+
+	if (cat)
+	{
+		const LLUUID outbox_id = getOutboxFolder();
+		
+		outbox_is_parent = (outbox_id.notNull() && (outbox_id == cat->getParentUUID()));
+	}
+	
+	return outbox_is_parent;
+}
+
 const LLUUID LLInvFVBridge::getOutboxFolder() const
 {
 	const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
@@ -2585,6 +2633,17 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
 		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
 		copy_folder_to_outbox(cat, outbox_id, cat->getUUID());
 	}
+#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
+	else if (isMarketplaceSendAction(action))
+	{
+		llinfos << "Send to marketplace action!" << llendl;
+
+		LLInventoryCategory * cat = gInventory.getCategory(mUUID);
+		if (!cat) return;
+		
+		send_to_marketplace(cat);
+	}
+#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
 }
 
 void LLFolderBridge::openItem()
@@ -3007,13 +3066,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	}
 	else if(isOutboxFolder())
 	{
-		mItems.push_back(std::string("Rename"));
-		mItems.push_back(std::string("Delete"));
-		
-		if ((flags & FIRST_SELECTED_ITEM) == 0)
-		{
-			mDisabledItems.push_back(std::string("Rename"));
-		}
+		addOutboxContextMenuOptions(flags, mItems, mDisabledItems);
 	}
 	else if(isAgentInventory()) // do not allow creating in library
 	{
@@ -3840,7 +3893,7 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	}	
 	else if(isOutboxFolder())
 	{
-		items.push_back(std::string("Delete"));
+		addOutboxContextMenuOptions(flags, items, disabled_items);
 	}
 	else
 	{
@@ -3916,7 +3969,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 
 	if (isOutboxFolder())
 	{
-		items.push_back(std::string("Delete"));
+		addOutboxContextMenuOptions(flags, items, disabled_items);
 	}
 	else
 	{
@@ -3974,7 +4027,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl;
 	if(isOutboxFolder())
 	{
-		items.push_back(std::string("Delete"));
+		addOutboxContextMenuOptions(flags, items, disabled_items);
 	}
 	else
 	{
@@ -5540,7 +5593,7 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 	}
 	else if(isOutboxFolder())
 	{
-		items.push_back(std::string("Delete"));
+		addOutboxContextMenuOptions(flags, items, disabled_items);
 	}
 	else
 	{
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 447d781f482..2ab339b9184 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -131,6 +131,9 @@ class LLInvFVBridge : public LLFolderViewEventListener
 	virtual void addDeleteContextMenuOptions(menuentry_vec_t &items,
 											 menuentry_vec_t &disabled_items);
 	virtual void addOpenRightClickMenuOption(menuentry_vec_t &items);
+	virtual void addOutboxContextMenuOptions(U32 flags,
+											 menuentry_vec_t &items,
+											 menuentry_vec_t &disabled_items);
 protected:
 	LLInvFVBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid);
 
@@ -144,6 +147,7 @@ class LLInvFVBridge : public LLFolderViewEventListener
 	BOOL isCOFFolder() const; // true if COF or descendent of
 	BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox
 	BOOL isOutboxFolder() const; // true if COF or descendent of marketplace outbox
+	BOOL isOutboxFolderDirectParent() const;
 	const LLUUID getOutboxFolder() const;
 
 	virtual BOOL isItemPermissive() const;
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index fb85e5278a0..31dcdfffbb3 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -694,6 +694,14 @@
 		 parameter="move_to_outbox" />
 	</menu_item_call>
 	<menu_item_call
+	 label="Send to Marketplace"
+	 layout="topleft"
+	 name="Marketplace Send">
+		<menu_item_call.on_click
+		 function="Inventory.DoToSelected"
+		 parameter="send_to_marketplace" />
+	</menu_item_call>
+	<menu_item_call
      label="--no options--"
      layout="topleft"
      name="--no options--" />
-- 
GitLab


From f64ad025e873fff1523d5e05ca1ec19c40bba837 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 6 Jan 2012 15:29:55 -0800
Subject: [PATCH 520/933] sync with viewer-development

---
 .../skins/default/xui/en/menu_login.xml       | 53 +++++++++++++++++-
 .../skins/default/xui/en/menu_viewer.xml      | 51 +++++++++++++++++
 .../xui/en/panel_preferences_general.xml      |  2 +-
 .../skins/default/xui/en/panel_script_ed.xml  | 22 ++++++--
 .../newview/skins/default/xui/en/strings.xml  | 55 ++++++++++---------
 5 files changed, 148 insertions(+), 35 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index 8ac1ac9e093..101e104eabf 100644
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -174,7 +174,58 @@
          function="Advanced.WebContentTest"
          parameter="http://google.com"/>
       </menu_item_call>
-      <menu_item_check
+      <menu
+       create_jump_keys="true"
+       label="Set Logging Level"
+       name="Set Logging Level"
+       tear_off="true">
+        <menu_item_check
+          label="Debug">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="0" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="0" />
+        </menu_item_check>
+        <menu_item_check
+          label="Info">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="1" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="1" />
+        </menu_item_check>
+        <menu_item_check
+          label="Warning">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="2" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="2" />
+        </menu_item_check>
+        <menu_item_check
+          label="Error">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="3" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="3" />
+        </menu_item_check>
+        <menu_item_check
+          label="None">
+          <menu_item_check.on_check
+            function="Develop.CheckLoggingLevel"
+            parameter="4" />
+          <menu_item_check.on_click
+           function="Develop.SetLoggingLevel"
+           parameter="4" />
+        </menu_item_check>
+      </menu>
+     <menu_item_check
         label="Show Grid Picker"
         name="Show Grid Picker"
         visible="false" 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 0aa5c72f2a5..0df123e1407 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3367,6 +3367,57 @@
              function="ToggleControl"
              parameter="ShowConsoleWindow" />
         </menu_item_check>
+        <menu
+         create_jump_keys="true"
+         label="Set Logging Level"
+         name="Set Logging Level"
+         tear_off="true">
+          <menu_item_check
+            label="Debug">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="0" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="0" />
+          </menu_item_check>
+          <menu_item_check
+            label="Info">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="1" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="1" />
+          </menu_item_check>
+          <menu_item_check
+            label="Warning">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="2" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="2" />
+          </menu_item_check>
+          <menu_item_check
+            label="Error">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="3" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="3" />
+          </menu_item_check>
+          <menu_item_check
+            label="None">
+            <menu_item_check.on_check
+              function="Develop.CheckLoggingLevel"
+              parameter="4" />
+            <menu_item_check.on_click
+             function="Develop.SetLoggingLevel"
+             parameter="4" />
+          </menu_item_check>
+       </menu>
 
         <menu_item_separator/>
 
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
index 4079a809249..9827180aa72 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
@@ -420,7 +420,7 @@
      follows="left|top"
      height="29"
      layout="topleft"
-     left="50"
+     left="30"
      name="busy_response"
      width="470"
      word_wrap="true">
diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml
index 8d420243864..f6a8af09735 100644
--- a/indra/newview/skins/default/xui/en/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml
@@ -54,12 +54,22 @@
              label="Save"
              layout="topleft"
              name="Save" />
-            <menu_item_separator
-             layout="topleft" />
-            <menu_item_call
-             label="Revert All Changes"
-             layout="topleft"
-             name="Revert All Changes" />
+          <menu_item_separator
+           layout="topleft" />
+          <menu_item_call
+           label="Revert All Changes"
+           layout="topleft"
+           name="Revert All Changes" />
+          <menu_item_separator
+           layout="topleft" />
+          <menu_item_call
+           label="Load from file..."
+           layout="topleft"
+           name="LoadFromFile" />
+          <menu_item_call
+           label="Save to file..."
+           layout="topleft"
+           name="SaveToFile" />
         </menu>
         <menu
          top="0"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 9752a07b666..2b0dcdfecaf 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -88,7 +88,7 @@ We are very sorry for the inconvenience.</string>
 Logins are currently restricted to employees only.
 Check www.secondlife.com/status for updates.</string>
 	<string name="LoginFailedPremiumOnly">Second Life logins are temporarily restricted in order to make sure that those in-world have the best possible experience.
-	 	
+
 People with free accounts will not be able to access Second Life during this time, to make room for those who have paid for Second Life.</string>
 	<string name="LoginFailedComputerProhibited">Second Life cannot be accessed from this computer.
 If you feel this is an error, please contact
@@ -168,7 +168,7 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
 	<string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
 	<string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
-	
+
 	<!-- tooltips for Urls -->
 	<string name="TooltipHttpUrl">Click to view this web page</string>
 	<string name="TooltipSLURL">Click to view this location's information</string>
@@ -188,7 +188,7 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipObjectIMUrl">Click to view this object's description</string>
 	<string name="TooltipMapUrl">Click to view this location on a map</string>
 	<string name="TooltipSLAPP">Click to run the secondlife:// command</string>
-	<string name="CurrentURL" value=" CurrentURL: [CurrentURL]" />	
+	<string name="CurrentURL" value=" CurrentURL: [CurrentURL]" />
 
 	<!-- text for SLURL labels -->
 	<string name="SLurlLabelTeleport">Teleport to</string>
@@ -427,9 +427,10 @@ Please try logging in again in a minute.</string>
 	<string name="compressed_image_files">Compressed Images</string>
 	<string name="load_files">Load Files</string>
 	<string name="choose_the_directory">Choose Directory</string>
+	<string name="script_files">Scripts</string>
 
-	<!-- LSL Usage Hover Tips -->
-	<!-- NOTE: For now these are set as translate="false", until DEV-40761 is implemented (to internationalize the rest of tooltips in the same window).
+  <!-- LSL Usage Hover Tips -->
+  <!-- NOTE: For now these are set as translate="false", until DEV-40761 is implemented (to internationalize the rest of tooltips in the same window).
              This has no effect on viewer code, but prevents Linden Lab internal localization tool from scraping these strings.  -->
 	<string name="LSLTipSleepTime" translate="false">
 Sleeps script for [SLEEP_TIME] seconds.
@@ -1950,7 +1951,7 @@ Returns a string with the requested data about the region
   <string name="physics">Physics</string>
   <string name="invalid">invalid</string>
   <string name="none">none</string>
-  
+
   <!-- Not Worn Wearable Types -->
 	<string name="shirt_not_worn">Shirt not worn</string>
 	<string name="pants_not_worn">Pants not worn</string>
@@ -1987,7 +1988,7 @@ Returns a string with the requested data about the region
 
   <!-- Wearable List-->
   <string name="NewWearable">New [WEARABLE_ITEM]</string>
-  
+
 	<!-- LLGroupNotify -->
 	<!-- used in the construction of a Group Notice blue dialog box, buttons, tooltip etc. Seems to be no longer utilized by code in Viewer 2.0 -->
 	<string name="next">Next</string>
@@ -2314,7 +2315,7 @@ Returns a string with the requested data about the region
 	<string name="ScriptLimitsRequestWrongRegion">Error: script information is only available in your current region</string>
 	<string name="ScriptLimitsRequestWaiting">Retrieving information...</string>
 	<string name="ScriptLimitsRequestDontOwnParcel">You do not have permission to examine this parcel</string>
-	
+
 	<string name="SITTING_ON">Sitting On</string>
 	<string name="ATTACH_CHEST">Chest</string>
 	<string name="ATTACH_HEAD">Head</string>
@@ -2354,7 +2355,7 @@ Returns a string with the requested data about the region
 	<string name="ATTACH_HUD_BOTTOM_LEFT">HUD Bottom Left</string>
 	<string name="ATTACH_HUD_BOTTOM">HUD Bottom</string>
 	<string name="ATTACH_HUD_BOTTOM_RIGHT">HUD Bottom Right</string>
-			
+
 	<!-- script editor -->
 	<string name="CursorPos">Line [LINE], Column [COLUMN]</string>
 
@@ -2367,7 +2368,7 @@ Returns a string with the requested data about the region
 
 	<!-- panel contents -->
 	<string name="PanelContentsTooltip">Content of object</string>
-	<string name="PanelContentsNewScript">New Script</string>	
+	<string name="PanelContentsNewScript">New Script</string>
 
   <!-- panel preferences general -->
   <string name="BusyModeResponseDefault">The Resident you messaged is in &apos;busy mode&apos; which means they have requested not to be disturbed.  Your message will still be shown in their IM panel for later viewing.</string>
@@ -2397,7 +2398,7 @@ Returns a string with the requested data about the region
 	<!-- panel classified -->
 	<string name="ClassifiedClicksTxt">Clicks: [TELEPORT] teleport, [MAP] map, [PROFILE] profile</string>
 	<string name="ClassifiedUpdateAfterPublish">(will update after publish)</string>
-  
+
   <!-- panel picks -->
   <string name="NoPicksClassifiedsText">You haven't created any Picks or Classifieds. Click the Plus button below to create a Pick or Classified.</string>
   <string name="NoAvatarPicksClassifiedsText">User has no picks or classifieds</string>
@@ -3274,7 +3275,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     You have blocked this Resident. Sending a message will automatically unblock them.
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3115 issue 'generic' is passed into the gIMMgr::showSessionStartError as a string name.
   Also there are some other places where "generic" is used.
   So, let add string with name="generic" with the same value as "generic_request_error" -->
@@ -3300,7 +3301,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     You are not a session moderator.
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3562 issue 'muted' is passed into the gIMMgr::showSessionStartError as a string name.
   So, let add string with name="muted" with the same value as "muted_error" -->
   <string name="muted">
@@ -3313,12 +3314,12 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     Unable to add users to chat session with [RECIPIENT].
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3562 issue 'message' is passed into the gIMMgr::showSessionStartError as a string name.
   So, let add string with name="message" with the same value as "message_session_event" -->
   <string name="message">
     Unable to send your message to the chat session with [RECIPIENT].
-  </string>  
+  </string>
   <string name="message_session_event">
     Unable to send your message to the chat session with [RECIPIENT].
   </string>
@@ -3326,7 +3327,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     Error while moderating.
   </string>
   <!--Some times string name is getting from the body of server response.
-  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post. 
+  For ex.: from gIMMgr::showSessionStartError in the LLViewerChatterBoxSessionStartReply::post.
   In case of the EXT-3459 issue 'removed' is passed into the gIMMgr::showSessionStartError as a string name.
   So, let add string with name="removed" with the same value as "removed_from_group" -->
   <string name="removed">
@@ -3347,9 +3348,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	<string name="session_initialization_timed_out_error">
 		The session initialization is timed out
 	</string>
-  
+
   <string name="Home position set.">Home position set.</string>
-  
+
   <string name="voice_morphing_url">http://secondlife.com/landing/voicemorphing</string>
 
   <!-- Financial operations strings -->
@@ -3371,20 +3372,20 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   <string name="to join a group">to join a group</string>
   <string name="to upload">to upload</string>
   <string name="to publish a classified ad">to publish a classified ad</string>
-  
+
   <string name="giving">Giving L$ [AMOUNT]</string>
   <string name="uploading_costs">Uploading costs L$ [AMOUNT]</string>
   <string name="this_costs">This costs L$ [AMOUNT]</string>
   <string name="buying_selected_land">Buying selected land for L$ [AMOUNT]</string>
   <string name="this_object_costs">This object costs L$ [AMOUNT]</string>
-  
+
   <string name="group_role_everyone">Everyone</string>
   <string name="group_role_officers">Officers</string>
   <string name="group_role_owners">Owners</string>
   <string name="group_member_status_online">Online</string>
 
   <string name="uploading_abuse_report">Uploading...
-  
+
 Abuse Report</string>
 
   <!-- names for new inventory items-->
@@ -3478,23 +3479,23 @@ Abuse Report</string>
 
   <!-- birth date format shared by avatar inspector and profile panels -->
   <string name="AvatarBirthDateFormat">[mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt]</string>
-  
+
   <string name="DefaultMimeType">none/none</string>
   <string name="texture_load_dimensions_error">Can't load images larger than [WIDTH]*[HEIGHT]</string>
 
   <!-- language specific white-space characters, delimiters, spacers, item separation symbols -->
   <string name="sentences_separator" value=" "></string>
   <string name="words_separator" value=", "/>
-  
+
   <string name="server_is_down">
 	Despite our best efforts, something unexpected has gone wrong.
 
-	Please check status.secondlifegrid.net to see if there is a known problem with the service.  
+	Please check status.secondlifegrid.net to see if there is a known problem with the service.
         If you continue to experience problems, please check your network and firewall setup.
   </string>
 
-  <!-- overriding datetime formating. 
-	didn't translate if this is not needed for current localization 
+  <!-- overriding datetime formating.
+	didn't translate if this is not needed for current localization
   -->
   <string name="dateTimeWeekdaysNames">Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday</string>
   <string name="dateTimeWeekdaysShortNames">Sun:Mon:Tue:Wed:Thu:Fri:Sat</string>
@@ -3527,7 +3528,7 @@ Abuse Report</string>
   <string name="DeleteItem">Delete selected item?</string>
 
   <string name="EmptyOutfitText">There are no items in this outfit</string>
- 
+
  <!-- External editor status codes -->
  <string name="ExternalEditorNotSet">Select an editor using the ExternalEditor setting.</string>
  <string name="ExternalEditorNotFound">Cannot find the external editor you specified.
-- 
GitLab


From c98bf3cd509dd7bf10837713a911f9932c476e1f Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 6 Jan 2012 15:50:43 -0800
Subject: [PATCH 521/933] Updated InventoryOutboxMaxFolderCount to 21 to allow
 top level folder and 20 subfolders in outbox items

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e5bb6861232..a4806e3b77e 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4291,7 +4291,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>20</integer>
+      <integer>21</integer>
     </map>
     <key>InventoryOutboxMaxFolderDepth</key>
     <map>
-- 
GitLab


From 8c0023eec46c8a9cdba674acf8c07b488dac6f7c Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 9 Jan 2012 08:40:42 -0500
Subject: [PATCH 522/933] Added tag 3.6.0-start for changeset a1012611a195

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 424701983a8..54dd41dbf04 100644
--- a/.hgtags
+++ b/.hgtags
@@ -244,3 +244,4 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
+a1012611a195a41cbfb8e6b842e9aac5bd3306e8 3.6.0-start
-- 
GitLab


From 41ceee848bbbaec892471b6396bd2d2383d10aa3 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 9 Jan 2012 08:41:36 -0500
Subject: [PATCH 523/933] increment viewer version to 3.2.7

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index ec378761c28..7bba3d298f9 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 6;
+const S32 LL_VERSION_PATCH = 7;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From 3dfb1536fa3bb85f6648a76591e80c3feea9eb83 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 9 Jan 2012 08:41:36 -0500
Subject: [PATCH 524/933] increment viewer version to 3.2.7

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index ec378761c28..7bba3d298f9 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 6;
+const S32 LL_VERSION_PATCH = 7;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From 1fb6dbbf8061c89131669286fef9940af5dffc76 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 9 Jan 2012 12:26:57 -0500
Subject: [PATCH 525/933] Backed out changeset 4fd359f2f1c3

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 7bba3d298f9..ec378761c28 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 7;
+const S32 LL_VERSION_PATCH = 6;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From fc00c99532932ee1664bca1ff295e58240bc01b7 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 9 Jan 2012 12:29:13 -0500
Subject: [PATCH 526/933] remove incorrect tag

---
 .hgtags | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.hgtags b/.hgtags
index 54dd41dbf04..424701983a8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -244,4 +244,3 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
-a1012611a195a41cbfb8e6b842e9aac5bd3306e8 3.6.0-start
-- 
GitLab


From 4c5141c5677a2e98c1331026d4e119abee6ab2ae Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 9 Jan 2012 12:29:39 -0500
Subject: [PATCH 527/933] Added tag 3.2.6-start for changeset 2174ed1c7129

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 424701983a8..f4ffb61aa60 100644
--- a/.hgtags
+++ b/.hgtags
@@ -244,3 +244,4 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
+2174ed1c7129562428a5cfe8651ed77b8d26ae18 3.2.6-start
-- 
GitLab


From 651fdba651dc4ecbb9a40b7c841a13ac1b47e1cc Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 9 Jan 2012 11:42:04 -0800
Subject: [PATCH 528/933] sync with viewer-development

---
 .../skins/default/xui/de/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/de/notifications.xml    |  2 +-
 .../skins/default/xui/de/panel_status_bar.xml |  2 +-
 .../skins/default/xui/en/floater_chat_bar.xml |  2 ++
 .../skins/default/xui/en/menu_edit.xml        |  3 +++
 .../skins/default/xui/en/menu_viewer.xml      |  2 ++
 .../skins/default/xui/en/notifications.xml    | 22 ++++++++++++++++++-
 .../xui/en/panel_snapshot_postcard.xml        |  8 -------
 .../skins/default/xui/en/panel_status_bar.xml |  3 +--
 .../default/xui/en/widgets/window_shade.xml   |  2 ++
 .../skins/default/xui/es/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/es/notifications.xml    |  2 +-
 .../skins/default/xui/es/panel_status_bar.xml |  2 +-
 .../skins/default/xui/fr/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/fr/notifications.xml    |  2 +-
 .../skins/default/xui/fr/panel_status_bar.xml |  2 +-
 .../skins/default/xui/it/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/it/notifications.xml    |  2 +-
 .../skins/default/xui/it/panel_status_bar.xml |  2 +-
 .../skins/default/xui/ja/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/ja/notifications.xml    |  2 +-
 .../skins/default/xui/ja/panel_status_bar.xml |  2 +-
 .../skins/default/xui/pl/notifications.xml    |  2 +-
 .../skins/default/xui/pt/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/pt/notifications.xml    |  2 +-
 .../skins/default/xui/pt/panel_status_bar.xml |  2 +-
 .../skins/default/xui/ru/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/ru/notifications.xml    |  2 +-
 .../skins/default/xui/ru/panel_status_bar.xml |  2 +-
 .../skins/default/xui/tr/floater_chat_bar.xml |  2 +-
 .../skins/default/xui/tr/notifications.xml    |  2 +-
 .../skins/default/xui/tr/panel_status_bar.xml |  2 +-
 .../skins/default/xui/zh/notifications.xml    |  2 +-
 33 files changed, 57 insertions(+), 37 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/widgets/window_shade.xml

diff --git a/indra/newview/skins/default/xui/de/floater_chat_bar.xml b/indra/newview/skins/default/xui/de/floater_chat_bar.xml
index dc5a7cd6819..2464a55665e 100644
--- a/indra/newview/skins/default/xui/de/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/de/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT IN DER NÄHE">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Zum Chatten hier klicken." name="chat_box" tool_tip="Eingabetaste zum Sprechen, Strg+Eingabe zum Rufen"/>
 		<button name="show_nearby_chat" tool_tip="Chatprotokoll in der Nähe ein-/ausblenden"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index 72e7ec8eb47..a5fcd3e0b41 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -1443,7 +1443,7 @@ Zur Installation des Updates muss [APP_NAME] neu gestartet werden.
 		<usetemplate ignoretext="Bestätigen, bevor Objekte an Ihre Eigentümer zurückgegeben werden" name="okcancelignore" notext="Abbrechen" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Sie sind Mitglied der Gruppe [GROUP].
+		Sie sind Mitglied der Gruppe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Diese Gruppe verlassen?
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml
index d34fcf70bc3..2493d60df66 100644
--- a/indra/newview/skins/default/xui/de/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Klicken, um L$-Guthaben zu aktualisieren" value="20 L$"/>
 		<button label="L$ kaufen" name="buyL" tool_tip="Hier klicken, um mehr L$ zu kaufen"/>
-		<button label="Einkaufen" name="goShop" tool_tip="Second Life-Marktplatz öffnen"/>
+		<button label="Einkaufen" name="goShop" tool_tip="Second Life-Marktplatz öffnen" width="85"/>
 	</panel>
 	<text name="TimeText" tool_tip="Aktuelle Zeit (Pazifik)">
 		24:00 H PST
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 8d0cecdac33..63992462b34 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -9,6 +9,7 @@
  single_instance="true"
  title="NEARBY CHAT"
  save_rect="true"
+ save_visibility="true"
  can_close="true"
  can_minimize="true"
  help_topic="chat_bar"
@@ -30,6 +31,7 @@
     <panel width="300" 
            height="31" 
            left="0" 
+           name="bottom_panel"
            bottom="-1" 
            follows="left|right|bottom" 
            tab_group="1">
diff --git a/indra/newview/skins/default/xui/en/menu_edit.xml b/indra/newview/skins/default/xui/en/menu_edit.xml
index fab76c497cf..99061e089a9 100644
--- a/indra/newview/skins/default/xui/en/menu_edit.xml
+++ b/indra/newview/skins/default/xui/en/menu_edit.xml
@@ -6,6 +6,7 @@
   <menu_item_call
    label="Undo"
    name="Undo"
+   allow_key_repeat="true"
    shortcut="control|Z">
     <menu_item_call.on_click
      function="Edit.Undo" />
@@ -15,6 +16,7 @@
   <menu_item_call
    label="Redo"
    name="Redo"
+   allow_key_repeat="true"
    shortcut="control|Y">
     <menu_item_call.on_click
      function="Edit.Redo" />
@@ -43,6 +45,7 @@
   <menu_item_call
    label="Paste"
    name="Paste"
+   allow_key_repeat="true"
    shortcut="control|V">
     <menu_item_call.on_click
      function="Edit.Paste" />
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 0df123e1407..ec2dd102480 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1154,6 +1154,7 @@
          enabled="false"
          label="Undo"
          name="Undo"
+         allow_key_repeat="true"
          shortcut="control|Z">
             <on_click
              function="Edit.Undo"
@@ -1165,6 +1166,7 @@
          enabled="false"
          label="Redo"
          name="Redo"
+         allow_key_repeat="true"
          shortcut="control|Y">
             <on_click
              function="Edit.Redo"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index a7705c8bac7..1daf2e69482 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3409,7 +3409,7 @@ Are you sure you want to return the selected objects to their owners? Transferab
    icon="alert.tga"
    name="GroupLeaveConfirmMember"
    type="alert">
-You are currently a member of the group [GROUP].
+You are currently a member of the group &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Leave Group?
     <tag>group</tag>
     <tag>confirm</tag>
@@ -6951,6 +6951,26 @@ With the following Residents:
      yestext="OK"/>
   </notification>
   
+  <notification
+   icon="notifytip.tga"
+   name="ShareFolderConfirmation"
+   type="alertmodal">
+Only one folder at a time can be shared.
+
+Are you sure you want to share the following items:
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+With the following Residents:
+
+[RESIDENTS]
+  <tag>confirm</tag>
+	<usetemplate
+     name="okcancelbuttons"
+     notext="Cancel"
+     yestext="Ok"/>
+  </notification>
+  
   <notification
    icon="notifytip.tga"
    name="ItemsShared"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
index d8ff043444b..ebba292a935 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
@@ -16,14 +16,6 @@
      name="upload_message">
         Sending...
     </string>
-    <string
-     name="default_subject">
-        Postcard from [SECOND_LIFE].
-    </string>
-    <string
-     name="default_message">
-        Check this out!
-    </string>
     <icon
      follows="top|left"
      height="18"
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index 3239c4e531f..d453a970e75 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -70,7 +70,7 @@
      pad_bottom="2"
      tool_tip="Click to buy more L$"
      top="0"
-     width="55" />
+     width="80" />
     <button
      halign="left"
      font="SansSerifSmall"
@@ -87,7 +87,6 @@
      left_pad="0"
      label_shadow="true"
      name="goShop"
-     pad_right="0"
      pad_bottom="2"
      tool_tip="Open Second Life Marketplace"
      top="0"
diff --git a/indra/newview/skins/default/xui/en/widgets/window_shade.xml b/indra/newview/skins/default/xui/en/widgets/window_shade.xml
new file mode 100644
index 00000000000..23eb2f13fb8
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/window_shade.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<window_shade shade_color="0 0 0 0.5"/>
diff --git a/indra/newview/skins/default/xui/es/floater_chat_bar.xml b/indra/newview/skins/default/xui/es/floater_chat_bar.xml
index 5e5ef616b8d..2e948050570 100644
--- a/indra/newview/skins/default/xui/es/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/es/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Pulsa aquí para chatear." name="chat_box" tool_tip="Pulsa Enter para decirlo o Ctrl+Enter para gritarlo"/>
 		<button name="show_nearby_chat" tool_tip="Muestra o esconde el registro del chat"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 9591b424fce..0de56f9b6da 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -1437,7 +1437,7 @@ Debemos reiniciar [APP_NAME] para instalar la actualización.
 		<usetemplate ignoretext="Confirmar antes de devolver objetos a sus propietarios." name="okcancelignore" notext="Cancelar" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Actualmente, eres miembro del grupo [GROUP].
+		Actualmente, eres miembro del grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 ¿Dejar el grupo?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/es/panel_status_bar.xml b/indra/newview/skins/default/xui/es/panel_status_bar.xml
index d43790c8c6f..79b2c32b236 100644
--- a/indra/newview/skins/default/xui/es/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Pulsa para comprar más L$"/>
-		<button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life"/>
+		<button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life" width="80"/>
 	</panel>
 	<text name="TimeText" tool_tip="Hora actual (Pacífico)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
index 88a2fb669b8..c7d27c05895 100644
--- a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT PRÈS DE MOI">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Cliquer ici pour chatter." name="chat_box" tool_tip="Appuyer sur Entrée pour dire, Ctrl-Entrée pour crier"/>
 		<button name="show_nearby_chat" tool_tip="Affiche/Masque le journal de chats près de vous"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index d8d79d8ddef..be6f1f8c310 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -1428,7 +1428,7 @@ Version [VERSION]
 		<usetemplate ignoretext="Confirmer avant de rendre les objets à leurs propriétaires" name="okcancelignore" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Vous êtes actuellement membre du groupe [GROUP].
+		Vous êtes actuellement membre du groupe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Quitter le groupe ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
index ac61eb7e52e..c0d59a3182d 100644
--- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
 		<button label="Acheter L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$."/>
-		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life."/>
+		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life." width="75"/>
 	</panel>
 	<text name="TimeText" tool_tip="Heure actuelle (Pacifique)">
 		00h00 PST
diff --git a/indra/newview/skins/default/xui/it/floater_chat_bar.xml b/indra/newview/skins/default/xui/it/floater_chat_bar.xml
index 6c5c8fbea0f..94c85b50c81 100644
--- a/indra/newview/skins/default/xui/it/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/it/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT NEI DINTORNI">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Clicca qui per la chat." name="chat_box" tool_tip="Premi Invio per parlare, Ctrl+Invio per gridare"/>
 		<button name="show_nearby_chat" tool_tip="Mostra/Nasconde il registro della chat nei dintorni"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index 2db0892cd6e..fce027da0c9 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -1432,7 +1432,7 @@ Per installare l&apos;aggiornamento è necessario riavviare [APP_NAME].
 		<usetemplate ignoretext="Conferma prima di restituire gli oggetti ai relativi proprietari" name="okcancelignore" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Sei attualmente un membro del gruppo [GROUP].
+		Sei attualmente un membro del gruppo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Vuoi lasciare il gruppo?
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/it/panel_status_bar.xml b/indra/newview/skins/default/xui/it/panel_status_bar.xml
index fadaa575ea7..4abc90113f4 100644
--- a/indra/newview/skins/default/xui/it/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/it/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Clicca per aggiornare il tuo saldo in L$" value="L$ 20"/>
 		<button label="Acquista L$" name="buyL" tool_tip="Clicca per acquistare più L$"/>
-		<button label="Acquisti" name="goShop" tool_tip="Apri Mercato Second Life"/>
+		<button label="Acquisti" name="goShop" tool_tip="Apri Mercato Second Life" width="75"/>
 	</panel>
 	<text name="TimeText" tool_tip="Orario attuale (Pacifico)">
 		24:00, ora del Pacifico
diff --git a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
index 9735afb101e..504cea5931b 100644
--- a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="近くのチャット">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="ここをクリックしてチャットを開始します。" name="chat_box" tool_tip="Enter キーを押して話し、Ctrl + Enter キーで叫びます。"/>
 		<button name="show_nearby_chat" tool_tip="近くのチャットログを表示・非表示"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 7dfa6d2f7a8..141f2c8071a 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1467,7 +1467,7 @@ http://secondlife.com/download から最新バージョンをダウンロード
 		<usetemplate ignoretext="オブジェクトを所有者に返却する前の確認" name="okcancelignore" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		現在あなたは [GROUP] のメンバーです。
+		現在あなたは &lt;nolink&gt;[GROUP]&lt;/nolink&gt; のメンバーです。
 このグループを抜けますか?
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/ja/panel_status_bar.xml b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
index 93689b81af7..4fb876f690b 100644
--- a/indra/newview/skins/default/xui/ja/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/>
 		<button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/>
-		<button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"/>
+		<button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"  width="40"/>
 	</panel>
 	<text name="TimeText" tool_tip="現在時刻(太平洋)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index e1fb6dd3f14..01942936422 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -1385,7 +1385,7 @@ W celu instalacji aktualizacji musi zostać wykonany restart [APP_NAME].
 		<usetemplate ignoretext="Potwierdź zanim zwrócisz obiekty do ich właścicieli" name="okcancelignore" notext="Anuluj" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Jesteś członkiem grupy [GROUP].
+		Jesteś członkiem grupy &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Chcesz opuścić grupę?
 		<usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/pt/floater_chat_bar.xml b/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
index c089ab93f2b..72016c6b406 100644
--- a/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="BATE-PAPO LOCAL">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Clique aqui para bater papo." name="chat_box" tool_tip="Tecle Enter para falar, Ctrl+Enter para gritar"/>
 		<button name="show_nearby_chat" tool_tip="Mostra/oculta o histórico do bate-papo local"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index d3547beeb36..b53ebeb1361 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -1419,7 +1419,7 @@ Para instalar a atualização, será preciso reiniciar o [APP_NAME].
 		<usetemplate ignoretext="Confirmar antes de devolver objetos a seus donos" name="okcancelignore" notext="Cancelar" yestext="Retornar"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Você é atualmente um membro do grupo [GROUP].
+		Você é atualmente um membro do grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Sair do grupo?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Sair"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/pt/panel_status_bar.xml b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
index d5a3258ddc1..22853f0643c 100644
--- a/indra/newview/skins/default/xui/pt/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Atualizar saldo de L$" value="L$20"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Comprar mais L$"/>
-		<button label="Comprar" name="goShop" tool_tip="Abrir Mercado do Second Life"/>
+		<button label="Comprar" name="goShop" tool_tip="Abrir Mercado do Second Life" width="80"/>
 	</panel>
 	<text name="TimeText" tool_tip="Hora atual (Pacífico)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
index eceab1775a5..79b7b033fb6 100644
--- a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="ЛОКАЛЬНЫЙ ЧАТ">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Щелкните здесь для общения." name="chat_box" tool_tip="Нажмите Enter, чтобы сказать, Ctrl+Enter, чтобы прокричать"/>
 		<button name="show_nearby_chat" tool_tip="Показать/скрыть лог локального чата"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index 1be14160ed1..f121743fe92 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -1431,7 +1431,7 @@ http://secondlife.com/download.
 		<usetemplate ignoretext="Подтверждать перед возвратом объектов владельцам" name="okcancelignore" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Вы являетесь участником группы [GROUP].
+		Вы являетесь участником группы &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Хотите покинуть группу?
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/ru/panel_status_bar.xml b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
index 68222441966..babe5811ace 100644
--- a/indra/newview/skins/default/xui/ru/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="Щелкните для обновления вашего баланса L$" value="L$20"/>
 		<button label="Купить L$" name="buyL" tool_tip="Щелкните для покупки L$"/>
-		<button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life"/>
+		<button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life" width="121"/>
 	</panel>
 	<text name="TimeText" tool_tip="Текущее время (тихоокеанское)">
 		00:00 (тихоокеанское время)
diff --git a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
index d2385e6be39..dee17b7bc4c 100644
--- a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="YAKINDAKÄ° SOHBET">
-	<panel>
+	<panel name="bottom_panel">
 		<line_editor label="Sohbet etmek için buraya tıklayın." name="chat_box" tool_tip="Söylemek için Enter, bağırmak için Ctrl+Enter yapın"/>
 		<button name="show_nearby_chat" tool_tip="yakın sohbet günlüğünü gösterir/gizler"/>
 	</panel>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index 6908f6867fa..c0dc67ed345 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -1431,7 +1431,7 @@ Güncellemeyi kurmak için [APP_NAME] uygulamasını yeniden başlatmalısınız
 		<usetemplate ignoretext="Nesneleri sahiplerine iade etmeden önce doğrulama iste" name="okcancelignore" notext="İptal" yestext="Tamam"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Şu anda [GROUP] grubunun bir üyesisiniz.
+		Şu anda &lt;nolink&gt;[GROUP]&lt;/nolink&gt; grubunun bir üyesisiniz.
 Gruptan ayrılmak istiyor musunuz?
 		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/tr/panel_status_bar.xml b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
index 63726b94e21..81c304a5d80 100644
--- a/indra/newview/skins/default/xui/tr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
@@ -18,7 +18,7 @@
 	<panel name="balance_bg">
 		<text name="balance" tool_tip="L$ bakiyenizi yenilemek için buraya tıklayın" value="L$20"/>
 		<button label="L$ Satın Al" name="buyL" tool_tip="Daha fazla L$ satın almak için tıklayın"/>
-		<button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç"/>
+		<button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç" width="95"/>
 	</panel>
 	<text name="TimeText" tool_tip="Geçerli zaman (Pasifik)">
 		24:00 AM PST
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index 17ff6288a5f..3fa8ff3f781 100644
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -1418,7 +1418,7 @@ We must restart [APP_NAME] to install the update.
 		<usetemplate ignoretext="在我退回物件給它們的擁有者前確認" name="okcancelignore" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		你目前是 [GROUP] 群組的成員。
+		你目前是 &lt;nolink&gt;[GROUP]&lt;/nolink&gt; 群組的成員。
 是否要離開群組?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
-- 
GitLab


From 98a85b1bf2d7decf477d3d1076859fdeec6f1b46 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 9 Jan 2012 13:39:58 -0800
Subject: [PATCH 529/933] EXP-1159 FIX -- User can get No transfer items into
 Merchant Outbox by rezzing object from Outbox, including No Transfer item in
 contents, and then taking back into Inventory

* Drag and drop to the 3D world is now disabled from the outbox
---
 indra/newview/lltooldraganddrop.cpp           | 17 ++++++++++++++-
 .../newview/skins/default/xui/en/strings.xml  | 21 ++++++++++---------
 2 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 6338ea477ce..5a4d1777098 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -769,6 +769,21 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop,
 
 	if (!handled)
 	{
+		// Disallow drag and drop to 3D from the outbox
+		const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+		if (outbox_id.notNull())
+		{
+			for (S32 item_index = 0; item_index < (S32)mCargoIDs.size(); item_index++)
+			{
+				if (gInventory.isObjectDescendentOf(mCargoIDs[item_index], outbox_id))
+				{
+					*acceptance = ACCEPT_NO;
+					mToolTipMsg = LLTrans::getString("TooltipOutboxDragToWorld");
+					return;
+				}
+			}
+		}
+		
 		dragOrDrop3D( x, y, mask, drop, acceptance );
 	}
 }
@@ -867,7 +882,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info)
 			(U32)mLastAccept,
 			(U32)callMemberFunction(*this, 
 									LLDragAndDropDictionary::instance().get(dad_type, target))
-			(hit_obj, hit_face, pick_info.mKeyMask, FALSE));
+				(hit_obj, hit_face, pick_info.mKeyMask, FALSE));
 	}
 
 	if (mDrop && ((U32)mLastAccept >= ACCEPT_YES_COPY_SINGLE))
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 20d94631867..a78f3df5b66 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -18,7 +18,7 @@
 	<string name="StartupClearingCache">Clearing cache...</string>
 	<string name="StartupInitializingTextureCache">Initializing texture cache...</string>
 	<string name="StartupInitializingVFS">Initializing VFS...</string>
-  <string name="StartupRequireDriverUpdate">Graphics initialization failed. Please update your graphics driver!</string>
+	<string name="StartupRequireDriverUpdate">Graphics initialization failed. Please update your graphics driver!</string>
 
 	<!--  progress -->
 	<string name="ProgressRestoring">Restoring...</string>
@@ -35,9 +35,9 @@
 	<string name="LoginAttempt">Previous login attempt failed. Logging in, attempt [NUMBER]</string>
 	<string name="LoginPrecaching">Loading world...</string>
 	<string name="LoginInitializingBrowser">Initializing embedded web browser...</string>
-  <string name="LoginInitializingMultimedia">Initializing multimedia...</string>
-  <string name="LoginInitializingFonts">Loading fonts...</string>
-  <string name="LoginVerifyingCache">Verifying cache files (can take 60-90 seconds)...</string>
+	<string name="LoginInitializingMultimedia">Initializing multimedia...</string>
+	<string name="LoginInitializingFonts">Loading fonts...</string>
+	<string name="LoginVerifyingCache">Verifying cache files (can take 60-90 seconds)...</string>
 	<string name="LoginProcessingResponse">Processing response...</string>
 	<string name="LoginInitializingWorld">Initializing world...</string>
 	<string name="LoginDecodingImages">Decoding images...</string>
@@ -49,12 +49,12 @@
 	<string name="LoginWaitingForRegionHandshake">Waiting for region handshake...</string>
 	<string name="LoginConnectingToRegion">Connecting to region...</string>
 	<string name="LoginDownloadingClothing">Downloading clothing...</string>
-        <string name="InvalidCertificate">The server returned an invalid or corrupt certificate. Please contact the Grid administrator.</string>
-        <string name="CertInvalidHostname">An invalid hostname was used to access the server, please check your SLURL or Grid hostname.</string>
-        <string name="CertExpired">The certificate returned by the Grid appears to be expired.  Please check your system clock, or contact your Grid administrator.</string>
-        <string name="CertKeyUsage">The certificate returned by the server could not be used for SSL.  Please contact your Grid administrator.</string>
-        <string name="CertBasicConstraints">Too many certificates were in the servers Certificate chain.  Please contact your Grid administrator.</string>
-        <string name="CertInvalidSignature">The certificate signature returned by the Grid server could not be verified.  Please contact your Grid administrator.</string>
+	<string name="InvalidCertificate">The server returned an invalid or corrupt certificate. Please contact the Grid administrator.</string>
+	<string name="CertInvalidHostname">An invalid hostname was used to access the server, please check your SLURL or Grid hostname.</string>
+	<string name="CertExpired">The certificate returned by the Grid appears to be expired.  Please check your system clock, or contact your Grid administrator.</string>
+	<string name="CertKeyUsage">The certificate returned by the server could not be used for SSL.  Please contact your Grid administrator.</string>
+	<string name="CertBasicConstraints">Too many certificates were in the servers Certificate chain.  Please contact your Grid administrator.</string>
+	<string name="CertInvalidSignature">The certificate signature returned by the Grid server could not be verified.  Please contact your Grid administrator.</string>
 
 	<string name="LoginFailedNoNetwork">Network error: Could not establish connection, please check your network connection.</string>
 	<string name="LoginFailed">Login failed.</string>
@@ -165,6 +165,7 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]: "/>
 
+	<string name="TooltipOutboxDragToWorld">You can not rez items in your merchant outbox</string>
 	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred.</string>
 	<string name="TooltipOutboxNotInInventory">Your merchant outbox can only accept items directly from your inventory</string>
 	<string name="TooltipOutboxWorn">You can not put items you are wearing into your merchant outbox</string>
-- 
GitLab


From c4a08e6c9d9f044532fcfd4eeeb8934f2c1f3dda Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Mon, 9 Jan 2012 14:42:34 -0800
Subject: [PATCH 530/933] EXP-1511 FIX Preview image overlays ui elements in
 Upload image floater

---
 indra/newview/llfloaterimagepreview.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 69de15d9eae..cc279049cae 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -63,6 +63,7 @@
 const S32 PREVIEW_BORDER_WIDTH = 2;
 const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
 const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
+const S32 PREVIEW_VPAD = 32;	// yuk, hard coded
 const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
 const S32 PREVIEW_TEXTURE_HEIGHT = 320;
 
@@ -99,7 +100,7 @@ BOOL LLFloaterImagePreview::postBuild()
 	childSetCommitCallback("clothing_type_combo", onPreviewTypeCommit, this);
 
 	mPreviewRect.set(PREVIEW_HPAD, 
-		PREVIEW_TEXTURE_HEIGHT,
+		PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD,
 		getRect().getWidth() - PREVIEW_HPAD, 
 		PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
@@ -271,13 +272,13 @@ void LLFloaterImagePreview::draw()
 			gGL.begin( LLRender::QUADS );
 			{
 				gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop);
-				gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
+				gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
 				gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mBottom);
 				gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 				gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom);
 				gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 				gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mTop);
-				gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
+				gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
 			}
 			gGL.end();
 
-- 
GitLab


From a47e9bd97b9855ca8bb3309a73d33d9ae593fd7d Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 10 Jan 2012 16:35:36 +0200
Subject: [PATCH 531/933] EXP-1525 FIXED Potential fix for a crash at shutdown:
 added some error handling to saving inventory cache.

---
 indra/llcommon/llsys.cpp         | 18 ++++++++++++++----
 indra/newview/llinventorymodel.h |  1 +
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 19075afa688..6073bcd0a6c 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -1364,11 +1364,21 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
 	src = LLFile::fopen(srcfile, "rb");		/* Flawfinder: ignore */
 	if (! src) goto err;
 
-	do
+	while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0)
 	{
-		bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE,src);
-		gzwrite(dst, buffer, bytes);
-	} while(feof(src) == 0);
+		if (gzwrite(dst, buffer, bytes) <= 0)
+		{
+			llwarns << "gzwrite failed: " << gzerror(dst, NULL) << llendl;
+			goto err;
+		}
+	}
+
+	if (ferror(src))
+	{
+		llwarns << "Error reading " << srcfile << llendl;
+		goto err;
+	}
+
 	gzclose(dst);
 	dst = NULL;
 #if LL_WINDOWS
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 340c1b0c22d..f36ae50272a 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -64,6 +64,7 @@ class LLInventoryCollectFunctor;
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 class LLInventoryModel
 {
+	LOG_CLASS(LLInventoryModel);
 public:
 	friend class LLInventoryModelFetchDescendentsResponder;
 
-- 
GitLab


From 0434771b043a96b44a99db6acfdec232806f2331 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 10 Jan 2012 17:20:49 +0200
Subject: [PATCH 532/933] EXP-1766 FIXED Disabled updating agent AFK state if
 the viewer is disconnected. Possible crash fix.

---
 indra/newview/llviewerwindow.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b73be4ed435..4499955dec0 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1206,7 +1206,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window,  LLCoordGL pos, MASK mask
 
 	mWindow->showCursorFromMouseMove();
 
-	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
+	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME
+		&& !gDisconnected)
 	{
 		gAgent.clearAFK();
 	}
-- 
GitLab


From 7bc4085eb2275c84eb482ba1f5b8426f1ac6ba5f Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 10 Jan 2012 12:03:20 -0500
Subject: [PATCH 533/933] STORM-1788 Clarify wording in About Land->Access and
 tooltips (and similar Estate panel)

---
 doc/contributions.txt                         |  1 +
 indra/newview/llfloaterland.cpp               | 21 ----------
 .../default/xui/en/floater_about_land.xml     | 38 +++++--------------
 .../default/xui/en/panel_region_estate.xml    | 10 ++---
 4 files changed, 16 insertions(+), 54 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 84f399cc893..ee8cbfa9f25 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -607,6 +607,7 @@ Jonathan Yap
 	STORM-1737
 	STORM-1733
 	STORM-1790
+	STORM-1788
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index b13a9aab888..05c4903cba1 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2475,27 +2475,6 @@ void LLPanelLandAccess::refresh()
 				mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
 			}
 		}
-		
-		LLCheckBoxWithTBAcess* maturity_checkbox = (LLCheckBoxWithTBAcess*) getChild<LLCheckBoxCtrl>( "public_access");
-		LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
-		if(region)
-		{
-			LLTextBox* maturity_textbox = maturity_checkbox->getTextBox();
-			insert_maturity_into_textbox(maturity_textbox, gFloaterView->getParentFloater(this), getString("allow_public_access"));
-			maturity_checkbox->reshape(maturity_checkbox->getRect().getWidth(), maturity_checkbox->getRect().getHeight(), FALSE);
-		}
-		else
-		{
-			std::string maturity_string = getString("allow_public_access");
-			size_t maturity_pos = maturity_string.find(MATURITY);
-
-			if (maturity_pos != std::string::npos)
-			{
-				maturity_string.replace(maturity_pos, MATURITY.length(), std::string(""));
-			}
-
-			maturity_checkbox->setLabel(maturity_string);
-		}
 
 		if(parcel->getRegionDenyAnonymousOverride())
 		{
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 4772f744ead..0c741f3831a 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1955,36 +1955,18 @@ Only large parcels can be listed in search.
 			 name="access_estate_defined">
 				(Defined by the Estate)
 			</panel.string>
-      <panel.string
-       name="allow_public_access">
-        Allow Public Access ([MATURITY]) (Note: Unchecking this will create ban lines)
-      </panel.string>
             <panel.string
              name="estate_override">
                 One or more of these options is set at the estate level
             </panel.string>
-            <text
-             type="string"
-             length="1"
-             follows="left|top"
-             height="16"
-             layout="topleft"
-             left="10"
-             name="Limit access to this parcel to:"
-             text_color="White"
-             top="10"
-             width="400">
-                Access To This Parcel
-            </text>
             <check_box
              follows="top|left"
              height="16"
              layout="topleft"
-             left_delta="0"
+             left="8"
              name="public_access"
-             top_pad="5"
-             label_text.valign="center"
-             label_text.v_pad="-2" 
+             label="Allow Public Access (Unchecking this will create ban lines)"
+             top_pad="10" 
              width="278" />
             <text
              type="string"
@@ -1994,28 +1976,28 @@ Only large parcels can be listed in search.
              layout="topleft"
              left_delta="20"
              name="Only Allow"
-             top="49"
+             top="30"
              width="325">
-                Restrict Access to Residents verified by:
+                Allow access only to Residents who:
             </text>
             <check_box
              follows="top|left"
              height="16"
-             label="Payment Information on File [ESTATE_PAYMENT_LIMIT]"
+             label="Have payment Information on File [ESTATE_PAYMENT_LIMIT]"
              layout="topleft"
              left_delta="0"
              name="limit_payment"
-             tool_tip="Ban unidentified Residents."
+             tool_tip="Residents must have payment information on file to access this parcel.  See the [SUPPORT_SITE] for more information."
              top_pad="4"
              width="278" />
             <check_box
              follows="top|left"
              height="16"
-             label="Age Verification [ESTATE_AGE_LIMIT]"
+             label="Have been age-verified [ESTATE_AGE_LIMIT]"
              layout="topleft"
              left_delta="0"
              name="limit_age_verified"
-             tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information."
+             tool_tip="Residents must be age verified to access this parcel. See the [SUPPORT_SITE] for more information."
              top_pad="4"
              width="278" />
             <check_box
@@ -2025,7 +2007,7 @@ Only large parcels can be listed in search.
              left="8"
              name="GroupCheck"
              tool_tip="Set group in the General tab."
-             top="109"
+             top="89"
              width="278" />
             <check_box
              enabled="false"
diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml
index 6b28639a777..bfd796a62bd 100644
--- a/indra/newview/skins/default/xui/en/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml
@@ -134,26 +134,26 @@
      name="Only Allow"
      top_delta="-30"
      width="278">
-        Restrict Access to accounts verified by:
+        Allow access only to Residents who:
     </text>
     <check_box
      follows="top|left"
      height="16"
-     label="Payment Information on File"
+     label="Have payment information on file"
      layout="topleft"
      left_delta="0"
      name="limit_payment"
-     tool_tip="Ban unidentified Residents"
+     tool_tip="Residents must have payment information on file to access this estate.  See the [SUPPORT_SITE] for more information."
      top_pad="2"
      width="278" />
     <check_box
      follows="top|left"
      height="16"
-     label="Age Verification"
+     label="Have been age-verified"
      layout="topleft"
      left_delta="0"
      name="limit_age_verified"
-     tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information."
+     tool_tip="Residents must be age verified to access this estate. See the [SUPPORT_SITE] for more information."
      top_pad="2"
      width="278" />
 
-- 
GitLab


From 9cdfecd9e1d9862d9dbd674faa1e28a793540079 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Tue, 10 Jan 2012 10:40:27 -0800
Subject: [PATCH 534/933] EXP-1765 (Add debug info) crash on startup at
 LLWindowWin32::switchContext()

---
 indra/llwindow/llwindowwin32.cpp | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 52c27b6736e..954b9f2b159 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1083,6 +1083,37 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		return FALSE;
 	}
 
+	// (EXP-1765) dump pixel data to see if there is a pattern that leads to unreproducible crash
+	LL_INFOS("Window") << "--- begin pixel format dump ---" << llendl ;
+	LL_INFOS("Window") << "pixel_format is " << pixel_format << llendl ;
+	LL_INFOS("Window") << "pfd.nSize:            " << pfd.nSize << llendl ;
+	LL_INFOS("Window") << "pfd.nVersion:         " << pfd.nVersion << llendl ;
+	LL_INFOS("Window") << "pfd.dwFlags:          0x" << std::hex << pfd.dwFlags << std::dec << llendl ;
+	LL_INFOS("Window") << "pfd.iPixelType:       " << (int)pfd.iPixelType << llendl ;
+	LL_INFOS("Window") << "pfd.cColorBits:       " << (int)pfd.cColorBits << llendl ;
+	LL_INFOS("Window") << "pfd.cRedBits:         " << (int)pfd.cRedBits << llendl ;
+	LL_INFOS("Window") << "pfd.cRedShift:        " << (int)pfd.cRedShift << llendl ;
+	LL_INFOS("Window") << "pfd.cGreenBits:       " << (int)pfd.cGreenBits << llendl ;
+	LL_INFOS("Window") << "pfd.cGreenShift:      " << (int)pfd.cGreenShift << llendl ;
+	LL_INFOS("Window") << "pfd.cBlueBits:        " << (int)pfd.cBlueBits << llendl ;
+	LL_INFOS("Window") << "pfd.cBlueShift:       " << (int)pfd.cBlueShift << llendl ;
+	LL_INFOS("Window") << "pfd.cAlphaBits:       " << (int)pfd.cAlphaBits << llendl ;
+	LL_INFOS("Window") << "pfd.cAlphaShift:      " << (int)pfd.cAlphaShift << llendl ;
+	LL_INFOS("Window") << "pfd.cAccumBits:       " << (int)pfd.cAccumBits << llendl ;
+	LL_INFOS("Window") << "pfd.cAccumRedBits:    " << (int)pfd.cAccumRedBits << llendl ;
+	LL_INFOS("Window") << "pfd.cAccumGreenBits:  " << (int)pfd.cAccumGreenBits << llendl ;
+	LL_INFOS("Window") << "pfd.cAccumBlueBits:   " << (int)pfd.cAccumBlueBits << llendl ;
+	LL_INFOS("Window") << "pfd.cAccumAlphaBits:  " << (int)pfd.cAccumAlphaBits << llendl ;
+	LL_INFOS("Window") << "pfd.cDepthBits:       " << (int)pfd.cDepthBits << llendl ;
+	LL_INFOS("Window") << "pfd.cStencilBits:     " << (int)pfd.cStencilBits << llendl ;
+	LL_INFOS("Window") << "pfd.cAuxBuffers:      " << (int)pfd.cAuxBuffers << llendl ;
+	LL_INFOS("Window") << "pfd.iLayerType:       " << (int)pfd.iLayerType << llendl ;
+	LL_INFOS("Window") << "pfd.bReserved:        " << (int)pfd.bReserved << llendl ;
+	LL_INFOS("Window") << "pfd.dwLayerMask:      " << pfd.dwLayerMask << llendl ;
+	LL_INFOS("Window") << "pfd.dwVisibleMask:    " << pfd.dwVisibleMask << llendl ;
+	LL_INFOS("Window") << "pfd.dwDamageMask:     " << pfd.dwDamageMask << llendl ;
+	LL_INFOS("Window") << "--- end pixel format dump ---" << llendl ;
+
 	if (pfd.cColorBits < 32)
 	{
 		close();
-- 
GitLab


From 16112a32e83c6d67acfffdbe339fa7b7b9dd4be3 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 10 Jan 2012 20:56:52 +0200
Subject: [PATCH 535/933] EXP-1783 FIXED Duplicated/missing IDs in
 menu_viewer.xml

---
 .../skins/default/xui/da/menu_viewer.xml      |  68 ++++----
 .../skins/default/xui/de/menu_viewer.xml      |  72 ++++-----
 .../skins/default/xui/en/menu_viewer.xml      | 147 +++---------------
 .../skins/default/xui/es/menu_viewer.xml      |  70 ++++-----
 .../skins/default/xui/fr/menu_viewer.xml      |  72 ++++-----
 .../skins/default/xui/it/menu_viewer.xml      |  70 ++++-----
 .../skins/default/xui/ja/menu_viewer.xml      |  72 ++++-----
 .../skins/default/xui/pl/menu_viewer.xml      |  68 ++++----
 .../skins/default/xui/pt/menu_viewer.xml      |  70 ++++-----
 .../skins/default/xui/ru/menu_viewer.xml      |  72 ++++-----
 .../skins/default/xui/tr/menu_viewer.xml      |  72 ++++-----
 .../skins/default/xui/zh/menu_viewer.xml      |  70 ++++-----
 12 files changed, 336 insertions(+), 587 deletions(-)

diff --git a/indra/newview/skins/default/xui/da/menu_viewer.xml b/indra/newview/skins/default/xui/da/menu_viewer.xml
index ba183066865..d695cd1f896 100644
--- a/indra/newview/skins/default/xui/da/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/da/menu_viewer.xml
@@ -20,8 +20,6 @@
 			<menu_item_call label="Væk" name="Set Away"/>
 			<menu_item_call label="Optaget" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Anmod om administrator status" name="Request Admin Options"/>
-		<menu_item_call label="Stop administrator status" name="Leave Admin Options"/>
 		<menu_item_call label="Afslut [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Kommunikér" name="Communicate">
@@ -36,11 +34,10 @@
 		<menu_item_check label="Søg" name="Search"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
 		<menu_item_call label="Opret landemærke for dette sted" name="Create Landmark Here"/>
-		<menu label="Profil for sted" name="Land">
-			<menu_item_call label="Profil for sted" name="Place Profile"/>
-			<menu_item_call label="Om land" name="About Land"/>
-			<menu_item_call label="Region/Estate" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profil for sted" name="Place Profile"/>
+		<menu_item_call label="Om land" name="About Land"/>
+		<menu_item_call label="Region/Estate" name="Region/Estate"/>
 		<menu_item_call label="Køb dette land" name="Buy Land"/>
 		<menu_item_call label="Mit land" name="My Land"/>
 		<menu label="Vis" name="LandShow">
@@ -56,7 +53,7 @@
 		</menu>
 		<menu_item_call label="Teleport hjem" name="Teleport Home"/>
 		<menu_item_call label="Sæt dette sted som &apos;Hjem&apos;" name="Set Home to Here"/>
-		<menu label="Sol" name="Environment Settings">
+		<menu label="Sol" name="Sun">
 			<menu_item_call label="Solopgang" name="Sunrise"/>
 			<menu_item_call label="Middag" name="Noon"/>
 			<menu_item_call label="Solnedgang" name="Sunset"/>
@@ -155,22 +152,22 @@
 			<menu_item_check label="Vis muse-sigte" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Gengivelsestyper" name="Rendering Types">
-			<menu_item_check label="Simpel" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Træer" name="Tree"/>
-			<menu_item_check label="Avatarer" name="Character"/>
-			<menu_item_check label="Surface Patch" name="Surface Patch"/>
-			<menu_item_check label="Himmel" name="Sky"/>
-			<menu_item_check label="Vand" name="Water"/>
-			<menu_item_check label="Jord" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Græs" name="Grass"/>
-			<menu_item_check label="Skyer" name="Clouds"/>
-			<menu_item_check label="Partikler" name="Particles"/>
-			<menu_item_check label="Bump" name="Bump"/>
+			<menu_item_check label="Simpel" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Træer" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatarer" name="Rendering Type Character"/>
+			<menu_item_check label="Surface Patch" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Himmel" name="Rendering Type Sky"/>
+			<menu_item_check label="Vand" name="Rendering Type Water"/>
+			<menu_item_check label="Jord" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Græs" name="Rendering Type Grass"/>
+			<menu_item_check label="Skyer" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partikler" name="Rendering Type Particles"/>
+			<menu_item_check label="Bump" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Gengivelsesegenskaber" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Valgte" name="Selected"/>
 			<menu_item_check label="Fremhævede" name="Highlighted"/>
 			<menu_item_check label="Dynamiske teksturer" name="Dynamic Textures"/>
@@ -182,10 +179,7 @@
 		<menu_item_call label="Tøm gruppe cache" name="ClearGroupCache"/>
 		<menu_item_check label="Muse udjævning" name="Mouse Smoothing"/>
 		<menu label="Shortcuts" name="Shortcuts">
-			<menu_item_call label="Billede (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Søg" name="Search"/>
 			<menu_item_call label="Frigør taster" name="Release Keys"/>
-			<menu_item_call label="Sæt UI størrelse til standard" name="Set UI Size to Default"/>
 			<menu_item_check label="Vis avanceret menu (gammel genvej)" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Luk vindue" name="Close Window"/>
 			<menu_item_call label="Luk alle vinduer" name="Close All Windows"/>
@@ -194,13 +188,6 @@
 			<menu_item_check label="&quot;Joystick Flycam&quot;" name="Joystick Flycam"/>
 			<menu_item_call label="Nulstil udsyn" name="Reset View"/>
 			<menu_item_call label="Se på den sidste der chattede" name="Look at Last Chatter"/>
-			<menu label="Vælg byggeværktøj" name="Select Tool">
-				<menu_item_call label="Fokuseringsværktøj" name="Focus"/>
-				<menu_item_call label="Flyt værktøj" name="Move"/>
-				<menu_item_call label="Redigeringsværktøj" name="Edit"/>
-				<menu_item_call label="Opret værktøj" name="Create"/>
-				<menu_item_call label="Land værktøj" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoom ind" name="Zoom In"/>
 			<menu_item_call label="Zoom standard" name="Zoom Default"/>
 			<menu_item_call label="Zoom ud" name="Zoom Out"/>
@@ -276,9 +263,8 @@
 			<menu_item_call label="Mist en netværkspakke" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Stød, skub &amp; slag" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Verden" name="World">
+		<menu label="Verden" name="DevelopWorld">
 			<menu_item_check label="Vælg anden sol end region" name="Sim Sun Override"/>
-			<menu_item_check label="Pejlelys blink effekt" name="Cheesy Beacon"/>
 			<menu_item_check label="Fast vejr" name="Fixed Weather"/>
 			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
 		</menu>
@@ -300,11 +286,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Hovede" name="Head"/>
-				<menu_item_call label="Overkrop" name="Upper Body"/>
-				<menu_item_call label="Underkrop" name="Lower Body"/>
-				<menu_item_call label="Nederdel" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Hovede" name="Grab Head"/>
+				<menu_item_call label="Overkrop" name="Grab Upper Body"/>
+				<menu_item_call label="Underkrop" name="Grab Lower Body"/>
+				<menu_item_call label="Nederdel" name="Grab Skirt"/>
 			</menu>
 			<menu label="Avatar tests" name="Character Tests">
 				<menu_item_call label="Skift avatar geometri" name="Toggle Character Geometry"/>
@@ -326,8 +312,8 @@
 		<menu_item_check label="Vis administrationsmenu" name="View Admin Options"/>
 	</menu>
 	<menu label="Administrér" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Tag kopi" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Tag kopi" name="Admin Take Copy"/>
 			<menu_item_call label="Gennemtving ejer til mig" name="Force Owner To Me"/>
 			<menu_item_call label="Gennemtving ejer tolerance" name="Force Owner Permissive"/>
 			<menu_item_call label="Slet" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index 90b2cfbc41d..23412938047 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -19,8 +19,6 @@
 			<menu_item_call label="Abwesend" name="Set Away"/>
 			<menu_item_call label="Beschäftigt" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Admin-Status anfordern" name="Request Admin Options"/>
-		<menu_item_call label="Admin-Status verlassen" name="Leave Admin Options"/>
 		<menu_item_call label="L$ kaufen" name="Buy and Sell L$"/>
 		<menu_item_call label="Einstellungen..." name="Preferences"/>
 		<menu_item_call label="Symbolleisten..." name="Toolbars"/>
@@ -40,11 +38,10 @@
 		<menu_item_check label="Suchen" name="Search"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
 		<menu_item_call label="Landmarke für diesen Ort setzen" name="Create Landmark Here"/>
-		<menu label="Ortsprofil" name="Land">
-			<menu_item_call label="Ortsprofil" name="Place Profile"/>
-			<menu_item_call label="Land-Info" name="About Land"/>
-			<menu_item_call label="Region/Grundbesitz" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Ortsprofil" name="Place Profile"/>
+		<menu_item_call label="Land-Info" name="About Land"/>
+		<menu_item_call label="Region/Grundbesitz" name="Region/Estate"/>
 		<menu_item_call label="Dieses Land kaufen" name="Buy Land"/>
 		<menu_item_call label="Mein Land" name="My Land"/>
 		<menu label="Anzeigen" name="LandShow">
@@ -60,14 +57,14 @@
 		</menu>
 		<menu_item_call label="Teleport nach Hause" name="Teleport Home"/>
 		<menu_item_call label="Hier als Zuhause wählen" name="Set Home to Here"/>
-		<menu label="Sonne" name="Environment Settings">
+		<menu label="Sonne" name="Sun">
 			<menu_item_call label="Sonnenaufgang" name="Sunrise"/>
 			<menu_item_call label="Mittag" name="Noon"/>
 			<menu_item_call label="Sonnenuntergang" name="Sunset"/>
 			<menu_item_call label="Mitternacht" name="Midnight"/>
 		</menu>
 		<menu label="Umgebungs-Editor" name="Enviroment Editor">
-			<menu_item_call label="Umgebungseinstellungen..." name="Enviroment Settings"/>
+			<menu_item_call label="Umgebungseinstellungen..." name="Environment Settings"/>
 			<menu label="Wasser-Voreinstellungen" name="Water Presets">
 				<menu_item_call label="Neue Voreinstellung..." name="new_water_preset"/>
 				<menu_item_call label="Voreinstellung bearbeiten..." name="edit_water_preset"/>
@@ -173,22 +170,22 @@
 			<menu_item_check label="Fadenkreuz für Mouselook anzeigen" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Darstellungstypen" name="Rendering Types">
-			<menu_item_check label="Einfach" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Baum" name="Tree"/>
-			<menu_item_check label="Avatare" name="Character"/>
-			<menu_item_check label="Flächenpatch" name="Surface Patch"/>
-			<menu_item_check label="Himmel" name="Sky"/>
-			<menu_item_check label="Wasser" name="Water"/>
-			<menu_item_check label="Boden" name="Ground"/>
-			<menu_item_check label="Volumen" name="Volume"/>
-			<menu_item_check label="Gras" name="Grass"/>
-			<menu_item_check label="Wolken" name="Clouds"/>
-			<menu_item_check label="Partikel" name="Particles"/>
-			<menu_item_check label="Unebenheiten" name="Bump"/>
+			<menu_item_check label="Einfach" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Baum" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatare" name="Rendering Type Character"/>
+			<menu_item_check label="Flächenpatch" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Himmel" name="Rendering Type Sky"/>
+			<menu_item_check label="Wasser" name="Rendering Type Water"/>
+			<menu_item_check label="Boden" name="Rendering Type Ground"/>
+			<menu_item_check label="Volumen" name="Rendering Type Volume"/>
+			<menu_item_check label="Gras" name="Rendering Type Grass"/>
+			<menu_item_check label="Wolken" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partikel" name="Rendering Type Particles"/>
+			<menu_item_check label="Unebenheiten" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Rendering-Eigenschaften" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Ausgewählt" name="Selected"/>
 			<menu_item_check label="Farblich hervorgehoben" name="Highlighted"/>
 			<menu_item_check label="Dynamische Texturen" name="Dynamic Textures"/>
@@ -201,10 +198,7 @@
 		<menu_item_call label="Gruppen-Cache löschen" name="ClearGroupCache"/>
 		<menu_item_check label="Weiche Mausbewegung" name="Mouse Smoothing"/>
 		<menu label="Tastaturkürzel" name="Shortcuts">
-			<menu_item_call label="Bild ([COST] L$)..." name="Upload Image"/>
-			<menu_item_check label="Suchen" name="Search"/>
 			<menu_item_call label="Tasten freigeben" name="Release Keys"/>
-			<menu_item_call label="UI-Größe auf Standard setzen" name="Set UI Size to Default"/>
 			<menu_item_check label="Erweitert-Menü anzeigen - veraltetet" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fenster schließen" name="Close Window"/>
 			<menu_item_call label="Alle Fenster schließen" name="Close All Windows"/>
@@ -213,13 +207,6 @@
 			<menu_item_check label="Joystick-Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Ansicht zurücksetzen" name="Reset View"/>
 			<menu_item_call label="Letzten Chatter ansehen" name="Look at Last Chatter"/>
-			<menu label="Bauwerkzeug auswählen" name="Select Tool">
-				<menu_item_call label="Fokus-Werkzeug" name="Focus"/>
-				<menu_item_call label="Werkzeug „Bewegen“" name="Move"/>
-				<menu_item_call label="Bearbeiten" name="Edit"/>
-				<menu_item_call label="Werkzeug „Erstellen&quot;" name="Create"/>
-				<menu_item_call label="Land-Werkzeug" name="Land"/>
-			</menu>
 			<menu_item_call label="Hineinzoomen" name="Zoom In"/>
 			<menu_item_call label="Zoom-Standard" name="Zoom Default"/>
 			<menu_item_call label="Wegzoomen" name="Zoom Out"/>
@@ -333,9 +320,8 @@
 			<menu_item_call label="Aufnahme starten" name="Start Record"/>
 			<menu_item_call label="Aufnahme stoppen" name="Stop Record"/>
 		</menu>
-		<menu label="Welt" name="World">
+		<menu label="Welt" name="DevelopWorld">
 			<menu_item_check label="Sonnen-Override für Sim" name="Sim Sun Override"/>
-			<menu_item_check label="Pulsierender Strahl" name="Cheesy Beacon"/>
 			<menu_item_check label="Festgelegtes Wetter" name="Fixed Weather"/>
 			<menu_item_call label="Regionsobjekt-Cache ausgeben" name="Dump Region Object Cache"/>
 		</menu>
@@ -367,11 +353,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Geladene Textur nehmen" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Kopf" name="Head"/>
-				<menu_item_call label="Oberkörper" name="Upper Body"/>
-				<menu_item_call label="Unterkörper" name="Lower Body"/>
-				<menu_item_call label="Rock" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Kopf" name="Grab Head"/>
+				<menu_item_call label="Oberkörper" name="Grab Upper Body"/>
+				<menu_item_call label="Unterkörper" name="Grab Lower Body"/>
+				<menu_item_call label="Rock" name="Grab Skirt"/>
 			</menu>
 			<menu label="Avatar-Tests" name="Character Tests">
 				<menu_item_call label="Aussehen als XML speichern" name="Appearance To XML"/>
@@ -406,8 +392,8 @@
 		<menu_item_check label="Admin-Menü anzeigen" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Kopie nehmen" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Kopie nehmen" name="Admin Take Copy"/>
 			<menu_item_call label="Besitzer zu mir zwingen" name="Force Owner To Me"/>
 			<menu_item_call label="Erlaubnis des Besitzers erzwingen" name="Force Owner Permissive"/>
 			<menu_item_call label="Löschen" name="Delete"/>
@@ -443,7 +429,7 @@
 			<menu_item_call label="Physik" name="Physics"/>
 			<menu_item_call label="Alle Kleider" name="All Clothes"/>
 		</menu>
-		<menu label="Hilfe" name="Help">
+		<menu label="Hilfe" name="DeprecatedHelp">
 			<menu_item_call label="Offizielles Linden-Blog" name="Official Linden Blog"/>
 			<menu_item_call label="Scripting-Portal" name="Scripting Portal"/>
 			<menu label="Fehlermeldungen" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 7d0ab33b662..3767560044d 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -118,7 +118,7 @@
         </menu_item_call>
         <menu_item_call
          label="Walk / run / fly..."
-         name="Stop Animating My Avatar">
+         name="Walk / run / fly">
           <menu_item_call.on_click
            function="Floater.ToggleOrBringToFront"
            parameter="moveview" />
@@ -144,23 +144,6 @@
         </menu_item_call>
       </menu>
 
-      <menu_item_call
-       label="Request Admin Status"
-       name="Request Admin Options"
-       shortcut="control|alt|G"
-       visible="false">
-        <menu_item_call.on_click
-         function="Advanced.RequestAdminStatus" />
-      </menu_item_call>
-      <menu_item_call
-       label="Leave Admin Status"
-       name="Leave Admin Options"
-       shortcut="control|alt|shift|G"
-       visible="false">
-        <menu_item_call.on_click
-         function="Advanced.LeaveAdminStatus" />
-      </menu_item_call>
-
       <menu_item_separator/>
 
       <menu_item_call
@@ -525,7 +508,7 @@
         <menu
          create_jump_keys="true"
          label="Sun"
-         name="Environment Settings"
+         name="Sun"
          tear_off="true">
             <menu_item_call
              label="Sunrise"
@@ -1452,7 +1435,7 @@
          tear_off="true">
             <menu_item_check
              label="Simple"
-             name="Simple"
+             name="Rendering Type Simple"
              shortcut="control|alt|shift|1">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1463,7 +1446,7 @@
             </menu_item_check>
             <menu_item_check
              label="Alpha"
-             name="Alpha"
+             name="Rendering Type Alpha"
              shortcut="control|alt|shift|2">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1474,7 +1457,7 @@
             </menu_item_check>
             <menu_item_check
              label="Tree"
-             name="Tree"
+             name="Rendering Type Tree"
              shortcut="control|alt|shift|3">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1485,7 +1468,7 @@
             </menu_item_check>
             <menu_item_check
              label="Avatars"
-             name="Character"
+             name="Rendering Type Character"
              shortcut="control|alt|shift|4">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1496,7 +1479,7 @@
             </menu_item_check>
             <menu_item_check
              label="Surface Patch"
-             name="Surface Patch"
+             name="Rendering Type Surface Patch"
              shortcut="control|alt|shift|5">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1507,7 +1490,7 @@
             </menu_item_check>
             <menu_item_check
              label="Sky"
-             name="Sky"
+             name="Rendering Type Sky"
              shortcut="control|alt|shift|6">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1518,7 +1501,7 @@
             </menu_item_check>
             <menu_item_check
              label="Water"
-             name="Water"
+             name="Rendering Type Water"
              shortcut="control|alt|shift|7">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1529,7 +1512,7 @@
             </menu_item_check>
             <menu_item_check
              label="Ground"
-             name="Ground"
+             name="Rendering Type Ground"
              shortcut="control|alt|shift|8">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1540,7 +1523,7 @@
             </menu_item_check>
             <menu_item_check
              label="Volume"
-             name="Volume"
+             name="Rendering Type Volume"
              shortcut="control|alt|shift|9">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1551,7 +1534,7 @@
             </menu_item_check>
             <menu_item_check
              label="Grass"
-             name="Grass"
+             name="Rendering Type Grass"
              shortcut="control|alt|shift|0">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1562,7 +1545,7 @@
             </menu_item_check>
             <menu_item_check
              label="Clouds"
-             name="Clouds"
+             name="Rendering Type Clouds"
              shortcut="control|alt|shift|-">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1573,7 +1556,7 @@
             </menu_item_check>
             <menu_item_check
              label="Particles"
-             name="Particles"
+             name="Rendering Type Particles"
              shortcut="control|alt|shift|=">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1584,7 +1567,7 @@
             </menu_item_check>
             <menu_item_check
              label="Bump"
-             name="Bump"
+             name="Rendering Type Bump"
              shortcut="control|alt|shift|\">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1601,7 +1584,7 @@
          tear_off="true">
             <menu_item_check
              label="UI"
-             name="UI"
+             name="ToggleUI"
              shortcut="control|alt|F1">
                 <menu_item_check.on_check
                  function="Advanced.CheckFeature"
@@ -1734,28 +1717,6 @@
          name="Shortcuts"
          tear_off="true"
          visible="false">
-          <menu_item_call
-             label="Image (L$[COST])..."
-             name="Upload Image"
-             shortcut="control|U">
-            <menu_item_call.on_click
-               function="File.UploadImage"
-               parameter="" />
-            <menu_item_call.on_enable
-               function="File.EnableUpload" />
-            </menu_item_call>
-            <menu_item_check
-               label="Search"
-               name="Search"
-               shortcut="control|F">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="search" />
-            <menu_item_check.on_click
-             function="Floater.Toggle"
-             parameter="search" />
-            </menu_item_check>
-
             <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
             <menu_item_check
                label="Show Advanced Menu - legacy shortcut"
@@ -1842,55 +1803,6 @@
 
             <menu_item_separator/>
 
-            <menu
-             create_jump_keys="true"
-             label="Select Build Tool"
-             name="Select Tool"
-             tear_off="true">
-                <menu_item_call
-                 label="Focus Tool"
-                 name="Focus"
-                 shortcut="control|1">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="focus" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Move Tool"
-                 name="Move"
-                 shortcut="control|2">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="move" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Edit Tool"
-                 name="Edit"
-                 shortcut="control|3">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="edit" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Create Tool"
-                 name="Create"
-                 shortcut="control|4">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="create" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Land Tool"
-                 name="Land"
-                 shortcut="control|5">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="land" />
-                </menu_item_call>
-            </menu>
-
-            <menu_item_separator/>
-
             <menu_item_call
              label="Zoom In"
              name="Zoom In"
@@ -2853,7 +2765,7 @@
         <menu
          create_jump_keys="true"
          label="World"
-         name="World"
+         name="DevelopWorld"
          tear_off="true">
             <menu_item_check
              label="Sim Sun Override"
@@ -2865,16 +2777,6 @@
                  function="ToggleControl"
                  parameter="SkyOverrideSimSunPosition" />
             </menu_item_check>
-            <menu_item_check
-             label="Cheesy Beacon"
-             name="Cheesy Beacon">
-                <menu_item_check.on_check
-                 function="CheckControl"
-                 parameter="CheesyBeacon" />
-                <menu_item_check.on_click
-                 function="ToggleControl"
-                 parameter="CheesyBeacon" />
-            </menu_item_check>
             <menu_item_check
              label="Fixed Weather"
              name="Fixed Weather">
@@ -3099,7 +3001,7 @@
              tear_off="true">
                 <menu_item_call
                  label="Iris"
-                 name="Iris">
+                 name="Grab Iris">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="iris" />
@@ -3109,7 +3011,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Head"
-                 name="Head">
+                 name="Grab Head">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="head" />
@@ -3119,7 +3021,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Upper Body"
-                 name="Upper Body">
+                 name="Grab Upper Body">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="upper" />
@@ -3129,7 +3031,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Lower Body"
-                 name="Lower Body">
+                 name="Grab Lower Body">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="lower" />
@@ -3139,7 +3041,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Skirt"
-                 name="Skirt">
+                 name="Grab Skirt">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="skirt" />
@@ -3407,10 +3309,11 @@
         <menu
          create_jump_keys="true"
          label="Object"
+         name="AdminObject"
          tear_off="true">
             <menu_item_call
              label="Take Copy"
-             name="Take Copy"
+             name="Admin Take Copy"
              shortcut="control|alt|shift|O">
                 <menu_item_call.on_click
                  function="Admin.ForceTakeCopy" />
@@ -3679,7 +3582,7 @@
         <menu
          create_jump_keys="true"
          label="Help"
-         name="Help"
+         name="DeprecatedHelp"
          tear_off="true">
             <menu_item_call
              label="Official Linden Blog"
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index f5cc2b9389e..635ed58a6f3 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -19,8 +19,6 @@
 			<menu_item_call label="Ausente" name="Set Away"/>
 			<menu_item_call label="Ocupado" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Solicitar estatus de Administrador" name="Request Admin Options"/>
-		<menu_item_call label="Dejar el estatus de Administrador" name="Leave Admin Options"/>
 		<menu_item_call label="Comprar L$" name="Buy and Sell L$"/>
 		<menu_item_call label="Preferencias..." name="Preferences"/>
 		<menu_item_call label="Barras de herramientas..." name="Toolbars"/>
@@ -40,11 +38,10 @@
 		<menu_item_check label="Buscar" name="Search"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
 		<menu_item_call label="Crear un hito de este sitio" name="Create Landmark Here"/>
-		<menu label="Perfil del lugar" name="Land">
-			<menu_item_call label="Perfil del lugar" name="Place Profile"/>
-			<menu_item_call label="Acerca del terreno" name="About Land"/>
-			<menu_item_call label="Región/Estado" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Perfil del lugar" name="Place Profile"/>
+		<menu_item_call label="Acerca del terreno" name="About Land"/>
+		<menu_item_call label="Región/Estado" name="Region/Estate"/>
 		<menu_item_call label="Comprar este terreno" name="Buy Land"/>
 		<menu_item_call label="Mi terreno" name="My Land"/>
 		<menu label="Mostrar" name="LandShow">
@@ -60,14 +57,14 @@
 		</menu>
 		<menu_item_call label="Teleportar a la Base" name="Teleport Home"/>
 		<menu_item_call label="Fijar mi Base aquí" name="Set Home to Here"/>
-		<menu label="Sol" name="Environment Settings">
+		<menu label="Sol" name="Sun">
 			<menu_item_call label="Amanecer" name="Sunrise"/>
 			<menu_item_call label="Mediodía" name="Noon"/>
 			<menu_item_call label="Atardecer" name="Sunset"/>
 			<menu_item_call label="Medianoche" name="Midnight"/>
 		</menu>
 		<menu label="Editor de entorno" name="Enviroment Editor">
-			<menu_item_call label="Configuración de entorno..." name="Enviroment Settings"/>
+			<menu_item_call label="Configuración de entorno..." name="Environment Settings"/>
 			<menu label="Agua predefinida" name="Water Presets">
 				<menu_item_call label="Nuevo predefinido..." name="new_water_preset"/>
 				<menu_item_call label="Editar predefinido..." name="edit_water_preset"/>
@@ -173,22 +170,22 @@
 			<menu_item_check label="Mostrar el Punto de Mira en la vista subjetiva" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Objetos representados" name="Rendering Types">
-			<menu_item_check label="Simple" name="Simple"/>
-			<menu_item_check label="Alfa" name="Alpha"/>
-			<menu_item_check label="Árbol" name="Tree"/>
-			<menu_item_check label="Avatares" name="Character"/>
-			<menu_item_check label="Parche de superficie" name="Surface Patch"/>
-			<menu_item_check label="Cielo" name="Sky"/>
-			<menu_item_check label="Agua" name="Water"/>
-			<menu_item_check label="Terreno" name="Ground"/>
-			<menu_item_check label="volumen" name="Volume"/>
-			<menu_item_check label="Hierba" name="Grass"/>
-			<menu_item_check label="Nubes" name="Clouds"/>
-			<menu_item_check label="Partículas" name="Particles"/>
-			<menu_item_check label="Efectos de relieve" name="Bump"/>
+			<menu_item_check label="Simple" name="Rendering Type Simple"/>
+			<menu_item_check label="Alfa" name="Rendering Type Alpha"/>
+			<menu_item_check label="Árbol" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatares" name="Rendering Type Character"/>
+			<menu_item_check label="Parche de superficie" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Cielo" name="Rendering Type Sky"/>
+			<menu_item_check label="Agua" name="Rendering Type Water"/>
+			<menu_item_check label="Terreno" name="Rendering Type Ground"/>
+			<menu_item_check label="volumen" name="Rendering Type Volume"/>
+			<menu_item_check label="Hierba" name="Rendering Type Grass"/>
+			<menu_item_check label="Nubes" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partículas" name="Rendering Type Particles"/>
+			<menu_item_check label="Efectos de relieve" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Rasgos renderizados" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Seleccionado" name="Selected"/>
 			<menu_item_check label="Realzados" name="Highlighted"/>
 			<menu_item_check label="Texturas dinámicas" name="Dynamic Textures"/>
@@ -200,10 +197,7 @@
 		<menu_item_call label="Vaciar la caché de grupo" name="ClearGroupCache"/>
 		<menu_item_check label="Vista subjetiva suavizada" name="Mouse Smoothing"/>
 		<menu label="Atajos de teclado" name="Shortcuts">
-			<menu_item_call label="Imagen ([COST] L$)..." name="Upload Image"/>
-			<menu_item_check label="Buscar" name="Search"/>
 			<menu_item_call label="Recuperar las teclas" name="Release Keys"/>
-			<menu_item_call label="Interfaz en el tamaño predeterminado" name="Set UI Size to Default"/>
 			<menu_item_check label="Mostrar el menú Avanzado - acceso directo antiguo" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Cerrar la ventana" name="Close Window"/>
 			<menu_item_call label="Cerrar todas las ventanas" name="Close All Windows"/>
@@ -212,13 +206,6 @@
 			<menu_item_check label="Flycam del joystick" name="Joystick Flycam"/>
 			<menu_item_call label="Volver a la vista por defecto" name="Reset View"/>
 			<menu_item_call label="Mirar al último que habló" name="Look at Last Chatter"/>
-			<menu label="Seleccionar la herramienta de construcción" name="Select Tool">
-				<menu_item_call label="Herramienta Visión" name="Focus"/>
-				<menu_item_call label="Herramienta Mover" name="Move"/>
-				<menu_item_call label="Herramienta Editar" name="Edit"/>
-				<menu_item_call label="Herramienta Crear" name="Create"/>
-				<menu_item_call label="Herramienta Terreno" name="Land"/>
-			</menu>
 			<menu_item_call label="Acercar el zoom" name="Zoom In"/>
 			<menu_item_call label="Zoom por defecto" name="Zoom Default"/>
 			<menu_item_call label="Alejar el zoom" name="Zoom Out"/>
@@ -296,9 +283,8 @@
 			<menu_item_call label="Drop a Packet" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Bumps, Pushes &amp; Hits" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="World" name="World">
+		<menu label="World" name="DevelopWorld">
 			<menu_item_check label="Region Sun Override" name="Sim Sun Override"/>
-			<menu_item_check label="Beacon flashing effect" name="Cheesy Beacon"/>
 			<menu_item_check label="Fixed Weather" name="Fixed Weather"/>
 			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
 		</menu>
@@ -320,11 +306,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Head" name="Head"/>
-				<menu_item_call label="Upper Body" name="Upper Body"/>
-				<menu_item_call label="Lower Body" name="Lower Body"/>
-				<menu_item_call label="Skirt" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Head" name="Grab Head"/>
+				<menu_item_call label="Upper Body" name="Grab Upper Body"/>
+				<menu_item_call label="Lower Body" name="Grab Lower Body"/>
+				<menu_item_call label="GrabSkirt" name="Grab Skirt"/>
 			</menu>
 			<menu label="Character Tests" name="Character Tests">
 				<menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/>
@@ -346,8 +332,8 @@
 		<menu_item_check label="Show Admin Menu" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Coger una copia" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Coger una copia" name="Admin Take Copy"/>
 			<menu_item_call label="Force Owner To Me" name="Force Owner To Me"/>
 			<menu_item_call label="Force Owner Permissive" name="Force Owner Permissive"/>
 			<menu_item_call label="Eliminar" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index d3b48639e02..1640026c9d0 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -19,8 +19,6 @@
 			<menu_item_call label="Absent" name="Set Away"/>
 			<menu_item_call label="Occupé" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Demander le statut Admin" name="Request Admin Options"/>
-		<menu_item_call label="Quitter le statut Admin" name="Leave Admin Options"/>
 		<menu_item_call label="Acheter des L$" name="Buy and Sell L$"/>
 		<menu_item_call label="Préférences..." name="Preferences"/>
 		<menu_item_call label="Barres d&apos;outils..." name="Toolbars"/>
@@ -40,11 +38,10 @@
 		<menu_item_check label="Rechercher" name="Search"/>
 		<menu_item_call label="Photo" name="Take Snapshot"/>
 		<menu_item_call label="Créer un repère pour ce lieu" name="Create Landmark Here"/>
-		<menu label="Profil du lieu" name="Land">
-			<menu_item_call label="Profil du lieu" name="Place Profile"/>
-			<menu_item_call label="À propos du terrain" name="About Land"/>
-			<menu_item_call label="Région/Domaine" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profil du lieu" name="Place Profile"/>
+		<menu_item_call label="À propos du terrain" name="About Land"/>
+		<menu_item_call label="Région/Domaine" name="Region/Estate"/>
 		<menu_item_call label="Acheter ce terrain" name="Buy Land"/>
 		<menu_item_call label="Mes terrains" name="My Land"/>
 		<menu label="Afficher" name="LandShow">
@@ -60,14 +57,14 @@
 		</menu>
 		<menu_item_call label="Me téléporter chez moi" name="Teleport Home"/>
 		<menu_item_call label="Définir le domicile ici" name="Set Home to Here"/>
-		<menu label="Luminosité" name="Environment Settings">
+		<menu label="Luminosité" name="Sun">
 			<menu_item_call label="Aube" name="Sunrise"/>
 			<menu_item_call label="Milieu de journée" name="Noon"/>
 			<menu_item_call label="Coucher de soleil" name="Sunset"/>
 			<menu_item_call label="Minuit" name="Midnight"/>
 		</menu>
 		<menu label="Éditeur d&apos;environnement" name="Enviroment Editor">
-			<menu_item_call label="Paramètres d&apos;environnement..." name="Enviroment Settings"/>
+			<menu_item_call label="Paramètres d&apos;environnement..." name="Environment Settings"/>
 			<menu label="Préréglages de l&apos;eau" name="Water Presets">
 				<menu_item_call label="Nouveau préréglage..." name="new_water_preset"/>
 				<menu_item_call label="Modifier un préréglage..." name="edit_water_preset"/>
@@ -173,22 +170,22 @@
 			<menu_item_check label="Afficher le réticule de la vue subjective" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Types de rendu" name="Rendering Types">
-			<menu_item_check label="Simple" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Arbre" name="Tree"/>
-			<menu_item_check label="Avatars" name="Character"/>
-			<menu_item_check label="Patch de surface" name="Surface Patch"/>
-			<menu_item_check label="Ciel" name="Sky"/>
-			<menu_item_check label="Eau" name="Water"/>
-			<menu_item_check label="Sol" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Herbe" name="Grass"/>
-			<menu_item_check label="Nuages" name="Clouds"/>
-			<menu_item_check label="Particules" name="Particles"/>
-			<menu_item_check label="Placage de relief" name="Bump"/>
+			<menu_item_check label="Simple" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Arbre" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatars" name="Rendering Type Character"/>
+			<menu_item_check label="Patch de surface" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Ciel" name="Rendering Type Sky"/>
+			<menu_item_check label="Eau" name="Rendering Type Water"/>
+			<menu_item_check label="Sol" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Herbe" name="Rendering Type Grass"/>
+			<menu_item_check label="Nuages" name="Rendering Type Clouds"/>
+			<menu_item_check label="Particules" name="Rendering Type Particles"/>
+			<menu_item_check label="Placage de relief" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Fonctionnalités de rendu" name="Rendering Features">
-			<menu_item_check label="Interface" name="UI"/>
+			<menu_item_check label="Interface" name="ToggleUI"/>
 			<menu_item_check label="Sélection" name="Selected"/>
 			<menu_item_check label="En surbrillance" name="Highlighted"/>
 			<menu_item_check label="Textures dynamiques" name="Dynamic Textures"/>
@@ -201,10 +198,7 @@
 		<menu_item_call label="Effacer le cache du groupe" name="ClearGroupCache"/>
 		<menu_item_check label="Effet de lissage de la souris" name="Mouse Smoothing"/>
 		<menu label="Raccourcis" name="Shortcuts">
-			<menu_item_call label="Image ([COST] L$)..." name="Upload Image"/>
-			<menu_item_check label="Rechercher" name="Search"/>
 			<menu_item_call label="Relâcher les touches" name="Release Keys"/>
-			<menu_item_call label="Taille de l&apos;interface par défaut" name="Set UI Size to Default"/>
 			<menu_item_check label="Afficher le menu Avancé - raccourci existant" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fermer la fenêtre" name="Close Window"/>
 			<menu_item_call label="Fermer toutes les fenêtres" name="Close All Windows"/>
@@ -213,13 +207,6 @@
 			<menu_item_check label="Joystick Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Réinitialiser la vue" name="Reset View"/>
 			<menu_item_call label="Regarder la dernière conversation" name="Look at Last Chatter"/>
-			<menu label="Sélectionner un outil de construction" name="Select Tool">
-				<menu_item_call label="Outil de mise au point" name="Focus"/>
-				<menu_item_call label="Outil de déplacement" name="Move"/>
-				<menu_item_call label="Outil de modification" name="Edit"/>
-				<menu_item_call label="Outil de création" name="Create"/>
-				<menu_item_call label="Outil Terrain" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoomer en avant" name="Zoom In"/>
 			<menu_item_call label="Zoom par défaut" name="Zoom Default"/>
 			<menu_item_call label="Zoomer en arrière" name="Zoom Out"/>
@@ -333,9 +320,8 @@
 			<menu_item_call label="Commencer l&apos;enregistrement" name="Start Record"/>
 			<menu_item_call label="Arrêter l&apos;enregistrement" name="Stop Record"/>
 		</menu>
-		<menu label="Monde" name="World">
+		<menu label="Monde" name="DevelopWorld">
 			<menu_item_check label="Ignorer les paramètres du soleil de la sim" name="Sim Sun Override"/>
-			<menu_item_check label="Balise animée" name="Cheesy Beacon"/>
 			<menu_item_check label="Météo fixe" name="Fixed Weather"/>
 			<menu_item_call label="Vidage de cache d&apos;objet de la région" name="Dump Region Object Cache"/>
 		</menu>
@@ -367,11 +353,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Récupérer la texture fixée" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Tête" name="Head"/>
-				<menu_item_call label="Haut du corps" name="Upper Body"/>
-				<menu_item_call label="Bas du corps" name="Lower Body"/>
-				<menu_item_call label="Jupe" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Tête" name="Grab Head"/>
+				<menu_item_call label="Haut du corps" name="Grab Upper Body"/>
+				<menu_item_call label="Bas du corps" name="Grab Lower Body"/>
+				<menu_item_call label="Jupe" name="Grab Skirt"/>
 			</menu>
 			<menu label="Tests personnages" name="Character Tests">
 				<menu_item_call label="Apparence dans XML" name="Appearance To XML"/>
@@ -406,8 +392,8 @@
 		<menu_item_check label="Afficher le menu Admin" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Prendre une copie" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Prendre une copie" name="Admin Take Copy"/>
 			<menu_item_call label="Téléporter le propriétaire" name="Force Owner To Me"/>
 			<menu_item_call label="Forcer la permission du propriétaire" name="Force Owner Permissive"/>
 			<menu_item_call label="Supprimer" name="Delete"/>
@@ -443,7 +429,7 @@
 			<menu_item_call label="Propriétés physiques" name="Physics"/>
 			<menu_item_call label="Tous les habits" name="All Clothes"/>
 		</menu>
-		<menu label="Aide" name="Help">
+		<menu label="Aide" name="DeprecatedHelp">
 			<menu_item_call label="Blog officiel des Linden" name="Official Linden Blog"/>
 			<menu_item_call label="Portail d&apos;écriture de scripts" name="Scripting Portal"/>
 			<menu label="Signaler des bugs" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index 8792a0fc195..2cccd4aa9f0 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -19,8 +19,6 @@
 			<menu_item_call label="Assente" name="Set Away"/>
 			<menu_item_call label="Non disponibile" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Richiedi diritti Admin" name="Request Admin Options"/>
-		<menu_item_call label="Lascia stato Admin" name="Leave Admin Options"/>
 		<menu_item_call label="Compra L$" name="Buy and Sell L$"/>
 		<menu_item_call label="Preferenze..." name="Preferences"/>
 		<menu_item_call label="Barre strumenti..." name="Toolbars"/>
@@ -40,11 +38,10 @@
 		<menu_item_check label="Cerca" name="Search"/>
 		<menu_item_call label="Istantanea" name="Take Snapshot"/>
 		<menu_item_call label="Crea punto di riferimento per questo luogo" name="Create Landmark Here"/>
-		<menu label="Profilo del luogo" name="Land">
-			<menu_item_call label="Profilo del luogo" name="Place Profile"/>
-			<menu_item_call label="Informazioni sui terreni" name="About Land"/>
-			<menu_item_call label="Regione/proprietà immobiliare" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profilo del luogo" name="Place Profile"/>
+		<menu_item_call label="Informazioni sui terreni" name="About Land"/>
+		<menu_item_call label="Regione/proprietà immobiliare" name="Region/Estate"/>
 		<menu_item_call label="Acquista questo terreno" name="Buy Land"/>
 		<menu_item_call label="Il mio terreno" name="My Land"/>
 		<menu label="Mostra" name="LandShow">
@@ -60,14 +57,14 @@
 		</menu>
 		<menu_item_call label="Teleport a Casa" name="Teleport Home"/>
 		<menu_item_call label="Imposta come Casa mia" name="Set Home to Here"/>
-		<menu label="Sole" name="Environment Settings">
+		<menu label="Sole" name="Sun">
 			<menu_item_call label="Alba" name="Sunrise"/>
 			<menu_item_call label="Mezzogiorno" name="Noon"/>
 			<menu_item_call label="Tramonto" name="Sunset"/>
 			<menu_item_call label="Mezzanotte" name="Midnight"/>
 		</menu>
 		<menu label="Editor ambiente" name="Enviroment Editor">
-			<menu_item_call label="Impostazioni ambiente..." name="Enviroment Settings"/>
+			<menu_item_call label="Impostazioni ambiente..." name="Environment Settings"/>
 			<menu label="Valori predefiniti acqua" name="Water Presets">
 				<menu_item_call label="Nuovo valore predefinito..." name="new_water_preset"/>
 				<menu_item_call label="Modifica valori predefiniti..." name="edit_water_preset"/>
@@ -173,22 +170,22 @@
 			<menu_item_check label="Mostra mirino visuale soggettiva" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Modalità di rendering" name="Rendering Types">
-			<menu_item_check label="Semplice" name="Simple"/>
-			<menu_item_check label="Alpha (Trasparenza)" name="Alpha"/>
-			<menu_item_check label="Albero" name="Tree"/>
-			<menu_item_check label="Avatar" name="Character"/>
-			<menu_item_check label="Superficie chiusa" name="Surface Patch"/>
-			<menu_item_check label="Cielo" name="Sky"/>
-			<menu_item_check label="Acqua" name="Water"/>
-			<menu_item_check label="Suolo" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Erba" name="Grass"/>
-			<menu_item_check label="Nuvole" name="Clouds"/>
-			<menu_item_check label="Particelle" name="Particles"/>
-			<menu_item_check label="Urti" name="Bump"/>
+			<menu_item_check label="Semplice" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha (Trasparenza)" name="Rendering Type Alpha"/>
+			<menu_item_check label="Albero" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatar" name="Rendering Type Character"/>
+			<menu_item_check label="Superficie chiusa" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Cielo" name="Rendering Type Sky"/>
+			<menu_item_check label="Acqua" name="Rendering Type Water"/>
+			<menu_item_check label="Suolo" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Erba" name="Rendering Type Grass"/>
+			<menu_item_check label="Nuvole" name="Rendering Type Clouds"/>
+			<menu_item_check label="Particelle" name="Rendering Type Particles"/>
+			<menu_item_check label="Urti" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Caratteristiche di rendering" name="Rendering Features">
-			<menu_item_check label="Interfaccia utente" name="UI"/>
+			<menu_item_check label="Interfaccia utente" name="ToggleUI"/>
 			<menu_item_check label="Selezionati" name="Selected"/>
 			<menu_item_check label="Evidenziato" name="Highlighted"/>
 			<menu_item_check label="Texture dinamiche" name="Dynamic Textures"/>
@@ -200,10 +197,7 @@
 		<menu_item_call label="Pulisci cache di gruppo" name="ClearGroupCache"/>
 		<menu_item_check label="Fluidità mouse" name="Mouse Smoothing"/>
 		<menu label="Scorciatoie" name="Shortcuts">
-			<menu_item_call label="Immagine ([COST]L$)..." name="Upload Image"/>
-			<menu_item_check label="Cerca" name="Search"/>
 			<menu_item_call label="Rilascia tasti" name="Release Keys"/>
-			<menu_item_call label="Imposta dimensioni dell&apos;interfaccia sui valori predefiniti" name="Set UI Size to Default"/>
 			<menu_item_check label="Mostra menu Avanzato - tasti di scelta rapida esistenti" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Chiudi finestra" name="Close Window"/>
 			<menu_item_call label="Chiudi tutte le finestre" name="Close All Windows"/>
@@ -212,13 +206,6 @@
 			<menu_item_check label="Joystick Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Reimposta vista" name="Reset View"/>
 			<menu_item_call label="Guarda l&apos;ultima conversazione" name="Look at Last Chatter"/>
-			<menu label="Seleziona strumento di costruzione" name="Select Tool">
-				<menu_item_call label="Strumento Ingrandisci" name="Focus"/>
-				<menu_item_call label="Strumento Movimento" name="Move"/>
-				<menu_item_call label="Strumento Modifica" name="Edit"/>
-				<menu_item_call label="Strumento Crea" name="Create"/>
-				<menu_item_call label="Strumento Terreno" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoom avanti" name="Zoom In"/>
 			<menu_item_call label="Zoom predefinito" name="Zoom Default"/>
 			<menu_item_call label="Zoom indietro" name="Zoom Out"/>
@@ -296,9 +283,8 @@
 			<menu_item_call label="Lascia un pacchetto" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Urti, spinte e contatti" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Mondo" name="World">
+		<menu label="Mondo" name="DevelopWorld">
 			<menu_item_check label="Esclusione al sole della regione" name="Sim Sun Override"/>
-			<menu_item_check label="Effetto marcatore lampeggiante" name="Cheesy Beacon"/>
 			<menu_item_check label="Clima fisso" name="Fixed Weather"/>
 			<menu_item_call label="Dump della cache oggetti regione" name="Dump Region Object Cache"/>
 		</menu>
@@ -320,11 +306,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iride" name="Iris"/>
-				<menu_item_call label="Testa" name="Head"/>
-				<menu_item_call label="Parte superiore del corpo" name="Upper Body"/>
-				<menu_item_call label="Parte inferiore del corpo" name="Lower Body"/>
-				<menu_item_call label="Gonna" name="Skirt"/>
+				<menu_item_call label="Iride" name="Grab Iris"/>
+				<menu_item_call label="Testa" name="Grab Head"/>
+				<menu_item_call label="Parte superiore del corpo" name="Grab Upper Body"/>
+				<menu_item_call label="Parte inferiore del corpo" name="Grab Lower Body"/>
+				<menu_item_call label="Gonna" name="Grab Skirt"/>
 			</menu>
 			<menu label="Test personaggio" name="Character Tests">
 				<menu_item_call label="Alterna la geometria dei personaggi" name="Toggle Character Geometry"/>
@@ -346,8 +332,8 @@
 		<menu_item_check label="Mostra menu Admin" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Prendi copia" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Prendi copia" name="Admin Take Copy"/>
 			<menu_item_call label="Rendimi proprietario" name="Force Owner To Me"/>
 			<menu_item_call label="Forza permesso proprietario" name="Force Owner Permissive"/>
 			<menu_item_call label="Elimina" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 125e9bb2267..1dc25791d3f 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -19,8 +19,6 @@
 			<menu_item_call label="一時退席中" name="Set Away"/>
 			<menu_item_call label="取り込み中" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="管理者権限のリクエスト" name="Request Admin Options"/>
-		<menu_item_call label="管理者ステータス解除" name="Leave Admin Options"/>
 		<menu_item_call label="L$ の購入" name="Buy and Sell L$"/>
 		<menu_item_call label="環境設定..." name="Preferences"/>
 		<menu_item_call label="ツールバー..." name="Toolbars"/>
@@ -40,11 +38,10 @@
 		<menu_item_check label="検索" name="Search"/>
 		<menu_item_call label="スナップショット" name="Take Snapshot"/>
 		<menu_item_call label="現在地をランドマーク" name="Create Landmark Here"/>
-		<menu label="場所のプロフィール" name="Land">
-			<menu_item_call label="場所のプロフィール" name="Place Profile"/>
-			<menu_item_call label="土地情報" name="About Land"/>
-			<menu_item_call label="地域 / 不動産" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="場所のプロフィール" name="Place Profile"/>
+		<menu_item_call label="土地情報" name="About Land"/>
+		<menu_item_call label="地域 / 不動産" name="Region/Estate"/>
 		<menu_item_call label="この土地を購入" name="Buy Land"/>
 		<menu_item_call label="自分の土地" name="My Land"/>
 		<menu label="表示" name="LandShow">
@@ -60,14 +57,14 @@
 		</menu>
 		<menu_item_call label="ホームにテレポート" name="Teleport Home"/>
 		<menu_item_call label="現在地をホームに設定" name="Set Home to Here"/>
-		<menu label="太陽" name="Environment Settings">
+		<menu label="太陽" name="Sun">
 			<menu_item_call label="日の出" name="Sunrise"/>
 			<menu_item_call label="正午" name="Noon"/>
 			<menu_item_call label="日没" name="Sunset"/>
 			<menu_item_call label="深夜" name="Midnight"/>
 		</menu>
 		<menu label="自然環境エディター" name="Enviroment Editor">
-			<menu_item_call label="環境の設定..." name="Enviroment Settings"/>
+			<menu_item_call label="環境の設定..." name="Environment Settings"/>
 			<menu label="水の事前設定" name="Water Presets">
 				<menu_item_call label="新しい事前設定..." name="new_water_preset"/>
 				<menu_item_call label="事前設定を編集..." name="edit_water_preset"/>
@@ -173,22 +170,22 @@
 			<menu_item_check label="一人称視点のときに十字線を表示する" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="レンダリング(種類)" name="Rendering Types">
-			<menu_item_check label="シンプル" name="Simple"/>
-			<menu_item_check label="アルファ" name="Alpha"/>
-			<menu_item_check label="木" name="Tree"/>
-			<menu_item_check label="アバター" name="Character"/>
-			<menu_item_check label="サーフェスパッチ" name="Surface Patch"/>
-			<menu_item_check label="空" name="Sky"/>
-			<menu_item_check label="æ°´" name="Water"/>
-			<menu_item_check label="地面" name="Ground"/>
-			<menu_item_check label="ボリューム" name="Volume"/>
-			<menu_item_check label="草" name="Grass"/>
-			<menu_item_check label="雲" name="Clouds"/>
-			<menu_item_check label="パーティクル" name="Particles"/>
-			<menu_item_check label="衝突" name="Bump"/>
+			<menu_item_check label="シンプル" name="Rendering Type Simple"/>
+			<menu_item_check label="アルファ" name="Rendering Type Alpha"/>
+			<menu_item_check label="木" name="Rendering Type Tree"/>
+			<menu_item_check label="アバター" name="Rendering Type Character"/>
+			<menu_item_check label="サーフェスパッチ" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="空" name="Rendering Type Sky"/>
+			<menu_item_check label="æ°´" name="Rendering Type Water"/>
+			<menu_item_check label="地面" name="Rendering Type Ground"/>
+			<menu_item_check label="ボリューム" name="Rendering Type Volume"/>
+			<menu_item_check label="草" name="Rendering Type Grass"/>
+			<menu_item_check label="雲" name="Rendering Type Clouds"/>
+			<menu_item_check label="パーティクル" name="Rendering Type Particles"/>
+			<menu_item_check label="衝突" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="レンダリング(機能)" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="選択済" name="Selected"/>
 			<menu_item_check label="ハイライト" name="Highlighted"/>
 			<menu_item_check label="ダイナミックテクスチャ" name="Dynamic Textures"/>
@@ -201,10 +198,7 @@
 		<menu_item_call label="グループキャッシュのクリア" name="ClearGroupCache"/>
 		<menu_item_check label="マウスの平滑化" name="Mouse Smoothing"/>
 		<menu label="ショートカット" name="Shortcuts">
-			<menu_item_call label="画像 (L$ [COST] )..." name="Upload Image"/>
-			<menu_item_check label="検索" name="Search"/>
 			<menu_item_call label="キーをリリース" name="Release Keys"/>
-			<menu_item_call label="UI のサイズをデフォルトに設定する" name="Set UI Size to Default"/>
 			<menu_item_check label="アドバンスメニューを表示 - レガシーのショートカット" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="ウィンドウを閉じる" name="Close Window"/>
 			<menu_item_call label="全てのウィンドウを閉じる" name="Close All Windows"/>
@@ -213,13 +207,6 @@
 			<menu_item_check label="ジョイスティックフライカム" name="Joystick Flycam"/>
 			<menu_item_call label="表示をリセットする" name="Reset View"/>
 			<menu_item_call label="最後の発言者を見る" name="Look at Last Chatter"/>
-			<menu label="制作ツールを選択する" name="Select Tool">
-				<menu_item_call label="焦点ツール" name="Focus"/>
-				<menu_item_call label="移動ツール" name="Move"/>
-				<menu_item_call label="編集ツール" name="Edit"/>
-				<menu_item_call label="作成ツール" name="Create"/>
-				<menu_item_call label="土地ツール" name="Land"/>
-			</menu>
 			<menu_item_call label="ズームイン" name="Zoom In"/>
 			<menu_item_call label="ズーム(デフォルト)" name="Zoom Default"/>
 			<menu_item_call label="ズームアウト" name="Zoom Out"/>
@@ -333,9 +320,8 @@
 			<menu_item_call label="記録開始" name="Start Record"/>
 			<menu_item_call label="記録停止" name="Stop Record"/>
 		</menu>
-		<menu label="世界" name="World">
+		<menu label="世界" name="DevelopWorld">
 			<menu_item_check label="シムの太陽の設定を無視する" name="Sim Sun Override"/>
-			<menu_item_check label="ビーコンを強調表示する" name="Cheesy Beacon"/>
 			<menu_item_check label="固定された天気" name="Fixed Weather"/>
 			<menu_item_call label="リージョンオブジェクトのキャッシュをダンプする" name="Dump Region Object Cache"/>
 		</menu>
@@ -367,11 +353,11 @@
 		</menu>
 		<menu label="アバター" name="Character">
 			<menu label="ベークドテクスチャを取得する" name="Grab Baked Texture">
-				<menu_item_call label="çž³" name="Iris"/>
-				<menu_item_call label="é ­" name="Head"/>
-				<menu_item_call label="上半身" name="Upper Body"/>
-				<menu_item_call label="下半身" name="Lower Body"/>
-				<menu_item_call label="スカート" name="Skirt"/>
+				<menu_item_call label="çž³" name="Grab Iris"/>
+				<menu_item_call label="é ­" name="Grab Head"/>
+				<menu_item_call label="上半身" name="Grab Upper Body"/>
+				<menu_item_call label="下半身" name="Grab Lower Body"/>
+				<menu_item_call label="スカート" name="Grab Skirt"/>
 			</menu>
 			<menu label="キャラクターテスト" name="Character Tests">
 				<menu_item_call label="容姿を XML に保存する" name="Appearance To XML"/>
@@ -406,8 +392,8 @@
 		<menu_item_check label="管理者メニューを表示する" name="View Admin Options"/>
 	</menu>
 	<menu label="管理者" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="コピーを取る" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="コピーを取る" name="Admin Take Copy"/>
 			<menu_item_call label="私を所有者にする" name="Force Owner To Me"/>
 			<menu_item_call label="所有者権限を実行する" name="Force Owner Permissive"/>
 			<menu_item_call label="削除" name="Delete"/>
@@ -443,7 +429,7 @@
 			<menu_item_call label="物理作用" name="Physics"/>
 			<menu_item_call label="すべての衣類" name="All Clothes"/>
 		</menu>
-		<menu label="ヘルプ" name="Help">
+		<menu label="ヘルプ" name="DeprecatedHelp">
 			<menu_item_call label="リンデン公式ブログ" name="Official Linden Blog"/>
 			<menu_item_call label="スクリプトポータル" name="Scripting Portal"/>
 			<menu label="バグの報告" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml
index c072ea9b5af..24c961fa265 100644
--- a/indra/newview/skins/default/xui/pl/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml
@@ -20,8 +20,6 @@
 			<menu_item_call label="Tryb oddalenia" name="Set Away"/>
 			<menu_item_call label="Tryb pracy" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Zażądaj statusu administratora" name="Request Admin Options"/>
-		<menu_item_call label="Wyłącz atatus administratora" name="Leave Admin Options"/>
 		<menu_item_call label="Wyłącz [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Komunikacja" name="Communicate">
@@ -36,11 +34,10 @@
 		<menu_item_check label="Szukaj" name="Search"/>
 		<menu_item_call label="Zrób zdjęcie" name="Take Snapshot"/>
 		<menu_item_call label="Zapamiętaj to miejsce (LM)" name="Create Landmark Here"/>
-		<menu label="Miejsce" name="Land">
-			<menu_item_call label="Profil miejsca" name="Place Profile"/>
-			<menu_item_call label="O posiadłości" name="About Land"/>
-			<menu_item_call label="Region/MajÄ…tek" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profil miejsca" name="Place Profile"/>
+		<menu_item_call label="O posiadłości" name="About Land"/>
+		<menu_item_call label="Region/MajÄ…tek" name="Region/Estate"/>
 		<menu_item_call label="Kup posiadłość" name="Buy Land"/>
 		<menu_item_call label="Moje posiadłości" name="My Land"/>
 		<menu label="Pokaż" name="LandShow">
@@ -56,7 +53,7 @@
 		</menu>
 		<menu_item_call label="Teleportuj do Miejsca Startu" name="Teleport Home"/>
 		<menu_item_call label="Ustaw Miejsce Startu" name="Set Home to Here"/>
-		<menu label="Słońce" name="Environment Settings">
+		<menu label="Słońce" name="Sun">
 			<menu_item_call label="Wschód Słońca" name="Sunrise"/>
 			<menu_item_call label="Południe" name="Noon"/>
 			<menu_item_call label="Zachód Słońca" name="Sunset"/>
@@ -153,22 +150,22 @@
 			<menu_item_check label="Pokaż celownik myszki" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Rodzaje renderowania" name="Rendering Types">
-			<menu_item_check label="Podstawowe" name="Simple"/>
-			<menu_item_check label="Maska alpha" name="Alpha"/>
-			<menu_item_check label="Drzewo" name="Tree"/>
-			<menu_item_check label="Awatary" name="Character"/>
-			<menu_item_check label="PÅ‚aszczyzna powierzchni" name="SurfacePath"/>
-			<menu_item_check label="Niebo" name="Sky"/>
-			<menu_item_check label="Woda" name="Water"/>
-			<menu_item_check label="Ziemia" name="Ground"/>
-			<menu_item_check label="Głośność" name="Volume"/>
-			<menu_item_check label="Trawa" name="Grass"/>
-			<menu_item_check label="Chmury" name="Clouds"/>
-			<menu_item_check label="CzÄ…steczki" name="Particles"/>
-			<menu_item_check label="Zderzenie" name="Bump"/>
+			<menu_item_check label="Podstawowe" name="Rendering Type Simple"/>
+			<menu_item_check label="Maska alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Drzewo" name="Rendering Type Tree"/>
+			<menu_item_check label="Awatary" name="Rendering Type Character"/>
+			<menu_item_check label="PÅ‚aszczyzna powierzchni" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Niebo" name="Rendering Type Sky"/>
+			<menu_item_check label="Woda" name="Rendering Type Water"/>
+			<menu_item_check label="Ziemia" name="Rendering Type Ground"/>
+			<menu_item_check label="Głośność" name="Rendering Type Volume"/>
+			<menu_item_check label="Trawa" name="Rendering Type Grass"/>
+			<menu_item_check label="Chmury" name="Rendering Type Clouds"/>
+			<menu_item_check label="CzÄ…steczki" name="Rendering Type Particles"/>
+			<menu_item_check label="Zderzenie" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Opcje renderowania" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Zaznaczone" name="Selected"/>
 			<menu_item_check label="Podświetlenie" name="Highlighted"/>
 			<menu_item_check label="Tekstury dynamiczne" name="Dynamic Textures"/>
@@ -180,10 +177,7 @@
 		<menu_item_call label="Wyczyść bufor danych grupy" name="ClearGroupCache"/>
 		<menu_item_check label="Wygładzanie ruchu myszki" name="Mouse Smoothing"/>
 		<menu label="Skróty" name="Shortcuts">
-			<menu_item_call label="Obraz (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Szukaj" name="Search"/>
 			<menu_item_call label="Zwolnij klawisze" name="Release Keys"/>
-			<menu_item_call label="Domyślne ustawienia rozmiaru interfejsu" name="Set UI Size to Default"/>
 			<menu_item_check label="Pokaż menu Zaawansowane - skrót" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Zamknij okno" name="Close Window"/>
 			<menu_item_call label="Zamknij wszystkie okna" name="Close All Windows"/>
@@ -192,13 +186,6 @@
 			<menu_item_check label="Wolna kamera" name="Joystick Flycam"/>
 			<menu_item_call label="Reset widoku" name="Reset View"/>
 			<menu_item_call label="Zobacz ostatniego rozmówcę" name="Look at Last Chatter"/>
-			<menu label="Wybierz narzędzie budowania" name="Select Tool">
-				<menu_item_call label="Narzędzie ogniskowej" name="Focus"/>
-				<menu_item_call label="Narzędzie ruchu" name="Move"/>
-				<menu_item_call label="Narzędzie edycji" name="Edit"/>
-				<menu_item_call label="Stwórz narzędzie" name="Create"/>
-				<menu_item_call label="Narzędzia posiadłości" name="Land"/>
-			</menu>
 			<menu_item_call label="Przybliż" name="Zoom In"/>
 			<menu_item_call label="Domyślne przybliżenie" name="Zoom Default"/>
 			<menu_item_call label="Oddal" name="Zoom Out"/>
@@ -267,9 +254,8 @@
 			<menu_item_call label="Upuść pakiet pamięci" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Zderzenia, popchnięcia &amp;  uderzenia" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Åšwiat" name="World">
+		<menu label="Åšwiat" name="DevelopWorld">
 			<menu_item_check label="Domyślne ustawienia środowiska Regionu" name="Sim Sun Override"/>
-			<menu_item_check label="Efekty emiterów" name="Cheesy Beacon"/>
 			<menu_item_check label="Ustalona pogoda" name="Fixed Weather"/>
 			<menu_item_call label="Zachowaj bufor pamięci obiektów regionu" name="Dump Region Object Cache"/>
 		</menu>
@@ -291,11 +277,11 @@
 		</menu>
 		<menu label="Awatar" name="Character">
 			<menu label="Przesuń bakowaną teksturę" name="Grab Baked Texture">
-				<menu_item_call label="Tęczówka oka" name="Iris"/>
-				<menu_item_call label="GÅ‚owa" name="Head"/>
-				<menu_item_call label="Górna część ciała" name="Upper Body"/>
-				<menu_item_call label="Dolna część ciała" name="Lower Body"/>
-				<menu_item_call label="Spódnica" name="Skirt"/>
+				<menu_item_call label="Tęczówka oka" name="Grab Iris"/>
+				<menu_item_call label="GÅ‚owa" name="Grab Head"/>
+				<menu_item_call label="Górna część ciała" name="Grab Upper Body"/>
+				<menu_item_call label="Dolna część ciała" name="Grab Lower Body"/>
+				<menu_item_call label="Spódnica" name="Grab Skirt"/>
 			</menu>
 			<menu label="Testy postaci" name="Character Tests">
 				<menu_item_call label="Przesuń geometrię postaci" name="Toggle Character Geometry"/>
@@ -316,8 +302,8 @@
 		<menu_item_check label="Pokaż menu administratora" name="View Admin Options"/>
 	</menu>
 	<menu label="Administrator" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Weź kopię" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Weź kopię" name="Admin Take Copy"/>
 			<menu_item_call label="Reset właściciela" name="Force Owner To Me"/>
 			<menu_item_call label="Reset przyzwolenia właściciela" name="Force Owner Permissive"/>
 			<menu_item_call label="Usuń" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index 5ff2d49ac1a..9ce55c6415e 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -19,8 +19,6 @@
 			<menu_item_call label="Ausente" name="Set Away"/>
 			<menu_item_call label="Ocupado" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Request Admin Status" name="Request Admin Options"/>
-		<menu_item_call label="Sair do modo admin" name="Leave Admin Options"/>
 		<menu_item_call label="Comprar L$" name="Buy and Sell L$"/>
 		<menu_item_call label="Preferências..." name="Preferences"/>
 		<menu_item_call label="Barras de ferramentas..." name="Toolbars"/>
@@ -40,11 +38,10 @@
 		<menu_item_check label="Busca" name="Search"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
 		<menu_item_call label="Criar marco deste lugar" name="Create Landmark Here"/>
-		<menu label="Perfil da região" name="Land">
-			<menu_item_call label="Perfil da região" name="Place Profile"/>
-			<menu_item_call label="Sobre terrenos" name="About Land"/>
-			<menu_item_call label="Região/Propriedade" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Perfil da região" name="Place Profile"/>
+		<menu_item_call label="Sobre terrenos" name="About Land"/>
+		<menu_item_call label="Região/Propriedade" name="Region/Estate"/>
 		<menu_item_call label="Comprar este terreno" name="Buy Land"/>
 		<menu_item_call label="Meus terrenos" name="My Land"/>
 		<menu label="Mostrar" name="LandShow">
@@ -60,14 +57,14 @@
 		</menu>
 		<menu_item_call label="Teletransportar para meu início" name="Teleport Home"/>
 		<menu_item_call label="Definir como Início" name="Set Home to Here"/>
-		<menu label="Sol" name="Environment Settings">
+		<menu label="Sol" name="Sun">
 			<menu_item_call label="Amanhecer" name="Sunrise"/>
 			<menu_item_call label="Meio-dia" name="Noon"/>
 			<menu_item_call label="Pôr-do-Sol" name="Sunset"/>
 			<menu_item_call label="Meia-noite" name="Midnight"/>
 		</menu>
 		<menu label="Editor de ambientes" name="Enviroment Editor">
-			<menu_item_call label="Configurações de ambiente..." name="Enviroment Settings"/>
+			<menu_item_call label="Configurações de ambiente..." name="Environment Settings"/>
 			<menu label="Pré-configurações de água" name="Water Presets">
 				<menu_item_call label="Nova pré-configuração..." name="new_water_preset"/>
 				<menu_item_call label="Editar pré-configuração..." name="edit_water_preset"/>
@@ -173,22 +170,22 @@
 			<menu_item_check label="Mostrar retículo na vista subjetiva" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Tipos de renderização" name="Rendering Types">
-			<menu_item_check label="Simples" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Árvore" name="Tree"/>
-			<menu_item_check label="Avatares" name="Character"/>
-			<menu_item_check label="Patch de superfície" name="Surface Patch"/>
-			<menu_item_check label="Céu" name="Sky"/>
-			<menu_item_check label="Água" name="Water"/>
-			<menu_item_check label="Chão" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Grama" name="Grass"/>
-			<menu_item_check label="Nuvens" name="Clouds"/>
-			<menu_item_check label="Partículas" name="Particles"/>
-			<menu_item_check label="Elevação" name="Bump"/>
+			<menu_item_check label="Simples" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Árvore" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatares" name="Rendering Type Character"/>
+			<menu_item_check label="Patch de superfície" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Céu" name="Rendering Type Sky"/>
+			<menu_item_check label="Água" name="Rendering Type Water"/>
+			<menu_item_check label="Chão" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Grama" name="Rendering Type Grass"/>
+			<menu_item_check label="Nuvens" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partículas" name="Rendering Type Particles"/>
+			<menu_item_check label="Elevação" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Recursos de renderização" name="Rendering Features">
-			<menu_item_check label="Interface" name="UI"/>
+			<menu_item_check label="Interface" name="ToggleUI"/>
 			<menu_item_check label="Selecionado" name="Selected"/>
 			<menu_item_check label="Realçado" name="Highlighted"/>
 			<menu_item_check label="Texturas dinâmicas" name="Dynamic Textures"/>
@@ -200,10 +197,7 @@
 		<menu_item_call label="Limpar cache de grupo" name="ClearGroupCache"/>
 		<menu_item_check label="Smoothing de mouse" name="Mouse Smoothing"/>
 		<menu label="Atalhos" name="Shortcuts">
-			<menu_item_call label="Imagem (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Busca" name="Search"/>
 			<menu_item_call label="Soltar objeto" name="Release Keys"/>
-			<menu_item_call label="Interface tamanho padrão" name="Set UI Size to Default"/>
 			<menu_item_check label="Mostrar menu avançado - atalho antigo" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fechar janela" name="Close Window"/>
 			<menu_item_call label="Fechar todas as janelas" name="Close All Windows"/>
@@ -212,13 +206,6 @@
 			<menu_item_check label="Flycam Joystick" name="Joystick Flycam"/>
 			<menu_item_call label="Visão padrão" name="Reset View"/>
 			<menu_item_call label="Olhar para quem fala por último" name="Look at Last Chatter"/>
-			<menu label="Selecionar ferramenta de construção" name="Select Tool">
-				<menu_item_call label="Ferramenta enfoque" name="Focus"/>
-				<menu_item_call label="Ferramenta de movimentação" name="Move"/>
-				<menu_item_call label="Ferramenta de edição" name="Edit"/>
-				<menu_item_call label="Ferramenta criar" name="Create"/>
-				<menu_item_call label="Ferramenta de terrenos" name="Land"/>
-			</menu>
 			<menu_item_call label="Mais zoom" name="Zoom In"/>
 			<menu_item_call label="Zoom padrão" name="Zoom Default"/>
 			<menu_item_call label="Menos zoom" name="Zoom Out"/>
@@ -296,9 +283,8 @@
 			<menu_item_call label="Drop a Packet" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Empurrões, trombadas e tapas" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Mundo" name="World">
+		<menu label="Mundo" name="DevelopWorld">
 			<menu_item_check label="Impor sobre sol regional" name="Sim Sun Override"/>
-			<menu_item_check label="Efeito baliza piscando" name="Cheesy Beacon"/>
 			<menu_item_check label="Fixed Weather" name="Fixed Weather"/>
 			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
 		</menu>
@@ -320,11 +306,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Íris" name="Iris"/>
-				<menu_item_call label="Cabeça" name="Head"/>
-				<menu_item_call label="Cintura acima" name="Upper Body"/>
-				<menu_item_call label="Cintura para baixo" name="Lower Body"/>
-				<menu_item_call label="Saia" name="Skirt"/>
+				<menu_item_call label="Íris" name="Grab Iris"/>
+				<menu_item_call label="Cabeça" name="Grab Head"/>
+				<menu_item_call label="Cintura acima" name="Grab Upper Body"/>
+				<menu_item_call label="Cintura para baixo" name="Grab Lower Body"/>
+				<menu_item_call label="Saia" name="Grab Skirt"/>
 			</menu>
 			<menu label="Testes de personagem" name="Character Tests">
 				<menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/>
@@ -346,8 +332,8 @@
 		<menu_item_check label="Mostrar menu admin" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Pegar uma cópia" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Pegar uma cópia" name="Admin Take Copy"/>
 			<menu_item_call label="Force Owner To Me" name="Force Owner To Me"/>
 			<menu_item_call label="Force Owner Permissive" name="Force Owner Permissive"/>
 			<menu_item_call label="Excluir" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml
index b9f403c04b1..6e4d64eca7c 100644
--- a/indra/newview/skins/default/xui/ru/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml
@@ -17,8 +17,6 @@
 			<menu_item_call label="Нет на месте" name="Set Away"/>
 			<menu_item_call label="Не беспокоить" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Запрос статуса администратора" name="Request Admin Options"/>
-		<menu_item_call label="Выход из статуса администратора" name="Leave Admin Options"/>
 		<menu_item_call label="Купить L$" name="Buy and Sell L$"/>
 		<menu_item_call label="Настройки..." name="Preferences"/>
 		<menu_item_call label="Панели инструментов..." name="Toolbars"/>
@@ -38,11 +36,10 @@
 		<menu_item_check label="Поиск" name="Search"/>
 		<menu_item_call label="Снимок" name="Take Snapshot"/>
 		<menu_item_call label="Добавить закладку на это место" name="Create Landmark Here"/>
-		<menu label="Профиль места" name="Land">
-			<menu_item_call label="Профиль места" name="Place Profile"/>
-			<menu_item_call label="О земле" name="About Land"/>
-			<menu_item_call label="Регион/землевладение" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Профиль места" name="Place Profile"/>
+		<menu_item_call label="О земле" name="About Land"/>
+		<menu_item_call label="Регион/землевладение" name="Region/Estate"/>
 		<menu_item_call label="Купить эту землю" name="Buy Land"/>
 		<menu_item_call label="Моя земля" name="My Land"/>
 		<menu label="Показать" name="LandShow">
@@ -58,14 +55,14 @@
 		</menu>
 		<menu_item_call label="Телепортироваться домой" name="Teleport Home"/>
 		<menu_item_call label="Установить дом здесь" name="Set Home to Here"/>
-		<menu label="Солнце" name="Environment Settings">
+		<menu label="Солнце" name="Sun">
 			<menu_item_call label="Восход" name="Sunrise"/>
 			<menu_item_call label="Полдень" name="Noon"/>
 			<menu_item_call label="Закат" name="Sunset"/>
 			<menu_item_call label="Полночь" name="Midnight"/>
 		</menu>
 		<menu label="Редактор среды" name="Enviroment Editor">
-			<menu_item_call label="Настройки среды..." name="Enviroment Settings"/>
+			<menu_item_call label="Настройки среды..." name="Environment Settings"/>
 			<menu label="Настройки воды" name="Water Presets">
 				<menu_item_call label="Создать настройку..." name="new_water_preset"/>
 				<menu_item_call label="Изменить настройку..." name="edit_water_preset"/>
@@ -171,22 +168,22 @@
 			<menu_item_check label="Показывать прицел при обзоре мышью" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Типы визуализации" name="Rendering Types">
-			<menu_item_check label="Обычная" name="Simple"/>
-			<menu_item_check label="Альфа" name="Alpha"/>
-			<menu_item_check label="Дерево" name="Tree"/>
-			<menu_item_check label="Аватары" name="Character"/>
-			<menu_item_check label="Исправление поверхности" name="Surface Patch"/>
-			<menu_item_check label="Небо" name="Sky"/>
-			<menu_item_check label="Вода" name="Water"/>
-			<menu_item_check label="Земля" name="Ground"/>
-			<menu_item_check label="Объем" name="Volume"/>
-			<menu_item_check label="Трава" name="Grass"/>
-			<menu_item_check label="Облака" name="Clouds"/>
-			<menu_item_check label="Частицы" name="Particles"/>
-			<menu_item_check label="Рельефное" name="Bump"/>
+			<menu_item_check label="Обычная" name="Rendering Type Simple"/>
+			<menu_item_check label="Альфа" name="Rendering Type Alpha"/>
+			<menu_item_check label="Дерево" name="Rendering Type Tree"/>
+			<menu_item_check label="Аватары" name="Rendering Type Character"/>
+			<menu_item_check label="Исправление поверхности" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Небо" name="Rendering Type Sky"/>
+			<menu_item_check label="Вода" name="Rendering Type Water"/>
+			<menu_item_check label="Земля" name="Rendering Type Ground"/>
+			<menu_item_check label="Объем" name="Rendering Type Volume"/>
+			<menu_item_check label="Трава" name="Rendering Type Grass"/>
+			<menu_item_check label="Облака" name="Rendering Type Clouds"/>
+			<menu_item_check label="Частицы" name="Rendering Type Particles"/>
+			<menu_item_check label="Рельефное" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Функции визуализации" name="Rendering Features">
-			<menu_item_check label="Интерфейс пользователя" name="UI"/>
+			<menu_item_check label="Интерфейс пользователя" name="ToggleUI"/>
 			<menu_item_check label="Выбрано" name="Selected"/>
 			<menu_item_check label="Выделено" name="Highlighted"/>
 			<menu_item_check label="Динамические текстуры" name="Dynamic Textures"/>
@@ -199,10 +196,7 @@
 		<menu_item_call label="Очистить кэш группы" name="ClearGroupCache"/>
 		<menu_item_check label="Сглаживание мышью" name="Mouse Smoothing"/>
 		<menu label="Горячие клавиши" name="Shortcuts">
-			<menu_item_call label="Изображение (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Поиск" name="Search"/>
 			<menu_item_call label="Освободить клавиши" name="Release Keys"/>
-			<menu_item_call label="Сбросить размер интерфейса" name="Set UI Size to Default"/>
 			<menu_item_check label="Показать меню «Дополнительно» - старое сочетание клавиш" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Закрыть окно" name="Close Window"/>
 			<menu_item_call label="Закрыть все окна" name="Close All Windows"/>
@@ -211,13 +205,6 @@
 			<menu_item_check label="Обзор джойстиком" name="Joystick Flycam"/>
 			<menu_item_call label="Сброс обзора" name="Reset View"/>
 			<menu_item_call label="Смотреть на последнего говорившего" name="Look at Last Chatter"/>
-			<menu label="Выбрать инструменты" name="Select Tool">
-				<menu_item_call label="Фокус" name="Focus"/>
-				<menu_item_call label="Перемещение" name="Move"/>
-				<menu_item_call label="Редактирование" name="Edit"/>
-				<menu_item_call label="Создание" name="Create"/>
-				<menu_item_call label="Земля" name="Land"/>
-			</menu>
 			<menu_item_call label="Приблизить" name="Zoom In"/>
 			<menu_item_call label="Стандартный масштаб" name="Zoom Default"/>
 			<menu_item_call label="Отодвинуть" name="Zoom Out"/>
@@ -331,9 +318,8 @@
 			<menu_item_call label="Начать запись" name="Start Record"/>
 			<menu_item_call label="Остановить запись" name="Stop Record"/>
 		</menu>
-		<menu label="Мир" name="World">
+		<menu label="Мир" name="DevelopWorld">
 			<menu_item_check label="Перекрытие солнца в симуляторе" name="Sim Sun Override"/>
-			<menu_item_check label="Мигающий маяк" name="Cheesy Beacon"/>
 			<menu_item_check label="Неизменная погода" name="Fixed Weather"/>
 			<menu_item_call label="Вывод кэша региональных объектов" name="Dump Region Object Cache"/>
 		</menu>
@@ -365,11 +351,11 @@
 		</menu>
 		<menu label="Аватар" name="Character">
 			<menu label="Захват запеченных текстур" name="Grab Baked Texture">
-				<menu_item_call label="Радужка" name="Iris"/>
-				<menu_item_call label="Голова" name="Head"/>
-				<menu_item_call label="Верхняя часть тела" name="Upper Body"/>
-				<menu_item_call label="Нижняя часть тела" name="Lower Body"/>
-				<menu_item_call label="Юбка" name="Skirt"/>
+				<menu_item_call label="Радужка" name="Grab Iris"/>
+				<menu_item_call label="Голова" name="Grab Head"/>
+				<menu_item_call label="Верхняя часть тела" name="Grab Upper Body"/>
+				<menu_item_call label="Нижняя часть тела" name="Grab Lower Body"/>
+				<menu_item_call label="Юбка" name="Grab Skirt"/>
 			</menu>
 			<menu label="Проверка персонажа" name="Character Tests">
 				<menu_item_call label="Внешний вид в XML" name="Appearance To XML"/>
@@ -404,8 +390,8 @@
 		<menu_item_check label="Показать меню администратора" name="View Admin Options"/>
 	</menu>
 	<menu label="Администратор" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Взять копию" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Взять копию" name="Admin Take Copy"/>
 			<menu_item_call label="Назначить себя владельцем" name="Force Owner To Me"/>
 			<menu_item_call label="Назначить полноправным владельцем" name="Force Owner Permissive"/>
 			<menu_item_call label="Удалить" name="Delete"/>
@@ -441,7 +427,7 @@
 			<menu_item_call label="Физика" name="Physics"/>
 			<menu_item_call label="Вся одежда" name="All Clothes"/>
 		</menu>
-		<menu label="Справка" name="Help">
+		<menu label="Справка" name="DeprecatedHelp">
 			<menu_item_call label="Официальный блог Linden" name="Official Linden Blog"/>
 			<menu_item_call label="Портал скриптов" name="Scripting Portal"/>
 			<menu label="Сообщение об ошибке" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index 75294e38d5b..7ad5221bb0d 100644
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -17,8 +17,6 @@
 			<menu_item_call label="Uzakta" name="Set Away"/>
 			<menu_item_call label="MeÅŸgul" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Yönetici Durumu Talep Et" name="Request Admin Options"/>
-		<menu_item_call label="Yönetici Durumundan Ayrıl" name="Leave Admin Options"/>
 		<menu_item_call label="L$ Satın Al" name="Buy and Sell L$"/>
 		<menu_item_call label="Tercihler..." name="Preferences"/>
 		<menu_item_call label="Araç çubukları..." name="Toolbars"/>
@@ -38,11 +36,10 @@
 		<menu_item_check label="Ara" name="Search"/>
 		<menu_item_call label="Anlık Görüntü" name="Take Snapshot"/>
 		<menu_item_call label="Bu Yeri Yer Ä°mlerine Ekle" name="Create Landmark Here"/>
-		<menu label="Profili YerleÅŸtir" name="Land">
-			<menu_item_call label="Profili YerleÅŸtir" name="Place Profile"/>
-			<menu_item_call label="Arazi Hakkında" name="About Land"/>
-			<menu_item_call label="Bölge/Gayrimenkul" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profili YerleÅŸtir" name="Place Profile"/>
+		<menu_item_call label="Arazi Hakkında" name="About Land"/>
+		<menu_item_call label="Bölge/Gayrimenkul" name="Region/Estate"/>
 		<menu_item_call label="Bu Araziyi Satın Al" name="Buy Land"/>
 		<menu_item_call label="Arazim" name="My Land"/>
 		<menu label="Göster" name="LandShow">
@@ -58,14 +55,14 @@
 		</menu>
 		<menu_item_call label="Ana Konuma Işınla" name="Teleport Home"/>
 		<menu_item_call label="Ana Konumu Burası Olarak Seç" name="Set Home to Here"/>
-		<menu label="Güneş" name="Environment Settings">
+		<menu label="Güneş" name="Sun">
 			<menu_item_call label="Gün Doğumu" name="Sunrise"/>
 			<menu_item_call label="Gün Ortası" name="Noon"/>
 			<menu_item_call label="Gün Batımı" name="Sunset"/>
 			<menu_item_call label="Gece Yarısı" name="Midnight"/>
 		</menu>
 		<menu label="Ortam Düzenleyici" name="Enviroment Editor">
-			<menu_item_call label="Ortam Ayarları..." name="Enviroment Settings"/>
+			<menu_item_call label="Ortam Ayarları..." name="Environment Settings"/>
 			<menu label="Su Ön Ayarları" name="Water Presets">
 				<menu_item_call label="Yeni ön ayar..." name="new_water_preset"/>
 				<menu_item_call label="Ön ayarı düzenle..." name="edit_water_preset"/>
@@ -171,22 +168,22 @@
 			<menu_item_check label="Fare Üzerinden Görünüm Artı İşaretini Göster" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="İşleme Türleri" name="Rendering Types">
-			<menu_item_check label="Basit" name="Simple"/>
-			<menu_item_check label="Alfa" name="Alpha"/>
-			<menu_item_check label="Ağaç" name="Tree"/>
-			<menu_item_check label="Avatarlar" name="Character"/>
-			<menu_item_check label="Yüzey Yaması" name="Surface Patch"/>
-			<menu_item_check label="Gökyüzü" name="Sky"/>
-			<menu_item_check label="Su" name="Water"/>
-			<menu_item_check label="Toprak" name="Ground"/>
-			<menu_item_check label="Hacim" name="Volume"/>
-			<menu_item_check label="Çimen" name="Grass"/>
-			<menu_item_check label="Bulutlar" name="Clouds"/>
-			<menu_item_check label="Parçacıklar" name="Particles"/>
-			<menu_item_check label="Tümsek" name="Bump"/>
+			<menu_item_check label="Basit" name="Rendering Type Simple"/>
+			<menu_item_check label="Alfa" name="Rendering Type Alpha"/>
+			<menu_item_check label="Ağaç" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatarlar" name="Rendering Type Character"/>
+			<menu_item_check label="Yüzey Yaması" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Gökyüzü" name="Rendering Type Sky"/>
+			<menu_item_check label="Su" name="Rendering Type Water"/>
+			<menu_item_check label="Toprak" name="Rendering Type Ground"/>
+			<menu_item_check label="Hacim" name="Rendering Type Volume"/>
+			<menu_item_check label="Çimen" name="Rendering Type Grass"/>
+			<menu_item_check label="Bulutlar" name="Rendering Type Clouds"/>
+			<menu_item_check label="Parçacıklar" name="Rendering Type Particles"/>
+			<menu_item_check label="Tümsek" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="İşleme Özellikleri" name="Rendering Features">
-			<menu_item_check label="KA" name="UI"/>
+			<menu_item_check label="KA" name="ToggleUI"/>
 			<menu_item_check label="Seçili" name="Selected"/>
 			<menu_item_check label="Vurgulanmış" name="Highlighted"/>
 			<menu_item_check label="Dinamik Dokular" name="Dynamic Textures"/>
@@ -199,10 +196,7 @@
 		<menu_item_call label="Grup Ön Belleğini Temizle" name="ClearGroupCache"/>
 		<menu_item_check label="Fare Düzleştirme" name="Mouse Smoothing"/>
 		<menu label="Kısa Yollar" name="Shortcuts">
-			<menu_item_call label="Görüntü (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Ara" name="Search"/>
 			<menu_item_call label="Bırakma Anahtarları" name="Release Keys"/>
-			<menu_item_call label="KA Büyüklüğünü Varsayılana Ayarla" name="Set UI Size to Default"/>
 			<menu_item_check label="Gelişmiş Menüyü Göster - eski kısayol" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Pencereyi Kapat" name="Close Window"/>
 			<menu_item_call label="Tüm Pencereleri Kapat" name="Close All Windows"/>
@@ -211,13 +205,6 @@
 			<menu_item_check label="Oyun Çubuğu Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Görünümü Sıfırla" name="Reset View"/>
 			<menu_item_call label="Son Sohbet Edene Bak" name="Look at Last Chatter"/>
-			<menu label="İnşa Et Aracını Seç" name="Select Tool">
-				<menu_item_call label="Odaklanma Aracı" name="Focus"/>
-				<menu_item_call label="Hareket Ettirme Aracı" name="Move"/>
-				<menu_item_call label="Düzenleme Aracı" name="Edit"/>
-				<menu_item_call label="Oluşturma Aracı" name="Create"/>
-				<menu_item_call label="Arazi Aracı" name="Land"/>
-			</menu>
 			<menu_item_call label="Yakınlaştır" name="Zoom In"/>
 			<menu_item_call label="Varsayılan Yakınlaştırma" name="Zoom Default"/>
 			<menu_item_call label="Uzaklaştırma" name="Zoom Out"/>
@@ -331,9 +318,8 @@
 			<menu_item_call label="Kaydı Başlat" name="Start Record"/>
 			<menu_item_call label="Kaydı Durdur" name="Stop Record"/>
 		</menu>
-		<menu label="Dünya" name="World">
+		<menu label="Dünya" name="DevelopWorld">
 			<menu_item_check label="Sim Güneşi Geçersiz Kıl" name="Sim Sun Override"/>
-			<menu_item_check label="Yanıp Sönen İşaret" name="Cheesy Beacon"/>
 			<menu_item_check label="Sabit Hava Durumu" name="Fixed Weather"/>
 			<menu_item_call label="Bölge Nesne Önbelleğinin Dökümünü Al" name="Dump Region Object Cache"/>
 		</menu>
@@ -365,11 +351,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="KaydedilmiÅŸ Dokuyu Al" name="Grab Baked Texture">
-				<menu_item_call label="Ä°ris" name="Iris"/>
-				<menu_item_call label="BaÅŸ" name="Head"/>
-				<menu_item_call label="Üst Gövde" name="Upper Body"/>
-				<menu_item_call label="Alt Gövde" name="Lower Body"/>
-				<menu_item_call label="Etek" name="Skirt"/>
+				<menu_item_call label="Ä°ris" name="Grab Iris"/>
+				<menu_item_call label="BaÅŸ" name="Grab Head"/>
+				<menu_item_call label="Üst Gövde" name="Grab Upper Body"/>
+				<menu_item_call label="Alt Gövde" name="Grab Lower Body"/>
+				<menu_item_call label="Etek" name="Grab Skirt"/>
 			</menu>
 			<menu label="Karakter Testleri" name="Character Tests">
 				<menu_item_call label="XML&apos;de Görünüm" name="Appearance To XML"/>
@@ -404,8 +390,8 @@
 		<menu_item_check label="Yönetici Menüsünü Göster" name="View Admin Options"/>
 	</menu>
 	<menu label="Yönetici" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Kopya Al" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Kopya Al" name="Admin Take Copy"/>
 			<menu_item_call label="Mülkiyetime Geçir" name="Force Owner To Me"/>
 			<menu_item_call label="İzinlerle Birlikte Mülkiyetime Geçir" name="Force Owner Permissive"/>
 			<menu_item_call label="Sil" name="Delete"/>
@@ -441,7 +427,7 @@
 			<menu_item_call label="Fizik" name="Physics"/>
 			<menu_item_call label="Tüm Giysiler" name="All Clothes"/>
 		</menu>
-		<menu label="Yardım" name="Help">
+		<menu label="Yardım" name="DeprecatedHelp">
 			<menu_item_call label="Resmi Linden Blog&apos;u" name="Official Linden Blog"/>
 			<menu_item_call label="Komut Dosyası Portalı" name="Scripting Portal"/>
 			<menu label="Hata Raporlama" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml
index f7be781caca..b6bb79bcbcc 100644
--- a/indra/newview/skins/default/xui/zh/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml
@@ -20,8 +20,6 @@
 			<menu_item_call label="離開" name="Set Away"/>
 			<menu_item_call label="忙碌" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="要求 Admin 狀態" name="Request Admin Options"/>
-		<menu_item_call label="離開 Admin 狀態" name="Leave Admin Options"/>
 		<menu_item_call label="結束退出 [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="溝通" name="Communicate">
@@ -36,11 +34,10 @@
 		<menu_item_check label="搜尋" name="Search"/>
 		<menu_item_call label="拍攝快照" name="Take Snapshot"/>
 		<menu_item_call label="將此處記下地標" name="Create Landmark Here"/>
-		<menu label="地點檔案" name="Land">
-			<menu_item_call label="地點檔案" name="Place Profile"/>
-			<menu_item_call label="關於土地" name="About Land"/>
-			<menu_item_call label="地區 / 領地" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="地點檔案" name="Place Profile"/>
+		<menu_item_call label="關於土地" name="About Land"/>
+		<menu_item_call label="地區 / 領地" name="Region/Estate"/>
 		<menu_item_call label="購買這塊土地" name="Buy Land"/>
 		<menu_item_call label="我的土地" name="My Land"/>
 		<menu label="顯示" name="LandShow">
@@ -56,7 +53,7 @@
 		</menu>
 		<menu_item_call label="瞬間瞬間傳送回家" name="Teleport Home"/>
 		<menu_item_call label="設定家在此處" name="Set Home to Here"/>
-		<menu label="太陽" name="Environment Settings">
+		<menu label="太陽" name="Sun">
 			<menu_item_call label="日出" name="Sunrise"/>
 			<menu_item_call label="中午" name="Noon"/>
 			<menu_item_call label="日落" name="Sunset"/>
@@ -154,22 +151,22 @@
 			<menu_item_check label="顯示第一人稱視角準星" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Rendering Types" name="Rendering Types">
-			<menu_item_check label="ç°¡å–®" name="Simple"/>
-			<menu_item_check label="半透明" name="Alpha"/>
-			<menu_item_check label="樹木" name="Tree"/>
-			<menu_item_check label="化身" name="Character"/>
-			<menu_item_check label="地表" name="SurfacePath"/>
-			<menu_item_check label="天空" name="Sky"/>
-			<menu_item_check label="æ°´æ–‡" name="Water"/>
-			<menu_item_check label="地面" name="Ground"/>
-			<menu_item_check label="體積" name="Volume"/>
-			<menu_item_check label="草地" name="Grass"/>
-			<menu_item_check label="雲彩" name="Clouds"/>
-			<menu_item_check label="粒子效果" name="Particles"/>
-			<menu_item_check label="碰撞" name="Bump"/>
+			<menu_item_check label="ç°¡å–®" name="Rendering Type Simple"/>
+			<menu_item_check label="半透明" name="Rendering Type Alpha"/>
+			<menu_item_check label="樹木" name="Rendering Type Tree"/>
+			<menu_item_check label="化身" name="Rendering Type Character"/>
+			<menu_item_check label="地表" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="天空" name="Rendering Type Sky"/>
+			<menu_item_check label="æ°´æ–‡" name="Rendering Type Water"/>
+			<menu_item_check label="地面" name="Rendering Type Ground"/>
+			<menu_item_check label="體積" name="Rendering Type Volume"/>
+			<menu_item_check label="草地" name="Rendering Type Grass"/>
+			<menu_item_check label="雲彩" name="Rendering Type Clouds"/>
+			<menu_item_check label="粒子效果" name="Rendering Type Particles"/>
+			<menu_item_check label="碰撞" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Rendering Features" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Selected" name="Selected"/>
 			<menu_item_check label="Highlighted" name="Highlighted"/>
 			<menu_item_check label="Dynamic Textures" name="Dynamic Textures"/>
@@ -182,10 +179,7 @@
 		<menu_item_call label="清除群組快取資料" name="ClearGroupCache"/>
 		<menu_item_check label="滑鼠平滑移動" name="Mouse Smoothing"/>
 		<menu label="快速鍵" name="Shortcuts">
-			<menu_item_call label="圖像(L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="搜尋" name="Search"/>
 			<menu_item_call label="釋出按鍵" name="Release Keys"/>
-			<menu_item_call label="設定使用者界面大小至預設值" name="Set UI Size to Default"/>
 			<menu_item_check label="顯示進階選單 - 舊版捷徑" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="關閉視窗" name="Close Window"/>
 			<menu_item_call label="關閉全部視窗" name="Close All Windows"/>
@@ -194,13 +188,6 @@
 			<menu_item_check label="Joystick Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="重設視角" name="Reset View"/>
 			<menu_item_call label="注視上一位聊天者" name="Look at Last Chatter"/>
-			<menu label="選擇建造工具" name="Select Tool">
-				<menu_item_call label="聚焦工具" name="Focus"/>
-				<menu_item_call label="移動工具" name="Move"/>
-				<menu_item_call label="編輯工具" name="Edit"/>
-				<menu_item_call label="創造工具" name="Create"/>
-				<menu_item_call label="土地工具" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoom In" name="Zoom In"/>
 			<menu_item_call label="Zoom Default" name="Zoom Default"/>
 			<menu_item_call label="Zoom Out" name="Zoom Out"/>
@@ -306,9 +293,8 @@
 			<menu_item_call label="開始錄製" name="Start Record"/>
 			<menu_item_call label="停止錄製" name="Stop Record"/>
 		</menu>
-		<menu label="世界" name="World">
+		<menu label="世界" name="DevelopWorld">
 			<menu_item_check label="模擬器太陽設定覆蓋" name="Sim Sun Override"/>
-			<menu_item_check label="Cheesy Beacon" name="Cheesy Beacon"/>
 			<menu_item_check label="固定天氣" name="Fixed Weather"/>
 			<menu_item_call label="傾印地區物件快取" name="Dump Region Object Cache"/>
 		</menu>
@@ -340,11 +326,11 @@
 		</menu>
 		<menu label="化身" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="頭部" name="Head"/>
-				<menu_item_call label="Upper Body" name="Upper Body"/>
-				<menu_item_call label="Lower Body" name="Lower Body"/>
-				<menu_item_call label="裙子" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="頭部" name="Grab Head"/>
+				<menu_item_call label="Upper Body" name="Grab Upper Body"/>
+				<menu_item_call label="Lower Body" name="Grab Lower Body"/>
+				<menu_item_call label="裙子" name="Grab Skirt"/>
 			</menu>
 			<menu label="Character Tests" name="Character Tests">
 				<menu_item_call label="Appearance To XML" name="Appearance To XML"/>
@@ -378,8 +364,8 @@
 		<menu_item_check label="Show Admin Menu" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="取得副本" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="取得副本" name="Admin Take Copy"/>
 			<menu_item_call label="強制擁有者為我" name="Force Owner To Me"/>
 			<menu_item_call label="Force Owner Permissive" name="Force Owner Permissive"/>
 			<menu_item_call label="刪除" name="Delete"/>
@@ -415,7 +401,7 @@
 			<menu_item_call label="身體物理" name="Physics"/>
 			<menu_item_call label="全部衣服" name="All Clothes"/>
 		</menu>
-		<menu label="幫助" name="Help">
+		<menu label="幫助" name="DeprecatedHelp">
 			<menu_item_call label="林登官方部落格" name="Official Linden Blog"/>
 			<menu_item_call label="Scripting Portal" name="Scripting Portal"/>
 			<menu label="臭蟲回報" name="Bug Reporting">
-- 
GitLab


From b2b421acb6ddea83c9cc25c3593c534f7ff22e57 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 10 Jan 2012 16:15:57 -0800
Subject: [PATCH 536/933] Changed merchant outbox visibility to not persist
 between sessions.

---
 indra/newview/skins/default/xui/en/floater_merchant_outbox.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 02394e8ac3d..741515d56c2 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -9,7 +9,7 @@
  min_height="200"
  name="floater_merchant_outbox"
  save_rect="true"
- save_visibility="true"
+ save_visibility="false"
  reuse_instance="true"
  title="MERCHANT OUTBOX"
  width="333" >
-- 
GitLab


From 4be85a0e3dd2ef9f2ff6e9c6bb95238fca737b3c Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 10 Jan 2012 17:08:20 -0800
Subject: [PATCH 537/933] FIX INTL-89 translation in 8 languages for Set29
 including new files

---
 .../skins/default/xui/de/floater_about.xml    |  48 +++----
 .../default/xui/de/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/de/floater_avatar.xml   |   2 +-
 .../default/xui/de/floater_buy_currency.xml   |   2 +-
 .../skins/default/xui/de/floater_camera.xml   |   2 +-
 .../xui/de/floater_hardware_settings.xml      |   2 +-
 .../default/xui/de/floater_model_preview.xml  |   5 +-
 .../default/xui/de/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/de/floater_moveview.xml |   2 +-
 .../skins/default/xui/de/floater_snapshot.xml | 122 ++++++++----------
 .../skins/default/xui/de/floater_toybox.xml   |   3 +-
 .../xui/de/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/de/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/de/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/de/menu_viewer.xml      |  58 +++++----
 .../skins/default/xui/de/notifications.xml    |  34 +++--
 .../skins/default/xui/de/panel_edit_skin.xml  |   6 +-
 .../default/xui/de/panel_postcard_message.xml |  21 +++
 .../xui/de/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/de/panel_preferences_chat.xml |  27 +---
 .../xui/de/panel_preferences_setup.xml        |   2 +-
 .../xui/de/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/de/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/de/panel_snapshot_options.xml |   7 +
 .../xui/de/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/de/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/de/strings.xml  |  61 ++++++++-
 .../skins/default/xui/de/teleport_strings.xml |   4 +-
 .../skins/default/xui/es/floater_about.xml    |  48 +++----
 .../default/xui/es/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/es/floater_avatar.xml   |   2 +-
 .../skins/default/xui/es/floater_camera.xml   |   2 +-
 .../xui/es/floater_hardware_settings.xml      |   2 +-
 .../default/xui/es/floater_model_preview.xml  |   3 +
 .../default/xui/es/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/es/floater_moveview.xml |   2 +-
 .../skins/default/xui/es/floater_snapshot.xml | 122 ++++++++----------
 .../skins/default/xui/es/floater_toybox.xml   |   3 +-
 .../xui/es/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/es/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/es/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/es/menu_viewer.xml      |  58 +++++----
 .../skins/default/xui/es/notifications.xml    |  38 ++++--
 .../skins/default/xui/es/panel_edit_skin.xml  |   6 +-
 .../default/xui/es/panel_nearby_chat.xml      |   2 +-
 .../default/xui/es/panel_postcard_message.xml |  21 +++
 .../xui/es/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/es/panel_preferences_chat.xml |  27 +---
 .../xui/es/panel_preferences_setup.xml        |   2 +-
 .../xui/es/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/es/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/es/panel_snapshot_options.xml |   7 +
 .../xui/es/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/es/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/es/strings.xml  |  61 ++++++++-
 .../skins/default/xui/es/teleport_strings.xml |   4 +-
 .../skins/default/xui/fr/floater_about.xml    |  48 +++----
 .../default/xui/fr/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/fr/floater_avatar.xml   |   2 +-
 .../default/xui/fr/floater_buy_currency.xml   |   8 +-
 .../skins/default/xui/fr/floater_camera.xml   |   2 +-
 .../xui/fr/floater_hardware_settings.xml      |   2 +-
 .../default/xui/fr/floater_model_preview.xml  |   5 +-
 .../default/xui/fr/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/fr/floater_moveview.xml |   2 +-
 .../skins/default/xui/fr/floater_snapshot.xml | 122 ++++++++----------
 .../skins/default/xui/fr/floater_toybox.xml   |   3 +-
 .../xui/fr/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/fr/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/fr/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/fr/menu_viewer.xml      |  60 +++++----
 .../skins/default/xui/fr/notifications.xml    |  42 ++++--
 .../skins/default/xui/fr/panel_edit_skin.xml  |   6 +-
 .../default/xui/fr/panel_nearby_chat.xml      |   2 +-
 .../default/xui/fr/panel_postcard_message.xml |  21 +++
 .../xui/fr/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/fr/panel_preferences_chat.xml |  27 +---
 .../xui/fr/panel_preferences_setup.xml        |   2 +-
 .../xui/fr/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/fr/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/fr/panel_snapshot_options.xml |   7 +
 .../xui/fr/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/fr/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/fr/strings.xml  |  61 ++++++++-
 .../skins/default/xui/fr/teleport_strings.xml |   4 +-
 .../skins/default/xui/it/floater_about.xml    |  48 +++----
 .../default/xui/it/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/it/floater_avatar.xml   |   2 +-
 .../default/xui/it/floater_buy_currency.xml   |   2 +-
 .../skins/default/xui/it/floater_camera.xml   |   2 +-
 .../xui/it/floater_hardware_settings.xml      |   2 +-
 .../default/xui/it/floater_model_preview.xml  |   3 +
 .../default/xui/it/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/it/floater_moveview.xml |   2 +-
 .../skins/default/xui/it/floater_snapshot.xml | 122 ++++++++----------
 .../skins/default/xui/it/floater_toybox.xml   |   3 +-
 .../xui/it/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/it/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/it/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/it/menu_viewer.xml      |  66 +++++-----
 .../skins/default/xui/it/notifications.xml    |  46 ++++---
 .../skins/default/xui/it/panel_edit_skin.xml  |   6 +-
 .../default/xui/it/panel_postcard_message.xml |  21 +++
 .../xui/it/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/it/panel_preferences_chat.xml |  27 +---
 .../xui/it/panel_preferences_setup.xml        |   2 +-
 .../xui/it/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/it/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/it/panel_snapshot_options.xml |   7 +
 .../xui/it/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/it/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/it/strings.xml  |  61 ++++++++-
 .../skins/default/xui/it/teleport_strings.xml |   4 +-
 .../skins/default/xui/ja/floater_about.xml    |   2 +
 .../default/xui/ja/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/ja/floater_avatar.xml   |   2 +-
 .../default/xui/ja/floater_buy_currency.xml   |   2 +-
 .../skins/default/xui/ja/floater_camera.xml   |   2 +-
 .../xui/ja/floater_hardware_settings.xml      |   4 +-
 .../default/xui/ja/floater_model_preview.xml  |   3 +
 .../default/xui/ja/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/ja/floater_moveview.xml |   2 +-
 .../skins/default/xui/ja/floater_snapshot.xml | 122 ++++++++----------
 .../skins/default/xui/ja/floater_toybox.xml   |   3 +-
 .../xui/ja/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/ja/floater_voice_controls.xml |   4 +-
 .../skins/default/xui/ja/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/ja/menu_viewer.xml      |  56 ++++----
 .../skins/default/xui/ja/notifications.xml    |  40 ++++--
 .../skins/default/xui/ja/panel_edit_skin.xml  |   6 +-
 .../default/xui/ja/panel_postcard_message.xml |  21 +++
 .../xui/ja/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/ja/panel_preferences_chat.xml |  27 +---
 .../xui/ja/panel_preferences_general.xml      |   2 +-
 .../xui/ja/panel_preferences_setup.xml        |   2 +-
 .../xui/ja/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/ja/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/ja/panel_snapshot_options.xml |   7 +
 .../xui/ja/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/ja/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/ja/strings.xml  |  61 ++++++++-
 .../skins/default/xui/ja/teleport_strings.xml |   4 +-
 .../skins/default/xui/pt/floater_about.xml    |  30 ++++-
 .../default/xui/pt/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/pt/floater_avatar.xml   |   2 +-
 .../default/xui/pt/floater_buy_currency.xml   |   2 +-
 .../skins/default/xui/pt/floater_camera.xml   |   2 +-
 .../xui/pt/floater_hardware_settings.xml      |   2 +-
 .../default/xui/pt/floater_model_preview.xml  |   3 +
 .../default/xui/pt/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/pt/floater_moveview.xml |   2 +-
 .../skins/default/xui/pt/floater_snapshot.xml | 122 ++++++++----------
 .../skins/default/xui/pt/floater_toybox.xml   |   3 +-
 .../xui/pt/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/pt/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/pt/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/pt/menu_viewer.xml      |  86 ++++++------
 .../skins/default/xui/pt/notifications.xml    |  40 ++++--
 .../skins/default/xui/pt/panel_edit_skin.xml  |   6 +-
 .../default/xui/pt/panel_postcard_message.xml |  21 +++
 .../xui/pt/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/pt/panel_preferences_chat.xml |  27 +---
 .../xui/pt/panel_preferences_setup.xml        |   2 +-
 .../xui/pt/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/pt/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/pt/panel_snapshot_options.xml |   7 +
 .../xui/pt/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/pt/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/pt/strings.xml  |  61 ++++++++-
 .../skins/default/xui/pt/teleport_strings.xml |   4 +-
 .../skins/default/xui/ru/floater_about.xml    |  46 +++----
 .../default/xui/ru/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/ru/floater_avatar.xml   |   2 +-
 .../default/xui/ru/floater_buy_currency.xml   |   2 +-
 .../skins/default/xui/ru/floater_camera.xml   |   2 +-
 .../xui/ru/floater_hardware_settings.xml      |   2 +-
 .../default/xui/ru/floater_model_preview.xml  |   5 +-
 .../default/xui/ru/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/ru/floater_moveview.xml |   2 +-
 .../skins/default/xui/ru/floater_snapshot.xml | 121 ++++++++---------
 .../skins/default/xui/ru/floater_toybox.xml   |   3 +-
 .../xui/ru/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/ru/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/ru/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/ru/menu_viewer.xml      |  54 ++++----
 .../skins/default/xui/ru/notifications.xml    |  38 ++++--
 .../skins/default/xui/ru/panel_edit_skin.xml  |   6 +-
 .../default/xui/ru/panel_nearby_chat.xml      |   2 +-
 .../default/xui/ru/panel_postcard_message.xml |  21 +++
 .../xui/ru/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/ru/panel_preferences_chat.xml |  26 +---
 .../xui/ru/panel_preferences_general.xml      |   2 +-
 .../xui/ru/panel_preferences_setup.xml        |   2 +-
 .../xui/ru/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/ru/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/ru/panel_snapshot_options.xml |   7 +
 .../xui/ru/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/ru/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/ru/strings.xml  |  59 ++++++++-
 .../skins/default/xui/ru/teleport_strings.xml |   4 +-
 .../skins/default/xui/tr/floater_about.xml    |  48 +++----
 .../default/xui/tr/floater_about_land.xml     |  17 ++-
 .../skins/default/xui/tr/floater_avatar.xml   |   2 +-
 .../default/xui/tr/floater_buy_currency.xml   |   2 +-
 .../skins/default/xui/tr/floater_camera.xml   |   2 +-
 .../xui/tr/floater_hardware_settings.xml      |   4 +-
 .../default/xui/tr/floater_model_preview.xml  |   3 +
 .../default/xui/tr/floater_model_wizard.xml   |   3 +
 .../skins/default/xui/tr/floater_moveview.xml |   2 +-
 .../skins/default/xui/tr/floater_snapshot.xml | 121 ++++++++---------
 .../skins/default/xui/tr/floater_toybox.xml   |   3 +-
 .../xui/tr/floater_translation_settings.xml   |  58 +++++++++
 .../default/xui/tr/floater_voice_controls.xml |   8 +-
 .../skins/default/xui/tr/menu_toolbars.xml    |   3 +-
 .../skins/default/xui/tr/menu_viewer.xml      |  58 +++++----
 .../skins/default/xui/tr/notifications.xml    |  38 ++++--
 .../skins/default/xui/tr/panel_edit_skin.xml  |   6 +-
 .../default/xui/tr/panel_postcard_message.xml |  21 +++
 .../xui/tr/panel_postcard_settings.xml        |  23 ++++
 .../default/xui/tr/panel_preferences_chat.xml |  26 +---
 .../xui/tr/panel_preferences_setup.xml        |   2 +-
 .../xui/tr/panel_snapshot_inventory.xml       |  21 +++
 .../default/xui/tr/panel_snapshot_local.xml   |  39 ++++++
 .../default/xui/tr/panel_snapshot_options.xml |   7 +
 .../xui/tr/panel_snapshot_postcard.xml        |  17 +++
 .../default/xui/tr/panel_snapshot_profile.xml |  28 ++++
 .../newview/skins/default/xui/tr/strings.xml  |  61 ++++++++-
 .../skins/default/xui/tr/teleport_strings.xml |   4 +-
 228 files changed, 3552 insertions(+), 1456 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/de/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/es/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/ru/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/ru/panel_snapshot_profile.xml
 create mode 100644 indra/newview/skins/default/xui/tr/floater_translation_settings.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_postcard_message.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_postcard_settings.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_snapshot_local.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml
 create mode 100644 indra/newview/skins/default/xui/tr/panel_snapshot_profile.xml

diff --git a/indra/newview/skins/default/xui/de/floater_about.xml b/indra/newview/skins/default/xui/de/floater_about.xml
index 145cc1e30bb..b4c28daac99 100644
--- a/indra/newview/skins/default/xui/de/floater_about.xml
+++ b/indra/newview/skins/default/xui/de/floater_about.xml
@@ -67,32 +67,34 @@ Voice-Serverversion: [VOICE_VERSION]
 		<panel label="Lizenzen" name="licenses_panel">
 			<text_editor name="credits_editor">
 				3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion.
-APR Copyright (C) 2000-2004 The Apache Software Foundation.
-Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
-cURL Copyright (C) 1996-2002, Daniel Stenberg (daniel@haxx.se).
-DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
-expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Copyright (C) 1999-2004 Brian Paul.
-GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University sowie David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Copyright (c) 2005, Google Inc.
-Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW).
-jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Copyright (C) 2001, Xiphophorus.
-OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
-PCRE Copyright (c) 1997-2008 University of Cambridge.
-SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga.
-SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com).
-xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
-zlib Copyright (C) 1995-2002 Jean-loup Gailly und Mark Adler.
-google-perftools Copyright (c) 2005, Google Inc.
+        APR Copyright (C) 2000-2004 The Apache Software Foundation.
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg (daniel@haxx.se).
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University sowie David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW).
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus.
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge.
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga.
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com).
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly und Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-Second Life Viewer verwendet Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (und Lizenzgeber). Alle Rechte vorbehalten. Details siehe www.havok.com.
+        Second Life Viewer verwendet Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (und Lizenzgeber). Alle Rechte vorbehalten. Details siehe www.havok.com.
 
-Alle Rechte vorbehalten.  Details siehe licenses.txt.
+        Diese Software enthält von der NVIDIA Corporation bereitgestellten Quellcode.
 
-Audiocodierung für Voice-Chat: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+        Alle Rechte vorbehalten.  Details siehe licenses.txt.
+
+        Audiocodierung für Voice-Chat: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml
index 3cf3a162470..b893ab79e50 100644
--- a/indra/newview/skins/default/xui/de/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/de/floater_about_land.xml
@@ -130,7 +130,7 @@
 				Traffic:
 			</text>
 			<text name="DwellText">
-				0
+				Laden...
 			</text>
 			<button label="Land kaufen" label_selected="Land kaufen..." name="Buy Land..."/>
 			<button label="Linden-Verkauf" label_selected="Linden-Verkauf..." name="Linden Sale..." tool_tip="Land muss Eigentum und auf Inhalt gesetzt sein und nicht zur Auktion stehen."/>
@@ -310,13 +310,15 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 				Kein Stoßen (regional)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Auf dieser Parzelle Einwohner sehen und mit ihnen chatten
+				Avatare auf anderen Parzellen können
 			</panel.string>
 			<text name="allow_label">
 				Anderen Einwohnern gestatten:
 			</text>
-			<check_box label="Terrain bearbeiten" name="edit land check" tool_tip="Falls aktiviert, kann jeder Ihr Land terraformen. Am besten ist es, wenn Sie diese Option deaktiviert lassen. Sie können Ihr eigenes Land jederzeit bearbeiten."/>
-			<check_box label="Fliegen" name="check fly" tool_tip="Falls aktiviert, können Einwohner auf Ihrem Land fliegen. Falls nicht aktiviert, können Einwohner lediglich auf Ihr Land fliegen und dort landen (dann jedoch nicht wieder weiterfliegen) oder über Ihr Land hinweg fliegen."/>
+			<text name="allow_label0">
+				Fliegen:
+			</text>
+			<check_box label="Jeder" name="check fly" tool_tip="Falls aktiviert, können Einwohner auf Ihrem Land fliegen. Falls nicht aktiviert, können Einwohner lediglich auf Ihr Land fliegen und dort landen (dann jedoch nicht wieder weiterfliegen) oder über Ihr Land hinweg fliegen."/>
 			<text name="allow_label2">
 				Bauen:
 			</text>
@@ -332,9 +334,6 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 			</text>
 			<check_box label="Jeder" name="check other scripts"/>
 			<check_box label="Gruppe" name="check group scripts"/>
-			<text name="land_options_label">
-				Landoptionen:
-			</text>
 			<check_box label="Sicher (kein Schaden)" name="check safe" tool_tip="Falls aktiviert, wird Land auf Option „Sicher“ eingestellt, Kampfschäden sind deaktiviert. Ansonsten sind Kampfschäden aktiviert."/>
 			<check_box label="Kein Stoßen" name="PushRestrictCheck" tool_tip="Verhindert Stoßen durch Skripte. Durch Aktivieren dieser Option verhindern Sie störendes Verhalten auf Ihrem Land."/>
 			<check_box label="Ort in Suche anzeigen (30 L$/Woche)" name="ShowDirectoryCheck" tool_tip="Diese Parzelle in Suchergebnissen anzeigen."/>
@@ -375,9 +374,9 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Klicken Sie hier, um ein Bild auszuwählen"/>
 			<text name="allow_label5">
-				Einwohnern auf anderen Parzellen Folgendes gestatten:
+				Avatare auf dieser Parzelle sehen und mit ihnen chatten
 			</text>
-			<check_box label="Avatare sehen" name="SeeAvatarsCheck" tool_tip="Gestattet sowohl Einwohnern auf anderen Parzellen, Einwohner auf dieser Parzelle zu sehen und mit ihnen zu chatten, als auch Ihnen, diese Einwohner auf anderen Parzellen zu sehen und mit ihnen zu chatten."/>
+			<check_box label="Avatare sehen" name="SeeAvatarsCheck" tool_tip="Gestattet sowohl Avataren auf anderen Parzellen, Avatare auf dieser Parzelle zu sehen und mit ihnen zu chatten, als auch Ihnen, diese Avatare auf anderen Parzellen zu sehen und mit ihnen zu chatten."/>
 			<text name="landing_point">
 				Landepunkt: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/de/floater_avatar.xml b/indra/newview/skins/default/xui/de/floater_avatar.xml
index 1470c4bcd6b..ba0dd54d96e 100644
--- a/indra/newview/skins/default/xui/de/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/de/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="AVATAR-AUSWAHL"/>
+<floater name="Avatar" title="AVATAR AUSWÄHLEN"/>
diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml
index e766b622f7b..65926c088c7 100644
--- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung]
+		[http://www.secondlife.com/my/account/payment_method_management.php Zahlungsart] | [http://www.secondlife.com/my/account/currency.php Währung]
 	</text>
 	<text name="exchange_rate_note">
 		Geben Sie den Betrag erneut ein, um die aktuellste Umtauschrate anzuzeigen.
diff --git a/indra/newview/skins/default/xui/de/floater_camera.xml b/indra/newview/skins/default/xui/de/floater_camera.xml
index 7e9ebdb6435..163ef87d8c1 100644
--- a/indra/newview/skins/default/xui/de/floater_camera.xml
+++ b/indra/newview/skins/default/xui/de/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="ANSICHT">
+<floater name="camera_floater" title="KAMERASTEUERUNGEN">
 	<floater.string name="rotate_tooltip">
 		Kamera um Fokus drehen
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml
index 9644bbbaea3..ca081aafae8 100644
--- a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml
@@ -4,7 +4,7 @@
 		Filtern:
 	</text>
 	<check_box label="Anisotropische Filterung (langsamer, wenn aktiviert)" name="ani"/>
-	<text name="Antialiasing:">
+	<text name="antialiasing label">
 		Antialiasing:
 	</text>
 	<combo_box label="Antialiasing" name="fsaa">
diff --git a/indra/newview/skins/default/xui/de/floater_model_preview.xml b/indra/newview/skins/default/xui/de/floater_model_preview.xml
index 7f6cd9944f2..4af8d67686f 100644
--- a/indra/newview/skins/default/xui/de/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/de/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Fehler: Fehler beim DAE-Parsen – Details siehe Protokoll.
 	</string>
+	<string name="status_material_mismatch">
+		Fehler: Das Material des Modells ist keine Teilmenge des Referenzmodells.
+	</string>
 	<string name="status_reading_file">
 		Laden...
 	</string>
@@ -137,7 +140,7 @@
 				</panel>
 				<panel name="physics analysis">
 					<text name="method_label">
-						Schritt 2: Analyse
+						Schritt 2: Analysieren
 					</text>
 					<text name="analysis_method_label">
 						Methode:
diff --git a/indra/newview/skins/default/xui/de/floater_model_wizard.xml b/indra/newview/skins/default/xui/de/floater_model_wizard.xml
index 354a505901c..a90f36f2026 100644
--- a/indra/newview/skins/default/xui/de/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/de/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Hochzuladende Modelldatei auswählen
 			</text>
 			<button label="Durchsuchen..." label_selected="Durchsuchen..." name="browse"/>
+			<text name="Model types">
+				Second Life unterstützt COLLADA-Dateien (.dae).
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/de/floater_moveview.xml b/indra/newview/skins/default/xui/de/floater_moveview.xml
index e8cc77c0386..c1c8271310b 100644
--- a/indra/newview/skins/default/xui/de/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/de/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="BEWEGEN">
+<floater name="move_floater" title="GEHEN / RENNEN / FLIEGEN">
 	<string name="walk_forward_tooltip">
 		Vorwärts gehen (Nach-oben-Pfeil oder W drücken)
 	</string>
diff --git a/indra/newview/skins/default/xui/de/floater_snapshot.xml b/indra/newview/skins/default/xui/de/floater_snapshot.xml
index ae68c71a80c..798461c0075 100644
--- a/indra/newview/skins/default/xui/de/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/de/floater_snapshot.xml
@@ -3,73 +3,63 @@
 	<floater.string name="unknown">
 		unbekannt
 	</floater.string>
-	<radio_group label="Fototyp" name="snapshot_type_radio">
-		<radio_item label="E-Mail" name="postcard"/>
-		<radio_item label="Mein Inventar ([AMOUNT] L$)" name="texture"/>
-		<radio_item label="Auf meinem Computer speichern" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		E-Mail senden
+	</string>
+	<string name="profile_progress_str">
+		Posten
+	</string>
+	<string name="inventory_progress_str">
+		Speichern im Inventar
+	</string>
+	<string name="local_progress_str">
+		Speichern auf Computer
+	</string>
+	<string name="profile_succeeded_str">
+		Bild hochgeladen
+	</string>
+	<string name="postcard_succeeded_str">
+		E-Mail gesendet!
+	</string>
+	<string name="inventory_succeeded_str">
+		Im Inventar gespeichert!
+	</string>
+	<string name="local_succeeded_str">
+		Auf Computer gespeichert!
+	</string>
+	<string name="profile_failed_str">
+		Fehler beim Hochladen des Bilds in Ihr Profil.
+	</string>
+	<string name="postcard_failed_str">
+		Fehler beim Senden der E-Mail.
+	</string>
+	<string name="inventory_failed_str">
+		Fehler beim Speichern im Inventar.
+	</string>
+	<string name="local_failed_str">
+		Fehler beim Speichern auf dem Computer.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Erweiterte Optionen"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[SIZE] KB
 	</text>
-	<button label="Foto aktualisieren" name="new_snapshot_btn"/>
-	<button label="Senden" name="send_btn"/>
-	<button label="Speichern ([AMOUNT] L$)" name="upload_btn"/>
-	<flyout_button label="Speichern" name="save_btn" tool_tip="Bild als Datei speichern">
-		<flyout_button.item label="Speichern" name="save_item"/>
-		<flyout_button.item label="Speichern unter..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Mehr" name="more_btn" tool_tip="Erweiterte Optionen"/>
-	<button label="Weniger" name="less_btn" tool_tip="Erweiterte Optionen"/>
-	<button label="Abbrechen" name="discard_btn"/>
-	<text name="type_label2">
-		Größe
-	</text>
-	<text name="format_label">
-		Format
-	</text>
-	<combo_box label="Auflösung" name="postcard_size_combo">
-		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
-	</combo_box>
-	<combo_box label="Auflösung" name="texture_size_combo">
-		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
-		<combo_box.item label="Klein (128x128)" name="Small(128x128)"/>
-		<combo_box.item label="Mittel (256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="Groß (512x512)" name="Large(512x512)"/>
-		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
-	</combo_box>
-	<combo_box label="Auflösung" name="local_size_combo">
-		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
-	</combo_box>
-	<combo_box label="Format" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="Breite" name="snapshot_width"/>
-	<spinner label="Größe" name="snapshot_height"/>
-	<check_box label="Seitenverhältnis beibehalten" name="keep_aspect_check"/>
-	<slider label="Bildqualität" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Aufnehmen:
-	</text>
-	<combo_box label="Bildlayer" name="layer_types">
-		<combo_box.item label="Farben" name="Colors"/>
-		<combo_box.item label="Tiefe" name="Depth"/>
-	</combo_box>
-	<check_box label="Schnittstelle" name="ui_check"/>
-	<check_box label="HUDs" name="hud_check"/>
-	<check_box label="Nach dem Speichern offen lassen" name="keep_open_check"/>
-	<check_box label="Frame einfrieren (Vollbild)" name="freeze_frame_check"/>
-	<check_box label="Automatisch aktualisieren" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			ERWEITERTE OPTIONEN
+		</text>
+		<text name="layer_type_label">
+			Aufnahme:
+		</text>
+		<combo_box label="Bildebenen" name="layer_types">
+			<combo_box.item label="Farben" name="Colors"/>
+			<combo_box.item label="Tiefe" name="Depth"/>
+		</combo_box>
+		<check_box label="Schnittstelle" name="ui_check"/>
+		<check_box label="HUDs" name="hud_check"/>
+		<check_box label="Standbild (Vollbild)" name="freeze_frame_check"/>
+		<check_box label="Automatisch aktualisieren" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/de/floater_toybox.xml b/indra/newview/skins/default/xui/de/floater_toybox.xml
index 23ec9c2e58a..90e50804d65 100644
--- a/indra/newview/skins/default/xui/de/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/de/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="SYMBOLLEISTEN ANPASSEN">
+<floater name="Toybox" title="SYMBOLLEISTENSCHALTFLÄCHEN">
 	<text name="toybox label 1">
 		Sie können Schaltflächen durch Ziehen zu Symbolleisten hinzufügen oder daraus entfernen.
 	</text>
 	<text name="toybox label 2">
 		Je nach Einstellung erscheinen Schaltflächen wie dargestellt oder nur als Symbol.
 	</text>
+	<button label="Alle Symbolleisten leeren" label_selected="Alle Symbolleisten leeren" name="btn_clear_all"/>
 	<button label="Standards wiederherstellen" label_selected="Standards wiederherstellen" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/de/floater_translation_settings.xml b/indra/newview/skins/default/xui/de/floater_translation_settings.xml
new file mode 100644
index 00000000000..3d5d1d46a8b
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="ÃœBERSETZUNGSEINSTELLUNGEN FÃœR CHATS">
+	<string name="bing_api_key_not_verified">
+		Bing-AppID nicht verifiziert. Versuchen Sie es erneut.
+	</string>
+	<string name="google_api_key_not_verified">
+		Google-API-Schlüssel nicht verifiziert. Versuchen Sie es erneut.
+	</string>
+	<string name="bing_api_key_verified">
+		Bing-AppID verifiziert.
+	</string>
+	<string name="google_api_key_verified">
+		Google-API-Schlüssel verifiziert.
+	</string>
+	<check_box label="Maschinenübersetzung beim Chatten aktivieren" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Chat übersetzen in:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="Systemstandard" name="System Default Language"/>
+		<combo_box.item label="English (Englisch)" name="English"/>
+		<combo_box.item label="Dansk (Dänisch)" name="Danish"/>
+		<combo_box.item label="Deutsch" name="German"/>
+		<combo_box.item label="Español (Spanisch)" name="Spanish"/>
+		<combo_box.item label="Français (Französisch)" name="French"/>
+		<combo_box.item label="Italiano (Italienisch)" name="Italian"/>
+		<combo_box.item label="Magyar (Ungarisch)" name="Hungarian"/>
+		<combo_box.item label="Nederlands (Holländisch)" name="Dutch"/>
+		<combo_box.item label="Polski (Polnisch)" name="Polish"/>
+		<combo_box.item label="Português (Portugiesisch)" name="Portugese"/>
+		<combo_box.item label="Русский (Russisch)" name="Russian"/>
+		<combo_box.item label="Türkçe (Türkisch)" name="Turkish"/>
+		<combo_box.item label="Українська (Ukrainisch)" name="Ukrainian"/>
+		<combo_box.item label="中文 (正體) (Chinesisch)" name="Chinese"/>
+		<combo_box.item label="日本語 (Japanisch)" name="Japanese"/>
+		<combo_box.item label="한국어 (Koreanisch)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Übersetzungsservice auswählen:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		Bing-[http://www.bing.com/developers/createapp.aspx AppID]:
+	</text>
+	<button label="Verifizieren" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		Google-[http://code.google.com/apis/language/translate/v2/getting_started.html#auth API-Schlüssel]:
+	</text>
+	<button label="Verifizieren" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Pricing] | [https://code.google.com/apis/console Statistik]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="Abbrechen" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_voice_controls.xml b/indra/newview/skins/default/xui/de/floater_voice_controls.xml
index 18d53841b84..5efda4136ea 100644
--- a/indra/newview/skins/default/xui/de/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/de/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="SPRACHSTEUERUNGEN">
 	<string name="title_nearby">
-		Stimme in der Nähe
+		VOICE-EINSTELLUNGEN
 	</string>
 	<string name="title_group">
-		Gruppengespräch mit [GROUP]
+		GRUPPENGESPRÄCH MIT [GROUP]
 	</string>
 	<string name="title_adhoc">
-		Konferenzgespräch
+		KONFERENZGESPRÄCH
 	</string>
 	<string name="title_peer_2_peer">
-		Gespräch mit [NAME]
+		GESPRÄCH MIT [NAME]
 	</string>
 	<string name="no_one_near">
 		Es ist niemand in der Nähe, der Voice aktiviert hat.
diff --git a/indra/newview/skins/default/xui/de/menu_toolbars.xml b/indra/newview/skins/default/xui/de/menu_toolbars.xml
index cfeae3deca6..3fb48e26b2e 100644
--- a/indra/newview/skins/default/xui/de/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/de/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Schaltflächen auswählen..." name="Chose Buttons"/>
+	<menu_item_call label="Diese Schaltfläche entfernen" name="Remove button"/>
+	<menu_item_call label="Symbolleistenschaltflächen..." name="Choose Buttons"/>
 	<menu_item_check label="Symbole und Beschriftungen" name="icons_with_text"/>
 	<menu_item_check label="Nur Symbole" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index 90b2cfbc41d..a81874bee9c 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Ich" name="Me">
-		<menu_item_call label="Dashboard..." name="Manage My Account">
-			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=de"/>
-		</menu_item_call>
 		<menu_item_call label="Profil..." name="Profile"/>
 		<menu_item_call label="Aussehen..." name="ChangeOutfit"/>
+		<menu_item_call label="Avatar auswählen..." name="Avatar Picker"/>
 		<menu_item_check label="Inventar..." name="Inventory"/>
-		<menu_item_check label="Gesten..." name="Gestures"/>
-		<menu_item_check label="Stimme..." name="ShowVoice"/>
+		<menu_item_call label="Neues Inventarfenster" name="NewInventoryWindow"/>
+		<menu_item_call label="Orte..." name="Places"/>
+		<menu_item_call label="Auswahlen..." name="Picks"/>
+		<menu_item_call label="Kamerasteuerungen..." name="Camera Controls"/>
 		<menu label="Bewegung" name="Movement">
 			<menu_item_call label="Hinsetzen" name="Sit Down Here"/>
 			<menu_item_check label="Fliegen" name="Fly"/>
@@ -22,34 +22,39 @@
 		<menu_item_call label="Admin-Status anfordern" name="Request Admin Options"/>
 		<menu_item_call label="Admin-Status verlassen" name="Leave Admin Options"/>
 		<menu_item_call label="L$ kaufen" name="Buy and Sell L$"/>
+		<menu_item_call label="Kontoübersicht..." name="Manage My Account">
+			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=de"/>
+		</menu_item_call>
 		<menu_item_call label="Einstellungen..." name="Preferences"/>
-		<menu_item_call label="Symbolleisten..." name="Toolbars"/>
+		<menu_item_call label="Symbolleistenschaltflächen..." name="Toolbars"/>
 		<menu_item_call label="Alle Steuerelemente ausblenden" name="Hide UI"/>
 		<menu_item_call label="[APP_NAME] schließen" name="Quit"/>
 	</menu>
 	<menu label="Unterhalten" name="Communicate">
-		<menu_item_call label="Meine Freunde" name="My Friends"/>
-		<menu_item_call label="Meine Gruppen" name="My Groups"/>
-		<menu_item_check label="Chat in der Nähe" name="Nearby Chat"/>
+		<menu_item_check label="Chat..." name="Nearby Chat"/>
+		<menu_item_check label="Sprechen" name="Speak"/>
+		<menu_item_check label="Voice-Einstellungen..." name="Nearby Voice"/>
+		<menu_item_check label="Voice-Morphing..." name="ShowVoice"/>
+		<menu_item_check label="Gesten..." name="Gestures"/>
+		<menu_item_call label="Freunde" name="My Friends"/>
+		<menu_item_call label="Gruppen" name="My Groups"/>
 		<menu_item_call label="Leute in der Nähe" name="Active Speakers"/>
-		<menu_item_check label="Stimme in der Nähe" name="Nearby Voice"/>
 	</menu>
 	<menu label="Welt" name="World">
-		<menu_item_check label="Minikarte" name="Mini-Map"/>
+		<menu_item_call label="Landmarke für diesen Ort setzen" name="Create Landmark Here"/>
+		<menu_item_call label="Ziele..." name="Destinations"/>
 		<menu_item_check label="Karte" name="World Map"/>
+		<menu_item_check label="Minikarte" name="Mini-Map"/>
 		<menu_item_check label="Suchen" name="Search"/>
+		<menu_item_call label="Nach Hause teleportieren" name="Teleport Home"/>
+		<menu_item_call label="Hier als Zuhause wählen" name="Set Home to Here"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
-		<menu_item_call label="Landmarke für diesen Ort setzen" name="Create Landmark Here"/>
-		<menu label="Ortsprofil" name="Land">
-			<menu_item_call label="Ortsprofil" name="Place Profile"/>
-			<menu_item_call label="Land-Info" name="About Land"/>
-			<menu_item_call label="Region/Grundbesitz" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="Ortsprofil" name="Place Profile"/>
+		<menu_item_call label="Landinformationen" name="About Land"/>
+		<menu_item_call label="Region/Grundbesitz" name="Region/Estate"/>
+		<menu_item_call label="Mein Landbesitz..." name="My Land"/>
 		<menu_item_call label="Dieses Land kaufen" name="Buy Land"/>
-		<menu_item_call label="Mein Land" name="My Land"/>
 		<menu label="Anzeigen" name="LandShow">
-			<menu_item_check label="Bewegungssteuerung" name="Movement Controls"/>
-			<menu_item_check label="Ansichtsteuerung" name="Camera Controls"/>
 			<menu_item_check label="Bannlinien" name="Ban Lines"/>
 			<menu_item_check label="Strahlen" name="beacons"/>
 			<menu_item_check label="Grundstücksgrenzen" name="Property Lines"/>
@@ -58,16 +63,15 @@
 			<menu_item_check label="Parzelleneigenschaften" name="Parcel Properties"/>
 			<menu_item_check label="Menü „Erweitert“" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Teleport nach Hause" name="Teleport Home"/>
-		<menu_item_call label="Hier als Zuhause wählen" name="Set Home to Here"/>
 		<menu label="Sonne" name="Environment Settings">
 			<menu_item_call label="Sonnenaufgang" name="Sunrise"/>
 			<menu_item_call label="Mittag" name="Noon"/>
 			<menu_item_call label="Sonnenuntergang" name="Sunset"/>
 			<menu_item_call label="Mitternacht" name="Midnight"/>
+			<menu_item_call label="Regionseinstellungen verwenden" name="Use Region Settings"/>
 		</menu>
-		<menu label="Umgebungs-Editor" name="Enviroment Editor">
-			<menu_item_call label="Umgebungseinstellungen..." name="Enviroment Settings"/>
+		<menu label="Umwelt-Editor" name="Environment Editor">
+			<menu_item_call label="Umwelt-Einstellungen..." name="Environment Settings"/>
 			<menu label="Wasser-Voreinstellungen" name="Water Presets">
 				<menu_item_call label="Neue Voreinstellung..." name="new_water_preset"/>
 				<menu_item_call label="Voreinstellung bearbeiten..." name="edit_water_preset"/>
@@ -146,6 +150,7 @@
 		<menu_item_call label="Wiederholen" name="Redo"/>
 	</menu>
 	<menu label="Hilfe" name="Help">
+		<menu_item_call label="Anweisungen..." name="How To"/>
 		<menu_item_call label="[SECOND_LIFE]-Hilfe" name="Second Life Help"/>
 		<menu_item_call label="Missbrauch melden" name="Report Abuse"/>
 		<menu_item_call label="Fehler melden" name="Report Bug"/>
@@ -200,11 +205,10 @@
 		<menu_item_check label="Plugin Read Thread verwenden" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Gruppen-Cache löschen" name="ClearGroupCache"/>
 		<menu_item_check label="Weiche Mausbewegung" name="Mouse Smoothing"/>
+		<menu_item_call label="Tasten freigeben" name="Release Keys"/>
 		<menu label="Tastaturkürzel" name="Shortcuts">
 			<menu_item_call label="Bild ([COST] L$)..." name="Upload Image"/>
 			<menu_item_check label="Suchen" name="Search"/>
-			<menu_item_call label="Tasten freigeben" name="Release Keys"/>
-			<menu_item_call label="UI-Größe auf Standard setzen" name="Set UI Size to Default"/>
 			<menu_item_check label="Erweitert-Menü anzeigen - veraltetet" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fenster schließen" name="Close Window"/>
 			<menu_item_call label="Alle Fenster schließen" name="Close All Windows"/>
@@ -290,6 +294,7 @@
 			<menu_item_check label="Lichter" name="Lights"/>
 			<menu_item_check label="Gelenkpunkte" name="Collision Skeleton"/>
 			<menu_item_check label="Raycast" name="Raycast"/>
+			<menu_item_check label="Windvektoren" name="Wind Vectors"/>
 			<menu_item_check label="Komplexität beim Rendern" name="rendercomplexity"/>
 			<menu_item_check label="Formen" name="Sculpt"/>
 		</menu>
@@ -302,7 +307,6 @@
 			<menu_item_check label="Licht und Schatten" name="Lighting and Shadows"/>
 			<menu_item_check label="Schatten von Sonne-/Mond-Projektoren" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO und Schattenglättung" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Globale Beleuchtung (experimentell)" name="Global Illumination"/>
 			<menu_item_check label="Fehler in GL beseitigen" name="Debug GL"/>
 			<menu_item_check label="Fehler in Pipeline beseitigen" name="Debug Pipeline"/>
 			<menu_item_check label="Automatische Alpha-Masken (aufgeschoben)" name="Automatic Alpha Masks (deferred)"/>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index a5fcd3e0b41..a34b938a7a6 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -1124,8 +1124,13 @@ Der Gruppe „[GROUP_NAME]“ [AREA] m² an Land schenken?
 	<notification name="DisplaySetToSafe">
 		Es wurden sichere Anzeige-Einstellungen gewählt, da die Option -safe verwendet wurde.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Es wurden die für Ihre Systemkonfiguration empfohlenen Anzeige-Einstellungen gewählt.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		Die Anzeigeeinstellungen wurden auf die empfohlenen Werte gesetzt, da Ihre Grafikkarte geändert wurde
+von „[LAST_GPU]“
+in „[THIS_GPU]“
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		Aufgrund einer Änderung des Rendersubsystems wurden die Anzeigeeinstellungen auf die empfohlenen Werte gesetzt.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1926,7 +1931,13 @@ Inventarobjekt(e) verschieben?
 		<usetemplate ignoretext="Bestätigen, bevor Sitzung beendet wird" name="okcancelignore" notext="Nicht beenden" yestext="Beenden"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		Möchten Sie wirklich Ihre Standardschaltflächen und -symbolleisten wiederherstellen? 
+		Durch diese Aktion werden Ihre Standardschaltflächen und -symbolleisten wiederhergestellt.
+
+Diese Aktion kann nicht rückgängig gemacht werden.
+		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Durch diese Aktion werden alle Schaltflächen zurück in die Toolbox gestellt; die Symbolleisten sind leer.
     
 Diese Aktion kann nicht rückgängig gemacht werden.
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
@@ -2250,14 +2261,16 @@ Wählen Sie ein einzelnes Objekt aus.
 		Ihre Visitenkarte wurde abgelehnt.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Sie können an Positionen wie „[NAME]“ teleportieren, wenn Sie rechts in Ihrem Bildschirm die Tafel „Orte“ öffnen und dann die Registerkarte „Meine Landmarken“ auswählen.
-Klicken Sie auf eine Landmarke, um diese auszuwählen. Klicken Sie anschließend auf unten in der Registerkarte auf „Teleportieren“.
-(Sie können auch auf die Landmarke doppelt klicken oder mit rechts auf die Landmarke klicken und dann „Teleportieren“ auswählen).
+		Um zu Orten wie „[NAME]“ zu teleportieren, klicken Sie zuerst auf die Schaltfläche „Orte“
+    und dann im eingeblendeten Fenster auf die Registerkarte „Landmarken“. Klicken Sie auf
+    die gewünschte Landmarke und dann unten im Fenster auf „Teleportieren“.
+    (Sie können auch auf die Landmarke doppelklicken bzw. sie mit der rechten Maustaste ankklicken und dann
+    „Teleportieren“ wählen.)
 	</notification>
 	<notification name="TeleportToPerson">
-		Sie können Einwohner wie „[NAME]“ kontaktieren, wenn Sie die Tafel „Leute“ auf der rechten Seite Ihres Bildschirms öffnen.
-Wählen Sie den Einwohner aus der Liste aus und klicken Sie unten auf „IM“.
-(Sie können auch auf den Namen doppelt klicken oder mit rechts auf den Namen klicken und dann „IM“ auswählen).
+		Um Einwohner wie „[NAME]“ zu kontaktieren, klicken Sie auf die Schaltfläche „Leute“, wählen Sie eingeblendeten Fenster einen Einwohner aus
+    und klicken Sie unten im Fenster auf „IM“.
+    (Sie können auch auf den Namen doppelklicken bzw. ihn mit der rechten Maustaste anklicken und dann „IM“ wählen.)
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		Land kann nicht über Servergrenzen hinweg ausgewählt werden.
@@ -2278,6 +2291,9 @@ Wählen Sie eine kleinere Landfläche.
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Event-Benachrichtigung:
 
diff --git a/indra/newview/skins/default/xui/de/panel_edit_skin.xml b/indra/newview/skins/default/xui/de/panel_edit_skin.xml
index f167f45e98a..60f6919485c 100644
--- a/indra/newview/skins/default/xui/de/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/de/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Kopftattoo" name="Head Tattoos" tool_tip="Zum Auswählen eines Bildes hier klicken"/>
-		<texture_picker label="Obere Tattoos" name="Upper Tattoos" tool_tip="Zum Auswählen eines Bildes hier klicken"/>
-		<texture_picker label="Untere Tattoos" name="Lower Tattoos" tool_tip="Zum Auswählen eines Bildes hier klicken"/>
+		<texture_picker label="Kopf" name="Head" tool_tip="Klicken, um ein Bild zu wählen"/>
+		<texture_picker label="Oberkörper" name="Upper Body" tool_tip="Klicken, um ein Bild zu wählen"/>
+		<texture_picker label="Unterkörper" name="Lower Body" tool_tip="Klicken, um ein Bild zu wählen"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/de/panel_postcard_message.xml b/indra/newview/skins/default/xui/de/panel_postcard_message.xml
new file mode 100644
index 00000000000..6eeef8af712
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		An:
+	</text>
+	<text name="name_label">
+		Von:
+	</text>
+	<text name="subject_label">
+		Betreff:
+	</text>
+	<line_editor label="Betreff hier eingeben." name="subject_form"/>
+	<text name="msg_label">
+		Nachricht:
+	</text>
+	<text_editor name="msg_form">
+		Nachricht hier eingeben.
+	</text_editor>
+	<button label="Abbrechen" name="cancel_btn"/>
+	<button label="Senden" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_postcard_settings.xml b/indra/newview/skins/default/xui/de/panel_postcard_settings.xml
new file mode 100644
index 00000000000..c1a1c0cc463
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Auflösung" name="postcard_size_combo">
+		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="Breite" name="postcard_snapshot_width"/>
+			<spinner label="Höhe" name="postcard_snapshot_height"/>
+			<check_box label="Seitenverhältnis beibehalten" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Bildqualität" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml
index 04f6c273301..746a561e6c6 100644
--- a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml
@@ -29,30 +29,5 @@
 	<check_box label="IM-Chats" name="EnableIMChatPopups" tool_tip="Markieren, um Popups zu sehen, wenn Instant Message eintrifft"/>
 	<spinner label="Lebenszeit von Toasts für Chat in der Nähe:" name="nearby_toasts_lifetime"/>
 	<spinner label="Ein-/Ausblenddauer von Toasts für Chat in der Nähe:" name="nearby_toasts_fadingtime"/>
-	<check_box name="translate_chat_checkbox"/>
-	<text name="translate_chb_label">
-		Beim Chatten Maschinenübersetzung verwenden
-	</text>
-	<text name="translate_language_text">
-		Chat übersetzen in:
-	</text>
-	<combo_box name="translate_language_combobox" width="200">
-		<combo_box.item label="Systemstandard" name="System Default Language"/>
-		<combo_box.item label="English (Englisch)" name="English"/>
-		<combo_box.item label="Dansk (Dänisch)" name="Danish"/>
-		<combo_box.item label="Deutsch" name="German"/>
-		<combo_box.item label="Español (Spanisch)" name="Spanish"/>
-		<combo_box.item label="Français (Französisch)" name="French"/>
-		<combo_box.item label="Italiano (Italienisch)" name="Italian"/>
-		<combo_box.item label="Magyar (Ungarisch)" name="Hungarian"/>
-		<combo_box.item label="Nederlands (Holländisch)" name="Dutch"/>
-		<combo_box.item label="Polski (Polnisch)" name="Polish"/>
-		<combo_box.item label="Português (Portugiesisch)" name="Portugese"/>
-		<combo_box.item label="Русский (Russisch)" name="Russian"/>
-		<combo_box.item label="Türkçe (Türkisch)" name="Turkish"/>
-		<combo_box.item label="Українська (Ukrainisch)" name="Ukrainian"/>
-		<combo_box.item label="中文 (正體) (Chinesisch)" name="Chinese"/>
-		<combo_box.item label="日本語 (Japanisch)" name="Japanese"/>
-		<combo_box.item label="한국어 (Koreanisch)" name="Korean"/>
-	</combo_box>
+	<button label="Übersetzungseinstellungen für Chats" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
index 8b18bf8659f..8c7ea688d7f 100644
--- a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Meinen Browser verwenden (IE, Firefox, Safari)" name="external" tool_tip="Standard Webbrowser des Systems verwenden, um die Hilfe, Weblinks usw. anzuzeigen. Bei Vollbildmodus nicht empfohlen." value="1"/>
+		<radio_item label="Meinen Browser verwenden (IE, Firefox, Safari)" name="external" tool_tip="Standard Webbrowser des Systems verwenden, um die Hilfe, Weblinks usw. anzuzeigen. Bei Vollbildmodus nicht empfohlen." value="true"/>
 		<radio_item label="Integrierten Browser verwenden" name="internal" tool_tip="Integrierten Webbrowser verwenden, um die Hilfe, Weblinks usw. anzuzeigen. Dieser Browser öffnet als neues Fenster innerhalb von [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Plugins aktivieren" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..10827ce6f20
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		In meinem Inventar speichern
+	</text>
+	<text name="hint_lbl">
+		Das Speichern eines Bilds in Ihrem Inventar kostet [UPLOAD_COST] L$. Um das Bild als Textur zu speichern, wählen Sie eines der quadratischen Formate aus.
+	</text>
+	<combo_box label="Auflösung" name="texture_size_combo">
+		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+		<combo_box.item label="Klein (128x128)" name="Small(128x128)"/>
+		<combo_box.item label="Mittel (256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="Groß (512x512)" name="Large(512x512)"/>
+		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
+	</combo_box>
+	<spinner label="Breite" name="inventory_snapshot_width"/>
+	<spinner label="Höhe" name="inventory_snapshot_height"/>
+	<check_box label="Seitenverhältnis beibehalten" name="inventory_keep_aspect_check"/>
+	<button label="Abbrechen" name="cancel_btn"/>
+	<button label="Speichern" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_local.xml b/indra/newview/skins/default/xui/de/panel_snapshot_local.xml
new file mode 100644
index 00000000000..3aeae803882
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Auf meinem Computer speichern
+	</text>
+	<combo_box label="Auflösung" name="local_size_combo">
+		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="Breite" name="local_snapshot_width"/>
+			<spinner label="Höhe" name="local_snapshot_height"/>
+			<check_box label="Seitenverhältnis beibehalten" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Format" name="local_format_combo">
+				<combo_box.item label="PNG (verlustfrei)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (verlustfrei)" name="BMP"/>
+			</combo_box>
+			<slider label="Bildqualität" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Abbrechen" name="cancel_btn"/>
+	<flyout_button label="Speichern" name="save_btn" tool_tip="Bild als Datei speichern">
+		<flyout_button.item label="Speichern" name="save_item"/>
+		<flyout_button.item label="Speichern unter..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
new file mode 100644
index 00000000000..e1d8a5dc6d4
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="In meinem Profil posten" name="save_to_profile_btn"/>
+	<button label="E-Mail" name="save_to_email_btn"/>
+	<button label="In meinem Inventar speichern ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+	<button label="Auf meinem Computer speichern" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..c9afe86d7fe
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		Postkarte aus [SECOND_LIFE].
+	</string>
+	<string name="default_message">
+		Sehen Sie mal!
+	</string>
+	<string name="upload_message">
+		Senden...
+	</string>
+	<text name="title">
+		E-Mail
+	</text>
+	<button label="Nachricht" name="message_btn"/>
+	<button label="Einstellungen" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..8d1c52dea82
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		In meinem Profil posten
+	</text>
+	<combo_box label="Auflösung" name="profile_size_combo">
+		<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Benutzerdefiniert" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="Breite" name="profile_snapshot_width"/>
+			<spinner label="Höhe" name="profile_snapshot_height"/>
+			<check_box label="Seitenverhältnis beibehalten" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Bildunterschrift:
+			</text>
+			<check_box initial_value="true" label="Ort einschließen" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Abbrechen" name="cancel_btn"/>
+	<button label="Posten" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 2929556d430..14e9fcdb7f3 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -1214,7 +1214,7 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		Sie haben keine Kopie dieser Textur in Ihrem Inventar.
 	</string>
 	<string name="InventoryInboxNoItems">
-		Objekte, die auf dem Marktplatz gekauft wurden, werden hierher geliefert.
+		Wenn Sie einen Artikel kaufen oder anderweitig erhalten, erscheint er hier, damit Sie ihn in einen Ordner in Ihrem Inventar ziehen bzw. löschen können, wenn Sie ihn nicht behalten möchten.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1412,6 +1412,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="no_attachments">
 		Keine Anhänge getragen
 	</string>
+	<string name="Attachments remain">
+		Anhänge (noch [COUNT] Positionen frei)
+	</string>
 	<string name="Buy">
 		Kaufen
 	</string>
@@ -1538,6 +1541,12 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="Right Pec">
 		Rechts
 	</string>
+	<string name="Neck">
+		Hals
+	</string>
+	<string name="Avatar Center">
+		Avatar-Mitte
+	</string>
 	<string name="Invalid Attachment">
 		Ungültige Stelle für Anhang
 	</string>
@@ -4030,6 +4039,18 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_
 	<string name="you_paid_ldollars_no_name">
 		Sie haben [REASON] [AMOUNT] L$ bezahlt.
 	</string>
+	<string name="you_paid_failure_ldollars">
+		Sie haben [NAME] [AMOUNT] L$ [REASON] nicht bezahlt.
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		Sie haben [AMOUNT] L$ nicht bezahlt.
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		Sie haben [NAME] [AMOUNT] L$ nicht bezahlt.
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		Sie haben [AMOUNT] L$ [REASON] nicht bezahlt.
+	</string>
 	<string name="for item">
 		für [ITEM]
 	</string>
@@ -4440,6 +4461,12 @@ Setzen Sie den Editorpfad in Anführungszeichen
 	<string name="ExternalEditorFailedToRun">
 		Externer Editor konnte nicht ausgeführt werden.
 	</string>
+	<string name="TranslationFailed">
+		Ãœbersetzung fehlgeschlagen: [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Fehler beim Parsen der Ãœbersetzungsantwort.
+	</string>
 	<string name="Esc">
 		Esc
 	</string>
@@ -4810,7 +4837,7 @@ Setzen Sie den Editorpfad in Anführungszeichen
 		Minikarte
 	</string>
 	<string name="Command_Move_Label">
-		Bewegen
+		Gehen / Rennen / Fliegen
 	</string>
 	<string name="Command_People_Label">
 		Leute
@@ -4837,10 +4864,10 @@ Setzen Sie den Editorpfad in Anführungszeichen
 		Sprechen
 	</string>
 	<string name="Command_View_Label">
-		Ansicht
+		Kamerasteuerungen
 	</string>
 	<string name="Command_Voice_Label">
-		Stimme in der Nähe
+		Voice-Einstellungen
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		Informationen zu dem von Ihnen besuchten Land
@@ -4912,7 +4939,16 @@ Setzen Sie den Editorpfad in Anführungszeichen
 		Kamerawinkel ändern
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Leute in der Nähe mit Sprechfähigkeit
+		Lautstärkeregler für Anrufe und Leute in Ihrer Nähe in SL
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		gegenwärtig in der unteren Symbolleiste
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		gegenwärtig in der linken Symbolleiste
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		gegenwärtig in der rechten Symbolleiste
 	</string>
 	<string name="Retain%">
 		% zurückbehalten
@@ -4938,4 +4974,19 @@ Setzen Sie den Editorpfad in Anführungszeichen
 	<string name="Normal">
 		Normal
 	</string>
+	<string name="snapshot_quality_very_low">
+		Sehr niedrig
+	</string>
+	<string name="snapshot_quality_low">
+		Niedrig
+	</string>
+	<string name="snapshot_quality_medium">
+		Mittel
+	</string>
+	<string name="snapshot_quality_high">
+		Hoch
+	</string>
+	<string name="snapshot_quality_very_high">
+		Sehr hoch
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/de/teleport_strings.xml b/indra/newview/skins/default/xui/de/teleport_strings.xml
index bbfc8306888..9cf381bacc1 100644
--- a/indra/newview/skins/default/xui/de/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/de/teleport_strings.xml
@@ -21,8 +21,8 @@ Wenn der Teleport dann immer noch nicht funktioniert, melden Sie sich bitte ab u
 Versuchen Sie es später noch einmal.
 		</message>
 		<message name="NoHelpIslandTP">
-		Sie können nicht zurück nach Welcome Island teleportieren. 
-Gehen Sie zu „Welcome Island Public“ und wiederholen sie das Tutorial.
+			Sie können nicht zurück nach Welcome Island teleportieren.
+Gehen Sie zu „Welcome Island Public“, um das Tutorial zu wiederholen.
 		</message>
 		<message name="noaccess_tport">
 			Sie haben leider keinen Zugang zu diesem Teleport-Ziel.
diff --git a/indra/newview/skins/default/xui/es/floater_about.xml b/indra/newview/skins/default/xui/es/floater_about.xml
index b7c9cc27acd..307b61133f3 100644
--- a/indra/newview/skins/default/xui/es/floater_about.xml
+++ b/indra/newview/skins/default/xui/es/floater_about.xml
@@ -67,32 +67,34 @@ Versión del servidor de voz: [VOICE_VERSION]
 		<panel label="Licencias" name="licenses_panel">
 			<text_editor name="credits_editor">
 				3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
-APR Copyright (C) 2000-2004 The Apache Software Foundation
-Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
-cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
-DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
-expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Copyright (C) 1999-2004 Brian Paul.
-GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University y David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Copyright (c) 2005, Google Inc.
-Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
-jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Copyright (C) 2001, Xiphophorus
-OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
-PCRE Copyright (c) 1997-2008 University of Cambridge
-SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
-zlib Copyright (C) 1995-2002 Jean-loup Gailly y Mark Adler.
-google-perftools Copyright (c) 2005, Google Inc.
+        APR Copyright (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-El visor de Second Life utiliza Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (y los propietarios de las licencias). Reservados todos los derechos. Consulta www.havok.com si deseas obtener más información.
+        El visor de Second Life usa Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (y sus licenciadores). Reservados todos los derechos. Vea los detalles en www.havok.com.
 
-Reservados todos los derechos.  Consulta las licencias en .txt si deseas obtener más información.
+        Este software contiene código fuente suministrado por NVIDIA Corporation.
 
-Codificación de sonido del chat de voz: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+        Reservados todos los derechos.  Consulte los detalles en licenses.txt.
+
+        Codificación del audio del chat de voz: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml
index b6391e28a01..6b8a1ff906d 100644
--- a/indra/newview/skins/default/xui/es/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/es/floater_about_land.xml
@@ -130,7 +130,7 @@ Vaya al menú Mundo &gt; Acerca del terreno o seleccione otra parcela para ver s
 				Tráfico:
 			</text>
 			<text name="DwellText">
-				0
+				Cargando...
 			</text>
 			<button label="Comprar terreno" left="130" name="Buy Land..." width="125"/>
 			<button label="Venta Linden" name="Linden Sale..." tool_tip="El terreno debe estar en propiedad, con contenido, y no estar en subasta."/>
@@ -309,13 +309,15 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
 				Sin &apos;empujones&apos; (prevalece lo marcado en la región)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Ver a los residentes de esta parcela y chatear con ellos
+				Los avatares de otras parcelas pueden ver
 			</panel.string>
 			<text name="allow_label">
 				Permitir a otros Residentes:
 			</text>
-			<check_box label="Editar el terreno" name="edit land check" tool_tip="Si se marca, cualquiera podrá modificar su terreno. Mejor dejarlo desmarcado, pues usted siempre puede modificar su terreno."/>
-			<check_box label="Volar" name="check fly" tool_tip="Si se marca, los residentes podrán volar en su terreno. Si no, sólo podrán volar al cruzarlo o hasta que aterricen en él."/>
+			<text name="allow_label0">
+				Volar:
+			</text>
+			<check_box label="Todos" name="check fly" tool_tip="Si se marca, los residentes podrán volar en su terreno. Si no, sólo podrán volar al cruzarlo o hasta que aterricen en él."/>
 			<text name="allow_label2">
 				Crear objetos:
 			</text>
@@ -331,9 +333,6 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
 			</text>
 			<check_box label="Todos los residentes" name="check other scripts"/>
 			<check_box label="El grupo" name="check group scripts"/>
-			<text name="land_options_label">
-				Opciones del terreno:
-			</text>
 			<check_box label="Seguro (sin daño)" name="check safe" tool_tip="Si se marca, convierte el terreno en &apos;seguro&apos;, desactivando el daño en combate. Si no, se activa el daño en combate."/>
 			<check_box label="Sin &apos;empujones&apos;" name="PushRestrictCheck" tool_tip="Previene scripts que empujen. Marcando esta opción prevendrá que en su terreno haya comportamientos destructivos."/>
 			<check_box label="Mostrar el sitio en la búsqueda (30 L$/semana)" name="ShowDirectoryCheck" tool_tip="Let people see this parcel in search results"/>
@@ -374,9 +373,9 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Pulse para elegir una imagen"/>
 			<text name="allow_label5">
-				Permitir a los residentes de otras parcelas:
+				a los avatares de esta parcela y chatear con ellos
 			</text>
-			<check_box label="Ver los avatares" name="SeeAvatarsCheck" tool_tip="Permite que los residentes de otras parcelas vean a los residentes de ésta y chateen con ellos, y también que tú puedas verles y chatear con ellos."/>
+			<check_box label="Ver los avatares" name="SeeAvatarsCheck" tool_tip="Permite que los avatares de otras parcelas vean a los avatares de ésta y chateen con ellos, y también que tú puedas verles y chatear con ellos."/>
 			<text name="landing_point">
 				Punto de llegada: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/es/floater_avatar.xml b/indra/newview/skins/default/xui/es/floater_avatar.xml
index 7c87fbe01cc..21d202309f4 100644
--- a/indra/newview/skins/default/xui/es/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/es/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="SELECTOR DE AVATAR"/>
+<floater name="Avatar" title="ELIGE UN AVATAR"/>
diff --git a/indra/newview/skins/default/xui/es/floater_camera.xml b/indra/newview/skins/default/xui/es/floater_camera.xml
index f8911f3a4a5..b0704ab7889 100644
--- a/indra/newview/skins/default/xui/es/floater_camera.xml
+++ b/indra/newview/skins/default/xui/es/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="VER">
+<floater name="camera_floater" title="CONTROLES DE LA CÁMARA">
 	<floater.string name="rotate_tooltip">
 		Girar la cámara alrededor de lo enfocado
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
index 0150241d9a9..b96076836b4 100644
--- a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
@@ -4,7 +4,7 @@
 		Filtrado:
 	</text>
 	<check_box label="Filtrado anisotrópico (más lento si se activa)" name="ani"/>
-	<text name="Antialiasing:">
+	<text name="antialiasing label">
 		Antialiasing:
 	</text>
 	<combo_box label="Antialiasing" name="fsaa" width="94">
diff --git a/indra/newview/skins/default/xui/es/floater_model_preview.xml b/indra/newview/skins/default/xui/es/floater_model_preview.xml
index 3e774536129..ab3ba5aed7e 100644
--- a/indra/newview/skins/default/xui/es/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/es/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Error: Problema de análisis de DAE - consulta los datos en el registro.
 	</string>
+	<string name="status_material_mismatch">
+		Error: el material del modelo no es un subconjunto del modelo de referencia.
+	</string>
 	<string name="status_reading_file">
 		Cargando...
 	</string>
diff --git a/indra/newview/skins/default/xui/es/floater_model_wizard.xml b/indra/newview/skins/default/xui/es/floater_model_wizard.xml
index c4eb5e955ad..e27db5a1c4a 100644
--- a/indra/newview/skins/default/xui/es/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/es/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Elige el archivo de modelo que deseas subir
 			</text>
 			<button label="Buscar..." label_selected="Buscar..." name="browse"/>
+			<text name="Model types">
+				‎Second Life admite los archivos COLLADA (.dae)
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/es/floater_moveview.xml b/indra/newview/skins/default/xui/es/floater_moveview.xml
index b29fe048486..0e7b950bd3b 100644
--- a/indra/newview/skins/default/xui/es/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/es/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="MOVERME">
+<floater name="move_floater" title="CAMINAR / CORRER / VOLAR">
 	<string name="walk_forward_tooltip">
 		Caminar hacia adelante (cursor arriba o W)
 	</string>
diff --git a/indra/newview/skins/default/xui/es/floater_snapshot.xml b/indra/newview/skins/default/xui/es/floater_snapshot.xml
index eafc623ea93..23078b3a553 100644
--- a/indra/newview/skins/default/xui/es/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/es/floater_snapshot.xml
@@ -3,73 +3,63 @@
 	<floater.string name="unknown">
 		desconocido
 	</floater.string>
-	<radio_group label="Tipo de foto" name="snapshot_type_radio">
-		<radio_item label="Correo-e" name="postcard"/>
-		<radio_item label="Mi inventario ([AMOUNT] L$)" name="texture"/>
-		<radio_item label="Guardar en mi ordenador" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		Enviando el correo electrónico
+	</string>
+	<string name="profile_progress_str">
+		Publicando
+	</string>
+	<string name="inventory_progress_str">
+		Guardando en el inventario
+	</string>
+	<string name="local_progress_str">
+		Guardando en el equipo
+	</string>
+	<string name="profile_succeeded_str">
+		Imagen subida
+	</string>
+	<string name="postcard_succeeded_str">
+		Correo electrónico enviado
+	</string>
+	<string name="inventory_succeeded_str">
+		¡Guardado en el inventario!
+	</string>
+	<string name="local_succeeded_str">
+		¡Guardado en el equipo!
+	</string>
+	<string name="profile_failed_str">
+		Error al subir la imagen a los comentarios de tu perfil.
+	</string>
+	<string name="postcard_failed_str">
+		Error al enviar el correo electrónico.
+	</string>
+	<string name="inventory_failed_str">
+		Error al guardar en el inventario.
+	</string>
+	<string name="local_failed_str">
+		Error al guardar en el equipo.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Opciones avanzadas"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[SIZE] kB
 	</text>
-	<button label="Actualizar la foto" name="new_snapshot_btn"/>
-	<button label="Enviar" name="send_btn"/>
-	<button label="Ahorro ([AMOUNT] L$)" name="upload_btn"/>
-	<flyout_button label="Guardar" name="save_btn" tool_tip="Guardar la imagen en un archivo">
-		<flyout_button.item label="Guardar" name="save_item"/>
-		<flyout_button.item label="Guardar como..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Más" name="more_btn" tool_tip="Opciones avanzadas"/>
-	<button label="Menos" name="less_btn" tool_tip="Opciones avanzadas"/>
-	<button label="Cancelar" name="discard_btn"/>
-	<text name="type_label2">
-		Tamaño
-	</text>
-	<text name="format_label">
-		Formato
-	</text>
-	<combo_box label="Resolución" name="postcard_size_combo">
-		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="Personalizado" name="Custom"/>
-	</combo_box>
-	<combo_box label="Resolución" name="texture_size_combo">
-		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
-		<combo_box.item label="Pequeña (128x128)" name="Small(128x128)"/>
-		<combo_box.item label="Mediana (256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
-		<combo_box.item label="Personalizado" name="Custom"/>
-	</combo_box>
-	<combo_box label="Resolución" name="local_size_combo">
-		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="Personalizado" name="Custom"/>
-	</combo_box>
-	<combo_box label="Formato" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="Ancho" name="snapshot_width"/>
-	<spinner label="Altura" name="snapshot_height"/>
-	<check_box label="Mantener las proporciones" name="keep_aspect_check"/>
-	<slider label="Calidad de la imagen" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Captura:
-	</text>
-	<combo_box label="Capas de imagen" name="layer_types">
-		<combo_box.item label="Colores" name="Colors"/>
-		<combo_box.item label="Profundidad" name="Depth"/>
-	</combo_box>
-	<check_box label="Interfaz" name="ui_check"/>
-	<check_box label="HUDs" name="hud_check"/>
-	<check_box label="Mantener abierto después de guardar" name="keep_open_check"/>
-	<check_box label="Congelar la toma (pantalla completa)" name="freeze_frame_check"/>
-	<check_box label="Actualizar automáticamente" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			OPCIONES AVANZADAS
+		</text>
+		<text name="layer_type_label">
+			Captura:
+		</text>
+		<combo_box label="Capas de imagen" name="layer_types">
+			<combo_box.item label="Colores" name="Colors"/>
+			<combo_box.item label="Profundidad" name="Depth"/>
+		</combo_box>
+		<check_box label="Interfaz" name="ui_check"/>
+		<check_box label="HUDs" name="hud_check"/>
+		<check_box label="Congelar la toma (pantalla completa)" name="freeze_frame_check"/>
+		<check_box label="Actualizar automáticamente" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/es/floater_toybox.xml b/indra/newview/skins/default/xui/es/floater_toybox.xml
index b36a05a6e4b..7275b0546ba 100644
--- a/indra/newview/skins/default/xui/es/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/es/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="PERSONALIZAR BARRAS DE HERRAMIENTAS">
+<floater name="Toybox" title="BOTONES DE LA BARRA DE HERRAMIENTAS">
 	<text name="toybox label 1">
 		Puedes agregar o quitar botones arrastrándolos a las barras de herramientas o desde ellas.
 	</text>
 	<text name="toybox label 2">
 		Los botones aparecerán como se muestra o solo como iconos, según la configuración de cada barra de herramientas.
 	</text>
+	<button label="Quitar todas las barras de herramientas" label_selected="Quitar todas las barras de herramientas" name="btn_clear_all"/>
 	<button label="Restaurar valores predeterminados" label_selected="Restaurar valores predeterminados" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/es/floater_translation_settings.xml b/indra/newview/skins/default/xui/es/floater_translation_settings.xml
new file mode 100644
index 00000000000..765c9a05a28
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="CONFIGURACIÓN DE LA TRADUCCIÓN DEL CHAT">
+	<string name="bing_api_key_not_verified">
+		appID de Bing no se ha confirmado. Vuelve a intentarlo.
+	</string>
+	<string name="google_api_key_not_verified">
+		La clave de API de Google no se ha confirmado. Vuelve a intentarlo.
+	</string>
+	<string name="bing_api_key_verified">
+		appID de Bing se ha confirmado.
+	</string>
+	<string name="google_api_key_verified">
+		La clave de API de Google se ha confirmado.
+	</string>
+	<check_box label="Activar la traducción automática durante el chat" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Traducir el chat al:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="Predeterminado del sistema" name="System Default Language"/>
+		<combo_box.item label="Inglés" name="English"/>
+		<combo_box.item label="Dansk (danés)" name="Danish"/>
+		<combo_box.item label="Deutsch (alemán)" name="German"/>
+		<combo_box.item label="Español (español)" name="Spanish"/>
+		<combo_box.item label="Français (francés)" name="French"/>
+		<combo_box.item label="Italiano (italiano)" name="Italian"/>
+		<combo_box.item label="Magyar (húngaro)" name="Hungarian"/>
+		<combo_box.item label="Nederlands (neerlandés)" name="Dutch"/>
+		<combo_box.item label="Polski (polaco)" name="Polish"/>
+		<combo_box.item label="Português (portugués)" name="Portugese"/>
+		<combo_box.item label="Русский (ruso)" name="Russian"/>
+		<combo_box.item label="Türkçe (turco)" name="Turkish"/>
+		<combo_box.item label="Українська (ucraniano)" name="Ukrainian"/>
+		<combo_box.item label="中文 (正體) (Chino)" name="Chinese"/>
+		<combo_box.item label="日本語 (japonés)" name="Japanese"/>
+		<combo_box.item label="한국어 (coreano)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Elige el servicio de traducción:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Traductor de Google" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		[http://www.bing.com/developers/createapp.aspx AppID] de Bing:
+	</text>
+	<button label="Verificar" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		[http://code.google.com/apis/language/translate/v2/getting_started.html#auth Clave de API] de Google:
+	</text>
+	<button label="Verificar" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Precios] | [https://code.google.com/apis/console Estadísticas]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="Cancelar" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_voice_controls.xml b/indra/newview/skins/default/xui/es/floater_voice_controls.xml
index cefec2a7a16..eff21239be1 100644
--- a/indra/newview/skins/default/xui/es/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/es/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="CONTROLES DE LA VOZ">
 	<string name="title_nearby">
-		Chat de voz
+		CONFIGURACIÓN DE VOZ
 	</string>
 	<string name="title_group">
-		Multiconferencia de voz con [GROUP]
+		MULTICONFERENCIA DE VOZ CON [GROUP]
 	</string>
 	<string name="title_adhoc">
-		Multiconferencia de voz
+		MULTICONFERENCIA DE VOZ
 	</string>
 	<string name="title_peer_2_peer">
-		Llamada: [NAME]
+		LLAMADA A [NAME]
 	</string>
 	<string name="no_one_near">
 		Nadie cercano tiene activada la voz
diff --git a/indra/newview/skins/default/xui/es/menu_toolbars.xml b/indra/newview/skins/default/xui/es/menu_toolbars.xml
index f8ed1c54ca3..63f3dc43bd5 100644
--- a/indra/newview/skins/default/xui/es/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/es/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Elegir botones..." name="Chose Buttons"/>
+	<menu_item_call label="Quitar este botón" name="Remove button"/>
+	<menu_item_call label="Botones de la barra de herramientas..." name="Choose Buttons"/>
 	<menu_item_check label="Iconos y etiquetas" name="icons_with_text"/>
 	<menu_item_check label="Solo iconos" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index f5cc2b9389e..4762e3f4a43 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Yo" name="Me">
-		<menu_item_call label="Panel de control..." name="Manage My Account">
-			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=es"/>
-		</menu_item_call>
 		<menu_item_call label="Perfil..." name="Profile"/>
 		<menu_item_call label="Apariencia" name="ChangeOutfit"/>
+		<menu_item_call label="Elige un avatar..." name="Avatar Picker"/>
 		<menu_item_check label="Inventario..." name="Inventory"/>
-		<menu_item_check label="Gestos..." name="Gestures"/>
-		<menu_item_check label="Voz..." name="ShowVoice"/>
+		<menu_item_call label="Nueva ventana del inventario" name="NewInventoryWindow"/>
+		<menu_item_call label="Lugares..." name="Places"/>
+		<menu_item_call label="Destacados..." name="Picks"/>
+		<menu_item_call label="Controles de la cámara..." name="Camera Controls"/>
 		<menu label="Movimiento" name="Movement">
 			<menu_item_call label="Sentarte" name="Sit Down Here"/>
 			<menu_item_check label="Volar" name="Fly"/>
@@ -22,34 +22,39 @@
 		<menu_item_call label="Solicitar estatus de Administrador" name="Request Admin Options"/>
 		<menu_item_call label="Dejar el estatus de Administrador" name="Leave Admin Options"/>
 		<menu_item_call label="Comprar L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Panel de control de la cuenta..." name="Manage My Account">
+			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=es"/>
+		</menu_item_call>
 		<menu_item_call label="Preferencias..." name="Preferences"/>
-		<menu_item_call label="Barras de herramientas..." name="Toolbars"/>
+		<menu_item_call label="Botones de la barra de herramientas..." name="Toolbars"/>
 		<menu_item_call label="Ocultar todos los controles" name="Hide UI"/>
 		<menu_item_call label="Salir de [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Comunicarme" name="Communicate">
-		<menu_item_call label="Mis amigos" name="My Friends"/>
-		<menu_item_call label="Mis grupos" name="My Groups"/>
-		<menu_item_check label="Chat" name="Nearby Chat"/>
+		<menu_item_check label="Chat..." name="Nearby Chat"/>
+		<menu_item_check label="Hablar" name="Speak"/>
+		<menu_item_check label="Configuración de voz..." name="Nearby Voice"/>
+		<menu_item_check label="Transformación de voz..." name="ShowVoice"/>
+		<menu_item_check label="Gestos..." name="Gestures"/>
+		<menu_item_call label="Amigos" name="My Friends"/>
+		<menu_item_call label="Grupos" name="My Groups"/>
 		<menu_item_call label="Gente cerca" name="Active Speakers"/>
-		<menu_item_check label="Chat de voz" name="Nearby Voice"/>
 	</menu>
 	<menu label="Mundo" name="World">
-		<menu_item_check label="Minimapa" name="Mini-Map"/>
+		<menu_item_call label="Crear un hito de este sitio" name="Create Landmark Here"/>
+		<menu_item_call label="Destinos..." name="Destinations"/>
 		<menu_item_check label="Mapa del mundo" name="World Map"/>
+		<menu_item_check label="Minimapa" name="Mini-Map"/>
 		<menu_item_check label="Buscar" name="Search"/>
+		<menu_item_call label="Teleportar a la Base" name="Teleport Home"/>
+		<menu_item_call label="Fijar mi Base aquí" name="Set Home to Here"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
-		<menu_item_call label="Crear un hito de este sitio" name="Create Landmark Here"/>
-		<menu label="Perfil del lugar" name="Land">
-			<menu_item_call label="Perfil del lugar" name="Place Profile"/>
-			<menu_item_call label="Acerca del terreno" name="About Land"/>
-			<menu_item_call label="Región/Estado" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="Perfil del lugar" name="Place Profile"/>
+		<menu_item_call label="Acerca del terreno" name="About Land"/>
+		<menu_item_call label="Región/Estado" name="Region/Estate"/>
+		<menu_item_call label="Mis terrenos..." name="My Land"/>
 		<menu_item_call label="Comprar este terreno" name="Buy Land"/>
-		<menu_item_call label="Mi terreno" name="My Land"/>
 		<menu label="Mostrar" name="LandShow">
-			<menu_item_check label="Controles del movimiento" name="Movement Controls"/>
-			<menu_item_check label="Controles de la cámara" name="Camera Controls"/>
 			<menu_item_check label="Líneas de prohibición" name="Ban Lines"/>
 			<menu_item_check label="Balizas" name="beacons"/>
 			<menu_item_check label="Límites de las parcelas" name="Property Lines"/>
@@ -58,16 +63,15 @@
 			<menu_item_check label="Propiedades de la parcela" name="Parcel Properties"/>
 			<menu_item_check label="Menú Avanzado" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Teleportar a la Base" name="Teleport Home"/>
-		<menu_item_call label="Fijar mi Base aquí" name="Set Home to Here"/>
 		<menu label="Sol" name="Environment Settings">
 			<menu_item_call label="Amanecer" name="Sunrise"/>
 			<menu_item_call label="Mediodía" name="Noon"/>
 			<menu_item_call label="Atardecer" name="Sunset"/>
 			<menu_item_call label="Medianoche" name="Midnight"/>
+			<menu_item_call label="Usar configuración de región" name="Use Region Settings"/>
 		</menu>
-		<menu label="Editor de entorno" name="Enviroment Editor">
-			<menu_item_call label="Configuración de entorno..." name="Enviroment Settings"/>
+		<menu label="Editor de entorno" name="Environment Editor">
+			<menu_item_call label="Configuración del entorno..." name="Environment Settings"/>
 			<menu label="Agua predefinida" name="Water Presets">
 				<menu_item_call label="Nuevo predefinido..." name="new_water_preset"/>
 				<menu_item_call label="Editar predefinido..." name="edit_water_preset"/>
@@ -146,6 +150,7 @@
 		<menu_item_call label="Rehacer" name="Redo"/>
 	</menu>
 	<menu label="Ayuda" name="Help">
+		<menu_item_call label="Cómo..." name="How To"/>
 		<menu_item_call label="Ayuda de [SECOND_LIFE]" name="Second Life Help"/>
 		<menu_item_call label="Denunciar una infracción" name="Report Abuse"/>
 		<menu_item_call label="Informar de un fallo" name="Report Bug"/>
@@ -199,11 +204,10 @@
 		<menu_item_check label="Usar Plugin Read Thread" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Vaciar la caché de grupo" name="ClearGroupCache"/>
 		<menu_item_check label="Vista subjetiva suavizada" name="Mouse Smoothing"/>
+		<menu_item_call label="Recuperar las teclas" name="Release Keys"/>
 		<menu label="Atajos de teclado" name="Shortcuts">
 			<menu_item_call label="Imagen ([COST] L$)..." name="Upload Image"/>
 			<menu_item_check label="Buscar" name="Search"/>
-			<menu_item_call label="Recuperar las teclas" name="Release Keys"/>
-			<menu_item_call label="Interfaz en el tamaño predeterminado" name="Set UI Size to Default"/>
 			<menu_item_check label="Mostrar el menú Avanzado - acceso directo antiguo" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Cerrar la ventana" name="Close Window"/>
 			<menu_item_call label="Cerrar todas las ventanas" name="Close All Windows"/>
@@ -272,6 +276,7 @@
 			<menu_item_check label="Actualizar el tipo" name="Update Type"/>
 			<menu_item_check label="Información sobre el nivel de detalle" name="LOD Info"/>
 			<menu_item_check label="Crear cola" name="Build Queue"/>
+			<menu_item_check label="Vectores de viento" name="Wind Vectors"/>
 			<menu_item_check label="Complejidad del renderizado" name="rendercomplexity"/>
 			<menu_item_check label="Esculpir" name="Sculpt"/>
 		</menu>
@@ -281,7 +286,6 @@
 			<menu_item_check label="Luces y sombras" name="Lighting and Shadows"/>
 			<menu_item_check label="Sombras del sol/la luna/proyectores" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO y sombras suavizadas" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Iluminación global (experimental)" name="Global Illumination"/>
 			<menu_item_check label="Capas alfa automáticas (deferidas)" name="Automatic Alpha Masks (deferred)"/>
 			<menu_item_check label="Capas alfa automáticas (no deferidas)" name="Automatic Alpha Masks (non-deferred)"/>
 			<menu_item_check label="Animation Textures" name="Animation Textures"/>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 0de56f9b6da..e0a20683c50 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -1114,8 +1114,13 @@ El precio de compra del terreno no se le devolverá al propietario. Si se vende
 	<notification name="DisplaySetToSafe">
 		Las configuraciones que se muestran se han fijado en los niveles guardados, pues especificaste la opción de guardarlos.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Las configuraciones que se muestran se han fijado en los niveles recomendados para la configuración de tu sistema.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		La configuración de pantalla se ha establecido en los niveles recomendados porque tu tarjeta de gráficos ha cambiado
+de &apos;[LAST_GPU]&apos;
+a &apos;[THIS_GPU]&apos;
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		La configuración de pantalla se ha establecido en los niveles recomendados a causa de un cambio en el subsistema de renderizado.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1920,7 +1925,13 @@ Dado que estos objetos tienen scripts, moverlos a tu inventario puede provocar u
 		<usetemplate ignoretext="Confirmar antes de salir" name="okcancelignore" notext="No salir" yestext="Salir"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		¿Estás seguro de que quieres restaurar los botones y barras de herramientas predeterminados? 
+		Esta acción restaurará los botones y barras de herramientas predeterminados.
+
+Esta acción no se puede deshacer.
+		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Esta acción volverá a colocar todos los botones a la caja de herramientas y las barras de herramientas aparecerán vacías.
     
 Esta acción no se puede deshacer.
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
@@ -2244,14 +2255,16 @@ Por favor, selecciona un sólo objeto.
 		Se ha rehusado tu tarjeta de visita.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Puedes teleportarte a lugares como &apos;[NAME]&apos; abriendo el panel Lugares -a la derecha de tu pantalla- y seleccionando la sección Hitos.
-Pulsa en un hito para seleccionarlo, y, luego, pulsa &apos;Teleportar&apos; en la parte inferior del panel.
-(También puedes pulsar dos veces en el hito o pulsarlo con el botón derecho del ratón y elegir &apos;Teleportar&apos;.)
+		Para teleportarte a lugares como &apos;[NAME]&apos;, pulsa el botón &quot;Lugares&quot;,
+    y selecciona la pestaña Hitos en la ventana que se abre. Pulsa en un
+    hito para seleccionarlo y luego pulsa &apos;Teleportar&apos; en la parte inferior de la ventana.
+    (También puedes pulsar dos veces en el hito o pulsarlo con el botón derecho del ratón y
+    elegir &apos;Teleportar&apos;.)
 	</notification>
 	<notification name="TeleportToPerson">
-		Puedes contactar con un Residente como &apos;[NAME]&apos; abriendo el panel Gente en el lado derecho de tu pantalla.
-Elige al Residente de la lista y pulsa &apos;MI&apos; en la parte inferior del panel.
-(También puedes pulsar dos veces en su nombre o pulsarlo con el botón derecho y elegir &apos;MI&apos;).
+		Para ponerte en contacto con Residentes como &apos;[NAME]&apos;, pulsa el botón &quot;Gente&quot;, selecciona un Residente en la ventana que se abre y después pulsa en &apos;MI&apos; en
+    la parte inferior de la ventana.
+    (También puedes pulsar dos veces en su nombre o pulsarlo con el botón derecho y elegir &apos;MI&apos;).
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		No puedes seleccionar un terreno que cruce las fronteras entre servidores.
@@ -2272,6 +2285,9 @@ Inténtalo seleccionando un trozo más pequeño de terreno.
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Notificación de un evento:
 
@@ -2526,10 +2542,10 @@ Por favor, vuelve a intentarlo en unos momentos.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha aceptado tu oferta de amistad.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha aceptado tu ofrecimiento de amistad.
 	</notification>
 	<notification name="FriendshipDeclined">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rehusado tu oferta de amistad.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rechazado tu ofrecimiento de amistad.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Aceptado el ofrecimiento de amistad.
diff --git a/indra/newview/skins/default/xui/es/panel_edit_skin.xml b/indra/newview/skins/default/xui/es/panel_edit_skin.xml
index 501ecfb4de3..8d895a61521 100644
--- a/indra/newview/skins/default/xui/es/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/es/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Tatuajes de la cabeza" name="Head Tattoos" tool_tip="Pulsa para elegir una imagen"/>
-		<texture_picker label="Tatuajes superiores" name="Upper Tattoos" tool_tip="Pulsa para elegir una imagen"/>
-		<texture_picker label="Tatuajes inferiores" name="Lower Tattoos" tool_tip="Pulsa para elegir una imagen"/>
+		<texture_picker label="Cabeza" name="Head" tool_tip="Pulsa para elegir una imagen"/>
+		<texture_picker label="Parte superior del cuerpo" name="Upper Body" tool_tip="Pulsa para elegir una imagen"/>
+		<texture_picker label="Parte inferior del cuerpo" name="Lower Body" tool_tip="Pulsa para elegir una imagen"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/es/panel_nearby_chat.xml b/indra/newview/skins/default/xui/es/panel_nearby_chat.xml
index 5a852a67118..4220ab3c9f8 100644
--- a/indra/newview/skins/default/xui/es/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/es/panel_nearby_chat.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Traducir chat" name="translate_chat_checkbox"/>
+	<check_box label="Traducir el chat" name="translate_chat_checkbox"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/es/panel_postcard_message.xml b/indra/newview/skins/default/xui/es/panel_postcard_message.xml
new file mode 100644
index 00000000000..7316d91f5c8
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		Hasta:
+	</text>
+	<text name="name_label">
+		Desde:
+	</text>
+	<text name="subject_label">
+		Asunto:
+	</text>
+	<line_editor label="Escribe aquí el asunto." name="subject_form"/>
+	<text name="msg_label">
+		Mensaje:
+	</text>
+	<text_editor name="msg_form">
+		Escribe aquí tu mensaje.
+	</text_editor>
+	<button label="Cancelar" name="cancel_btn"/>
+	<button label="Enviar" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_postcard_settings.xml b/indra/newview/skins/default/xui/es/panel_postcard_settings.xml
new file mode 100644
index 00000000000..39313194479
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Resolución" name="postcard_size_combo">
+		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Personalizado" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="Ancho" name="postcard_snapshot_width"/>
+			<spinner label="Altura" name="postcard_snapshot_height"/>
+			<check_box label="Mantener las proporciones" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Calidad de la imagen" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml
index e8225855669..aea9b9ce4ac 100644
--- a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml
@@ -29,30 +29,5 @@
 	<check_box label="Chats de MI" name="EnableIMChatPopups" tool_tip="Activa esta casilla para ver una ventana emergente cada vez que recibas un mensaje instantáneo"/>
 	<spinner label="Duración de los interlocutores favoritos:" name="nearby_toasts_lifetime"/>
 	<spinner label="Tiempo de los otros interlocutores:" name="nearby_toasts_fadingtime"/>
-	<check_box name="translate_chat_checkbox"/>
-	<text name="translate_chb_label">
-		Usar en el chat el traductor automático
-	</text>
-	<text name="translate_language_text">
-		Traducir el chat al:
-	</text>
-	<combo_box name="translate_language_combobox">
-		<combo_box.item label="Predeterminado del sistema" name="System Default Language"/>
-		<combo_box.item label="English (inglés)" name="English"/>
-		<combo_box.item label="Dansk (danés)" name="Danish"/>
-		<combo_box.item label="Deutsch (alemán)" name="German"/>
-		<combo_box.item label="Español" name="Spanish"/>
-		<combo_box.item label="Français (francés)" name="French"/>
-		<combo_box.item label="Italiano (italiano)" name="Italian"/>
-		<combo_box.item label="Magyar (húngaro)" name="Hungarian"/>
-		<combo_box.item label="Nederlands (neerlandés)" name="Dutch"/>
-		<combo_box.item label="Polski (polaco)" name="Polish"/>
-		<combo_box.item label="Português (portugués)" name="Portugese"/>
-		<combo_box.item label="Русский (ruso)" name="Russian"/>
-		<combo_box.item label="Türkçe (turco)" name="Turkish"/>
-		<combo_box.item label="Українська (ucraniano)" name="Ukrainian"/>
-		<combo_box.item label="中文 (正體) (Chino)" name="Chinese"/>
-		<combo_box.item label="日本語 (japonés)" name="Japanese"/>
-		<combo_box.item label="한국어 (coreano)" name="Korean"/>
-	</combo_box>
+	<button label="Configuración de la traducción del chat" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
index 3de18654b5b..81a29dae5ad 100644
--- a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Usar mi navegador (IE, Firefox, Safari)" name="external" tool_tip="Usa tu navegador por defecto para ayuda, enlaces web, etc. No es aconsejable si estás a pantalla completa." value="1"/>
+		<radio_item label="Usar mi navegador (IE, Firefox, Safari)" name="external" tool_tip="Usa tu navegador por defecto para ayuda, enlaces web, etc. No es aconsejable si estás a pantalla completa." value="true"/>
 		<radio_item label="Usar el navegador incorporado" name="internal" tool_tip="Usa el navegador incorporado para ayuda, enlaces web, etc. Este navegador se abre en una nueva ventana dentro de [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Activar plugins" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..12c74b5cd18
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		Guardar en mi inventario
+	</text>
+	<text name="hint_lbl">
+		Guardar una imagen en el inventario cuesta [UPLOAD_COST] L$. Para guardar una imagen como una textura, selecciona uno de los formatos cuadrados.
+	</text>
+	<combo_box label="Resolución" name="texture_size_combo">
+		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
+		<combo_box.item label="Pequeña (128x128)" name="Small(128x128)"/>
+		<combo_box.item label="Mediana (256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
+		<combo_box.item label="Personalizado" name="Custom"/>
+	</combo_box>
+	<spinner label="Ancho" name="inventory_snapshot_width"/>
+	<spinner label="Altura" name="inventory_snapshot_height"/>
+	<check_box label="Mantener las proporciones" name="inventory_keep_aspect_check"/>
+	<button label="Cancelar" name="cancel_btn"/>
+	<button label="Guardar" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_local.xml b/indra/newview/skins/default/xui/es/panel_snapshot_local.xml
new file mode 100644
index 00000000000..08c45d2e764
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Guardar en mi ordenador
+	</text>
+	<combo_box label="Resolución" name="local_size_combo">
+		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="Personalizado" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="Ancho" name="local_snapshot_width"/>
+			<spinner label="Altura" name="local_snapshot_height"/>
+			<check_box label="Mantener las proporciones" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Formato" name="local_format_combo">
+				<combo_box.item label="PNG (sin pérdida)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (sin pérdida)" name="BMP"/>
+			</combo_box>
+			<slider label="Calidad de la imagen" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Cancelar" name="cancel_btn"/>
+	<flyout_button label="Guardar" name="save_btn" tool_tip="Guardar la imagen en un archivo">
+		<flyout_button.item label="Guardar" name="save_item"/>
+		<flyout_button.item label="Guardar como..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
new file mode 100644
index 00000000000..2b2584f66c5
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="Publicar en los comentarios de Mi perfil" name="save_to_profile_btn"/>
+	<button label="Correo-e" name="save_to_email_btn"/>
+	<button label="Guardar en Mi inventario ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+	<button label="Guardar en mi ordenador" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..649d547ba0c
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		Postal desde [SECOND_LIFE].
+	</string>
+	<string name="default_message">
+		¡Mira esto!
+	</string>
+	<string name="upload_message">
+		Enviando...
+	</string>
+	<text name="title">
+		Correo-e
+	</text>
+	<button label="Mensaje" name="message_btn"/>
+	<button label="Ajustes" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/es/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..6a0bc22d685
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		Publicar en los comentarios de Mi perfil
+	</text>
+	<combo_box label="Resolución" name="profile_size_combo">
+		<combo_box.item label="Ventana actual" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Personalizado" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="Ancho" name="profile_snapshot_width"/>
+			<spinner label="Altura" name="profile_snapshot_height"/>
+			<check_box label="Mantener las proporciones" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Título:
+			</text>
+			<check_box initial_value="true" label="Incluir ubicación" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Cancelar" name="cancel_btn"/>
+	<button label="Publicar" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index e3ea4baa6c0..2a6f32f84f5 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -1199,7 +1199,7 @@ Intenta iniciar sesión de nuevo en unos instantes.
 		No tienes en tu inventario una copia de esta textura
 	</string>
 	<string name="InventoryInboxNoItems">
-		Aquí se entregarán los objetos comprados en el mercado.
+		Cuando compres un objeto o lo recibas por otra vía, aparecerá aquí, para que puedas arrastrarlo a una carpeta de tu inventario o eliminarlo si no deseas conservarlo.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1391,6 +1391,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="no_attachments">
 		No tienes puestos anexos
 	</string>
+	<string name="Attachments remain">
+		Anexos (quedan [COUNT] ranuras)
+	</string>
 	<string name="Buy">
 		Comprar
 	</string>
@@ -1517,6 +1520,12 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="Right Pec">
 		Pecho derecho
 	</string>
+	<string name="Neck">
+		Cuello
+	</string>
+	<string name="Avatar Center">
+		Centro del avatar
+	</string>
 	<string name="Invalid Attachment">
 		Punto de colocación no válido
 	</string>
@@ -3943,6 +3952,18 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE].
 	<string name="you_paid_ldollars_no_name">
 		Has pagado [AMOUNT] L$ por [REASON].
 	</string>
+	<string name="you_paid_failure_ldollars">
+		No has pagado a [NAME] [AMOUNT] L$ [REASON].
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		No has pagado [AMOUNT] L$.
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		No has pagado a [NAME] [AMOUNT] L$.
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		No has pagado [AMOUNT] L$ [REASON].
+	</string>
 	<string name="for item">
 		para [ITEM]
 	</string>
@@ -4353,6 +4374,12 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 	<string name="ExternalEditorFailedToRun">
 		Error al ejecutar el editor externo.
 	</string>
+	<string name="TranslationFailed">
+		Error al traducir: [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Error al analizar la respuesta de la traducción.
+	</string>
 	<string name="Esc">
 		Esc
 	</string>
@@ -4723,7 +4750,7 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 		Minimapa
 	</string>
 	<string name="Command_Move_Label">
-		Moverme
+		Caminar / Correr / Volar
 	</string>
 	<string name="Command_People_Label">
 		Gente
@@ -4750,10 +4777,10 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 		Hablar
 	</string>
 	<string name="Command_View_Label">
-		Visión
+		Controles de la cámara
 	</string>
 	<string name="Command_Voice_Label">
-		Chat de voz
+		Configuración de voz
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		Información sobre el terreno que vas a visitar
@@ -4825,7 +4852,16 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 		Cambiando el ángulo de la cámara
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Personas próximas con capacidad de voz
+		Controles de volumen para las llamadas y la gente que se encuentre cerca de ti en el mundo virtual
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		actualmente en tu barra de herramientas inferior
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		actualmente en tu barra de herramientas izquierda
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		actualmente en tu barra de herramientas derecha
 	</string>
 	<string name="Retain%">
 		% retención
@@ -4851,4 +4887,19 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 	<string name="Normal">
 		Normal
 	</string>
+	<string name="snapshot_quality_very_low">
+		Muy bajo
+	</string>
+	<string name="snapshot_quality_low">
+		Bajo
+	</string>
+	<string name="snapshot_quality_medium">
+		Medio
+	</string>
+	<string name="snapshot_quality_high">
+		Alto
+	</string>
+	<string name="snapshot_quality_very_high">
+		Muy alto
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/es/teleport_strings.xml b/indra/newview/skins/default/xui/es/teleport_strings.xml
index e785a7ac407..a23d9c43d0f 100644
--- a/indra/newview/skins/default/xui/es/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/es/teleport_strings.xml
@@ -20,8 +20,8 @@ Si sigues recibiendo este mensaje, por favor, acude al [SUPPORT_SITE].
 Vuelva a intentarlo en un momento.
 		</message>
 		<message name="NoHelpIslandTP">
-		No puede teleportarse de vuelta a la Welcome Island (&apos;Isla de Ayuda&apos;).
-Vaya a la &apos;Welcome Island Public&apos; (&apos;Isla Pública de Ayuda&apos;) para repetir el tutorial.
+			No te puedes volver a teleportar a la isla de bienvenida.
+Para repetir el tutorial, visita la isla de bienvenida pública.
 		</message>
 		<message name="noaccess_tport">
 			Lo sentimos, pero no tienes acceso al destino de este teleporte.
diff --git a/indra/newview/skins/default/xui/fr/floater_about.xml b/indra/newview/skins/default/xui/fr/floater_about.xml
index 4d02513a532..44099495841 100644
--- a/indra/newview/skins/default/xui/fr/floater_about.xml
+++ b/indra/newview/skins/default/xui/fr/floater_about.xml
@@ -67,32 +67,34 @@ Version serveur vocal : [VOICE_VERSION]
 		<panel label="Licences" name="licenses_panel">
 			<text_editor name="credits_editor">
 				3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
-APR Copyright (C) 2000-2004 The Apache Software Foundation
-Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
-cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
-DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
-expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Copyright (C) 1999-2004 Brian Paul.
-GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University et David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Copyright (c) 2005, Google Inc.
-Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
-jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Copyright (C) 2001, Xiphophorus
-OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
-PCRE Copyright (c) 1997-2008 University of Cambridge
-SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
-zlib Copyright (C) 1995-2002 Jean-loup Gailly et Mark Adler.
-google-perftools Copyright (c) 2005, Google Inc.
+        APR Copyright (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University et David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly et Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-Le client Second Life utilise Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (et ses concédants de licence). Tous droits réservés. Pour plus de détails, consultez le site Web www.havok.com.
+        Le client Second Life utilise Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (et ses concédants de licence). Tous droits réservés. Pour plus de détails, consultez le site Web www.havok.com.
 
-Tous droits réservés. Voir licenses.txt pour plus d&apos;informations.
+        Ce logiciel contient du code source fourni par NVIDIA Corporation.
 
-Codage audio du chat vocal : Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+        Tous droits réservés.  Voir licenses.txt pour plus d&apos;informations.
+
+        Codage audio du chat vocal : Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/fr/floater_about_land.xml b/indra/newview/skins/default/xui/fr/floater_about_land.xml
index 9771c3f7fd2..b554a0a892f 100644
--- a/indra/newview/skins/default/xui/fr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/fr/floater_about_land.xml
@@ -132,7 +132,7 @@
 				Trafic :
 			</text>
 			<text name="DwellText">
-				0
+				Chargement...
 			</text>
 			<button label="Acheter du terrain" label_selected="Acheter le terrain..." left_delta="60" name="Buy Land..." width="125"/>
 			<button label="Vente Linden" label_selected="Vente Linden..." name="Linden Sale..." tool_tip="Le terrain doit être la propriété d&apos;un résident, avoir un contenu défini et ne pas être aux enchères."/>
@@ -313,13 +313,15 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche.
 				Pas de bousculades (les règles de la région priment)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Voir et chatter avec les résidents sur cette parcelle
+				Les avatars sur les autres parcelles peuvent voir
 			</panel.string>
 			<text name="allow_label">
 				Autoriser les autres résidents à :
 			</text>
-			<check_box label="Modifier le terrain" name="edit land check" tool_tip="Si cette option est cochée, n&apos;importe qui peut terraformer votre terrain. Il vaut mieux ne pas cocher cette option pour toujours pouvoir modifer votre propre terrain."/>
-			<check_box label="Voler" name="check fly" tool_tip="Si cette option est cochée, les résidents peuvent voler sur votre terrain. Si elle n&apos;est pas cochée, ils ne pourront voler que lorsqu&apos;ils arrivent et passent au dessus de votre terrain."/>
+			<text name="allow_label0">
+				Voler :
+			</text>
+			<check_box label="Tous" name="check fly" tool_tip="Si cette option est cochée, les résidents peuvent voler sur votre terrain. Si elle n&apos;est pas cochée, ils ne pourront voler que lorsqu&apos;ils arrivent et passent au dessus de votre terrain."/>
 			<text name="allow_label2">
 				Construire :
 			</text>
@@ -335,9 +337,6 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche.
 			</text>
 			<check_box label="Tous" name="check other scripts"/>
 			<check_box label="Groupe" name="check group scripts"/>
-			<text name="land_options_label">
-				Options du terrain :
-			</text>
 			<check_box label="Sécurisé (pas de dégâts)" name="check safe" tool_tip="Si cette option est cochée, le terrain est sécurisé et il n&apos;y pas de risques de dommages causés par des combats. Si elle est décochée, des dommages causés par les combats peuvent avoir lieu."/>
 			<check_box label="Pas de bousculades" name="PushRestrictCheck" tool_tip="Empêche l&apos;utilisation de scripts causant des bousculades. Cette option est utile pour empêcher les comportements abusifs sur votre terrain."/>
 			<check_box label="Afficher le lieu dans la recherche (30 L$/semaine)" name="ShowDirectoryCheck" tool_tip="Afficher la parcelle dans les résultats de recherche"/>
@@ -378,9 +377,9 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Cliquez pour sélectionner une image"/>
 			<text name="allow_label5">
-				Autoriser les résidents sur les autres parcelles à :
+				et chatter avec les avatars sur cette parcelle
 			</text>
-			<check_box label="Voir les avatars" name="SeeAvatarsCheck" tool_tip="Permettre aux résidents présents sur d&apos;autres parcelles de voir et chatter avec les résidents présents sur cette parcelle et vous permettre de les voir et de chatter avec eux."/>
+			<check_box label="Voir les avatars" name="SeeAvatarsCheck" tool_tip="Permettre aux avatars présents sur d&apos;autres parcelles de voir et chatter avec les avatars présents sur cette parcelle et à vous de les voir et de chatter avec eux."/>
 			<text name="landing_point">
 				Lieu d&apos;arrivée : [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/fr/floater_avatar.xml b/indra/newview/skins/default/xui/fr/floater_avatar.xml
index cfbac66c0e1..7cbb50a3d61 100644
--- a/indra/newview/skins/default/xui/fr/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/fr/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="CHOIX D&apos;AVATAR"/>
+<floater name="Avatar" title="CHOISIR UN AVATAR"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
index d9e8e8821df..148a5a35d23 100644
--- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml
@@ -22,10 +22,10 @@ le Lindex...
 	<text name="currency_action">
 		Je veux acheter
 	</text>
-	<text name="currency_label" left="308">
+	<text left="308" name="currency_label">
 		L$
 	</text>
-	<line_editor label="L$" name="currency_amt" width="65" left_pad="-85">
+	<line_editor label="L$" left_pad="-85" name="currency_amt" width="65">
 		1234
 	</line_editor>
 	<text name="buying_label">
@@ -47,13 +47,13 @@ le Lindex...
 		[AMT] L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise]
+		[http://www.secondlife.com/my/account/payment_method_management.php mode de paiement] | [http://www.secondlife.com/my/account/currency.php devise]
 	</text>
 	<text name="exchange_rate_note">
 		Saisissez à nouveau le montant pour voir le taux de change actuel.
 	</text>
 	<text name="purchase_warning_repurchase">
-		Confirmer cet achat n'achète que des L$, pas l'objet.
+		Confirmer cet achat n&apos;achète que des L$, pas l&apos;objet.
 	</text>
 	<text bottom_delta="16" name="purchase_warning_notenough">
 		Vous n&apos;achetez pas assez de L$. Veuillez augmenter le montant.
diff --git a/indra/newview/skins/default/xui/fr/floater_camera.xml b/indra/newview/skins/default/xui/fr/floater_camera.xml
index 77d3c2cfe4d..f2b0ee8af3f 100644
--- a/indra/newview/skins/default/xui/fr/floater_camera.xml
+++ b/indra/newview/skins/default/xui/fr/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="AFFICHER">
+<floater name="camera_floater" title="PARAMÈTRES DE LA CAMÉRA">
 	<floater.string name="rotate_tooltip">
 		Faire tourner la caméra autour du point central
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
index 8ad301823bf..2bc76e0c632 100644
--- a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
@@ -4,7 +4,7 @@
 		Filtres :
 	</text>
 	<check_box label="Filtre anisotrope (plus lent si activé)" name="ani"/>
-	<text name="Antialiasing:">
+	<text name="antialiasing label">
 		Anti-aliasing :
 	</text>
 	<combo_box label="Anti-aliasing" name="fsaa" width="84">
diff --git a/indra/newview/skins/default/xui/fr/floater_model_preview.xml b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
index a26deb1aefd..a3b50351ae4 100644
--- a/indra/newview/skins/default/xui/fr/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Erreur : Problème d&apos;analyse de fichier .dae ; reportez-vous au journal pour plus de détails.
 	</string>
+	<string name="status_material_mismatch">
+		Erreur : le matériau du modèle ne correspond pas à un sous-ensemble du modèle de référence.
+	</string>
 	<string name="status_reading_file">
 		Chargement...
 	</string>
@@ -137,7 +140,7 @@
 				</panel>
 				<panel name="physics analysis">
 					<text name="method_label">
-						Étape 2 : Analyse
+						Étape 2 : Analyser
 					</text>
 					<text name="analysis_method_label">
 						Moyen :
diff --git a/indra/newview/skins/default/xui/fr/floater_model_wizard.xml b/indra/newview/skins/default/xui/fr/floater_model_wizard.xml
index cd2eb761ec1..63feb1d4037 100644
--- a/indra/newview/skins/default/xui/fr/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/fr/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Choisir un fichier de modèle à charger
 			</text>
 			<button label="Parcourir..." label_selected="Parcourir..." name="browse"/>
+			<text name="Model types">
+				Second Life prend en charge les fichiers COLLADA (.dae).
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/fr/floater_moveview.xml b/indra/newview/skins/default/xui/fr/floater_moveview.xml
index 0b0ec518468..853af2afdff 100644
--- a/indra/newview/skins/default/xui/fr/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/fr/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="BOUGER">
+<floater name="move_floater" title="MARCHER / COURIR / VOLER">
 	<string name="walk_forward_tooltip">
 		Marcher en avant (appuyer sur la flèche vers le haut ou W)
 	</string>
diff --git a/indra/newview/skins/default/xui/fr/floater_snapshot.xml b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
index 365ff77ff94..9244051edce 100644
--- a/indra/newview/skins/default/xui/fr/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
@@ -3,73 +3,63 @@
 	<floater.string name="unknown">
 		inconnu
 	</floater.string>
-	<radio_group label="Type de photo" name="snapshot_type_radio">
-		<radio_item label="E-mail" name="postcard"/>
-		<radio_item label="Mon inventaire ([AMOUNT] L$)" name="texture"/>
-		<radio_item label="Enregistrer sur mon ordinateur" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		Envoi par e-mail
+	</string>
+	<string name="profile_progress_str">
+		Publication
+	</string>
+	<string name="inventory_progress_str">
+		Enregistrement dans l&apos;inventaire
+	</string>
+	<string name="local_progress_str">
+		Enregistrement sur l&apos;ordinateur
+	</string>
+	<string name="profile_succeeded_str">
+		Image chargée
+	</string>
+	<string name="postcard_succeeded_str">
+		Envoi par e-mail effectué !
+	</string>
+	<string name="inventory_succeeded_str">
+		Enregistrement dans l&apos;inventaire effectué !
+	</string>
+	<string name="local_succeeded_str">
+		Enregistrement sur l&apos;ordinateur effectué !
+	</string>
+	<string name="profile_failed_str">
+		Échec de chargement de l&apos;image sur le flux de votre profil.
+	</string>
+	<string name="postcard_failed_str">
+		Échec d&apos;envoi par e-mail.
+	</string>
+	<string name="inventory_failed_str">
+		Échec d&apos;enregistrement dans l&apos;inventaire.
+	</string>
+	<string name="local_failed_str">
+		Échec d&apos;enregistrement sur l&apos;ordinateur.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Options avancées"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[SIZE] Ko
 	</text>
-	<button label="Rafraîchir" name="new_snapshot_btn"/>
-	<button label="Envoyer" name="send_btn"/>
-	<button label="Enreg. ([AMOUNT] L$)" name="upload_btn"/>
-	<flyout_button label="Enregistrer" name="save_btn" tool_tip="Enregistrer l&apos;image sous forme de fichier">
-		<flyout_button.item label="Enregistrer" name="save_item"/>
-		<flyout_button.item label="Enregistrer sous..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Plus" name="more_btn" tool_tip="Options avancées"/>
-	<button label="Moins" name="less_btn" tool_tip="Options avancées"/>
-	<button label="Annuler" name="discard_btn"/>
-	<text name="type_label2">
-		Taille
-	</text>
-	<text name="format_label">
-		Format
-	</text>
-	<combo_box label="Résolution" name="postcard_size_combo">
-		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
-		<combo_box.item label="640 x 480" name="640x480"/>
-		<combo_box.item label="800 x 600" name="800x600"/>
-		<combo_box.item label="1 024 x 768" name="1024x768"/>
-		<combo_box.item label="Personnalisée" name="Custom"/>
-	</combo_box>
-	<combo_box label="Résolution" name="texture_size_combo">
-		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
-		<combo_box.item label="Petite (128 x 128)" name="Small(128x128)"/>
-		<combo_box.item label="Moyenne (256 x 256)" name="Medium(256x256)"/>
-		<combo_box.item label="Grande (512 x 512)" name="Large(512x512)"/>
-		<combo_box.item label="Personnalisée" name="Custom"/>
-	</combo_box>
-	<combo_box label="Résolution" name="local_size_combo">
-		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
-		<combo_box.item label="320 x 240" name="320x240"/>
-		<combo_box.item label="640 x 480" name="640x480"/>
-		<combo_box.item label="800 x 600" name="800x600"/>
-		<combo_box.item label="1 024 x 768" name="1024x768"/>
-		<combo_box.item label="1 280 x 1 024" name="1280x1024"/>
-		<combo_box.item label="1 600 x 1 200" name="1600x1200"/>
-		<combo_box.item label="Personnalisée" name="Custom"/>
-	</combo_box>
-	<combo_box label="Format" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="Larg." name="snapshot_width"/>
-	<spinner label="Haut." name="snapshot_height"/>
-	<check_box label="Contraindre les proportions" name="keep_aspect_check"/>
-	<slider label="Qualité de l&apos;image" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Capturer :
-	</text>
-	<combo_box label="Couches d&apos;images" name="layer_types">
-		<combo_box.item label="Couleurs" name="Colors"/>
-		<combo_box.item label="Profondeur" name="Depth"/>
-	</combo_box>
-	<check_box label="Interface" name="ui_check"/>
-	<check_box label="HUD" name="hud_check"/>
-	<check_box label="Garder ouvert après enregistrement" name="keep_open_check"/>
-	<check_box label="Arrêt sur image (plein écran)" name="freeze_frame_check"/>
-	<check_box label="Actualisation automatique" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			OPTIONS AVANCÉES
+		</text>
+		<text name="layer_type_label">
+			Capturer :
+		</text>
+		<combo_box label="Couches d&apos;images" name="layer_types">
+			<combo_box.item label="Couleurs" name="Colors"/>
+			<combo_box.item label="Profondeur" name="Depth"/>
+		</combo_box>
+		<check_box label="Interface" name="ui_check"/>
+		<check_box label="HUD" name="hud_check"/>
+		<check_box label="Arrêt sur image (plein écran)" name="freeze_frame_check"/>
+		<check_box label="Actualisation automatique" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_toybox.xml b/indra/newview/skins/default/xui/fr/floater_toybox.xml
index 33aea6bb2d8..f99d3d30b58 100644
--- a/indra/newview/skins/default/xui/fr/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/fr/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="PERSONNALISER LES BARRES D&apos;OUTILS">
+<floater name="Toybox" title="BOUTONS DES BARRES D&apos;OUTILS">
 	<text name="toybox label 1">
 		Ajouter ou supprimer des boutons : les faire glisser vers ou depuis les barres d&apos;outils.
 	</text>
 	<text name="toybox label 2">
 		Ils s&apos;afficheront comme indiqué ou comme des icônes, selon les paramètres de barre d&apos;outils.
 	</text>
+	<button label="Effacer tout" label_selected="Effacer tout" name="btn_clear_all"/>
 	<button label="Valeurs par défaut" label_selected="Valeurs par défaut" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_translation_settings.xml b/indra/newview/skins/default/xui/fr/floater_translation_settings.xml
new file mode 100644
index 00000000000..c7582f110f6
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="TRADUCTION AUTOMATIQUE">
+	<string name="bing_api_key_not_verified">
+		ID d&apos;application Bing non vérifié. Veuillez réessayer.
+	</string>
+	<string name="google_api_key_not_verified">
+		Clé d&apos;API Google non vérifiée. Veuillez réessayer.
+	</string>
+	<string name="bing_api_key_verified">
+		ID d&apos;application Bing vérifié.
+	</string>
+	<string name="google_api_key_verified">
+		Clé d&apos;API Google vérifiée.
+	</string>
+	<check_box label="Activer la traduction automatique lors des chats" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Traduire les chats en :
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="Langue système par défaut" name="System Default Language"/>
+		<combo_box.item label="English (Anglais)" name="English"/>
+		<combo_box.item label="Dansk (Danois)" name="Danish"/>
+		<combo_box.item label="Deutsch (Allemand)" name="German"/>
+		<combo_box.item label="Español (Espagnol)" name="Spanish"/>
+		<combo_box.item label="Français" name="French"/>
+		<combo_box.item label="Italiano (Italien)" name="Italian"/>
+		<combo_box.item label="Magyar (Hongrois)" name="Hungarian"/>
+		<combo_box.item label="Nederlands (Néerlandais)" name="Dutch"/>
+		<combo_box.item label="Polski (Polonais)" name="Polish"/>
+		<combo_box.item label="Português (Portugais)" name="Portugese"/>
+		<combo_box.item label="Русский (Russe)" name="Russian"/>
+		<combo_box.item label="Türkçe (Turc)" name="Turkish"/>
+		<combo_box.item label="Українська (Ukrainien)" name="Ukrainian"/>
+		<combo_box.item label="中文 (正體) (Chinois)" name="Chinese"/>
+		<combo_box.item label="日本語 (Japonais)" name="Japanese"/>
+		<combo_box.item label="한국어 (Coréen)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Choisir le service à utiliser :
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		[http://www.bing.com/developers/createapp.aspx ID d&apos;application] Bing :
+	</text>
+	<button label="Vérifier" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		[http://code.google.com/apis/language/translate/v2/getting_started.html#auth Clé d&apos;API] Google :
+	</text>
+	<button label="Vérifier" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Tarification] | [https://code.google.com/apis/console Statistiques]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="Annuler" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_voice_controls.xml b/indra/newview/skins/default/xui/fr/floater_voice_controls.xml
index 2b2bb8bbe32..fc4de4a5a6d 100644
--- a/indra/newview/skins/default/xui/fr/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/fr/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="CONTROLES DE LA VOIX">
 	<string name="title_nearby">
-		Chat près de vous
+		PARAMÈTRES VOCAUX
 	</string>
 	<string name="title_group">
-		Appel de groupe avec [GROUP]
+		APPEL DE GROUPE AVEC [GROUP]
 	</string>
 	<string name="title_adhoc">
-		Téléconférence
+		CONFÉRENCE
 	</string>
 	<string name="title_peer_2_peer">
-		Appel avec [NAME]
+		APPEL AVEC [NAME]
 	</string>
 	<string name="no_one_near">
 		Il n&apos;y a personne près de vous avec le chat vocal activé
diff --git a/indra/newview/skins/default/xui/fr/menu_toolbars.xml b/indra/newview/skins/default/xui/fr/menu_toolbars.xml
index d3e9f927704..f74d206d562 100644
--- a/indra/newview/skins/default/xui/fr/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/fr/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Choisir les boutons..." name="Chose Buttons"/>
+	<menu_item_call label="Supprimer ce bouton" name="Remove button"/>
+	<menu_item_call label="Boutons des barres d&apos;outils..." name="Choose Buttons"/>
 	<menu_item_check label="Icônes et libellés" name="icons_with_text"/>
 	<menu_item_check label="Icônes uniquement" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index d3b48639e02..9303815c301 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Moi" name="Me">
-		<menu_item_call label="Page d&apos;accueil..." name="Manage My Account">
-			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=fr"/>
-		</menu_item_call>
 		<menu_item_call label="Profil..." name="Profile"/>
 		<menu_item_call label="Apparence..." name="ChangeOutfit"/>
+		<menu_item_call label="Choisir un avatar..." name="Avatar Picker"/>
 		<menu_item_check label="Inventaire..." name="Inventory"/>
-		<menu_item_check label="Gestes..." name="Gestures"/>
-		<menu_item_check label="Chat vocal..." name="ShowVoice"/>
+		<menu_item_call label="Nouvelle fenêtre d&apos;inventaire" name="NewInventoryWindow"/>
+		<menu_item_call label="Endroits..." name="Places"/>
+		<menu_item_call label="Favoris..." name="Picks"/>
+		<menu_item_call label="Paramètres de la caméra..." name="Camera Controls"/>
 		<menu label="Déplacement" name="Movement">
 			<menu_item_call label="M&apos;asseoir" name="Sit Down Here"/>
 			<menu_item_check label="Voler" name="Fly"/>
@@ -22,34 +22,39 @@
 		<menu_item_call label="Demander le statut Admin" name="Request Admin Options"/>
 		<menu_item_call label="Quitter le statut Admin" name="Leave Admin Options"/>
 		<menu_item_call label="Acheter des L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Page d&apos;accueil du compte..." name="Manage My Account">
+			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=fr"/>
+		</menu_item_call>
 		<menu_item_call label="Préférences..." name="Preferences"/>
-		<menu_item_call label="Barres d&apos;outils..." name="Toolbars"/>
+		<menu_item_call label="Boutons des barres d&apos;outils..." name="Toolbars"/>
 		<menu_item_call label="Masquer tous les contrôles" name="Hide UI"/>
 		<menu_item_call label="Quitter [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Communiquer" name="Communicate">
-		<menu_item_call label="Mes amis" name="My Friends"/>
-		<menu_item_call label="Mes groupes" name="My Groups"/>
-		<menu_item_check label="Chat près de moi" name="Nearby Chat"/>
-		<menu_item_call label="Personnes près de moi" name="Active Speakers"/>
-		<menu_item_check label="Chat vocal près de vous" name="Nearby Voice"/>
+		<menu_item_check label="Chat..." name="Nearby Chat"/>
+		<menu_item_check label="Parler" name="Speak"/>
+		<menu_item_check label="Paramètres vocaux..." name="Nearby Voice"/>
+		<menu_item_check label="Effet de voix..." name="ShowVoice"/>
+		<menu_item_check label="Gestes..." name="Gestures"/>
+		<menu_item_call label="Amis" name="My Friends"/>
+		<menu_item_call label="Groupes" name="My Groups"/>
+		<menu_item_call label="Personnes près de vous" name="Active Speakers"/>
 	</menu>
 	<menu label="Monde" name="World">
-		<menu_item_check label="Mini-carte" name="Mini-Map"/>
+		<menu_item_call label="Créer un repère pour ce lieu" name="Create Landmark Here"/>
+		<menu_item_call label="Destinations..." name="Destinations"/>
 		<menu_item_check label="Carte du monde" name="World Map"/>
+		<menu_item_check label="Mini-carte" name="Mini-Map"/>
 		<menu_item_check label="Rechercher" name="Search"/>
+		<menu_item_call label="Me téléporter chez moi" name="Teleport Home"/>
+		<menu_item_call label="Définir le domicile ici" name="Set Home to Here"/>
 		<menu_item_call label="Photo" name="Take Snapshot"/>
-		<menu_item_call label="Créer un repère pour ce lieu" name="Create Landmark Here"/>
-		<menu label="Profil du lieu" name="Land">
-			<menu_item_call label="Profil du lieu" name="Place Profile"/>
-			<menu_item_call label="À propos du terrain" name="About Land"/>
-			<menu_item_call label="Région/Domaine" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="Profil du lieu" name="Place Profile"/>
+		<menu_item_call label="À propos du terrain" name="About Land"/>
+		<menu_item_call label="Région/Domaine" name="Region/Estate"/>
+		<menu_item_call label="Mes terrains..." name="My Land"/>
 		<menu_item_call label="Acheter ce terrain" name="Buy Land"/>
-		<menu_item_call label="Mes terrains" name="My Land"/>
 		<menu label="Afficher" name="LandShow">
-			<menu_item_check label="Contrôles de mouvement" name="Movement Controls"/>
-			<menu_item_check label="Contrôles d’affichage" name="Camera Controls"/>
 			<menu_item_check label="Lignes d&apos;interdiction" name="Ban Lines"/>
 			<menu_item_check label="Balises" name="beacons"/>
 			<menu_item_check label="Limites du terrain" name="Property Lines"/>
@@ -58,16 +63,15 @@
 			<menu_item_check label="Propriétés de la parcelle" name="Parcel Properties"/>
 			<menu_item_check label="Menu Avancé" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Me téléporter chez moi" name="Teleport Home"/>
-		<menu_item_call label="Définir le domicile ici" name="Set Home to Here"/>
 		<menu label="Luminosité" name="Environment Settings">
 			<menu_item_call label="Aube" name="Sunrise"/>
 			<menu_item_call label="Milieu de journée" name="Noon"/>
 			<menu_item_call label="Coucher de soleil" name="Sunset"/>
 			<menu_item_call label="Minuit" name="Midnight"/>
+			<menu_item_call label="Utiliser les réglages de la région" name="Use Region Settings"/>
 		</menu>
-		<menu label="Éditeur d&apos;environnement" name="Enviroment Editor">
-			<menu_item_call label="Paramètres d&apos;environnement..." name="Enviroment Settings"/>
+		<menu label="Éditeur d&apos;environnement" name="Environment Editor">
+			<menu_item_call label="Paramètres d&apos;environnement..." name="Environment Settings"/>
 			<menu label="Préréglages de l&apos;eau" name="Water Presets">
 				<menu_item_call label="Nouveau préréglage..." name="new_water_preset"/>
 				<menu_item_call label="Modifier un préréglage..." name="edit_water_preset"/>
@@ -146,6 +150,7 @@
 		<menu_item_call label="Refaire" name="Redo"/>
 	</menu>
 	<menu label="Aide" name="Help">
+		<menu_item_call label="Aide rapide..." name="How To"/>
 		<menu_item_call label="Aide de [SECOND_LIFE]" name="Second Life Help"/>
 		<menu_item_call label="Signaler une infraction" name="Report Abuse"/>
 		<menu_item_call label="Signaler un bug" name="Report Bug"/>
@@ -200,11 +205,10 @@
 		<menu_item_check label="Utiliser le thread de lecture de plug-in" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Effacer le cache du groupe" name="ClearGroupCache"/>
 		<menu_item_check label="Effet de lissage de la souris" name="Mouse Smoothing"/>
+		<menu_item_call label="Libérer les touches" name="Release Keys"/>
 		<menu label="Raccourcis" name="Shortcuts">
 			<menu_item_call label="Image ([COST] L$)..." name="Upload Image"/>
 			<menu_item_check label="Rechercher" name="Search"/>
-			<menu_item_call label="Relâcher les touches" name="Release Keys"/>
-			<menu_item_call label="Taille de l&apos;interface par défaut" name="Set UI Size to Default"/>
 			<menu_item_check label="Afficher le menu Avancé - raccourci existant" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fermer la fenêtre" name="Close Window"/>
 			<menu_item_call label="Fermer toutes les fenêtres" name="Close All Windows"/>
@@ -290,6 +294,7 @@
 			<menu_item_check label="Lumières" name="Lights"/>
 			<menu_item_check label="Squelette de collision" name="Collision Skeleton"/>
 			<menu_item_check label="Rayons" name="Raycast"/>
+			<menu_item_check label="Vecteurs de vent" name="Wind Vectors"/>
 			<menu_item_check label="Complexité du rendu" name="rendercomplexity"/>
 			<menu_item_check label="Sculpture" name="Sculpt"/>
 		</menu>
@@ -302,7 +307,6 @@
 			<menu_item_check label="Éclairage et ombres" name="Lighting and Shadows"/>
 			<menu_item_check label="Ombres du soleil/de la lune/des projecteurs" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO et lissage des ombres" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Illumination globale (expérimental)" name="Global Illumination"/>
 			<menu_item_check label="Débogage GL" name="Debug GL"/>
 			<menu_item_check label="Débogage pipeline" name="Debug Pipeline"/>
 			<menu_item_check label="Masques alpha automatiques (différés)" name="Automatic Alpha Masks (deferred)"/>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index be6f1f8c310..2f9bf23bc42 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -980,7 +980,7 @@ Proposer à [NAME] de devenir votre ami(e) ?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Voulez-vous supprimer &lt;nolink&gt;[NAME]&lt;/nolink&gt; de votre liste d&apos;amis ?
+		Voulez-vous supprimer &lt;nolink&gt;[NAME]&lt;/nolink&gt; de votre liste d&apos;amis ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -1105,8 +1105,13 @@ Céder ces [AREA] m² de terrain au groupe [GROUP_NAME] ?
 	<notification name="DisplaySetToSafe">
 		Les paramètres d&apos;affichage sont au niveau le plus sûr, comme vous l&apos;aviez indiqué.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Vos paramètres d&apos;affichage ont été réglés avec une marge de sécurité en fonction de votre configuration système.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		Les paramètres d&apos;affichage ont été modifiés selon les niveaux recommandés car votre carte graphique
+[LAST_GPU] a été remplacée
+par une carte [THIS_GPU].
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		Les paramètres d&apos;affichage ont été modifiés selon les niveaux recommandés en raison d&apos;un changement relatif au sous-système de rendu.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1910,9 +1915,15 @@ Déplacer les objets de l&apos;inventaire ?
 		<usetemplate ignoretext="Confirmer avant de quitter" name="okcancelignore" notext="Ne pas quitter" yestext="Quitter"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		Etes-vous certain de vouloir restaurer vos boutons et barres d&apos;outils par défaut ? 
+		Cette action rétablira vos boutons et barres d&apos;outils par défaut.
+
+Vous ne pouvez pas l&apos;annuler.
+		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Cette action replacera tous les boutons dans la boîte à outils de sorte que vos barres d&apos;outils seront vides.
     
-Vous ne pouvez pas annuler cette action.
+Vous ne pouvez pas l&apos;annuler.
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="DeleteItems">
@@ -2236,14 +2247,16 @@ Veuillez sélectionner un seul objet.
 		Votre carte de visite a été refusée.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Vous pouvez vous téléporter vers des endroits comme [NAME] en ouvrant le panneau Lieux sur le côté droit de votre écran, puis en sélectionnant l&apos;onglet Repères.
-Cliquez sur le repère de votre choix pour le sélectionner, puis sur Téléporter en bas du panneau.
-(Vous pouvez aussi double-cliquer sur le repère ou cliquer dessus avec le bouton droit de la souris et sélectionner Téléporter.)
+		Pour vous téléporter vers un lieu tel que [NAME], cliquez sur le bouton Endroits,
+    puis sélectionnez l&apos;onglet Repères dans la fenêtre qui s&apos;ouvre. Cliquez sur n&apos;importe quel
+    repère pour le sélectionner, puis sur Téléportation en bas de la fenêtre.
+    (Vous pouvez aussi double-cliquer sur le repère ou cliquer-droit dessus et
+    choisir Téléportation).
 	</notification>
 	<notification name="TeleportToPerson">
-		Vous pouvez contacter des résidents comme [NAME] en ouvrant le panneau Résidents sur le côté droit de votre écran.
-Sélectionnez le résident de votre choix dans la liste, puis cliquez sur IM en bas du panneau.
-(Vous pouvez aussi double-cliquer sur le nom du résident dans la liste ou cliquer dessus avec le bouton droit de la souris et sélectionner IM.)
+		Pour contacter un résident tel que [NAME], cliquez sur le bouton Personnes, sélectionnez le résident dans la fenêtre qui s&apos;ouvre, puis cliquez sur IM en
+    bas de la fenêtre.
+    (Vous pouvez aussi double-cliquer sur le nom du résident dans la liste ou cliquer-droit dessus et choisir IM.)
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		Vous ne pouvez pas sélectionner de terrain en dehors des limites du serveur.
@@ -2264,6 +2277,9 @@ Veuillez sélectionner un terrain plus petit.
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Avis d&apos;événement :
 
@@ -2798,7 +2814,7 @@ Voir le fichier journal pour plus de détails.
 avec les résidents suivants :
 
 [RESIDENTS] ?
-		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="Ok"/>
+		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="ItemsShared">
 		Articles partagés.
@@ -2888,7 +2904,7 @@ Les résidents rejoignant l&apos;appel ultérieurement seront également
 ignorés, même si vous quittez l&apos;appel.
 
 Ignorer les autres ?
-		<usetemplate ignoretext="Confirmer avant d&apos;ignorer les autres lors d&apos;un appel de groupe" name="okcancelignore" notext="Annuler" yestext="Ok"/>
+		<usetemplate ignoretext="Confirmer avant d&apos;ignorer les autres lors d&apos;un appel de groupe" name="okcancelignore" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification label="Chat" name="HintChat">
 		Pour participer à la conversation, saisissez du texte dans le champ de chat situé en dessous.
diff --git a/indra/newview/skins/default/xui/fr/panel_edit_skin.xml b/indra/newview/skins/default/xui/fr/panel_edit_skin.xml
index 9640adcdf82..f5f27383197 100644
--- a/indra/newview/skins/default/xui/fr/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/fr/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Tatouage tête" name="Head Tattoos" tool_tip="Cliquez pour sélectionner une image" width="76"/>
-		<texture_picker label="Tatouage haut" name="Upper Tattoos" tool_tip="Cliquez pour sélectionner une image" width="80"/>
-		<texture_picker label="Tatouage bas" name="Lower Tattoos" tool_tip="Cliquez pour sélectionner une image"/>
+		<texture_picker label="Tête" name="Head" tool_tip="Cliquer pour sélectionner une image."/>
+		<texture_picker label="Haut du corps" name="Upper Body" tool_tip="Cliquer pour sélectionner une image."/>
+		<texture_picker label="Bas du corps" name="Lower Body" tool_tip="Cliquer pour sélectionner une image."/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml b/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml
index 31cb3308e35..00bd6e81aed 100644
--- a/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Traduction du chat" name="translate_chat_checkbox"/>
+	<check_box label="Traduire le chat" name="translate_chat_checkbox"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_postcard_message.xml b/indra/newview/skins/default/xui/fr/panel_postcard_message.xml
new file mode 100644
index 00000000000..0f8397cfb4e
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		À :
+	</text>
+	<text name="name_label">
+		De :
+	</text>
+	<text name="subject_label">
+		Objet :
+	</text>
+	<line_editor label="Saisir ici votre objet" name="subject_form"/>
+	<text name="msg_label">
+		Message :
+	</text>
+	<text_editor name="msg_form">
+		Saisir ici votre message
+	</text_editor>
+	<button label="Annuler" name="cancel_btn"/>
+	<button label="Envoyer" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_postcard_settings.xml b/indra/newview/skins/default/xui/fr/panel_postcard_settings.xml
new file mode 100644
index 00000000000..6f4e9c23f9c
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Résolution" name="postcard_size_combo">
+		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+		<combo_box.item label="640 x 480" name="640x480"/>
+		<combo_box.item label="800 x 600" name="800x600"/>
+		<combo_box.item label="1 024 x 768" name="1024x768"/>
+		<combo_box.item label="Personnalisée" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="Largeur" name="postcard_snapshot_width"/>
+			<spinner label="Hauteur" name="postcard_snapshot_height"/>
+			<check_box label="Conserver les proportions" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Qualité de l&apos;image" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
index fa026d81067..76ed2374512 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
@@ -29,30 +29,5 @@
 	<check_box label="Chats IM" name="EnableIMChatPopups" tool_tip="Cocher cette case pour qu&apos;un popup s&apos;affiche à réception d&apos;un message instantané."/>
 	<spinner label="Durée de vie du popup Chat près de moi :" name="nearby_toasts_lifetime"/>
 	<spinner label="Disparition progressive du popup Chat près de moi :" name="nearby_toasts_fadingtime"/>
-	<check_box name="translate_chat_checkbox"/>
-	<text name="translate_chb_label">
-		Utiliser la traduction automatique lors des chats
-	</text>
-	<text name="translate_language_text">
-		Traduire le chat en :
-	</text>
-	<combo_box name="translate_language_combobox">
-		<combo_box.item label="Choix par défaut" name="System Default Language"/>
-		<combo_box.item label="English (Anglais)" name="English"/>
-		<combo_box.item label="Dansk (Danois)" name="Danish"/>
-		<combo_box.item label="Deutsch (Allemand)" name="German"/>
-		<combo_box.item label="Español (Espagnol)" name="Spanish"/>
-		<combo_box.item label="Français" name="French"/>
-		<combo_box.item label="Italiano (Italien)" name="Italian"/>
-		<combo_box.item label="Magyar (Hongrois)" name="Hungarian"/>
-		<combo_box.item label="Nederlands (Néerlandais)" name="Dutch"/>
-		<combo_box.item label="Polski (Polonais)" name="Polish"/>
-		<combo_box.item label="Português (Portugais)" name="Portugese"/>
-		<combo_box.item label="Русский (Russe)" name="Russian"/>
-		<combo_box.item label="Türkçe (Turc)" name="Turkish"/>
-		<combo_box.item label="Українська (Ukrainien)" name="Ukrainian"/>
-		<combo_box.item label="中文 (正體) (Chinois)" name="Chinese"/>
-		<combo_box.item label="日本語 (Japonais)" name="Japanese"/>
-		<combo_box.item label="한국어 (Coréen)" name="Korean"/>
-	</combo_box>
+	<button label="Traduction automatique" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
index 82780c27c59..83303950dcd 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web :
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Utiliser mon navigateur (IE, Firefox, Safari)" name="external" tool_tip="Utiliser le navigateur web système par défaut pour l&apos;aide, les liens etc. Non recommandé en mode plein écran." value="1"/>
+		<radio_item label="Utiliser mon navigateur (IE, Firefox, Safari)" name="external" tool_tip="Utiliser le navigateur web système par défaut pour l&apos;aide, les liens etc. Non recommandé en mode plein écran." value="true"/>
 		<radio_item label="Utiliser le navigateur intégré" name="internal" tool_tip="Utilisez le navigateur intégré pour obtenir de l&apos;aide, ouvrir des liens, etc. Ce navigateur s&apos;ouvre dans [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Activer les plugins" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..4454d2475ef
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		Enregistrer dans mon inventaire
+	</text>
+	<text name="hint_lbl">
+		L&apos;enregistrement d&apos;une image dans votre inventaire coûte [UPLOAD_COST] L$. Pour enregistrer votre image sous forme de texture, sélectionnez l&apos;un des formats carrés.
+	</text>
+	<combo_box label="Résolution" name="texture_size_combo">
+		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+		<combo_box.item label="Petite (128 x 128)" name="Small(128x128)"/>
+		<combo_box.item label="Moyenne (256 x 256)" name="Medium(256x256)"/>
+		<combo_box.item label="Grande (512 x 512)" name="Large(512x512)"/>
+		<combo_box.item label="Personnalisée" name="Custom"/>
+	</combo_box>
+	<spinner label="Largeur" name="inventory_snapshot_width"/>
+	<spinner label="Hauteur" name="inventory_snapshot_height"/>
+	<check_box label="Conserver les proportions" name="inventory_keep_aspect_check"/>
+	<button label="Annuler" name="cancel_btn"/>
+	<button label="Enregistrer" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_local.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_local.xml
new file mode 100644
index 00000000000..41264521fd7
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Enregistrer sur mon ordinateur
+	</text>
+	<combo_box label="Résolution" name="local_size_combo">
+		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+		<combo_box.item label="320 x 240" name="320x240"/>
+		<combo_box.item label="640 x 480" name="640x480"/>
+		<combo_box.item label="800 x 600" name="800x600"/>
+		<combo_box.item label="1 024 x 768" name="1024x768"/>
+		<combo_box.item label="1 280 x 1 024" name="1280x1024"/>
+		<combo_box.item label="1 600 x 1 200" name="1600x1200"/>
+		<combo_box.item label="Personnalisée" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="Largeur" name="local_snapshot_width"/>
+			<spinner label="Hauteur" name="local_snapshot_height"/>
+			<check_box label="Conserver les proportions" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Format" name="local_format_combo">
+				<combo_box.item label="PNG (sans perte)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (sans perte)" name="BMP"/>
+			</combo_box>
+			<slider label="Qualité de l&apos;image" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Annuler" name="cancel_btn"/>
+	<flyout_button label="Enregistrer" name="save_btn" tool_tip="Enregistrer l&apos;image dans un fichier.">
+		<flyout_button.item label="Enregistrer" name="save_item"/>
+		<flyout_button.item label="Enregistrer sous..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
new file mode 100644
index 00000000000..db3fcbeac9c
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="Publier sur le flux de mon profil" name="save_to_profile_btn"/>
+	<button label="Envoyer par e-mail" name="save_to_email_btn"/>
+	<button label="Enregistrer dans mon inventaire ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+	<button label="Enregistrer sur mon ordinateur" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..bb23b528507
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		Carte postale de [SECOND_LIFE].
+	</string>
+	<string name="default_message">
+		Ouvrez-moi !
+	</string>
+	<string name="upload_message">
+		Envoi en cours...
+	</string>
+	<text name="title">
+		Envoyer par e-mail
+	</text>
+	<button label="Message" name="message_btn"/>
+	<button label="Paramètres" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..427ffe21131
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		Publier sur le flux de mon profil
+	</text>
+	<combo_box label="Résolution" name="profile_size_combo">
+		<combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+		<combo_box.item label="640 x 480" name="640x480"/>
+		<combo_box.item label="800 x 600" name="800x600"/>
+		<combo_box.item label="1 024 x 768" name="1024x768"/>
+		<combo_box.item label="Personnalisée" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="Largeur" name="profile_snapshot_width"/>
+			<spinner label="Hauteur" name="profile_snapshot_height"/>
+			<check_box label="Conserver les proportions" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Légende :
+			</text>
+			<check_box initial_value="true" label="Inclure l&apos;endroit" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Annuler" name="cancel_btn"/>
+	<button label="Publier" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index f9f3366f63e..d959a965650 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -1214,7 +1214,7 @@ Veuillez réessayer de vous connecter dans une minute.
 		Vous n&apos;avez pas de copie de cette texture dans votre inventaire
 	</string>
 	<string name="InventoryInboxNoItems">
-		Ici seront livrés les articles achetés sur la Place du marché.
+		Lorsque vous achetez ou recevez un article, il s&apos;affiche ici. Vous pouvez alors le faire glisser vers un dossier de votre inventaire ou le supprimer si vous ne souhaitez pas le conserver.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1412,6 +1412,9 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="no_attachments">
 		Aucun élément attaché porté
 	</string>
+	<string name="Attachments remain">
+		Éléments attachés ([COUNT] emplacements restants)
+	</string>
 	<string name="Buy">
 		Acheter
 	</string>
@@ -1538,6 +1541,12 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="Right Pec">
 		Pectoral droit
 	</string>
+	<string name="Neck">
+		Cou
+	</string>
+	<string name="Avatar Center">
+		Centre de l&apos;avatar
+	</string>
 	<string name="Invalid Attachment">
 		Point d&apos;attache non valide
 	</string>
@@ -4030,6 +4039,18 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 	<string name="you_paid_ldollars_no_name">
 		Vous avez payé à [AMOUNT] L$ [REASON].
 	</string>
+	<string name="you_paid_failure_ldollars">
+		Votre paiement de [AMOUNT] L$ à [NAME] [REASON] a échoué.
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		Votre paiement de [AMOUNT] L$ a échoué.
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		Votre paiement de [AMOUNT] L$ à [NAME] a échoué.
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		Votre paiement de [AMOUNT] L$ [REASON] a échoué.
+	</string>
 	<string name="for item">
 		pour l&apos;article suivant : [ITEM]
 	</string>
@@ -4440,6 +4461,12 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 	<string name="ExternalEditorFailedToRun">
 		Échec d&apos;exécution de l&apos;éditeur externe.
 	</string>
+	<string name="TranslationFailed">
+		Échec de traduction : [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Erreur lors de l&apos;analyse de la réponse relative à la traduction.
+	</string>
 	<string name="Esc">
 		Échap
 	</string>
@@ -4810,7 +4837,7 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 		Mini-carte
 	</string>
 	<string name="Command_Move_Label">
-		Bouger
+		Marcher / Courir / Voler
 	</string>
 	<string name="Command_People_Label">
 		Personnes
@@ -4837,10 +4864,10 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 		Parler
 	</string>
 	<string name="Command_View_Label">
-		Affichage
+		Paramètres de la caméra
 	</string>
 	<string name="Command_Voice_Label">
-		Chat près de vous
+		Paramètres vocaux
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		Information sur le terrain que vous visitez
@@ -4912,7 +4939,16 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 		Changer l&apos;angle de la caméra
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Personnes près de vous avec le chat vocal
+		Commandes de réglage du volume des appels et des personnes près de vous dans Second Life.
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		actuellement dans la barre d&apos;outils du bas
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		actuellement dans la barre d&apos;outils de gauche
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		actuellement dans la barre d&apos;outils de droite
 	</string>
 	<string name="Retain%">
 		Garder%
@@ -4938,4 +4974,19 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 	<string name="Normal">
 		Normal
 	</string>
+	<string name="snapshot_quality_very_low">
+		Très faible
+	</string>
+	<string name="snapshot_quality_low">
+		Faible
+	</string>
+	<string name="snapshot_quality_medium">
+		Moyenne
+	</string>
+	<string name="snapshot_quality_high">
+		Élevée
+	</string>
+	<string name="snapshot_quality_very_high">
+		Très élevée
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/fr/teleport_strings.xml b/indra/newview/skins/default/xui/fr/teleport_strings.xml
index 401b272c813..d0c74ff3530 100644
--- a/indra/newview/skins/default/xui/fr/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/fr/teleport_strings.xml
@@ -21,8 +21,8 @@ Si vous ne parvenez toujours pas à être téléporté, déconnectez-vous puis r
 Veuillez réessayer dans un moment.
 		</message>
 		<message name="NoHelpIslandTP">
-		Vous ne pouvez pas retourner sur Welcome Island.
-Pour répéter le didacticiel, veuillez aller sur Welcome Island Public.
+			Vous ne pouvez pas vous téléporter à nouveau vers Welcome Island.
+Pour recommencer le didacticiel, accédez à Welcome Island Public.
 		</message>
 		<message name="noaccess_tport">
 			Désolé, vous n&apos;avez pas accès à cette destination.
diff --git a/indra/newview/skins/default/xui/it/floater_about.xml b/indra/newview/skins/default/xui/it/floater_about.xml
index 68d073a7669..39114b7bf73 100644
--- a/indra/newview/skins/default/xui/it/floater_about.xml
+++ b/indra/newview/skins/default/xui/it/floater_about.xml
@@ -67,32 +67,34 @@ Versione Server voice: [VOICE_VERSION]
 		<panel label="Licenze" name="licenses_panel">
 			<text_editor name="credits_editor">
 				3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
-APR Copyright (C) 2000-2004 The Apache Software Foundation
-Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
-cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
-DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
-expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Copyright (C) 1999-2004 Brian Paul.
-GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Copyright (c) 2005, Google Inc.
-Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
-jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Copyright (C) 2001, Xiphophorus
-OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
-PCRE Copyright (c) 1997-2008 University of Cambridge
-SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
-zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
-google-perftools Copyright (c) 2005, Google Inc.
+        APR Copyright (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-Il Viewer Second Life utilizza Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (e licenziatari). Tutti i diritti riservati. Per informazioni dettagliate, vedere www.havok.com.
+        Il Viewer Second Life utilizza Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (e licenziatari). Tutti i diritti riservati. Per informazioni dettagliate, vedere www.havok.com.
 
-Tutti i diritti riservati.  Per informazioni dettagliate, vedere licenses.txt.
+        Questo software contiene codice sorgente fornito da NVIDIA Corporation.
 
-Codifica audio chat vocale: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+        Tutti i diritti riservati.  Per informazioni dettagliate, vedere licenses.txt.
+
+        Codifica audio chat vocale: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml
index b6bfb4aadf1..528cf185fcf 100644
--- a/indra/newview/skins/default/xui/it/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/it/floater_about_land.xml
@@ -133,7 +133,7 @@ Vai al menu Mondo &gt; Informazioni sul terreno oppure seleziona un altro appezz
 				Traffico:
 			</text>
 			<text name="DwellText" width="140">
-				0
+				Caricamento in corso...
 			</text>
 			<button label="Acquista il terreno..." label_selected="Acquista il terreno..." left="130" name="Buy Land..." width="125"/>
 			<button label="Vendita Linden" name="Linden Sale..." tool_tip="La terra deve essere di proprietà, con contenuto impostato, e non già messa all&apos;asta."/>
@@ -314,13 +314,15 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
 				Nessuna spinta (Impostazione regionale)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Vedi i residenti in questo lotto e chatta con loro
+				Gli avatar in altri lotti possono vedere
 			</panel.string>
 			<text name="allow_label">
 				Permetti ad altri residenti di:
 			</text>
-			<check_box label="Modificare il terreno" name="edit land check" tool_tip="Se spuntata, chiunque può terraformare il tuo terreno. È preferibile lasciare questa opzione non spuntata, dato che sarai comunque in grado di modificare il tuo terreno."/>
-			<check_box label="Permetti il volo" name="check fly" tool_tip="Se spuntato, gli altri residenti potranno volare sul tuo terreno. Se non spuntato, potranno solamente arrivare in volo o sorvolare il terreno."/>
+			<text name="allow_label0">
+				Vola:
+			</text>
+			<check_box label="Tutti" name="check fly" tool_tip="Se spuntato, gli altri residenti potranno volare sul tuo terreno. Se non spuntato, potranno solamente arrivare in volo o sorvolare il terreno."/>
 			<text name="allow_label2">
 				Creare oggetti:
 			</text>
@@ -336,9 +338,6 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
 			</text>
 			<check_box label="Tutti i residenti" name="check other scripts"/>
 			<check_box label="Gruppo" name="check group scripts"/>
-			<text name="land_options_label">
-				Opzioni per il terreno:
-			</text>
 			<check_box label="Sicuro (senza danno)" name="check safe" tool_tip="Se spuntato, imposta il terreno su &apos;sicuro&apos;, disabilitando i danni da combattimento. Se non spuntato, viene abilitato il combattimento con danni."/>
 			<check_box label="Nessuna spinta" name="PushRestrictCheck" tool_tip="Previeni i colpi. Selezionare questa opzione può essere utile per prevenire comportamenti dannosi sul tuo terreno."/>
 			<check_box label="Mostra luogo nella ricerca (30 L$/settimana)" name="ShowDirectoryCheck" tool_tip="Consenti che il lotto sia visto nei risultati di ricerca"/>
@@ -379,9 +378,9 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Clicca per scegliere una immagine"/>
 			<text name="allow_label5">
-				Permetti ai residenti in altri lotti di:
+				e chattare con avatar in questo lotto
 			</text>
-			<check_box label="Vedi avatar" name="SeeAvatarsCheck" tool_tip="Consente ai residenti in altri lotti di vedere i residenti in questo lotto e chattare con loro, e ti consente di vederli e chattare con loro."/>
+			<check_box label="Vedi avatar" name="SeeAvatarsCheck" tool_tip="Consente ad avatar in altri lotti di vedere e chattare con avatar in questo lotto e viceversa."/>
 			<text name="landing_point">
 				Punto di atterraggio: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/it/floater_avatar.xml b/indra/newview/skins/default/xui/it/floater_avatar.xml
index 1587c347a54..d7445cfb2bf 100644
--- a/indra/newview/skins/default/xui/it/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/it/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="SCELTA AVATAR"/>
+<floater name="Avatar" title="SELEZIONA UN AVATAR"/>
diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
index d985ad2b3cb..743969f5571 100644
--- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		[AMT]L$
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
+		[http://www.secondlife.com/my/account/payment_method_management.php metodo di pagamento] | [http://www.secondlife.com/my/account/currency.php valuta]
 	</text>
 	<text name="exchange_rate_note">
 		Riscrivi l&apos;importo per vedere l&apos;ultimo tasso al cambio.
diff --git a/indra/newview/skins/default/xui/it/floater_camera.xml b/indra/newview/skins/default/xui/it/floater_camera.xml
index 7e6ca4307ed..be03857bc96 100644
--- a/indra/newview/skins/default/xui/it/floater_camera.xml
+++ b/indra/newview/skins/default/xui/it/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="VISTA">
+<floater name="camera_floater" title="CONTROLLI FOTOCAMERA">
 	<floater.string name="rotate_tooltip">
 		Ruota la telecamera Intorno all&apos;Inquadratura
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/it/floater_hardware_settings.xml b/indra/newview/skins/default/xui/it/floater_hardware_settings.xml
index 561f8dbf347..5d3ae04a4d8 100644
--- a/indra/newview/skins/default/xui/it/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/it/floater_hardware_settings.xml
@@ -4,7 +4,7 @@
 		Filtraggio:
 	</text>
 	<check_box label="Filtraggio Anisotropico (rallenta se attivato)" name="ani"/>
-	<text name="Antialiasing:">
+	<text name="antialiasing label">
 		Antialiasing:
 	</text>
 	<combo_box label="Antialiasing" name="fsaa" width="94">
diff --git a/indra/newview/skins/default/xui/it/floater_model_preview.xml b/indra/newview/skins/default/xui/it/floater_model_preview.xml
index 03102f5f81f..ca36fd2defc 100644
--- a/indra/newview/skins/default/xui/it/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/it/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Errore: Errore elaborazione Dae - vedere il registro per informazioni dettagliate.
 	</string>
+	<string name="status_material_mismatch">
+		Errore: il materiale del modello non è un sottoinsieme del modello di riferimento.
+	</string>
 	<string name="status_reading_file">
 		Caricamento in corso...
 	</string>
diff --git a/indra/newview/skins/default/xui/it/floater_model_wizard.xml b/indra/newview/skins/default/xui/it/floater_model_wizard.xml
index e6d0a7c4bcc..7c1b13c18fb 100644
--- a/indra/newview/skins/default/xui/it/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/it/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Scegli il file del modello da caricare
 			</text>
 			<button label="Sfoglia..." label_selected="Sfoglia..." name="browse"/>
+			<text name="Model types">
+				Second Life supporta file COLLADA (.dae)
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/it/floater_moveview.xml b/indra/newview/skins/default/xui/it/floater_moveview.xml
index 6e820a335c5..1237bd06a90 100644
--- a/indra/newview/skins/default/xui/it/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/it/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="SPOSTA">
+<floater name="move_floater" title="CAMMINA / CORRI / VOLA">
 	<string name="walk_forward_tooltip">
 		Cammina in avanti (premi freccia su o W)
 	</string>
diff --git a/indra/newview/skins/default/xui/it/floater_snapshot.xml b/indra/newview/skins/default/xui/it/floater_snapshot.xml
index f1c5cc4caf7..bff6081bdf6 100644
--- a/indra/newview/skins/default/xui/it/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/it/floater_snapshot.xml
@@ -3,73 +3,63 @@
 	<floater.string name="unknown">
 		sconosciuto
 	</floater.string>
-	<radio_group label="Tipo di fotografia" name="snapshot_type_radio">
-		<radio_item label="E-mail" name="postcard"/>
-		<radio_item label="Il mio inventario (L$[AMOUNT])" name="texture"/>
-		<radio_item label="Salva sul mio computer" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		Invio e-mail in corso
+	</string>
+	<string name="profile_progress_str">
+		Caricamento post
+	</string>
+	<string name="inventory_progress_str">
+		Salva nell&apos;inventario
+	</string>
+	<string name="local_progress_str">
+		Salvataggio sul computer in corso
+	</string>
+	<string name="profile_succeeded_str">
+		Immagine caricata
+	</string>
+	<string name="postcard_succeeded_str">
+		E-mail inviata.
+	</string>
+	<string name="inventory_succeeded_str">
+		Salvato nell&apos;inventario.
+	</string>
+	<string name="local_succeeded_str">
+		Salvato sul computer.
+	</string>
+	<string name="profile_failed_str">
+		Caricamento immagine sul feed del profilo non riuscito.
+	</string>
+	<string name="postcard_failed_str">
+		Invio e-mail non riuscito.
+	</string>
+	<string name="inventory_failed_str">
+		Non salvato nell&apos;inventario.
+	</string>
+	<string name="local_failed_str">
+		Non salvato sul computer.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Opzioni Avanzate"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[SIZE] KB
 	</text>
-	<button label="Aggiorna la fotografia" name="new_snapshot_btn"/>
-	<button label="Invia" name="send_btn"/>
-	<button label="Salva ([AMOUNT] L$)" name="upload_btn"/>
-	<flyout_button label="Salva" name="save_btn" tool_tip="Salva immagine come file">
-		<flyout_button.item label="Salva" name="save_item"/>
-		<flyout_button.item label="Salva con nome..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Altro" name="more_btn" tool_tip="Opzioni Avanzate"/>
-	<button label="Meno" name="less_btn" tool_tip="Opzioni Avanzate"/>
-	<button label="Annulla" name="discard_btn"/>
-	<text name="type_label2">
-		Dimensioni
-	</text>
-	<text name="format_label">
-		Formato
-	</text>
-	<combo_box label="Risoluzione" name="postcard_size_combo">
-		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="Personalizza" name="Custom"/>
-	</combo_box>
-	<combo_box label="Risoluzione" name="texture_size_combo">
-		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
-		<combo_box.item label="Piccola (128x128)" name="Small(128x128)"/>
-		<combo_box.item label="Media (256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
-		<combo_box.item label="Personalizza" name="Custom"/>
-	</combo_box>
-	<combo_box label="Risoluzione" name="local_size_combo">
-		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="Personalizza" name="Custom"/>
-	</combo_box>
-	<combo_box label="Formato" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="Larghezza" name="snapshot_width"/>
-	<spinner label="Altezza" name="snapshot_height"/>
-	<check_box label="Mantieni le proporzioni" name="keep_aspect_check"/>
-	<slider label="Qualità dell&apos;immagine" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Cattura:
-	</text>
-	<combo_box label="Layer dell&apos;immagine" name="layer_types">
-		<combo_box.item label="Colori" name="Colors"/>
-		<combo_box.item label="Profondità" name="Depth"/>
-	</combo_box>
-	<check_box label="Interfaccia" name="ui_check"/>
-	<check_box label="HUD" name="hud_check"/>
-	<check_box label="Tieni aperta dopo il salvataggio" name="keep_open_check"/>
-	<check_box label="Congela il frame (tutto schermo)" name="freeze_frame_check"/>
-	<check_box label="Aggiornamento automatico" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			OPZIONI AVANZATE
+		</text>
+		<text name="layer_type_label">
+			Cattura:
+		</text>
+		<combo_box label="Layer dell&apos;immagine" name="layer_types">
+			<combo_box.item label="Colori" name="Colors"/>
+			<combo_box.item label="Profondità" name="Depth"/>
+		</combo_box>
+		<check_box label="Interfaccia" name="ui_check"/>
+		<check_box label="HUD" name="hud_check"/>
+		<check_box label="Congela il frame (tutto schermo)" name="freeze_frame_check"/>
+		<check_box label="Aggiornamento automatico" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/it/floater_toybox.xml b/indra/newview/skins/default/xui/it/floater_toybox.xml
index c8d5f1ed7c5..269e2831d06 100644
--- a/indra/newview/skins/default/xui/it/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/it/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="PERSONALIZZA BARRE STRUMENTI">
+<floater name="Toybox" title="PULSANTI BARRA STRUMENTI">
 	<text name="toybox label 1">
 		Aggiungere o rimuovere pulsanti trascinandoli dentro o fuori dalle barre strumenti.
 	</text>
 	<text name="toybox label 2">
 		I pulsanti verranno visualizzati come mostrato o solo come icone, a seconda delle impostazioni della singola barra degli strumenti.
 	</text>
+	<button label="Cancella tutte le barre strumenti" label_selected="Cancella tutte le barre strumenti" name="btn_clear_all"/>
 	<button label="Ripristina predefiniti" label_selected="Ripristina predefiniti" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/it/floater_translation_settings.xml b/indra/newview/skins/default/xui/it/floater_translation_settings.xml
new file mode 100644
index 00000000000..a0a34da723e
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="IMPOSTAZIONI TRADUZIONE CHAT">
+	<string name="bing_api_key_not_verified">
+		appID Bing non verificato. Riprova.
+	</string>
+	<string name="google_api_key_not_verified">
+		Chiave API Google non verificata. Riprova.
+	</string>
+	<string name="bing_api_key_verified">
+		appID Bing verificato.
+	</string>
+	<string name="google_api_key_verified">
+		Chiave API Google verificata.
+	</string>
+	<check_box label="Usa la traduzione meccanica durante le chat" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Traduci chat in:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="Predefinito di sistema" name="System Default Language"/>
+		<combo_box.item label="English (Inglese)" name="English"/>
+		<combo_box.item label="Dansk (Danese)" name="Danish"/>
+		<combo_box.item label="Deutsch (Tedesco)" name="German"/>
+		<combo_box.item label="Español (Spagnolo)" name="Spanish"/>
+		<combo_box.item label="Français (Francese)" name="French"/>
+		<combo_box.item label="Italiano" name="Italian"/>
+		<combo_box.item label="Magyar (Ungherese)" name="Hungarian"/>
+		<combo_box.item label="Nederlands (Olandese)" name="Dutch"/>
+		<combo_box.item label="Polski (Polacco)" name="Polish"/>
+		<combo_box.item label="Português (Portoghese)" name="Portugese"/>
+		<combo_box.item label="Русский (Russo)" name="Russian"/>
+		<combo_box.item label="Türkçe (Turco)" name="Turkish"/>
+		<combo_box.item label="Українська (Ucraino)" name="Ukrainian"/>
+		<combo_box.item label="中文 (正體) (Cinese)" name="Chinese"/>
+		<combo_box.item label="日本語 (Giapponese)" name="Japanese"/>
+		<combo_box.item label="한국어 (Coreano)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Seleziona il servizio di traduzione:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		Bing [http://www.bing.com/developers/createapp.aspx AppID]:
+	</text>
+	<button label="Verifica" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		Google [http://code.google.com/apis/language/translate/v2/getting_started.html#auth API key]:
+	</text>
+	<button label="Verifica" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Prezzi] | [https://code.google.com/apis/console Statistiche]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="Annulla" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_voice_controls.xml b/indra/newview/skins/default/xui/it/floater_voice_controls.xml
index d0ac815b8b3..77973eef1e0 100644
--- a/indra/newview/skins/default/xui/it/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/it/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="CONTROLLI VOCE">
 	<string name="title_nearby">
-		Voce vicina
+		IMPOSTAZIONI VOCE
 	</string>
 	<string name="title_group">
-		Chiamata di gruppo con [GROUP]
+		CHIAMATA DI GRUPPO CON [GROUP]
 	</string>
 	<string name="title_adhoc">
-		Chiamata in conferenza
+		CHIAMATA IN CONFERENZA
 	</string>
 	<string name="title_peer_2_peer">
-		Chiamata con [NAME]
+		CHIAMATA CON [NAME]
 	</string>
 	<string name="no_one_near">
 		Nessuno nei dintorni ha attivato la funzione voce
diff --git a/indra/newview/skins/default/xui/it/menu_toolbars.xml b/indra/newview/skins/default/xui/it/menu_toolbars.xml
index 784ecd262c5..604ca763d13 100644
--- a/indra/newview/skins/default/xui/it/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/it/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Seleziona pulsanti..." name="Chose Buttons"/>
+	<menu_item_call label="Rimuovi questo pulsante" name="Remove button"/>
+	<menu_item_call label="Pulsanti barra strumenti..." name="Choose Buttons"/>
 	<menu_item_check label="Icone ed etichette" name="icons_with_text"/>
 	<menu_item_check label="Solo icone" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index 8792a0fc195..5140d2b1ec1 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Io" name="Me">
-		<menu_item_call label="Dashboard..." name="Manage My Account">
-			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=it"/>
-		</menu_item_call>
 		<menu_item_call label="Profilo..." name="Profile"/>
 		<menu_item_call label="Aspetto fisico..." name="ChangeOutfit"/>
+		<menu_item_call label="Scegli un avatar..." name="Avatar Picker"/>
 		<menu_item_check label="Inventario..." name="Inventory"/>
-		<menu_item_check label="Gesture..." name="Gestures"/>
-		<menu_item_check label="Voce..." name="ShowVoice"/>
+		<menu_item_call label="Nuova finestra inventario" name="NewInventoryWindow"/>
+		<menu_item_call label="Luoghi..." name="Places"/>
+		<menu_item_call label="Preferiti..." name="Picks"/>
+		<menu_item_call label="Controlli fotocamera..." name="Camera Controls"/>
 		<menu label="Spostamento" name="Movement">
 			<menu_item_call label="Siedi" name="Sit Down Here"/>
 			<menu_item_check label="Vola" name="Fly"/>
@@ -22,34 +22,39 @@
 		<menu_item_call label="Richiedi diritti Admin" name="Request Admin Options"/>
 		<menu_item_call label="Lascia stato Admin" name="Leave Admin Options"/>
 		<menu_item_call label="Compra L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Dashboard dell&apos;account..." name="Manage My Account">
+			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=it"/>
+		</menu_item_call>
 		<menu_item_call label="Preferenze..." name="Preferences"/>
-		<menu_item_call label="Barre strumenti..." name="Toolbars"/>
+		<menu_item_call label="Pulsanti barra strumenti..." name="Toolbars"/>
 		<menu_item_call label="Nascondi tutti i controlli" name="Hide UI"/>
 		<menu_item_call label="Esci da [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Comunica" name="Communicate">
-		<menu_item_call label="I miei amici..." name="My Friends"/>
-		<menu_item_call label="I miei gruppi" name="My Groups"/>
-		<menu_item_check label="Chat nei dintorni" name="Nearby Chat"/>
+		<menu_item_check label="Chat..." name="Nearby Chat"/>
+		<menu_item_check label="Parla" name="Speak"/>
+		<menu_item_check label="Impostazioni voce..." name="Nearby Voice"/>
+		<menu_item_check label="Manipolazione voce..." name="ShowVoice"/>
+		<menu_item_check label="Gesture..." name="Gestures"/>
+		<menu_item_call label="Amici" name="My Friends"/>
+		<menu_item_call label="Gruppi" name="My Groups"/>
 		<menu_item_call label="Persone vicine" name="Active Speakers"/>
-		<menu_item_check label="Voce nei dintorni" name="Nearby Voice"/>
 	</menu>
 	<menu label="Mondo" name="World">
+		<menu_item_call label="Crea punto di riferimento per questo luogo" name="Create Landmark Here"/>
+		<menu_item_call label="Destinazioni..." name="Destinations"/>
+		<menu_item_check label="Mappamondo" name="World Map"/>
 		<menu_item_check label="Mini mappa" name="Mini-Map"/>
-		<menu_item_check label="Mappa del mondo" name="World Map"/>
 		<menu_item_check label="Cerca" name="Search"/>
+		<menu_item_call label="Teleport a Casa" name="Teleport Home"/>
+		<menu_item_call label="Imposta come Casa mia" name="Set Home to Here"/>
 		<menu_item_call label="Istantanea" name="Take Snapshot"/>
-		<menu_item_call label="Crea punto di riferimento per questo luogo" name="Create Landmark Here"/>
-		<menu label="Profilo del luogo" name="Land">
-			<menu_item_call label="Profilo del luogo" name="Place Profile"/>
-			<menu_item_call label="Informazioni sui terreni" name="About Land"/>
-			<menu_item_call label="Regione/proprietà immobiliare" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="Profilo del luogo" name="Place Profile"/>
+		<menu_item_call label="Informazioni sul terreno" name="About Land"/>
+		<menu_item_call label="Regione/proprietà immobiliare" name="Region/Estate"/>
+		<menu_item_call label="Terreni posseduti..." name="My Land"/>
 		<menu_item_call label="Acquista questo terreno" name="Buy Land"/>
-		<menu_item_call label="Il mio terreno" name="My Land"/>
 		<menu label="Mostra" name="LandShow">
-			<menu_item_check label="Comandi del movimento" name="Movement Controls"/>
-			<menu_item_check label="Comandi visualizzazione" name="Camera Controls"/>
 			<menu_item_check label="Linee di divieto" name="Ban Lines"/>
 			<menu_item_check label="Marcatori" name="beacons"/>
 			<menu_item_check label="Linee di confine" name="Property Lines"/>
@@ -58,29 +63,28 @@
 			<menu_item_check label="Proprietà del lotto" name="Parcel Properties"/>
 			<menu_item_check label="Menu Avanzato" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Teleport a Casa" name="Teleport Home"/>
-		<menu_item_call label="Imposta come Casa mia" name="Set Home to Here"/>
 		<menu label="Sole" name="Environment Settings">
 			<menu_item_call label="Alba" name="Sunrise"/>
 			<menu_item_call label="Mezzogiorno" name="Noon"/>
 			<menu_item_call label="Tramonto" name="Sunset"/>
 			<menu_item_call label="Mezzanotte" name="Midnight"/>
+			<menu_item_call label="Usa impostazioni regione" name="Use Region Settings"/>
 		</menu>
-		<menu label="Editor ambiente" name="Enviroment Editor">
-			<menu_item_call label="Impostazioni ambiente..." name="Enviroment Settings"/>
+		<menu label="Editor ambiente" name="Environment Editor">
+			<menu_item_call label="Impostazioni ambiente..." name="Environment Settings"/>
 			<menu label="Valori predefiniti acqua" name="Water Presets">
 				<menu_item_call label="Nuovo valore predefinito..." name="new_water_preset"/>
-				<menu_item_call label="Modifica valori predefiniti..." name="edit_water_preset"/>
+				<menu_item_call label="Modifica valore predefinito..." name="edit_water_preset"/>
 				<menu_item_call label="Cancella valore predefinito..." name="delete_water_preset"/>
 			</menu>
 			<menu label="Valori predefiniti cielo" name="Sky Presets">
 				<menu_item_call label="Nuovo valore predefinito..." name="new_sky_preset"/>
-				<menu_item_call label="Modifica valori predefiniti..." name="edit_sky_preset"/>
+				<menu_item_call label="Modifica valore predefinito..." name="edit_sky_preset"/>
 				<menu_item_call label="Cancella valore predefinito..." name="delete_sky_preset"/>
 			</menu>
-			<menu label="Valori predefiniti giornata" name="Day Presets">
+			<menu label="Valori predefiniti giorno" name="Day Presets">
 				<menu_item_call label="Nuovo valore predefinito..." name="new_day_preset"/>
-				<menu_item_call label="Modifica valori predefiniti..." name="edit_day_preset"/>
+				<menu_item_call label="Modifica valore predefinito..." name="edit_day_preset"/>
 				<menu_item_call label="Cancella valore predefinito..." name="delete_day_preset"/>
 			</menu>
 		</menu>
@@ -146,6 +150,7 @@
 		<menu_item_call label="Ripeti" name="Redo"/>
 	</menu>
 	<menu label="Aiuto" name="Help">
+		<menu_item_call label="Istruzioni..." name="How To"/>
 		<menu_item_call label="Aiuto di [SECOND_LIFE]" name="Second Life Help"/>
 		<menu_item_call label="Segnala abuso" name="Report Abuse"/>
 		<menu_item_call label="Segnala bug" name="Report Bug"/>
@@ -199,11 +204,10 @@
 		<menu_item_check label="Usa thread lettura plugin" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Pulisci cache di gruppo" name="ClearGroupCache"/>
 		<menu_item_check label="Fluidità mouse" name="Mouse Smoothing"/>
+		<menu_item_call label="Rilascia tasti" name="Release Keys"/>
 		<menu label="Scorciatoie" name="Shortcuts">
 			<menu_item_call label="Immagine ([COST]L$)..." name="Upload Image"/>
 			<menu_item_check label="Cerca" name="Search"/>
-			<menu_item_call label="Rilascia tasti" name="Release Keys"/>
-			<menu_item_call label="Imposta dimensioni dell&apos;interfaccia sui valori predefiniti" name="Set UI Size to Default"/>
 			<menu_item_check label="Mostra menu Avanzato - tasti di scelta rapida esistenti" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Chiudi finestra" name="Close Window"/>
 			<menu_item_call label="Chiudi tutte le finestre" name="Close All Windows"/>
@@ -272,6 +276,7 @@
 			<menu_item_check label="Aggiorna tipo" name="Update Type"/>
 			<menu_item_check label="Info livello dettaglio" name="LOD Info"/>
 			<menu_item_check label="Crea coda" name="Build Queue"/>
+			<menu_item_check label="Vettori vento" name="Wind Vectors"/>
 			<menu_item_check label="Complessità rendering" name="rendercomplexity"/>
 			<menu_item_check label="Scolpisci" name="Sculpt"/>
 		</menu>
@@ -281,7 +286,6 @@
 			<menu_item_check label="Luci e ombre" name="Lighting and Shadows"/>
 			<menu_item_check label="Ombra dal sole, dalla luna e dai proiettori" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO e ombre fluide" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Illuminazione globale (sperimentale)" name="Global Illumination"/>
 			<menu_item_check label="Maschera alfa automatica (differita)" name="Automatic Alpha Masks (deferred)"/>
 			<menu_item_check label="Maschera alfa automatica (non differita)" name="Automatic Alpha Masks (non-deferred)"/>
 			<menu_item_check label="Texture delle animazioni" name="Animation Textures"/>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index fce027da0c9..fcc515186df 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -1110,8 +1110,13 @@ Cedere questi [AREA] m² di terreno al gruppo &apos;[GROUP_NAME]&apos;?
 	<notification name="DisplaySetToSafe">
 		Le impostazioni dello schermo sono state impostate a valori di sicurezza perchè hai specificato l&apos;opzione -safe.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Le impostazioni dello schermo sono state impostate a valori ottimali basati sulla tua configurazione di sistema.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		Le impostazioni di visualizzazione sono ai livelli consigliati a causa di un cambiamento nella scheda grafica
+da &apos;[LAST_GPU]&apos;
+a &apos;[THIS_GPU]&apos;
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		Le impostazioni di visualizzazione sono ai livelli consigliati a causa di un cambiamento nel sottosistema di rendering.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1916,7 +1921,13 @@ Trasferisci gli elementi nell&apos;inventario?
 		<usetemplate ignoretext="Conferma prima di uscire" name="okcancelignore" notext="Non uscire" yestext="Esci"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		Passare ai pulsanti e alle barre strumenti predefinite? 
+		Questa azione ripristina pulsanti e barre degli strumenti predefinite.
+
+Questa azione non può essere ripristinata
+		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Questa azione riporterà tutti i pulsanti nella casella strumenti. Le barre degli strumenti saranno vuote.
     
 Questa azione non può essere ripristinata
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
@@ -2125,10 +2136,10 @@ Verrà avviato il browser Web.
 		Oggetto: [SUBJECT], Messaggio: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è Online
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è online
 	</notification>
 	<notification name="FriendOffline">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è Offline
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; è offline
 	</notification>
 	<notification name="AddSelfFriend">
 		Anche se sei molto simpatico, non puoi aggiungere te stesso all&apos;elenco degli amici.
@@ -2241,14 +2252,16 @@ Seleziona solo un oggetto.
 		Il tuo biglietto da visita non è stato accettato.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Puoi teleportarti alle ubicazioni come &apos;[NAME]&apos; aprendo il pannello Luoghi sul lato destro dello schermo, quindi selezionare la scheda Punti di riferimento.
-Clicca su un punto di riferimento per selezionarlo, quindi clicca su Teleport sul lato inferiore del pannello.
-(Puoi anche fare doppio clic sul punto di riferimento oppure cliccare su di esso con il tasto destro del mouse e scegliere Teleport.)
+		Per teleportarti a luoghi come &apos;[NAME]&apos;, clicca sul pulsante &quot;Luoghi&quot;,
+    quindi seleziona la scheda Punti di riferimento nel pannello che viene aperto. Clicca su qualsiasi
+    unto di riferimento per selezionarlo, quindi clicca su Teleport sul lato inferiore del pannello.
+    (Puoi anche fare doppio clic sul punto di riferimento oppure cliccare su di esso con il tasto destro del mouse e 
+    scegliere Teleport.)
 	</notification>
 	<notification name="TeleportToPerson">
-		Puoi contattare il residente &apos;[NAME]&apos; aprendo il pannello Persone nel lato destro del tuo schermo.
-Seleziona il residente dall&apos;elenco, clicca su &apos;IM&apos; in basso nel pannello.
-(Puoi anche fare doppio clic sul nome nell&apos;elenco oppure fare clic con il pulsante destro del mouse e selezionare &apos;IM&apos;).
+		Per contattare Residenti come &apos;[NAME]&apos;, clicca sul pulsante &quot;Persone&quot;, seleziona un Residente nel pannello che viene aperto, quindi clicca su &apos;IM&apos; in
+    basso nel pannello.
+    (Puoi anche fare doppio clic sul nome nell&apos;elenco oppure fare clic con il pulsante destro del mouse e selezionare &apos;IM&apos;).
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		Non è possibile selezionare il terreno attraverso i confini del server.
@@ -2269,6 +2282,9 @@ Prova a selezionare una parte di terreno più piccola.
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Notifica eventi:
 
@@ -2520,10 +2536,10 @@ Riprova tra qualche istante.
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha accettato la tua offerta di amicizia.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha accettato la tua richiesta di amicizia.
 	</notification>
 	<notification name="FriendshipDeclined">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rifiutato la tua offerta di amicizia.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; ha rifiutato la tua richiesta di amicizia.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Offerta di amicizia accettata.
@@ -2800,7 +2816,7 @@ Per informazioni dettagliate, vedi il file del registro.
 Con i seguenti residenti?
 
 [RESIDENTS]
-		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="Ok"/>
+		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="ItemsShared">
 		Gli oggetti sono stati condivisi.
@@ -2890,7 +2906,7 @@ In questo modo verrà disattivato l&apos;audio anche di tutti i residenti che si
 uniscono alla chiamata in un secondo momento, anche dopo che tu ti fossi scollegato.
 
 Disattiva audio di tutti?
-		<usetemplate ignoretext="Conferma prima di disattivare l&apos;audio di tutti i partecipanti alla chiamata di gruppo" name="okcancelignore" notext="Annulla" yestext="Ok"/>
+		<usetemplate ignoretext="Conferma prima di disattivare l&apos;audio di tutti i partecipanti alla chiamata di gruppo" name="okcancelignore" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification label="Chat" name="HintChat">
 		Per partecipare alla conversazione, digita nel campo chat in basso.
diff --git a/indra/newview/skins/default/xui/it/panel_edit_skin.xml b/indra/newview/skins/default/xui/it/panel_edit_skin.xml
index a15489b333a..466eff27080 100644
--- a/indra/newview/skins/default/xui/it/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/it/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Tatuaggi testa" name="Head Tattoos" tool_tip="Clicca per scegliere una fotografia"/>
-		<texture_picker label="Tatuaggi superiori" name="Upper Tattoos" tool_tip="Clicca per scegliere una fotografia"/>
-		<texture_picker label="Tatuaggi inferiori" name="Lower Tattoos" tool_tip="Clicca per scegliere una fotografia"/>
+		<texture_picker label="Testa" name="Head" tool_tip="Clicca per scegliere una fotografia"/>
+		<texture_picker label="Parte superiore del corpo" name="Upper Body" tool_tip="Clicca per scegliere una fotografia"/>
+		<texture_picker label="Parte inferiore del corpo" name="Lower Body" tool_tip="Clicca per scegliere una fotografia"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/it/panel_postcard_message.xml b/indra/newview/skins/default/xui/it/panel_postcard_message.xml
new file mode 100644
index 00000000000..c720f4822dc
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		A:
+	</text>
+	<text name="name_label">
+		Da:
+	</text>
+	<text name="subject_label">
+		Oggetto:
+	</text>
+	<line_editor label="Digita qui l&apos;oggetto." name="subject_form"/>
+	<text name="msg_label">
+		Messaggio:
+	</text>
+	<text_editor name="msg_form">
+		Digita qui il messaggio.
+	</text_editor>
+	<button label="Annulla" name="cancel_btn"/>
+	<button label="Invia" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_postcard_settings.xml b/indra/newview/skins/default/xui/it/panel_postcard_settings.xml
new file mode 100644
index 00000000000..6a586c44155
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Risoluzione" name="postcard_size_combo">
+		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Personalizza" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="Larghezza" name="postcard_snapshot_width"/>
+			<spinner label="Altezza" name="postcard_snapshot_height"/>
+			<check_box label="Mantieni le proporzioni" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Qualità dell&apos;immagine" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml
index 1a0a1d8434e..7f5992b5845 100644
--- a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml
@@ -29,30 +29,5 @@
 	<check_box label="Chat IM" name="EnableIMChatPopups" tool_tip="Seleziona per vedere una finestra popup quando arriva un messaggio IM"/>
 	<spinner label="Durata chat vicine:" name="nearby_toasts_lifetime"/>
 	<spinner label="Durata dissolvenza chat vicine:" name="nearby_toasts_fadingtime"/>
-	<check_box label="Use machine translation while chatting" name="translate_chat_checkbox"/>
-	<text name="translate_chb_label">
-		Usa la traduzione meccanica durante le chat
-	</text>
-	<text name="translate_language_text" width="110">
-		Traduci chat in:
-	</text>
-	<combo_box name="translate_language_combobox" width="146">
-		<combo_box.item label="Default di sistema" name="System Default Language"/>
-		<combo_box.item label="English (Inglese)" name="English"/>
-		<combo_box.item label="Dansk (Danese)" name="Danish"/>
-		<combo_box.item label="Deutsch (Tedesco)" name="German"/>
-		<combo_box.item label="Español (Spagnolo)" name="Spanish"/>
-		<combo_box.item label="Français (Francese)" name="French"/>
-		<combo_box.item label="Italiano" name="Italian"/>
-		<combo_box.item label="Magyar (Ungherese)" name="Hungarian"/>
-		<combo_box.item label="Nederlands (Olandese)" name="Dutch"/>
-		<combo_box.item label="Polski (Polacco)" name="Polish"/>
-		<combo_box.item label="Português (Portoghese)" name="Portugese"/>
-		<combo_box.item label="Русский (Russo)" name="Russian"/>
-		<combo_box.item label="Türkçe (Turco)" name="Turkish"/>
-		<combo_box.item label="Українська (Ucraino)" name="Ukrainian"/>
-		<combo_box.item label="中文 (正體) (Cinese)" name="Chinese"/>
-		<combo_box.item label="日本語 (Giapponese)" name="Japanese"/>
-		<combo_box.item label="한국어 (Coreano)" name="Korean"/>
-	</combo_box>
+	<button label="Impostazioni traduzione chat" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
index bf784321108..0189d47f45e 100644
--- a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Usa il mio browser (IE, Firefox, Safari)" name="external" tool_tip="Utilizza il browser Web predefinito di sistema per l&apos;aiuto, per i link Web e così via. Sconsigliato durante l&apos;esecuzione a tutto schermo." value="1"/>
+		<radio_item label="Usa il mio browser (IE, Firefox, Safari)" name="external" tool_tip="Utilizza il browser Web predefinito di sistema per l&apos;aiuto, per i link Web e così via. Sconsigliato durante l&apos;esecuzione a tutto schermo." value="true"/>
 		<radio_item label="Utilizza il browser Web integrato" name="internal" tool_tip="Utilizza il browser Web integrato per l&apos;aiuto, per i link Web e così via. Questo browser si apre in una nuova finestra in [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Abilita plugin" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..c9245029b71
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		Salva nell&apos;inventario
+	</text>
+	<text name="hint_lbl">
+		Salvare un&apos;immagine nell&apos;inventario costa L$[UPLOAD_COST]. Per salvare l&apos;immagine come texture, selezionare uno dei formati quadrati.
+	</text>
+	<combo_box label="Risoluzione" name="texture_size_combo">
+		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+		<combo_box.item label="Piccola (128x128)" name="Small(128x128)"/>
+		<combo_box.item label="Media (256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
+		<combo_box.item label="Personalizza" name="Custom"/>
+	</combo_box>
+	<spinner label="Larghezza" name="inventory_snapshot_width"/>
+	<spinner label="Altezza" name="inventory_snapshot_height"/>
+	<check_box label="Mantieni le proporzioni" name="inventory_keep_aspect_check"/>
+	<button label="Annulla" name="cancel_btn"/>
+	<button label="Salva" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_local.xml b/indra/newview/skins/default/xui/it/panel_snapshot_local.xml
new file mode 100644
index 00000000000..4b725b68f97
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Salva sul mio computer
+	</text>
+	<combo_box label="Risoluzione" name="local_size_combo">
+		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="Personalizza" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="Larghezza" name="local_snapshot_width"/>
+			<spinner label="Altezza" name="local_snapshot_height"/>
+			<check_box label="Mantieni le proporzioni" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Formato" name="local_format_combo">
+				<combo_box.item label="PNG (senza perdite)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (senza perdite)" name="BMP"/>
+			</combo_box>
+			<slider label="Qualità dell&apos;immagine" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Annulla" name="cancel_btn"/>
+	<flyout_button label="Salva" name="save_btn" tool_tip="Salva immagine come file">
+		<flyout_button.item label="Salva" name="save_item"/>
+		<flyout_button.item label="Salva con nome..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
new file mode 100644
index 00000000000..f2d42c5197b
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="Invia post al feed del mio profilo" name="save_to_profile_btn"/>
+	<button label="E-mail" name="save_to_email_btn"/>
+	<button label="Salva nell&apos;inventario (L$[AMOUNT])" name="save_to_inventory_btn"/>
+	<button label="Salva sul mio computer" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..3703b97e6ce
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		Cartolina da [SECOND_LIFE].
+	</string>
+	<string name="default_message">
+		Dai un&apos;occhiata!
+	</string>
+	<string name="upload_message">
+		Invio...
+	</string>
+	<text name="title">
+		E-mail
+	</text>
+	<button label="Messaggio" name="message_btn"/>
+	<button label="Impostazioni" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/it/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..2cdbf970498
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		Invia post al feed del mio profilo
+	</text>
+	<combo_box label="Risoluzione" name="profile_size_combo">
+		<combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Personalizza" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="Larghezza" name="profile_snapshot_width"/>
+			<spinner label="Altezza" name="profile_snapshot_height"/>
+			<check_box label="Mantieni le proporzioni" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Didascalia:
+			</text>
+			<check_box initial_value="true" label="Includi luogo" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Annulla" name="cancel_btn"/>
+	<button label="Post" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 8f292338251..c81dd0f55d5 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -1205,7 +1205,7 @@ Prova ad accedere nuovamente tra un minuto.
 		Non hai una copia di questa texture nel tuo inventario
 	</string>
 	<string name="InventoryInboxNoItems">
-		Gli elementi acquistati attraverso il mercato verranno consegnati qui
+		Quando acquisti o ricevi un oggetto, verrà visualizzato qui per permetterti di trascinarlo in una cartella dell&apos;inventario o di cancellarlo se non desideri mantenerlo.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]/learn_more
@@ -1397,6 +1397,9 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="no_attachments">
 		Nessun allegato indossato
 	</string>
+	<string name="Attachments remain">
+		Allegati ([COUNT] spazi restanti)
+	</string>
 	<string name="Buy">
 		Acquista
 	</string>
@@ -1523,6 +1526,12 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="Right Pec">
 		Petto destro
 	</string>
+	<string name="Neck">
+		Collo
+	</string>
+	<string name="Avatar Center">
+		Centro avatar
+	</string>
 	<string name="Invalid Attachment">
 		Punto di collegamento non valido
 	</string>
@@ -3940,6 +3949,18 @@ Se il messaggio persiste, contatta [SUPPORT_SITE].
 	<string name="you_paid_ldollars_no_name">
 		Hai pagato L$ [AMOUNT] [REASON].
 	</string>
+	<string name="you_paid_failure_ldollars">
+		Non hai pagato [NAME] L$[AMOUNT] [REASON].
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		Non hai pagato L$ [AMOUNT].
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		Non hai pagato [NAME] L$[AMOUNT].
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		Non hai pagato L$ [AMOUNT] [REASON].
+	</string>
 	<string name="for item">
 		per [ITEM]
 	</string>
@@ -4350,6 +4371,12 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 	<string name="ExternalEditorFailedToRun">
 		L&apos;editor esterno non è stato avviato.
 	</string>
+	<string name="TranslationFailed">
+		Traduzione non riuscita: [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Errore di elaborazione della risposta della traduzione.
+	</string>
 	<string name="Esc">
 		Esc
 	</string>
@@ -4720,7 +4747,7 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 		Mini mappa
 	</string>
 	<string name="Command_Move_Label">
-		Movimento
+		Cammina / corri / vola
 	</string>
 	<string name="Command_People_Label">
 		Persone
@@ -4747,10 +4774,10 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 		Parla
 	</string>
 	<string name="Command_View_Label">
-		Visuale
+		Controlli fotocamera
 	</string>
 	<string name="Command_Voice_Label">
-		Voce vicina
+		Impostazioni voce
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		Informazioni sul terreno che visiti
@@ -4822,7 +4849,16 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 		Modifica angolo fotocamera
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Persona vicine con funzioni voce
+		I controlli per il volume per le chiamate e per le persone nelle vicinanze nel mondo virtuale
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		attualmente nella barra degli strumenti in basso
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		attualmente nella barra degli strumenti a sinistra
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		attualmente nella barra degli strumenti a destra
 	</string>
 	<string name="Retain%">
 		Mantieni%
@@ -4848,4 +4884,19 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 	<string name="Normal">
 		Normale
 	</string>
+	<string name="snapshot_quality_very_low">
+		Molto basso
+	</string>
+	<string name="snapshot_quality_low">
+		Basso
+	</string>
+	<string name="snapshot_quality_medium">
+		Medio
+	</string>
+	<string name="snapshot_quality_high">
+		Alto
+	</string>
+	<string name="snapshot_quality_very_high">
+		Molto alto
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/it/teleport_strings.xml b/indra/newview/skins/default/xui/it/teleport_strings.xml
index a0b324d8fbe..f4852122909 100644
--- a/indra/newview/skins/default/xui/it/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/it/teleport_strings.xml
@@ -19,8 +19,8 @@ Se si continua a visualizzare questo messaggio, consulta la pagina [SUPPORT_SITE
 			Spiacenti, il sistema non riesce a completare il teletrasporto. Riprova tra un attimo.
 		</message>
 		<message name="NoHelpIslandTP">
-		Non è possibile per te ritornare all&apos;Welcome Island.
-Vai alla &apos;Welcome Island Public&apos; per ripetere il tutorial.
+			Non puoi teleportarti nuovamente a Welcome Island.
+Per ripetere l&apos;esercitazione, visita &apos;Welcome Island Public&apos;.
 		</message>
 		<message name="noaccess_tport">
 			Spiacenti, ma non hai accesso nel luogo di destinazione richiesto.
diff --git a/indra/newview/skins/default/xui/ja/floater_about.xml b/indra/newview/skins/default/xui/ja/floater_about.xml
index c628ade43e7..3c7a210a22b 100644
--- a/indra/newview/skins/default/xui/ja/floater_about.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about.xml
@@ -90,6 +90,8 @@ google-perftools Copyright (c) 2005, Google Inc.
 
 Second Life ビューワでは Havok (TM) Physics が使用されています。(c)Copyright 1999-2010 Havok.com Inc. (and its Licensors).無断複写・複製・転載を禁じます。詳細については www.havok.com をご参照ください。
 
+このソフトウェアには、NVIDIA Corporation によるソースコードが含まれます。
+
 無断複写・複製・転載を禁じます。詳細については licenses.txt をご参照ください。
 
 ボイスチャットのオーディオコーディング:Polycom(R) Siren14(TM) (ITU-T Rec.G.722.1 Annex C)
diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml
index 3c88c902f88..816a6ff203e 100644
--- a/indra/newview/skins/default/xui/ja/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml
@@ -130,7 +130,7 @@
 				交通量:
 			</text>
 			<text name="DwellText">
-				誤
+				ローディング...
 			</text>
 			<button label="土地の購入" label_selected="土地を購入..." left="130" name="Buy Land..." width="100"/>
 			<button label="リンデンセール" label_selected="Linden セール..." name="Linden Sale..." tool_tip="土地が所有されており、コンテンツが設定されている必要があります。オークションの対象になっていないことも必要条件です。"/>
@@ -311,13 +311,15 @@
 				プッシュ禁止 (地域設定優先)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				この区画にいる住人と会ってチャットする
+				他の区画にいるアバターは、
 			</panel.string>
 			<text name="allow_label">
 				他の住人への許可:
 			</text>
-			<check_box label="地形を編集" name="edit land check" tool_tip="チェックを入れると、他人があなたの土地の地形編集を行うことが可能となります。このオプションのチェックを外しておくことをおすすめします。外した状態であなたの土地の地形編集が可能です。"/>
-			<check_box label="飛行" name="check fly" tool_tip="チェックを入れるとこの土地での飛行が可能となります。チェックを外すと土地に入る際と通り過ぎるときのみ飛行可能となります。"/>
+			<text name="allow_label0">
+				飛行:
+			</text>
+			<check_box label="全員" name="check fly" tool_tip="チェックを入れるとこの土地での飛行が可能となります。チェックを外すと土地に入る際と通り過ぎるときのみ飛行可能となります。"/>
 			<text name="allow_label2">
 				制作:
 			</text>
@@ -333,9 +335,6 @@
 			</text>
 			<check_box label="全員" name="check other scripts"/>
 			<check_box label="グループ" name="check group scripts"/>
-			<text name="land_options_label">
-				土地オプション:
-			</text>
 			<check_box label="安全(ダメージなし)" name="check safe" tool_tip="チェックを入れるとこの土地でのダメージコンバットが無効になり、「安全」に設定されます。 チェックを外すとダメージコンバットが有効になります。"/>
 			<check_box label="プッシュ禁止" name="PushRestrictCheck" tool_tip="スクリプトによるプッシュを禁止します。 このオプションを選択することにより、あなたの土地での破壊的行動を防ぐことができます。"/>
 			<check_box label="検索に区画を表示(週 L$ 30)" name="ShowDirectoryCheck" tool_tip="この区画を検索結果に表示します"/>
@@ -376,9 +375,9 @@
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="写真をクリックして選択"/>
 			<text name="allow_label5">
-				他の区画にいる住人への許可:
+				この区画にいるアバターに会ってチャットできます
 			</text>
-			<check_box label="アバターを表示" name="SeeAvatarsCheck" tool_tip="他の区画の住人が、この区画にいる住人に会ってチャットすることを許可し、あなたもそれら住人に会ってチャットできるようにします。"/>
+			<check_box label="アバターを表示" name="SeeAvatarsCheck" tool_tip="他の区画のアバターが、この区画にいるアバターに会ってチャットすることを許可し、あなたもそれらアバターに会ってチャットできるようにします。"/>
 			<text name="landing_point">
 				着地点: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/ja/floater_avatar.xml b/indra/newview/skins/default/xui/ja/floater_avatar.xml
index c4455282d2b..d2895805065 100644
--- a/indra/newview/skins/default/xui/ja/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/ja/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="アバターピッカー"/>
+<floater name="Avatar" title="アバターを選択"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
index e447eefe0e7..a472f163e3f 100644
--- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨]
+		[http://www.secondlife.com/my/account/payment_method_management.php 支払方法] | [http://www.secondlife.com/my/account/currency.php 通貨]
 	</text>
 	<text name="exchange_rate_note">
 		金額を再入力して最新換算レートを確認します。
diff --git a/indra/newview/skins/default/xui/ja/floater_camera.xml b/indra/newview/skins/default/xui/ja/floater_camera.xml
index 0661e173091..982e5ce42bf 100644
--- a/indra/newview/skins/default/xui/ja/floater_camera.xml
+++ b/indra/newview/skins/default/xui/ja/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="表示">
+<floater name="camera_floater" title="カメラのコントロール">
 	<floater.string name="rotate_tooltip">
 		フォーカスを中心にカメラを回転
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml b/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml
index ffafbaf3b67..1b6558a9eb3 100644
--- a/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml
@@ -4,8 +4,8 @@
 		フィルタリング:
 	</text>
 	<check_box label="異方的フィルタリング(有効にすると速度が低下します)" name="ani"/>
-	<text name="Antialiasing:">
-		アンチエイリアシング:
+	<text name="antialiasing label">
+		アンチエイリアシング:
 	</text>
 	<combo_box label="アンチエイリアシング" name="fsaa">
 		<combo_box.item label="無効" name="FSAADisabled"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_model_preview.xml b/indra/newview/skins/default/xui/ja/floater_model_preview.xml
index 157c68a5705..c9ff0e29cbc 100644
--- a/indra/newview/skins/default/xui/ja/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/ja/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		エラー:Dae に問題が見つかりました - 詳細についてはログをご参照ください。
 	</string>
+	<string name="status_material_mismatch">
+		エラー:モデルの材料は参考モデルのサブセットではありません。
+	</string>
 	<string name="status_reading_file">
 		ローディング...
 	</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
index 915b37557f8..6aaa9a42a5d 100644
--- a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				アップロードするモデルファイルの選択
 			</text>
 			<button label="参照" label_selected="参照" name="browse"/>
+			<text name="Model types">
+				Second Life は COLLADA (.dae) ファイルをサポートします。
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/ja/floater_moveview.xml b/indra/newview/skins/default/xui/ja/floater_moveview.xml
index 88c1905b8a7..aed3b78a144 100644
--- a/indra/newview/skins/default/xui/ja/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/ja/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="移動">
+<floater name="move_floater" title="歩行 / 走行 / 飛行">
 	<string name="walk_forward_tooltip">
 		前に進む(上矢印か W を押す)
 	</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_snapshot.xml b/indra/newview/skins/default/xui/ja/floater_snapshot.xml
index 05a10f9f6d9..cf4732a68ef 100644
--- a/indra/newview/skins/default/xui/ja/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/ja/floater_snapshot.xml
@@ -3,73 +3,63 @@
 	<floater.string name="unknown">
 		不明
 	</floater.string>
-	<radio_group label="スナップショットの種類" name="snapshot_type_radio">
-		<radio_item label="メール" name="postcard"/>
-		<radio_item label="持ち物(L$[AMOUNT])" name="texture"/>
-		<radio_item label="コンピューターに保存" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		メールの送信
+	</string>
+	<string name="profile_progress_str">
+		投稿
+	</string>
+	<string name="inventory_progress_str">
+		持ち物に保存
+	</string>
+	<string name="local_progress_str">
+		コンピュータに保存
+	</string>
+	<string name="profile_succeeded_str">
+		画像がアップロードされました
+	</string>
+	<string name="postcard_succeeded_str">
+		メールが送信されました
+	</string>
+	<string name="inventory_succeeded_str">
+		持ち物に保存されました
+	</string>
+	<string name="local_succeeded_str">
+		コンピュータに保存されました
+	</string>
+	<string name="profile_failed_str">
+		プロフィールフィードに画像をアップロードできませんでした。
+	</string>
+	<string name="postcard_failed_str">
+		メールを送信できませんでした。
+	</string>
+	<string name="inventory_failed_str">
+		持ち物に保存できませんでした。
+	</string>
+	<string name="local_failed_str">
+		コンピュータに保存できませんでした。
+	</string>
+	<button name="advanced_options_btn" tool_tip="詳しい設定"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[SIZE] キロバイト
 	</text>
-	<button label="スナップショットを更新" name="new_snapshot_btn"/>
-	<button label="送信" name="send_btn"/>
-	<button label="保存(L$[AMOUNT])" name="upload_btn"/>
-	<flyout_button label="保存" name="save_btn" tool_tip="画像をファイルに保存">
-		<flyout_button.item label="保存" name="save_item"/>
-		<flyout_button.item label="別名で保存..." name="saveas_item"/>
-	</flyout_button>
-	<button label="詳細" name="more_btn" tool_tip="詳しい設定"/>
-	<button label="簡易" name="less_btn" tool_tip="詳しい設定"/>
-	<button label="取り消し" name="discard_btn"/>
-	<text name="type_label2">
-		サイズ
-	</text>
-	<text name="format_label">
-		書式
-	</text>
-	<combo_box label="解像度" name="postcard_size_combo">
-		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="カスタム" name="Custom"/>
-	</combo_box>
-	<combo_box label="解像度" name="texture_size_combo">
-		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
-		<combo_box.item label="小(128x128)" name="Small(128x128)"/>
-		<combo_box.item label="中(256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="大(512x512)" name="Large(512x512)"/>
-		<combo_box.item label="カスタム" name="Custom"/>
-	</combo_box>
-	<combo_box label="解像度" name="local_size_combo">
-		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="カスタム" name="Custom"/>
-	</combo_box>
-	<combo_box label="書式" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="å¹…" name="snapshot_width"/>
-	<spinner label="高さ" name="snapshot_height"/>
-	<check_box label="縦横比の固定" name="keep_aspect_check"/>
-	<slider label="画質" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		キャプチャ:
-	</text>
-	<combo_box label="画像レイヤー" name="layer_types">
-		<combo_box.item label="色" name="Colors"/>
-		<combo_box.item label="深度" name="Depth"/>
-	</combo_box>
-	<check_box label="インターフェース" name="ui_check"/>
-	<check_box label="HUD" name="hud_check"/>
-	<check_box label="保存後もこのまま" name="keep_open_check"/>
-	<check_box label="画面全体を静止" name="freeze_frame_check"/>
-	<check_box label="自動更新" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			詳しい設定
+		</text>
+		<text name="layer_type_label">
+			キャプチャ:
+		</text>
+		<combo_box label="画像レイヤー" name="layer_types">
+			<combo_box.item label="色" name="Colors"/>
+			<combo_box.item label="深度" name="Depth"/>
+		</combo_box>
+		<check_box label="インターフェース" name="ui_check"/>
+		<check_box label="HUD" name="hud_check"/>
+		<check_box label="画面全体を静止" name="freeze_frame_check"/>
+		<check_box label="自動更新" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_toybox.xml b/indra/newview/skins/default/xui/ja/floater_toybox.xml
index d7056f806c6..682352ec827 100644
--- a/indra/newview/skins/default/xui/ja/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/ja/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="ツールバーをカスタマイズ">
+<floater name="Toybox" title="ツールバーのボタン">
 	<text name="toybox label 1">
 		ボタンをツールバーに追加または削除するにはボタンをドラッグします。
 	</text>
 	<text name="toybox label 2">
 		各ツールバーの設定に応じて、ボタンは以下のように表示されたり、アイコンのみで表示されます。
 	</text>
+	<button label="ツールバーを全てクリア" label_selected="ツールバーを全てクリア" name="btn_clear_all"/>
 	<button label="デフォルト設定を復元" label_selected="デフォルト設定を復元" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_translation_settings.xml b/indra/newview/skins/default/xui/ja/floater_translation_settings.xml
new file mode 100644
index 00000000000..27143086ac4
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="チャットの翻訳設定">
+	<string name="bing_api_key_not_verified">
+		Bing appID を認証できませんでした。もう一度お試しください。
+	</string>
+	<string name="google_api_key_not_verified">
+		Google API キーを認証できませんでした。もう一度お試しください。
+	</string>
+	<string name="bing_api_key_verified">
+		Bing appID が認証されました。
+	</string>
+	<string name="google_api_key_verified">
+		Google API キーが認証されました。
+	</string>
+	<check_box label="チャット中の機械翻訳機能を有効にする" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		翻訳する言語:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="システム標準" name="System Default Language"/>
+		<combo_box.item label="英語" name="English"/>
+		<combo_box.item label="Dansk(デンマーク語)" name="Danish"/>
+		<combo_box.item label="Deutsch(ドイツ語)" name="German"/>
+		<combo_box.item label="Español(スペイン語)" name="Spanish"/>
+		<combo_box.item label="Français(フランス語)" name="French"/>
+		<combo_box.item label="Italiano(イタリア語)" name="Italian"/>
+		<combo_box.item label="Magyar(ハンガリー語)" name="Hungarian"/>
+		<combo_box.item label="Nederlands(オランダ語)" name="Dutch"/>
+		<combo_box.item label="Polski(ポーランド語)" name="Polish"/>
+		<combo_box.item label="Português(ポルトガル語)" name="Portugese"/>
+		<combo_box.item label="Русский(ロシア語)" name="Russian"/>
+		<combo_box.item label="Türkçe(トルコ語)" name="Turkish"/>
+		<combo_box.item label="Українська (ウクライナ語)" name="Ukrainian"/>
+		<combo_box.item label="中文 (正體) (中国語)" name="Chinese"/>
+		<combo_box.item label="日本語(日本語)" name="Japanese"/>
+		<combo_box.item label="한국어(韓国語)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		翻訳サービスを選択してください:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		Bing AppID [http://www.bing.com/developers/createapp.aspx AppID]:
+	</text>
+	<button label="認証" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		Google API key [http://code.google.com/apis/language/translate/v2/getting_started.html#auth API key]:
+	</text>
+	<button label="認証" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html 価格] | [https://code.google.com/apis/console 統計]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="取り消し" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_voice_controls.xml b/indra/newview/skins/default/xui/ja/floater_voice_controls.xml
index f12648f208c..f7d3fd11e09 100644
--- a/indra/newview/skins/default/xui/ja/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/ja/floater_voice_controls.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="ボイスコントロール">
 	<string name="title_nearby">
-		近くのボイス
+		ボイス設定
 	</string>
 	<string name="title_group">
 		[GROUP] とグループコール
@@ -10,7 +10,7 @@
 		コンファレンスコール
 	</string>
 	<string name="title_peer_2_peer">
-		[NAME] でコール
+		[NAME] とコール
 	</string>
 	<string name="no_one_near">
 		近くにボイスを有効にしている人はいません。
diff --git a/indra/newview/skins/default/xui/ja/menu_toolbars.xml b/indra/newview/skins/default/xui/ja/menu_toolbars.xml
index e911ca4a134..d5363a5131d 100644
--- a/indra/newview/skins/default/xui/ja/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/ja/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="ボタンを選択..." name="Chose Buttons"/>
+	<menu_item_call label="このボタンを削除" name="Remove button"/>
+	<menu_item_call label="ツールバーのボタン..." name="Choose Buttons"/>
 	<menu_item_check label="アイコンとラベル" name="icons_with_text"/>
 	<menu_item_check label="アイコンのみ" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 125e9bb2267..ef3261f1d43 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="ミー" name="Me">
-		<menu_item_call label="マイアカウント..." name="Manage My Account">
-			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=ja"/>
-		</menu_item_call>
 		<menu_item_call label="プロフィール..." name="Profile"/>
 		<menu_item_call label="容姿..." name="ChangeOutfit"/>
+		<menu_item_call label="アバターを選択..." name="Avatar Picker"/>
 		<menu_item_check label="持ち物..." name="Inventory"/>
-		<menu_item_check label="ジェスチャー..." name="Gestures"/>
-		<menu_item_check label="ボイス..." name="ShowVoice"/>
+		<menu_item_call label="新しい持ち物ウィンドウ" name="NewInventoryWindow"/>
+		<menu_item_call label="場所..." name="Places"/>
+		<menu_item_call label="ピック..." name="Picks"/>
+		<menu_item_call label="カメラコントロール..." name="Camera Controls"/>
 		<menu label="ムーブメント" name="Movement">
 			<menu_item_call label="座る" name="Sit Down Here"/>
 			<menu_item_check label="飛ぶ" name="Fly"/>
@@ -22,34 +22,39 @@
 		<menu_item_call label="管理者権限のリクエスト" name="Request Admin Options"/>
 		<menu_item_call label="管理者ステータス解除" name="Leave Admin Options"/>
 		<menu_item_call label="L$ の購入" name="Buy and Sell L$"/>
+		<menu_item_call label="マイアカウント..." name="Manage My Account">
+			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=ja"/>
+		</menu_item_call>
 		<menu_item_call label="環境設定..." name="Preferences"/>
-		<menu_item_call label="ツールバー..." name="Toolbars"/>
+		<menu_item_call label="ツールバーのボタン..." name="Toolbars"/>
 		<menu_item_call label="全てのコントロールを非表示にする" name="Hide UI"/>
 		<menu_item_call label="[APP_NAME] を終了" name="Quit"/>
 	</menu>
 	<menu label="コミュニケーション" name="Communicate">
+		<menu_item_check label="チャット..." name="Nearby Chat"/>
+		<menu_item_check label="話す" name="Speak"/>
+		<menu_item_check label="ボイス設定..." name="Nearby Voice"/>
+		<menu_item_check label="ボイスモーフィング..." name="ShowVoice"/>
+		<menu_item_check label="ジェスチャー..." name="Gestures"/>
 		<menu_item_call label="フレンド" name="My Friends"/>
-		<menu_item_call label="所属グループ" name="My Groups"/>
-		<menu_item_check label="近くのチャット" name="Nearby Chat"/>
+		<menu_item_call label="グループ" name="My Groups"/>
 		<menu_item_call label="近くにいる人" name="Active Speakers"/>
-		<menu_item_check label="近くのボイス" name="Nearby Voice"/>
 	</menu>
 	<menu label="世界" name="World">
-		<menu_item_check label="ミニマップ" name="Mini-Map"/>
+		<menu_item_call label="現在地をランドマーク" name="Create Landmark Here"/>
+		<menu_item_call label="行き先..." name="Destinations"/>
 		<menu_item_check label="世界地図" name="World Map"/>
+		<menu_item_check label="ミニマップ" name="Mini-Map"/>
 		<menu_item_check label="検索" name="Search"/>
+		<menu_item_call label="ホームにテレポート" name="Teleport Home"/>
+		<menu_item_call label="現在地をホームに設定" name="Set Home to Here"/>
 		<menu_item_call label="スナップショット" name="Take Snapshot"/>
-		<menu_item_call label="現在地をランドマーク" name="Create Landmark Here"/>
-		<menu label="場所のプロフィール" name="Land">
-			<menu_item_call label="場所のプロフィール" name="Place Profile"/>
-			<menu_item_call label="土地情報" name="About Land"/>
-			<menu_item_call label="地域 / 不動産" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="場所のプロフィール" name="Place Profile"/>
+		<menu_item_call label="土地情報" name="About Land"/>
+		<menu_item_call label="地域 / 不動産" name="Region/Estate"/>
+		<menu_item_call label="保有地..." name="My Land"/>
 		<menu_item_call label="この土地を購入" name="Buy Land"/>
-		<menu_item_call label="自分の土地" name="My Land"/>
 		<menu label="表示" name="LandShow">
-			<menu_item_check label="移動コントロール" name="Movement Controls"/>
-			<menu_item_check label="カメラコントロール" name="Camera Controls"/>
 			<menu_item_check label="立入禁止ライン" name="Ban Lines"/>
 			<menu_item_check label="ビーコン(標識)" name="beacons"/>
 			<menu_item_check label="プロパティ境界線" name="Property Lines"/>
@@ -58,16 +63,15 @@
 			<menu_item_check label="区画プロパティ" name="Parcel Properties"/>
 			<menu_item_check label="アドバンスメニュー" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="ホームにテレポート" name="Teleport Home"/>
-		<menu_item_call label="現在地をホームに設定" name="Set Home to Here"/>
 		<menu label="太陽" name="Environment Settings">
 			<menu_item_call label="日の出" name="Sunrise"/>
 			<menu_item_call label="正午" name="Noon"/>
 			<menu_item_call label="日没" name="Sunset"/>
 			<menu_item_call label="深夜" name="Midnight"/>
+			<menu_item_call label="リージョンの設定を使用" name="Use Region Settings"/>
 		</menu>
-		<menu label="自然環境エディター" name="Enviroment Editor">
-			<menu_item_call label="環境の設定..." name="Enviroment Settings"/>
+		<menu label="自然環境エディター" name="Environment Editor">
+			<menu_item_call label="自然環境の設定..." name="Environment Settings"/>
 			<menu label="水の事前設定" name="Water Presets">
 				<menu_item_call label="新しい事前設定..." name="new_water_preset"/>
 				<menu_item_call label="事前設定を編集..." name="edit_water_preset"/>
@@ -146,6 +150,7 @@
 		<menu_item_call label="やり直し" name="Redo"/>
 	</menu>
 	<menu label="ヘルプ" name="Help">
+		<menu_item_call label="ハウツー..." name="How To"/>
 		<menu_item_call label="[SECOND_LIFE] ヘルプ" name="Second Life Help"/>
 		<menu_item_call label="嫌がらせを報告する" name="Report Abuse"/>
 		<menu_item_call label="バグを報告する" name="Report Bug"/>
@@ -200,11 +205,10 @@
 		<menu_item_check label="Use Plugin Read Thread" name="Use Plugin Read Thread"/>
 		<menu_item_call label="グループキャッシュのクリア" name="ClearGroupCache"/>
 		<menu_item_check label="マウスの平滑化" name="Mouse Smoothing"/>
+		<menu_item_call label="リリースキー" name="Release Keys"/>
 		<menu label="ショートカット" name="Shortcuts">
 			<menu_item_call label="画像 (L$ [COST] )..." name="Upload Image"/>
 			<menu_item_check label="検索" name="Search"/>
-			<menu_item_call label="キーをリリース" name="Release Keys"/>
-			<menu_item_call label="UI のサイズをデフォルトに設定する" name="Set UI Size to Default"/>
 			<menu_item_check label="アドバンスメニューを表示 - レガシーのショートカット" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="ウィンドウを閉じる" name="Close Window"/>
 			<menu_item_call label="全てのウィンドウを閉じる" name="Close All Windows"/>
@@ -290,6 +294,7 @@
 			<menu_item_check label="å…‰" name="Lights"/>
 			<menu_item_check label="骨組みの衝突判定" name="Collision Skeleton"/>
 			<menu_item_check label="レイキャスト" name="Raycast"/>
+			<menu_item_check label="風のベクトル" name="Wind Vectors"/>
 			<menu_item_check label="描画の詳細度" name="rendercomplexity"/>
 			<menu_item_check label="スカルプト" name="Sculpt"/>
 		</menu>
@@ -302,7 +307,6 @@
 			<menu_item_check label="光と影" name="Lighting and Shadows"/>
 			<menu_item_check label="太陽・月・プロジェクタからの影" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO と影の平滑化" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="グローバルイルミネーション(試験段階)" name="Global Illumination"/>
 			<menu_item_check label="GL デバッグ" name="Debug GL"/>
 			<menu_item_check label="経路をデバッグ" name="Debug Pipeline"/>
 			<menu_item_check label="自動アルファマスク(遅延)" name="Automatic Alpha Masks (deferred)"/>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 141f2c8071a..20468c8c2af 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1144,8 +1144,13 @@ L$ は返金されません。
 		-safe オプションを指定したので、
 表示設定はセーフレベルに設定されています。
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		表示設定は、あなたのシステム構成に基づいて推奨されたレベルに設定されています。
+	<notification name="DisplaySetToRecommendedGPUChange">
+		グラフィックの変更により、画面設定は推奨レベルに設定されました。
+&apos;[LAST_GPU]&apos; から
+&apos;[THIS_GPU]&apos; まで
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		レンダリングサブシステムの変更により、画面設定は推奨レベルに設定されました。
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1954,7 +1959,13 @@ Adult 専用リージョンに入るには、住人のアカウントが年齢
 		<usetemplate ignoretext="終了時の確認" name="okcancelignore" notext="終了しない" yestext="終了"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		デフォルトのボタンとツールバーを復元しますか? 
+		この操作を実行すると、デフォルト設定のボタンとツールバーが復元されます。
+
+この操作は元に戻せません。
+		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		この操作により、全てのボタンはツールボックスに戻り、ツールバーは空になります。
     
 この操作は元に戻せません。
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
@@ -2167,10 +2178,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		件名: [SUBJECT]、メッセージ: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオンライン中です
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオンラインです
 	</notification>
 	<notification name="FriendOffline">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオフライン中です
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はオフラインです
 	</notification>
 	<notification name="AddSelfFriend">
 		残念ながら自分自身をフレンド登録することはできません。
@@ -2284,13 +2295,15 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		コーリングカードが拒否されました。
 	</notification>
 	<notification name="TeleportToLandmark">
-		画面右の「場所」パネルを開いて、「ランドマーク」タブを選ぶと、[NAME] といった場所にテレポートできます。 
-好きなランドマークをクリックして選び、次にパネル下の「テレポート」をクリックします。
-(ランドマークをダブルクリック、または右クリックして「テレポート」を選んでも同じです。)
+		[NAME] などの場所にテレポートするには、「場所」ボタンをクリックしてから、
+表示されたウィンドウで「ランドマーク」タブを選択します。ランドマークを
+いずれか 1 つ選択してから、ウィンドウ下部にある「テレポート」をクリックします。
+(この操作は、ランドマークをダブルクリックするか、右クリックして
+「テレポート」を選択して実行することもできます。)
 	</notification>
 	<notification name="TeleportToPerson">
-		画面右の「人」パネルを開いて、[NAME] といった住人に連絡を取ることができます。
-リストから住人を選択して、パネル下の「IM」をクリックします。
+		[NAME] のような住人に連絡をとるには、「人」ボタンをクリックし、表示されるウィンドウで「住人」を選択してから、
+ウィンドウ下部にある「IM」をクリックします。
 (リストの名前をダブルクリック、または右クリックして「IM」を選んでも同じです。)
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
@@ -2312,6 +2325,9 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		イベント通知:
 
@@ -2567,10 +2583,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt;は、フレンド登録を受け入れました。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はあなたからの友人登録リクエストを受諾しました。
 	</notification>
 	<notification name="FriendshipDeclined">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt;は、フレンド登録を断りました。
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; はあなたからの友人登録リクエストを拒否しました。
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		フレンドの登録依頼が承認されました。
diff --git a/indra/newview/skins/default/xui/ja/panel_edit_skin.xml b/indra/newview/skins/default/xui/ja/panel_edit_skin.xml
index 2c554dad94d..7573132576b 100644
--- a/indra/newview/skins/default/xui/ja/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/ja/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="頭部のタトゥー" name="Head Tattoos" tool_tip="クリックして写真を選択"/>
-		<texture_picker label="上部のタトゥー" name="Upper Tattoos" tool_tip="クリックして写真を選択"/>
-		<texture_picker label="下部のタトゥー" name="Lower Tattoos" tool_tip="クリックして写真を選択"/>
+		<texture_picker label="頭" name="Head" tool_tip="クリックして写真を選択します"/>
+		<texture_picker label="上半身" name="Upper Body" tool_tip="クリックして写真を選択します"/>
+		<texture_picker label="下半身" name="Lower Body" tool_tip="クリックして写真を選択します"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/ja/panel_postcard_message.xml b/indra/newview/skins/default/xui/ja/panel_postcard_message.xml
new file mode 100644
index 00000000000..b7c3f48557e
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		終:
+	</text>
+	<text name="name_label">
+		始:
+	</text>
+	<text name="subject_label">
+		件名:
+	</text>
+	<line_editor label="件名をここに入力してください。" name="subject_form"/>
+	<text name="msg_label">
+		メッセージ:
+	</text>
+	<text_editor name="msg_form">
+		メッセージをここに入力してください。
+	</text_editor>
+	<button label="取り消し" name="cancel_btn"/>
+	<button label="送信" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_postcard_settings.xml b/indra/newview/skins/default/xui/ja/panel_postcard_settings.xml
new file mode 100644
index 00000000000..314aaef7fd6
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="解像度" name="postcard_size_combo">
+		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="カスタム" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="å¹…" name="postcard_snapshot_width"/>
+			<spinner label="高さ" name="postcard_snapshot_height"/>
+			<check_box label="縦横比の固定" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="画質" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml
index 1502442a06a..75bf28a3c8b 100644
--- a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml
@@ -29,30 +29,5 @@
 	<check_box label="IM チャット" name="EnableIMChatPopups" tool_tip="これを選択すると、インスタントメッセージを受信した際にポップアップが表示されます"/>
 	<spinner label="近くのチャットメッセージが表示される長さ:" name="nearby_toasts_lifetime"/>
 	<spinner label="近くのチャットメッセージが消えるまでの長さ:" name="nearby_toasts_fadingtime"/>
-	<check_box label="Use machine translation while chatting" name="translate_chat_checkbox"/>
-	<text name="translate_chb_label">
-		チャット中に内容を機械翻訳する
-	</text>
-	<text name="translate_language_text">
-		翻訳する言語:
-	</text>
-	<combo_box name="translate_language_combobox">
-		<combo_box.item label="システム標準" name="System Default Language"/>
-		<combo_box.item label="English(英語)" name="English"/>
-		<combo_box.item label="Dansk(デンマーク語)" name="Danish"/>
-		<combo_box.item label="Deutsch(ドイツ語)" name="German"/>
-		<combo_box.item label="Español(スペイン語)" name="Spanish"/>
-		<combo_box.item label="Français(フランス語)" name="French"/>
-		<combo_box.item label="Italiano(イタリア語)" name="Italian"/>
-		<combo_box.item label="Magyar(ハンガリー語)" name="Hungarian"/>
-		<combo_box.item label="Nederlands(オランダ語)" name="Dutch"/>
-		<combo_box.item label="Polski(ポーランド語)" name="Polish"/>
-		<combo_box.item label="Português(ポルトガル語)" name="Portugese"/>
-		<combo_box.item label="Русский(ロシア語)" name="Russian"/>
-		<combo_box.item label="Türkçe(トルコ語)" name="Turkish"/>
-		<combo_box.item label="Українська(ウクライナ語)" name="Ukrainian"/>
-		<combo_box.item label="中文 (正體) (Chinese)" name="Chinese"/>
-		<combo_box.item label="日本語" name="Japanese"/>
-		<combo_box.item label="한국어(韓国語)" name="Korean"/>
-	</combo_box>
+	<button label="チャットの翻訳設定" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
index 1bafa52fbe1..91e1514e496 100644
--- a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
@@ -16,7 +16,7 @@
 		<combo_box.item label="Русский (ロシア語) - ベータ" name="Russian"/>
 		<combo_box.item label="Türkçe (トルコ語) - ベータ" name="Turkish"/>
 		<combo_box.item label="日本語 – ベータ" name="(Japanese)"/>
-		<combo_box.item label="正體中文 (中国語 - 繁体字) - ベータ" name="Traditional Chinese"/>
+		<combo_box.item label="正體中文(簡体字中国語)- ベータ版" name="Traditional Chinese"/>
 	</combo_box>
 	<text name="language_textbox2">
 		(再起動後に反映)
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
index 7877c0495ff..d90a1632ab6 100644
--- a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="指定のブラウザ(IE や Firefox)を使用" name="external" tool_tip="デフォルトのシステム Web ブラウザでヘルプや Web リンク先などを見ます。全画面で起動中にはおすすめしません。" value="1"/>
+		<radio_item label="指定のブラウザ(IE や Firefox)を使用" name="external" tool_tip="デフォルトのシステム Web ブラウザでヘルプや Web リンク先などを見ます。全画面で起動中にはおすすめしません。" value="true"/>
 		<radio_item label="内蔵ブラウザを使用" name="internal" tool_tip="内蔵ブラウザでヘルプや Web リンクなどを見ます。[APP_NAME] 内に新しいウィンドウでこのブラウザが開きます。" value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="プラグインを有効にする" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..46f2b0a3f99
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		「持ち物」に保存
+	</text>
+	<text name="hint_lbl">
+		画像を持ち物に保存するには L$[UPLOAD_COST] の費用がかかります。画像をテクスチャとして保存するには平方形式の 1 つを選択してください。
+	</text>
+	<combo_box label="解像度" name="texture_size_combo">
+		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
+		<combo_box.item label="小(128x128)" name="Small(128x128)"/>
+		<combo_box.item label="中(256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="大(512x512)" name="Large(512x512)"/>
+		<combo_box.item label="カスタム" name="Custom"/>
+	</combo_box>
+	<spinner label="å¹…" name="inventory_snapshot_width"/>
+	<spinner label="高さ" name="inventory_snapshot_height"/>
+	<check_box label="縦横比の固定" name="inventory_keep_aspect_check"/>
+	<button label="取り消し" name="cancel_btn"/>
+	<button label="保存" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_local.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_local.xml
new file mode 100644
index 00000000000..cb658fb6c9a
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		コンピューターに保存
+	</text>
+	<combo_box label="解像度" name="local_size_combo">
+		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="カスタム" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="å¹…" name="local_snapshot_width"/>
+			<spinner label="高さ" name="local_snapshot_height"/>
+			<check_box label="縦横比の固定" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="書式" name="local_format_combo">
+				<combo_box.item label="PNG(可逆圧縮)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP(可逆圧縮)" name="BMP"/>
+			</combo_box>
+			<slider label="画質" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="取り消し" name="cancel_btn"/>
+	<flyout_button label="保存" name="save_btn" tool_tip="画像をファイルに保存">
+		<flyout_button.item label="保存" name="save_item"/>
+		<flyout_button.item label="別名で保存..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
new file mode 100644
index 00000000000..cd5b7590ad8
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="プロフィールフィードに投稿する" name="save_to_profile_btn"/>
+	<button label="メール" name="save_to_email_btn"/>
+	<button label="持ち物に保存(L$[Amount])" name="save_to_inventory_btn"/>
+	<button label="コンピューターに保存" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..1ddd7238400
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		[SECOND_LIFE] からのポストカードです。
+	</string>
+	<string name="default_message">
+		ぜひご覧ください!
+	</string>
+	<string name="upload_message">
+		送信中...
+	</string>
+	<text name="title">
+		メール
+	</text>
+	<button label="メッセージ" name="message_btn"/>
+	<button label="設定" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..b860a6afe91
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		プロフィールフィードに投稿する
+	</text>
+	<combo_box label="解像度" name="profile_size_combo">
+		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="カスタム" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="å¹…" name="profile_snapshot_width"/>
+			<spinner label="高さ" name="profile_snapshot_height"/>
+			<check_box label="縦横比の固定" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				キャプション:
+			</text>
+			<check_box initial_value="true" label="場所を含む" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="取り消し" name="cancel_btn"/>
+	<button label="投稿" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index f611b965020..c6b033ed950 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -1214,7 +1214,7 @@ support@secondlife.com にお問い合わせください。
 		「持ち物」内にこのテクスチャのコピーがありません
 	</string>
 	<string name="InventoryInboxNoItems">
-		マーケットプレイスで購入した商品はここに配達されます。
+		購入するなどして取得したアイテムや商品はここに表示され、持ち物のフォルダにドラッグして移動することもできれば、要らなくなった場合には削除することができます。
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1412,6 +1412,9 @@ support@secondlife.com にお問い合わせください。
 	<string name="no_attachments">
 		着用しているアタッチメントはありません
 	</string>
+	<string name="Attachments remain">
+		アタッチメント(残りのスロット数:[COUNT])
+	</string>
 	<string name="Buy">
 		買う
 	</string>
@@ -1538,6 +1541,12 @@ support@secondlife.com にお問い合わせください。
 	<string name="Right Pec">
 		右胸筋
 	</string>
+	<string name="Neck">
+		首
+	</string>
+	<string name="Avatar Center">
+		アバターの中央
+	</string>
 	<string name="Invalid Attachment">
 		装着先が正しくありません
 	</string>
@@ -4030,6 +4039,18 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="you_paid_ldollars_no_name">
 		L$ [AMOUNT] を支払いました:[REASON]
 	</string>
+	<string name="you_paid_failure_ldollars">
+		[NAME] に [REASON] の代金 L$ [AMOUNT] を支払えませんでした。
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		L$ [AMOUNT] を支払えませんでした。
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		[NAME] に L$ [AMOUNT] を支払えませんでした。
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		[REASON] の 代金 L$ [AMOUNT] を支払えませんでした。
+	</string>
 	<string name="for item">
 		[ITEM] 向け
 	</string>
@@ -4440,6 +4461,12 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="ExternalEditorFailedToRun">
 		外部エディターを実行できませんでした。
 	</string>
+	<string name="TranslationFailed">
+		翻訳できませんでした:[REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		翻訳の応答にエラーが発生しました。
+	</string>
 	<string name="Esc">
 		Esc
 	</string>
@@ -4810,7 +4837,7 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 		ミニマップ
 	</string>
 	<string name="Command_Move_Label">
-		移動
+		歩行 / 走行 / 飛行
 	</string>
 	<string name="Command_People_Label">
 		人
@@ -4837,10 +4864,10 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 		話す
 	</string>
 	<string name="Command_View_Label">
-		視界
+		カメラコントロール
 	</string>
 	<string name="Command_Voice_Label">
-		近くのボイス
+		ボイス設定
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		訪問先に関する情報
@@ -4912,7 +4939,16 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 		カメラの角度を変更
 	</string>
 	<string name="Command_Voice_Tooltip">
-		ボイスチャット機能を持つ近くの人
+		インワールドでのコールや近くにいる人の音量調整
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		現在、下のツールバーにあります
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		現在、左のツールバーにあります
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		現在、右のツールバーにあります
 	</string>
 	<string name="Retain%">
 		維持率
@@ -4938,4 +4974,19 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="Normal">
 		普通
 	</string>
+	<string name="snapshot_quality_very_low">
+		非常に低い
+	</string>
+	<string name="snapshot_quality_low">
+		低
+	</string>
+	<string name="snapshot_quality_medium">
+		中
+	</string>
+	<string name="snapshot_quality_high">
+		高
+	</string>
+	<string name="snapshot_quality_very_high">
+		非常に高い
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/ja/teleport_strings.xml b/indra/newview/skins/default/xui/ja/teleport_strings.xml
index 04ea1c24385..6c69c7a2313 100644
--- a/indra/newview/skins/default/xui/ja/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/ja/teleport_strings.xml
@@ -21,8 +21,8 @@
 もう少し後でやり直してください。
 		</message>
 		<message name="NoHelpIslandTP">
-		Welcome Islandには戻ることができません。
-「Welcome Island Public」に行き、
+			ウェルカムアイランドにテレポートで戻ることはできません。
+「Welcome Island Public」に行き再度チュートリアルを行ってください。
 		</message>
 		<message name="noaccess_tport">
 			残念ながら、そのテレポート目的地へのアクセスがありません。
diff --git a/indra/newview/skins/default/xui/pt/floater_about.xml b/indra/newview/skins/default/xui/pt/floater_about.xml
index c374264c4ad..e843e56090b 100644
--- a/indra/newview/skins/default/xui/pt/floater_about.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about.xml
@@ -65,13 +65,35 @@ Versão do servidor de voz: [VOICE_VERSION]
 		</panel>
 		<panel label="Licenças" name="licenses_panel">
 			<text_editor name="credits_editor">
-				3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion APR Copyright (C) 2000-2004 The Apache Software Foundation Collada DOM Copyright 2005 Sony Computer Entertainment Inc. cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). GL Copyright (C) 1999-2004 Brian Paul. GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. google-perftools Copyright (c) 2005, Google Inc. Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) jpeglib Copyright (C) 1991-1998, Thomas G. Lane. ogg/vorbis Copyright (C) 2001, Xiphophorus OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. PCRE Copyright (c) 1997-2008 University of Cambridge SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) xmlrpc-epi Copyright (C) 2000 Epinions, Inc. zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. google-perftools Copyright (c) 2005, Google Inc.
+				3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion
+        APR Copyright (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Copyright 2005 Sony Computer Entertainment Inc.
+        cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Copyright (C) 2002, 2003  CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc.
+        expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Copyright (C) 1999-2004 Brian Paul.
+        GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University e David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Copyright (c) 2005, Google Inc.
+        Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Copyright (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Copyright (C) 2001, Xiphophorus
+        OpenSSL Copyright (C) 1998-2002 The OpenSSL Project.
+        PCRE Copyright (c) 1997-2008 University of Cambridge
+        SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+        zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
+        google-perftools Copyright (c) 2005, Google Inc.
 
-O Second Life Viewer usa Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (e licenciadores). Todos os direitos reservados. Mais detalhes em www.havok.com
+        O Visualizador do Second Life usa Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (e seus Licenciantes). Todos os direitos reservados. Consulte www.havok.com para obter detalhes.
 
-Todos os direitos reservados.  Mais detalhes em licenses.txt.
+        Este software contém código fonte fornecido pela NVIDIA Corporation.
 
-Codificação do áudio de bate-papo de voz: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+        Todos os direitos reservados.  Consulte licenses.txt para obter detalhes.
+
+        Codificação de áudio da conversa com voz: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/pt/floater_about_land.xml b/indra/newview/skins/default/xui/pt/floater_about_land.xml
index cc098889942..30d4b0290c0 100644
--- a/indra/newview/skins/default/xui/pt/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about_land.xml
@@ -130,7 +130,7 @@ Vá para o menu Mundo &gt; Sobre o terreno ou selecione outro lote para mostrar
 				Tráfego:
 			</text>
 			<text name="DwellText">
-				0
+				Carregando...
 			</text>
 			<button label="Comprar terreno..." label_selected="Comprar terreno..." left="130" name="Buy Land..." width="125"/>
 			<button label="Venda Linden" name="Linden Sale..." tool_tip="O terreno precisa ser possuído, estar com o conteúdo configurado e não estar pronto para leilão."/>
@@ -309,13 +309,15 @@ Apenas lotes maiores podem ser listados na busca.
 				Proibido empurrar (regulamento da região)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Veja e bata papo com os residentes deste terreno
+				Avatares em outros lotes podem ver
 			</panel.string>
 			<text name="allow_label">
 				Autorizar outros residentes a:
 			</text>
-			<check_box label="Editar terreno" name="edit land check" tool_tip="Se ativado, qualquer um pode modificar o terreno. É melhor deixar esta opção desativada, uma vez que você sempre pode editar seu próprio terreno."/>
-			<check_box label="Voar" name="check fly" tool_tip="Se ativado,  residentes podem voar sobre seu terreno. Se desativado, eles podem voar apenas até chegar ou sobrevoar o seu terreno."/>
+			<text name="allow_label0">
+				Voar:
+			</text>
+			<check_box label="Todos" name="check fly" tool_tip="Se ativado,  residentes podem voar sobre seu terreno. Se desativado, eles podem voar apenas até chegar ou sobrevoar o seu terreno."/>
 			<text name="allow_label2">
 				Criar objetos:
 			</text>
@@ -331,9 +333,6 @@ Apenas lotes maiores podem ser listados na busca.
 			</text>
 			<check_box label="Residentes" name="check other scripts"/>
 			<check_box label="Grupo" name="check group scripts"/>
-			<text name="land_options_label">
-				Opções do terreno:
-			</text>
 			<check_box label="Seguro (sem danos)" name="check safe" tool_tip="Se ativado, ajusta o terreno para Seguro, impedindo lutas com danos. Se não ativado, lutas com danos é habilitado."/>
 			<check_box label="Proibido empurrar" name="PushRestrictCheck" tool_tip="Evita scripts que empurram. Ativar essa opção ajuda a prevenir comportamentos desordeiros no seu terreno."/>
 			<check_box label="Mostrar terreno nos resultados de busca (L$30/semana)" name="ShowDirectoryCheck" tool_tip="Permitir que as pessoas vejam este terreno nos resultados de busca"/>
@@ -374,9 +373,9 @@ Apenas lotes maiores podem ser listados na busca.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Clique para escolher uma imagem"/>
 			<text name="allow_label5">
-				Permitir que residentes de outros terrenos:
+				e bater papo com avatares neste lote
 			</text>
-			<check_box label="Ver avatares" name="SeeAvatarsCheck" tool_tip="Permite que residentes de outros terrenos vejam e conversem com os residentes deste terreno e vice-versa."/>
+			<check_box label="Ver avatares" name="SeeAvatarsCheck" tool_tip="Permite que os avatares em outros lotes vejam e batam papo com avatares neste lote. Você poderá vê-los e conversar com eles."/>
 			<text name="landing_point">
 				Ponto de Aterrissagem: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_avatar.xml b/indra/newview/skins/default/xui/pt/floater_avatar.xml
index f51b7651054..168cdacae1e 100644
--- a/indra/newview/skins/default/xui/pt/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/pt/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="SELETOR DE AVATAR"/>
+<floater name="Avatar" title="ESCOLHA UM AVATAR"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
index b5ba477fe53..2845a29e1da 100644
--- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
+		[http://www.secondlife.com/my/account/payment_method_management.php método de pagamento] | [http://www.secondlife.com/my/account/currency.php moeda]
 	</text>
 	<text name="exchange_rate_note">
 		Digite o valor novamente para ver o câmbio atual.
diff --git a/indra/newview/skins/default/xui/pt/floater_camera.xml b/indra/newview/skins/default/xui/pt/floater_camera.xml
index 6b66d017816..9cda01c187d 100644
--- a/indra/newview/skins/default/xui/pt/floater_camera.xml
+++ b/indra/newview/skins/default/xui/pt/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="EXIBIR">
+<floater name="camera_floater" title="CONTROLES DA CÂMERA">
 	<floater.string name="rotate_tooltip">
 		Girar a Câmera ao redor do Foco
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml b/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml
index 8c95a3b5482..1bc2bce7685 100644
--- a/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml
@@ -4,7 +4,7 @@
 		Filtragem:
 	</text>
 	<check_box label="Filtragem Anisotrópica (mais lento quando habilitada)" name="ani"/>
-	<text name="Antialiasing:">
+	<text name="antialiasing label">
 		Suavização:
 	</text>
 	<combo_box label="Suavização" name="fsaa" width="94">
diff --git a/indra/newview/skins/default/xui/pt/floater_model_preview.xml b/indra/newview/skins/default/xui/pt/floater_model_preview.xml
index 17abe72173d..89605008313 100644
--- a/indra/newview/skins/default/xui/pt/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/pt/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Erro: Problema ao analisar .dae - consulte log para obter detalhes.
 	</string>
+	<string name="status_material_mismatch">
+		Erro: o material do modelo não é um subconjunto do modelo de referência.
+	</string>
 	<string name="status_reading_file">
 		Carregando...
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_model_wizard.xml b/indra/newview/skins/default/xui/pt/floater_model_wizard.xml
index d9195adbf9e..498058f9337 100644
--- a/indra/newview/skins/default/xui/pt/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/pt/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Escolha o arquivo de modelo para upload
 			</text>
 			<button label="Procurar..." label_selected="Procurar..." name="browse"/>
+			<text name="Model types">
+				O Second Life oferece suporte a arquivos COLLADA (.dae)
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_moveview.xml b/indra/newview/skins/default/xui/pt/floater_moveview.xml
index 0cb6f9a98e5..728357a400f 100644
--- a/indra/newview/skins/default/xui/pt/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/pt/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="MOVER">
+<floater name="move_floater" title="ANDAR/CORRER/VOAR">
 	<string name="walk_forward_tooltip">
 		Andar para frente (flecha para cima ou W)
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_snapshot.xml b/indra/newview/skins/default/xui/pt/floater_snapshot.xml
index d62fe3dd20a..4110e690686 100644
--- a/indra/newview/skins/default/xui/pt/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/pt/floater_snapshot.xml
@@ -3,73 +3,63 @@
 	<floater.string name="unknown">
 		desconhecido
 	</floater.string>
-	<radio_group label="Tipo de foto" name="snapshot_type_radio">
-		<radio_item label="Email" name="postcard"/>
-		<radio_item label="Meu inventário (L$[AMOUNT])" name="texture"/>
-		<radio_item label="Salvar no meu PC" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		Enviando e-mail
+	</string>
+	<string name="profile_progress_str">
+		Postando
+	</string>
+	<string name="inventory_progress_str">
+		Salvando no inventário
+	</string>
+	<string name="local_progress_str">
+		Salvo no computador
+	</string>
+	<string name="profile_succeeded_str">
+		Imagem carregada
+	</string>
+	<string name="postcard_succeeded_str">
+		E-mail enviado!
+	</string>
+	<string name="inventory_succeeded_str">
+		Salvo no inventário!
+	</string>
+	<string name="local_succeeded_str">
+		Salvo no computador!
+	</string>
+	<string name="profile_failed_str">
+		Falha ao carregar a imagem no feed do seu perfil.
+	</string>
+	<string name="postcard_failed_str">
+		Falha ao enviar e-mail.
+	</string>
+	<string name="inventory_failed_str">
+		Falha ao salvar no inventário.
+	</string>
+	<string name="local_failed_str">
+		Falha ao salvar no computador.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Opções avançadas"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[TAMANHO] KB
 	</text>
-	<button label="Atualizar a foto" name="new_snapshot_btn"/>
-	<button label="Enviar" name="send_btn"/>
-	<button label="Economize (L$[AMOUNT])" name="upload_btn"/>
-	<flyout_button label="Salvar" name="save_btn" tool_tip="Salvar imagem em um arquivo">
-		<flyout_button.item label="Salvar" name="save_item"/>
-		<flyout_button.item label="Salvar como..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Mais" name="more_btn" tool_tip="Opções avançadas"/>
-	<button label="Menos" name="less_btn" tool_tip="Opções avançadas"/>
-	<button label="Cancelar" name="discard_btn"/>
-	<text name="type_label2">
-		Tamanho
-	</text>
-	<text name="format_label">
-		Formato
-	</text>
-	<combo_box label="Resolução" name="postcard_size_combo">
-		<combo_box.item label="Janela atual" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="Customizado" name="Custom"/>
-	</combo_box>
-	<combo_box label="Resolução" name="texture_size_combo">
-		<combo_box.item label="Janela atual" name="CurrentWindow"/>
-		<combo_box.item label="Pequeno (128x128)" name="Small(128x128)"/>
-		<combo_box.item label="Médio (256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
-		<combo_box.item label="Customizado" name="Custom"/>
-	</combo_box>
-	<combo_box label="Resolução" name="local_size_combo">
-		<combo_box.item label="Janela atual" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="Customizado" name="Custom"/>
-	</combo_box>
-	<combo_box label="Formato" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="Largura" name="snapshot_width"/>
-	<spinner label="Altura" name="snapshot_height"/>
-	<check_box label="Limitar proproções" name="keep_aspect_check"/>
-	<slider label="Qualidade da imagem" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Capturar:
-	</text>
-	<combo_box label="Camadas da imagem" name="layer_types">
-		<combo_box.item label="Cores" name="Colors"/>
-		<combo_box.item label="Profundidade" name="Depth"/>
-	</combo_box>
-	<check_box label="Interface" name="ui_check"/>
-	<check_box label="HUDs" name="hud_check"/>
-	<check_box label="Deixar aberto depois de salvo" name="keep_open_check"/>
-	<check_box label="Gerar quadro (tela inteira)" name="freeze_frame_check"/>
-	<check_box label="Atualizar" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			OPÇÕES AVANÇADAS
+		</text>
+		<text name="layer_type_label">
+			Capturar:
+		</text>
+		<combo_box label="Camadas da imagem" name="layer_types">
+			<combo_box.item label="Cores" name="Colors"/>
+			<combo_box.item label="Profundidade" name="Depth"/>
+		</combo_box>
+		<check_box label="Interface" name="ui_check"/>
+		<check_box label="HUDs" name="hud_check"/>
+		<check_box label="Gerar quadro (tela inteira)" name="freeze_frame_check"/>
+		<check_box label="Atualização automática" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_toybox.xml b/indra/newview/skins/default/xui/pt/floater_toybox.xml
index 67076beb0f7..3677c3b1f55 100644
--- a/indra/newview/skins/default/xui/pt/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/pt/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="PERSONALIZAR BARRAS DE FERRAMENTA">
+<floater name="Toybox" title="BOTÕES DA BARRA DE FERRAMENTAS">
 	<text name="toybox label 1">
 		Adicione ou remova botões arrastando-os para dentro ou para fora das barras de ferramentas.
 	</text>
 	<text name="toybox label 2">
 		Os botões aparecerão como mostrado ou somente como ícone, dependendo das configurações de cada barra de ferramentas.
 	</text>
+	<button label="Limpar todas as barras de ferramentas" label_selected="Limpar todas as barras de ferramentas" name="btn_clear_all"/>
 	<button label="Restaurar padrão" label_selected="Restaurar padrão" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_translation_settings.xml b/indra/newview/skins/default/xui/pt/floater_translation_settings.xml
new file mode 100644
index 00000000000..1955599a818
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="CONFIGURAÇÕES DE TRADUÇÃO DE BATE-PAPO">
+	<string name="bing_api_key_not_verified">
+		appID do Bing não verificada. Tente novamente.
+	</string>
+	<string name="google_api_key_not_verified">
+		Chave do API do Google não verificada. Tente novamente.
+	</string>
+	<string name="bing_api_key_verified">
+		appID do Bing verificada.
+	</string>
+	<string name="google_api_key_verified">
+		Chave do API do Google verificada.
+	</string>
+	<check_box label="Permitir a tradução de máquina durante o bate-papo" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Traduzir bate-papo para:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="Padrão" name="System Default Language"/>
+		<combo_box.item label="Inglês" name="English"/>
+		<combo_box.item label="Dansk (Dinamarquês)" name="Danish"/>
+		<combo_box.item label="Deutsch (Alemão)" name="German"/>
+		<combo_box.item label="Español (Espanhol)" name="Spanish"/>
+		<combo_box.item label="Français (Francês)" name="French"/>
+		<combo_box.item label="Italiano (Italiano)" name="Italian"/>
+		<combo_box.item label="Magyar (Húngaro)" name="Hungarian"/>
+		<combo_box.item label="Nederlands (Holandês)" name="Dutch"/>
+		<combo_box.item label="Polski (Polonês)" name="Polish"/>
+		<combo_box.item label="Português (Português)" name="Portugese"/>
+		<combo_box.item label="Русский (Russo)" name="Russian"/>
+		<combo_box.item label="Türkçe (Turco)" name="Turkish"/>
+		<combo_box.item label="Українська (Ucraniano)" name="Ukrainian"/>
+		<combo_box.item label="中文 (简体) (Chinês)" name="Chinese"/>
+		<combo_box.item label="日本語 (Japonês)" name="Japanese"/>
+		<combo_box.item label="한국어 (Coreano)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Escolha o serviço de tradução:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		[http://www.bing.com/developers/createapp.aspx AppID] do Bing:
+	</text>
+	<button label="Verificar" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		[http://code.google.com/apis/language/translate/v2/getting_started.html#auth Chave API] do Google:
+	</text>
+	<button label="Verificar" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Preços] | [https://code.google.com/apis/console Estatísticas]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="Cancelar" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_voice_controls.xml b/indra/newview/skins/default/xui/pt/floater_voice_controls.xml
index 61324790410..745a7d0e00b 100644
--- a/indra/newview/skins/default/xui/pt/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/pt/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="CONTROLES DE VOZ">
 	<string name="title_nearby">
-		Voz próxima
+		CONFIGURAÇÕES DE VOZ
 	</string>
 	<string name="title_group">
-		Ligação de grupo com [GROUP]
+		LIGAÇÃO DE GRUPO COM [GROUP]
 	</string>
 	<string name="title_adhoc">
-		Teleconferência
+		TELECONFERÊNCIA
 	</string>
 	<string name="title_peer_2_peer">
-		Ligação para [NAME]
+		LIGAÇÃO PARA [NAME]
 	</string>
 	<string name="no_one_near">
 		Ninguém por perto ativou a voz
diff --git a/indra/newview/skins/default/xui/pt/menu_toolbars.xml b/indra/newview/skins/default/xui/pt/menu_toolbars.xml
index f1e41aaea97..b58a1a6e4f5 100644
--- a/indra/newview/skins/default/xui/pt/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/pt/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Escolher botões..." name="Chose Buttons"/>
+	<menu_item_call label="Remover este botão" name="Remove button"/>
+	<menu_item_call label="Botões da barra de ferramentas..." name="Choose Buttons"/>
 	<menu_item_check label="Ícones e rótulos" name="icons_with_text"/>
 	<menu_item_check label="Somente ícones" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index 5ff2d49ac1a..119a3bdcfe7 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Eu" name="Me">
-		<menu_item_call label="Painel..." name="Manage My Account">
-			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=pt"/>
-		</menu_item_call>
 		<menu_item_call label="Perfil..." name="Profile"/>
 		<menu_item_call label="Aparência..." name="ChangeOutfit"/>
+		<menu_item_call label="Selecione um avatar..." name="Avatar Picker"/>
 		<menu_item_check label="Inventário..." name="Inventory"/>
-		<menu_item_check label="Gestos..." name="Gestures"/>
-		<menu_item_check label="Voz..." name="ShowVoice"/>
+		<menu_item_call label="Nova janela de inventário" name="NewInventoryWindow"/>
+		<menu_item_call label="Lugares..." name="Places"/>
+		<menu_item_call label="Destaques..." name="Picks"/>
+		<menu_item_call label="Controles da câmera..." name="Camera Controls"/>
 		<menu label="Movimentos" name="Movement">
 			<menu_item_call label="Sentar" name="Sit Down Here"/>
 			<menu_item_check label="Voar" name="Fly"/>
@@ -22,34 +22,39 @@
 		<menu_item_call label="Request Admin Status" name="Request Admin Options"/>
 		<menu_item_call label="Sair do modo admin" name="Leave Admin Options"/>
 		<menu_item_call label="Comprar L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Painel da conta..." name="Manage My Account">
+			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=pt"/>
+		</menu_item_call>
 		<menu_item_call label="Preferências..." name="Preferences"/>
-		<menu_item_call label="Barras de ferramentas..." name="Toolbars"/>
+		<menu_item_call label="Botões da barra de ferramentas..." name="Toolbars"/>
 		<menu_item_call label="Ocultar todos os controles" name="Hide UI"/>
 		<menu_item_call label="Sair do [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Comunicar" name="Communicate">
-		<menu_item_call label="Meus amigos" name="My Friends"/>
-		<menu_item_call label="Meus grupos" name="My Groups"/>
-		<menu_item_check label="Bate-papo local" name="Nearby Chat"/>
-		<menu_item_call label="Pessoas por perto" name="Active Speakers"/>
-		<menu_item_check label="Voz por perto" name="Nearby Voice"/>
+		<menu_item_check label="Bate-papo..." name="Nearby Chat"/>
+		<menu_item_check label="Falar" name="Speak"/>
+		<menu_item_check label="Configurações de voz..." name="Nearby Voice"/>
+		<menu_item_check label="Distorção de voz..." name="ShowVoice"/>
+		<menu_item_check label="Gestos..." name="Gestures"/>
+		<menu_item_call label="Amigos" name="My Friends"/>
+		<menu_item_call label="Grupos" name="My Groups"/>
+		<menu_item_call label="Pessoas próximas" name="Active Speakers"/>
 	</menu>
 	<menu label="Mundo" name="World">
-		<menu_item_check label="Mini Mapa" name="Mini-Map"/>
+		<menu_item_call label="Criar marco deste lugar" name="Create Landmark Here"/>
+		<menu_item_call label="Destinos..." name="Destinations"/>
 		<menu_item_check label="Mapa-múndi" name="World Map"/>
+		<menu_item_check label="Mini Mapa" name="Mini-Map"/>
 		<menu_item_check label="Busca" name="Search"/>
+		<menu_item_call label="Teletransportar para início" name="Teleport Home"/>
+		<menu_item_call label="Definir como casa" name="Set Home to Here"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
-		<menu_item_call label="Criar marco deste lugar" name="Create Landmark Here"/>
-		<menu label="Perfil da região" name="Land">
-			<menu_item_call label="Perfil da região" name="Place Profile"/>
-			<menu_item_call label="Sobre terrenos" name="About Land"/>
-			<menu_item_call label="Região/Propriedade" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="Perfil da região" name="Place Profile"/>
+		<menu_item_call label="Sobre terrenos" name="About Land"/>
+		<menu_item_call label="Região/Propriedade" name="Region/Estate"/>
+		<menu_item_call label="Meus terrenos..." name="My Land"/>
 		<menu_item_call label="Comprar este terreno" name="Buy Land"/>
-		<menu_item_call label="Meus terrenos" name="My Land"/>
 		<menu label="Mostrar" name="LandShow">
-			<menu_item_check label="Controles de movimento" name="Movement Controls"/>
-			<menu_item_check label="Ver controles" name="Camera Controls"/>
 			<menu_item_check label="Limites" name="Ban Lines"/>
 			<menu_item_check label="Balizas" name="beacons"/>
 			<menu_item_check label="Limites do imóvel" name="Property Lines"/>
@@ -58,30 +63,29 @@
 			<menu_item_check label="Propriedades do lote" name="Parcel Properties"/>
 			<menu_item_check label="Menu avançado" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Teletransportar para meu início" name="Teleport Home"/>
-		<menu_item_call label="Definir como Início" name="Set Home to Here"/>
 		<menu label="Sol" name="Environment Settings">
 			<menu_item_call label="Amanhecer" name="Sunrise"/>
 			<menu_item_call label="Meio-dia" name="Noon"/>
 			<menu_item_call label="Pôr-do-Sol" name="Sunset"/>
 			<menu_item_call label="Meia-noite" name="Midnight"/>
-		</menu>
-		<menu label="Editor de ambientes" name="Enviroment Editor">
-			<menu_item_call label="Configurações de ambiente..." name="Enviroment Settings"/>
-			<menu label="Pré-configurações de água" name="Water Presets">
-				<menu_item_call label="Nova pré-configuração..." name="new_water_preset"/>
-				<menu_item_call label="Editar pré-configuração..." name="edit_water_preset"/>
-				<menu_item_call label="Excluir pré-configuração..." name="delete_water_preset"/>
+			<menu_item_call label="Usar configurações da região" name="Use Region Settings"/>
+		</menu>
+		<menu label="Editor de ambientes" name="Environment Editor">
+			<menu_item_call label="Configurações do ambiente..." name="Environment Settings"/>
+			<menu label="Predefinições da água" name="Water Presets">
+				<menu_item_call label="Nova predefinição..." name="new_water_preset"/>
+				<menu_item_call label="Editar predefinição..." name="edit_water_preset"/>
+				<menu_item_call label="Excluir predefinição..." name="delete_water_preset"/>
 			</menu>
-			<menu label="Pré-configurações de céu" name="Sky Presets">
-				<menu_item_call label="Nova pré-configuração..." name="new_sky_preset"/>
-				<menu_item_call label="Editar pré-configuração..." name="edit_sky_preset"/>
-				<menu_item_call label="Excluir pré-configuração..." name="delete_sky_preset"/>
+			<menu label="Predefinições de céu" name="Sky Presets">
+				<menu_item_call label="Nova predefinição..." name="new_sky_preset"/>
+				<menu_item_call label="Editar predefinição..." name="edit_sky_preset"/>
+				<menu_item_call label="Excluir predefinição..." name="delete_sky_preset"/>
 			</menu>
-			<menu label="Pré-configurações de dias" name="Day Presets">
-				<menu_item_call label="Nova pré-configuração..." name="new_day_preset"/>
-				<menu_item_call label="Editar pré-configuração..." name="edit_day_preset"/>
-				<menu_item_call label="Excluir pré-configuração..." name="delete_day_preset"/>
+			<menu label="Predefinições do dia" name="Day Presets">
+				<menu_item_call label="Nova predefinição..." name="new_day_preset"/>
+				<menu_item_call label="Editar predefinição..." name="edit_day_preset"/>
+				<menu_item_call label="Excluir predefinição..." name="delete_day_preset"/>
 			</menu>
 		</menu>
 	</menu>
@@ -146,6 +150,7 @@
 		<menu_item_call label="Repetir" name="Redo"/>
 	</menu>
 	<menu label="Ajuda" name="Help">
+		<menu_item_call label="Como..." name="How To"/>
 		<menu_item_call label="[SECOND_LIFE] Ajuda" name="Second Life Help"/>
 		<menu_item_call label="Denunciar abuso" name="Report Abuse"/>
 		<menu_item_call label="Relatar bug" name="Report Bug"/>
@@ -199,11 +204,10 @@
 		<menu_item_check label="Usar plugin de leitura de threads" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Limpar cache de grupo" name="ClearGroupCache"/>
 		<menu_item_check label="Smoothing de mouse" name="Mouse Smoothing"/>
+		<menu_item_call label="Liberar teclas" name="Release Keys"/>
 		<menu label="Atalhos" name="Shortcuts">
 			<menu_item_call label="Imagem (L$[COST])..." name="Upload Image"/>
 			<menu_item_check label="Busca" name="Search"/>
-			<menu_item_call label="Soltar objeto" name="Release Keys"/>
-			<menu_item_call label="Interface tamanho padrão" name="Set UI Size to Default"/>
 			<menu_item_check label="Mostrar menu avançado - atalho antigo" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fechar janela" name="Close Window"/>
 			<menu_item_call label="Fechar todas as janelas" name="Close All Windows"/>
@@ -272,6 +276,7 @@
 			<menu_item_check label="Tipo de atualização" name="Update Type"/>
 			<menu_item_check label="Dados LOD" name="LOD Info"/>
 			<menu_item_check label="Fila de construção" name="Build Queue"/>
+			<menu_item_check label="Vetores de vento" name="Wind Vectors"/>
 			<menu_item_check label="Renderizar complexidade" name="rendercomplexity"/>
 			<menu_item_check label="Esculpir" name="Sculpt"/>
 		</menu>
@@ -281,7 +286,6 @@
 			<menu_item_check label="Iluminação e sombras" name="Lighting and Shadows"/>
 			<menu_item_check label="Sombras da projeção do sol/lua" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO e sombra suave" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Iluminação global (fase experimental)" name="Global Illumination"/>
 			<menu_item_check label="Máscaras alpha automáticas (adiadas)" name="Automatic Alpha Masks (deferred)"/>
 			<menu_item_check label="Máscaras alpha automáticas (sem adiar)" name="Automatic Alpha Masks (non-deferred)"/>
 			<menu_item_check label="Texturas de animação" name="Animation Textures"/>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index b53ebeb1361..2c5ccd6e191 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -973,7 +973,7 @@ Oferecer amizade para [NAME]?
 		</form>
 	</notification>
 	<notification name="RemoveFromFriends">
-		Remover &lt;nolink&gt;[NAME]&lt;/nolink&gt; da sua lista de amigos?
+		Deseja remover &lt;nolink&gt;[NAME]&lt;/nolink&gt; da sua lista de amigos?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Remover"/>
 	</notification>
 	<notification name="RemoveMultipleFromFriends">
@@ -1099,8 +1099,13 @@ Doar este terreno de [AREA] m² para o grupo &apos;[GROUP_NAME]&apos;?
 	<notification name="DisplaySetToSafe">
 		Configurações de display foram ajustadas para níveis de segurança porque você especificou -- opção de segurança.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Configurações de display foram ajustadas para nível recomendado baseado na configuração do seu sistema.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		As configurações de tela foram definidas nos níveis recomendados porque sua placa de vídeo foi alterada
+de &apos;[LAST_GPU]&apos;
+para &apos;[THIS_GPU]&apos;
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		As configurações de tela foram definidas nos níveis recomendados por causa de uma alteração no subsistema de renderização.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1900,7 +1905,13 @@ Mover para o inventário o(s) item(s)?
 		<usetemplate ignoretext="Confirmar antes de sair" name="okcancelignore" notext="Não sair" yestext="Sair"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		Tem certeza que deseja restaurar seus botões e barras de ferramenta padrão? 
+		Essa ação irá restaurar os botões e barras de ferramenta padrão.
+
+Não é possível desfazer essa ação.
+		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Essa ação fará com que todos os botões voltem para a caixa de ferramentas e suas barras de ferramentas ficarão vazias.
     
 Não é possível desfazer essa ação.
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
@@ -2225,14 +2236,16 @@ Selecione só um objeto.
 		Seu cartão de visita foi negado.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Para se teletransportar para lugares como &apos;[NAME]&apos;, abra o painel &apos;Lugares&apos; à direita da tela e selecione a guia Marcos.  
-Basta clicar em qualquer marco e depois clicar em &apos;Teletransportar&apos; na parte inferior da tela. 
-(Também é possível clicar duas vezes no marco, ou clicar no marco com o botão direito e selecionar &apos;Teletransportar&apos;.)
+		Para se teletransportar para locais como &apos;[NAME]&apos;, clique no botão &quot;Lugares&quot;,
+    e selecione a guia Marcos na janela que é exibida. Clique em qualquer
+    marco para selecioná-lo e em seguida em &apos;Teletransportar&apos; na parte inferior da tela.
+    (Também é possível clicar duas vezes sobre o marco ou clicar com o botão direito do mouse sobre ele
+    e selecionar &apos;Teletransportar&apos;.)
 	</notification>
 	<notification name="TeleportToPerson">
-		Para entrar em contato com residentes como &apos;&apos;[NAME]&apos;,  abra o painel &apos;Pessoas&apos; à direita da tela.
-Selecione o residente da lista e clique em &apos;MI&apos; na parte de baixo do painel.
-(Também é possível clicar duas vezes no nome, ou clicar no nome com o botão direito e selecionar &apos;MI&apos;.)
+		Para entrar em contato com residentes como &apos;[NAME]&apos;, clique no botão &quot;Pessoas&quot;, selecione um residente na janela que é exibida e clique em &apos;MI&apos; na
+    parte inferior da janela.
+    (Também é possível clicar duas vezes no nome, ou clicar no nome com o botão direito e selecionar &apos;MI&apos;.)
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		Impossível selecionar terra nas fronteiras do servidor. Tente selecionar um pedaço menor de terra.
@@ -2252,6 +2265,9 @@ Selecione o residente da lista e clique em &apos;MI&apos; na parte de baixo do p
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Notificação de evento:
 
@@ -2501,10 +2517,10 @@ Cada um pode ver o status do outro (definição padrão).
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; aceitou seu convite de amizade.
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; aceitou sua oferta de amizade.
 	</notification>
 	<notification name="FriendshipDeclined">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; recusou seu convite de amizade
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; rejeitou sua oferta de amizade.
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
 		Oferta de amizada aceita.
diff --git a/indra/newview/skins/default/xui/pt/panel_edit_skin.xml b/indra/newview/skins/default/xui/pt/panel_edit_skin.xml
index f3d88123f2e..d00aa2dc662 100644
--- a/indra/newview/skins/default/xui/pt/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/pt/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Tatuagens na cabeça" name="Head Tattoos" tool_tip="Selecionar imagem"/>
-		<texture_picker label="Tatuagem parte de cima" name="Upper Tattoos" tool_tip="Selecionar imagem"/>
-		<texture_picker label="Tatuagem de baixo" name="Lower Tattoos" tool_tip="Selecionar imagem"/>
+		<texture_picker label="Cabeça" name="Head" tool_tip="Selecionar imagem"/>
+		<texture_picker label="Cintura acima" name="Upper Body" tool_tip="Selecionar imagem"/>
+		<texture_picker label="Cintura para baixo" name="Lower Body" tool_tip="Selecionar imagem"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/pt/panel_postcard_message.xml b/indra/newview/skins/default/xui/pt/panel_postcard_message.xml
new file mode 100644
index 00000000000..9cde8104302
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		Para:
+	</text>
+	<text name="name_label">
+		De:
+	</text>
+	<text name="subject_label">
+		Assunto:
+	</text>
+	<line_editor label="Digite aqui o assunto." name="subject_form"/>
+	<text name="msg_label">
+		Mensagem:
+	</text>
+	<text_editor name="msg_form">
+		Digite aqui a mensagem.
+	</text_editor>
+	<button label="Cancelar" name="cancel_btn"/>
+	<button label="Enviar" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_postcard_settings.xml b/indra/newview/skins/default/xui/pt/panel_postcard_settings.xml
new file mode 100644
index 00000000000..3088b9a9962
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Resolução" name="postcard_size_combo">
+		<combo_box.item label="Janela atual" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Customizado" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="Largura" name="postcard_snapshot_width"/>
+			<spinner label="Altura" name="postcard_snapshot_height"/>
+			<check_box label="Limitar proporções" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Qualidade da imagem" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml
index f98659aa738..c5a4febb0e3 100644
--- a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml
@@ -29,30 +29,5 @@
 	<check_box label="Bate-papos de MI" name="EnableIMChatPopups" tool_tip="Exibir pop-up de mensagens instantâneas novas"/>
 	<spinner label="Transição de avisos de bate-papos por perto:" name="nearby_toasts_lifetime"/>
 	<spinner label="Transição de avisos de bate-papos por perto:" name="nearby_toasts_fadingtime"/>
-	<check_box name="translate_chat_checkbox"/>
-	<text name="translate_chb_label">
-		Traduzir bate-papo automaticamente
-	</text>
-	<text name="translate_language_text">
-		Traduzir bate-papo para:
-	</text>
-	<combo_box name="translate_language_combobox">
-		<combo_box.item label="Padrão" name="System Default Language"/>
-		<combo_box.item label="English (Inglês)" name="English"/>
-		<combo_box.item label="Dansk (Dinamarquês)" name="Danish"/>
-		<combo_box.item label="Deutsch (Alemão)" name="German"/>
-		<combo_box.item label="Español (Espanhol)" name="Spanish"/>
-		<combo_box.item label="Français (Francês)" name="French"/>
-		<combo_box.item label="Italiano (Italiano)" name="Italian"/>
-		<combo_box.item label="Magyar (Húngaro)" name="Hungarian"/>
-		<combo_box.item label="Nederlands (Holandês)" name="Dutch"/>
-		<combo_box.item label="Polski (Polonês)" name="Polish"/>
-		<combo_box.item label="Português (Português)" name="Portugese"/>
-		<combo_box.item label="Русский (Russo)" name="Russian"/>
-		<combo_box.item label="Türkçe (Turco)" name="Turkish"/>
-		<combo_box.item label="Українська (Ucraniano)" name="Ukrainian"/>
-		<combo_box.item label="中文 (简体) (Chinês)" name="Chinese"/>
-		<combo_box.item label="日本語 (Japonês)" name="Japanese"/>
-		<combo_box.item label="한국어 (Coreano)" name="Korean"/>
-	</combo_box>
+	<button label="Configurações de tradução de bate-papo" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
index 9259c0ed563..ebbd63138a5 100644
--- a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Usar meu navegador (IE, Firefox, Safari)" name="external" tool_tip="Use o navegador incluso para consultar a ajuda, abrir links da web, etc. Uso em tela inteira não recomendado." value="1"/>
+		<radio_item label="Usar meu navegador (IE, Firefox, Safari)" name="external" tool_tip="Use o navegador incluso para consultar a ajuda, abrir links da web, etc. Uso em tela inteira não recomendado." value="true"/>
 		<radio_item label="Usar navegador incluso" name="internal" tool_tip="Use este navegador para consultar a ajuda, abrir links da web, etc. As janelas abrem dentro do [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Habilitar plugins" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..3c4bb186877
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		Salvar no meu inventário
+	</text>
+	<text name="hint_lbl">
+		Salvar uma imagem em seu inventário custa L$[UPLOAD_COST]. Para salvar sua imagem como uma textura, selecione um dos formatos quadrados.
+	</text>
+	<combo_box label="Resolução" name="texture_size_combo">
+		<combo_box.item label="Janela atual" name="CurrentWindow"/>
+		<combo_box.item label="Pequeno (128x128)" name="Small(128x128)"/>
+		<combo_box.item label="Médio (256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
+		<combo_box.item label="Customizado" name="Custom"/>
+	</combo_box>
+	<spinner label="Largura" name="inventory_snapshot_width"/>
+	<spinner label="Altura" name="inventory_snapshot_height"/>
+	<check_box label="Limitar proporções" name="inventory_keep_aspect_check"/>
+	<button label="Cancelar" name="cancel_btn"/>
+	<button label="Salvar" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_local.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_local.xml
new file mode 100644
index 00000000000..36b5b0cbe6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Salvar no meu PC
+	</text>
+	<combo_box label="Resolução" name="local_size_combo">
+		<combo_box.item label="Janela atual" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="Customizado" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="Largura" name="local_snapshot_width"/>
+			<spinner label="Altura" name="local_snapshot_height"/>
+			<check_box label="Limitar proporções" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Formato" name="local_format_combo">
+				<combo_box.item label="PNG (sem perda)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (sem perda)" name="BMP"/>
+			</combo_box>
+			<slider label="Qualidade da imagem" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Cancelar" name="cancel_btn"/>
+	<flyout_button label="Salvar" name="save_btn" tool_tip="Salvar imagem em um arquivo">
+		<flyout_button.item label="Salvar" name="save_item"/>
+		<flyout_button.item label="Salvar como..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
new file mode 100644
index 00000000000..7f1452e9926
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="Postar no feed do meu perfil" name="save_to_profile_btn"/>
+	<button label="E-mail" name="save_to_email_btn"/>
+	<button label="Salvar em Meu inventário (L$[AMOUNT])" name="save_to_inventory_btn"/>
+	<button label="Salvar no meu PC" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..12a648f600b
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		Postal do [SECOND_LIFE].
+	</string>
+	<string name="default_message">
+		Confira!
+	</string>
+	<string name="upload_message">
+		Enviando...
+	</string>
+	<text name="title">
+		E-mail
+	</text>
+	<button label="Mensagem" name="message_btn"/>
+	<button label="Configurações" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..095b8fc75d5
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		Postar no feed do meu perfil
+	</text>
+	<combo_box label="Resolução" name="profile_size_combo">
+		<combo_box.item label="Janela atual" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Customizado" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="Largura" name="profile_snapshot_width"/>
+			<spinner label="Altura" name="profile_snapshot_height"/>
+			<check_box label="Limitar proporções" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Legenda:
+			</text>
+			<check_box initial_value="true" label="Incluir local" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Cancelar" name="cancel_btn"/>
+	<button label="Postar" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 6b4835e8193..4babd9cc43e 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -1160,7 +1160,7 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 		Você não possui uma cópia desta textura no seu inventário
 	</string>
 	<string name="InventoryInboxNoItems">
-		Compras do marketplace serão entregues aqui.
+		Quando você comprar ou receber um item, ele aparecerá aqui para que você possa arrastá-lo para uma pasta em seu inventário ou excluí-lo caso não queira mantê-lo.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1352,6 +1352,9 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 	<string name="no_attachments">
 		Nenhum anexo vestido
 	</string>
+	<string name="Attachments remain">
+		Anexos ([COUNT] slots permanecem)
+	</string>
 	<string name="Buy">
 		Comprar
 	</string>
@@ -1478,6 +1481,12 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 	<string name="Right Pec">
 		Peitoral D
 	</string>
+	<string name="Neck">
+		Pescoço
+	</string>
+	<string name="Avatar Center">
+		Centro do avatar
+	</string>
 	<string name="Invalid Attachment">
 		Ponto de encaixe inválido
 	</string>
@@ -3897,6 +3906,18 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	<string name="you_paid_ldollars_no_name">
 		Você pagou L$[AMOUNT] por [REASON].
 	</string>
+	<string name="you_paid_failure_ldollars">
+		Você não pagou L$[AMOUNT] a [NAME] referentes a [REASON].
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		Você não pagou L$[AMOUNT].
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		Você não pagou L$[AMOUNT] a [NAME].
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		Você não pagou L$[AMOUNT] referentes a [REASON].
+	</string>
 	<string name="for item">
 		por [ITEM]
 	</string>
@@ -4307,6 +4328,12 @@ Tente colocar o caminho do editor entre aspas.
 	<string name="ExternalEditorFailedToRun">
 		Falha de execução do editor externo.
 	</string>
+	<string name="TranslationFailed">
+		Falha na tradução: [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Erro ao analisar resposta de tradução.
+	</string>
 	<string name="Esc">
 		Esc
 	</string>
@@ -4677,7 +4704,7 @@ Tente colocar o caminho do editor entre aspas.
 		Mini Mapa
 	</string>
 	<string name="Command_Move_Label">
-		Mover
+		Andar/correr/voar
 	</string>
 	<string name="Command_People_Label">
 		Pessoas
@@ -4704,10 +4731,10 @@ Tente colocar o caminho do editor entre aspas.
 		Falar
 	</string>
 	<string name="Command_View_Label">
-		Exibir
+		Controles da câmera
 	</string>
 	<string name="Command_Voice_Label">
-		Voz próxima
+		Configurações de voz
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		Informações sobre o terreno que você está visitando
@@ -4779,7 +4806,16 @@ Tente colocar o caminho do editor entre aspas.
 		Alterar o ângulo da câmera
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Pessoas próximas com recursos de voz
+		Controles de volume das chamadas e pessoas próximas a você no mundo virtual
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		atualmente na sua barra de ferramentas inferior
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		atualmente na sua barra de ferramentas esquerda
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		atualmente na sua barra de ferramentas direita
 	</string>
 	<string name="Retain%">
 		Reter%
@@ -4805,4 +4841,19 @@ Tente colocar o caminho do editor entre aspas.
 	<string name="Normal">
 		Normal
 	</string>
+	<string name="snapshot_quality_very_low">
+		Muito baixo
+	</string>
+	<string name="snapshot_quality_low">
+		Baixo
+	</string>
+	<string name="snapshot_quality_medium">
+		Médio
+	</string>
+	<string name="snapshot_quality_high">
+		Alto
+	</string>
+	<string name="snapshot_quality_very_high">
+		Muito alto
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/pt/teleport_strings.xml b/indra/newview/skins/default/xui/pt/teleport_strings.xml
index f8ded1ce690..3fb77a02d26 100644
--- a/indra/newview/skins/default/xui/pt/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/pt/teleport_strings.xml
@@ -19,8 +19,8 @@ Se você continuar a receber esta mensagem, por favor consulte o [SUPPORT_SITE].
 			Desculpe, não foi possível para o sistema executar o teletransporte. Tente novamente dentro de alguns instantes.
 		</message>
 		<message name="NoHelpIslandTP">
-		Você não pode se tele-transportar de volta à Ilha de Welcome.
-Vá para a Ilha de Welcome Pública para repetir este tutorial.
+			Não é possível se teletransportar de volta à Ilha Welcome.
+Vá para a &apos;Ilha Welcome Pública&apos; para repetir o tutorial.
 		</message>
 		<message name="noaccess_tport">
 			Desculpe, você não tem acesso ao destino deste teletransporte.
diff --git a/indra/newview/skins/default/xui/ru/floater_about.xml b/indra/newview/skins/default/xui/ru/floater_about.xml
index deb6be319cf..119f104906e 100644
--- a/indra/newview/skins/default/xui/ru/floater_about.xml
+++ b/indra/newview/skins/default/xui/ru/floater_about.xml
@@ -63,32 +63,34 @@
 		<panel label="Лицензии" name="licenses_panel">
 			<text_editor name="credits_editor">
 				3Dconnexion SDK (C) 1992-2007 3Dconnexion
-APR (C) 2000-2004 The Apache Software Foundation
-Collada DOM (C) 2005 Sony Computer Entertainment Inc.cURL (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        APR (C) 2000-2004 The Apache Software Foundation
+        Collada DOM (C) 2005 Sony Computer Entertainment Inc.
+        cURL (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib (C) 2002, 2003  CodeFactory AB / (C) 2003, 2004 Red Hat, Inc.
+        expat (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL (C) 1999-2004 Brian Paul.
+        GLOD (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Университет Джона Гопкинса и David Luebke, Brenden Schubert, Университет Вирджинии.
+        google-perftools (c) 2005, Google Inc.
+        Havok.com(TM) (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 (C) 2001, David Taubman, Университет Нового Южного Уэльса (UNSW)
+        jpeglib (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis (C) 2001, Xiphophorus
+        OpenSSL (C) 1998-2002 The OpenSSL Project.
+        PCRE (c) 1997-2008, Кембриджский университет
+        SDL (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi (C) 2000 Epinions, Inc.
+        zlib (C) 1995-2002 Jean-loup Gailly и Mark Adler.
+        google-perftools (c) 2005, Google Inc.
 
-DBus/dbus-glib (C) 2002, 2003  CodeFactory AB / (C) 2003, 2004 Red Hat, Inc.
-expat (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL (C) 1999-2004 Brian Paul.
-GLOD (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University и David Luebke, Brenden Schubert, Университет Вирджиинии.
-google-perftools (c) 2005, Google Inc.
-Havok.com(TM) (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 (C) 2001, David Taubman, Университет Нового Южного Уэльса (UNSW)
-jpeglib (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis (C) 2001, Xiphophorus
-OpenSSL (C) 1998-2002 The OpenSSL Project.
-PCRE (c) 1997-2008, Кембриджский университет
-SDL (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi (C) 2000 Epinions, Inc.
-zlib (C) 1995-2002 Jean-loup Gailly и Mark Adler.
-google-perftools (c) 2005, Google Inc.
+        В клиенте Second Life используется технология Havok (TM) Physics. (C) 1999-2010 Havok.com Inc. (и лицензиары компании). Все права защищены. Подробнее см. веб-сайт www.havok.com.
 
-В клиенте Second Life используется технология Havok (TM) Physics. (C) 1999-2010 Havok.com Inc. (и лицензиары компании). Все права защищены. Подробнее см. веб-сайт www.havok.com.
+        Это программное обеспечение содержит исходный код, предоставленный корпорацией NVIDIA.
 
-Все права защищены.  Подробные сведения см. в файле licenses.txt.
+        Все права защищены.  Подробные сведения см. в файле licenses.txt.
 
-Кодирование звука для голосового чата: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1, Приложение C)
+        Кодирование звука для голосового чата: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/ru/floater_about_land.xml b/indra/newview/skins/default/xui/ru/floater_about_land.xml
index 3c278fce52c..46414a530aa 100644
--- a/indra/newview/skins/default/xui/ru/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ru/floater_about_land.xml
@@ -129,7 +129,7 @@
 				Посещаемость:
 			</text>
 			<text name="DwellText">
-				0
+				Загрузка...
 			</text>
 			<button label="Купить землю" name="Buy Land..."/>
 			<button label="Продать для Linden" name="Linden Sale..." tool_tip="Земля должна быть в собственности, иметь заданное содержимое и не быть выставленной на аукцион,"/>
@@ -307,13 +307,15 @@
 				Не толкать (настройки региона)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Видеть жителей этого участка и общаться с ними в чате
+				Аватары с других участков могут видеть
 			</panel.string>
 			<text name="allow_label">
 				Позволить другим жителям:
 			</text>
-			<check_box label="Изменить ландшафт" name="edit land check" tool_tip="Если отмечено, вашу землю сможет терраформировать кто угодно. Лучше не отмечать, так как вы всегда можете изменить вашу землю."/>
-			<check_box label="Полет" name="check fly" tool_tip="Если отмечено, жители смогут летать над вашей землей. Если не отметить, они смогут только прилетать и пролетать мимо земли."/>
+			<text name="allow_label0">
+				Полет:
+			</text>
+			<check_box label="Все" name="check fly" tool_tip="Если отмечено, жители смогут летать над вашей землей. Если не отметить, они смогут только прилетать и пролетать мимо земли."/>
 			<text name="allow_label2">
 				Строительство:
 			</text>
@@ -329,9 +331,6 @@
 			</text>
 			<check_box label="Все" name="check other scripts"/>
 			<check_box label="Группа" name="check group scripts"/>
-			<text name="land_options_label">
-				Параметры земли:
-			</text>
 			<check_box label="Безопасно (нет повреждений)" name="check safe" tool_tip="Если отмечено, то земля считается безопасной, отключены боевые повреждения. Если не отмечено, то боевые повреждения включены."/>
 			<check_box label="Не толкать" name="PushRestrictCheck" tool_tip="Запрещает скриптам функцию толкания. Этот параметр может оказаться полезным для предотвращения нежелательного поведения на вашей земле."/>
 			<check_box label="Показать место в поиске (L$30/неделя)" name="ShowDirectoryCheck" tool_tip="Позволить людям видеть участок в результатах поиска"/>
@@ -372,9 +371,9 @@
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Щелкните для выбора изображения"/>
 			<text name="allow_label5">
-				Позволить жителям с других участков:
+				аватары на этом участке и общаться с ними
 			</text>
-			<check_box label="Видны аватары" name="SeeAvatarsCheck" tool_tip="Жители с других участков могут видеть жителей этого участка и общаться с ними в чате (вы также сможете видеть жителей с других участков и общаться с ними)."/>
+			<check_box label="Видны аватары" name="SeeAvatarsCheck" tool_tip="Аватары с других участков смогут видеть аватары на этом участке и общаться с ними в чате, а вы также сможете видеть их и общаться с ними."/>
 			<text name="landing_point">
 				В точку телепортации: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/ru/floater_avatar.xml b/indra/newview/skins/default/xui/ru/floater_avatar.xml
index 6bdf8198809..b480af9345d 100644
--- a/indra/newview/skins/default/xui/ru/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/ru/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="ВЫБОР АВАТАРА"/>
+<floater name="Avatar" title="ВЫБЕРИТЕ АВАТАР"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
index 7d34ca32740..87e8bd524e9 100644
--- a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта]
+		[http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php деньги]
 	</text>
 	<text name="exchange_rate_note">
 		Повторно введите сумму, чтобы увидеть новый обменный курс.
diff --git a/indra/newview/skins/default/xui/ru/floater_camera.xml b/indra/newview/skins/default/xui/ru/floater_camera.xml
index 945a63c0eb8..52e7c62e06e 100644
--- a/indra/newview/skins/default/xui/ru/floater_camera.xml
+++ b/indra/newview/skins/default/xui/ru/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="КАМЕРА">
+<floater name="camera_floater" title="УПРАВЛЕНИЕ КАМЕРОЙ">
 	<floater.string name="rotate_tooltip">
 		Повернуть камеру вокруг точки фокусировки
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml b/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
index 0fefb76ea52..7400f1df3b5 100644
--- a/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
@@ -4,7 +4,7 @@
 		Фильтрация:
 	</text>
 	<check_box label="Анизотропная фильтрация (медленнее, если включено)" name="ani"/>
-	<text name="Antialiasing:">
+	<text name="antialiasing label">
 		Сглаживание:
 	</text>
 	<combo_box label="Сглаживание" name="fsaa">
diff --git a/indra/newview/skins/default/xui/ru/floater_model_preview.xml b/indra/newview/skins/default/xui/ru/floater_model_preview.xml
index 31517e722d9..5bb96b8de45 100644
--- a/indra/newview/skins/default/xui/ru/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/ru/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Ошибка. Проблема при анализе файла DAE – см. подробности в журнале.
 	</string>
+	<string name="status_material_mismatch">
+		Ошибка. Материал модели не входит в эталонную модель.
+	</string>
 	<string name="status_reading_file">
 		Загрузка...
 	</string>
@@ -137,7 +140,7 @@
 				</panel>
 				<panel name="physics analysis">
 					<text name="method_label">
-						Шаг 2. Анализ
+						2 этап. Анализ
 					</text>
 					<text name="analysis_method_label">
 						Метод:
diff --git a/indra/newview/skins/default/xui/ru/floater_model_wizard.xml b/indra/newview/skins/default/xui/ru/floater_model_wizard.xml
index ef2fe8e5a5f..5b03dd2c731 100644
--- a/indra/newview/skins/default/xui/ru/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/ru/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Выберите файл модели для передачи
 			</text>
 			<button label="Обзор..." label_selected="Обзор..." name="browse"/>
+			<text name="Model types">
+				В Second Life поддерживаются файлы COLLADA (.dae)
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/ru/floater_moveview.xml b/indra/newview/skins/default/xui/ru/floater_moveview.xml
index 6e01f997e18..cb1fda1a1f3 100644
--- a/indra/newview/skins/default/xui/ru/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/ru/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="ПЕРЕМЕЩЕНИЕ">
+<floater name="move_floater" title="ХОДЬБА / БЕГ / ПОЛЕТ">
 	<string name="walk_forward_tooltip">
 		Идти вперед (нажмите стрелку вверх или клавишу W)
 	</string>
diff --git a/indra/newview/skins/default/xui/ru/floater_snapshot.xml b/indra/newview/skins/default/xui/ru/floater_snapshot.xml
index f85d602be72..7e88630b32e 100644
--- a/indra/newview/skins/default/xui/ru/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/ru/floater_snapshot.xml
@@ -3,72 +3,63 @@
 	<floater.string name="unknown">
 		неизвестно
 	</floater.string>
-	<radio_group label="Тип снимка" name="snapshot_type_radio">
-		<radio_item label="Электронная почта" name="postcard"/>
-		<radio_item label="Мой инвентарь (L$[AMOUNT])" name="texture"/>
-		<radio_item label="Сохранить на моем компьютере" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		Отправка письма
+	</string>
+	<string name="profile_progress_str">
+		Публикация
+	</string>
+	<string name="inventory_progress_str">
+		Сохранение в -инвентарь
+	</string>
+	<string name="local_progress_str">
+		Сохранение на компьютере
+	</string>
+	<string name="profile_succeeded_str">
+		Изображение отправлено
+	</string>
+	<string name="postcard_succeeded_str">
+		Письмо отправлено!
+	</string>
+	<string name="inventory_succeeded_str">
+		Сохранено в инвентаре!
+	</string>
+	<string name="local_succeeded_str">
+		Сохранено на компьютере!
+	</string>
+	<string name="profile_failed_str">
+		Не удалось передать изображение в ваш профиль.
+	</string>
+	<string name="postcard_failed_str">
+		Не удалось отправить письмо.
+	</string>
+	<string name="inventory_failed_str">
+		Не удалось сохранить в инвентаре.
+	</string>
+	<string name="local_failed_str">
+		Не удалось сохранить на компьютере.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Дополнительные параметры"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] пикс.
+	</text>
 	<text name="file_size_label">
 		[SIZE] КБ
 	</text>
-	<button label="Послать" name="send_btn"/>
-	<button label="Сохранить (L$[AMOUNT])" name="upload_btn"/>
-	<flyout_button label="Сохранить" name="save_btn" tool_tip="Сохранить изображение в файл">
-		<flyout_button.item label="Сохранить" name="save_item"/>
-		<flyout_button.item label="Сохранить как..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Больше" name="more_btn" tool_tip="Дополнительные параметры"/>
-	<button label="Меньше" name="less_btn" tool_tip="Дополнительные параметры"/>
-	<button label="Отмена" name="discard_btn"/>
-	<text name="type_label2">
-		Размер
-	</text>
-	<text name="format_label">
-		Формат
-	</text>
-	<combo_box label="Разрешение" name="postcard_size_combo">
-		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="Задать" name="Custom"/>
-	</combo_box>
-	<combo_box label="Разрешение" name="texture_size_combo">
-		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
-		<combo_box.item label="Маленький (128x128)" name="Small(128x128)"/>
-		<combo_box.item label="Средний (256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="Большой (512x512)" name="Large(512x512)"/>
-		<combo_box.item label="Задать" name="Custom"/>
-	</combo_box>
-	<combo_box label="Разрешение" name="local_size_combo">
-		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="Задать" name="Custom"/>
-	</combo_box>
-	<combo_box label="Формат" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="Ширина" name="snapshot_width"/>
-	<spinner label="Высота" name="snapshot_height"/>
-	<check_box label="Сохранять пропорции" name="keep_aspect_check"/>
-	<slider label="Качество изображения" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Захват:
-	</text>
-	<combo_box label="Слои изображения" name="layer_types">
-		<combo_box.item label="Цвета" name="Colors"/>
-		<combo_box.item label="Глубина" name="Depth"/>
-	</combo_box>
-	<check_box label="Интерфейс" name="ui_check"/>
-	<check_box label="HUD" name="hud_check"/>
-	<check_box label="Оставить окно открытым" name="keep_open_check"/>
-	<check_box label="Стоп-кадр (полноэкранный)" name="freeze_frame_check"/>
-	<check_box label="Автообновление" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			ДОПОЛНИТЕЛЬНЫЕ ПАРАМЕТРЫ
+		</text>
+		<text name="layer_type_label">
+			Захват:
+		</text>
+		<combo_box label="Слои изображения" name="layer_types">
+			<combo_box.item label="Цвета" name="Colors"/>
+			<combo_box.item label="Глубина" name="Depth"/>
+		</combo_box>
+		<check_box label="Интерфейс" name="ui_check"/>
+		<check_box label="Данные в игре" name="hud_check"/>
+		<check_box label="Стоп-кадр (полноэкранный)" name="freeze_frame_check"/>
+		<check_box label="Автообновление" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_toybox.xml b/indra/newview/skins/default/xui/ru/floater_toybox.xml
index 8d7431d393a..a4754ad7abf 100644
--- a/indra/newview/skins/default/xui/ru/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/ru/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="НАСТРОИТЬ ПАНЕЛИ ИНСТРУМЕНТОВ">
+<floater name="Toybox" title="КНОПКИ ПАНЕЛИ ИНСТРУМЕНТОВ">
 	<text name="toybox label 1">
 		Добавьте или удалите кнопки, перетягивая их на панели инструментов или с них.
 	</text>
 	<text name="toybox label 2">
 		Кнопки будут отображены в исходном виде или в виде значков, в зависимости от настроек каждой панели инструментов.
 	</text>
+	<button label="Очистить все панели" label_selected="Очистить все панели" name="btn_clear_all"/>
 	<button label="Вернуть стандартные" label_selected="Вернуть стандартные" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_translation_settings.xml b/indra/newview/skins/default/xui/ru/floater_translation_settings.xml
new file mode 100644
index 00000000000..ad280a50dd6
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="НАСТРОЙКИ ПЕРЕВОДА ЧАТА">
+	<string name="bing_api_key_not_verified">
+		Bing appID не подтвержден. Повторите попытку.
+	</string>
+	<string name="google_api_key_not_verified">
+		Ключ Google API не подтвержден. Повторите попытку.
+	</string>
+	<string name="bing_api_key_verified">
+		Bing appID подтвержден.
+	</string>
+	<string name="google_api_key_verified">
+		Ключ Google API подтвержден.
+	</string>
+	<check_box label="Включить машинный перевод при чате" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Переводить чат на:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="язык системы" name="System Default Language"/>
+		<combo_box.item label="английский" name="English"/>
+		<combo_box.item label="датский" name="Danish"/>
+		<combo_box.item label="немецкий" name="German"/>
+		<combo_box.item label="испанский" name="Spanish"/>
+		<combo_box.item label="французский" name="French"/>
+		<combo_box.item label="итальянский" name="Italian"/>
+		<combo_box.item label="венгерский" name="Hungarian"/>
+		<combo_box.item label="нидерландский" name="Dutch"/>
+		<combo_box.item label="польский" name="Polish"/>
+		<combo_box.item label="португальский" name="Portugese"/>
+		<combo_box.item label="русский" name="Russian"/>
+		<combo_box.item label="турецкий" name="Turkish"/>
+		<combo_box.item label="украинский" name="Ukrainian"/>
+		<combo_box.item label="китайский" name="Chinese"/>
+		<combo_box.item label="японский" name="Japanese"/>
+		<combo_box.item label="корейский" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Выберите сервис перевода:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Translator" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		Bing [http://www.bing.com/developers/createapp.aspx AppID]:
+	</text>
+	<button label="Подтвердить" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		Google [http://code.google.com/apis/language/translate/v2/getting_started.html#auth Ключ API]:
+	</text>
+	<button label="Подтвердить" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Цены] | [https://code.google.com/apis/console Статистика]
+	</text>
+	<button label="OK" name="ok_btn"/>
+	<button label="Отмена" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_voice_controls.xml b/indra/newview/skins/default/xui/ru/floater_voice_controls.xml
index c1fb858d48c..2b230860624 100644
--- a/indra/newview/skins/default/xui/ru/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/ru/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="УПРАВЛЕНИЕ ГОЛОСОМ">
 	<string name="title_nearby">
-		Настройки голоса
+		НАСТРОЙКИ ГОЛОСА
 	</string>
 	<string name="title_group">
-		Звонок группе [GROUP]
+		ЗВОНОК ГРУППЕ [GROUP]
 	</string>
 	<string name="title_adhoc">
-		Конференция
+		КОНФЕРЕНЦИЯ
 	</string>
 	<string name="title_peer_2_peer">
-		Звонок пользователю [NAME]
+		ЗВОНОК ПОЛЬЗОВАТЕЛЮ [NAME]
 	</string>
 	<string name="no_one_near">
 		Нет никого с включенным голосом
diff --git a/indra/newview/skins/default/xui/ru/menu_toolbars.xml b/indra/newview/skins/default/xui/ru/menu_toolbars.xml
index e04a9ee57d2..aa05dbc390e 100644
--- a/indra/newview/skins/default/xui/ru/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/ru/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Выбор кнопок..." name="Chose Buttons"/>
+	<menu_item_call label="Удалить эту кнопку" name="Remove button"/>
+	<menu_item_call label="Кнопки панели инструментов..." name="Choose Buttons"/>
 	<menu_item_check label="Значки и подписи" name="icons_with_text"/>
 	<menu_item_check label="Только значки" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml
index b9f403c04b1..93d0166568d 100644
--- a/indra/newview/skins/default/xui/ru/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Я" name="Me">
-		<menu_item_call label="Информационная панель..." name="Manage My Account"/>
 		<menu_item_call label="Профиль…" name="Profile"/>
 		<menu_item_call label="Внешность..." name="ChangeOutfit"/>
+		<menu_item_call label="Выберите аватар..." name="Avatar Picker"/>
 		<menu_item_check label="Инвентарь..." name="Inventory"/>
-		<menu_item_check label="Жесты..." name="Gestures"/>
-		<menu_item_check label="Голос..." name="ShowVoice"/>
+		<menu_item_call label="Новое окно инвентаря" name="NewInventoryWindow"/>
+		<menu_item_call label="Места..." name="Places"/>
+		<menu_item_call label="Подборка..." name="Picks"/>
+		<menu_item_call label="Управление камерой..." name="Camera Controls"/>
 		<menu label="Движение" name="Movement">
 			<menu_item_call label="Сесть" name="Sit Down Here"/>
 			<menu_item_check label="Полет" name="Fly"/>
@@ -20,34 +22,37 @@
 		<menu_item_call label="Запрос статуса администратора" name="Request Admin Options"/>
 		<menu_item_call label="Выход из статуса администратора" name="Leave Admin Options"/>
 		<menu_item_call label="Купить L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Информационная панель аккаунта..." name="Manage My Account"/>
 		<menu_item_call label="Настройки..." name="Preferences"/>
-		<menu_item_call label="Панели инструментов..." name="Toolbars"/>
+		<menu_item_call label="Кнопки панели инструментов..." name="Toolbars"/>
 		<menu_item_call label="Скрыть все элементы управления" name="Hide UI"/>
 		<menu_item_call label="Выход из [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Общение" name="Communicate">
-		<menu_item_call label="Мои друзья" name="My Friends"/>
-		<menu_item_call label="Мои группы" name="My Groups"/>
-		<menu_item_check label="Локальный чат" name="Nearby Chat"/>
+		<menu_item_check label="Чат..." name="Nearby Chat"/>
+		<menu_item_check label="Говорить" name="Speak"/>
+		<menu_item_check label="Настройки голоса..." name="Nearby Voice"/>
+		<menu_item_check label="Изменение голоса..." name="ShowVoice"/>
+		<menu_item_check label="Жесты..." name="Gestures"/>
+		<menu_item_call label="Друзья" name="My Friends"/>
+		<menu_item_call label="Группы" name="My Groups"/>
 		<menu_item_call label="Люди неподалеку" name="Active Speakers"/>
-		<menu_item_check label="Голоса собеседников" name="Nearby Voice"/>
 	</menu>
 	<menu label="Мир" name="World">
-		<menu_item_check label="Миникарта" name="Mini-Map"/>
+		<menu_item_call label="Добавить закладку на это место" name="Create Landmark Here"/>
+		<menu_item_call label="Пункты..." name="Destinations"/>
 		<menu_item_check label="Карта мира" name="World Map"/>
+		<menu_item_check label="Миникарта" name="Mini-Map"/>
 		<menu_item_check label="Поиск" name="Search"/>
+		<menu_item_call label="Телепортация домой" name="Teleport Home"/>
+		<menu_item_call label="Установить дом здесь" name="Set Home to Here"/>
 		<menu_item_call label="Снимок" name="Take Snapshot"/>
-		<menu_item_call label="Добавить закладку на это место" name="Create Landmark Here"/>
-		<menu label="Профиль места" name="Land">
-			<menu_item_call label="Профиль места" name="Place Profile"/>
-			<menu_item_call label="О земле" name="About Land"/>
-			<menu_item_call label="Регион/землевладение" name="Region/Estate"/>
-		</menu>
+		<menu_item_call label="Профиль места" name="Place Profile"/>
+		<menu_item_call label="О земле" name="About Land"/>
+		<menu_item_call label="Регион/землевладение" name="Region/Estate"/>
+		<menu_item_call label="Мои владения..." name="My Land"/>
 		<menu_item_call label="Купить эту землю" name="Buy Land"/>
-		<menu_item_call label="Моя земля" name="My Land"/>
 		<menu label="Показать" name="LandShow">
-			<menu_item_check label="Панель движения" name="Movement Controls"/>
-			<menu_item_check label="Панель камеры" name="Camera Controls"/>
 			<menu_item_check label="Линии запрета" name="Ban Lines"/>
 			<menu_item_check label="Метки" name="beacons"/>
 			<menu_item_check label="Границы собственности" name="Property Lines"/>
@@ -56,16 +61,15 @@
 			<menu_item_check label="Свойства участка" name="Parcel Properties"/>
 			<menu_item_check label="Меню «Дополнительно»" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Телепортироваться домой" name="Teleport Home"/>
-		<menu_item_call label="Установить дом здесь" name="Set Home to Here"/>
 		<menu label="Солнце" name="Environment Settings">
 			<menu_item_call label="Восход" name="Sunrise"/>
 			<menu_item_call label="Полдень" name="Noon"/>
 			<menu_item_call label="Закат" name="Sunset"/>
 			<menu_item_call label="Полночь" name="Midnight"/>
+			<menu_item_call label="Использовать настройки региона" name="Use Region Settings"/>
 		</menu>
-		<menu label="Редактор среды" name="Enviroment Editor">
-			<menu_item_call label="Настройки среды..." name="Enviroment Settings"/>
+		<menu label="Редактор среды" name="Environment Editor">
+			<menu_item_call label="Настройки среды..." name="Environment Settings"/>
 			<menu label="Настройки воды" name="Water Presets">
 				<menu_item_call label="Создать настройку..." name="new_water_preset"/>
 				<menu_item_call label="Изменить настройку..." name="edit_water_preset"/>
@@ -144,6 +148,7 @@
 		<menu_item_call label="Вернуть" name="Redo"/>
 	</menu>
 	<menu label="Справка" name="Help">
+		<menu_item_call label="Инструкции..." name="How To"/>
 		<menu_item_call label="Справка по [SECOND_LIFE]" name="Second Life Help"/>
 		<menu_item_call label="Жалоба" name="Report Abuse"/>
 		<menu_item_call label="Сообщить об ошибке" name="Report Bug"/>
@@ -198,11 +203,10 @@
 		<menu_item_check label="Использовать поток для чтения подключаемых модулей" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Очистить кэш группы" name="ClearGroupCache"/>
 		<menu_item_check label="Сглаживание мышью" name="Mouse Smoothing"/>
+		<menu_item_call label="Освободить клавиши" name="Release Keys"/>
 		<menu label="Горячие клавиши" name="Shortcuts">
 			<menu_item_call label="Изображение (L$[COST])..." name="Upload Image"/>
 			<menu_item_check label="Поиск" name="Search"/>
-			<menu_item_call label="Освободить клавиши" name="Release Keys"/>
-			<menu_item_call label="Сбросить размер интерфейса" name="Set UI Size to Default"/>
 			<menu_item_check label="Показать меню «Дополнительно» - старое сочетание клавиш" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Закрыть окно" name="Close Window"/>
 			<menu_item_call label="Закрыть все окна" name="Close All Windows"/>
@@ -288,6 +292,7 @@
 			<menu_item_check label="Освещение" name="Lights"/>
 			<menu_item_check label="Каркас столкновений" name="Collision Skeleton"/>
 			<menu_item_check label="Лучи" name="Raycast"/>
+			<menu_item_check label="Направления ветра" name="Wind Vectors"/>
 			<menu_item_check label="Сложность визуализации" name="rendercomplexity"/>
 			<menu_item_check label="Лепка" name="Sculpt"/>
 		</menu>
@@ -300,7 +305,6 @@
 			<menu_item_check label="Освещение и тени" name="Lighting and Shadows"/>
 			<menu_item_check label="Тени от солнца, луны и прожекторов" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO и сглаживание теней" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Повсеместное освещение (экспериментальное)" name="Global Illumination"/>
 			<menu_item_check label="Отладка GL" name="Debug GL"/>
 			<menu_item_check label="Отладка конвейера" name="Debug Pipeline"/>
 			<menu_item_check label="Автоматические альфа-маски (отложенные)" name="Automatic Alpha Masks (deferred)"/>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index f121743fe92..04f2f6b486b 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -1110,8 +1110,13 @@
 	<notification name="DisplaySetToSafe">
 		Установлен безопасный уровень настроек отображения, так как указан параметр -safe.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Установлен рекомендуемый уровень настроек отображения в соответствии с вашей системной конфигурацией.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		Установлен рекомендуемый уровень настроек отображения, так как графическая карта изменена:
+с «[LAST_GPU]»
+на «[THIS_GPU]»
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		Установлен рекомендуемый уровень настроек отображения, так как подсистема визуализации изменена.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1910,7 +1915,13 @@ http://secondlife.com/download.
 		<usetemplate ignoretext="Подтверждать перед выходом" name="okcancelignore" notext="Не выходить" yestext="Выйти"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		Вы действительно хотите восстановить принятые по умолчанию кнопки и панели инструментов? 
+		Это действие приведет к восстановлению стандартных кнопок и панелей инструментов.
+
+Это действие нельзя отменить.
+		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Это действие возвращает все кнопки в инструментарий, а панели инструментов становятся пустыми.
     
 Это действие нельзя отменить.
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
@@ -2236,14 +2247,16 @@ http://secondlife.com/download.
 		Ваша визитка отклонена.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Вы можете телепортироваться в такие места, как «[NAME]», открыв панель «Места» в правой части экрана и выбрав вкладку «Закладки».
-Щелкните любую закладку, чтобы выбрать ее, а затем нажмите кнопку «Телепортация» внизу панели.
-(Также можно дважды щелкнуть закладку или щелкнуть ее правой кнопкой мыши и выбрать команду «Телепортация».)
+		Для телепортации в другое место, например «[NAME]», нажмите кнопку «Места»,
+    затем в открывшемся окне выберите вкладку «Закладки». Щелкните любую
+    закладку, чтобы выбрать ее, а затем нажмите кнопку «Телепортация» внизу окна.
+    (Также можно дважды щелкнуть закладку или щелкнуть ее правой кнопкой мыши и
+    выбрать команду «Телепортация».)
 	</notification>
 	<notification name="TeleportToPerson">
-		Вы можете общаться с такими жителями, как «[NAME]», открыв панель «Люди» в правой части экрана.
-Выберите в списке нужного жителя, а затем нажмите кнопку «IM» внизу панели.
-(Также можно дважды щелкнуть имя жителя в списке или щелкнуть ее правой кнопкой мыши и выбрать команду «IM».)
+		Чтобы обратиться к жителю, например «[NAME]», нажмите кнопку «Люди», выберите жителя в появившемся окне и нажмите кнопку
+    «IM» внизу окна.
+    (Также можно дважды щелкнуть имя жителя в списке или щелкнуть его правой кнопкой мыши и выбрать команду «IM».)
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		Нельзя выбрать землю с обеих сторон границы между серверами.
@@ -2264,6 +2277,9 @@ http://secondlife.com/download.
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Уведомление о событии:
 
@@ -2798,7 +2814,7 @@ http://secondlife.com/download.
 Со следующими жителями:
 
 [RESIDENTS]
-		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="ОК"/>
+		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification name="ItemsShared">
 		Предметы успешно розданы.
@@ -2888,7 +2904,7 @@ http://secondlife.com/download.
 позже, даже после того, как вы покинули разговор.
 
 Заглушить всех?
-		<usetemplate ignoretext="Подтверждать перед заглушением всех участников группового разговора" name="okcancelignore" notext="Отмена" yestext="ОК"/>
+		<usetemplate ignoretext="Подтверждать перед заглушением всех участников группового разговора" name="okcancelignore" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification label="Чат" name="HintChat">
 		Чтобы присоединиться к чату, введите слова в поле чата ниже.
diff --git a/indra/newview/skins/default/xui/ru/panel_edit_skin.xml b/indra/newview/skins/default/xui/ru/panel_edit_skin.xml
index ac7e74316ed..f5a5339afe9 100644
--- a/indra/newview/skins/default/xui/ru/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/ru/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Тату на голове" name="Head Tattoos" tool_tip="Щелкните для выбора изображения"/>
-		<texture_picker label="Тату на верхних частях тела" name="Upper Tattoos" tool_tip="Щелкните для выбора изображения"/>
-		<texture_picker label="Тату на нижних частях тела" name="Lower Tattoos" tool_tip="Щелкните для выбора изображения"/>
+		<texture_picker label="Голова" name="Head" tool_tip="Щелкните для выбора изображения"/>
+		<texture_picker label="Верхняя часть тела" name="Upper Body" tool_tip="Щелкните для выбора изображения"/>
+		<texture_picker label="Нижняя часть тела" name="Lower Body" tool_tip="Щелкните для выбора изображения"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml b/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml
index 1d26eecf87f..8e3aac38d2d 100644
--- a/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Перевод чата" name="translate_chat_checkbox"/>
+	<check_box label="Переводить чат" name="translate_chat_checkbox"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_postcard_message.xml b/indra/newview/skins/default/xui/ru/panel_postcard_message.xml
new file mode 100644
index 00000000000..70587d80900
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		Кому:
+	</text>
+	<text name="name_label">
+		От:
+	</text>
+	<text name="subject_label">
+		Тема:
+	</text>
+	<line_editor label="Введите тему письма." name="subject_form"/>
+	<text name="msg_label">
+		Сообщение:
+	</text>
+	<text_editor name="msg_form">
+		Введите текст письма.
+	</text_editor>
+	<button label="Отмена" name="cancel_btn"/>
+	<button label="Послать" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_postcard_settings.xml b/indra/newview/skins/default/xui/ru/panel_postcard_settings.xml
new file mode 100644
index 00000000000..dc9d59008f1
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Размер" name="postcard_size_combo">
+		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Задать" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="Ширина" name="postcard_snapshot_width"/>
+			<spinner label="Высота" name="postcard_snapshot_height"/>
+			<check_box label="Сохранять пропорции" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Качество изображения" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml
index a3ee5b78157..a9d5569c7f3 100644
--- a/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml
@@ -29,29 +29,5 @@
 	<check_box label="Текстовые чаты" name="EnableIMChatPopups" tool_tip="Отображать всплывающие уведомления при получении IM-сообщений"/>
 	<spinner label="Время отображения всплывающих реплик:" name="nearby_toasts_lifetime"/>
 	<spinner label="Время затухания всплывающих реплик:" name="nearby_toasts_fadingtime"/>
-	<text name="translate_chb_label">
-		Использовать машинный перевод при общении
-	</text>
-	<text name="translate_language_text">
-		Переводить чат на:
-	</text>
-	<combo_box name="translate_language_combobox">
-		<combo_box.item label="Язык системы" name="System Default Language"/>
-		<combo_box.item label="English" name="English"/>
-		<combo_box.item label="Dansk" name="Danish"/>
-		<combo_box.item label="Deutsch" name="German"/>
-		<combo_box.item label="Español" name="Spanish"/>
-		<combo_box.item label="Français" name="French"/>
-		<combo_box.item label="Italiano" name="Italian"/>
-		<combo_box.item label="Magyar" name="Hungarian"/>
-		<combo_box.item label="Nederlands" name="Dutch"/>
-		<combo_box.item label="Polski" name="Polish"/>
-		<combo_box.item label="Português" name="Portugese"/>
-		<combo_box.item label="Русский" name="Russian"/>
-		<combo_box.item label="Türkçe" name="Turkish"/>
-		<combo_box.item label="Українська" name="Ukrainian"/>
-		<combo_box.item label="中文 (简体) (китайский)" name="Chinese"/>
-		<combo_box.item label="日本語 (Japanese)" name="Japanese"/>
-		<combo_box.item label="한국어 (Korean)" name="Korean"/>
-	</combo_box>
+	<button label="Настройки перевода чата" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
index 49f743a6baf..d1bfedf2d85 100644
--- a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
@@ -16,7 +16,7 @@
 		<combo_box.item label="Русский (бета-версия)" name="Russian"/>
 		<combo_box.item label="Türkçe - турецкий (бета-версия)" name="Turkish"/>
 		<combo_box.item label="日本語 – японский (бета-версия)" name="(Japanese)"/>
-		<combo_box.item label="正體中文 - китайский, традиционное письмо (бета-версия)" name="Traditional Chinese"/>
+		<combo_box.item label="китайский, традиционное письмо - бета-версия" name="Traditional Chinese"/>
 	</combo_box>
 	<text name="language_textbox2">
 		(Требуется перезапуск)
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
index db881891692..8e7fc71f0d5 100644
--- a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Браузер:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Использовать мой браузер (IE, Firefox, Safari)" name="external" tool_tip="Будет использоваться браузер, заданный в системе по умолчанию. Не рекомендуется, если [APP_NAME] работает в полноэкранном режиме." value="1"/>
+		<radio_item label="Использовать мой браузер (IE, Firefox, Safari)" name="external" tool_tip="Будет использоваться браузер, заданный в системе по умолчанию. Не рекомендуется, если [APP_NAME] работает в полноэкранном режиме." value="true"/>
 		<radio_item label="Использовать встроенный браузер" name="internal" tool_tip="Для просмотра справки, ссылок на веб-страницы и т. д. будет использоваться встроенный браузер. Этот браузер открывается как новое окно в [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="истина" label="Разрешить плагины" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..53a150c9f9e
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		Сохранить в моем инвентаре
+	</text>
+	<text name="hint_lbl">
+		Сохранение изображения в инвентаре стоит L$[UPLOAD_COST]. Чтобы сохранить его как текстуру, выберите один из квадратных форматов.
+	</text>
+	<combo_box label="Размер" name="texture_size_combo">
+		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
+		<combo_box.item label="Маленький (128x128)" name="Small(128x128)"/>
+		<combo_box.item label="Средний (256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="Большой (512x512)" name="Large(512x512)"/>
+		<combo_box.item label="Задать" name="Custom"/>
+	</combo_box>
+	<spinner label="Ширина" name="inventory_snapshot_width"/>
+	<spinner label="Высота" name="inventory_snapshot_height"/>
+	<check_box label="Сохранять пропорции" name="inventory_keep_aspect_check"/>
+	<button label="Отмена" name="cancel_btn"/>
+	<button label="Сохранить" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_local.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_local.xml
new file mode 100644
index 00000000000..446b9bb2fd3
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Сохранить на моем компьютере
+	</text>
+	<combo_box label="Размер" name="local_size_combo">
+		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="Задать" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="Ширина" name="local_snapshot_width"/>
+			<spinner label="Высота" name="local_snapshot_height"/>
+			<check_box label="Сохранять пропорции" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Формат" name="local_format_combo">
+				<combo_box.item label="PNG (без потерь)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (без потерь)" name="BMP"/>
+			</combo_box>
+			<slider label="Качество изображения" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Отмена" name="cancel_btn"/>
+	<flyout_button label="Сохранить" name="save_btn" tool_tip="Сохранить изображение в файл">
+		<flyout_button.item label="Сохранить" name="save_item"/>
+		<flyout_button.item label="Сохранить как..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
new file mode 100644
index 00000000000..250a76cd213
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="Поместить в мой профиль" name="save_to_profile_btn"/>
+	<button label="Отправить по почте" name="save_to_email_btn"/>
+	<button label="Сохранить в моем инвентаре (L$[AMOUNT])" name="save_to_inventory_btn"/>
+	<button label="Сохранить на моем компьютере" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..47f4caf8e38
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		Открытка из [SECOND_LIFE].
+	</string>
+	<string name="default_message">
+		Побывай здесь!
+	</string>
+	<string name="upload_message">
+		Отправка...
+	</string>
+	<text name="title">
+		Электронное письмо
+	</text>
+	<button label="Сообщение" name="message_btn"/>
+	<button label="Настройки" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..79a9ef58d03
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		Поместить в мой профиль
+	</text>
+	<combo_box label="Размер" name="profile_size_combo">
+		<combo_box.item label="Текущее окно" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Задать" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="Ширина" name="profile_snapshot_width"/>
+			<spinner label="Высота" name="profile_snapshot_height"/>
+			<check_box label="Сохранять пропорции" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Подпись:
+			</text>
+			<check_box initial_value="true" label="Включить расположение" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Отмена" name="cancel_btn"/>
+	<button label="Опубликовать" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 7fef5797a93..6d954139ffa 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -1211,7 +1211,7 @@ support@secondlife.com.
 		В вашем инвентаре нет копии этой текстуры
 	</string>
 	<string name="InventoryInboxNoItems">
-		Покупки из торгового центра будут доставлены сюда.
+		Если вы купите или как-то иначе получите предмет, он появится здесь. Его можно будет перетащить в папку вашего инвентаря или удалить, если он больше не нужен.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1409,6 +1409,9 @@ support@secondlife.com.
 	<string name="no_attachments">
 		Нет прикрепленных объектов
 	</string>
+	<string name="Attachments remain">
+		Присоединения (осталось гнезд: [COUNT])
+	</string>
 	<string name="Buy">
 		Купить
 	</string>
@@ -1535,6 +1538,12 @@ support@secondlife.com.
 	<string name="Right Pec">
 		Правая грудь
 	</string>
+	<string name="Neck">
+		Шея
+	</string>
+	<string name="Avatar Center">
+		Центр аватара
+	</string>
 	<string name="Invalid Attachment">
 		Неверная точка присоединения
 	</string>
@@ -4024,6 +4033,18 @@ support@secondlife.com.
 	<string name="you_paid_ldollars_no_name">
 		Вы заплатили L$[AMOUNT] за [REASON].
 	</string>
+	<string name="you_paid_failure_ldollars">
+		Вы не смогли заплатить пользователю [NAME] L$[AMOUNT]: [REASON].
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		Вы не смогли заплатить L$[AMOUNT]
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		Вы не смогли заплатить пользователю [NAME] L$[AMOUNT]
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		Вы не смогли заплатить L$[AMOUNT]: [REASON].
+	</string>
 	<string name="for item">
 		за [ITEM]
 	</string>
@@ -4433,6 +4454,12 @@ support@secondlife.com.
 	<string name="ExternalEditorFailedToRun">
 		Не удалось запустить внешний редактор.
 	</string>
+	<string name="TranslationFailed">
+		Ошибка телепортации: [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Ошибка при анализе ответа переводчика.
+	</string>
 	<string name="Esc">
 		ESC
 	</string>
@@ -4815,7 +4842,7 @@ support@secondlife.com.
 		Миникарта
 	</string>
 	<string name="Command_Move_Label">
-		Переместить
+		Ходьба / бег / полет
 	</string>
 	<string name="Command_People_Label">
 		Люди
@@ -4842,7 +4869,7 @@ support@secondlife.com.
 		Говорить
 	</string>
 	<string name="Command_View_Label">
-		Вид
+		Управление камерой
 	</string>
 	<string name="Command_Voice_Label">
 		Настройки голоса
@@ -4917,7 +4944,16 @@ support@secondlife.com.
 		Изменение угла камеры
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Громкость звонков и голосов окружающих вас людей
+		Регулировка громкости вызовов и разговоров с людьми около вас
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		сейчас на нижней панели инструментов
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		сейчас на левой панели инструментов
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		сейчас на правой панели инструментов
 	</string>
 	<string name="Retain%">
 		Остаток%
@@ -4943,4 +4979,19 @@ support@secondlife.com.
 	<string name="Normal">
 		Нормальный
 	</string>
+	<string name="snapshot_quality_very_low">
+		Очень низкий
+	</string>
+	<string name="snapshot_quality_low">
+		Низкий
+	</string>
+	<string name="snapshot_quality_medium">
+		Средний
+	</string>
+	<string name="snapshot_quality_high">
+		Высокий
+	</string>
+	<string name="snapshot_quality_very_high">
+		Очень высокий
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/ru/teleport_strings.xml b/indra/newview/skins/default/xui/ru/teleport_strings.xml
index 296562e6f1c..feff2861116 100644
--- a/indra/newview/skins/default/xui/ru/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/ru/teleport_strings.xml
@@ -21,8 +21,8 @@
 Повторите попытку позже.
 		</message>
 		<message name="NoHelpIslandTP">
-		Вы не можете телепортироваться обратно на Остров Помощи.
-Телепортируйтесь на Общественный Остров Помощи, чтобы повторить обучение
+			Телепортироваться назад на Остров прибытия нельзя.
+Для повторения учебника перейдите на «Остров прибытия - общий».
 		</message>
 		<message name="noaccess_tport">
 			У вас нет доступа к точке назначения этого телепорта.
diff --git a/indra/newview/skins/default/xui/tr/floater_about.xml b/indra/newview/skins/default/xui/tr/floater_about.xml
index 993ec429581..8fa12ea759f 100644
--- a/indra/newview/skins/default/xui/tr/floater_about.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about.xml
@@ -64,32 +64,34 @@ Ses Sunucusu Sürümü: [VOICE_VERSION]
 		<panel label="Lisanslar" name="licenses_panel">
 			<text_editor name="credits_editor">
 				3Dconnexion SDK Telif Hakkı (C) 1992-2007 3Dconnexion
-APR Telif Hakkı (C) 2000-2004 The Apache Software Foundation
-Collada DOM Telif Hakkı 2005 Sony Computer Entertainment Inc.
-cURL Telif Hakkı (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
-DBus/dbus-glib Telif Hakkı (C) 2002, 2003  CodeFactory AB / Telif Hakkı (C) 2003, 2004 Red Hat, Inc.
-expat Telif Hakkı (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
-FreeType Telif Hakkı (C) 1996-2002, The FreeType Project (www.freetype.org).
-GL Telif Hakkı (C) 1999-2004 Brian Paul.
-GLOD Telif Hakkı (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University ve David Luebke, Brenden Schubert, University of Virginia.
-google-perftools Telif Hakkı (c) 2005, Google Inc.
-Havok.com(TM) Telif Hakkı (C) 1999-2001, Telekinesys Research Limited.
-jpeg2000 Telif Hakkı (C) 2001, David Taubman, The University of New South Wales (UNSW)
-jpeglib Telif Hakkı (C) 1991-1998, Thomas G. Lane.
-ogg/vorbis Telif Hakkı (C) 2001, Xiphophorus
-OpenSSL Telif Hakkı (C) 1998-2002 The OpenSSL Project.
-PCRE Telif Hakkı (c) 1997-2008 University of Cambridge
-SDL Telif Hakkı (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-SSLeay Telif Hakkı (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-xmlrpc-epi Telif Hakkı (C) 2000 Epinions, Inc.
-zlib Telif Hakkı (C) 1995-2002 Jean-loup Gailly ve Mark Adler.
-google-perftools Telif Hakkı (c) 2005, Google Inc.
+        APR Telif Hakkı (C) 2000-2004 The Apache Software Foundation
+        Collada DOM Telif Hakkı 2005 Sony Computer Entertainment Inc.
+        cURL Telif Hakkı (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se)
+        DBus/dbus-glib Telif Hakkı (C) 2002, 2003  CodeFactory AB / Telif Hakkı (C) 2003, 2004 Red Hat, Inc.
+        expat Telif Hakkı (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
+        FreeType Telif Hakkı (C) 1996-2002, The FreeType Project (www.freetype.org).
+        GL Telif Hakkı (C) 1999-2004 Brian Paul.
+        GLOD Telif Hakkı (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University ve David Luebke, Brenden Schubert, University of Virginia.
+        google-perftools Telif Hakkı (c) 2005, Google Inc.
+        Havok.com(TM) Telif Hakkı (C) 1999-2001, Telekinesys Research Limited.
+        jpeg2000 Telif Hakkı (C) 2001, David Taubman, The University of New South Wales (UNSW)
+        jpeglib Telif Hakkı (C) 1991-1998, Thomas G. Lane.
+        ogg/vorbis Telif Hakkı (C) 2001, Xiphophorus
+        OpenSSL Telif Hakkı (C) 1998-2002 The OpenSSL Project.
+        PCRE Telif Hakkı (c) 1997-2008 University of Cambridge
+        SDL Telif Hakkı (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
+        SSLeay Telif Hakkı (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+        xmlrpc-epi Telif Hakkı (C) 2000 Epinions, Inc.
+        zlib Telif Hakkı (C) 1995-2002 Jean-loup Gailly ve Mark Adler.
+        google-perftools Telif Hakkı (c) 2005, Google Inc.
 
-Second Life Görüntüleyicisi Havok (TM) Fizik motorunu kullanmaktadır. (c)Telif Hakkı 1999-2010 Havok.com Inc. (ve Lisans Verenleri). Tüm Hakları Saklıdır. Ayrıntılı bilgi için bkz. www.havok.com
+        Second Life Görüntüleyicisi Havok (TM) Fizik motorunu kullanmaktadır. (c)Telif Hakkı 1999-2010 Havok.com Inc. (ve Lisans Verenleri). Tüm Hakları Saklıdır. Ayrıntılı bilgi için bkz. www.havok.com
 
-Tüm hakları saklıdır.  Ayrıntılı bilgi için bkz. licenses.txt
+        Bu yazılımda NVIDIA Corporation tarafından sağlanan kaynak kod yer almaktadır.
 
-Sesli sohbet için Ses kodlaması: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
+        Tüm hakları saklıdır.  Ayrıntılı bilgi için bkz. licenses.txt
+
+        Sesli sohbet için Ses kodlaması: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C)
 			</text_editor>
 		</panel>
 	</tab_container>
diff --git a/indra/newview/skins/default/xui/tr/floater_about_land.xml b/indra/newview/skins/default/xui/tr/floater_about_land.xml
index e0350964b59..dde658d64d6 100644
--- a/indra/newview/skins/default/xui/tr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about_land.xml
@@ -129,7 +129,7 @@
 				Trafik:
 			</text>
 			<text name="DwellText">
-				0
+				Yükleniyor...
 			</text>
 			<button label="Arazi Satın Al" name="Buy Land..."/>
 			<button label="Linden Satışı" name="Linden Sale..." tool_tip="Arazinin sahip olunması, içeriğinin ayarlanması ve ihaleye çıkmamış olması gerekir"/>
@@ -307,13 +307,15 @@ Sadece büyük parseller aramada görünür.
 				İtme Yok (Bölge Geçersiz Kılma)
 			</panel.string>
 			<panel.string name="see_avs_text">
-				Parseldeki sakinleri gör ve onlarla sohbet et
+				DiÄŸer parsellerdeki avatarlar bu
 			</panel.string>
 			<text name="allow_label">
 				Sakinlere şunun için izin ver:
 			</text>
-			<check_box label="Yüzeyi Düzenle" name="edit land check" tool_tip="İşaretliyse herkes arazinizi şekillendirebilir. en iyisi bunu işaretlememektir, çünkü kendi arazinizi her zaman düzenleyebilirsiniz."/>
-			<check_box label="Uç" name="check fly" tool_tip="İşaretliyse Sakinler arazinizden uçabilir. İşaretli değilse, sadece arazinize ve arazinizin üzerinde uçabilir."/>
+			<text name="allow_label0">
+				Uçma:
+			</text>
+			<check_box label="Herkes" name="check fly" tool_tip="İşaretliyse Sakinler arazinizden uçabilir. İşaretli değilse, sadece arazinize ve arazinizin üzerinde uçabilir."/>
 			<text name="allow_label2">
 				Ä°nÅŸa Et:
 			</text>
@@ -329,9 +331,6 @@ Sadece büyük parseller aramada görünür.
 			</text>
 			<check_box label="Herkes" name="check other scripts"/>
 			<check_box label="Grup" name="check group scripts"/>
-			<text name="land_options_label">
-				Arazi Seçenekleri:
-			</text>
 			<check_box label="Güvenli (hasar yok)" name="check safe" tool_tip="İşaretliyse, araziyi Güvenli moda getirerek hasar çarpışmasını etkinsizleştirir İşaretli değilse hasar çarpışması etkinleşir."/>
 			<check_box label="İtme Yok" name="PushRestrictCheck" tool_tip="Komut dosyalarının itmesini önler Bu seçeneğin işaretlenmesi arazinizdeki bozucu davranışları önlemeye yardımcı olabilir."/>
 			<check_box label="Konumu Arama sonuçlarında göster (L$30/hafta)" name="ShowDirectoryCheck" tool_tip="Arama sonuçlarında bu parsel görünsün"/>
@@ -372,9 +371,9 @@ Sadece büyük parseller aramada görünür.
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Bir resim seçmek için tıklayın"/>
 			<text name="allow_label5">
-				Diğer parsel Sakinlerine şunun için izin verin:
+				bu parseldeki avatarları görebilir ve onlarla sohbet edebilir
 			</text>
-			<check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki sakinlerin bu parseldeki sakinleri görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/>
+			<check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki avatarların bu parseldeki avatarları görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/>
 			<text name="landing_point">
 				İniş Noktası: [LANDING]
 			</text>
diff --git a/indra/newview/skins/default/xui/tr/floater_avatar.xml b/indra/newview/skins/default/xui/tr/floater_avatar.xml
index fc9e3c8a9b5..c6b14ba7105 100644
--- a/indra/newview/skins/default/xui/tr/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/tr/floater_avatar.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Avatar" title="AVATAR SEÇİCİ"/>
+<floater name="Avatar" title="BİR AVATAR SEÇİN"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
index 6608fd72e10..d90985dcffe 100644
--- a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml
@@ -46,7 +46,7 @@
 		L$ [AMT]
 	</text>
 	<text name="currency_links">
-		[http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi
+		[http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi]
 	</text>
 	<text name="exchange_rate_note">
 		En son döviz kurunu görmek için miktarı yeniden girin.
diff --git a/indra/newview/skins/default/xui/tr/floater_camera.xml b/indra/newview/skins/default/xui/tr/floater_camera.xml
index c92d4e9db49..22e2aa52c6b 100644
--- a/indra/newview/skins/default/xui/tr/floater_camera.xml
+++ b/indra/newview/skins/default/xui/tr/floater_camera.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="camera_floater" title="GÖSTER">
+<floater name="camera_floater" title="KAMERA DENETÄ°MLERÄ°">
 	<floater.string name="rotate_tooltip">
 		Odak Etrafında Kamerayı Döndür
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml b/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml
index 12927dcaebb..8e056b9b0d0 100644
--- a/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml
@@ -4,8 +4,8 @@
 		Filtreleme:
 	</text>
 	<check_box label="Anisotropik Filtreleme (etkinken daha yavaÅŸ)" name="ani"/>
-	<text name="Antialiasing:">
-		Antialiasing:
+	<text name="antialiasing label">
+		Düzgünleştirme:
 	</text>
 	<combo_box label="Antialiasing" name="fsaa">
 		<combo_box.item label="Devre dışı" name="FSAADisabled"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_model_preview.xml b/indra/newview/skins/default/xui/tr/floater_model_preview.xml
index 339545f96e9..0c7cabc6ea3 100644
--- a/indra/newview/skins/default/xui/tr/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/tr/floater_model_preview.xml
@@ -4,6 +4,9 @@
 	<string name="status_parse_error">
 		Hata: Tarih ayrıştırma sorunu - ayrıntılar için günlüğe bakın.
 	</string>
+	<string name="status_material_mismatch">
+		Hata: Modelin malzemesi, referans modelin bir alt kümesi değil.
+	</string>
 	<string name="status_reading_file">
 		Yükleniyor...
 	</string>
diff --git a/indra/newview/skins/default/xui/tr/floater_model_wizard.xml b/indra/newview/skins/default/xui/tr/floater_model_wizard.xml
index 108d20cfac4..b3c72ba2da4 100644
--- a/indra/newview/skins/default/xui/tr/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/tr/floater_model_wizard.xml
@@ -20,6 +20,9 @@
 				Karşıya yüklenecek model dosyasını seçin
 			</text>
 			<button label="Gözat..." label_selected="Gözat..." name="browse"/>
+			<text name="Model types">
+				Second Life, COLLADA (.dae) dosyalarını destekler
+			</text>
 			<text name="dimensions">
 				X         Y         Z
 			</text>
diff --git a/indra/newview/skins/default/xui/tr/floater_moveview.xml b/indra/newview/skins/default/xui/tr/floater_moveview.xml
index 74ed613a62a..9226218a240 100644
--- a/indra/newview/skins/default/xui/tr/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/tr/floater_moveview.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="move_floater" title="HAREKET ET">
+<floater name="move_floater" title="YÜRÜ / KOŞ / UÇ">
 	<string name="walk_forward_tooltip">
 		İleri Yürü (Yukarı Okuna veya W&apos;ye basın)
 	</string>
diff --git a/indra/newview/skins/default/xui/tr/floater_snapshot.xml b/indra/newview/skins/default/xui/tr/floater_snapshot.xml
index 492ec4b5886..fa51f15d16a 100644
--- a/indra/newview/skins/default/xui/tr/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/tr/floater_snapshot.xml
@@ -3,72 +3,63 @@
 	<floater.string name="unknown">
 		bilinmiyor
 	</floater.string>
-	<radio_group label="Anlık görüntü türü" name="snapshot_type_radio">
-		<radio_item label="E-posta" name="postcard"/>
-		<radio_item label="Envanterim (L$[AMOUNT])" name="texture"/>
-		<radio_item label="Bilgisayarıma kaydet" name="local"/>
-	</radio_group>
+	<string name="postcard_progress_str">
+		E-posta Gönderiliyor
+	</string>
+	<string name="profile_progress_str">
+		Yayınlanıyor
+	</string>
+	<string name="inventory_progress_str">
+		Envantere Kaydediliyor
+	</string>
+	<string name="local_progress_str">
+		Bilgisayara Kaydediliyor
+	</string>
+	<string name="profile_succeeded_str">
+		Görüntü yüklendi
+	</string>
+	<string name="postcard_succeeded_str">
+		E-posta Gönderildi!
+	</string>
+	<string name="inventory_succeeded_str">
+		Envantere Kaydedildi!
+	</string>
+	<string name="local_succeeded_str">
+		Bilgisayara Kaydedildi!
+	</string>
+	<string name="profile_failed_str">
+		Görüntü Profil Akışınıza yüklenemedi.
+	</string>
+	<string name="postcard_failed_str">
+		E-posta gönderilemedi.
+	</string>
+	<string name="inventory_failed_str">
+		Envantere kaydedilemedi.
+	</string>
+	<string name="local_failed_str">
+		Bilgisayara kaydedilemedi.
+	</string>
+	<button name="advanced_options_btn" tool_tip="Gelişmiş seçenekler"/>
+	<text name="image_res_text">
+		[WIDTH] x [HEIGHT] px
+	</text>
 	<text name="file_size_label">
 		[SIZE] KB
 	</text>
-	<button label="Gönder" name="send_btn"/>
-	<button label="Kaydet (L$[AMOUNT])" name="upload_btn"/>
-	<flyout_button label="Kaydet" name="save_btn" tool_tip="Görüntüyü bir dosyaya kaydet">
-		<flyout_button.item label="Kaydet" name="save_item"/>
-		<flyout_button.item label="Farklı Kaydet..." name="saveas_item"/>
-	</flyout_button>
-	<button label="Daha Fazla" name="more_btn" tool_tip="Gelişmiş seçenekler"/>
-	<button label="Daha Az" name="less_btn" tool_tip="Gelişmiş seçenekler"/>
-	<button label="Ä°ptal" name="discard_btn"/>
-	<text name="type_label2">
-		Büyüklük
-	</text>
-	<text name="format_label">
-		Format
-	</text>
-	<combo_box label="Çözünürlük" name="postcard_size_combo">
-		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="Özel" name="Custom"/>
-	</combo_box>
-	<combo_box label="Çözünürlük" name="texture_size_combo">
-		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
-		<combo_box.item label="Küçük (128x128)" name="Small(128x128)"/>
-		<combo_box.item label="Orta (256x256)" name="Medium(256x256)"/>
-		<combo_box.item label="Büyük (512x512)" name="Large(512x512)"/>
-		<combo_box.item label="Özel" name="Custom"/>
-	</combo_box>
-	<combo_box label="Çözünürlük" name="local_size_combo">
-		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
-		<combo_box.item label="320x240" name="320x240"/>
-		<combo_box.item label="640x480" name="640x480"/>
-		<combo_box.item label="800x600" name="800x600"/>
-		<combo_box.item label="1024x768" name="1024x768"/>
-		<combo_box.item label="1280x1024" name="1280x1024"/>
-		<combo_box.item label="1600x1200" name="1600x1200"/>
-		<combo_box.item label="Özel" name="Custom"/>
-	</combo_box>
-	<combo_box label="Format" name="local_format_combo">
-		<combo_box.item label="PNG" name="PNG"/>
-		<combo_box.item label="JPEG" name="JPEG"/>
-		<combo_box.item label="BMP" name="BMP"/>
-	</combo_box>
-	<spinner label="GeniÅŸlik" name="snapshot_width"/>
-	<spinner label="Yükseklik" name="snapshot_height"/>
-	<check_box label="Oranları Koru" name="keep_aspect_check"/>
-	<slider label="Görüntü kalitesi" name="image_quality_slider"/>
-	<text name="layer_type_label">
-		Yakala:
-	</text>
-	<combo_box label="Görüntü Katmanları" name="layer_types">
-		<combo_box.item label="Renkler" name="Colors"/>
-		<combo_box.item label="Derinlik" name="Depth"/>
-	</combo_box>
-	<check_box label="Arayüz" name="ui_check"/>
-	<check_box label="BÃœG&apos;ler" name="hud_check"/>
-	<check_box label="Kaydettikten sonra açık tut" name="keep_open_check"/>
-	<check_box label="Kare dondur (tam ekran)" name="freeze_frame_check"/>
-	<check_box label="Otomatik yenile" name="auto_snapshot_check"/>
+	<panel name="advanced_options_panel">
+		<text name="advanced_options_label">
+			GELİŞMİŞ SEÇENEKLER
+		</text>
+		<text name="layer_type_label">
+			Yakala:
+		</text>
+		<combo_box label="Görüntü Katmanları" name="layer_types">
+			<combo_box.item label="Renkler" name="Colors"/>
+			<combo_box.item label="Derinlik" name="Depth"/>
+		</combo_box>
+		<check_box label="Arayüz" name="ui_check"/>
+		<check_box label="BÃœG&apos;ler" name="hud_check"/>
+		<check_box label="Kare dondur (tam ekran)" name="freeze_frame_check"/>
+		<check_box label="Otomatik yenile" name="auto_snapshot_check"/>
+	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_toybox.xml b/indra/newview/skins/default/xui/tr/floater_toybox.xml
index 05d3633df07..e60e1766439 100644
--- a/indra/newview/skins/default/xui/tr/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/tr/floater_toybox.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Toybox" title="ARAÇ ÇUBUKLARINI ÖZELLEŞTİR">
+<floater name="Toybox" title="ARAÇ ÇUBUĞU DÜĞMELERİ">
 	<text name="toybox label 1">
 		Düğmeleri araç çubuklarına veya araç çubuklarından sürükleyerek ekleyin ya da kaldırın.
 	</text>
 	<text name="toybox label 2">
 		Her bir araç çubuğunun ayarına göre düğmeler gösterilir veya sadece simgeleri yer alır.
 	</text>
+	<button label="Tüm araç çubuklarını temizle" label_selected="Tüm araç çubuklarını temizle" name="btn_clear_all"/>
 	<button label="Varsayılanları geri yükle" label_selected="Varsayılanları geri yükle" name="btn_restore_defaults"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_translation_settings.xml b/indra/newview/skins/default/xui/tr/floater_translation_settings.xml
new file mode 100644
index 00000000000..33ce76bd9a6
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_translation_settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_translation_settings" title="SOHBET ÇEVİRİSİ AYARLARI">
+	<string name="bing_api_key_not_verified">
+		Bing uygulama kimliği doğrulanmadı. Lütfen tekrar deneyin.
+	</string>
+	<string name="google_api_key_not_verified">
+		Google API anahtarı doğrulanmadı. Lütfen tekrar deneyin.
+	</string>
+	<string name="bing_api_key_verified">
+		Bing uygulama kimliği doğrulandı.
+	</string>
+	<string name="google_api_key_verified">
+		Google API anahtarı doğrulandı.
+	</string>
+	<check_box label="Sohbet ederken makine çevirisini etkinleştirin" name="translate_chat_checkbox"/>
+	<text name="translate_language_label">
+		Sohbeti şu dile çevir:
+	</text>
+	<combo_box name="translate_language_combo">
+		<combo_box.item label="Sistem Varsayılanı" name="System Default Language"/>
+		<combo_box.item label="Ä°ngilizce" name="English"/>
+		<combo_box.item label="Dansk (Danca)" name="Danish"/>
+		<combo_box.item label="Deutsch (Almanca)" name="German"/>
+		<combo_box.item label="Español (İspanyolca)" name="Spanish"/>
+		<combo_box.item label="Français (Fransızca)" name="French"/>
+		<combo_box.item label="Italiano (Ä°talyanca)" name="Italian"/>
+		<combo_box.item label="Magyar (Macarca)" name="Hungarian"/>
+		<combo_box.item label="Nederlands (Flemenkçe)" name="Dutch"/>
+		<combo_box.item label="Polski (Lehçe)" name="Polish"/>
+		<combo_box.item label="Português (Portekizce)" name="Portugese"/>
+		<combo_box.item label="Русский (Rusça)" name="Russian"/>
+		<combo_box.item label="Türkçe (Türkçe)" name="Turkish"/>
+		<combo_box.item label="Українська (Ukraynaca)" name="Ukrainian"/>
+		<combo_box.item label="中文 (正體) (Çince)" name="Chinese"/>
+		<combo_box.item label="日本語 (Japonca)" name="Japanese"/>
+		<combo_box.item label="한국어 (Korece)" name="Korean"/>
+	</combo_box>
+	<text name="tip">
+		Çeviri hizmetini seçin:
+	</text>
+	<radio_group name="translation_service_rg">
+		<radio_item initial_value="bing" label="Bing Çevirmeni" name="bing"/>
+		<radio_item initial_value="google" label="Google Translate" name="google"/>
+	</radio_group>
+	<text name="bing_api_key_label">
+		Bing [http://www.bing.com/developers/createapp.aspx Uygulama KimliÄŸi]:
+	</text>
+	<button label="DoÄŸrula" name="verify_bing_api_key_btn"/>
+	<text name="google_api_key_label">
+		Google [http://code.google.com/apis/language/translate/v2/getting_started.html#auth API anahtarı]:
+	</text>
+	<button label="DoÄŸrula" name="verify_google_api_key_btn"/>
+	<text name="google_links_text">
+		[http://code.google.com/apis/language/translate/v2/pricing.html Fiyatlandırma] | [https://code.google.com/apis/console İstatistikler]
+	</text>
+	<button label="Tamam" name="ok_btn"/>
+	<button label="Ä°ptal" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_voice_controls.xml b/indra/newview/skins/default/xui/tr/floater_voice_controls.xml
index dac05d83273..5ff0804f177 100644
--- a/indra/newview/skins/default/xui/tr/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/tr/floater_voice_controls.xml
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_voice_controls" title="SES DENETÄ°MLERÄ°">
 	<string name="title_nearby">
-		Yakındaki ses
+		SES AYARLARI
 	</string>
 	<string name="title_group">
-		[GROUP] ile grup araması
+		[GROUP] Ä°LE GRUP ARAMASI
 	</string>
 	<string name="title_adhoc">
-		Konferans araması
+		KONFERANS ARAMASI
 	</string>
 	<string name="title_peer_2_peer">
-		[NAME] ile arama
+		[NAME] Ä°LE ARAMA
 	</string>
 	<string name="no_one_near">
 		Yakındaki kimsede ses etkin değil
diff --git a/indra/newview/skins/default/xui/tr/menu_toolbars.xml b/indra/newview/skins/default/xui/tr/menu_toolbars.xml
index 7cb3192ec49..c8523a6ec94 100644
--- a/indra/newview/skins/default/xui/tr/menu_toolbars.xml
+++ b/indra/newview/skins/default/xui/tr/menu_toolbars.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Toolbars Popup">
-	<menu_item_call label="Düğmeleri seç..." name="Chose Buttons"/>
+	<menu_item_call label="Bu düğmeyi kaldır" name="Remove button"/>
+	<menu_item_call label="Araç çubuğu düğmeleri..." name="Choose Buttons"/>
 	<menu_item_check label="Simgeler ve etiketler" name="icons_with_text"/>
 	<menu_item_check label="Sadece simgeler" name="icons_only"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index 75294e38d5b..ef10d639d77 100644
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="Ben" name="Me">
-		<menu_item_call label="Kontrol Paneli..." name="Manage My Account"/>
 		<menu_item_call label="Profil..." name="Profile"/>
 		<menu_item_call label="Görünüm..." name="ChangeOutfit"/>
+		<menu_item_call label="Bir avatar seçin..." name="Avatar Picker"/>
 		<menu_item_check label="Envanter..." name="Inventory"/>
-		<menu_item_check label="Mimikler..." name="Gestures"/>
-		<menu_item_check label="Ses..." name="ShowVoice"/>
+		<menu_item_call label="Yeni Envanter Penceresi" name="NewInventoryWindow"/>
+		<menu_item_call label="Yerler..." name="Places"/>
+		<menu_item_call label="Favoriler..." name="Picks"/>
+		<menu_item_call label="Kamera Denetimleri..." name="Camera Controls"/>
 		<menu label="Hareket" name="Movement">
 			<menu_item_call label="Otur" name="Sit Down Here"/>
 			<menu_item_check label="Uç" name="Fly"/>
@@ -20,34 +22,37 @@
 		<menu_item_call label="Yönetici Durumu Talep Et" name="Request Admin Options"/>
 		<menu_item_call label="Yönetici Durumundan Ayrıl" name="Leave Admin Options"/>
 		<menu_item_call label="L$ Satın Al" name="Buy and Sell L$"/>
+		<menu_item_call label="Hesap kontrol paneli..." name="Manage My Account"/>
 		<menu_item_call label="Tercihler..." name="Preferences"/>
-		<menu_item_call label="Araç çubukları..." name="Toolbars"/>
+		<menu_item_call label="Araç çubuğu düğmeleri..." name="Toolbars"/>
 		<menu_item_call label="Tüm denetimleri sakla" name="Hide UI"/>
 		<menu_item_call label="[APP_NAME]&apos;den Çık" name="Quit"/>
 	</menu>
 	<menu label="Ä°letiÅŸim Kur" name="Communicate">
-		<menu_item_call label="Arkadaşlarım" name="My Friends"/>
-		<menu_item_call label="Gruplarım" name="My Groups"/>
-		<menu_item_check label="Yakındaki Sohbet" name="Nearby Chat"/>
-		<menu_item_call label="Yakındaki Kişiler" name="Active Speakers"/>
-		<menu_item_check label="Yakındaki Ses" name="Nearby Voice"/>
+		<menu_item_check label="Sohbet..." name="Nearby Chat"/>
+		<menu_item_check label="KonuÅŸ" name="Speak"/>
+		<menu_item_check label="Ses ayarları..." name="Nearby Voice"/>
+		<menu_item_check label="Ses ÅŸekillendirme..." name="ShowVoice"/>
+		<menu_item_check label="Mimikler..." name="Gestures"/>
+		<menu_item_call label="ArkadaÅŸlar" name="My Friends"/>
+		<menu_item_call label="Gruplar" name="My Groups"/>
+		<menu_item_call label="Yakındaki kişiler" name="Active Speakers"/>
 	</menu>
 	<menu label="Dünya" name="World">
+		<menu_item_call label="Bu Yeri Yer Ä°mlerine Ekle" name="Create Landmark Here"/>
+		<menu_item_call label="Hedef Konumlar..." name="Destinations"/>
+		<menu_item_check label="Dünya haritası" name="World Map"/>
 		<menu_item_check label="Mini-harita" name="Mini-Map"/>
-		<menu_item_check label="Dünya Haritası" name="World Map"/>
 		<menu_item_check label="Ara" name="Search"/>
+		<menu_item_call label="Ana konuma ışınlan" name="Teleport Home"/>
+		<menu_item_call label="Ana konumu burası olarak seç" name="Set Home to Here"/>
 		<menu_item_call label="Anlık Görüntü" name="Take Snapshot"/>
-		<menu_item_call label="Bu Yeri Yer Ä°mlerine Ekle" name="Create Landmark Here"/>
-		<menu label="Profili YerleÅŸtir" name="Land">
-			<menu_item_call label="Profili YerleÅŸtir" name="Place Profile"/>
-			<menu_item_call label="Arazi Hakkında" name="About Land"/>
-			<menu_item_call label="Bölge/Gayrimenkul" name="Region/Estate"/>
-		</menu>
-		<menu_item_call label="Bu Araziyi Satın Al" name="Buy Land"/>
-		<menu_item_call label="Arazim" name="My Land"/>
+		<menu_item_call label="Profili yerleÅŸtir" name="Place Profile"/>
+		<menu_item_call label="Arazi hakkında" name="About Land"/>
+		<menu_item_call label="Bölge / Gayrimenkul" name="Region/Estate"/>
+		<menu_item_call label="Sahip olduğum arazi parçaları..." name="My Land"/>
+		<menu_item_call label="Bu araziyi satın al" name="Buy Land"/>
 		<menu label="Göster" name="LandShow">
-			<menu_item_check label="Denetimleri Hareket Ettir" name="Movement Controls"/>
-			<menu_item_check label="Denetimleri Göster" name="Camera Controls"/>
 			<menu_item_check label="Yasaklama Çizgileri" name="Ban Lines"/>
 			<menu_item_check label="Ä°ÅŸaretler" name="beacons"/>
 			<menu_item_check label="Mülkiyet Çizgileri" name="Property Lines"/>
@@ -56,16 +61,15 @@
 			<menu_item_check label="Parsel Özellikleri" name="Parcel Properties"/>
 			<menu_item_check label="Gelişmiş Menü" name="Show Advanced Menu"/>
 		</menu>
-		<menu_item_call label="Ana Konuma Işınla" name="Teleport Home"/>
-		<menu_item_call label="Ana Konumu Burası Olarak Seç" name="Set Home to Here"/>
 		<menu label="Güneş" name="Environment Settings">
 			<menu_item_call label="Gün Doğumu" name="Sunrise"/>
 			<menu_item_call label="Gün Ortası" name="Noon"/>
 			<menu_item_call label="Gün Batımı" name="Sunset"/>
 			<menu_item_call label="Gece Yarısı" name="Midnight"/>
+			<menu_item_call label="Bölge Ayarlarını Kullanın" name="Use Region Settings"/>
 		</menu>
-		<menu label="Ortam Düzenleyici" name="Enviroment Editor">
-			<menu_item_call label="Ortam Ayarları..." name="Enviroment Settings"/>
+		<menu label="Ortam Düzenleyici" name="Environment Editor">
+			<menu_item_call label="Ortam Ayarları..." name="Environment Settings"/>
 			<menu label="Su Ön Ayarları" name="Water Presets">
 				<menu_item_call label="Yeni ön ayar..." name="new_water_preset"/>
 				<menu_item_call label="Ön ayarı düzenle..." name="edit_water_preset"/>
@@ -144,6 +148,7 @@
 		<menu_item_call label="Yinele" name="Redo"/>
 	</menu>
 	<menu label="Yardım" name="Help">
+		<menu_item_call label="Nasıl yapılır..." name="How To"/>
 		<menu_item_call label="[SECOND_LIFE] Yardımı" name="Second Life Help"/>
 		<menu_item_call label="Kötüye Kullanımı Bildir" name="Report Abuse"/>
 		<menu_item_call label="Hata Bildir" name="Report Bug"/>
@@ -198,11 +203,10 @@
 		<menu_item_check label="İş Parçacığı Okuma Eklentisini Kullan" name="Use Plugin Read Thread"/>
 		<menu_item_call label="Grup Ön Belleğini Temizle" name="ClearGroupCache"/>
 		<menu_item_check label="Fare Düzleştirme" name="Mouse Smoothing"/>
+		<menu_item_call label="Bırakma Anahtarları" name="Release Keys"/>
 		<menu label="Kısa Yollar" name="Shortcuts">
 			<menu_item_call label="Görüntü (L$[COST])..." name="Upload Image"/>
 			<menu_item_check label="Ara" name="Search"/>
-			<menu_item_call label="Bırakma Anahtarları" name="Release Keys"/>
-			<menu_item_call label="KA Büyüklüğünü Varsayılana Ayarla" name="Set UI Size to Default"/>
 			<menu_item_check label="Gelişmiş Menüyü Göster - eski kısayol" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Pencereyi Kapat" name="Close Window"/>
 			<menu_item_call label="Tüm Pencereleri Kapat" name="Close All Windows"/>
@@ -288,6 +292,7 @@
 			<menu_item_check label="Işıklar" name="Lights"/>
 			<menu_item_check label="Çarpışma İskeleti" name="Collision Skeleton"/>
 			<menu_item_check label="Işın Yayını" name="Raycast"/>
+			<menu_item_check label="Rüzgar Vektörleri" name="Wind Vectors"/>
 			<menu_item_check label="İşleme Karmaşıklığı" name="rendercomplexity"/>
 			<menu_item_check label="Åžekillendir" name="Sculpt"/>
 		</menu>
@@ -300,7 +305,6 @@
 			<menu_item_check label="Işıklandırma ve Gölgeler" name="Lighting and Shadows"/>
 			<menu_item_check label="Güneş/Ay/Projektörlerden Gelen Gölgeler" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO ve Gölge Yumuşatma" name="SSAO and Shadow Smoothing"/>
-			<menu_item_check label="Küresel Aydınlatma (Deneysel)" name="Global Illumination"/>
 			<menu_item_check label="GL Hata Ayıklama" name="Debug GL"/>
 			<menu_item_check label="Ardışık Hata Ayıklama" name="Debug Pipeline"/>
 			<menu_item_check label="Otomatik Alfa Maskeleri (ertelenmiÅŸ)" name="Automatic Alpha Masks (deferred)"/>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index c0dc67ed345..631634aa7d1 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -1110,8 +1110,13 @@ Arazinin satış bedeli sahibine geri ödenmez. Devredilen bir parsel satılırs
 	<notification name="DisplaySetToSafe">
 		Güvenli seçeneği seçtiğiniz için görüntüleme ayarları güvenli düzeye ayarlandı.
 	</notification>
-	<notification name="DisplaySetToRecommended">
-		Görüntüleme ayarları sistem yapılandırmanız için önerilen düzeye ayarlandı.
+	<notification name="DisplaySetToRecommendedGPUChange">
+		Grafik kartınız değiştiği için görüntü ayarları tavsiye edilen seviyelere ayarlandı
+önceki: &apos;[LAST_GPU]&apos;
+sonraki: &apos;[THIS_GPU]&apos;
+	</notification>
+	<notification name="DisplaySetToRecommendedFeatureChange">
+		İşleme alt sistemindeki bir değişiklik nedeniyle görüntü ayarları tavsiye edilen seviyelere ayarlandı.
 	</notification>
 	<notification name="ErrorMessage">
 		[ERROR_MESSAGE]
@@ -1910,7 +1915,13 @@ Envanter öğesi/öğeleri taşınsın mı?
 		<usetemplate ignoretext="Çıkmadan önce doğrulama iste" name="okcancelignore" notext="Çıkma" yestext="Çık"/>
 	</notification>
 	<notification name="ConfirmRestoreToybox">
-		Varsayılan düğmelerinizi ve araç çubuklarınızı geri yüklemek istediğinize emin misiniz? 
+		Bu eylem, varsayılan düğmelerinizi ve araç çubuklarınızı geri yükleyecek.
+
+Bu eylemi geri alamazsınız.
+		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
+	</notification>
+	<notification name="ConfirmClearAllToybox">
+		Bu eylem ile tüm düğmeler araç kutusuna döner ve araç çubuklarınız boş olur.
     
 Bu eylemi geri alamazsınız.
 		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
@@ -2119,10 +2130,10 @@ Bu adımda web tarayıcınızın başlatılacağına dikkat edin.
 		Konu: [SUBJECT], Ä°leti: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; Çevrimiçi
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; çevrimiçi
 	</notification>
 	<notification name="FriendOffline">
-		&lt;nolink&gt;[NAME]&lt;/nolink&gt; Çevrimdışı
+		&lt;nolink&gt;[NAME]&lt;/nolink&gt; çevrimdışı
 	</notification>
 	<notification name="AddSelfFriend">
 		Çok iyi biri olduğunuza eminiz fakat kendinizi arkadaş olarak ekleyemezsiniz.
@@ -2236,14 +2247,16 @@ Lütfen tek bir nesne seçin.
 		Arama kartınız reddedildi.
 	</notification>
 	<notification name="TeleportToLandmark">
-		Ekranınızın sağ tarafındaki Yerler panelini açıp Yer İmleri sekmesini seçerek &apos;[NAME]&apos; gibi konumlara ışınlanabilirsiniz.
-Seçmek için herhangi bir yer iminin üzerini tıklatın ve ardından panelin en altındaki &apos;Işınla&apos; düğmesini tıklatın.
-(Yer iminin üzerini çift tıklatabilir veya sağ tıklayıp &apos;Işınla&apos;yı seçebilirsiniz.)
+		&apos;[NAME]&apos; gibi konumlara ışınlanmak için &quot;Yerler&quot; düğmesine tıklayın,
+    sonra açılan pencerede Yer İmleri sekmesini seçin. Herhangi bir
+    yer iminin üzerine tıklayarak bunu seçin ve ardından pencerenin en altındaki &apos;Işınla&apos; düğmesine tıklayın.
+    (Ayrıca yer imine çift tıklayabilir veya sağ tıklayarak
+    &apos;Işınla&apos; seçimini yapabilirsiniz.)
 	</notification>
 	<notification name="TeleportToPerson">
-		Ekranınızın sağ tarafındaki İnsanlar panelini açarak  &apos;[NAME]&apos; gibi Sakinler ile iletişim kurabilirsiniz.
-Sakini listeden seçin ve  panelin altındaki &apos;Aİ&quot; düğmesini tıklatın.
-(Listede adlarını çift tıklatarak veya sağ tıklatıp &quot;Aİ&quot;yi seçerek de bunu yapabilirsiniz.)
+		&apos;[NAME]&apos; gibi sakinlerle bağlantıya geçmek için &quot;Kişiler&quot; düğmesine tıklayın, açılan pencereden bir Sakin seçin ve sonra
+    pencerenin altında &apos;Anlık İleti&quot; üzerine tıklayın.
+    (Listede adlarına çift tıklayarak veya sağ tıklayıp &quot;Anlık İleti&quot;yi seçerek de bunu yapabilirsiniz.)
 	</notification>
 	<notification name="CantSelectLandFromMultipleRegions">
 		Sunucunun sınırları dışındaki arazi seçilemez.
@@ -2264,6 +2277,9 @@ Daha küçük bir arazi parçası seçmeyi deneyin.
 	<notification name="PaymentSent">
 		[MESSAGE]
 	</notification>
+	<notification name="PaymentFailure">
+		[MESSAGE]
+	</notification>
 	<notification name="EventNotification">
 		Etkinlik Bildirimi
 
diff --git a/indra/newview/skins/default/xui/tr/panel_edit_skin.xml b/indra/newview/skins/default/xui/tr/panel_edit_skin.xml
index 33fb787e086..fdf75100ed9 100644
--- a/indra/newview/skins/default/xui/tr/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/tr/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Baş Dövmeleri" name="Head Tattoos" tool_tip="Bir resim seçmek için tıklayın"/>
-		<texture_picker label="Üst Gövde Dövmeleri" name="Upper Tattoos" tool_tip="Bir resim seçmek için tıklayın"/>
-		<texture_picker label="Alt Gövde Dövmeleri" name="Lower Tattoos" tool_tip="Bir resim seçmek için tıklayın"/>
+		<texture_picker label="Baş" name="Head" tool_tip="Bir resim seçmek için tıklayın"/>
+		<texture_picker label="Üst gövde" name="Upper Body" tool_tip="Bir resim seçmek için tıklayın"/>
+		<texture_picker label="Alt gövde" name="Lower Body" tool_tip="Bir resim seçmek için tıklayın"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/tr/panel_postcard_message.xml b/indra/newview/skins/default/xui/tr/panel_postcard_message.xml
new file mode 100644
index 00000000000..2361f4c1c3e
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_postcard_message.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_message">
+	<text name="to_label">
+		Kime:
+	</text>
+	<text name="name_label">
+		Kimden:
+	</text>
+	<text name="subject_label">
+		Konu:
+	</text>
+	<line_editor label="Konunuzu buraya yazın." name="subject_form"/>
+	<text name="msg_label">
+		Ä°leti:
+	</text>
+	<text_editor name="msg_form">
+		İletinizi buraya yazın.
+	</text_editor>
+	<button label="Ä°ptal" name="cancel_btn"/>
+	<button label="Gönder" name="send_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_postcard_settings.xml b/indra/newview/skins/default/xui/tr/panel_postcard_settings.xml
new file mode 100644
index 00000000000..bce0b21b9a6
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_postcard_settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_postcard_settings">
+	<combo_box label="Çözünürlük" name="postcard_size_combo">
+		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Özel" name="Custom"/>
+	</combo_box>
+	<layout_stack name="postcard_image_params_ls">
+		<layout_panel name="postcard_image_size_lp">
+			<spinner label="GeniÅŸlik" name="postcard_snapshot_width"/>
+			<spinner label="Yükseklik" name="postcard_snapshot_height"/>
+			<check_box label="Oranları koru" name="postcard_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="postcard_image_format_quality_lp">
+			<slider label="Görüntü kalitesi" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
index f7f0698a318..9caf95a122d 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
@@ -29,29 +29,5 @@
 	<check_box label="Aİ Sohbetleri" name="EnableIMChatPopups" tool_tip="Bir anlık ileti geldiğinde açılır pencereleri görmek için işaretle"/>
 	<spinner label="Yakındaki sohbet iletilerinin vurgulanma süresi:" name="nearby_toasts_lifetime"/>
 	<spinner label="Yakındaki sohbet iletilerinin sönme süresi:" name="nearby_toasts_fadingtime"/>
-	<text name="translate_chb_label">
-		Sohbet ederken makine çevirisi kullanılsın
-	</text>
-	<text name="translate_language_text">
-		Sohbeti şu dile çevir:
-	</text>
-	<combo_box name="translate_language_combobox">
-		<combo_box.item label="Sistem Varsayılanı" name="System Default Language"/>
-		<combo_box.item label="Ä°ngilizce" name="English"/>
-		<combo_box.item label="Dansk (Danca)" name="Danish"/>
-		<combo_box.item label="Deutsch (Almanca)" name="German"/>
-		<combo_box.item label="Español (İspanyolca)" name="Spanish"/>
-		<combo_box.item label="Français (Fransızca)" name="French"/>
-		<combo_box.item label="Italiano (Ä°talyanca)" name="Italian"/>
-		<combo_box.item label="Magyar (Macarca)" name="Hungarian"/>
-		<combo_box.item label="Nederlands (Flemenkçe)" name="Dutch"/>
-		<combo_box.item label="Polski (Lehçe)" name="Polish"/>
-		<combo_box.item label="Português (Portekizce)" name="Portugese"/>
-		<combo_box.item label="Русский (Rusça)" name="Russian"/>
-		<combo_box.item label="Türkçe (Türkçe)" name="Turkish"/>
-		<combo_box.item label="Українська (Ukraynaca)" name="Ukrainian"/>
-		<combo_box.item label="中文 (正體) (Çince)" name="Chinese"/>
-		<combo_box.item label="日本語 (Japonca)" name="Japanese"/>
-		<combo_box.item label="한국어 (Korece)" name="Korean"/>
-	</combo_box>
+	<button label="Sohbet Çevirisi Ayarları" name="ok_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml
index 12c175b8f53..9d03d9b01d6 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Tarayıcımı kullan (IE, Firefox, Safari)" name="external" tool_tip="Yardım, web bağlantıları vs. için sistemin varsayılan web tarayıcısını kullanın. Tam ekran çalıştırılıyorsa tavsiye edilmez." value="1"/>
+		<radio_item label="Tarayıcımı kullan (IE, Firefox, Safari)" name="external" tool_tip="Yardım, web bağlantıları vs. için sistemin varsayılan web tarayıcısını kullanın. Tam ekran çalıştırılıyorsa tavsiye edilmez." value="true"/>
 		<radio_item label="Yerleşik tarayıcıyı kullan" name="internal" tool_tip="Yardım, web bağlantıları vs. için dahili web tarayıcısını kullanın. Bu tarayıcı [APP_NAME] içerisinde yeni bir pencere olarak açılır." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Eklentileri etkinleÅŸtir" name="browser_plugins_enabled"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
new file mode 100644
index 00000000000..e3b22c639a6
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_inventory">
+	<text name="title">
+		Envanterime Kaydet
+	</text>
+	<text name="hint_lbl">
+		Bir görüntüyü envanterinize kaydetmenin maliyeti L$[UPLOAD_COST] olur. Görüntünüzü bir doku olarak kaydetmek için kare formatlardan birini seçin.
+	</text>
+	<combo_box label="Çözünürlük" name="texture_size_combo">
+		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+		<combo_box.item label="Küçük (128x128)" name="Small(128x128)"/>
+		<combo_box.item label="Orta (256x256)" name="Medium(256x256)"/>
+		<combo_box.item label="Büyük (512x512)" name="Large(512x512)"/>
+		<combo_box.item label="Özel" name="Custom"/>
+	</combo_box>
+	<spinner label="GeniÅŸlik" name="inventory_snapshot_width"/>
+	<spinner label="Yükseklik" name="inventory_snapshot_height"/>
+	<check_box label="Oranları koru" name="inventory_keep_aspect_check"/>
+	<button label="Ä°ptal" name="cancel_btn"/>
+	<button label="Kaydet" name="save_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_local.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_local.xml
new file mode 100644
index 00000000000..87d7677d738
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_local.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_local">
+	<text name="title">
+		Bilgisayarıma Kaydet
+	</text>
+	<combo_box label="Çözünürlük" name="local_size_combo">
+		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+		<combo_box.item label="320x240" name="320x240"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="1280x1024" name="1280x1024"/>
+		<combo_box.item label="1600x1200" name="1600x1200"/>
+		<combo_box.item label="Özel" name="Custom"/>
+	</combo_box>
+	<layout_stack name="local_image_params_ls">
+		<layout_panel name="local_image_size_lp">
+			<spinner label="GeniÅŸlik" name="local_snapshot_width"/>
+			<spinner label="Yükseklik" name="local_snapshot_height"/>
+			<check_box label="Oranları koru" name="local_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="local_image_format_quality_lp">
+			<combo_box label="Format" name="local_format_combo">
+				<combo_box.item label="PNG (Kayıpsız)" name="PNG"/>
+				<combo_box.item label="JPEG" name="JPEG"/>
+				<combo_box.item label="BMP (Kayıpsız)" name="BMP"/>
+			</combo_box>
+			<slider label="Görüntü kalitesi" name="image_quality_slider"/>
+			<text name="image_quality_level">
+				([QLVL])
+			</text>
+		</layout_panel>
+	</layout_stack>
+	<button label="Ä°ptal" name="cancel_btn"/>
+	<flyout_button label="Kaydet" name="save_btn" tool_tip="Görüntüyü bir dosyaya kaydet">
+		<flyout_button.item label="Kaydet" name="save_item"/>
+		<flyout_button.item label="Farklı Kaydet..." name="saveas_item"/>
+	</flyout_button>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
new file mode 100644
index 00000000000..fd2e85fce51
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_options">
+	<button label="Profil Akışımda Yayınla" name="save_to_profile_btn"/>
+	<button label="E-posta" name="save_to_email_btn"/>
+	<button label="Envanterime Kaydet (L$[AMOUNT])" name="save_to_inventory_btn"/>
+	<button label="Bilgisayarıma Kaydet" name="save_to_computer_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml
new file mode 100644
index 00000000000..e999678a0d5
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_postcard">
+	<string name="default_subject">
+		SECOND_LIFE]&apos;dan posta kartı.
+	</string>
+	<string name="default_message">
+		Buna bakın!
+	</string>
+	<string name="upload_message">
+		Gönderiyor...
+	</string>
+	<text name="title">
+		E-posta
+	</text>
+	<button label="Ä°leti" name="message_btn"/>
+	<button label="Ayarlar" name="settings_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_profile.xml
new file mode 100644
index 00000000000..334fd52a481
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_profile.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel name="panel_snapshot_profile">
+	<text name="title">
+		Profil Akışımda Yayınla
+	</text>
+	<combo_box label="Çözünürlük" name="profile_size_combo">
+		<combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+		<combo_box.item label="640x480" name="640x480"/>
+		<combo_box.item label="800x600" name="800x600"/>
+		<combo_box.item label="1024x768" name="1024x768"/>
+		<combo_box.item label="Özel" name="Custom"/>
+	</combo_box>
+	<layout_stack name="profile_image_params_ls">
+		<layout_panel name="profile_image_size_lp">
+			<spinner label="GeniÅŸlik" name="profile_snapshot_width"/>
+			<spinner label="Yükseklik" name="profile_snapshot_height"/>
+			<check_box label="Oranları koru" name="profile_keep_aspect_check"/>
+		</layout_panel>
+		<layout_panel name="profile_image_metadata_lp">
+			<text name="caption_label">
+				Resim yazısı:
+			</text>
+			<check_box initial_value="true" label="Konumu dahil et" name="add_location_cb"/>
+		</layout_panel>
+	</layout_stack>
+	<button label="Ä°ptal" name="cancel_btn"/>
+	<button label="Yayınla" name="post_btn"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index bf331dc3cf3..0dbc9b0a0ee 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -1211,7 +1211,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		Envanterinizde bu dokunun kopyası yok
 	</string>
 	<string name="InventoryInboxNoItems">
-		Pazaryeri üzerinden satın alınan öğeler buraya teslim edilir.
+		Bir öğeyi satın aldığınızda veya başka bir şekilde edindiğinizde burada görünür; bunu envanterinizdeki bir klasöre sürükleyebilir veya tutmak istemiyorsanız silebilirsiniz.
 	</string>
 	<string name="MarketplaceURL">
 		http://marketplace.[DOMAIN_NAME]
@@ -1409,6 +1409,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 	<string name="no_attachments">
 		Giyilen aksesuar yok
 	</string>
+	<string name="Attachments remain">
+		Aksesuarlar ([COUNT] yuva mevcut)
+	</string>
 	<string name="Buy">
 		Satın Al
 	</string>
@@ -1535,6 +1538,12 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 	<string name="Right Pec">
 		Sağ Göğüs
 	</string>
+	<string name="Neck">
+		Boyun
+	</string>
+	<string name="Avatar Center">
+		Avatar Merkezi
+	</string>
 	<string name="Invalid Attachment">
 		Geçersiz Aksesuar Noktası
 	</string>
@@ -4027,6 +4036,18 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 	<string name="you_paid_ldollars_no_name">
 		[REASON] L$[AMOUNT] ödediniz.
 	</string>
+	<string name="you_paid_failure_ldollars">
+		[REASON] [NAME]&apos;e L$[AMOUNT] ödeyemediniz.
+	</string>
+	<string name="you_paid_failure_ldollars_no_info">
+		L$[AMOUNT] ödeyemediniz.
+	</string>
+	<string name="you_paid_failure_ldollars_no_reason">
+		[NAME]&apos;e L$[AMOUNT] ödeyemediniz.
+	</string>
+	<string name="you_paid_failure_ldollars_no_name">
+		[REASON] L$[AMOUNT] ödeyemediniz.
+	</string>
 	<string name="for item">
 		[ITEM] için.
 	</string>
@@ -4437,6 +4458,12 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 	<string name="ExternalEditorFailedToRun">
 		Harici düzenleyici çalışmadı.
 	</string>
+	<string name="TranslationFailed">
+		Çeviri başarılamadı: [REASON]
+	</string>
+	<string name="TranslationResponseParseError">
+		Çeviri yanıtı ayrıştırılırken hata meydana geldi.
+	</string>
 	<string name="Esc">
 		Esc
 	</string>
@@ -4819,7 +4846,7 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 		Mini-harita
 	</string>
 	<string name="Command_Move_Label">
-		Hareket Et
+		Yürü / koş / uç
 	</string>
 	<string name="Command_People_Label">
 		KiÅŸiler
@@ -4846,10 +4873,10 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 		KonuÅŸ
 	</string>
 	<string name="Command_View_Label">
-		Görünüm
+		Kamera denetimleri
 	</string>
 	<string name="Command_Voice_Label">
-		Yakındaki ses
+		Ses ayarları
 	</string>
 	<string name="Command_AboutLand_Tooltip">
 		Ziyaret ettiÄŸiniz araziyle ilgili bilgi
@@ -4921,7 +4948,16 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 		Kamera açısını değiştirmek
 	</string>
 	<string name="Command_Voice_Tooltip">
-		Ses imkanına sahip yakındaki kişiler
+		Aramalar ve 	SL dünyası içinde size yakın kişiler için ses denetimleri
+	</string>
+	<string name="Toolbar_Bottom_Tooltip">
+		şu anda alt araç çubuğunuzda
+	</string>
+	<string name="Toolbar_Left_Tooltip">
+		şu anda sol araç çubuğunuzda
+	</string>
+	<string name="Toolbar_Right_Tooltip">
+		şu anda sağ araç çubuğunuzda
 	</string>
 	<string name="Retain%">
 		Koru %
@@ -4947,4 +4983,19 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 	<string name="Normal">
 		Normal
 	</string>
+	<string name="snapshot_quality_very_low">
+		Çok Düşük
+	</string>
+	<string name="snapshot_quality_low">
+		Düşük
+	</string>
+	<string name="snapshot_quality_medium">
+		Orta
+	</string>
+	<string name="snapshot_quality_high">
+		Yüksek
+	</string>
+	<string name="snapshot_quality_very_high">
+		Çok Yüksek
+	</string>
 </strings>
diff --git a/indra/newview/skins/default/xui/tr/teleport_strings.xml b/indra/newview/skins/default/xui/tr/teleport_strings.xml
index c506bb8a583..62aaaf671fb 100644
--- a/indra/newview/skins/default/xui/tr/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/tr/teleport_strings.xml
@@ -21,8 +21,8 @@ Hala ışınlanamıyorsanız, sorunu çözmek için lütfen çıkış yapıp otu
 Bir dakika sonra tekrar deneyin.
 		</message>
 		<message name="NoHelpIslandTP">
-You cannot teleport back to Welcome Island.
-Go to &apos;Welcome Island Public&apos; to repeat the tutorial.
+			Karşılama Ada&apos;sına geri ışınlanamazsınız.
+Öğreticiyi tekrarlamak için &apos;Karşılama Ada&apos;sı Kamusal Alanı&apos;na gidin.
 		</message>
 		<message name="noaccess_tport">
 			Üzgünüz, bu ışınlanma hedef konumuna erişim hakkına sahip değilsiniz.
-- 
GitLab


From 00b767e5a91d9e3379119c867164f9be40f888cc Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 10:05:15 -0800
Subject: [PATCH 538/933] EXP-1791 - Handle case where initialization with SLM
 fails in the Merchant Outbox floater in the viewer

* Added code to clear and re-initialize the SLM cookie when authentication errors are encountered.
* Re-organized logic for outbox import a bit to hopefully be more robust when errors are encountered.
---
 indra/newview/llfloateroutbox.cpp             |  38 +++-
 indra/newview/llfloateroutbox.h               |   1 +
 indra/newview/llmarketplacefunctions.cpp      | 175 +++++++++++-------
 indra/newview/llmarketplacefunctions.h        |   4 +
 .../skins/default/xui/en/notifications.xml    |  14 ++
 5 files changed, 157 insertions(+), 75 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 6ecf7155882..28589f5e9a4 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -250,12 +250,12 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
 	// Initialize the marketplace import API
 	//
 	
-	mImportBusy = true;
-	setStatusString(getString("OutboxInitializing"));
-
-	LLMarketplaceInventoryImporter::getInstance()->initialize();
-	LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
-	LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
+	LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance();
+	
+	importer.setInitializationErrorCallback(boost::bind(&LLFloaterOutbox::initializationReportError, this, _1, _2));
+	importer.setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
+	importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
+	importer.initialize();
 }
 
 void LLFloaterOutbox::setStatusString(const std::string& statusString)
@@ -403,7 +403,7 @@ void LLFloaterOutbox::onImportButtonClicked()
 {
 	mOutboxInventoryPanel->clearSelection();
 
-	LLMarketplaceInventoryImporter::instance().triggerImport();
+	mImportBusy = LLMarketplaceInventoryImporter::instance().triggerImport();
 }
 
 void LLFloaterOutbox::onOutboxChanged()
@@ -449,10 +449,14 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 {
 	if (inProgress)
 	{
-		if (!mImportBusy)
+		if (mImportBusy)
 		{
 			setStatusString(getString("OutboxImporting"));
 		}
+		else
+		{
+			setStatusString(getString("OutboxInitializing"));
+		}
 		
 		mImportBusy = true;
 		mImportButton->setEnabled(false);
@@ -463,9 +467,25 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
 		mImportBusy = false;
 		mImportButton->setEnabled(mOutboxItemCount > 0);
 		mInventoryImportInProgress->setVisible(false);
+	}
+	
+	updateView();
+}
 
-		updateView();
+void LLFloaterOutbox::initializationReportError(U32 status, const LLSD& content)
+{
+	if (status != MarketplaceErrorCodes::IMPORT_DONE)
+	{
+		char status_string[16];
+		sprintf(status_string, "%d", status);
+		
+		LLSD subs;
+		subs["[ERROR_CODE]"] = status_string;
+		
+		LLNotificationsUtil::add("OutboxInitFailed", subs);
 	}
+	
+	updateView();
 }
 
 void LLFloaterOutbox::showNotification(const LLSD& notify)
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 6b4021807cb..58b7d6ec98a 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -71,6 +71,7 @@ class LLFloaterOutbox : public LLFloater
 
 	void importReportResults(U32 status, const LLSD& content);
 	void importStatusChanged(bool inProgress);
+	void initializationReportError(U32 status, const LLSD& content);
 	
 	void onClose(bool app_quitting);
 	void onOpen(const LLSD& key);
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 9a83c5fcb7d..ea6634a39ef 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -97,14 +97,15 @@ namespace LLMarketplaceImport
 {
 	// Basic interface for this namespace
 
+	bool hasSessionCookie();
 	bool inProgress();
 	bool resultPending();
 	U32 getResultStatus();
 	const LLSD& getResults();
 
-	void establishMarketplaceSessionCookie();
-	void pollStatus();
-	void triggerImport();
+	bool establishMarketplaceSessionCookie();
+	bool pollStatus();
+	bool triggerImport();
 	
 	// Internal state variables
 
@@ -116,7 +117,6 @@ namespace LLMarketplaceImport
 	static U32 sImportResultStatus = 0;
 	static LLSD sImportResults = LLSD::emptyMap();
 
-	
 	// Responders
 	
 	class LLImportPostResponder : public LLHTTPClient::Responder
@@ -147,7 +147,12 @@ namespace LLMarketplaceImport
 		
 		void completedHeader(U32 status, const std::string& reason, const LLSD& content)
 		{
-			sMarketplaceCookie = content["set-cookie"].asString();
+			const std::string& set_cookie_string = content["set-cookie"].asString();
+			
+			if (!set_cookie_string.empty())
+			{
+				sMarketplaceCookie = set_cookie_string;
+			}
 		}
 		
 		void completed(U32 status, const std::string& reason, const LLSD& content)
@@ -158,6 +163,16 @@ namespace LLMarketplaceImport
 				llinfos << " SLM GET reason: " << reason << llendl;
 				llinfos << " SLM GET content: " << content.asString() << llendl;
 			}
+			
+			if (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR)
+			{
+				if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+				{
+					llinfos << " SLM GET clearing marketplace cookie due to authentication failure" << llendl;
+				}
+
+				sMarketplaceCookie.clear();
+			}
 
 			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
 			sImportGetPending = false;
@@ -165,56 +180,14 @@ namespace LLMarketplaceImport
 			sImportResults = content;
 		}
 	};
-	
-	// Coroutine testing
-/*
-	std::string gTimeDelayDebugFunc = "";
-	
-	void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
-	{
-		waitForEventOn(self, "mainloop");
-		
-		LLTimer delayTimer;
-		delayTimer.reset();
-		delayTimer.setTimerExpirySec(5.0f);
-		
-		while (!delayTimer.hasExpired())
-		{
-			waitForEventOn(self, "mainloop");
-		}
-		
-		outboxPanel->onImportPostComplete(MarketplaceErrorCodes::IMPORT_DONE, LLSD::emptyMap());
-		
-		gTimeDelayDebugFunc = "";
-	}
-	
-	std::string gImportPollingFunc = "";
-	
-	void importPoll(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
+
+	// Basic API
+
+	bool hasSessionCookie()
 	{
-		waitForEventOn(self, "mainloop");
-		
-		while (outboxPanel->isImportInProgress())
-		{
-			LLTimer delayTimer;
-			delayTimer.reset();
-			delayTimer.setTimerExpirySec(5.0f);
-			
-			while (!delayTimer.hasExpired())
-			{
-				waitForEventOn(self, "mainloop");
-			}
-			
-			//outboxPanel->
-		}
-		
-		gImportPollingFunc = "";
+		return !sMarketplaceCookie.empty();
 	}
 	
-*/	
-	
-	// Basic API
-
 	bool inProgress()
 	{
 		return sImportInProgress;
@@ -246,8 +219,13 @@ namespace LLMarketplaceImport
 		return url;
 	}
 	
-	void establishMarketplaceSessionCookie()
+	bool establishMarketplaceSessionCookie()
 	{
+		if (hasSessionCookie())
+		{
+			return false;
+		}
+
 		sImportInProgress = true;
 		sImportGetPending = true;
 		
@@ -259,10 +237,17 @@ namespace LLMarketplaceImport
 		}
 
 		LLHTTPClient::get(url, new LLImportGetResponder(), LLViewerMedia::getHeaders());
+		
+		return true;
 	}
 	
-	void pollStatus()
+	bool pollStatus()
 	{
+		if (!hasSessionCookie())
+		{
+			return false;
+		}
+		
 		sImportGetPending = true;
 
 		std::string url = getInventoryImportURL();
@@ -282,10 +267,17 @@ namespace LLMarketplaceImport
 		}
 
 		LLHTTPClient::get(url, new LLImportGetResponder(), headers);
+		
+		return true;
 	}
 	
-	void triggerImport()
+	bool triggerImport()
 	{
+		if (!hasSessionCookie())
+		{
+			return false;
+		}
+
 		sImportId = LLSD::emptyMap();
 		sImportInProgress = true;
 		sImportPostPending = true;
@@ -309,8 +301,7 @@ namespace LLMarketplaceImport
 
 		LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers);
 		
-		// Set a timer (for testing only)
-		//gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
+		return true;
 	}
 }
 
@@ -330,8 +321,10 @@ void LLMarketplaceInventoryImporter::update()
 }
 
 LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter()
-	: mImportInProgress(false)
+	: mAutoTriggerImport(false)
+	, mImportInProgress(false)
 	, mInitialized(false)
+	, mErrorInitSignal(NULL)
 	, mStatusChangedSignal(NULL)
 	, mStatusReportSignal(NULL)
 {
@@ -339,12 +332,24 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter()
 
 void LLMarketplaceInventoryImporter::initialize()
 {
-	if (!mInitialized)
+	llassert(!mInitialized);
+	
+	if (!LLMarketplaceImport::hasSessionCookie())
 	{
 		LLMarketplaceImport::establishMarketplaceSessionCookie();
 	}
 }
 
+boost::signals2::connection LLMarketplaceInventoryImporter::setInitializationErrorCallback(const status_report_signal_t::slot_type& cb)
+{
+	if (mErrorInitSignal == NULL)
+	{
+		mErrorInitSignal = new status_report_signal_t();
+	}
+	
+	return mErrorInitSignal->connect(cb);
+}
+
 boost::signals2::connection LLMarketplaceInventoryImporter::setStatusChangedCallback(const status_changed_signal_t::slot_type& cb)
 {
 	if (mStatusChangedSignal == NULL)
@@ -367,9 +372,18 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setStatusReportCallb
 
 bool LLMarketplaceInventoryImporter::triggerImport()
 {
-	LLMarketplaceImport::triggerImport();
+	const bool import_triggered = LLMarketplaceImport::triggerImport();
 	
-	return LLMarketplaceImport::inProgress();
+	if (!import_triggered)
+	{
+		mInitialized = false;
+
+		initialize();
+		
+		mAutoTriggerImport = true;
+	}
+	
+	return import_triggered;
 }
 
 void LLMarketplaceInventoryImporter::updateImport()
@@ -378,7 +392,16 @@ void LLMarketplaceInventoryImporter::updateImport()
 	
 	if (in_progress && !LLMarketplaceImport::resultPending())
 	{
-		LLMarketplaceImport::pollStatus();
+		const bool polling_status = LLMarketplaceImport::pollStatus();
+		
+		if (!polling_status)
+		{
+			mInitialized = false;
+			
+			initialize();
+			
+			mAutoTriggerImport = true;
+		}
 	}	
 	
 	if (mImportInProgress != in_progress)
@@ -390,16 +413,36 @@ void LLMarketplaceInventoryImporter::updateImport()
 			(*mStatusChangedSignal)(mImportInProgress);
 		}
 		
-		// If we are no longer in progress, report results
-		if (!mImportInProgress && mStatusReportSignal)
+		// If we are no longer in progress
+		if (!mImportInProgress)
 		{
 			if (mInitialized)
 			{
-				(*mStatusReportSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
+				// Report results
+				if (mStatusReportSignal)
+				{
+					(*mStatusReportSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
+				}
 			}
 			else
 			{
-				mInitialized = true;
+				// Look for results success
+				mInitialized = LLMarketplaceImport::hasSessionCookie();
+				
+				if (mInitialized)
+				{
+					// Follow up with auto trigger of import
+					if (mAutoTriggerImport)
+					{
+						mAutoTriggerImport = false;
+
+						triggerImport();
+					}
+				}
+				else if (mErrorInitSignal)
+				{
+					(*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
+				}
 			}
 		}
 	}
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index f501f1ee8b6..b2f6cb7521d 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -46,6 +46,7 @@ namespace MarketplaceErrorCodes
 	{
 		IMPORT_DONE = 200,
 		IMPORT_PROCESSING = 202,
+		IMPORT_AUTHENTICATION_ERROR = 401,
 		IMPORT_DONE_WITH_ERRORS = 409,
 		IMPORT_JOB_FAILED = 410,
 	};
@@ -65,6 +66,7 @@ class LLMarketplaceInventoryImporter
 	typedef boost::signals2::signal<void (bool)> status_changed_signal_t;
 	typedef boost::signals2::signal<void (U32, const LLSD&)> status_report_signal_t;
 
+	boost::signals2::connection setInitializationErrorCallback(const status_report_signal_t::slot_type& cb);
 	boost::signals2::connection setStatusChangedCallback(const status_changed_signal_t::slot_type& cb);
 	boost::signals2::connection setStatusReportCallback(const status_report_signal_t::slot_type& cb);
 	
@@ -75,9 +77,11 @@ class LLMarketplaceInventoryImporter
 	void updateImport();
 	
 private:
+	bool mAutoTriggerImport;
 	bool mImportInProgress;
 	bool mInitialized;
 	
+	status_report_signal_t *	mErrorInitSignal;
 	status_changed_signal_t *	mStatusChangedSignal;
 	status_report_signal_t *	mStatusReportSignal;
 };
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index bcb3a105ea0..2269703cb66 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -252,6 +252,20 @@ Error [ERROR_CODE]
          yestext="OK"/>
   </notification>
 
+  <notification
+   icon="OutboxStatus_Error"
+   name="OutboxInitFailed"
+   type="outbox">
+Marketplace initialization failed
+
+Initialization with the Marketplace failed because of a system or network error.  Try again later.
+
+Error [ERROR_CODE]
+
+        <usetemplate
+         name="okbutton"
+         yestext="OK"/>
+  </notification>
     
 
     <notification
-- 
GitLab


From 3169f4a96fd4c62d1390cd53ff2aaa4cb28fb047 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 11 Jan 2012 10:19:11 -0800
Subject: [PATCH 539/933] assert for updating views while drawing was too
 aggressive made assert match actual error condition for list iterators

reviewed by Leslie
---
 indra/llui/llview.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 542f57ee5fd..004681325f9 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -282,9 +282,6 @@ void LLView::moveChildToBackOfTabGroup(LLUICtrl* child)
 // virtual
 bool LLView::addChild(LLView* child, S32 tab_group)
 {
-	// NOTE: Changed this to not crash in release mode
-	llassert(mInDraw == false);
-
 	if (!child)
 	{
 		return false;
@@ -334,10 +331,11 @@ bool LLView::addChildInBack(LLView* child, S32 tab_group)
 // remove the specified child from the view, and set it's parent to NULL.
 void LLView::removeChild(LLView* child)
 {
-	llassert_always(mInDraw == false);
 	//llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs
 	if (child->mParentView == this) 
 	{
+		// if we are removing an item we are currently iterating over, that would be bad
+		llassert(child->mInDraw == false);
 		mChildList.remove( child );
 		child->mParentView = NULL;
 		if (child->isCtrl())
@@ -1086,7 +1084,6 @@ void LLView::draw()
 
 void LLView::drawChildren()
 {
-	mInDraw = true;
 	if (!mChildList.empty())
 	{
 		LLView* rootp = LLUI::getRootView();		
@@ -1105,7 +1102,10 @@ void LLView::drawChildren()
 					LLUI::pushMatrix();
 					{
 						LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom, 0.f);
+						// flag the fact we are in draw here, in case overridden draw() method attempts to remove this widget
+						viewp->mInDraw = true;
 						viewp->draw();
+						viewp->mInDraw = false;
 
 						if (sDebugRects)
 						{
@@ -1125,7 +1125,6 @@ void LLView::drawChildren()
 		}
 		--sDepth;
 	}
-	mInDraw = false;
 }
 
 void LLView::dirtyRect()
-- 
GitLab


From 0a1cb4f03ee1aeb0cfc9d9bdb837043d0f46f292 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 11:26:56 -0800
Subject: [PATCH 540/933] EXP-1791 FIX -- Handle case where initialization with
 SLM fails in the Merchant Outbox floater in the viewer

* Updated marketplace import to properly handle failed cases of authentications
  and invalid cookies.  The import will reset to an uninitialized state and then
  trigger and initialization followed immediately by an import when appropriate.
---
 indra/newview/llfloateroutbox.cpp             |  1 -
 indra/newview/llmarketplacefunctions.cpp      | 67 +++++++++++--------
 indra/newview/llmarketplacefunctions.h        |  5 +-
 .../skins/default/xui/en/notifications.xml    |  7 +-
 4 files changed, 45 insertions(+), 35 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 28589f5e9a4..130c26acdc2 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -438,7 +438,6 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
 		LLSD subs;
 		subs["[ERROR_CODE]"] = status_string;
 		
-		//llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED);
 		LLNotificationsUtil::add("OutboxImportFailed", subs);
 	}
 	
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index ea6634a39ef..84cbe3cac22 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -133,6 +133,17 @@ namespace LLMarketplaceImport
 				llinfos << " SLM POST content: " << content.asString() << llendl;
 			}
 
+			if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) ||
+				(status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR))
+			{
+				if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
+				{
+					llinfos << " SLM POST clearing marketplace cookie due to authentication failure" << llendl;
+				}
+
+				sMarketplaceCookie.clear();
+			}
+
 			sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
 			sImportPostPending = false;
 			sImportResultStatus = status;
@@ -330,16 +341,6 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter()
 {
 }
 
-void LLMarketplaceInventoryImporter::initialize()
-{
-	llassert(!mInitialized);
-	
-	if (!LLMarketplaceImport::hasSessionCookie())
-	{
-		LLMarketplaceImport::establishMarketplaceSessionCookie();
-	}
-}
-
 boost::signals2::connection LLMarketplaceInventoryImporter::setInitializationErrorCallback(const status_report_signal_t::slot_type& cb)
 {
 	if (mErrorInitSignal == NULL)
@@ -370,17 +371,32 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setStatusReportCallb
 	return mStatusReportSignal->connect(cb);
 }
 
+void LLMarketplaceInventoryImporter::initialize()
+{
+	llassert(!mInitialized);
+
+	if (!LLMarketplaceImport::hasSessionCookie())
+	{
+		LLMarketplaceImport::establishMarketplaceSessionCookie();
+	}
+}
+
+void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport()
+{
+	mInitialized = false;
+
+	initialize();
+
+	mAutoTriggerImport = true;
+}
+
 bool LLMarketplaceInventoryImporter::triggerImport()
 {
 	const bool import_triggered = LLMarketplaceImport::triggerImport();
 	
 	if (!import_triggered)
 	{
-		mInitialized = false;
-
-		initialize();
-		
-		mAutoTriggerImport = true;
+		reinitializeAndTriggerImport();
 	}
 	
 	return import_triggered;
@@ -396,23 +412,14 @@ void LLMarketplaceInventoryImporter::updateImport()
 		
 		if (!polling_status)
 		{
-			mInitialized = false;
-			
-			initialize();
-			
-			mAutoTriggerImport = true;
+			reinitializeAndTriggerImport();
 		}
 	}	
 	
 	if (mImportInProgress != in_progress)
 	{
 		mImportInProgress = in_progress;
-		
-		if (mStatusChangedSignal)
-		{
-			(*mStatusChangedSignal)(mImportInProgress);
-		}
-		
+
 		// If we are no longer in progress
 		if (!mImportInProgress)
 		{
@@ -436,7 +443,7 @@ void LLMarketplaceInventoryImporter::updateImport()
 					{
 						mAutoTriggerImport = false;
 
-						triggerImport();
+						mImportInProgress = triggerImport();
 					}
 				}
 				else if (mErrorInitSignal)
@@ -445,6 +452,12 @@ void LLMarketplaceInventoryImporter::updateImport()
 				}
 			}
 		}
+
+		// Make sure we trigger the status change with the final state (in case of auto trigger after initialize)
+		if (mStatusChangedSignal)
+		{
+			(*mStatusChangedSignal)(mImportInProgress);
+		}
 	}
 }
 
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index b2f6cb7521d..78df86ef3e7 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -46,6 +46,7 @@ namespace MarketplaceErrorCodes
 	{
 		IMPORT_DONE = 200,
 		IMPORT_PROCESSING = 202,
+		IMPORT_REDIRECT = 302,
 		IMPORT_AUTHENTICATION_ERROR = 401,
 		IMPORT_DONE_WITH_ERRORS = 409,
 		IMPORT_JOB_FAILED = 410,
@@ -61,8 +62,6 @@ class LLMarketplaceInventoryImporter
 	
 	LLMarketplaceInventoryImporter();
 	
-	void initialize();
-
 	typedef boost::signals2::signal<void (bool)> status_changed_signal_t;
 	typedef boost::signals2::signal<void (U32, const LLSD&)> status_report_signal_t;
 
@@ -70,10 +69,12 @@ class LLMarketplaceInventoryImporter
 	boost::signals2::connection setStatusChangedCallback(const status_changed_signal_t::slot_type& cb);
 	boost::signals2::connection setStatusReportCallback(const status_report_signal_t::slot_type& cb);
 	
+	void initialize();
 	bool triggerImport();
 	bool isImportInProgress() const { return mImportInProgress; }
 	
 protected:
+	void reinitializeAndTriggerImport();
 	void updateImport();
 	
 private:
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 2269703cb66..61346bf3d65 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -230,8 +230,9 @@ All folders were successfully sent to the Marketplace.
    type="outbox">
 Some folders did not transfer
 
-Errors occurred when some folders were sent to the Marketplace.  Those folders are still in your Merchant Outbox.  See the error log for more information.
+Errors occurred when some folders were sent to the Marketplace.  Those folders are still in your Merchant Outbox.
 
+See the error log for more information.
         <usetemplate
          name="okbutton"
          yestext="OK"/>
@@ -245,8 +246,6 @@ Transfer failed
 
 No folders were sent to the Marketplace because of a system or network error.  Try again later.
 
-Error [ERROR_CODE]
-
         <usetemplate
          name="okbutton"
          yestext="OK"/>
@@ -260,8 +259,6 @@ Marketplace initialization failed
 
 Initialization with the Marketplace failed because of a system or network error.  Try again later.
 
-Error [ERROR_CODE]
-
         <usetemplate
          name="okbutton"
          yestext="OK"/>
-- 
GitLab


From 98f071aa6fc2961d9a86fa1d174c1f988a6ef8dc Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 11:59:34 -0800
Subject: [PATCH 541/933] EXP-1790 FIX -- Hitting return on item in Merchant
 Outbox wears the object

* Disabled the "openItem" function on outbox items to prevent default behavior
  when the return button is pressed.
---
 indra/newview/llpanelmarketplaceoutboxinventory.cpp | 5 +++++
 indra/newview/llpanelmarketplaceoutboxinventory.h   | 1 +
 2 files changed, 6 insertions(+)

diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
index c14a0c83790..ff62cb23dbb 100644
--- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
@@ -148,4 +148,9 @@ BOOL LLOutboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
 	return TRUE;
 }
 
+void LLOutboxFolderViewItem::openItem()
+{
+	// Intentionally do nothing to block attaching items from the outbox
+}
+
 // eof
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h
index 167f371f0ec..a6c522b7c23 100644
--- a/indra/newview/llpanelmarketplaceoutboxinventory.h
+++ b/indra/newview/llpanelmarketplaceoutboxinventory.h
@@ -71,6 +71,7 @@ class LLOutboxFolderViewItem : public LLFolderViewItem
 
 	// virtual
 	BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+	void openItem();
 };
 
 
-- 
GitLab


From 542c31d547a7a42cd81c2a535805d30b164e31e4 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 13:37:43 -0800
Subject: [PATCH 542/933] EXP-1788 FIX -- Outbox drag and drop restrictions can
 be bypassed if inventory not fully loaded

* The "Copy to Outbox" option is now disabled when the item is in the loading state.
---
 indra/newview/llfolderviewitem.h    |   2 +
 indra/newview/llinventorybridge.cpp | 118 +++++++++++++++++-----------
 indra/newview/llinventorybridge.h   |   6 +-
 3 files changed, 76 insertions(+), 50 deletions(-)

diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 0f8c3edef82..5a0e58ea0e2 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -122,6 +122,8 @@ class LLFolderViewItem : public LLView
 
 	// Mostly for debugging printout purposes.
 	const std::string& getSearchableLabel() { return mSearchableLabel; }
+	
+	BOOL isLoading() const { return mIsLoading; }
 
 private:
 	BOOL						mIsSelected;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 8abb6d66ada..e75ef20c6a9 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1088,108 +1088,132 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid)
 	}
 }
 
-BOOL LLInvFVBridge::canShare() const
+bool LLInvFVBridge::canShare() const
 {
-	if (!isAgentInventory()) return FALSE;
+	bool can_share = false;
 
-	const LLInventoryModel* model = getInventoryModel();
-	if (!model) return FALSE;
-
-	const LLViewerInventoryItem *item = model->getItem(mUUID);
-	if (item)
+	if (isAgentInventory())
 	{
-		if (!LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item)) 
-			return FALSE;
-		return (BOOL)LLGiveInventory::isInventoryGiveAcceptable(item);
+		const LLInventoryModel* model = getInventoryModel();
+		if (model)
+		{
+			const LLViewerInventoryItem *item = model->getItem(mUUID);
+			if (item)
+			{
+				if (LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item)) 
+				{
+					can_share = LLGiveInventory::isInventoryGiveAcceptable(item);
+				}
+			}
+			else
+			{
+				// Categories can be given.
+				can_share = (model->getCategory(mUUID) != NULL);
+			}
+		}
 	}
 
-	// Categories can be given.
-	if (model->getCategory(mUUID)) return TRUE;
-
-	return FALSE;
+	return can_share;
 }
 
-BOOL LLInvFVBridge::canListOnMarketplace() const
+bool LLInvFVBridge::canListOnMarketplace() const
 {
 #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+
 	LLInventoryModel * model = getInventoryModel();
+
 	const LLViewerInventoryCategory * cat = model->getCategory(mUUID);
 	if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
 	{
-		return FALSE;
+		return false;
 	}
 
 	if (!isAgentInventory())
 	{
-		return FALSE;
+		return false;
 	}
 	
 	if (getOutboxFolder().isNull())
 	{
-		return FALSE;
+		return false;
 	}
 
 	if (isInboxFolder() || isOutboxFolder())
 	{
-		return FALSE;
+		return false;
 	}
 	
 	const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
 	if (outbox_id.isNull())
 	{
-		return FALSE;
+		return false;
 	}
 
 	LLViewerInventoryItem * item = model->getItem(mUUID);
 	if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
 	{
-		return FALSE;
+		return false;
 	}
 
-	return TRUE;
+	return true;
+
 #else
-	return FALSE;
+	return false;
 #endif
 }
 
-BOOL LLInvFVBridge::canListOnMarketplaceNow() const
+bool LLInvFVBridge::canListOnMarketplaceNow() const
 {
-	BOOL can_list = FALSE;
-	
 #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
+	
+	bool can_list = true;
 
+	// Do not allow listing while import is in progress
+	if (LLMarketplaceInventoryImporter::instanceExists())
+	{
+		can_list = !LLMarketplaceInventoryImporter::instance().isImportInProgress();
+	}
+	
 	const LLInventoryObject* obj = getInventoryObject();
 
-	if (obj)
+	if (obj && can_list)
 	{
-		// Get outbox id
-		const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
-		LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id);
+		const LLUUID& object_id = obj->getLinkedUUID();
+		can_list = object_id.notNull();
 
-		if (outbox_itemp)
+		if (can_list)
 		{
-			MASK mask = 0x0;
-			BOOL drop = FALSE;
-			EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType());
-			void * cargo_data = (void *) obj;
-			std::string tooltip_msg;
-			
-			can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg);
+			LLFolderViewFolder * object_folderp = mRoot->getFolderByID(object_id);
+			if (object_folderp)
+			{
+				can_list = !object_folderp->isLoading();
+			}
 		}
-	}
-
-	// Do not allow listing while import is in progress
-	if (LLMarketplaceInventoryImporter::instanceExists())
-	{
-		if (LLMarketplaceInventoryImporter::instance().isImportInProgress())
+		
+		if (can_list)
 		{
-			can_list = FALSE;
+			// Get outbox id
+			const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+			LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id);
+
+			if (outbox_itemp)
+			{
+				MASK mask = 0x0;
+				BOOL drop = FALSE;
+				EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType());
+				void * cargo_data = (void *) obj;
+				std::string tooltip_msg;
+				
+				can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg);
+			}
 		}
 	}
+	
+	return can_list;
 
+#else
+	return false;
 #endif
-
-	return can_list;
 }
 
 
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 2ab339b9184..cb378b7d7a3 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -69,9 +69,9 @@ class LLInvFVBridge : public LLFolderViewEventListener
 									   U32 flags = 0x00);
 	virtual ~LLInvFVBridge() {}
 
-	BOOL canShare() const;
-	BOOL canListOnMarketplace() const;
-	BOOL canListOnMarketplaceNow() const;
+	bool canShare() const;
+	bool canListOnMarketplace() const;
+	bool canListOnMarketplaceNow() const;
 
 	//--------------------------------------------------------------------
 	// LLInvFVBridge functionality
-- 
GitLab


From 59950f6178699b96e86bfd2c0bc701271b3f1a6b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 16:49:32 -0800
Subject: [PATCH 543/933] EXP-1778 FIX -- Link to Marketplace Error log in
 transfer failed viewer notification

* Added a link to the "imports" log from the "done with errors" notification when
  sending folders to the marketplace.
---
 indra/newview/llfloateroutbox.cpp                    |  6 ++++--
 indra/newview/llmarketplacefunctions.cpp             | 12 +++++-------
 indra/newview/llmarketplacefunctions.h               |  2 +-
 indra/newview/skins/default/xui/en/notifications.xml |  3 ++-
 indra/newview/skins/default/xui/en/strings.xml       |  1 +
 5 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 130c26acdc2..597602d5abb 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -332,7 +332,7 @@ void LLFloaterOutbox::updateView()
 		std::string outbox_title;
 		std::string outbox_tooltip;
 		
-		LLStringUtil::format_map_t subs = getMarketplaceStringSubstitutions();
+		const LLSD& subs = getMarketplaceStringSubstitutions();
 		
 		if (mOutboxId.notNull())
 		{
@@ -428,7 +428,9 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
 	}
 	else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)
 	{
-		LLNotificationsUtil::add("OutboxImportHadErrors");
+		const LLSD& subs = getMarketplaceStringSubstitutions();
+
+		LLNotificationsUtil::add("OutboxImportHadErrors", subs);
 	}
 	else
 	{
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 84cbe3cac22..ee7505c4f41 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -72,23 +72,21 @@ static std::string getMarketplaceURL(const std::string& urlStringName)
 	return marketplace_url;
 }
 
-LLStringUtil::format_map_t getMarketplaceStringSubstitutions()
+LLSD getMarketplaceStringSubstitutions()
 {
 	std::string marketplace_url = getMarketplaceURL("MarketplaceURL");
 	std::string marketplace_url_create = getMarketplaceURL("MarketplaceURL_CreateStore");
 	std::string marketplace_url_dashboard = getMarketplaceURL("MarketplaceURL_Dashboard");
+	std::string marketplace_url_imports = getMarketplaceURL("MarketplaceURL_Imports");
 	std::string marketplace_url_info = getMarketplaceURL("MarketplaceURL_LearnMore");
 	
-	LLStringUtil::format_map_t agent_map;
-	agent_map["[AGENT_ID]"] = gAgent.getID().getString();
-	
-	LLStringUtil::format(marketplace_url_dashboard, agent_map);
-	
-	LLStringUtil::format_map_t marketplace_sub_map;
+	LLSD marketplace_sub_map;
+
 	marketplace_sub_map["[MARKETPLACE_URL]"] = marketplace_url;
 	marketplace_sub_map["[MARKETPLACE_CREATE_STORE_URL]"] = marketplace_url_create;
 	marketplace_sub_map["[MARKETPLACE_LEARN_MORE_URL]"] = marketplace_url_info;
 	marketplace_sub_map["[MARKETPLACE_DASHBOARD_URL]"] = marketplace_url_dashboard;
+	marketplace_sub_map["[MARKETPLACE_IMPORTS_URL]"] = marketplace_url_imports;
 	
 	return marketplace_sub_map;
 }
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index 78df86ef3e7..47315663661 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -37,7 +37,7 @@
 #include "llstring.h"
 
 
-LLStringUtil::format_map_t getMarketplaceStringSubstitutions();
+LLSD getMarketplaceStringSubstitutions();
 
 
 namespace MarketplaceErrorCodes
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 61346bf3d65..657d9fe91ab 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -232,7 +232,8 @@ Some folders did not transfer
 
 Errors occurred when some folders were sent to the Marketplace.  Those folders are still in your Merchant Outbox.
 
-See the error log for more information.
+See the [[MARKETPLACE_IMPORTS_URL] error log] for more information.
+
         <usetemplate
          name="okbutton"
          yestext="OK"/>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index a78f3df5b66..84fce6630bf 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2040,6 +2040,7 @@ Returns a string with the requested data about the region
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
 	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
+	<string name="MarketplaceURL_Imports">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports</string>
 	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
 	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace.</string>
 	<string name="InventoryOutboxNotMerchantTooltip"></string>
-- 
GitLab


From 6452154b19c6592efaf27e07bbee3bc6bcd3a415 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 16:53:08 -0800
Subject: [PATCH 544/933] Correcting logic back to way it was, to make sure
 invalid objects can not be copied to the outbox

---
 indra/newview/llinventorybridge.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index e75ef20c6a9..1d7406883c0 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1175,8 +1175,9 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const
 	}
 	
 	const LLInventoryObject* obj = getInventoryObject();
+	can_list &= (obj != NULL);
 
-	if (obj && can_list)
+	if (can_list)
 	{
 		const LLUUID& object_id = obj->getLinkedUUID();
 		can_list = object_id.notNull();
-- 
GitLab


From b41e66c1cb7d48ef600588fa2b57e43f80860c71 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Wed, 11 Jan 2012 17:15:06 -0800
Subject: [PATCH 545/933] EXP-1511 REFIX Preview image overlays ui elements in
 Upload image floater Tweaked offset and missed a corner case

---
 indra/newview/llfloaterimagepreview.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index cc279049cae..92ee8ddac6a 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -63,7 +63,7 @@
 const S32 PREVIEW_BORDER_WIDTH = 2;
 const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
 const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
-const S32 PREVIEW_VPAD = 32;	// yuk, hard coded
+const S32 PREVIEW_VPAD = -24;	// yuk, hard coded
 const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
 const S32 PREVIEW_TEXTURE_HEIGHT = 320;
 
@@ -304,13 +304,13 @@ void LLFloaterImagePreview::draw()
 				gGL.begin( LLRender::QUADS );
 				{
 					gGL.texCoord2f(0.f, 1.f);
-					gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
+					gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
 					gGL.texCoord2f(0.f, 0.f);
 					gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 					gGL.texCoord2f(1.f, 0.f);
 					gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 					gGL.texCoord2f(1.f, 1.f);
-					gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
+					gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
 				}
 				gGL.end();
 
-- 
GitLab


From 1307fad7c9f7a1130242a4de7e0144ba4dea6297 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 11 Jan 2012 17:32:22 -0800
Subject: [PATCH 546/933] EXP-1752 FIX -- Merchant outbox import completion
 success modal dialog needs checkbox to disable EXP-1795 PROGRESS -- Update
 warning dialog for dragging and dropping no-copy items to Merchant Outbox

* The text associated with EXP-1795 has been updated but the "apply to all"
  checkbox has not been implemented yet.
* Updated the "0 folders" text to be an empty string instead.
---
 .../skins/default/xui/en/floater_merchant_outbox.xml |  2 +-
 indra/newview/skins/default/xui/en/notifications.xml | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 741515d56c2..c0f26413cb3 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -13,7 +13,7 @@
  reuse_instance="true"
  title="MERCHANT OUTBOX"
  width="333" >
- <string name="OutboxFolderCount0">0 folders</string>
+ <string name="OutboxFolderCount0"></string>
  <string name="OutboxFolderCount1">1 folder</string>
  <string name="OutboxFolderCountN">[NUM] folders</string>
  <string name="OutboxImporting">Sending folders...</string>
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 657d9fe91ab..387cee3cee2 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -203,12 +203,13 @@ Save changes to current clothing/body part?
    icon="alertmodal.tga"
      name="ConfirmNoCopyToOutbox"
      type="alertmodal">
-You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item?
+You don't have permission to copy this item to the Merchant Outbox. You can move it or leave it behind.
+
 [ITEM_NAME]
         <usetemplate
-         name="okcancelbuttons"
-         notext="No"
-         yestext="Yes"/>
+         name="yesnocancelbuttons"
+         notext="Don't move item"
+         yestext="Move item"/>
     </notification>
 
   <notification
@@ -220,7 +221,8 @@ Success
 All folders were successfully sent to the Marketplace.
 
         <usetemplate
-         name="okbutton"
+         ignoretext="All folders sent to the Marketplace"
+         name="okignore"
          yestext="OK"/>
   </notification>
 
-- 
GitLab


From 33a17d8a83b3810e344e663395219d3130cb34c3 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 11 Jan 2012 17:43:17 -0800
Subject: [PATCH 547/933] EXP-1549 : Disable the Remove button menu item in the
 toolbar contextual menu if no button clicked

---
 indra/llui/lltoolbar.cpp | 9 ++++++++-
 indra/llui/lltoolbar.h   | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 7f96c1373c2..9b31a6449df 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -151,14 +151,20 @@ void LLToolBar::createContextMenu()
 		if (menu)
 		{
 			menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor"));
-
 			mPopupMenuHandle = menu->getHandle();
+			mRemoveButtonHandle = menu->getChild<LLView>("Remove button")->getHandle();
 		}
 		else
 		{
 			llwarns << "Unable to load toolbars context menu." << llendl;
 		}
 	}
+	
+	if (mRemoveButtonHandle.get())
+	{
+		// Disable/Enable the "Remove button" menu item depending on whether or not a button was clicked
+		mRemoveButtonHandle.get()->setEnabled(mRightMouseTargetButton != NULL);
+	}
 }
 
 void LLToolBar::initFromParams(const LLToolBar::Params& p)
@@ -401,6 +407,7 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
 	{
 		// Determine which button the mouse was over during the click in case the context menu action
 		// is intended to affect the button.
+		mRightMouseTargetButton = NULL;
 		BOOST_FOREACH(LLToolBarButton* button, mButtons)
 		{
 			LLRect button_rect;
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 51fe23ddd18..a50c60282c4 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -271,6 +271,7 @@ class LLToolBar
 	LLLayoutStack*					mCenteringStack;
 	LLPanel*						mButtonPanel;
 	LLHandle<class LLContextMenu>	mPopupMenuHandle;
+	LLHandle<class LLView>			mRemoveButtonHandle;
 
 	LLToolBarButton*				mRightMouseTargetButton;
 
-- 
GitLab


From 37c68057c92f5a21a3d21b4ac01690a1cf4cf8e4 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 11 Jan 2012 18:59:35 -0800
Subject: [PATCH 548/933] EXP-876 : Avoid ui elements using the same name
 reference.

---
 .../default/xui/en/floater_model_wizard.xml   | 32 +++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
index 9c0af7d9ba5..62b8c5f96ed 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -108,7 +108,7 @@
 		 height="22"
 		 top_pad="15"
 		 width="505"
-		 name="header_panel"
+		 name="choose_file_header_panel"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true"
@@ -117,7 +117,7 @@
 			 width="200"
 			 left="10"
 			 top="3"
-			 name="header_text"
+			 name="choose_file_header_text"
 			 text_color="White"
 			 height="10"
 			 font="SansSerifBig"
@@ -130,7 +130,7 @@
 		 left="15"
 		 height="310"
 		 width="505"
-		 name="content"
+		 name="choose_file_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -287,7 +287,7 @@
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="optimize_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -296,7 +296,7 @@
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="optimize_header_text"
 			 top="3"
 			 text_color="White"
 			 height="10"
@@ -311,7 +311,7 @@
 		 height="20"
 		 font="SansSerifSmall"
 		 layout="topleft"
-		 name="description"
+		 name="optimize_description"
 		 word_wrap="true"
 		 left_delta="5">
 			We have optimized the model for performance. Adjust it further if you wish.
@@ -322,7 +322,7 @@
 		 left="15"
 		 height="270"
 		 width="505"
-		 name="content"
+		 name="optimize_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -497,7 +497,7 @@ Higher prim weight</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="physics_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -506,7 +506,7 @@ Higher prim weight</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="physics_header_text"
 			 top="3"
 			 height="10"
 			 font="SansSerifBig"
@@ -521,7 +521,7 @@ Higher prim weight</text>
 		 height="50"
 		 font="SansSerifSmall"
 		 layout="topleft"
-		 name="description"
+		 name="physics_description"
 		 word_wrap="true"
 		 left_delta="5">
 			We will create a shape for the outer hull of the model. Adjust the shape's detail level as needed for the intended purpose of your model.
@@ -531,7 +531,7 @@ Higher prim weight</text>
 		 left="15"
 		 height="270"
 		 width="505"
-		 name="content"
+		 name="physics_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -635,7 +635,7 @@ Buildings</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="review_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -644,7 +644,7 @@ Buildings</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="review_header_text"
 			 text_color="White" 
 			 top="3"
 			 height="10"
@@ -658,7 +658,7 @@ Buildings</text>
 		 left="15"
 		 height="310"
 		 width="505"
-		 name="content"
+		 name="review_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -706,7 +706,7 @@ Buildings</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="upload_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -715,7 +715,7 @@ Buildings</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="upload_header_text"
 			 top="3"
 			 text_color="White" 
 			 height="10"
-- 
GitLab


From 8ff215590fb1345a68205d27f55c51d69216b06e Mon Sep 17 00:00:00 2001
From: LanceCorrimal <none@none>
Date: Thu, 12 Jan 2012 09:20:43 +0100
Subject: [PATCH 549/933] VWR-28087: image preview floter 20 pixels too short

---
 .../newview/skins/default/xui/en/floater_image_preview.xml  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml
index 86232de1a47..44d2c14cc8d 100644
--- a/indra/newview/skins/default/xui/en/floater_image_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml
@@ -2,7 +2,7 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- height="440"
+ height="460"
  layout="topleft"
  name="Image Preview"
  help_topic="image_preview"
@@ -108,7 +108,7 @@
     <text
      type="string"
      length="1"
-     bottom="225"
+     bottom="250"
      height="45"
      word_wrap="true"
      follows="top|left"
@@ -137,7 +137,7 @@ Try saving image as 24 bit Targa (.tga).
      layout="topleft"
      left="165"
      name="cancel_btn"
-     top="410"
+     top="430"
      width="125" />
     <button
      follows="bottom|left"
-- 
GitLab


From 2ae55b2be6bea2b95a3fa4cc1ca2c4fe14609a4e Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 12 Jan 2012 15:42:31 -0500
Subject: [PATCH 550/933] STORM-1798 'Block' menuitem title isn't changed after
 blocking item in object inspector

---
 indra/newview/llviewermenu.cpp                | 28 +++++++++++++++++--
 .../xui/en/menu_inspect_object_gear.xml       |  9 ++++++
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 3a1b8d7623d..4d6f6a444e3 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2762,8 +2762,31 @@ bool enable_object_mute()
 	else
 	{
 		// Just a regular object
-		return LLSelectMgr::getInstance()->getSelection()->
-			contains( object, SELECT_ALL_TES );
+		return LLSelectMgr::getInstance()->getSelection()->contains( object, SELECT_ALL_TES ) &&
+			   !LLMuteList::getInstance()->isMuted(object->getID());
+	}
+}
+
+bool enable_object_unmute()
+{
+	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
+	if (!object) return false;
+
+	LLVOAvatar* avatar = find_avatar_from_object(object); 
+	if (avatar)
+	{
+		// It's an avatar
+		LLNameValue *lastname = avatar->getNVPair("LastName");
+		bool is_linden =
+			lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden");
+		bool is_self = avatar->isSelf();
+		return !is_linden && !is_self;
+	}
+	else
+	{
+		// Just a regular object
+		return LLSelectMgr::getInstance()->getSelection()->contains( object, SELECT_ALL_TES ) &&
+			   LLMuteList::getInstance()->isMuted(object->getID());;
 	}
 }
 
@@ -8281,6 +8304,7 @@ void initialize_menus()
 
 	enable.add("Avatar.EnableMute", boost::bind(&enable_object_mute));
 	enable.add("Object.EnableMute", boost::bind(&enable_object_mute));
+	enable.add("Object.EnableUnmute", boost::bind(&enable_object_unmute));
 	enable.add("Object.EnableBuy", boost::bind(&enable_buy_object));
 	commit.add("Object.ZoomIn", boost::bind(&handle_look_at_selection, "zoom"));
 
diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml
index f818ebe2d7d..63e154697ba 100644
--- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml
@@ -113,6 +113,15 @@
     <menu_item_call.on_visible
      function="Object.EnableMute" />
   </menu_item_call>
+  <menu_item_call
+   label="Unblock"
+   layout="topleft"
+   name="unblock">
+    <menu_item_call.on_click
+     function="Object.Mute" />
+    <menu_item_call.on_visible
+     function="Object.EnableUnmute" />
+  </menu_item_call>
   <menu_item_call
     label="Zoom In"
     layout="topleft"
-- 
GitLab


From ec2b0e3af34bee7870283e5af2d16f879ad68f1b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 12 Jan 2012 14:17:47 -0800
Subject: [PATCH 551/933] Fixing up 'cancel' button text on no-copy item
 transfer to outbox message

---
 indra/newview/skins/default/xui/en/notifications.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 387cee3cee2..a7e74362564 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -207,6 +207,7 @@ You don't have permission to copy this item to the Merchant Outbox. You can move
 
 [ITEM_NAME]
         <usetemplate
+         canceltext="Cancel"
          name="yesnocancelbuttons"
          notext="Don't move item"
          yestext="Move item"/>
-- 
GitLab


From f082de03ff24ae8cc6a2de103bc643c392135742 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 12 Jan 2012 16:36:56 -0700
Subject: [PATCH 552/933] fix for SH-2845, SH-2846, SH-2847, SH-2851: curl
 crashes and out-of-memory crashes.

---
 indra/llmessage/llcurl.cpp                    | 293 ++++++++++++++----
 indra/llmessage/llcurl.h                      |  22 +-
 indra/llmessage/llhttpassetstorage.cpp        |  10 +-
 indra/llmessage/llhttpclient.cpp              |  12 +-
 indra/llmessage/lliopipe.cpp                  |   6 +
 indra/llmessage/lliopipe.h                    |   2 +
 indra/llmessage/llpumpio.cpp                  |  50 ++-
 indra/llmessage/llpumpio.h                    |  12 +-
 indra/llmessage/llsdrpcclient.h               |   3 +
 indra/llmessage/llurlrequest.cpp              |  18 ++
 indra/llmessage/llurlrequest.h                |   2 +
 indra/newview/llmeshrepository.cpp            | 131 +++++---
 indra/newview/llmeshrepository.h              |   4 +-
 indra/newview/llxmlrpctransaction.cpp         |  19 ++
 .../updater/llupdatedownloader.cpp            |  23 +-
 15 files changed, 475 insertions(+), 132 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index e17380fdf5e..eab28745964 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -72,10 +72,12 @@
 
 static const U32 EASY_HANDLE_POOL_SIZE		= 5;
 static const S32 MULTI_PERFORM_CALL_REPEAT	= 5;
-static const S32 CURL_REQUEST_TIMEOUT = 30; // seconds
+static const S32 CURL_REQUEST_TIMEOUT = 30; // seconds per operation
 static const S32 MAX_ACTIVE_REQUEST_COUNT = 100;
 
-static 
+static const F32 DEFAULT_MULTI_IDLE_TIME = 120.0f ; //seconds
+static const S32 MAX_NUM_OF_HANDLES = 256 ; //max number of handles, (multi handles and easy handles combined).
+
 // DEBUG //
 S32 gCurlEasyCount = 0;
 S32 gCurlMultiCount = 0;
@@ -87,6 +89,8 @@ std::vector<LLMutex*> LLCurl::sSSLMutex;
 std::string LLCurl::sCAPath;
 std::string LLCurl::sCAFile;
 LLCurlThread* LLCurl::sCurlThread = NULL ;
+LLMutex* LLCurl::sHandleMutexp = NULL ;
+S32      LLCurl::sTotalHandles = 0 ;
 
 void check_curl_code(CURLcode code)
 {
@@ -230,7 +234,7 @@ CURL* LLCurl::Easy::allocEasyHandle()
 
 	if (sFreeHandles.empty())
 	{
-		ret = curl_easy_init();
+		ret = LLCurl::newEasyHandle();
 	}
 	else
 	{
@@ -250,16 +254,27 @@ CURL* LLCurl::Easy::allocEasyHandle()
 //static
 void LLCurl::Easy::releaseEasyHandle(CURL* handle)
 {
+	static const S32 MAX_NUM_FREE_HANDLES = 32 ;
+
 	if (!handle)
 	{
-		llerrs << "handle cannot be NULL!" << llendl;
+		return ; //handle allocation failed.
+		//llerrs << "handle cannot be NULL!" << llendl;
 	}
 
 	LLMutexLock lock(sHandleMutexp) ;
 	if (sActiveHandles.find(handle) != sActiveHandles.end())
 	{
 		sActiveHandles.erase(handle);
-		sFreeHandles.insert(handle);
+
+		if(sFreeHandles.size() < MAX_NUM_FREE_HANDLES)
+		{
+			sFreeHandles.insert(handle);
+		}
+		else
+		{
+			LLCurl::deleteEasyHandle(handle) ;
+		}
 	}
 	else
 	{
@@ -517,8 +532,7 @@ void LLCurl::Easy::prepRequest(const std::string& url,
 }
 
 ////////////////////////////////////////////////////////////////////////////
-LLMutex* LLCurl::Multi::sMultiInitMutexp = NULL ;
-LLCurl::Multi::Multi()
+LLCurl::Multi::Multi(F32 idle_time_out)
 	: mQueued(0),
 	  mErrorCount(0),
 	  mState(STATE_READY),
@@ -527,28 +541,47 @@ LLCurl::Multi::Multi()
 	  mDeletionMutexp(NULL),
 	  mEasyMutexp(NULL)
 {
-	mCurlMultiHandle = initMulti();
+	mCurlMultiHandle = LLCurl::newMultiHandle();
 	if (!mCurlMultiHandle)
 	{
 		llwarns << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl;
-		mCurlMultiHandle = initMulti();
+		mCurlMultiHandle = LLCurl::newMultiHandle();
 	}
 	
-	llassert_always(mCurlMultiHandle);	
-
-	if(LLCurl::getCurlThread()->getThreaded())
+	//llassert_always(mCurlMultiHandle);	
+	
+	if(mCurlMultiHandle)
 	{
-		mMutexp = new LLMutex(NULL) ;
-		mDeletionMutexp = new LLMutex(NULL) ;
-		mEasyMutexp = new LLMutex(NULL) ;
-	}
-	LLCurl::getCurlThread()->addMulti(this) ;
+		if(LLCurl::getCurlThread()->getThreaded())
+		{
+			mMutexp = new LLMutex(NULL) ;
+			mDeletionMutexp = new LLMutex(NULL) ;
+			mEasyMutexp = new LLMutex(NULL) ;
+		}
+		LLCurl::getCurlThread()->addMulti(this) ;
+
+		mIdleTimeOut = idle_time_out ;
+		if(mIdleTimeOut < DEFAULT_MULTI_IDLE_TIME)
+		{
+			mIdleTimeOut = DEFAULT_MULTI_IDLE_TIME ;
+		}
 
-	++gCurlMultiCount;
+		++gCurlMultiCount;
+	}
 }
 
 LLCurl::Multi::~Multi()
 {
+	cleanup() ;	
+}
+
+void LLCurl::Multi::cleanup()
+{
+	if(!mCurlMultiHandle)
+	{
+		return ; //nothing to clean.
+	}
+
 	// Clean up active
 	for(easy_active_list_t::iterator iter = mEasyActiveList.begin();
 		iter != mEasyActiveList.end(); ++iter)
@@ -564,7 +597,8 @@ LLCurl::Multi::~Multi()
 	for_each(mEasyFreeList.begin(), mEasyFreeList.end(), DeletePointer());	
 	mEasyFreeList.clear();
 
-	check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle));
+	check_curl_multi_code(LLCurl::deleteMultiHandle(mCurlMultiHandle));
+	mCurlMultiHandle = NULL ;
 
 	delete mMutexp ;
 	mMutexp = NULL ;
@@ -572,15 +606,13 @@ LLCurl::Multi::~Multi()
 	mDeletionMutexp = NULL ;
 	delete mEasyMutexp ;
 	mEasyMutexp = NULL ;
-
+	
+	mQueued = 0 ;
+	mState = STATE_COMPLETED;
+	
 	--gCurlMultiCount;
-}
-
-CURLM* LLCurl::Multi::initMulti()
-{
-	LLMutexLock lock(sMultiInitMutexp) ;
 
-	return curl_multi_init() ;
+	return ;
 }
 
 void LLCurl::Multi::lock()
@@ -604,6 +636,7 @@ void LLCurl::Multi::markDead()
 	LLMutexLock lock(mDeletionMutexp) ;
 	
 	mDead = TRUE ;
+	LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ; 
 }
 
 void LLCurl::Multi::setState(LLCurl::Multi::ePerformState state)
@@ -630,6 +663,11 @@ bool LLCurl::Multi::isCompleted()
 
 bool LLCurl::Multi::waitToComplete()
 {
+	if(!isValid())
+	{
+		return true ;
+	}
+
 	if(!mMutexp) //not threaded
 	{
 		doPerform() ;
@@ -639,7 +677,7 @@ bool LLCurl::Multi::waitToComplete()
 	bool completed = (STATE_COMPLETED == mState) ;
 	if(!completed)
 	{
-		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_URGENT) ;
+		LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_HIGH) ;
 	}
 	
 	return completed;
@@ -689,7 +727,12 @@ bool LLCurl::Multi::doPerform()
 		}
 
 		mQueued = q;	
-		setState(STATE_COMPLETED) ;
+		setState(STATE_COMPLETED) ;		
+		mIdleTimer.reset() ;
+	}
+	else if(mIdleTimer.getElapsedTimeF32() > mIdleTimeOut) //idle for too long, remove it.
+	{
+		dead = true ;
 	}
 
 	return dead ;
@@ -697,6 +740,11 @@ bool LLCurl::Multi::doPerform()
 
 S32 LLCurl::Multi::process()
 {
+	if(!isValid())
+	{
+		return 0 ;
+	}
+
 	waitToComplete() ;
 
 	if (getState() != STATE_COMPLETED)
@@ -849,7 +897,11 @@ bool LLCurlThread::CurlRequest::processRequest()
 	if(mMulti)
 	{
 		completed = mCurlThread->doMultiPerform(mMulti) ;
-		setPriority(LLQueuedThread::PRIORITY_LOW) ;
+
+		if(!completed)
+		{
+			setPriority(LLQueuedThread::PRIORITY_LOW) ;
+		}
 	}
 
 	return completed ;
@@ -857,24 +909,26 @@ bool LLCurlThread::CurlRequest::processRequest()
 
 void LLCurlThread::CurlRequest::finishRequest(bool completed)
 {
-	mCurlThread->deleteMulti(mMulti) ;
+	if(mMulti->isDead())
+	{
+		mCurlThread->deleteMulti(mMulti) ;
+	}
+	else
+	{
+		mMulti->cleanup() ; //being idle too long, remove the request.
+	}
+
 	mMulti = NULL ;
 }
 	
 LLCurlThread::LLCurlThread(bool threaded) :
 	LLQueuedThread("curlthread", threaded)
 {
-	if(!LLCurl::Multi::sMultiInitMutexp)
-	{
-		LLCurl::Multi::sMultiInitMutexp = new LLMutex(NULL) ;
-	}
 }
 	
 //virtual 
 LLCurlThread::~LLCurlThread() 
 {
-	delete LLCurl::Multi::sMultiInitMutexp ;
-	LLCurl::Multi::sMultiInitMutexp = NULL ;
 }
 
 S32 LLCurlThread::update(F32 max_time_ms)
@@ -896,7 +950,19 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi)
 	
 void LLCurlThread::killMulti(LLCurl::Multi* multi)
 {
-	multi->markDead() ;
+	if(!multi)
+	{
+		return ;
+	}
+
+	if(multi->isValid())
+	{
+		multi->markDead() ;
+	}
+	else
+	{
+		deleteMulti(multi) ;
+	}
 }
 
 //private
@@ -942,7 +1008,14 @@ LLCurlRequest::~LLCurlRequest()
 void LLCurlRequest::addMulti()
 {
 	LLCurl::Multi* multi = new LLCurl::Multi();
-	
+	if(!multi->isValid())
+	{
+		LLCurl::getCurlThread()->killMulti(multi) ;
+		mActiveMulti = NULL ;
+		mActiveRequestCount = 0 ;
+		return;
+	}
+
 	mMultiSet.insert(multi);
 	mActiveMulti = multi;
 	mActiveRequestCount = 0;
@@ -1066,6 +1139,19 @@ S32 LLCurlRequest::process()
 	{
 		curlmulti_set_t::iterator curiter = iter++;
 		LLCurl::Multi* multi = *curiter;
+
+		if(!multi->isValid())
+		{
+			if(multi == mActiveMulti)
+			{				
+				mActiveMulti = NULL ;
+				mActiveRequestCount = 0 ;
+			}
+			mMultiSet.erase(curiter) ;
+			LLCurl::getCurlThread()->killMulti(multi) ;
+			continue ;
+		}
+
 		S32 tres = multi->process();
 		res += tres;
 		if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0)
@@ -1086,6 +1172,19 @@ S32 LLCurlRequest::getQueued()
 	{
 		curlmulti_set_t::iterator curiter = iter++;
 		LLCurl::Multi* multi = *curiter;
+		
+		if(!multi->isValid())
+		{
+			if(multi == mActiveMulti)
+			{				
+				mActiveMulti = NULL ;
+				mActiveRequestCount = 0 ;
+			}
+			LLCurl::getCurlThread()->killMulti(multi);
+			mMultiSet.erase(curiter) ;
+			continue ;
+		}
+
 		queued += multi->mQueued;
 		if (multi->getState() != LLCurl::Multi::STATE_READY)
 		{
@@ -1105,13 +1204,22 @@ LLCurlEasyRequest::LLCurlEasyRequest()
 {
 	mMulti = new LLCurl::Multi();
 	
-	mEasy = mMulti->allocEasy();
-	if (mEasy)
+	if(mMulti->isValid())
 	{
-		mEasy->setErrorBuffer();
-		mEasy->setCA();
-		// Set proxy settings if configured to do so.
-		LLProxy::getInstance()->applyProxySettings(mEasy);
+		mEasy = mMulti->allocEasy();
+		if (mEasy)
+		{
+			mEasy->setErrorBuffer();
+			mEasy->setCA();
+			// Set proxy settings if configured to do so.
+			LLProxy::getInstance()->applyProxySettings(mEasy);
+		}
+	}
+	else
+	{
+		LLCurl::getCurlThread()->killMulti(mMulti) ;
+		mEasy = NULL ;
+		mMulti = NULL ;
 	}
 }
 
@@ -1122,7 +1230,7 @@ LLCurlEasyRequest::~LLCurlEasyRequest()
 	
 void LLCurlEasyRequest::setopt(CURLoption option, S32 value)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setopt(option, value);
 	}
@@ -1130,7 +1238,7 @@ void LLCurlEasyRequest::setopt(CURLoption option, S32 value)
 
 void LLCurlEasyRequest::setoptString(CURLoption option, const std::string& value)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setoptString(option, value);
 	}
@@ -1138,7 +1246,7 @@ void LLCurlEasyRequest::setoptString(CURLoption option, const std::string& value
 
 void LLCurlEasyRequest::setPost(char* postdata, S32 size)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setopt(CURLOPT_POST, 1);
 		mEasy->setopt(CURLOPT_POSTFIELDS, postdata);
@@ -1148,7 +1256,7 @@ void LLCurlEasyRequest::setPost(char* postdata, S32 size)
 
 void LLCurlEasyRequest::setHeaderCallback(curl_header_callback callback, void* userdata)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setopt(CURLOPT_HEADERFUNCTION, (void*)callback);
 		mEasy->setopt(CURLOPT_HEADERDATA, userdata); // aka CURLOPT_WRITEHEADER
@@ -1157,7 +1265,7 @@ void LLCurlEasyRequest::setHeaderCallback(curl_header_callback callback, void* u
 
 void LLCurlEasyRequest::setWriteCallback(curl_write_callback callback, void* userdata)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setopt(CURLOPT_WRITEFUNCTION, (void*)callback);
 		mEasy->setopt(CURLOPT_WRITEDATA, userdata);
@@ -1166,7 +1274,7 @@ void LLCurlEasyRequest::setWriteCallback(curl_write_callback callback, void* use
 
 void LLCurlEasyRequest::setReadCallback(curl_read_callback callback, void* userdata)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setopt(CURLOPT_READFUNCTION, (void*)callback);
 		mEasy->setopt(CURLOPT_READDATA, userdata);
@@ -1175,7 +1283,7 @@ void LLCurlEasyRequest::setReadCallback(curl_read_callback callback, void* userd
 
 void LLCurlEasyRequest::setSSLCtxCallback(curl_ssl_ctx_callback callback, void* userdata)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setopt(CURLOPT_SSL_CTX_FUNCTION, (void*)callback);
 		mEasy->setopt(CURLOPT_SSL_CTX_DATA, userdata);
@@ -1184,7 +1292,7 @@ void LLCurlEasyRequest::setSSLCtxCallback(curl_ssl_ctx_callback callback, void*
 
 void LLCurlEasyRequest::slist_append(const char* str)
 {
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->slist_append(str);
 	}
@@ -1195,7 +1303,7 @@ void LLCurlEasyRequest::sendRequest(const std::string& url)
 	llassert_always(!mRequestSent);
 	mRequestSent = true;
 	lldebugs << url << llendl;
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mEasy->setHeaders();
 		mEasy->setoptString(CURLOPT_URL, url);
@@ -1207,7 +1315,7 @@ void LLCurlEasyRequest::requestComplete()
 {
 	llassert_always(mRequestSent);
 	mRequestSent = false;
-	if (mEasy)
+	if (isValid() && mEasy)
 	{
 		mMulti->removeEasy(mEasy);
 	}
@@ -1216,6 +1324,10 @@ void LLCurlEasyRequest::requestComplete()
 // Usage: Call getRestult until it returns false (no more messages)
 bool LLCurlEasyRequest::getResult(CURLcode* result, LLCurl::TransferInfo* info)
 {
+	if(!isValid())
+	{
+		return false ;
+	}
 	if (!mMulti->isCompleted())
 	{ //we're busy, try again later
 		return false;
@@ -1280,7 +1392,7 @@ CURLMsg* LLCurlEasyRequest::info_read(S32* q, LLCurl::TransferInfo* info)
 
 std::string LLCurlEasyRequest::getErrorString()
 {
-	return mEasy ? std::string(mEasy->getErrorBuffer()) : std::string();
+	return isValid() &&  mEasy ? std::string(mEasy->getErrorBuffer()) : std::string();
 }
 
 ////////////////////////////////////////////////////////////////////////////
@@ -1328,6 +1440,7 @@ void LLCurl::initClass(bool multi_threaded)
 	sCurlThread = new LLCurlThread(multi_threaded) ;
 	if(multi_threaded)
 	{
+		sHandleMutexp = new LLMutex(NULL) ;
 		Easy::sHandleMutexp = new LLMutex(NULL) ;
 	}
 }
@@ -1354,7 +1467,7 @@ void LLCurl::cleanupClass()
 	for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
 	{
 		CURL* curl = *iter;
-		curl_easy_cleanup(curl);
+		LLCurl::deleteEasyHandle(curl);
 	}
 
 	Easy::sFreeHandles.clear();
@@ -1362,9 +1475,77 @@ void LLCurl::cleanupClass()
 	delete Easy::sHandleMutexp ;
 	Easy::sHandleMutexp = NULL ;
 
+	delete sHandleMutexp ;
+	sHandleMutexp = NULL ;
+
 	llassert(Easy::sActiveHandles.empty());
 }
 
+//static 
+CURLM* LLCurl::newMultiHandle()
+{
+	LLMutexLock lock(sHandleMutexp) ;
+
+	if(sTotalHandles + 1 > MAX_NUM_OF_HANDLES)
+	{
+		llwarns << "no more handles available." << llendl ;
+		return NULL ; //failed
+	}
+	sTotalHandles++;
+
+	CURLM* ret = curl_multi_init() ;
+	if(!ret)
+	{
+		llwarns << "curl_multi_init failed." << llendl ;
+	}
+
+	return ret ;
+}
+
+//static 
+CURLMcode  LLCurl::deleteMultiHandle(CURLM* handle)
+{
+	if(handle)
+	{
+		LLMutexLock lock(sHandleMutexp) ;		
+		sTotalHandles-- ;
+		return curl_multi_cleanup(handle) ;
+	}
+	return CURLM_OK ;
+}
+
+//static 
+CURL*  LLCurl::newEasyHandle()
+{
+	LLMutexLock lock(sHandleMutexp) ;
+
+	if(sTotalHandles + 1 > MAX_NUM_OF_HANDLES)
+	{
+		llwarns << "no more handles available." << llendl ;
+		return NULL ; //failed
+	}
+	sTotalHandles++;
+
+	CURL* ret = curl_easy_init() ;
+	if(!ret)
+	{
+		llwarns << "curl_easy_init failed." << llendl ;
+	}
+
+	return ret ;
+}
+
+//static 
+void  LLCurl::deleteEasyHandle(CURL* handle)
+{
+	if(handle)
+	{
+		LLMutexLock lock(sHandleMutexp) ;
+		curl_easy_cleanup(handle) ;
+		sTotalHandles-- ;
+	}
+}
+
 const unsigned int LLCurl::MAX_REDIRECTS = 5;
 
 // Provide access to LLCurl free functions outside of llcurl.cpp without polluting the global namespace.
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 9c2c215c7a6..32da911cbf3 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -43,6 +43,7 @@
 #include "llsd.h"
 #include "llthread.h"
 #include "llqueuedthread.h"
+#include "llframetimer.h"
 
 class LLMutex;
 class LLCurlThread;
@@ -182,11 +183,20 @@ class LLCurl
 	static unsigned long ssl_thread_id(void);
 
 	static LLCurlThread* getCurlThread() { return sCurlThread ;}
+
+	static CURLM* newMultiHandle() ;
+	static CURLMcode deleteMultiHandle(CURLM* handle) ;
+	static CURL*  newEasyHandle() ;
+	static void   deleteEasyHandle(CURL* handle) ;
+
 private:
 	static std::string sCAPath;
 	static std::string sCAFile;
 	static const unsigned int MAX_REDIRECTS;
 	static LLCurlThread* sCurlThread;
+
+	static LLMutex* sHandleMutexp ;
+	static S32      sTotalHandles ;
 };
 
 class LLCurl::Easy
@@ -277,7 +287,7 @@ class LLCurl::Multi
 		STATE_COMPLETED=2
 	} ePerformState;
 
-	Multi();	
+	Multi(F32 idle_time_out = 0.f);	
 
 	LLCurl::Easy* allocEasy();
 	bool addEasy(LLCurl::Easy* easy);	
@@ -288,7 +298,10 @@ class LLCurl::Multi
 
 	void setState(ePerformState state) ;
 	ePerformState getState() ;
+	
 	bool isCompleted() ;
+	bool isValid() {return mCurlMultiHandle != NULL ;}
+	bool isDead() {return mDead;}
 
 	bool waitToComplete() ;
 
@@ -299,9 +312,9 @@ class LLCurl::Multi
 	S32 mQueued;
 	S32 mErrorCount;
 	
-	static CURLM* initMulti() ;
 private:
 	void easyFree(LLCurl::Easy*);
+	void cleanup() ;
 	
 	CURLM* mCurlMultiHandle;
 
@@ -319,8 +332,8 @@ class LLCurl::Multi
 	LLMutex* mMutexp ;
 	LLMutex* mDeletionMutexp ;
 	LLMutex* mEasyMutexp ;
-
-	static LLMutex* sMultiInitMutexp ;
+	LLFrameTimer mIdleTimer ;
+	F32 mIdleTimeOut;
 };
 
 class LLCurlThread : public LLQueuedThread
@@ -414,6 +427,7 @@ class LLCurlEasyRequest
 	std::string getErrorString();
 	bool isCompleted() {return mMulti->isCompleted() ;}
 	bool wait() { return mMulti->waitToComplete(); }
+	bool isValid() {return mMulti && mMulti->isValid(); }
 
 	LLCurl::Easy* getEasy() const { return mEasy; }
 
diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp
index 2bca517e97a..612d765969e 100644
--- a/indra/llmessage/llhttpassetstorage.cpp
+++ b/indra/llmessage/llhttpassetstorage.cpp
@@ -232,7 +232,8 @@ LLSD LLHTTPAssetRequest::getFullDetails() const
 void LLHTTPAssetRequest::setupCurlHandle()
 {
 	// *NOTE: Similar code exists in mapserver/llcurlutil.cpp  JC
-	mCurlHandle = curl_easy_init();
+	mCurlHandle = LLCurl::newEasyHandle();
+	llassert_always(mCurlHandle != NULL) ;
 
 	// Apply proxy settings if configured to do so
 	LLProxy::getInstance()->applyProxySettings(mCurlHandle);
@@ -278,7 +279,7 @@ void LLHTTPAssetRequest::setupCurlHandle()
 
 void LLHTTPAssetRequest::cleanupCurlHandle()
 {
-	curl_easy_cleanup(mCurlHandle);
+	LLCurl::deleteEasyHandle(mCurlHandle);
 	if (mAssetStoragep)
 	{
 		// Terminating a request.  Thus upload or download is no longer pending.
@@ -429,12 +430,13 @@ void LLHTTPAssetStorage::_init(const std::string& web_host, const std::string& l
 
 	// curl_global_init moved to LLCurl::initClass()
 	
-	mCurlMultiHandle = curl_multi_init();
+	mCurlMultiHandle = LLCurl::newMultiHandle() ;
+	llassert_always(mCurlMultiHandle != NULL) ;
 }
 
 LLHTTPAssetStorage::~LLHTTPAssetStorage()
 {
-	curl_multi_cleanup(mCurlMultiHandle);
+	LLCurl::deleteMultiHandle(mCurlMultiHandle);
 	mCurlMultiHandle = NULL;
 	
 	// curl_global_cleanup moved to LLCurl::initClass()
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index dd4e3a63007..231cb7ca8f6 100644
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -228,6 +228,12 @@ static void request(
 	LLPumpIO::chain_t chain;
 
 	LLURLRequest* req = new LLURLRequest(method, url);
+	if(!req->isValid())//failed
+	{
+		delete req ;
+		return ;
+	}
+
 	req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req);
 
 	
@@ -423,7 +429,9 @@ static LLSD blocking_request(
 {
 	lldebugs << "blockingRequest of " << url << llendl;
 	char curl_error_buffer[CURL_ERROR_SIZE] = "\0";
-	CURL* curlp = curl_easy_init();
+	CURL* curlp = LLCurl::newEasyHandle();
+	llassert_always(curlp != NULL) ;
+
 	LLHTTPBuffer http_buffer;
 	std::string body_str;
 	
@@ -517,7 +525,7 @@ static LLSD blocking_request(
 	}
 
 	// * Cleanup
-	curl_easy_cleanup(curlp);
+	LLCurl::deleteEasyHandle(curlp);
 	return response;
 }
 
diff --git a/indra/llmessage/lliopipe.cpp b/indra/llmessage/lliopipe.cpp
index 6e4eec74a65..8f827f7a307 100644
--- a/indra/llmessage/lliopipe.cpp
+++ b/indra/llmessage/lliopipe.cpp
@@ -75,6 +75,12 @@ LLIOPipe::~LLIOPipe()
 	//lldebugs << "destroying LLIOPipe" << llendl;
 }
 
+//virtual 
+bool LLIOPipe::isValid() 
+{
+	return true ;
+}
+
 // static
 std::string LLIOPipe::lookupStatusString(EStatus status)
 {
diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h
index 8e656b6da1c..cbd17b5a3d9 100644
--- a/indra/llmessage/lliopipe.h
+++ b/indra/llmessage/lliopipe.h
@@ -231,6 +231,8 @@ class LLIOPipe
 	 */
 	virtual ~LLIOPipe();
 
+	virtual bool isValid() ;
+
 protected:
 	/**
 	 * @brief Base Constructor.
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index a8d2a0a2240..0ff300efd0e 100644
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -195,7 +195,7 @@ bool LLPumpIO::prime(apr_pool_t* pool)
 	return ((pool == NULL) ? false : true);
 }
 
-bool LLPumpIO::addChain(const chain_t& chain, F32 timeout)
+bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request)
 {
 	LLMemType m1(LLMemType::MTYPE_IO_PUMP);
 	if(chain.empty()) return false;
@@ -204,6 +204,7 @@ bool LLPumpIO::addChain(const chain_t& chain, F32 timeout)
 	LLScopedLock lock(mChainsMutex);
 #endif
 	LLChainInfo info;
+	info.mHasCurlRequest = has_curl_request;
 	info.setTimeoutSeconds(timeout);
 	info.mData = LLIOPipe::buffer_ptr_t(new LLBufferArray);
 	LLLinkInfo link;
@@ -440,6 +441,15 @@ void LLPumpIO::pump()
 
 static LLFastTimer::DeclareTimer FTM_PUMP_IO("Pump IO");
 
+LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t& run_chain) 
+{
+	std::for_each(
+				(*run_chain).mDescriptors.begin(),
+				(*run_chain).mDescriptors.end(),
+				ll_delete_apr_pollset_fd_client_data());
+	return mRunningChains.erase(run_chain);
+}
+
 //timeout is in microseconds
 void LLPumpIO::pump(const S32& poll_timeout)
 {
@@ -585,10 +595,16 @@ void LLPumpIO::pump(const S32& poll_timeout)
 //						<< (*run_chain).mChainLinks[0].mPipe
 //						<< " because we reached the end." << llendl;
 #endif
-				run_chain = mRunningChains.erase(run_chain);
+				run_chain = removeRunningChain(run_chain);
 				continue;
 			}
 		}
+		else if(isChainExpired(*run_chain))
+		{
+			run_chain = removeRunningChain(run_chain);
+			continue;
+		}
+
 		PUMP_DEBUG;
 		if((*run_chain).mLock)
 		{
@@ -696,11 +712,7 @@ void LLPumpIO::pump(const S32& poll_timeout)
 			PUMP_DEBUG;
 			// This chain is done. Clean up any allocated memory and
 			// erase the chain info.
-			std::for_each(
-				(*run_chain).mDescriptors.begin(),
-				(*run_chain).mDescriptors.end(),
-				ll_delete_apr_pollset_fd_client_data());
-			run_chain = mRunningChains.erase(run_chain);
+			run_chain = removeRunningChain(run_chain);
 
 			// *NOTE: may not always need to rebuild the pollset.
 			mRebuildPollset = true;
@@ -1095,6 +1107,24 @@ void LLPumpIO::processChain(LLChainInfo& chain)
 	PUMP_DEBUG;
 }
 
+bool LLPumpIO::isChainExpired(LLChainInfo& chain)
+{
+	if(!chain.mHasCurlRequest)
+	{
+		return false ;
+	}
+
+	for(links_t::iterator iter = chain.mChainLinks.begin(); iter != chain.mChainLinks.end(); ++iter)
+	{
+		if(!(*iter).mPipe->isValid())
+		{
+			return true ;
+		}
+	}
+
+	return false ;
+}
+
 bool LLPumpIO::handleChainError(
 	LLChainInfo& chain,
 	LLIOPipe::EStatus error)
@@ -1136,6 +1166,9 @@ bool LLPumpIO::handleChainError(
 #endif
 			keep_going = false;
 			break;
+		case LLIOPipe::STATUS_EXPIRED:
+			keep_going = false;
+			break ;
 		default:
 			if(LLIOPipe::isSuccess(error))
 			{
@@ -1157,7 +1190,8 @@ bool LLPumpIO::handleChainError(
 LLPumpIO::LLChainInfo::LLChainInfo() :
 	mInit(false),
 	mLock(0),
-	mEOS(false)
+	mEOS(false),
+	mHasCurlRequest(false)
 {
 	LLMemType m1(LLMemType::MTYPE_IO_PUMP);
 	mTimer.setTimerExpirySec(DEFAULT_CHAIN_EXPIRY_SECS);
diff --git a/indra/llmessage/llpumpio.h b/indra/llmessage/llpumpio.h
index 9303c9d7fcf..e405124403a 100644
--- a/indra/llmessage/llpumpio.h
+++ b/indra/llmessage/llpumpio.h
@@ -113,7 +113,7 @@ class LLPumpIO
 	 * expire. Pass in 0.0f to never expire.
 	 * @return Returns true if anything was added to the pump.
 	 */
-	bool addChain(const chain_t& chain, F32 timeout);
+	bool addChain(const chain_t& chain, F32 timeout, bool has_curl_request = false);
 	
 	/** 
 	 * @brief Struct to associate a pipe with it's buffer io indexes.
@@ -356,12 +356,13 @@ class LLPumpIO
 
 		// basic member data
 		bool mInit;
+		bool mEOS;
+		bool mHasCurlRequest;
 		S32 mLock;
 		LLFrameTimer mTimer;
 		links_t::iterator mHead;
 		links_t mChainLinks;
-		LLIOPipe::buffer_ptr_t mData;
-		bool mEOS;
+		LLIOPipe::buffer_ptr_t mData;		
 		LLSD mContext;
 
 		// tracking inside the pump
@@ -402,7 +403,7 @@ class LLPumpIO
 protected:
 	void initialize(apr_pool_t* pool);
 	void cleanup();
-
+	current_chain_t removeRunningChain(current_chain_t& chain) ;
 	/** 
 	 * @brief Given the internal state of the chains, rebuild the pollset
 	 * @see setConditional()
@@ -429,6 +430,9 @@ class LLPumpIO
 	 */
 	bool handleChainError(LLChainInfo& chain, LLIOPipe::EStatus error);
 
+	//if the chain is expired, remove it
+	bool isChainExpired(LLChainInfo& chain) ;
+
 public:
 	/** 
 	 * @brief Return number of running chains.
diff --git a/indra/llmessage/llsdrpcclient.h b/indra/llmessage/llsdrpcclient.h
index 9fb49a5c330..235077179e0 100644
--- a/indra/llmessage/llsdrpcclient.h
+++ b/indra/llmessage/llsdrpcclient.h
@@ -239,6 +239,8 @@ class LLSDRPCClientFactory : public LLChainIOFactory
 	LLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {}
 	virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
 	{
+		llerrs << "Can not call this." << llendl ;
+
 		lldebugs << "LLSDRPCClientFactory::build" << llendl;
 		LLIOPipe::ptr_t service(new Client);
 		chain.push_back(service);
@@ -282,6 +284,7 @@ class LLXMLSDRPCClientFactory : public LLChainIOFactory
 	LLXMLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {}
 	virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
 	{
+		llerrs << "who calls this?" << llendl ;
 		lldebugs << "LLXMLSDRPCClientFactory::build" << llendl;
 		LLIOPipe::ptr_t service(new Client);
 		chain.push_back(service);
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 261e57e79e4..f02c6368380 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -83,6 +83,12 @@ LLURLRequestDetail::LLURLRequestDetail() :
 {
 	LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
 	mCurlRequest = new LLCurlEasyRequest();
+	
+	if(!mCurlRequest->isValid()) //failed.
+	{
+		delete mCurlRequest ;
+		mCurlRequest = NULL ;
+	}
 }
 
 LLURLRequestDetail::~LLURLRequestDetail()
@@ -250,12 +256,24 @@ void LLURLRequest::allowCookies()
 	mDetail->mCurlRequest->setoptString(CURLOPT_COOKIEFILE, "");
 }
 
+//virtual 
+bool LLURLRequest::isValid() 
+{
+	return mDetail->mCurlRequest && mDetail->mCurlRequest->isValid(); 
+}
+
 // virtual
 LLIOPipe::EStatus LLURLRequest::handleError(
 	LLIOPipe::EStatus status,
 	LLPumpIO* pump)
 {
 	LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
+	
+	if(!isValid())
+	{
+		return STATUS_EXPIRED ;
+	}
+
 	if(mCompletionCallback && pump)
 	{
 		LLURLRequestComplete* complete = NULL;
diff --git a/indra/llmessage/llurlrequest.h b/indra/llmessage/llurlrequest.h
index ec5c2c19414..44d358d906f 100644
--- a/indra/llmessage/llurlrequest.h
+++ b/indra/llmessage/llurlrequest.h
@@ -188,6 +188,8 @@ class LLURLRequest : public LLIOPipe
 	 */
 	void allowCookies();
 
+	/*virtual*/ bool isValid() ;
+
 public:
 	/** 
 	 * @brief Give this pipe a chance to handle a generated error
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a97e256c899..c64479f5898 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -498,9 +498,11 @@ void LLMeshRepoThread::run()
 					LODRequest req = mLODReqQ.front();
 					mLODReqQ.pop();
 					mMutex->unlock();
-					if (fetchMeshLOD(req.mMeshParams, req.mLOD))
+					if (!fetchMeshLOD(req.mMeshParams, req.mLOD, count))//failed, resubmit
 					{
-						count++;
+						mMutex->lock();
+						mLODReqQ.push(req) ; 
+						mMutex->unlock();
 					}
 				}
 			}
@@ -512,9 +514,11 @@ void LLMeshRepoThread::run()
 					HeaderRequest req = mHeaderReqQ.front();
 					mHeaderReqQ.pop();
 					mMutex->unlock();
-					if (fetchMeshHeader(req.mMeshParams))
+					if (!fetchMeshHeader(req.mMeshParams, count))//failed, resubmit
 					{
-						count++;
+						mMutex->lock();
+						mHeaderReqQ.push(req) ;
+						mMutex->unlock();
 					}
 				}
 			}
@@ -658,6 +662,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 		return false;
 	}
 
+	bool ret = true ;
 	U32 header_size = mMeshHeaderSize[mesh_id];
 	
 	if (header_size > 0)
@@ -673,7 +678,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 			//check VFS for mesh skin info
 			LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
 			if (file.getSize() >= offset+size)
-			{
+			{				
 				LLMeshRepository::sCacheBytesRead += size;
 				file.seek(offset);
 				U8* buffer = new U8[size];
@@ -689,7 +694,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 				if (!zero)
 				{ //attempt to parse
 					if (skinInfoReceived(mesh_id, buffer, size))
-					{
+					{						
 						delete[] buffer;
 						return true;
 					}
@@ -704,11 +709,14 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
-			{
-				++sActiveLODRequests;
-				LLMeshRepository::sHTTPRequestCount++;
-				mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
+			{				
+				ret = mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshSkinInfoResponder(mesh_id, offset, size));
+				if(ret)
+				{
+					++sActiveLODRequests;
+					LLMeshRepository::sHTTPRequestCount++;
+				}
 			}
 		}
 	}
@@ -718,7 +726,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 	}
 
 	//early out was not hit, effectively fetched
-	return true;
+	return ret;
 }
 
 bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
@@ -732,7 +740,8 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 	}
 
 	U32 header_size = mMeshHeaderSize[mesh_id];
-
+	bool ret = true ;
+	
 	if (header_size > 0)
 	{
 		S32 version = mMeshHeader[mesh_id]["version"].asInteger();
@@ -748,6 +757,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 			if (file.getSize() >= offset+size)
 			{
 				LLMeshRepository::sCacheBytesRead += size;
+
 				file.seek(offset);
 				U8* buffer = new U8[size];
 				file.read(buffer, size);
@@ -777,11 +787,14 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
-			{
-				++sActiveLODRequests;
-				LLMeshRepository::sHTTPRequestCount++;
-				mCurlRequest->getByteRange(http_url, headers, offset, size,
+			{				
+				ret = mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshDecompositionResponder(mesh_id, offset, size));
+				if(ret)
+				{
+					++sActiveLODRequests;
+					LLMeshRepository::sHTTPRequestCount++;
+				}
 			}
 		}
 	}
@@ -791,7 +804,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 	}
 
 	//early out was not hit, effectively fetched
-	return true;
+	return ret;
 }
 
 bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
@@ -805,6 +818,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 	}
 
 	U32 header_size = mMeshHeaderSize[mesh_id];
+	bool ret = true ;
 
 	if (header_size > 0)
 	{
@@ -850,11 +864,15 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
-			{
-				++sActiveLODRequests;
-				LLMeshRepository::sHTTPRequestCount++;
-				mCurlRequest->getByteRange(http_url, headers, offset, size,
+			{				
+				ret = mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshPhysicsShapeResponder(mesh_id, offset, size));
+
+				if(ret)
+				{
+					++sActiveLODRequests;
+					LLMeshRepository::sHTTPRequestCount++;
+				}
 			}
 		}
 		else
@@ -868,13 +886,12 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 	}
 
 	//early out was not hit, effectively fetched
-	return true;
+	return ret;
 }
 
-bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
+//return false if failed to get header
+bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count)
 {
-	bool retval = false;
-
 	{
 		//look for mesh in asset in vfs
 		LLVFile file(gVFS, mesh_params.getSculptID(), LLAssetType::AT_MESH);
@@ -889,36 +906,40 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
 			file.read(buffer, bytes);
 			if (headerReceived(mesh_params, buffer, bytes))
 			{ //did not do an HTTP request, return false
-				return false;
+				return true;
 			}
 		}
 	}
 
-	//either cache entry doesn't exist or is corrupt, request header from simulator
-
+	//either cache entry doesn't exist or is corrupt, request header from simulator	
+	bool retval = true ;
 	std::vector<std::string> headers;
 	headers.push_back("Accept: application/octet-stream");
 
 	std::string http_url = constructUrl(mesh_params.getSculptID());
 	if (!http_url.empty())
 	{
-		++sActiveHeaderRequests;
-		retval = true;
 		//grab first 4KB if we're going to bother with a fetch.  Cache will prevent future fetches if a full mesh fits
 		//within the first 4KB
-		//NOTE -- this will break of headers ever exceed 4KB
-		LLMeshRepository::sHTTPRequestCount++;
-		mCurlRequest->getByteRange(http_url, headers, 0, 4096, new LLMeshHeaderResponder(mesh_params));
+		//NOTE -- this will break of headers ever exceed 4KB		
+		retval = mCurlRequest->getByteRange(http_url, headers, 0, 4096, new LLMeshHeaderResponder(mesh_params));
+		if(retval)
+		{
+			++sActiveHeaderRequests;
+			LLMeshRepository::sHTTPRequestCount++;
+		}
+		count++;
 	}
 
 	return retval;
 }
 
-bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
+//return false if failed to get mesh lod.
+bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count)
 { //protected by mMutex
 	mHeaderMutex->lock();
 
-	bool retval = false;
+	bool retval = true;
 
 	LLUUID mesh_id = mesh_params.getSculptID();
 	
@@ -955,7 +976,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 					if (lodReceived(mesh_params, lod, buffer, size))
 					{
 						delete[] buffer;
-						return false;
+						return true;
 					}
 				}
 
@@ -968,12 +989,16 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
-			{
-				++sActiveLODRequests;
-				retval = true;
-				LLMeshRepository::sHTTPRequestCount++;
-				mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
+			{				
+				retval = mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
 										   new LLMeshLODResponder(mesh_params, lod, offset, size));
+
+				if(retval)
+				{
+					++sActiveLODRequests;				
+					LLMeshRepository::sHTTPRequestCount++;
+				}
+				count++;
 			}
 			else
 			{
@@ -1540,8 +1565,17 @@ void LLMeshUploadThread::doWholeModelUpload()
 		LLSD body = full_model_data["asset_resources"];
 		dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num));
 		LLCurlRequest::headers_t headers;
-		mCurlRequest->post(mWholeModelUploadURL, headers, body,
-						   new LLWholeModelUploadResponder(this, full_model_data, mUploadObserverHandle), mMeshUploadTimeOut);
+
+		{
+			LLCurl::ResponderPtr responder = new LLWholeModelUploadResponder(this, full_model_data, mUploadObserverHandle) ;
+
+			while(!mCurlRequest->post(mWholeModelUploadURL, headers, body, responder, mMeshUploadTimeOut))
+			{
+				//sleep for 10ms to prevent eating a whole core
+				apr_sleep(10000);
+			}
+		}
+
 		do
 		{
 			mCurlRequest->process();
@@ -1571,8 +1605,15 @@ void LLMeshUploadThread::requestWholeModelFee()
 
 	mPendingUploads++;
 	LLCurlRequest::headers_t headers;
-	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
-					   new LLWholeModelFeeResponder(this,model_data, mFeeObserverHandle), mMeshUploadTimeOut);
+
+	{
+		LLCurl::ResponderPtr responder = new LLWholeModelFeeResponder(this,model_data, mFeeObserverHandle) ;
+		while(!mCurlRequest->post(mWholeModelFeeCapability, headers, model_data, responder, mMeshUploadTimeOut))
+		{
+			//sleep for 10ms to prevent eating a whole core
+			apr_sleep(10000);
+		}
+	}
 
 	do
 	{
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 31b84ea0d9f..2efe810438c 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -323,8 +323,8 @@ class LLMeshRepoThread : public LLThread
 	virtual void run();
 
 	void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
-	bool fetchMeshHeader(const LLVolumeParams& mesh_params);
-	bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
+	bool fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count);
+	bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count);
 	bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size);
 	bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size);
 	bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size);
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 920a9a37528..0da70d398b0 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -305,6 +305,15 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
 	{
 		mCurlRequest = new LLCurlEasyRequest();
 	}
+	if(!mCurlRequest->isValid())
+	{
+		llwarns << "mCurlRequest is invalid." << llendl ;
+
+		delete mCurlRequest ;
+		mCurlRequest = NULL ;
+		return ;
+	}
+
 	mErrorCert = NULL;
 
 //	mCurlRequest->setopt(CURLOPT_VERBOSE, 1); // useful for debugging
@@ -357,10 +366,20 @@ LLXMLRPCTransaction::Impl::~Impl()
 	}
 	
 	delete mCurlRequest;
+	mCurlRequest = NULL ;
 }
 
 bool LLXMLRPCTransaction::Impl::process()
 {
+	if(!mCurlRequest || !mCurlRequest->isValid())
+	{
+		llwarns << "transaction failed." << llendl ;
+
+		delete mCurlRequest ;
+		mCurlRequest = NULL ;
+		return true ; //failed, quit.
+	}
+
 	switch(mStatus)
 	{
 		case LLXMLRPCTransaction::StatusComplete:
diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp
index e88d1bf811d..19ac418e9ef 100644
--- a/indra/viewer_components/updater/llupdatedownloader.cpp
+++ b/indra/viewer_components/updater/llupdatedownloader.cpp
@@ -39,7 +39,7 @@
 #include "llsdserialize.h"
 #include "llthread.h"
 #include "llupdaterservice.h"
-
+#include "llcurl.h"
 
 class LLUpdateDownloader::Implementation:
 	public LLThread
@@ -198,13 +198,19 @@ LLUpdateDownloader::Implementation::Implementation(LLUpdateDownloader::Client &
 
 LLUpdateDownloader::Implementation::~Implementation()
 {
-	if(isDownloading()) {
+	if(isDownloading()) 
+	{
 		cancel();
 		shutdown();
-	} else {
+	} 
+	else 
+	{
 		; // No op.
 	}
-	if(mCurl) curl_easy_cleanup(mCurl);
+	if(mCurl)
+	{
+		LLCurl::deleteEasyHandle(mCurl);
+	}
 }
 
 
@@ -406,9 +412,12 @@ void LLUpdateDownloader::Implementation::run(void)
 
 void LLUpdateDownloader::Implementation::initializeCurlGet(std::string const & url, bool processHeader)
 {
-	if(mCurl == 0) {
-		mCurl = curl_easy_init();
-	} else {
+	if(mCurl == 0) 
+	{
+		mCurl = LLCurl::newEasyHandle();
+	} 
+	else 
+	{
 		curl_easy_reset(mCurl);
 	}
 	
-- 
GitLab


From ba41aea4b2813ac96cad2bae7c82da6e5eefd63a Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 12 Jan 2012 17:01:23 -0800
Subject: [PATCH 553/933] EXP-1795 FIX -- Update warning dialog for dragging
 and dropping no-copy items to Merchant Outbox

* Any drag and drop or copy operation to the merchant outbox that contains one
  or more no-copy items now brings up a single modal dialog prompting the user
  to move the no-copy items to the outbox or to leave them all behind.
---
 indra/newview/llinventorybridge.cpp           |  8 +--
 indra/newview/llinventoryfunctions.cpp        | 60 ++++++++++++++-----
 indra/newview/llinventoryfunctions.h          |  4 +-
 indra/newview/lltooldraganddrop.cpp           |  8 +++
 indra/newview/lltooldraganddrop.h             |  3 +
 .../skins/default/xui/en/notifications.xml    | 11 ++--
 6 files changed, 66 insertions(+), 28 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1d7406883c0..11e22d5226a 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1323,7 +1323,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
 		if (!itemp) return;
 
 		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
-		copy_item_to_outbox(itemp, outbox_id, LLUUID::null);
+		copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId());
 	}
 }
 
@@ -2221,7 +2221,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else if (move_is_into_outbox && !move_is_from_outbox)
 			{
-				copy_folder_to_outbox(inv_cat, mUUID, cat_id);
+				copy_folder_to_outbox(inv_cat, mUUID, cat_id, LLToolDragAndDrop::getOperationId());
 			}
 			else
 			{
@@ -2655,7 +2655,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
 		if (!cat) return;
 
 		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
-		copy_folder_to_outbox(cat, outbox_id, cat->getUUID());
+		copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId());
 	}
 #if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
 	else if (isMarketplaceSendAction(action))
@@ -3694,7 +3694,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 				}
 				else
 				{
-					copy_item_to_outbox(inv_item, mUUID, LLUUID::null);
+					copy_item_to_outbox(inv_item, mUUID, LLUUID::null, LLToolDragAndDrop::getOperationId());
 				}
 			}
 			// NORMAL or TRASH folder
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index e8efac1ebfb..7672f7e6742 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -82,6 +82,8 @@
 #include "llvoavatarself.h"
 #include "llwearablelist.h"
 
+#include <boost/foreach.hpp>
+
 BOOL LLInventoryState::sWearNewClothing = FALSE;
 LLUUID LLInventoryState::sWearNewClothingTransactionID;
 
@@ -535,13 +537,10 @@ void open_outbox()
 	LLFloaterReg::showInstance("outbox");
 }
 
-void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
+void move_to_outbox_cb_action(const LLSD& payload)
 {
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-	if (option != 0) return; // canceled
-
-	LLViewerInventoryItem * viitem = gInventory.getItem(notification["payload"]["item_id"].asUUID());
-	LLUUID dest_folder_id = notification["payload"]["dest_folder_id"].asUUID();
+	LLViewerInventoryItem * viitem = gInventory.getItem(payload["item_id"].asUUID());
+	LLUUID dest_folder_id = payload["dest_folder_id"].asUUID();
 
 	if (viitem)
 	{	
@@ -560,12 +559,12 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 			dest_folder_id,
 			false);
 
-		LLUUID top_level_folder = notification["payload"]["top_level_folder"].asUUID();
+		LLUUID top_level_folder = payload["top_level_folder"].asUUID();
 
 		if (top_level_folder != LLUUID::null)
 		{
 			LLViewerInventoryCategory* category;
-			
+
 			while (parent.notNull())
 			{
 				LLInventoryModel::cat_array_t* cat_array;
@@ -593,20 +592,41 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 				parent = next_parent;
 			}
 		}
-		
+
 		open_outbox();
 	}
 }
 
+static S32 move_to_outbox_operation_id = -1;
+static std::list<LLSD> move_to_outbox_payloads;
+
+void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
+{
+	const S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+
+	if (option == 0)
+	{
+		llassert(move_to_outbox_payloads.size() > 0);
+
+		BOOST_FOREACH(const LLSD& payload, move_to_outbox_payloads)
+		{
+			move_to_outbox_cb_action(payload);
+		}
+	}
+
+	move_to_outbox_operation_id = -1;
+	move_to_outbox_payloads.clear();
+}
+
 
-void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder)
+void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id)
 {
 	// Collapse links directly to items/folders
 	LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
 	LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory();
 	if (linked_category != NULL)
 	{
-		copy_folder_to_outbox(linked_category, dest_folder, top_level_folder);
+		copy_folder_to_outbox(linked_category, dest_folder, top_level_folder, operation_id);
 	}
 	else
 	{
@@ -639,11 +659,21 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 		{	
 			LLSD args;
 			args["ITEM_NAME"] = inv_item->getName();
+
 			LLSD payload;
 			payload["item_id"] = inv_item->getUUID();
 			payload["dest_folder_id"] = dest_folder;
 			payload["top_level_folder"] = top_level_folder;
-			LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2));
+
+			if (move_to_outbox_operation_id != operation_id)
+			{
+				LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2));
+				
+				move_to_outbox_operation_id = operation_id;
+				move_to_outbox_payloads.clear();
+			}
+
+			move_to_outbox_payloads.push_back(payload);
 		}
 	}
 }
@@ -665,7 +695,7 @@ void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder)
 					   false);
 }
 
-void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder)
+void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id)
 {
 	LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName());
 	gInventory.notifyObservers();
@@ -680,7 +710,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold
 	for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
 	{
 		LLInventoryItem* item = *iter;
-		copy_item_to_outbox(item, new_folder_id, top_level_folder);
+		copy_item_to_outbox(item, new_folder_id, top_level_folder, operation_id);
 	}
 
 	LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
@@ -688,7 +718,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold
 	for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
 	{
 		LLViewerInventoryCategory* category = *iter;
-		copy_folder_to_outbox(category, new_folder_id, top_level_folder);
+		copy_folder_to_outbox(category, new_folder_id, top_level_folder, operation_id);
 	}
 
 	open_outbox();
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 9f0ee0571a6..a93446000db 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -74,10 +74,10 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
 // Generates a string containing the path to the item specified by item_id.
 void append_path(const LLUUID& id, std::string& path);
 
-void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder);
+void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id);
 void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder);
 
-void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder);
+void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id);
 
 /**                    Miscellaneous global functions
  **                                                                            **
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 5a4d1777098..8c32dfcb4de 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -282,6 +282,8 @@ void LLCategoryDropDescendentsObserver::done()
 }
 */
 
+S32 LLToolDragAndDrop::sOperationId = 0;
+
 LLToolDragAndDrop::DragAndDropEntry::DragAndDropEntry(dragOrDrop3dImpl f_none,
 													  dragOrDrop3dImpl f_self,
 													  dragOrDrop3dImpl f_avatar,
@@ -644,6 +646,12 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop,
 
 	mToolTipMsg.clear();
 
+	// Increment the operation id for every drop
+	if (drop)
+	{
+		sOperationId++;
+	}
+
 	if (top_view)
 	{
 		handled = TRUE;
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index 273d23d1a0f..188d36cd1b9 100644
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -88,6 +88,7 @@ class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop>
 	boost::signals2::connection setEndDragCallback( const enddrag_signal_t::slot_type& cb ) { return mEndDragSignal.connect(cb); }
 	
 	uuid_vec_t::size_type getCargoIDsCount() const { return mCargoIDs.size(); }
+	static S32 getOperationId() { return sOperationId; }
 
 protected:
 	enum EDropTarget
@@ -127,6 +128,8 @@ class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop>
 	LLUUID mSourceID;
 	LLUUID mObjectID;
 
+	static S32		sOperationId;
+
 	LLVector3d		mLastCameraPos;
 	LLVector3d		mLastHitPos;
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index a7e74362564..1a4dab2ac52 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -203,14 +203,11 @@ Save changes to current clothing/body part?
    icon="alertmodal.tga"
      name="ConfirmNoCopyToOutbox"
      type="alertmodal">
-You don't have permission to copy this item to the Merchant Outbox. You can move it or leave it behind.
-
-[ITEM_NAME]
+You don't have permission to copy one or more of these items to the Merchant Outbox.  You can move them or leave them behind.
         <usetemplate
-         canceltext="Cancel"
-         name="yesnocancelbuttons"
-         notext="Don't move item"
-         yestext="Move item"/>
+         name="okcancelbuttons"
+         notext="Don't move item(s)"
+         yestext="Move item(s)"/>
     </notification>
 
   <notification
-- 
GitLab


From 11bd5cb86025376a198e45330116de4757b5c89e Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 12 Jan 2012 20:32:32 -0700
Subject: [PATCH 554/933] trivial: fix a mac build error.

---
 indra/llmessage/llcurl.cpp | 9 ++++++++-
 indra/llmessage/llcurl.h   | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index eab28745964..277c274f526 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -915,7 +915,7 @@ void LLCurlThread::CurlRequest::finishRequest(bool completed)
 	}
 	else
 	{
-		mMulti->cleanup() ; //being idle too long, remove the request.
+		mCurlThread->cleanupMulti(mMulti) ; //being idle too long, remove the request.
 	}
 
 	mMulti = NULL ;
@@ -976,6 +976,13 @@ void LLCurlThread::deleteMulti(LLCurl::Multi* multi)
 {
 	delete multi ;
 }
+
+//private
+void LLCurlThread::cleanupMulti(LLCurl::Multi* multi) 
+{
+	multi->cleanup() ;
+}
+
 //------------------------------------------------------------
 
 //static
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 32da911cbf3..2b23ac97630 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -370,6 +370,7 @@ class LLCurlThread : public LLQueuedThread
 private:
 	bool doMultiPerform(LLCurl::Multi* multi) ;
 	void deleteMulti(LLCurl::Multi* multi) ;
+	void cleanupMulti(LLCurl::Multi* multi) ;
 } ;
 
 namespace boost
-- 
GitLab


From 86ef722e7cb2e4c791e8223f5c09a0552b52b574 Mon Sep 17 00:00:00 2001
From: merov <none@none>
Date: Fri, 13 Jan 2012 15:11:37 -0800
Subject: [PATCH 555/933] EXP-1775 : cleanup a bit PeekMessage() usage, avoid
 eating one event when reaching MAX_MESSAGE_PER_UPDATE.

---
 indra/llwindow/llwindowwin32.cpp | 2 +-
 indra/newview/llstartup.cpp      | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 954b9f2b159..228fbefd194 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1747,7 +1747,7 @@ void LLWindowWin32::gatherInput()
 
 	LLMemType m1(LLMemType::MTYPE_GATHER_INPUT);
 
-	while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) && msg_count < MAX_MESSAGE_PER_UPDATE)
+	while ((msg_count < MAX_MESSAGE_PER_UPDATE) && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
 	{
 		mCallbacks->handlePingWatchdog(this, "Main:TranslateGatherInput");
 		TranslateMessage(&msg);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 7e02a41e7e1..3923b4510a7 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -804,9 +804,8 @@ bool idle_startup()
 #ifdef _WIN32
 		MSG msg;
 		while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) )
-		{
-			display_startup();
-		}
+		{ }
+		display_startup();
 #endif
 		timeout.reset();
 		return FALSE;
-- 
GitLab


From d6add298d7c793eda1fee2c03b2ccf91df7f6102 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 13 Jan 2012 16:06:58 -0800
Subject: [PATCH 556/933] EXP-1802 FIX -- Create labeled drop target region at
 bottom of merchant outbox floater for easy top level drop access

* Added generic drop zone that highlights green when its functionality will be used.
---
 indra/newview/llfloateroutbox.cpp             |  34 ++-
 indra/newview/llfloateroutbox.h               |   3 +
 .../xui/en/floater_merchant_outbox.xml        | 241 ++++++++++--------
 3 files changed, 167 insertions(+), 111 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 597602d5abb..297736f3bd8 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -111,6 +111,7 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
 	, mOutboxId(LLUUID::null)
 	, mOutboxInventoryPanel(NULL)
 	, mOutboxItemCount(0)
+	, mOutboxTopLevelDropZone(NULL)
 	, mWindowShade(NULL)
 {
 }
@@ -140,7 +141,9 @@ BOOL LLFloaterOutbox::postBuild()
 	
 	mImportButton = getChild<LLButton>("outbox_import_btn");
 	mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this));
-	
+
+	mOutboxTopLevelDropZone = getChild<LLPanel>("outbox_generic_drag_target");
+
 	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterOutbox::onFocusReceived, this));
 
 	return TRUE;
@@ -353,6 +356,11 @@ void LLFloaterOutbox::updateView()
 	}
 }
 
+bool isAccepted(EAcceptance accept)
+{
+	return (accept >= ACCEPT_YES_COPY_SINGLE);
+}
+
 BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 										EDragAndDropType cargo_type,
 										void* cargo_data,
@@ -370,7 +378,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 	BOOL handled = (handled_view != NULL);
 	
 	// Pass all drag and drop for this floater to the outbox inventory control
-	if (!handled || (*accept == ACCEPT_NO))
+	if (!handled || !isAccepted(*accept))
 	{
 		// Always assume we are going to move the drag and drop operation to the outbox root folder
 		bool move_to_root = true;
@@ -394,11 +402,33 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 			
 			handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 		}
+
+		if (mOutboxTopLevelDropZone)
+		{
+			mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept));
+		}
+	}
+	else
+	{
+		if (mOutboxTopLevelDropZone)
+		{
+			mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
+		}
 	}
 	
 	return handled;
 }
 
+void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+	if (mOutboxTopLevelDropZone)
+	{
+		mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
+	}
+
+	LLFloater::onMouseLeave(x, y, mask);
+}
+
 void LLFloaterOutbox::onImportButtonClicked()
 {
 	mOutboxInventoryPanel->clearSelection();
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 58b7d6ec98a..796c533059f 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -66,6 +66,8 @@ class LLFloaterOutbox : public LLFloater
 	
 	void showNotification(const LLSD& notify);
 
+	void onMouseLeave(S32 x, S32 y, MASK mask);
+
 protected:
 	void fetchOutboxContents();
 
@@ -103,6 +105,7 @@ class LLFloaterOutbox : public LLFloater
 	LLUUID				mOutboxId;
 	LLInventoryPanel *	mOutboxInventoryPanel;
 	U32					mOutboxItemCount;
+	LLPanel *			mOutboxTopLevelDropZone;
 	
 	LLWindowShade *	mWindowShade;
 };
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index c0f26413cb3..498a9b6ce09 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -1,24 +1,24 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
- open_positioning="cascading"
- can_close="true"
- can_resize="true"
- height="440"
- help_topic="floater_merchant_outbox"
- min_width="300"
- min_height="200"
- name="floater_merchant_outbox"
- save_rect="true"
- save_visibility="false"
- reuse_instance="true"
- title="MERCHANT OUTBOX"
- width="333" >
- <string name="OutboxFolderCount0"></string>
- <string name="OutboxFolderCount1">1 folder</string>
- <string name="OutboxFolderCountN">[NUM] folders</string>
- <string name="OutboxImporting">Sending folders...</string>
- <string name="OutboxInitializing">Initializing...</string>
- <panel
+    open_positioning="cascading"
+    can_close="true"
+    can_resize="true"
+    height="440"
+    help_topic="floater_merchant_outbox"
+    min_width="300"
+    min_height="200"
+    name="floater_merchant_outbox"
+    save_rect="true"
+    save_visibility="false"
+    reuse_instance="true"
+    title="MERCHANT OUTBOX"
+    width="333">
+  <string name="OutboxFolderCount0"></string>
+  <string name="OutboxFolderCount1">1 folder</string>
+  <string name="OutboxFolderCountN">[NUM] folders</string>
+  <string name="OutboxImporting">Sending folders...</string>
+  <string name="OutboxInitializing">Initializing...</string>
+  <panel
       follows="all"
       layout="topleft"
       left="0"
@@ -26,104 +26,127 @@
       label=""
       height="440"
       width="333">
-     <panel
+    <panel
         follows="all"
         left="10"
-        bottom="400"
+        bottom="370"
         width="313"
         top="0"
-        bg_opaque_color="InventoryBackgroundColor"
-        >
-		<panel
-			name="outbox_inventory_placeholder_panel"
-			follows="all"
-			layout="topleft"
-			top="0"
-			left="0"
-			width="308"
-			height="400"
-			bg_opaque_color="InventoryBackgroundColor"
-			>
-			<text
-				name="outbox_inventory_placeholder_title"
-				type="string"
-				follows="top|left|right"
-				layout="topleft"
-				top="10"
-				left="0"
-				width="308"
-				height="25"
-				wrap="true"
-				halign="center"
-				font="SansSerifBold">
-				Loading...
-			</text>
-			<text
-				name="outbox_inventory_placeholder_text"
-				type="string"
-				follows="top|left|right"
-				layout="topleft"
-				top="35"
-				left="0"
-				width="308"
-				height="130"
-				wrap="true"
-				halign="left" />
-		</panel>
+        bg_opaque_color="InventoryBackgroundColor">
+      <panel
+          name="outbox_inventory_placeholder_panel"
+          follows="all"
+          layout="topleft"
+          top="0"
+          left="0"
+          width="308"
+          height="370"
+          bg_opaque_color="InventoryBackgroundColor">
+        <text
+            name="outbox_inventory_placeholder_title"
+            type="string"
+            follows="top|left|right"
+            layout="topleft"
+            top="10"
+            left="0"
+            width="308"
+            height="25"
+            wrap="true"
+            halign="center"
+            font="SansSerifBold">
+          Loading...
+        </text>
+        <text
+            name="outbox_inventory_placeholder_text"
+            type="string"
+            follows="top|left|right"
+            layout="topleft"
+            top="35"
+            left="0"
+            width="308"
+            height="130"
+            wrap="true"
+            halign="left" />
+      </panel>
     </panel>
-	<panel
+    <panel
         follows="bottom|left|right"
         left="10"
         bottom="435"
         width="313"
-        top="405"
-        bg_opaque_color="InventoryBackgroundColor"
-        >
-		<text
-			name="outbox_folder_count"
-			type="string"
-			follows="all"
-			layout="topleft"
-			top="10"
-			left="5"
-			width="150"
-			height="20"
-			wrap="true"
-			halign="left"
-			valign="bottom"
-			font="SansSerif" />
-		<button
-			 label="Send to Marketplace"
-			 tool_tip="Push to my Marketplace Storefront"
-			 is_toggle="false"
-			 name="outbox_import_btn"
-			 follows="bottom|right"
-			 tab_stop="false"
-			 halign="center"
-			 top="3"
-			 left="160"
-			 height="25"
-			 width="150"
-			 enabled="false" />
+        top="370">
+      <panel
+          name="outbox_generic_drag_target"
+          mouse_opaque="false"
+          follows="all"
+          top="5"
+          left="5"
+          width="303"
+          height="25"
+          background_visible="false"
+          bg_alpha_color="EmphasisColor_35"
+          border="true"
+          bevel_style="in"
+          visible="true">
+        <text
+            type="string"
+            follows="all"
+            layout="topleft"
+            top="6"
+            height="20"
+            left="5"
+            width="293"
+            halign="center"
+            font="SansSerifMedium"
+            font_shadow="hard"
+            valign="bottom">
+          Drag items here to create folders
+        </text>
+      </panel>
+      <text
+          name="outbox_folder_count"
+          type="string"
+          follows="all"
+          layout="topleft"
+          top="40"
+          left="5"
+          width="150"
+          height="20"
+          wrap="true"
+          halign="left"
+          valign="bottom"
+          font="SansSerif" />
+      <button
+          label="Send to Marketplace"
+          tool_tip="Push to my Marketplace Storefront"
+          is_toggle="false"
+          name="outbox_import_btn"
+          follows="bottom|right"
+          tab_stop="false"
+          halign="center"
+          top="37"
+          left="160"
+          height="25"
+          width="150"
+          enabled="false" />
     </panel>
-	<layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
-		<layout_panel />
-		<layout_panel height="45" auto_resize="false">
-			<layout_stack orientation="horizontal" left="0" height="45" top="0" width="333" follows="all">
-				<layout_panel width="0" />
-				<layout_panel width="45" auto_resize="false">
-					<loading_indicator
-						 height="45"
-						 layout="topleft"
-						 left="0"
-						 top="0"
-						 width="45"
-						 />
-				</layout_panel>
-				<layout_panel width="0" />
-			</layout_stack>
-		 </layout_panel>
-		 <layout_panel />
-	</layout_stack>
- </panel>
+    <layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
+      <layout_panel />
+      <layout_panel height="45" auto_resize="false">
+        <layout_stack orientation="horizontal" left="0" height="45" top="0" width="333" follows="all">
+          <layout_panel width="0" />
+          <layout_panel width="45" auto_resize="false">
+            <loading_indicator
+                height="45"
+                layout="topleft"
+                left="0"
+                top="0"
+                width="45" />
+          </layout_panel>
+          <layout_panel width="0" />
+        </layout_stack>
+      </layout_panel>
+      <layout_panel />
+    </layout_stack>
+  </panel>
 </floater>
-- 
GitLab


From 6b919e324e55ebcac0e2d33ca44a05fae9ac1d42 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 13 Jan 2012 16:36:57 -0800
Subject: [PATCH 557/933] EXP-1803 FIX -- Notify the user when a folder is
 automatically created for them in the outbox

* New confirmation dialog lets them know when a folder was automatically created to contain an item dragged/copied to the outbox.
---
 indra/newview/llinventorybridge.cpp           |  2 +-
 indra/newview/llinventoryfunctions.cpp        | 45 ++++++++++++++-----
 indra/newview/llinventoryfunctions.h          |  2 +-
 .../skins/default/xui/en/notifications.xml    | 22 ++++++---
 4 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 11e22d5226a..270ef4fddc9 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3690,7 +3690,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			{
 				if (move_is_from_outbox)
 				{
-					move_item_within_outbox(inv_item, mUUID);
+					move_item_within_outbox(inv_item, mUUID, LLToolDragAndDrop::getOperationId());
 				}
 				else
 				{
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 7672f7e6742..f5be271a68d 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -532,11 +532,39 @@ void show_item_original(const LLUUID& item_uuid)
 	}
 }
 
+
+static S32 create_folder_in_outbox_operation_id = -1;
+static S32 move_to_outbox_operation_id = -1;
+static std::list<LLSD> move_to_outbox_payloads;
+
 void open_outbox()
 {
 	LLFloaterReg::showInstance("outbox");
 }
 
+void folder_created_in_outbox_cb(const LLSD& notification, const LLSD& response)
+{
+	create_folder_in_outbox_operation_id = -1;
+}
+
+LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& destFolderId, S32 operation_id)
+{
+	llassert(item);
+	llassert(destFolderId.notNull());
+
+	LLUUID created_folder_id = gInventory.createNewCategory(destFolderId, LLFolderType::FT_NONE, item->getName());
+	gInventory.notifyObservers();
+
+	if (create_folder_in_outbox_operation_id != operation_id)
+	{
+		LLNotificationsUtil::add("OutboxFolderCreated", LLSD(), LLSD(), boost::bind(&folder_created_in_outbox_cb, _1, _2));
+
+		create_folder_in_outbox_operation_id = operation_id;
+	}
+
+	return created_folder_id;
+}
+
 void move_to_outbox_cb_action(const LLSD& payload)
 {
 	LLViewerInventoryItem * viitem = gInventory.getItem(payload["item_id"].asUUID());
@@ -547,8 +575,8 @@ void move_to_outbox_cb_action(const LLSD& payload)
 		// when moving item directly into outbox create folder with that name
 		if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
 		{
-			dest_folder_id = gInventory.createNewCategory(dest_folder_id,  LLFolderType::FT_NONE, viitem->getName());
-			gInventory.notifyObservers();
+			S32 operation_id = payload["operation_id"].asInteger();
+			dest_folder_id = create_folder_in_outbox_for_item(viitem, dest_folder_id, operation_id);
 		}
 
 		LLUUID parent = viitem->getParentUUID();
@@ -597,9 +625,6 @@ void move_to_outbox_cb_action(const LLSD& payload)
 	}
 }
 
-static S32 move_to_outbox_operation_id = -1;
-static std::list<LLSD> move_to_outbox_payloads;
-
 void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 {
 	const S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -618,7 +643,6 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
 	move_to_outbox_payloads.clear();
 }
 
-
 void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id)
 {
 	// Collapse links directly to items/folders
@@ -642,8 +666,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 			// when moving item directly into outbox create folder with that name
 			if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
 			{
-				dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName());
-				gInventory.notifyObservers();
+				dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id);
 			}
 			
 			copy_inventory_item(gAgent.getID(),
@@ -664,6 +687,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 			payload["item_id"] = inv_item->getUUID();
 			payload["dest_folder_id"] = dest_folder;
 			payload["top_level_folder"] = top_level_folder;
+			payload["operation_id"] = operation_id;
 
 			if (move_to_outbox_operation_id != operation_id)
 			{
@@ -678,13 +702,12 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 	}
 }
 
-void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder)
+void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id)
 {
 	// when moving item directly into outbox create folder with that name
 	if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
 	{
-		dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName());
-		gInventory.notifyObservers();
+		dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id);
 	}
 	
 	LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index a93446000db..ce2b89b22e6 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -75,7 +75,7 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
 void append_path(const LLUUID& id, std::string& path);
 
 void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id);
-void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder);
+void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id);
 
 void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id);
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 1a4dab2ac52..e44fb3bf28d 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -204,11 +204,23 @@ Save changes to current clothing/body part?
      name="ConfirmNoCopyToOutbox"
      type="alertmodal">
 You don't have permission to copy one or more of these items to the Merchant Outbox.  You can move them or leave them behind.
-        <usetemplate
-         name="okcancelbuttons"
-         notext="Don't move item(s)"
-         yestext="Move item(s)"/>
-    </notification>
+    <usetemplate
+     name="okcancelbuttons"
+     notext="Don't move item(s)"
+     yestext="Move item(s)"/>
+  </notification>
+
+  <notification
+   icon="OutboxStatus_Success"
+   name="OutboxFolderCreated"
+   type="outbox">
+A new folder has been created for each item you have transferred into the top level of your Merchant Outbox.
+
+    <usetemplate
+     ignoretext="A new folder was created in the Merchant Outbox"
+     name="okignore"
+     yestext="OK"/>
+  </notification>
 
   <notification
    icon="OutboxStatus_Success"
-- 
GitLab


From 637409950512ac84a7c94c446ac60875757a92ef Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 13 Jan 2012 16:41:54 -0800
Subject: [PATCH 558/933] EXP-1770 WIP Drag and drop visual selection can be
 off across hierarchies made shift-selection work consistently across folder
 boundaries

---
 indra/newview/llfolderview.cpp     |  24 --
 indra/newview/llfolderview.h       |   5 +-
 indra/newview/llfolderviewitem.cpp | 364 +++++++++++++++++------------
 indra/newview/llfolderviewitem.h   |  18 +-
 4 files changed, 223 insertions(+), 188 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index ecd4c2c3deb..3167c51970e 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -349,10 +349,6 @@ BOOL LLFolderView::addFolder( LLFolderViewFolder* folder)
 	{
 		mFolders.insert(mFolders.begin(), folder);
 	}
-	if (folder->numSelected())
-	{
-		recursiveIncrementNumDescendantsSelected(folder->numSelected());
-	}
 	folder->setShowLoadStatus(mShowLoadStatus);
 	folder->setOrigin(0, 0);
 	folder->reshape(getRect().getWidth(), 0);
@@ -694,26 +690,6 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected)
 	return rv;
 }
 
-void LLFolderView::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items)
-{
-	// now store resulting selection
-	if (mAllowMultiSelect)
-	{
-		LLFolderViewItem *cur_selection = getCurSelectedItem();
-		LLFolderViewFolder::extendSelection(selection, cur_selection, items);
-		for (S32 i = 0; i < items.count(); i++)
-		{
-			addToSelectionList(items[i]);
-		}
-	}
-	else
-	{
-		setSelection(selection, FALSE, FALSE);
-	}
-
-	mSignalSelectCallback = SIGNAL_KEYBOARD_FOCUS;
-}
-
 static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection");
 void LLFolderView::sanitizeSelection()
 {
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 8af01e9102b..d4305a2fe26 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -106,6 +106,8 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	U32 getSortOrder() const;
 	BOOL isFilterModified();
 
+	bool getAllowMultiSelect() { return mAllowMultiSelect; }
+
 	// Close all folders in the view
 	void closeAllFolders();
 	void openTopLevelFolders();
@@ -141,8 +143,6 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	// children, and keeps track of selected objects.
 	virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
 
-	virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
-
 	virtual std::set<LLUUID> getSelectionList() const;
 
 	// make sure if ancestor is selected, descendents are not
@@ -156,7 +156,6 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	void setDraggingOverItem(LLFolderViewItem* item) { mDraggingOverItem = item; }
 	LLFolderViewItem* getDraggingOverItem() { return mDraggingOverItem; }
 
-
 	// deletion functionality
  	void removeSelectedItems();
 
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index f27fd035dbc..ca7e4bc1d0e 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -386,13 +386,6 @@ void LLFolderViewItem::changeSelectionFromRoot(LLFolderViewItem* selection, BOOL
 	getRoot()->changeSelection(selection, selected);
 }
 
-void LLFolderViewItem::extendSelectionFromRoot(LLFolderViewItem* selection)
-{
-	LLDynamicArray<LLFolderViewItem*> selected_items;
-
-	getRoot()->extendSelection(selection, NULL, selected_items);
-}
-
 std::set<LLUUID> LLFolderViewItem::getSelectionList() const
 {
 	std::set<LLUUID> selection;
@@ -496,10 +489,6 @@ BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL openitem,
 	if (selection == this && !mIsSelected)
 	{
 		selectItem();
-		if (mListener)
-		{
-			mListener->selectItem();
-		}
 	}
 	else if (mIsSelected)	// Deselect everything else.
 	{
@@ -520,10 +509,6 @@ BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selecte
 		{
 			selectItem();
 		}
-		if (mListener)
-		{
-			mListener->selectItem();
-		}
 		return TRUE;
 	}
 	return FALSE;
@@ -531,30 +516,16 @@ BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selecte
 
 void LLFolderViewItem::deselectItem(void)
 {
-	llassert(mIsSelected);
-
 	mIsSelected = FALSE;
-
-	// Update ancestors' count of selected descendents.
-	LLFolderViewFolder* parent_folder = getParentFolder();
-	if (parent_folder)
-	{
-		parent_folder->recursiveIncrementNumDescendantsSelected(-1);
-	}
 }
 
 void LLFolderViewItem::selectItem(void)
 {
-	llassert(!mIsSelected);
-
-	mIsSelected = TRUE;
-
-	// Update ancestors' count of selected descendents.
-	LLFolderViewFolder* parent_folder = getParentFolder();
-	if (parent_folder)
+	if (mListener)
 	{
-		parent_folder->recursiveIncrementNumDescendantsSelected(1);
+		mListener->selectItem();
 	}
+	mIsSelected = TRUE;
 }
 
 BOOL LLFolderViewItem::isMovable()
@@ -697,7 +668,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
 		}
 		else if (mask & MASK_SHIFT)
 		{
-			extendSelectionFromRoot(this);
+			getParentFolder()->extendSelectionTo(this);
 		}
 		else
 		{
@@ -812,7 +783,7 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask )
 		}
 		else if (mask & MASK_SHIFT)
 		{
-			extendSelectionFromRoot(this);
+			getParentFolder()->extendSelectionTo(this);
 		}
 		else
 		{
@@ -1125,7 +1096,6 @@ void LLFolderViewItem::draw()
 
 LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ): 
 	LLFolderViewItem( p ),	// 0 = no create time
-	mNumDescendantsSelected(0),
 	mIsOpen(FALSE),
 	mExpanderHighlighted(FALSE),
 	mCurHeight(0.f),
@@ -1572,21 +1542,6 @@ BOOL LLFolderViewFolder::hasFilteredDescendants()
 	return mMostFilteredDescendantGeneration >= getRoot()->getFilter()->getCurrentGeneration();
 }
 
-void LLFolderViewFolder::recursiveIncrementNumDescendantsSelected(S32 increment)
-{
-	LLFolderViewFolder* parent_folder = this;
-	do
-	{
-		parent_folder->mNumDescendantsSelected += increment;
-
-		// Make sure we don't have negative values.
-		llassert(parent_folder->mNumDescendantsSelected >= 0);
-
-		parent_folder = parent_folder->getParentFolder();
-	}
-	while(parent_folder);
-}
-
 // Passes selection information on to children and record selection
 // information if necessary.
 BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem,
@@ -1599,10 +1554,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
 		{
 			selectItem();
 		}
-		if (mListener)
-		{
-			mListener->selectItem();
-		}
 		rv = TRUE;
 	}
 	else
@@ -1663,10 +1614,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
 				deselectItem();
 			}
 		}
-		if (mListener && selected)
-		{
-			mListener->selectItem();
-		}
 	}
 
 	for (folders_t::iterator iter = mFolders.begin();
@@ -1690,119 +1637,261 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
 	return rv;
 }
 
-void LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& selected_items)
+LLFolderViewFolder* LLFolderViewFolder::getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse)
 {
-	// pass on to child folders first
-	for (folders_t::iterator iter = mFolders.begin();
-		iter != mFolders.end();)
+	if (!item_a->getParentFolder() || !item_b->getParentFolder()) return NULL;
+
+	std::deque<LLFolderViewFolder*> item_a_ancestors;
+
+	LLFolderViewFolder* parent = item_a->getParentFolder();
+	while(parent)
 	{
-		folders_t::iterator fit = iter++;
-		(*fit)->extendSelection(selection, last_selected, selected_items);
+		item_a_ancestors.push_back(parent);
+		parent = parent->getParentFolder();
 	}
 
-	// handle selection of our immediate children...
-	BOOL reverse_select = FALSE;
-	BOOL found_last_selected = FALSE;
-	BOOL found_selection = FALSE;
-	LLDynamicArray<LLFolderViewItem*> items_to_select;
-	LLFolderViewItem* item;
+	std::deque<LLFolderViewFolder*> item_b_ancestors;
+	
+	parent = item_b->getParentFolder();
+	while(parent)
+	{
+		item_b_ancestors.push_back(parent);
+		parent = parent->getParentFolder();
+	}
 
-	//...folders first...
-	for (folders_t::iterator iter = mFolders.begin();
-		iter != mFolders.end();)
+	LLFolderViewFolder* common_ancestor = item_a->getRoot();
+
+	while(item_a_ancestors.size() > item_b_ancestors.size())
 	{
-		folders_t::iterator fit = iter++;
-		item = (*fit);
-		if(item == selection)
-		{
-			found_selection = TRUE;
-		}
-		else if (item == last_selected)
+		item_a = item_a_ancestors.front();
+		item_a_ancestors.pop_front();
+	}
+
+	while(item_b_ancestors.size() > item_a_ancestors.size())
+	{
+		item_b = item_b_ancestors.front();
+		item_b_ancestors.pop_front();
+	}
+
+	while(item_a_ancestors.size())
+	{
+		common_ancestor = item_a_ancestors.front();
+
+		if (item_a_ancestors.front() == item_b_ancestors.front())
 		{
-			found_last_selected = TRUE;
-			if (found_selection)
+			// which came first, sibling a or sibling b?
+			for (folders_t::iterator it = common_ancestor->mFolders.begin(), end_it = common_ancestor->mFolders.end();
+				it != end_it;
+				++it)
 			{
-				reverse_select = TRUE;
+				LLFolderViewItem* item = *it;
+
+				if (item == item_a)
+				{
+					reverse = false;
+					return common_ancestor;
+				}
+				if (item == item_b)
+				{
+					reverse = true;
+					return common_ancestor;
+				}
 			}
-		}
 
-		if (found_selection || found_last_selected)
-		{
-			// deselect currently selected items so they can be pushed back on queue
-			if (item->isSelected())
+			for (items_t::iterator it = common_ancestor->mItems.begin(), end_it = common_ancestor->mItems.end();
+				it != end_it;
+				++it)
 			{
-				item->changeSelection(item, FALSE);
+				LLFolderViewItem* item = *it;
+
+				if (item == item_a)
+				{
+					reverse = false;
+					return common_ancestor;
+				}
+				if (item == item_b)
+				{
+					reverse = true;
+					return common_ancestor;
+				}
 			}
-			items_to_select.put(item);
+			break;
 		}
 
-		if (found_selection && found_last_selected)
-		{
-			break;
-		}		
+		item_a = item_a_ancestors.front();
+		item_a_ancestors.pop_front();
+		item_b = item_b_ancestors.front();
+		item_b_ancestors.pop_front();
 	}
 
-	if (!(found_selection && found_last_selected))
+	return NULL;
+}
+
+void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFolderViewItem* end, bool reverse, std::vector<LLFolderViewItem*>& items)
+{
+	bool selecting = start == NULL;
+	if (reverse)
 	{
-		//,,,then items
-		for (items_t::iterator iter = mItems.begin();
-			iter != mItems.end();)
+		for (items_t::reverse_iterator it = mItems.rbegin(), end_it = mItems.rend();
+			it != end_it;
+			++it)
 		{
-			items_t::iterator iit = iter++;
-			item = (*iit);
-			if(item == selection)
+			if (*it == end)
 			{
-				found_selection = TRUE;
+				return;
 			}
-			else if (item == last_selected)
+			if (selecting)
 			{
-				found_last_selected = TRUE;
-				if (found_selection)
-				{
-					reverse_select = TRUE;
-				}
+				items.push_back(*it);
 			}
 
-			if (found_selection || found_last_selected)
+			if (*it == start)
 			{
-				// deselect currently selected items so they can be pushed back on queue
-				if (item->isSelected())
-				{
-					item->changeSelection(item, FALSE);
-				}
-				items_to_select.put(item);
+				selecting = true;
+			}
+		}
+		for (folders_t::reverse_iterator it = mFolders.rbegin(), end_it = mFolders.rend();
+			it != end_it;
+			++it)
+		{
+			if (*it == end)
+			{
+				return;
 			}
 
-			if (found_selection && found_last_selected)
+			if (selecting)
 			{
-				break;
+				items.push_back(*it);
+			}
+
+			if (*it == start)
+			{
+				selecting = true;
 			}
 		}
 	}
-
-	if (found_last_selected && found_selection)
+	else
 	{
-		// we have a complete selection inside this folder
-		for (S32 index = reverse_select ? items_to_select.getLength() - 1 : 0; 
-			reverse_select ? index >= 0 : index < items_to_select.getLength(); reverse_select ? index-- : index++)
+		for (folders_t::iterator it = mFolders.begin(), end_it = mFolders.end();
+			it != end_it;
+			++it)
+		{
+			if (*it == end)
+			{
+				return;
+			}
+
+			if (selecting)
+			{
+				items.push_back(*it);
+			}
+
+			if (*it == start)
+			{
+				selecting = true;
+			}
+		}
+		for (items_t::iterator it = mItems.begin(), end_it = mItems.end();
+			it != end_it;
+			++it)
 		{
-			LLFolderViewItem* item = items_to_select[index];
-			if (item->changeSelection(item, TRUE))
+			if (*it == end)
+			{
+				return;
+			}
+
+			if (selecting)
+			{
+				items.push_back(*it);
+			}
+
+			if (*it == start)
 			{
-				selected_items.put(item);
+				selecting = true;
 			}
 		}
 	}
-	else if (found_selection)
+}
+
+void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection)
+{
+	if (getRoot()->getAllowMultiSelect() == FALSE) return;
+
+	LLFolderViewItem* cur_selected_item = getRoot()->getCurSelectedItem();
+	if (cur_selected_item == NULL)
+	{
+		cur_selected_item = new_selection;
+	}
+
+
+	bool reverse = false;
+	LLFolderViewFolder* common_ancestor = getCommonAncestor(cur_selected_item, new_selection, reverse);
+	if (!common_ancestor) return;
+
+	LLFolderViewItem* last_selected_item_from_cur = cur_selected_item;
+	LLFolderViewFolder* cur_folder = cur_selected_item->getParentFolder();
+
+	std::vector<LLFolderViewItem*> items_to_select_forward;
+
+	while(cur_folder != common_ancestor)
+	{
+		cur_folder->gatherChildRangeExclusive(last_selected_item_from_cur, NULL, reverse, items_to_select_forward);
+			
+		last_selected_item_from_cur = cur_folder;
+		cur_folder = cur_folder->getParentFolder();
+	}
+
+	std::vector<LLFolderViewItem*> items_to_select_reverse;
+
+	LLFolderViewItem* last_selected_item_from_new = new_selection;
+	cur_folder = new_selection->getParentFolder();
+	while(cur_folder != common_ancestor)
+	{
+		cur_folder->gatherChildRangeExclusive(last_selected_item_from_new, NULL, !reverse, items_to_select_reverse);
+
+		last_selected_item_from_new = cur_folder;
+		cur_folder = cur_folder->getParentFolder();
+	}
+
+	common_ancestor->gatherChildRangeExclusive(last_selected_item_from_cur, last_selected_item_from_new, reverse, items_to_select_forward);
+
+	for (std::vector<LLFolderViewItem*>::reverse_iterator it = items_to_select_reverse.rbegin(), end_it = items_to_select_reverse.rend();
+		it != end_it;
+		++it)
 	{
-		// last selection was not in this folder....go ahead and select just the new item
-		if (selection->changeSelection(selection, TRUE))
+		items_to_select_forward.push_back(*it);
+	}
+
+	LLFolderView* root = getRoot();
+
+	for (std::vector<LLFolderViewItem*>::iterator it = items_to_select_forward.begin(), end_it = items_to_select_forward.end();
+		it != end_it;
+		++it)
+	{
+		LLFolderViewItem* item = *it;
+		if (item->isSelected())
+		{
+			root->removeFromSelectionList(item);
+		}
+		else
 		{
-			selected_items.put(selection);
+			item->selectItem();
 		}
+		root->addToSelectionList(item);
 	}
+
+	if (new_selection->isSelected())
+	{
+		root->removeFromSelectionList(new_selection);
+	}
+	else
+	{
+		new_selection->selectItem();
+	}
+	root->addToSelectionList(new_selection);
 }
 
+
 void LLFolderViewFolder::destroyView()
 {
 	for (items_t::iterator iter = mItems.begin();
@@ -1874,19 +1963,11 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
 		ft = std::find(mFolders.begin(), mFolders.end(), f);
 		if (ft != mFolders.end())
 		{
-			if ((*ft)->numSelected())
-			{
-				recursiveIncrementNumDescendantsSelected(-(*ft)->numSelected());
-			}
 			mFolders.erase(ft);
 		}
 	}
 	else
 	{
-		if ((*it)->isSelected())
-		{
-			recursiveIncrementNumDescendantsSelected(-1);
-		}
 		mItems.erase(it);
 	}
 	//item has been removed, need to update filter
@@ -2055,11 +2136,6 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
 {
 	mItems.push_back(item);
 	
-	if (item->isSelected())
-	{
-		recursiveIncrementNumDescendantsSelected(1);
-	}
-	
 	item->setRect(LLRect(0, 0, getRect().getWidth(), 0));
 	item->setVisible(FALSE);
 	
@@ -2097,10 +2173,6 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
 BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder)
 {
 	mFolders.push_back(folder);
-	if (folder->numSelected())
-	{
-		recursiveIncrementNumDescendantsSelected(folder->numSelected());
-	}
 	folder->setOrigin(0, 0);
 	folder->reshape(getRect().getWidth(), 0);
 	folder->setVisible(FALSE);
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 3433e3f7f3a..29c5b2246d4 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -164,9 +164,6 @@ class LLFolderViewItem : public LLView
 	// helper function to change the selection from the root.
 	void changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected);
 
-	// helper function to change the selection from the root.
-	void extendSelectionFromRoot(LLFolderViewItem* selection);
-
 	// this is an internal method used for adding items to folders. A
 	// no-op at this level, but reimplemented in derived classes.
 	virtual BOOL addItem(LLFolderViewItem*) { return FALSE; }
@@ -224,9 +221,6 @@ class LLFolderViewItem : public LLView
 	// Returns TRUE if the selection state of this item was changed.
 	virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
 
-	// this method is used to group select items
-	virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) { }
-
 	// this method is used to deselect this element
 	void deselectItem();
 
@@ -373,13 +367,6 @@ class LLFolderViewFolder : public LLFolderViewItem
 	typedef std::list<LLFolderViewItem*> items_t;
 	typedef std::list<LLFolderViewFolder*> folders_t;
 
-private:
-	S32		mNumDescendantsSelected;
-
-public:		// Accessed needed by LLFolderViewItem
-	void recursiveIncrementNumDescendantsSelected(S32 increment);
-	S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); }
-
 protected:
 	items_t mItems;
 	folders_t mFolders;
@@ -461,7 +448,7 @@ class LLFolderViewFolder : public LLFolderViewItem
 	virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
 
 	// this method is used to group select items
-	virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
+	void extendSelectionTo(LLFolderViewItem* selection);
 
 	// Returns true is this object and all of its children can be removed.
 	virtual BOOL isRemovable();
@@ -551,7 +538,6 @@ class LLFolderViewFolder : public LLFolderViewItem
 
 	time_t getCreationDate() const;
 	bool isTrash() const;
-	S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; }
 
 	folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); }
 	folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); }
@@ -560,6 +546,8 @@ class LLFolderViewFolder : public LLFolderViewItem
 	items_t::const_iterator getItemsBegin() const { return mItems.begin(); }
 	items_t::const_iterator getItemsEnd() const { return mItems.end(); }
 	items_t::size_type getItemsCount() const { return mItems.size(); }
+	LLFolderViewFolder* getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse);
+	void gatherChildRangeExclusive(LLFolderViewItem* start, LLFolderViewItem* end, bool reverse,  std::vector<LLFolderViewItem*>& items);
 };
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
GitLab


From 5e5105bd223f5180bbca634ba2c393be2ef3d13d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 13 Jan 2012 18:37:50 -0800
Subject: [PATCH 559/933] EXP-1770 WIP Drag and drop visual selection can be
 off across hierarchies added throttling to fetchInventoryItem queries

---
 indra/newview/llfolderviewitem.cpp            |  11 +-
 indra/newview/llinventorybridge.cpp           |   2 +-
 .../llinventorymodelbackgroundfetch.cpp       | 328 ++++++++++++------
 .../newview/llinventorymodelbackgroundfetch.h |  16 +-
 4 files changed, 237 insertions(+), 120 deletions(-)

diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index ca7e4bc1d0e..50d62b29d33 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -499,7 +499,7 @@ BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL openitem,
 
 BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selected)
 {
-	if (selection == this && mIsSelected != selected)
+	if (selection == this)
 	{
 		if (mIsSelected)
 		{
@@ -521,11 +521,14 @@ void LLFolderViewItem::deselectItem(void)
 
 void LLFolderViewItem::selectItem(void)
 {
-	if (mListener)
+	if (mIsSelected == FALSE)
 	{
-		mListener->selectItem();
+		if (mListener)
+		{
+			mListener->selectItem();
+		}
+		mIsSelected = TRUE;
 	}
-	mIsSelected = TRUE;
 }
 
 BOOL LLFolderViewItem::isMovable()
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index eaf9b53eb91..5916ed60a48 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1234,7 +1234,7 @@ void LLItemBridge::selectItem()
 	LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
 	if(item && !item->isFinished())
 	{
-		item->fetchFromServer();
+		LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
 	}
 }
 
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 91fdd678063..5f0c7441924 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -50,7 +50,7 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch() :
 	mMinTimeBetweenFetches(0.3f),
 	mMaxTimeBetweenFetches(10.f),
 	mTimelyFetchPending(FALSE),
-	mBulkFetchCount(0)
+	mFetchCount(0)
 {
 }
 
@@ -60,7 +60,7 @@ LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch()
 
 bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const
 {
-	return mFetchQueue.empty() && mBulkFetchCount<=0;
+	return mFetchQueue.empty() && mFetchCount<=0;
 }
 
 bool LLInventoryModelBackgroundFetch::libraryFetchStarted() const
@@ -103,44 +103,60 @@ BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const
 	return mBackgroundFetchActive;
 }
 
-void LLInventoryModelBackgroundFetch::start(const LLUUID& cat_id, BOOL recursive)
+void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive)
 {
-	if (!mAllFoldersFetched || cat_id.notNull())
-	{
-		LL_DEBUGS("InventoryFetch") << "Start fetching category: " << cat_id << ", recursive: " << recursive << LL_ENDL;
+	if (id.isNull()) return;
 
-		mBackgroundFetchActive = TRUE;
-		if (cat_id.isNull())
+	LLViewerInventoryCategory* cat = gInventory.getCategory(id);
+	if (cat)
+	{	// it's a folder, do a bulk fetch
+		if (!mAllFoldersFetched)
 		{
-			if (!mRecursiveInventoryFetchStarted)
+			LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL;
+
+			mBackgroundFetchActive = TRUE;
+			if (id.isNull())
 			{
-				mRecursiveInventoryFetchStarted |= recursive;
-				mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive));
-				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+				if (!mRecursiveInventoryFetchStarted)
+				{
+					mRecursiveInventoryFetchStarted |= recursive;
+					mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive));
+					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+				}
+				if (!mRecursiveLibraryFetchStarted)
+				{
+					mRecursiveLibraryFetchStarted |= recursive;
+					mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive));
+					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+				}
 			}
-			if (!mRecursiveLibraryFetchStarted)
+			else
 			{
-				mRecursiveLibraryFetchStarted |= recursive;
-				mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive));
-				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+				// Specific folder requests go to front of queue.
+				if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id)
+				{
+					mFetchQueue.push_front(FetchQueueInfo(id, recursive));
+					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+				}
+				if (id == gInventory.getLibraryRootFolderID())
+				{
+					mRecursiveLibraryFetchStarted |= recursive;
+				}
+				if (id == gInventory.getRootFolderID())
+				{
+					mRecursiveInventoryFetchStarted |= recursive;
+				}
 			}
 		}
-		else
+	}
+	else if (LLViewerInventoryItem* itemp = gInventory.getItem(id))
+	{
+		if (!itemp->mIsComplete && (mFetchQueue.empty() || mFetchQueue.front().mUUID != id))
 		{
-			// Specific folder requests go to front of queue.
-			if (mFetchQueue.empty() || mFetchQueue.front().mCatUUID != cat_id)
-			{
-				mFetchQueue.push_front(FetchQueueInfo(cat_id, recursive));
-				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-			}
-			if (cat_id == gInventory.getLibraryRootFolderID())
-			{
-				mRecursiveLibraryFetchStarted |= recursive;
-			}
-			if (cat_id == gInventory.getRootFolderID())
-			{
-				mRecursiveInventoryFetchStarted |= recursive;
-			}
+			mBackgroundFetchActive = TRUE;
+
+			mFetchQueue.push_front(FetchQueueInfo(id, false, false));
+			gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
 		}
 	}
 }
@@ -158,7 +174,7 @@ void LLInventoryModelBackgroundFetch::stopBackgroundFetch()
 	{
 		mBackgroundFetchActive = FALSE;
 		gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-		mBulkFetchCount=0;
+		mFetchCount=0;
 		mMinTimeBetweenFetches=0.0f;
 	}
 }
@@ -183,10 +199,9 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 	if (mBackgroundFetchActive && gAgent.getRegion())
 	{
 		// If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
-		std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents2");   
-		if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty()) 
+		if (gSavedSettings.getBOOL("UseHTTPInventory")) 
 		{
-			bulkFetch(url);
+			bulkFetch();
 			return;
 		}
 		
@@ -230,7 +245,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 			}
 
 			const FetchQueueInfo info = mFetchQueue.front();
-			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mCatUUID);
+			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID);
 
 			// Category has been deleted, remove from queue.
 			if (!cat)
@@ -258,7 +273,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 				}
 			}
 			// Do I have all my children?
-			else if (gInventory.isCategoryComplete(info.mCatUUID))
+			else if (gInventory.isCategoryComplete(info.mUUID))
 			{
 				// Finished with this category, remove from queue.
 				mFetchQueue.pop_front();
@@ -313,15 +328,35 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 	}
 }
 
-void LLInventoryModelBackgroundFetch::incrBulkFetch(S16 fetching) 
+void LLInventoryModelBackgroundFetch::incrFetchCount(S16 fetching) 
 {  
-	mBulkFetchCount += fetching; 
-	if (mBulkFetchCount < 0)
+	mFetchCount += fetching; 
+	if (mFetchCount < 0)
 	{
-		mBulkFetchCount = 0; 
+		mFetchCount = 0; 
 	}
 }
 
+class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInventoryResponder
+{
+public:
+	LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {};
+	void result(const LLSD& content);			
+	void error(U32 status, const std::string& reason);
+};
+
+void LLInventoryModelFetchItemResponder::result( const LLSD& content )
+{
+	LLInventoryModel::fetchInventoryResponder::result(content);
+	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
+}
+
+void LLInventoryModelFetchItemResponder::error( U32 status, const std::string& reason )
+{
+	LLInventoryModel::fetchInventoryResponder::error(status, reason);
+	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
+}
+
 
 class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder
 {
@@ -458,7 +493,7 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
 		}
 	}
 
-	fetcher->incrBulkFetch(-1);
+	fetcher->incrFetchCount(-1);
 	
 	if (fetcher->isBulkFetchProcessingComplete())
 	{
@@ -477,7 +512,7 @@ void LLInventoryModelFetchDescendentsResponder::error(U32 status, const std::str
 	llinfos << "LLInventoryModelFetchDescendentsResponder::error "
 		<< status << ": " << reason << llendl;
 						
-	fetcher->incrBulkFetch(-1);
+	fetcher->incrFetchCount(-1);
 
 	if (status==499) // timed out
 	{
@@ -508,12 +543,14 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat
 
 // Bundle up a bunch of requests to send all at once.
 // static   
-void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
+void LLInventoryModelBackgroundFetch::bulkFetch()
 {
 	//Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped.
 	//If there are items in mFetchQueue, we want to check the time since the last bulkFetch was 
 	//sent.  If it exceeds our retry time, go ahead and fire off another batch.  
 	//Stopbackgroundfetch will be run from the Responder instead of here.  
+	LLViewerRegion* region = gAgent.getRegion();
+	if (!region) return;
 
 	S16 max_concurrent_fetches=8;
 	F32 new_min_time = 0.5f;			//HACK!  Clean this up when old code goes away entirely.
@@ -523,12 +560,13 @@ void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
 	}
 	
 	if (gDisconnected ||
-		(mBulkFetchCount > max_concurrent_fetches) ||
+		(mFetchCount > max_concurrent_fetches) ||
 		(mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches))
 	{
 		return; // just bail if we are disconnected
 	}	
 
+	U32 item_count=0;
 	U32 folder_count=0;
 	U32 max_batch_size=5;
 
@@ -536,83 +574,159 @@ void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
 
 	uuid_vec_t recursive_cats;
 
-	LLSD body;
-	LLSD body_lib;
+	LLSD folder_request_body;
+	LLSD folder_request_body_lib;
+	LLSD item_request_body;
+	LLSD item_request_body_lib;
 
-	while (!(mFetchQueue.empty()) && (folder_count < max_batch_size))
+	while (!(mFetchQueue.empty()) && ((item_count + folder_count) < max_batch_size))
 	{
 		const FetchQueueInfo& fetch_info = mFetchQueue.front();
-		const LLUUID &cat_id = fetch_info.mCatUUID;
-        if (cat_id.isNull()) //DEV-17797
-        {
-			LLSD folder_sd;
-			folder_sd["folder_id"]		= LLUUID::null.asString();
-			folder_sd["owner_id"]		= gAgent.getID();
-			folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
-			folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE;
-			folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
-			body["folders"].append(folder_sd);
-            folder_count++;
-        }
-        else
-        {
-		    const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+		if (fetch_info.mIsCategory)
+		{
+
+			const LLUUID &cat_id = fetch_info.mUUID;
+			if (cat_id.isNull()) //DEV-17797
+			{
+				LLSD folder_sd;
+				folder_sd["folder_id"]		= LLUUID::null.asString();
+				folder_sd["owner_id"]		= gAgent.getID();
+				folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
+				folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE;
+				folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
+				folder_request_body["folders"].append(folder_sd);
+				folder_count++;
+			}
+			else
+			{
+				const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
 		
-		    if (cat)
-		    {
-			    if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
-			    {
-				    LLSD folder_sd;
-				    folder_sd["folder_id"]		= cat->getUUID();
-				    folder_sd["owner_id"]		= cat->getOwnerID();
-				    folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
-				    folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
-				    folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
-				    
-				    if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
-					    body_lib["folders"].append(folder_sd);
-				    else
-					    body["folders"].append(folder_sd);
-				    folder_count++;
-			    }
-				// May already have this folder, but append child folders to list.
-			    if (fetch_info.mRecursive)
-			    {	
-					LLInventoryModel::cat_array_t* categories;
-					LLInventoryModel::item_array_t* items;
-					gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
-					for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
-						 it != categories->end();
-						 ++it)
+				if (cat)
+				{
+					if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
 					{
-						mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
-				    }
-			    }
-		    }
-        }
-		if (fetch_info.mRecursive)
-			recursive_cats.push_back(cat_id);
+						LLSD folder_sd;
+						folder_sd["folder_id"]		= cat->getUUID();
+						folder_sd["owner_id"]		= cat->getOwnerID();
+						folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
+						folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
+						folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
+				    
+						if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
+							folder_request_body_lib["folders"].append(folder_sd);
+						else
+							folder_request_body["folders"].append(folder_sd);
+						folder_count++;
+					}
+					// May already have this folder, but append child folders to list.
+					if (fetch_info.mRecursive)
+					{	
+						LLInventoryModel::cat_array_t* categories;
+						LLInventoryModel::item_array_t* items;
+						gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
+						for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
+							 it != categories->end();
+							 ++it)
+						{
+							mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
+						}
+					}
+				}
+			}
+			if (fetch_info.mRecursive)
+				recursive_cats.push_back(cat_id);
+		}
+		else
+		{
+			LLViewerInventoryItem* itemp = gInventory.getItem(fetch_info.mUUID);
+			if (itemp)
+			{
+				LLSD item_sd;
+				item_sd["owner_id"] = itemp->getPermissions().getOwner();
+				item_sd["item_id"] = itemp->getUUID();
+				if (itemp->getPermissions().getOwner() == gAgent.getID())
+				{
+					item_request_body.append(item_sd);
+				}
+				else
+				{
+					item_request_body_lib.append(item_sd);
+				}
+				//itemp->fetchFromServer();
+				item_count++;
+			}
+		}
 
 		mFetchQueue.pop_front();
 	}
 		
-	if (folder_count > 0)
+	if (item_count + folder_count > 0)
 	{
-		mBulkFetchCount++;
-		if (body["folders"].size())
+		if (folder_count)
 		{
-			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body, recursive_cats);
-			LLHTTPClient::post(url, body, fetcher, 300.0);
+			std::string url = region->getCapability("FetchInventoryDescendents2");   
+			mFetchCount++;
+			if (folder_request_body["folders"].size())
+			{
+				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
+				LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
+			}
+			if (folder_request_body_lib["folders"].size())
+			{
+				std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
+
+				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
+				LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
+			}
 		}
-		if (body_lib["folders"].size())
+		if (item_count)
 		{
-			std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
-			
-			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body_lib, recursive_cats);
-			LLHTTPClient::post(url_lib, body_lib, fetcher, 300.0);
+			std::string url;
+
+			if (item_request_body.size())
+			{
+				mFetchCount++;
+				url = region->getCapability("FetchInventory2");
+				if (!url.empty())
+				{
+					LLSD body;
+					body["agent_id"]	= gAgent.getID();
+					body["items"] = item_request_body;
+
+					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
+				}
+				//else
+				//{
+				//	LLMessageSystem* msg = gMessageSystem;
+				//	msg->newMessage("FetchInventory");
+				//	msg->nextBlock("AgentData");
+				//	msg->addUUID("AgentID", gAgent.getID());
+				//	msg->addUUID("SessionID", gAgent.getSessionID());
+				//	msg->nextBlock("InventoryData");
+				//	msg->addUUID("OwnerID", mPermissions.getOwner());
+				//	msg->addUUID("ItemID", mUUID);
+				//	gAgent.sendReliableMessage();
+				//}
+			}
+
+			if (item_request_body_lib.size())
+			{
+				mFetchCount++;
+
+				url = region->getCapability("FetchLib2");
+				if (!url.empty())
+				{
+					LLSD body;
+					body["agent_id"]	= gAgent.getID();
+					body["items"] = item_request_body_lib;
+
+					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
+				}
+			}
 		}
 		mFetchTimer.reset();
 	}
+
 	else if (isBulkFetchProcessingComplete())
 	{
 		setAllFoldersFetched();
@@ -624,7 +738,7 @@ bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LL
 	for (fetch_queue_t::const_iterator it = mFetchQueue.begin();
 		 it != mFetchQueue.end(); ++it)
 	{
-		const LLUUID& fetch_id = (*it).mCatUUID;
+		const LLUUID& fetch_id = (*it).mUUID;
 		if (gInventory.isObjectDescendentOf(fetch_id, cat_id))
 			return false;
 	}
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index c35c785ceb3..0745407a8c8 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -60,10 +60,10 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	bool inventoryFetchInProgress() const;
 
     void findLostItems();	
+	void incrFetchCount(S16 fetching);
 protected:
-	void incrBulkFetch(S16 fetching);
 	bool isBulkFetchProcessingComplete() const;
-	void bulkFetch(std::string url);
+	void bulkFetch();
 
 	void backgroundFetch();
 	static void backgroundFetchCB(void*); // background fetch idle function
@@ -77,7 +77,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	BOOL mAllFoldersFetched;
 
 	BOOL mBackgroundFetchActive;
-	S16 mBulkFetchCount;
+	S16 mFetchCount;
 	BOOL mTimelyFetchPending;
 	S32 mNumFetchRetries;
 
@@ -87,11 +87,11 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 
 	struct FetchQueueInfo
 	{
-		FetchQueueInfo(const LLUUID& id, BOOL recursive) :
-			mCatUUID(id), mRecursive(recursive)
-		{
-		}
-		LLUUID mCatUUID;
+		FetchQueueInfo(const LLUUID& id, BOOL recursive, bool is_category = true) :
+			mUUID(id), mRecursive(recursive), mIsCategory(is_category)
+		{}
+		LLUUID mUUID;
+		bool mIsCategory;
 		BOOL mRecursive;
 	};
 	typedef std::deque<FetchQueueInfo> fetch_queue_t;
-- 
GitLab


From c0d2d316bef9157fcf80e7ee33aff38b55410f16 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sun, 15 Jan 2012 10:04:41 -0500
Subject: [PATCH 560/933] STORM-1796 Preferences->Privacy->Only friends and
 groups can call or IM me cannot be changed unless Voice Chat is enabled

---
 doc/contributions.txt                                            | 1 +
 indra/newview/skins/default/xui/en/panel_preferences_privacy.xml | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 84f399cc893..30cc447bbfa 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -607,6 +607,7 @@ Jonathan Yap
 	STORM-1737
 	STORM-1733
 	STORM-1790
+	STORM-1796
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
index 47236c1a48b..587c461bee9 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
@@ -59,7 +59,6 @@
      top_pad="30"
      width="350" />
     <check_box
-     enabled_control="EnableVoiceChat"
      control_name="VoiceCallsFriendsOnly"
      height="16"
      label="Only friends and groups can call or IM me"
-- 
GitLab


From 1fc53d33bd6ca6e6cb2f32281e54bd5c78b15610 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 16 Jan 2012 12:16:17 -0500
Subject: [PATCH 561/933] STORM-1799 Object doesn't appear in Block list if
 trying to block from Remote object inspector

---
 doc/contributions.txt                   |  1 +
 indra/newview/llinspectremoteobject.cpp | 24 +++---------------------
 2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 84f399cc893..cd782985dd6 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -607,6 +607,7 @@ Jonathan Yap
 	STORM-1737
 	STORM-1733
 	STORM-1790
+	STORM-1799
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp
index bf6cf522980..a12ec390af4 100644
--- a/indra/newview/llinspectremoteobject.cpp
+++ b/indra/newview/llinspectremoteobject.cpp
@@ -60,12 +60,10 @@ class LLInspectRemoteObject : public LLInspect
 	
 private:
 	void update();
-	void onNameCache(const LLUUID& id, const std::string& name, bool is_group);
 	
 private:
 	LLUUID		 mObjectID;
 	LLUUID		 mOwnerID;
-	std::string  mOwnerLegacyName;
 	std::string  mSLurl;
 	std::string  mName;
 	bool         mGroupOwned;
@@ -75,7 +73,6 @@ LLInspectRemoteObject::LLInspectRemoteObject(const LLSD& sd) :
 	LLInspect(LLSD()),
 	mObjectID(NULL),
 	mOwnerID(NULL),
-	mOwnerLegacyName(),
 	mSLurl(""),
 	mName(""),
 	mGroupOwned(false)
@@ -111,14 +108,6 @@ void LLInspectRemoteObject::onOpen(const LLSD& data)
 	mGroupOwned = data["group_owned"].asBoolean();
 	mSLurl      = data["slurl"].asString();
 
-	// work out the owner's name
-	mOwnerLegacyName = "";
-	if (gCacheName)
-	{
-		gCacheName->get(mOwnerID, mGroupOwned,  // muting
-			boost::bind(&LLInspectRemoteObject::onNameCache, this, _1, _2, _3));
-	}
-
 	// update the inspector with the current object state
 	update();
 
@@ -144,8 +133,7 @@ void LLInspectRemoteObject::onClickMap()
 
 void LLInspectRemoteObject::onClickBlock()
 {
-	LLMute::EType mute_type = mGroupOwned ? LLMute::GROUP : LLMute::AGENT;
-	LLMute mute(mOwnerID, mOwnerLegacyName, mute_type);
+	LLMute mute(mObjectID, mName, LLMute::OBJECT);
 	LLMuteList::getInstance()->add(mute);
 	LLPanelBlockedList::showPanelAndSelect(mute.mID);
 	closeFloater();
@@ -156,12 +144,6 @@ void LLInspectRemoteObject::onClickClose()
 	closeFloater();
 }
 
-void LLInspectRemoteObject::onNameCache(const LLUUID& id, const std::string& name, bool is_group)
-{
-	mOwnerLegacyName = name;
-	update();
-}
-
 void LLInspectRemoteObject::update()
 {
 	// show the object name as the inspector's title
@@ -198,8 +180,8 @@ void LLInspectRemoteObject::update()
 	// disable the Map button if we don't have a SLurl
 	getChild<LLUICtrl>("map_btn")->setEnabled(! mSLurl.empty());
 
-	// disable the Block button if we don't have the owner ID
-	getChild<LLUICtrl>("block_btn")->setEnabled(! mOwnerID.isNull());
+	// disable the Block button if we don't have the object ID (will this ever happen?)
+	getChild<LLUICtrl>("block_btn")->setEnabled(! mObjectID.isNull());
 }
 
 //////////////////////////////////////////////////////////////////////////////
-- 
GitLab


From cd4204b2730350eede126190814621b65308c422 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 16 Jan 2012 11:03:33 -0800
Subject: [PATCH 562/933] EXP-1758 WIP Progress spinner not shown during
 merketplace synch if Merchant Outbox floater was previously minimized rewrote
 layout_stack resizing logic to be symmetrical

---
 indra/llui/lllayoutstack.cpp                  | 784 +++++++++++-------
 indra/llui/lllayoutstack.h                    |  69 +-
 indra/llui/llresizebar.cpp                    |   4 +-
 indra/llui/llresizebar.h                      |   1 +
 indra/llui/llwindowshade.cpp                  |   4 +-
 indra/newview/llchathistory.cpp               |   1 -
 indra/newview/llchicletbar.cpp                |  27 -
 .../newview/llfloaternotificationsconsole.cpp |   2 +-
 indra/newview/llimfloater.cpp                 |   3 -
 indra/newview/llsidepanelinventory.cpp        |   1 -
 .../default/xui/en/floater_help_browser.xml   |   1 -
 .../default/xui/en/floater_im_session.xml     |   5 +-
 .../default/xui/en/floater_media_browser.xml  |   4 -
 .../xui/en/floater_test_layout_stacks.xml     | 223 +++++
 .../default/xui/en/floater_ui_preview.xml     |   2 +
 .../default/xui/en/floater_voice_controls.xml |   5 +-
 .../default/xui/en/floater_web_content.xml    |   5 +-
 .../skins/default/xui/en/main_view.xml        |   2 -
 .../default/xui/en/menu_inventory_add.xml     |   1 +
 .../xui/en/panel_adhoc_control_panel.xml      |   6 +-
 .../default/xui/en/panel_bottomtray_lite.xml  |   8 +-
 .../default/xui/en/panel_chiclet_bar.xml      |   4 -
 .../default/xui/en/panel_classified_info.xml  |  12 +-
 .../default/xui/en/panel_edit_classified.xml  |   2 -
 .../skins/default/xui/en/panel_edit_pick.xml  |   2 -
 .../default/xui/en/panel_edit_profile.xml     |   2 -
 .../default/xui/en/panel_edit_wearable.xml    |   2 -
 .../xui/en/panel_group_control_panel.xml      |  11 +-
 .../xui/en/panel_group_info_sidetray.xml      |   5 +-
 .../default/xui/en/panel_im_control_panel.xml |  23 +-
 .../skins/default/xui/en/panel_landmarks.xml  |   4 -
 .../skins/default/xui/en/panel_login.xml      |   2 -
 .../default/xui/en/panel_main_inventory.xml   |   4 -
 .../default/xui/en/panel_navigation_bar.xml   |   1 -
 .../default/xui/en/panel_nearby_media.xml     |  10 +-
 .../default/xui/en/panel_outfit_edit.xml      |   6 +-
 .../xui/en/panel_outfits_inventory.xml        |   2 -
 .../skins/default/xui/en/panel_people.xml     |  12 -
 .../skins/default/xui/en/panel_pick_info.xml  |   3 -
 .../skins/default/xui/en/panel_picks.xml      |   5 -
 .../default/xui/en/panel_place_profile.xml    |   2 -
 .../skins/default/xui/en/panel_places.xml     |  10 -
 .../xui/en/panel_postcard_settings.xml        |   2 -
 .../xui/en/panel_prim_media_controls.xml      |  35 +-
 .../skins/default/xui/en/panel_progress.xml   |   3 -
 .../default/xui/en/panel_snapshot_local.xml   |   2 -
 .../default/xui/en/panel_snapshot_profile.xml |   2 -
 .../default/xui/en/panel_toolbar_view.xml     |   5 -
 .../default/xui/en/sidepanel_inventory.xml    |  12 +-
 49 files changed, 755 insertions(+), 588 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 0e7060e22cf..b67030dc34e 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -34,10 +34,13 @@
 #include "llpanel.h"
 #include "llresizebar.h"
 #include "llcriticaldamp.h"
+#include "boost/foreach.hpp"
 
 static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
 static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
 
+static const F32 MAX_FRACTIONAL_VALUE = 0.99999f;
+
 void LLLayoutStack::OrientationNames::declareValues()
 {
 	declare("horizontal", HORIZONTAL);
@@ -49,15 +52,12 @@ void LLLayoutStack::OrientationNames::declareValues()
 //
 LLLayoutPanel::Params::Params()	
 :	expanded_min_dim("expanded_min_dim", 0),
-	min_dim("min_dim", 0),
-	max_dim("max_dim", S32_MAX),
-	user_resize("user_resize", true),
+	min_dim("min_dim", -1),
+	user_resize("user_resize", false),
 	auto_resize("auto_resize", true)
 {
 	addSynonym(min_dim, "min_width");
 	addSynonym(min_dim, "min_height");
-	addSynonym(max_dim, "max_width");
-	addSynonym(max_dim, "max_height");
 }
 
 LLLayoutPanel::LLLayoutPanel(const Params& p)	
@@ -65,7 +65,6 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
 	mExpandedMinDimSpecified(false),
 	mExpandedMinDim(p.min_dim),
  	mMinDim(p.min_dim), 
- 	mMaxDim(p.max_dim), 
  	mAutoResize(p.auto_resize),
  	mUserResize(p.user_resize),
 	mCollapsed(FALSE),
@@ -73,6 +72,8 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
 	mVisibleAmt(1.f), // default to fully visible
 	mResizeBar(NULL),
 	mFractionalSize(0.f),
+	mTargetDim(0),
+	mIgnoreReshape(false),
 	mOrientation(LLLayoutStack::HORIZONTAL)
 {
 	// Set the expanded min dim if it is provided, otherwise it gets the p.min_dim value
@@ -103,33 +104,85 @@ LLLayoutPanel::~LLLayoutPanel()
 	mResizeBar = NULL;
 }
 
-void LLLayoutPanel::reshape(S32 width, S32 height, BOOL called_from_parent)
+F32 LLLayoutPanel::getAutoResizeFactor() const
+{
+	return mVisibleAmt * (1.f - mCollapseAmt);
+}
+ 
+F32 LLLayoutPanel::getVisibleAmount() const
+{
+	return mVisibleAmt;
+}
+
+S32 LLLayoutPanel::getLayoutDim() const
+{
+	return llround((mOrientation == LLLayoutStack::HORIZONTAL)
+					? getRect().getWidth()
+					: getRect().getHeight());
+}
+ 
+S32 LLLayoutPanel::getVisibleDim() const
+{
+	F32 min_dim = getRelevantMinDim();
+	return llround(mVisibleAmt
+					* (min_dim
+						+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
+}
+ 
+void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientation )
 {
-	if (mOrientation == LLLayoutStack::HORIZONTAL)
+	mOrientation = orientation;
+	S32 layout_dim = llround((mOrientation == LLLayoutStack::HORIZONTAL)
+		? getRect().getWidth()
+		: getRect().getHeight());
+
+	if (mMinDim == -1)
 	{
-		mFractionalSize += width - llround(mFractionalSize);
+		if (!mAutoResize)
+		{
+			setMinDim(layout_dim);
+		}
+		else
+		{
+			setMinDim(0);
+		}
 	}
-	else
+
+	mTargetDim = llmax(layout_dim, getMinDim());
+}
+ 
+void LLLayoutPanel::setVisible( BOOL visible )
+{
+	if (visible != getVisible())
 	{
-		mFractionalSize += height - llround(mFractionalSize);
+		LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent());
+		stackp->mNeedsLayout = true;
 	}
-	LLPanel::reshape(width, height, called_from_parent);
+	LLPanel::setVisible(visible);
 }
 
-F32 LLLayoutPanel::getCollapseFactor()
+void LLLayoutPanel::reshape( S32 width, S32 height, BOOL called_from_parent /*= TRUE*/ )
 {
-	if (mOrientation == LLLayoutStack::HORIZONTAL)
+	if (!mIgnoreReshape && !mAutoResize)
 	{
-		F32 collapse_amt = 
-			clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)getRelevantMinDim() / (F32)llmax(1, getRect().getWidth()));
-		return mVisibleAmt * collapse_amt;
+		mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height;
 	}
-	else
+	LLPanel::reshape(width, height, called_from_parent);
+}
+
+void LLLayoutPanel::handleReshape(const LLRect& new_rect, bool by_user)
+{
+	LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent());
+	if (stackp)
 	{
-		F32 collapse_amt = 
-			clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)getRelevantMinDim() / (F32)llmax(1, getRect().getHeight())));
-		return mVisibleAmt * collapse_amt;
+		stackp->mNeedsLayout = true;
+		if (by_user)
+		{
+			// tell layout stack to account for new shape
+			stackp->updatePanelRect(this, new_rect);
+		}
 	}
+	LLPanel::handleReshape(new_rect, by_user);
 }
 
 //
@@ -147,12 +200,11 @@ LLLayoutStack::Params::Params()
 
 LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) 
 :	LLView(p),
-	mMinWidth(0),
-	mMinHeight(0),
 	mPanelSpacing(p.border_size),
 	mOrientation(p.orientation),
 	mAnimate(p.animate),
 	mAnimatedThisFrame(false),
+	mNeedsLayout(true),
 	mClip(p.clip),
 	mOpenTimeConstant(p.open_time_constant),
 	mCloseTimeConstant(p.close_time_constant)
@@ -169,26 +221,26 @@ void LLLayoutStack::draw()
 {
 	updateLayout();
 
-	e_panel_list_t::iterator panel_it;
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+	// always clip to stack itself
+	LLLocalClipRect clip(getLocalRect());
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 	{
 		// clip to layout rectangle, not bounding rectangle
-		LLRect clip_rect = (*panel_it)->getRect();
+		LLRect clip_rect = panelp->getRect();
 		// scale clipping rectangle by visible amount
 		if (mOrientation == HORIZONTAL)
 		{
-			clip_rect.mRight = clip_rect.mLeft + llround((F32)clip_rect.getWidth() * (*panel_it)->getCollapseFactor());
+			clip_rect.mRight = clip_rect.mLeft + panelp->getVisibleDim();
 		}
 		else
 		{
-			clip_rect.mBottom = clip_rect.mTop - llround((F32)clip_rect.getHeight() * (*panel_it)->getCollapseFactor());
+			clip_rect.mBottom = clip_rect.mTop - panelp->getVisibleDim();
 		}
 
-		LLPanel* panelp = (*panel_it);
-
-		LLLocalClipRect clip(clip_rect, mClip);
-		// only force drawing invisible children if visible amount is non-zero
-		drawChild(panelp, 0, 0, !clip_rect.isEmpty());
+		{LLLocalClipRect clip(clip_rect, mClip);
+			// only force drawing invisible children if visible amount is non-zero
+			drawChild(panelp, 0, 0, !clip_rect.isEmpty());
+		}
 	}
 	mAnimatedThisFrame = false;
 }
@@ -201,12 +253,10 @@ void LLLayoutStack::removeChild(LLView* view)
 	{
 		mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
 		delete embedded_panelp;
+		updateFractionalSizes();
+		mNeedsLayout = true;
 	}
 
-	// need to update resizebars
-
-	calcMinExtents();
-
 	LLView::removeChild(view);
 }
 
@@ -221,29 +271,15 @@ bool LLLayoutStack::addChild(LLView* child, S32 tab_group)
 	LLLayoutPanel* panelp = dynamic_cast<LLLayoutPanel*>(child);
 	if (panelp)
 	{
-		panelp->mFractionalSize = (mOrientation == HORIZONTAL)
-									? panelp->getRect().getWidth()
-									: panelp->getRect().getHeight();
 		panelp->setOrientation(mOrientation);
 		mPanels.push_back(panelp);
+		createResizeBar(panelp);
+		mNeedsLayout = true;
 	}
-	return LLView::addChild(child, tab_group);
-}
-
-void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front)
-{
-	LLLayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move);
-	LLLayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel);
+	BOOL result = LLView::addChild(child, tab_group);
 
-	if (!embedded_panel_to_move || !embedded_target_panel || embedded_panel_to_move == embedded_target_panel)
-	{
-		llwarns << "One of the panels was not found in stack or NULL was passed instead of valid panel" << llendl;
-		return;
-	}
-	e_panel_list_t::iterator it = std::find(mPanels.begin(), mPanels.end(), embedded_panel_to_move);
-	mPanels.erase(it);
-	it = move_to_front ? mPanels.begin() : std::find(mPanels.begin(), mPanels.end(), embedded_target_panel);
-	mPanels.insert(it, embedded_panel_to_move);
+	updateFractionalSizes();
+	return result;
 }
 
 void LLLayoutStack::addPanel(LLLayoutPanel* panel, EAnimate animate)
@@ -258,23 +294,19 @@ void LLLayoutStack::addPanel(LLLayoutPanel* panel, EAnimate animate)
 	}
 }
 
-void LLLayoutStack::removePanel(LLPanel* panel)
-{
-	removeChild(panel);
-}
-
 void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)
 {
 	LLLayoutPanel* panel_container = findEmbeddedPanel(panel);
 	if (!panel_container) return;
 
 	panel_container->mCollapsed = collapsed;
+	mNeedsLayout = true;
 }
 
 void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize)
 {
 	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
-
+	
 	if (panel)
 	{
 		panel->mAutoResize = auto_resize;
@@ -291,51 +323,246 @@ void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_
 	}
 }
 
-bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_dimp)
+
+static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks");
+
+void LLLayoutStack::updateLayout()
+{	
+	LLFastTimer ft(FTM_UPDATE_LAYOUT);
+
+	if (!mNeedsLayout) return;
+
+	bool animation_in_progress = animatePanels();
+	F32 total_visible_fraction = 0.f;
+	S32 space_to_distribute = (mOrientation == HORIZONTAL)
+							? getRect().getWidth()
+							: getRect().getHeight();
+
+	// first, assign minimum dimensions
+	LLLayoutPanel* panelp = NULL;
+	BOOST_FOREACH(panelp, mPanels)
+	{
+		if (panelp->mAutoResize)
+		{
+			panelp->mTargetDim = panelp->getRelevantMinDim();
+		}
+		space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
+		total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
+	}
+
+	llassert(total_visible_fraction < 1.01f);
+
+	// don't need spacing after last panel
+	space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
+
+	// scale up space to distribute, since some of might will go to an invisible fraction of the auto-resize space
+	space_to_distribute = (total_visible_fraction > 0.f)
+						? llround((F32)space_to_distribute / total_visible_fraction)
+						: space_to_distribute;
+
+	if (space_to_distribute > 0)
+	{	// give space proportionally to auto resize panels, even invisible ones
+		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		{
+			if (panelp->mAutoResize == TRUE)
+			{
+				S32 delta = llround((F32)space_to_distribute * panelp->mFractionalSize/* * panelp->getAutoResizeFactor()*/);
+				panelp->mTargetDim += delta;
+			}
+		}
+	}
+
+	F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight();
+
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	{
+		F32 panel_dim = panelp->mTargetDim;
+		F32 panel_visible_dim = panelp->getVisibleDim();
+
+		LLRect panel_rect;
+		if (mOrientation == HORIZONTAL)
+		{
+			panel_rect.setLeftTopAndSize(llround(cur_pos),
+										getRect().getHeight(),
+										llround(panel_dim),
+										getRect().getHeight());
+		}
+		else
+		{
+			panel_rect.setLeftTopAndSize(0,
+				llround(cur_pos),
+				getRect().getWidth(),
+				llround(panel_dim));
+		}
+		panelp->setIgnoreReshape(true);
+		panelp->setShape(panel_rect);
+		panelp->setIgnoreReshape(false);
+
+		static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0);
+		LLRect resize_bar_rect(panel_rect);
+
+		F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
+		if (mOrientation == HORIZONTAL)
+		{
+			resize_bar_rect.mLeft = panel_rect.mRight - resize_bar_overlap;
+			resize_bar_rect.mRight = panel_rect.mRight + panel_spacing + resize_bar_overlap;
+
+			cur_pos += panel_visible_dim + panel_spacing;
+		}
+		else //VERTICAL
+		{
+			resize_bar_rect.mTop = panel_rect.mBottom + resize_bar_overlap;
+			resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing - resize_bar_overlap;
+
+			cur_pos -= panel_visible_dim + panel_spacing;
+		}
+		panelp->mResizeBar->setShape(resize_bar_rect);
+	}
+
+	updateResizeBarLimits();
+
+	// clear animation flag at end, since panel resizes will set it
+	// and leave it set if there is any animation in progress
+	mNeedsLayout = animation_in_progress;
+} // end LLLayoutStack::updateLayout
+
+LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
+{
+	if (!panelp) return NULL;
+
+	e_panel_list_t::const_iterator panel_it;
+	BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+	{
+		if (p == panelp)
+		{
+			return p;
+		}
+	}
+	return NULL;
+}
+
+LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const
 {
-	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+	LLLayoutPanel* result = NULL;
 
-	if (panel && min_dimp)
+	BOOST_FOREACH(LLLayoutPanel* p, mPanels)
 	{
-		*min_dimp = panel->getRelevantMinDim();
+		if (p->getName() == name)
+		{
+			result = p;
+			break;
+		}
 	}
 
-	return NULL != panel;
+	return result;
 }
 
-bool LLLayoutStack::getPanelMaxSize(const std::string& panel_name, S32* max_dimp)
+void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
 {
-	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+	BOOST_FOREACH(LLLayoutPanel* lp, mPanels)
+	{
+		if (lp->mResizeBar == NULL)
+		{
+			LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM;
+			LLRect resize_bar_rect = getRect();
 
-	if (panel)
+			LLResizeBar::Params resize_params;
+			resize_params.name("resize");
+			resize_params.resizing_view(lp);
+			resize_params.min_size(lp->getRelevantMinDim());
+			resize_params.side(side);
+			resize_params.snapping_enabled(false);
+			LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params);
+			lp->mResizeBar = resize_bar;
+			LLView::addChild(resize_bar, 0);
+		}
+	}
+	// bring all resize bars to the front so that they are clickable even over the panels
+	// with a bit of overlap
+	for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
-		if (max_dimp) *max_dimp = panel->mMaxDim;
+		LLResizeBar* resize_barp = (*panel_it)->mResizeBar;
+		sendChildToFront(resize_barp);
 	}
+}
 
-	return NULL != panel;
+// update layout stack animations, etc. once per frame
+// NOTE: we use this to size world view based on animating UI, *before* we draw the UI
+// we might still need to call updateLayout during UI draw phase, in case UI elements
+// are resizing themselves dynamically
+//static 
+void LLLayoutStack::updateClass()
+{
+	for (instance_iter it = beginInstances(); it != endInstances(); ++it)
+	{
+		it->updateLayout();
+	}
 }
 
-static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks");
-void LLLayoutStack::updateLayout(BOOL force_resize)
+void LLLayoutStack::updateFractionalSizes()
 {
-	LLFastTimer ft(FTM_UPDATE_LAYOUT);
-	static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0);
-	calcMinExtents();
-	createResizeBars();
+	F32 total_resizable_dim = 0;
+	S32 num_auto_resize_panels = 0;
+
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	{
+		if (panelp->mAutoResize)
+		{
+			total_resizable_dim += llmax(0, panelp->getLayoutDim() - panelp->getRelevantMinDim());
+			num_auto_resize_panels++;
+		}
+	}
 
-	// calculate current extents
-	F32 total_size = 0.f;
+	F32 total_fractional_size = 0.f;
+	
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	{
+		if (panelp->mAutoResize)
+		{
+			F32 panel_resizable_dim = llmax(0.f, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
+			panelp->mFractionalSize = llmin(MAX_FRACTIONAL_VALUE, (panel_resizable_dim == 0.f)
+																	? (1.f - MAX_FRACTIONAL_VALUE)
+																	: panel_resizable_dim / total_resizable_dim);
+			total_fractional_size += panelp->mFractionalSize;
+			// check for NaNs
+			llassert(panelp->mFractionalSize == panelp->mFractionalSize);
+		}
+	}
 
+	if (total_fractional_size == 0.f)
+	{ // equal distribution
+		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		{
+			if (panelp->mAutoResize)
+			{
+				panelp->mFractionalSize = 1.f / (F32)num_auto_resize_panels;
+			}
+		}
+	}
+	else
+	{ // renormalize
+		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		{
+			if (panelp->mAutoResize)
+			{
+				panelp->mFractionalSize /= total_fractional_size;
+			}
+		}
+	}
+}
+
+bool LLLayoutStack::animatePanels()
+{
+	bool animation_in_progress = false;
+	
 	//
 	// animate visibility
 	//
-	e_panel_list_t::iterator panel_it;
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end();	++panel_it)
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 	{
-		LLLayoutPanel* panelp = (*panel_it);
-		if (panelp->getVisible()) 
+		if (panelp->getVisible())
 		{
-			if (mAnimate)
+			if (mAnimate && panelp->mVisibleAmt < 1.f)
 			{
 				if (!mAnimatedThisFrame)
 				{
@@ -345,15 +572,21 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 						panelp->mVisibleAmt = 1.f;
 					}
 				}
+				
+				animation_in_progress = true;
 			}
 			else
 			{
-				panelp->mVisibleAmt = 1.f;
+				if (panelp->mVisibleAmt != 1.f)
+				{
+					panelp->mVisibleAmt = 1.f;
+					animation_in_progress = true;
+				}
 			}
 		}
 		else // not visible
 		{
-			if (mAnimate)
+			if (mAnimate && panelp->mVisibleAmt > 0.f)
 			{
 				if (!mAnimatedThisFrame)
 				{
@@ -363,297 +596,206 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 						panelp->mVisibleAmt = 0.f;
 					}
 				}
+
+				animation_in_progress = true;
 			}
 			else
 			{
-				panelp->mVisibleAmt = 0.f;
+				if (panelp->mVisibleAmt != 0.f)
+				{
+					panelp->mVisibleAmt = 0.f;
+					animation_in_progress = true;
+				}
 			}
 		}
 
 		F32 collapse_state = panelp->mCollapsed ? 1.f : 0.f;
-		panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
-
-        total_size += panelp->mFractionalSize * panelp->getCollapseFactor();
-        // want n-1 panel gaps for n panels
-		if (panel_it != mPanels.begin())
-		{
-			total_size += mPanelSpacing;
-		}
-	}
-
-	S32 num_resizable_panels = 0;
-	F32 shrink_headroom_available = 0.f;
-	F32 shrink_headroom_total = 0.f;
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
-	{
-		LLLayoutPanel* panelp = (*panel_it);
-
-		// panels that are not fully visible do not count towards shrink headroom
-		if (panelp->getCollapseFactor() < 1.f) 
-		{
-			continue;
-		}
-
-		F32 cur_size = panelp->mFractionalSize;
-		F32 min_size = (F32)panelp->getRelevantMinDim();
-		
-		// if currently resizing a panel or the panel is flagged as not automatically resizing
-		// only track total available headroom, but don't use it for automatic resize logic
-		if (panelp->mResizeBar->hasMouseCapture() 
-			|| (!panelp->mAutoResize 
-				&& !force_resize))
-		{
-			shrink_headroom_total += cur_size - min_size;
-		}
-		else
-		{
-			num_resizable_panels++;
-			
-			shrink_headroom_available += cur_size - min_size;
-			shrink_headroom_total += cur_size - min_size;
-		}
-	}
-
-	// calculate how many pixels need to be distributed among layout panels
-	// positive means panels need to grow, negative means shrink
-	F32 pixels_to_distribute = (mOrientation == HORIZONTAL)
-							? getRect().getWidth() - total_size
-							: getRect().getHeight() - total_size;
-
-	// now we distribute the pixels...
-	F32 cur_x = 0.f;
-	F32 cur_y = (F32)getRect().getHeight();
-
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
-	{
-		LLLayoutPanel* panelp = (*panel_it);
-
-		F32 min_size = panelp->getRelevantMinDim();
-		F32 delta_size = 0.f;
-
-		// if panel can automatically resize (not animating, and resize flag set)...
-		if (panelp->getCollapseFactor() == 1.f 
-			&& (force_resize || panelp->mAutoResize) 
-			&& !panelp->mResizeBar->hasMouseCapture()) 
+		if (panelp->mCollapseAmt != collapse_state)
 		{
-			if (pixels_to_distribute < 0.f)
+			if (!mAnimatedThisFrame)
 			{
-				// shrink proportionally to amount over minimum
-				// so we can do this in one pass
-				delta_size = (shrink_headroom_available > 0.f) 
-					? pixels_to_distribute * ((F32)(panelp->mFractionalSize - min_size) / shrink_headroom_available) 
-					: 0.f;
-				shrink_headroom_available -= (panelp->mFractionalSize - min_size);
+				panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
 			}
-			else
+			animation_in_progress = true;
+			
+			if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f)
 			{
-				// grow all elements equally
-				delta_size = pixels_to_distribute / (F32)num_resizable_panels;
-				num_resizable_panels--;
+				panelp->mCollapseAmt = collapse_state;
 			}
-			
-			panelp->mFractionalSize = llmax(min_size, panelp->mFractionalSize + delta_size);
-			pixels_to_distribute -= delta_size;
 		}
+	}
 
-		// adjust running headroom count based on new sizes
-		shrink_headroom_total += delta_size;
+	mAnimatedThisFrame = true;
 
-		LLRect panel_rect;
-		if (mOrientation == HORIZONTAL)
-		{
-			panel_rect.setLeftTopAndSize(llround(cur_x), 
-										llround(cur_y), 
-										llround(panelp->mFractionalSize), 
-										getRect().getHeight());
-		}
-		else
-		{
-			panel_rect.setLeftTopAndSize(llround(cur_x), 
-										llround(cur_y), 
-										getRect().getWidth(), 
-										llround(panelp->mFractionalSize));
-		}
-		panelp->setShape(panel_rect);
+	return animation_in_progress;
+}
 
-		LLRect resize_bar_rect = panel_rect;
-		if (mOrientation == HORIZONTAL)
-		{
-			resize_bar_rect.mLeft = panel_rect.mRight - resize_bar_overlap;
-			resize_bar_rect.mRight = panel_rect.mRight + mPanelSpacing + resize_bar_overlap;
-		}
-		else
-		{
-			resize_bar_rect.mTop = panel_rect.mBottom + resize_bar_overlap;
-			resize_bar_rect.mBottom = panel_rect.mBottom - mPanelSpacing - resize_bar_overlap;
-		}
-		(*panel_it)->mResizeBar->setRect(resize_bar_rect);
+void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& new_rect )
+{
+	S32 new_dim = (mOrientation == HORIZONTAL)
+					? new_rect.getWidth()
+					: new_rect.getHeight();
+	S32 delta_dim = new_dim - resized_panel->getVisibleDim();
+	if (delta_dim == 0) return;
 
-		F32 size = ((*panel_it)->mFractionalSize * (*panel_it)->getCollapseFactor()) + (F32)mPanelSpacing;
-		if (mOrientation == HORIZONTAL)
-		{
-			cur_x += size;
-		}
-		else //VERTICAL
-		{
-			cur_y -= size;
-		}
-	}
+	F32 total_visible_fraction = 0.f;
+	F32 delta_auto_resize_headroom = 0.f;
+	F32 total_auto_resize_headroom = 0.f;
 
-	// update resize bars with new limits
-	LLLayoutPanel* last_resizeable_panel = NULL;
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
-	{
-		LLLayoutPanel* panelp = (*panel_it);
-		S32 relevant_min = panelp->getRelevantMinDim();
+	LLLayoutPanel* other_resize_panel = NULL;
+	LLLayoutPanel* following_panel = NULL;
 
-		if (mOrientation == HORIZONTAL)
+	BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels)
+	{
+		if (panelp->mAutoResize)
 		{
-			(*panel_it)->mResizeBar->setResizeLimits(
-				relevant_min, 
-				relevant_min + llround(shrink_headroom_total));
+			total_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
+			total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
 		}
-		else //VERTICAL
+
+		if (panelp == resized_panel)
 		{
-			(*panel_it)->mResizeBar->setResizeLimits(
-				relevant_min, 
-				relevant_min + llround(shrink_headroom_total));
+			other_resize_panel = following_panel;
 		}
 
-		// toggle resize bars based on panel visibility, resizability, etc
-		BOOL resize_bar_enabled = panelp->getVisible() && (*panel_it)->mUserResize;
-		(*panel_it)->mResizeBar->setVisible(resize_bar_enabled);
-
-		if ((*panel_it)->mUserResize || (*panel_it)->mAutoResize)
+		if (panelp->getVisible() && !panelp->mCollapsed)
 		{
-			last_resizeable_panel = (*panel_it);
+			following_panel = panelp;
 		}
 	}
 
-	// hide last resize bar as there is nothing past it
-	// resize bars need to be in between two resizable panels
-	if (last_resizeable_panel)
+	if (resized_panel->mAutoResize == FALSE)
 	{
-		last_resizeable_panel->mResizeBar->setVisible(FALSE);
+		delta_auto_resize_headroom += -delta_dim;
 	}
-
-	// not enough room to fit existing contents
-	if (force_resize == FALSE
-		// layout did not complete by reaching target position
-		&& ((mOrientation == VERTICAL && llround(cur_y) != -mPanelSpacing)
-			|| (mOrientation == HORIZONTAL && llround(cur_x) != getRect().getWidth() + mPanelSpacing)))
+	if (other_resize_panel && other_resize_panel->mAutoResize == FALSE)
 	{
-		// do another layout pass with all stacked elements contributing
-		// even those that don't usually resize
-		llassert_always(force_resize == FALSE);
-		updateLayout(TRUE);
+		delta_auto_resize_headroom += delta_dim;
 	}
 
-	 mAnimatedThisFrame = true;
-} // end LLLayoutStack::updateLayout
 
+	//delta_auto_resize_headroom = (total_visible_fraction > 0.f)
+	//								? delta_auto_resize_headroom / total_visible_fraction
+	//								: 0.f;
 
-LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
-{
-	if (!panelp) return NULL;
+	F32 fraction_given_up = 0.f;
+	F32 fraction_remaining = 1.f;
+	F32 updated_auto_resize_headroom = total_auto_resize_headroom + delta_auto_resize_headroom;
 
-	e_panel_list_t::const_iterator panel_it;
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+	enum
 	{
-		if ((*panel_it) == panelp)
-		{
-			return *panel_it;
-		}
-	}
-	return NULL;
-}
-
-LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const
-{
-	LLLayoutPanel* result = NULL;
+		BEFORE_RESIZED_PANEL,
+		RESIZED_PANEL,
+		NEXT_PANEL,
+		AFTER_RESIZED_PANEL
+	} which_panel = BEFORE_RESIZED_PANEL;
 
-	for (e_panel_list_t::const_iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 	{
-		LLLayoutPanel* p = *panel_it;
+		if (!panelp->getVisible() || panelp->mCollapsed) continue;
 
-		if (p->getName() == name)
+		if (panelp == resized_panel)
 		{
-			result = p;
-			break;
+			which_panel = RESIZED_PANEL;
 		}
-	}
-
-	return result;
-}
 
-// Compute sum of min_width or min_height of children
-void LLLayoutStack::calcMinExtents()
-{
-	mMinWidth = 0;
-	mMinHeight = 0;
-
-	e_panel_list_t::iterator panel_it;
-	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
-	{
-		if (mOrientation == HORIZONTAL)
+		switch(which_panel)
 		{
-            mMinWidth += (*panel_it)->getRelevantMinDim();
-			if (panel_it != mPanels.begin())
+		case BEFORE_RESIZED_PANEL:
+			if (panelp->mAutoResize)
+			{	// freeze current size as fraction of overall auto_resize space
+				F32 fractional_adjustment_factor = total_auto_resize_headroom / updated_auto_resize_headroom;
+				F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
+													0.f,
+													MAX_FRACTIONAL_VALUE);
+				F32 fraction_delta = (new_fractional_size - panelp->mFractionalSize);
+				fraction_given_up -= fraction_delta;
+				fraction_remaining -= panelp->mFractionalSize;
+				panelp->mFractionalSize += fraction_delta;
+				llassert(!llisnan(panelp->mFractionalSize));
+			}
+			else
 			{
-				mMinWidth += mPanelSpacing;
+				// leave non auto-resize panels alone
 			}
-		}
-		else //VERTICAL
-		{
-			mMinHeight += (*panel_it)->getRelevantMinDim();
-			if (panel_it != mPanels.begin())
+			break;
+		case RESIZED_PANEL:
+			if (panelp->mAutoResize)
+			{	// freeze new size as fraction
+				F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
+					? 1.f
+					: llmin(MAX_FRACTIONAL_VALUE, ((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom));
+				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
+				fraction_remaining -= panelp->mFractionalSize;
+				panelp->mFractionalSize = new_fractional_size;
+				llassert(!llisnan(panelp->mFractionalSize));
+			}
+			else
+			{	// freeze new size as original size
+				panelp->mTargetDim = new_dim;
+				fraction_remaining -= fraction_given_up;
+			}
+			which_panel = NEXT_PANEL;
+			break;
+		case NEXT_PANEL:
+			if (panelp->mAutoResize)
+			{
+				F32 new_fractional_size = (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
+												/ updated_auto_resize_headroom;
+				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
+				fraction_remaining -= panelp->mFractionalSize;
+				panelp->mFractionalSize = new_fractional_size;
+			}
+			else
+			{
+				panelp->mTargetDim -= delta_dim;
+			}
+			which_panel = AFTER_RESIZED_PANEL;
+			break;
+		case AFTER_RESIZED_PANEL:
+			if (panelp->mAutoResize)
 			{
-				mMinHeight += mPanelSpacing;
+				panelp->mFractionalSize += (panelp->mFractionalSize / fraction_remaining) * fraction_given_up;
 			}
+		default:
+			break;
 		}
 	}
 }
 
-void LLLayoutStack::createResizeBars()
+void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)
 {
-	for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+	mNeedsLayout = true;
+	LLView::reshape(width, height, called_from_parent);
+}
+
+void LLLayoutStack::updateResizeBarLimits()
+{
+	LLLayoutPanel* previous_visible_panelp = NULL;
+	BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels)
 	{
-		LLLayoutPanel* lp = (*panel_it);
-		if (lp->mResizeBar == NULL)
+		if (!visible_panelp->getVisible() || visible_panelp->mCollapsed)
 		{
-			LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM;
-			LLRect resize_bar_rect = getRect();
-
-			LLResizeBar::Params resize_params;
-			resize_params.name("resize");
-			resize_params.resizing_view(lp);
-			resize_params.min_size(lp->getRelevantMinDim());
-			resize_params.side(side);
-			resize_params.snapping_enabled(false);
-			LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params);
-			lp->mResizeBar = resize_bar;
-			LLView::addChild(resize_bar, 0);
+			visible_panelp->mResizeBar->setVisible(FALSE);
+			continue;
+		}
 
-			// bring all resize bars to the front so that they are clickable even over the panels
-			// with a bit of overlap
-			for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
-			{
-				LLResizeBar* resize_barp = (*panel_it)->mResizeBar;
-				sendChildToFront(resize_barp);
-			}
+		// toggle resize bars based on panel visibility, resizability, etc
+		if (visible_panelp->mUserResize 
+			&& previous_visible_panelp 
+			&& previous_visible_panelp->mUserResize)
+		{
+			visible_panelp->mResizeBar->setVisible(TRUE);
+			visible_panelp->mResizeBar->setResizeLimits(visible_panelp->getRelevantMinDim(), 
+														visible_panelp->getVisibleDim() 
+															+ (previous_visible_panelp->getVisibleDim() 
+																- previous_visible_panelp->getRelevantMinDim()));
+		}
+		else
+		{
+			visible_panelp->mResizeBar->setVisible(FALSE);
 		}
-	}
-}
 
-// update layout stack animations, etc. once per frame
-// NOTE: we use this to size world view based on animating UI, *before* we draw the UI
-// we might still need to call updateLayout during UI draw phase, in case UI elements
-// are resizing themselves dynamically
-//static 
-void LLLayoutStack::updateClass()
-{
-	for (instance_iter it = beginInstances(); it != endInstances(); ++it)
-	{
-		it->updateLayout();
+		previous_visible_panelp = visible_panelp;
 	}
 }
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 3b308a359d1..a343e11cece 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -5,7 +5,7 @@
  *
  * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2010, Linden Reshasearch, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -72,12 +72,11 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	/*virtual*/ void removeChild(LLView*);
 	/*virtual*/ BOOL postBuild();
 	/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
+	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
+
 
 	static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
 
-	S32 getMinWidth() const { return mMinWidth; }
-	S32 getMinHeight() const { return mMinHeight; }
-	
 	typedef enum e_animate
 	{
 		NO_ANIMATE,
@@ -85,47 +84,27 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	} EAnimate;
 
 	void addPanel(LLLayoutPanel* panel, EAnimate animate = NO_ANIMATE);
-	void removePanel(LLPanel* panel);
 	void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE);
 	S32 getNumPanels() { return mPanels.size(); }
-	/**
-	 * Moves panel_to_move before target_panel inside layout stack (both panels should already be there).
-	 * If move_to_front is true target_panel is ignored and panel_to_move is moved to the beginning of mPanels
-	 */
-	void movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front = false);
 
 	void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize);
 	void setPanelUserResize(const std::string& panel_name, BOOL user_resize);
 	
-	/**
-	 * Gets minimal dimension along layout_stack axis of the specified by name panel.
-	 *
-	 * @returns true if specified by panel_name internal panel exists, false otherwise.
-	 */
-	bool getPanelMinSize(const std::string& panel_name, S32* min_dimp);
-
-	/**
-	 * Gets maximal dimension along layout_stack axis of the specified by name panel.
-	 *
-	 * @returns true if specified by panel_name internal panel exists, false otherwise.
-	 */
-	bool getPanelMaxSize(const std::string& panel_name, S32* max_dim);
-	
-	void updateLayout(BOOL force_resize = FALSE);
-	
+	void updateLayout();
+
 	S32 getPanelSpacing() const { return mPanelSpacing; }
-	BOOL getAnimate () const { return mAnimate; }
-	void setAnimate (BOOL animate) { mAnimate = animate; }
 	
 	static void updateClass();
 
 protected:
 	LLLayoutStack(const Params&);
 	friend class LLUICtrlFactory;
+	friend class LLLayoutPanel;
 
 private:
-	void createResizeBars();
-	void calcMinExtents();
+	void updateResizeBarLimits();
+	bool animatePanels();
+	void createResizeBar(LLLayoutPanel* panel);
 
 	const ELayoutOrientation mOrientation;
 
@@ -134,9 +113,9 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 
 	LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
 	LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
+	void updateFractionalSizes();
+	void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect );
 
-	S32 mMinWidth;  // calculated by calcMinExtents
-	S32 mMinHeight;  // calculated by calcMinExtents
 	S32 mPanelSpacing;
 
 	// true if we already applied animation this frame
@@ -145,6 +124,7 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	bool mClip;
 	F32 mOpenTimeConstant;
 	F32 mCloseTimeConstant;
+	bool mNeedsLayout;
 }; // end class LLLayoutStack
 
 
@@ -156,8 +136,7 @@ friend class LLUICtrlFactory;
 	struct Params : public LLInitParam::Block<Params, LLPanel::Params>
 	{
 		Optional<S32>			expanded_min_dim,
-								min_dim,
-								max_dim;
+								min_dim;
 		Optional<bool>			user_resize,
 								auto_resize;
 
@@ -168,14 +147,17 @@ friend class LLUICtrlFactory;
 
 	void initFromParams(const Params& p);
 
+	void handleReshape(const LLRect& new_rect, bool by_user);
+
 	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
+	
+
+	void setVisible(BOOL visible);
 
+	S32 getLayoutDim() const;
 	S32 getMinDim() const { return mMinDim; }
 	void setMinDim(S32 value) { mMinDim = value; if (!mExpandedMinDimSpecified) mExpandedMinDim = value; }
 
-	S32 getMaxDim() const { return mMaxDim; }
-	void setMaxDim(S32 value) { mMaxDim = value; }
-
 	S32 getExpandedMinDim() const { return mExpandedMinDim; }
 	void setExpandedMinDim(S32 value) { mExpandedMinDim = value; mExpandedMinDimSpecified = true; }
 	
@@ -191,8 +173,14 @@ friend class LLUICtrlFactory;
 		return min_dim;
 	}
 
-	F32 getCollapseFactor();
-	void setOrientation(LLLayoutStack::ELayoutOrientation orientation) { mOrientation = orientation; }
+	F32 getAutoResizeFactor() const;
+	F32 getVisibleAmount() const;
+	S32 getVisibleDim() const;
+
+	void setOrientation(LLLayoutStack::ELayoutOrientation orientation);
+	void storeOriginalDim();
+
+	void setIgnoreReshape(bool ignore) { mIgnoreReshape = ignore; }
 
 protected:
 	LLLayoutPanel(const Params& p);
@@ -201,13 +189,14 @@ friend class LLUICtrlFactory;
 	S32		mExpandedMinDim;
 	
 	S32		mMinDim;
-	S32		mMaxDim;
 	bool	mAutoResize;
 	bool	mUserResize;
 	bool	mCollapsed;
 	F32		mVisibleAmt;
 	F32		mCollapseAmt;
 	F32		mFractionalSize;
+	S32		mTargetDim;
+	bool	mIgnoreReshape;
 	LLLayoutStack::ELayoutOrientation mOrientation;
 	class LLResizeBar* mResizeBar;
 };
diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp
index 02f60c76faf..87aeb4d7a74 100644
--- a/indra/llui/llresizebar.cpp
+++ b/indra/llui/llresizebar.cpp
@@ -79,6 +79,8 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p)
 
 BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask)
 {
+	if (!canResize()) return FALSE;
+
 	// Route future Mouse messages here preemptively.  (Release on mouse up.)
 	// No handler needed for focus lost since this clas has no state that depends on it.
 	gFocusMgr.setMouseCapture( this );
@@ -243,7 +245,7 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask)
 		handled = TRUE;
 	}
 
-	if( handled )
+	if( handled && canResize() )
 	{
 		switch( mSide )
 		{
diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h
index 0725fbd846a..6daf1919185 100644
--- a/indra/llui/llresizebar.h
+++ b/indra/llui/llresizebar.h
@@ -70,6 +70,7 @@ class LLResizeBar : public LLView
 	void			setResizeLimits( S32 min_size, S32 max_size ) { mMinSize = min_size; mMaxSize = max_size; }
 	void			setEnableSnapping(BOOL enable) { mSnappingEnabled = enable; }
 	void			setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; }
+	bool			canResize() { return getEnabled() && mMaxSize > mMinSize; }
 
 private:
 	S32				mDragLastScreenX;
diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index ae8b30b1ba2..a8bb29374ea 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -176,12 +176,12 @@ void LLWindowShade::draw()
 	{
 		hide();
 	}
-	else if (notification_area->getCollapseFactor() < 0.01f)
+	else if (notification_area->getVisibleAmount() < 0.01f)
 	{
 		displayLatestNotification();
 	}
 
-	if (!notification_area->getVisible() && (notification_area->getCollapseFactor() < 0.001f))
+	if (!notification_area->getVisible() && (notification_area->getVisibleAmount() < 0.001f))
 	{
 		getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(false);
 		setMouseOpaque(false);
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 42de47e7777..f530d10ddc5 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -621,7 +621,6 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p)
 	panel_p.has_border = false;
 	panel_p.mouse_opaque = false;
 	panel_p.min_dim = 30;
-	panel_p.max_dim = S32_MAX;
 	panel_p.auto_resize = true;
 	panel_p.user_resize = false;
 
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index a879651060b..a32fd307f16 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -42,28 +42,6 @@ namespace
 {
 	const std::string& PANEL_CHICLET_NAME	= "chiclet_list_panel";
 
-	S32 get_panel_min_width(LLLayoutStack* stack, LLView* panel)
-	{
-		S32 minimal_width = 0;
-		llassert(stack);
-		if ( stack && panel && panel->getVisible() )
-		{
-			stack->getPanelMinSize(panel->getName(), &minimal_width);
-		}
-		return minimal_width;
-	}
-
-	S32 get_panel_max_width(LLLayoutStack* stack, LLPanel* panel)
-	{
-		S32 max_width = 0;
-		llassert(stack);
-		if ( stack && panel && panel->getVisible() )
-		{
-			stack->getPanelMaxSize(panel->getName(), &max_width);
-		}
-		return max_width;
-	}
-
 	S32 get_curr_width(LLUICtrl* ctrl)
 	{
 		S32 cur_width = 0;
@@ -234,15 +212,10 @@ void LLChicletBar::reshape(S32 width, S32 height, BOOL called_from_parent)
 	{
 		// Firstly, update layout stack to ensure we deal with correct panel sizes.
 		{
-			BOOL saved_anim = mToolbarStack->getAnimate();
 			// Set chiclet panel to be autoresized by default.
 			mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE);
-			// Disable animation to prevent layout updating in several frames.
-			mToolbarStack->setAnimate(FALSE);
 			// Force the updating of layout to reset panels collapse factor.
 			mToolbarStack->updateLayout();
-			// Restore animate state.
-			mToolbarStack->setAnimate(saved_anim);
 		}
 
 		// chiclet bar is narrowed
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 29af81d64c0..2681d4b34d2 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -220,7 +220,7 @@ void LLFloaterNotificationConsole::addChannel(const std::string& name, bool open
 void LLFloaterNotificationConsole::removeChannel(const std::string& name)
 {
 	LLPanel* panelp = getChild<LLPanel>(name);
-	getChildRef<LLLayoutStack>("notification_channels").removePanel(panelp);
+	getChildRef<LLView>("notification_channels").removeChild(panelp);
 	delete panelp;
 
 	updateResizeLimits();
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index f5cda52d444..228260c41a4 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -385,9 +385,6 @@ void LLIMFloater::onSlide()
 
 	getChild<LLButton>("slide_left_btn")->setVisible(mControlPanel->getParent()->getVisible());
 	getChild<LLButton>("slide_right_btn")->setVisible(!mControlPanel->getParent()->getVisible());
-
-	LLLayoutStack* stack = getChild<LLLayoutStack>("im_panels");
-	if (stack) stack->setAnimate(true);
 }
 
 //static
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 9d069c3996c..e40cc4662b7 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -248,7 +248,6 @@ BOOL LLSidepanelInventory::postBuild()
 
 		// Disable user_resize on main inventory panel by default
 		inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false);
-		inv_stack->setPanelUserResize(INBOX_OUTBOX_LAYOUT_PANEL_NAME, false);
 
 		// Collapse marketplace panel by default
 		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME), true);
diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml
index d101bca6943..cd075abc415 100644
--- a/indra/newview/skins/default/xui/en/floater_help_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml
@@ -34,7 +34,6 @@
          left_delta="0"
          top_delta="0"
          name="external_controls"
-         user_resize="false"
          width="620">
             <web_browser
              trusted_content="true" 
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index a2739a8339f..ca73883e534 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -16,7 +16,7 @@
  min_width="250"
  min_height="190">
   <layout_stack
-   animate="false" 
+   animate="true" 
    default_tab_group="2"
   follows="all"
   height="320"
@@ -32,8 +32,7 @@
       min_width="115"
       width="150" 
       height="320" 
-      auto_resize="false"
-      user_resize="false">
+      auto_resize="false">
       <panel
         name="panel_im_control_panel"
         layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml
index c3324a6aa40..ce788654aa3 100644
--- a/indra/newview/skins/default/xui/en/floater_media_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml
@@ -37,7 +37,6 @@
          min_height="20"
          name="nav_controls"
          top="400"
-         user_resize="false"
          width="800">
             <button
              follows="left|top"
@@ -113,7 +112,6 @@
          min_height="20"         
          name="time_controls"
          top_delta="0"
-         user_resize="false"
          width="800">
             <button
              follows="left|top"
@@ -171,7 +169,6 @@
          min_height="20"         
          name="parcel_owner_controls"
          top_delta="0"
-         user_resize="false"
          width="540">
             <button
              enabled="false"
@@ -193,7 +190,6 @@
          left_delta="0"
          name="external_controls"
          top_delta="0"
-         user_resize="false"
          width="540">
           <web_browser
              bottom="-30"
diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..dbe75f8b532
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_resize="true"
+ can_close="true"
+ bevel_style="in"
+ height="300"
+ layout="topleft"
+ min_height="40"
+ min_width="420"
+ name="Test Floater"
+ title="LAYOUTSTACK TESTS"
+ width="420">
+  <layout_stack name="test_stack"
+              left="0"
+              top="0"
+              width="100"
+              height="250"
+              follows="left|top|bottom"
+              orientation="vertical">
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                  min_height="0"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                  min_height="0"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+  </layout_stack>
+  <layout_stack name="test_stack"
+              left_pad="5"
+              top="0"
+              width="100"
+              height="250"
+              follows="left|top|bottom"
+              orientation="vertical">
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  visible="false"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                  auto_resize="false"
+                  user_resize="true"
+                  height="50"
+                  min_height="10"
+                  bg_alpha_color="green"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                min_height="10"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  visible="true"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+  <layout_stack name="test_stack"
+               left_pad="5"
+               top="0"
+               width="100"
+               height="250"
+               follows="left|top|bottom"
+               orientation="vertical">
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  height="11"
+                  bg_alpha_color="blue"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+  <layout_stack name="test_stack"
+               left_pad="5"
+               top="0"
+               width="100"
+               height="250"
+               follows="left|top|bottom"
+               orientation="vertical">
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml
index 3921cfcd2c9..06d43272935 100644
--- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml
@@ -22,6 +22,7 @@ or specifying its path in the "Editor Path" field.</string>
      layout="topleft"
      left="0"
      mouse_opaque="false"
+     default_tab_group="1"
      name="main_panel"
      right="750"
      top="0">
@@ -196,6 +197,7 @@ or specifying its path in the "Editor Path" field.</string>
          left="10"
          name="name_list"
          right="-10"
+         tab_group="1"
          search_column="1"
          top="80">
             <scroll_list.columns
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index 6807b01fa3e..cea19ec75c7 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -49,7 +49,6 @@
          width="263">
         <layout_panel
          follows="top|left|right"
-         user_resize="false"
          auto_resize="false"
          layout="topleft"
          min_height="20"
@@ -89,7 +88,7 @@
              visible="true"
              width="20" />
         </layout_panel>
-        <layout_panel name="leave_call_panel" height="26" min_height="26" user_resize="false" auto_resize="false">
+        <layout_panel name="leave_call_panel" height="26" min_height="26" auto_resize="false">
         <layout_stack
          clip="true"
          follows="left|top|right"
@@ -110,7 +109,6 @@
           </layout_panel>
           <layout_panel
            auto_resize="false"
-           user_resize="false"
            follows="top|right"
            height="23"
            visible="true"
@@ -133,7 +131,6 @@
           top_pad="0"
           height="132"
           name="callers_panel"
-          user_resize="false" 
           auto_resize="true"
           width="280">
         <avatar_list
diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml
index 57d1c92acbf..cea10adca8e 100644
--- a/indra/newview/skins/default/xui/en/floater_web_content.xml
+++ b/indra/newview/skins/default/xui/en/floater_web_content.xml
@@ -31,7 +31,6 @@
       min_height="20"
       name="nav_controls"
       top="400"
-      user_resize="false"
       width="770">
       <button
         image_overlay="Arrow_Left_Off"
@@ -160,7 +159,6 @@
       left_delta="0"
       name="external_controls"
       top_delta="0"
-      user_resize="false"
       auto_resize="true"
       width="585">
       <web_browser
@@ -173,8 +171,7 @@
     </layout_panel>
     <layout_panel name="status_bar" 
                   height="23"
-                  auto_resize="false"
-                  user_resize="false">
+                  auto_resize="false">
       <text
         type="string"
         length="200"
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index b4be17e677b..a87027a1136 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -23,7 +23,6 @@
               left="0"
               top="0"
               width="1024"
-              user_resize="false"
               auto_resize="false"
               visible="true">
       <view mouse_opaque="false"
@@ -40,7 +39,6 @@
                   name="nav_bar_container"
                   tab_stop="false"
                   width="1024"
-                  user_resize="false"
                   visible="false"/>
     <layout_panel auto_resize="true"  
                   follows="all"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
index 0f42000ae79..e91f5af3d53 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
@@ -3,6 +3,7 @@
  layout="topleft"
  left="0"
  mouse_opaque="false"
+ can_tear_off="true"
  name="menu_inventory_add"
  visible="false">
             <menu
diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
index 93cafd4a53e..d68fa6ca6c2 100644
--- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
@@ -27,8 +27,7 @@
          mouse_opaque="false"
          width="147"
          top="0"
-         name="speakers_list_panel"
-         user_resize="false">
+         name="speakers_list_panel">
             <avatar_list
              color="DkGray2"
              follows="all"
@@ -50,7 +49,6 @@
          min_height="25"
          width="130"
          name="call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
@@ -68,7 +66,6 @@
          min_height="25"
          width="130"
          name="end_call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
@@ -85,7 +82,6 @@
          min_height="25"
          width="130"
          name="voice_ctrls_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
index b5e1a5f16df..f4722b05d69 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
@@ -31,7 +31,6 @@
      width="1000">
         <layout_panel
          auto_resize="false"
-         user_resize="false" 
          min_width="2"
          width="2" />
         <layout_panel
@@ -40,8 +39,7 @@
          height="28"
          layout="topleft"
          width="310"
-         min_width="188"
-         user_resize="false">
+         min_width="188">
           <panel
             left="0"
             filename="panel_nearby_chat_bar.xml"
@@ -61,8 +59,7 @@
          width="82"
          top_delta="0"
          min_width="52"
-         name="gesture_panel"
-         user_resize="false">
+         name="gesture_panel">
             <gesture_combo_list
              follows="left|right"
              height="23"
@@ -80,7 +77,6 @@
         </layout_panel>
         <layout_panel
          auto_resize="false"
-         user_resize="false" 
          min_width="3"
          name="after_gesture_panel"
          width="3"/>
diff --git a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
index 41d1036a4d4..6d4008a4edf 100644
--- a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
@@ -28,7 +28,6 @@
          mouse_opaque="false"
          name="chiclet_list_panel"
          top="0"
-         user_resize="false"
          width="189">
       <chiclet_panel
              chiclet_padding="4"
@@ -78,7 +77,6 @@
       </chiclet_panel>
     </layout_panel>
     <layout_panel auto_resize="false"
-                      user_resize="false"
                       width="4"
                       min_width="4"/>
     <layout_panel
@@ -90,7 +88,6 @@
          min_width="37"
          name="im_well_panel"
          top="0"
-         user_resize="false"
          width="37">
       <chiclet_im_well
              follows="right"
@@ -139,7 +136,6 @@ image_pressed_selected  "Lit" + "Selected" - there are new messages and the Well
          min_width="37"
          name="notification_well_panel"
          top="0"
-         user_resize="false"
          width="37">
       <chiclet_notification
              follows="right"
diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml
index 6c8d994bc63..d4a2745d1d6 100644
--- a/indra/newview/skins/default/xui/en/panel_classified_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml
@@ -289,8 +289,7 @@
           left="0"
           top="0"
           width="290"
-          height="16"
-          user_resize="false">
+          height="16">
         <text
          follows="left|top"
          font.style="BOLD"
@@ -327,8 +326,7 @@
           left="0"
           top="0"
           width="290"
-          height="16"
-          user_resize="false">
+          height="16">
         <text
          follows="left|top"
          font.style="BOLD"
@@ -357,8 +355,7 @@
           left="0"
           top="0"
           width="290"
-          height="215"
-          user_resize="false">
+          height="215">
         <text
          auto_resize="false"
          follows="left|top"
@@ -416,7 +413,6 @@
 			  layout="bottomleft"
 			  left="0"
 			  name="layout_panel1"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
@@ -436,7 +432,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="100">
 			  <button
@@ -455,7 +450,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="edit_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml
index e512d63f9e2..3509eaa2851 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml
@@ -319,7 +319,6 @@
 			  layout="bottomleft"
 			  left="0"
 			  name="save_changes_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="156">
 			  <button
@@ -339,7 +338,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="157">
 			  <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
index 2ec2e03e8c9..0faa1598b1b 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
@@ -201,7 +201,6 @@
 			  layout="topleft"
 			  left="0"
 			  name="layout_panel1"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="150">
 		        <button
@@ -221,7 +220,6 @@
 			  layout="topleft"
 			  left_pad="4"
 			  name="layout_panel2"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="146">
 		        <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
index 442eb8c28d7..2c7c8133d13 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
@@ -435,7 +435,6 @@
 			  layout="bottomleft"
 			  name="save_changes_btn_lp"
 			  top="0"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="153">
         <button
@@ -456,7 +455,6 @@
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
 			  top="0"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="154">
         <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
index c8764a6a843..69a692e2c4c 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
@@ -454,7 +454,6 @@
              left="0"			
              mouse_opaque="false"
              name="save_as_btn_lp"
-             user_resize="false" 
              auto_resize="true"
              width="154">
                 <button
@@ -474,7 +473,6 @@
              left_pad="3"			
              mouse_opaque="false"
              name="revert_btn_lp"
-             user_resize="false" 
              auto_resize="true"
              width="152">
                 <button
diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml
index c1dc2aaaf78..ad10e53a4e3 100644
--- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml
@@ -26,8 +26,7 @@
          mouse_opaque="false"
          width="145"
          top="0"
-         name="speakers_list_panel"
-         user_resize="false">
+         name="speakers_list_panel">
             <avatar_list
              color="DkGray2"
              follows="all"
@@ -48,8 +47,7 @@
          layout="topleft"
          min_height="28"
          width="130"
-         name="group_info_btn_panel"
-         user_resize="false">
+         name="group_info_btn_panel">
             <button
              follows="left|right|bottom"
              height="23"
@@ -66,8 +64,7 @@
          layout="topleft"
          min_height="28"
          width="130"
-         name="call_btn_panel"
-         user_resize="false">
+         name="call_btn_panel">
             <button
              follows="all"
              height="23"
@@ -84,7 +81,6 @@
          min_height="28"
          width="130"
          name="end_call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
@@ -101,7 +97,6 @@
          min_height="28"
          width="130"
          name="voice_ctrls_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
index ec3f3b48bcb..206496cc0e8 100644
--- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
@@ -97,6 +97,7 @@ background_visible="true"
        follows="all"
        layout="topleft"
        auto_resize="true"
+       user_resize="true"
        height="513"
        width="313">
    <accordion
@@ -195,7 +196,6 @@ background_visible="true"
 				layout="bottomleft"
 				left="0"
 				name="btn_refresh_lp"
-			    user_resize="false" 
 			    auto_resize="false"
 				width="24">
 					<button
@@ -215,7 +215,6 @@ background_visible="true"
 				layout="bottomleft"
 				left_pad="3"
 				name="btn_chat_lp"
-			    user_resize="false" 
 			    auto_resize="true"
 				width="91">
 					<button
@@ -234,7 +233,6 @@ background_visible="true"
 				layout="bottomleft"
 				left_pad="3"
 				name="call_btn_lp"
-			    user_resize="false" 
 			    auto_resize="true"
 				width="91">
 					<button
@@ -255,7 +253,6 @@ background_visible="true"
 				layout="bottomleft"
 				left_pad="3"
 				name="btn_apply_lp"
-			    user_resize="false" 
 			    auto_resize="true"
 				width="91">
 					<button
diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
index 9f73b7c5402..8fcd6ccbaf2 100644
--- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
@@ -32,8 +32,7 @@
          min_height="20"
          width="140"
          name="view_profile_btn_panel"
-         top="0" 
-         user_resize="false">
+         top="0" >
             <button
              follows="left|top|right"
              height="23"
@@ -49,8 +48,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="add_friend_btn_panel"
-         user_resize="false">
+         name="add_friend_btn_panel">
             <button
              follows="left|top|right"
              height="23"
@@ -66,8 +64,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="teleport_btn_panel"
-         user_resize="false">
+         name="teleport_btn_panel">
         <button
              auto_resize="false"
              follows="left|top|right"
@@ -84,8 +81,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="share_btn_panel"
-         user_resize="false">
+         name="share_btn_panel">
            <button
              auto_resize="true"
              follows="left|top|right"
@@ -101,8 +97,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="pay_btn_panel"
-         user_resize="false">
+         name="pay_btn_panel">
            <button
              auto_resize="true"
              follows="left|top|right"
@@ -118,8 +113,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="call_btn_panel"
-         user_resize="false">
+         name="call_btn_panel">
             <button
              follows="left|top|right"
              height="23"
@@ -135,7 +129,6 @@
          min_height="25"
          width="140"
          name="end_call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="left|top|right"
@@ -152,7 +145,6 @@
          min_height="25"
          width="140"
          name="voice_ctrls_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="left|top|right"
@@ -169,7 +161,6 @@
        layout="topleft"
        min_height="0"
        width="140"
-       name="spacer"
-       user_resize="false" />
+       name="spacer"/>
     </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml
index 23d8cb11cac..2a5933e3e93 100644
--- a/indra/newview/skins/default/xui/en/panel_landmarks.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml
@@ -114,7 +114,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="options_gear_btn_panel"
-		       user_resize="false"
 		       width="32">
 		          <menu_button
 		           follows="bottom|left"
@@ -135,7 +134,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="add_btn_panel"
-		       user_resize="false"
 		       width="32">
 		          <button
 		           follows="bottom|left"
@@ -156,7 +154,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="dummy_panel"
-		       user_resize="false"
 		       width="212">
 		          <icon
 		           follows="bottom|left|right"
@@ -173,7 +170,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="trash_btn_panel"
-		       user_resize="false"
 		       width="31">
 		          <dnd_button
 		           follows="bottom|left"
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 6521bf2a4ea..223326dd06e 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -48,7 +48,6 @@ name="login"
 layout="topleft"
 width="705"
 min_width="705"
-user_resize="false"
 height="80">
 <text
 follows="left|bottom"
@@ -165,7 +164,6 @@ follows="right|bottom"
 name="links"
 width="205"
 min_width="205"
-user_resize="false"
 height="80">
    <text
 follows="right|bottom"
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index e6c5110999d..9f84cdc43e4 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -119,7 +119,6 @@
        height="25"
        layout="topleft"
        name="options_gear_btn_panel"
-       user_resize="false"
        width="32">
           <menu_button
            follows="bottom|left"
@@ -140,7 +139,6 @@
        height="25"
        layout="topleft"
        name="add_btn_panel"
-       user_resize="false"
        width="32">
           <button
            follows="bottom|left"
@@ -161,7 +159,6 @@
        height="25"
        layout="topleft"
        name="dummy_panel"
-       user_resize="false"
        width="212">
           <icon
            follows="bottom|left|right"
@@ -178,7 +175,6 @@
        height="25"
        layout="topleft"
        name="trash_btn_panel"
-       user_resize="false"
        width="31">
           <dnd_button
            follows="bottom|left"
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 7a8e872dc96..9dee68efa7c 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -141,7 +141,6 @@
            max_width="5"
            min_width="5"
            name="nav_bar_resize_handle_panel"
-           user_resize="false"
            width="5">
              <icon
                follows="top|right"
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
index bfc503f05b0..d1cb64f7ad3 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_media.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
@@ -196,7 +196,6 @@
 			name="stop"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="22"
@@ -224,7 +223,6 @@
 			name="play"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="22"
@@ -252,7 +250,6 @@
 			name="pause"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			min_width="22"
@@ -279,7 +276,6 @@
 			name="volume_slider_ctrl"
 			mouse_opaque="false"
 			auto_resize="true"
-			user_resize="false"
 			follows="left|right"
 			layout="topleft"
 			top="0"
@@ -304,7 +300,6 @@
 			name="mute"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="72"
@@ -333,7 +328,6 @@
 			name="zoom"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="28"
@@ -361,7 +355,6 @@
 			name="unzoom"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			min_width="21"
@@ -388,8 +381,7 @@
 		<layout_panel
 			name="right_bookend"
 			width="0"
-			mouse_opaque="false"
-			user_resize="false" />
+			mouse_opaque="false"/>
 	  </layout_stack>
 	</panel>
   </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
index e1cd78bad8a..b61f110e32f 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -198,7 +198,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                  height="154"
                  name="add_button_and_combobox"
                  width="311"
-                 user_resize="false"
                  visible="true">
 
             <!-- List containing items from the COF and Base outfit -->
@@ -271,8 +270,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                  height="30"
                  name="filter_panel"
                  width="311"
-                 visible="false"
-                 user_resize="false">
+                 visible="false">
 
                     <filter_editor
 		             background_image="TextField_Search_Off"
@@ -515,7 +513,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                      left="0"			
                      mouse_opaque="false"
                      name="save_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="156">
         <button
@@ -550,7 +547,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                      left_pad="3"			
                      mouse_opaque="false"
                      name="revert_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="147">
         <button
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
index 2ad2416179d..405d9513db3 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
@@ -84,7 +84,6 @@
                      left="0"			
                      mouse_opaque="false"
                      name="save_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="156">
                     <button
@@ -118,7 +117,6 @@
                      left_pad="3"			
                      mouse_opaque="false"
                      name="wear_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="147">
                     <button
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 0ebfd9c037a..98c7c49ff47 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -284,7 +284,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="options_gear_btn_panel"
-				       user_resize="false"
 				       width="32">
 				          <menu_button
 				           follows="bottom|left"
@@ -305,7 +304,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="add_btn_panel"
-				       user_resize="false"
 				       width="32">
 				          <button
 				           follows="bottom|left"
@@ -326,7 +324,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="dummy_panel"
-				       user_resize="false"
 				       width="210">
 				          <icon
 				           follows="bottom|left|right"
@@ -343,7 +340,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="trash_btn_panel"
-				       user_resize="false"
 				       width="31">
 				          <dnd_button
 				           follows="bottom|left"
@@ -602,7 +598,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left="0"
 			name="view_profile_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="68">
 				<button
@@ -623,7 +618,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="im_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="41">
 				<button
@@ -644,7 +638,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="call_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="52">
 				<button
@@ -665,7 +658,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="share_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="66">
 				<button
@@ -686,7 +678,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="teleport_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="77">
 				<button
@@ -720,7 +711,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			left="0"			
 			mouse_opaque="false"
 			name="group_info_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="108">
 				<button
@@ -743,7 +733,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			left_pad="3"
 			mouse_opaque="false"
 			name="chat_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="101">
 				<button
@@ -766,7 +755,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			left_pad="3"
 			mouse_opaque="false"
 			name="group_call_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="96">
 				<button
diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml
index 24046d5cca6..79d190e1e09 100644
--- a/indra/newview/skins/default/xui/en/panel_pick_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml
@@ -139,7 +139,6 @@
 			  layout="bottomleft"
 			  left="0"
 			  name="layout_panel1"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
@@ -158,7 +157,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="100">
 			  <button
@@ -177,7 +175,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="edit_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml
index 85f402dfa24..8def96cada1 100644
--- a/indra/newview/skins/default/xui/en/panel_picks.xml
+++ b/indra/newview/skins/default/xui/en/panel_picks.xml
@@ -102,7 +102,6 @@ bg_opaque_color="DkGray2"
 			  layout="bottomleft"
 			  left="0"
 			  name="gear_menu_btn"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="51">
 				<button
@@ -124,7 +123,6 @@ bg_opaque_color="DkGray2"
 			  height="18"
 			  layout="bottomleft"
 			  name="trash_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="18">
 				<button
@@ -170,7 +168,6 @@ bg_opaque_color="DkGray2"
 			  layout="topleft"
 			  left="0"
 			  name="info_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  top="0"
 			  width="95">
@@ -192,7 +189,6 @@ bg_opaque_color="DkGray2"
 			  layout="bottomleft" 
 			  left_pad="2"
 			  name="teleport_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="117">
 		        <button
@@ -212,7 +208,6 @@ bg_opaque_color="DkGray2"
 			  height="28"
 			  layout="bottomleft"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true" 
 			  left_pad="2"
 			  width="90">
diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml
index e280115bda0..308acf0c0c5 100644
--- a/indra/newview/skins/default/xui/en/panel_place_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml
@@ -238,7 +238,6 @@
                  mouse_opaque="false"
                  name="here_panel"
                  top="0"
-                 user_resize="false"
                  width="60">
                     <icon
                      follows="top|left"
@@ -259,7 +258,6 @@
                  mouse_opaque="false"
                  name="for_sale_panel"
                  top="0"
-                 user_resize="false"
                  width="60">
                     <icon
                      follows="top|left"
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index 670aa47313d..f169dbb7027 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -92,7 +92,6 @@ background_visible="true"
 			left="0"			
 			mouse_opaque="false"
 			name="lp1"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="193">
 			
@@ -115,7 +114,6 @@ background_visible="true"
 					left="0"			
 					mouse_opaque="false"
 					name="teleport_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="109">
 						<button
@@ -137,7 +135,6 @@ background_visible="true"
 					left_pad="3"
 					mouse_opaque="false"
 					name="chat_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="86">
 						<button
@@ -161,7 +158,6 @@ background_visible="true"
 			left_pad="0"			
 			mouse_opaque="false"
 			name="lp2"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="116">
 			
@@ -185,7 +181,6 @@ background_visible="true"
 					left_pad="0"
 					mouse_opaque="false"
 					name="edit_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="84">
 						<button
@@ -208,7 +203,6 @@ background_visible="true"
 					left_pad="0"
 					mouse_opaque="false"
 					name="overflow_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="24">
 						<menu_button
@@ -246,7 +240,6 @@ background_visible="true"
 					left_pad="3"			
 					mouse_opaque="false"
 					name="profile_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="102">
 						<button
@@ -283,7 +276,6 @@ background_visible="true"
 					mouse_opaque="false"
 					name="close_btn_lp"
 					top="0"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="51">
 						<button
@@ -324,7 +316,6 @@ background_visible="true"
 			mouse_opaque="false"
 			name="save_btn_lp"
 			top="0"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="153">
 				<button
@@ -347,7 +338,6 @@ background_visible="true"
 			mouse_opaque="false"
 			name="cancel_btn_lp"
 			top="0"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="154">
 				<button
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index 2e0bb88f530..e9427a23882 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -50,7 +50,6 @@
          layout="topleft"
          left="0"
          name="postcard_image_size_lp"
-         user_resize="false" 
          auto_resize="false"
          top="0"
          right="-1"
@@ -99,7 +98,6 @@
          layout="topleft"
          left="0"
          name="postcard_image_format_quality_lp"
-         user_resize="false" 
          auto_resize="true"
          top="0"
          right="-1"
diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
index 273c2524742..198ccd6e2f7 100644
--- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
@@ -31,8 +31,7 @@
 		width="0"
 		name="left_bookend_bottom"
 		mouse_opaque="false"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
 	<layout_panel
 		name="media_progress_indicator"
 		mouse_opaque="false"
@@ -41,7 +40,6 @@
 		left="0"
 		top="0"
 		auto_resize="false"
-		user_resize="false"
 		min_width="100"
 		width="200">
 	  <progress_bar
@@ -59,8 +57,7 @@
 		name="right_bookend_bottom"
 		width="0"
 		mouse_opaque="false"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
   </layout_stack>
   <layout_stack
 	  name="media_controls"
@@ -79,13 +76,11 @@
 		top="0"
 		width="0"
 		mouse_opaque="false"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
 	<layout_panel
 		name="back"
 		top="0"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		mouse_opaque="false"
 		min_width="22"
@@ -114,7 +109,6 @@
 		name="fwd"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		min_width="22"
 		top="0"
@@ -142,7 +136,6 @@
 		name="home"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -170,7 +163,6 @@
 		name="media_stop"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -198,7 +190,6 @@
 		name="reload"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -226,7 +217,6 @@
 		name="stop"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -254,7 +244,6 @@
 		name="play"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -282,7 +271,6 @@
 		name="pause"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -310,7 +298,6 @@
 		name="media_address"
 		mouse_opaque="false"
 		auto_resize="true"
-		user_resize="false"
 		height="24"
 		follows="left|right|bottom"
 		layout="topleft"
@@ -343,8 +330,7 @@
 			layout="topleft"
 			width="16"
 			mouse_opaque="false"
-			auto_resize="false"
-			user_resize="false">
+			auto_resize="false">
 		  <icon
 			  name="media_whitelist_flag"
 			  follows="top|right"
@@ -358,8 +344,7 @@
 			layout="topleft"
 			width="16"
 			mouse_opaque="false"
-			auto_resize="false"
-			user_resize="false">
+			auto_resize="false">
 		  <icon
 			  name="media_secure_lock_flag"
 			  height="16"
@@ -374,7 +359,6 @@
 		name="media_play_position"
 		mouse_opaque="false"
 		auto_resize="true"
-		user_resize="false"
 		follows="left|right"
 		layout="topleft"
 		top="0"
@@ -399,7 +383,6 @@
 		name="skip_back"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -428,7 +411,6 @@
 		name="skip_forward"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -455,7 +437,6 @@
 		name="media_volume"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="72"
@@ -511,7 +492,6 @@
 		name="zoom_frame"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="28"
@@ -539,7 +519,6 @@
 		name="close"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="21"
@@ -567,7 +546,6 @@
 		name="new_window"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -596,8 +574,7 @@
 		mouse_opaque="false"
 		top="0"
 		width="0"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
   </layout_stack>
   <panel
 	  name="media_region"
diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml
index 4535c563398..7275e8d89ba 100644
--- a/indra/newview/skins/default/xui/en/panel_progress.xml
+++ b/indra/newview/skins/default/xui/en/panel_progress.xml
@@ -20,14 +20,12 @@
          layout="topleft"
          min_width="10"
          name="panel1"
-         user_resize="false"
          width="150" />
         <layout_panel
          height="768"
          layout="topleft"
          min_width="640"
          name="panel2"
-         user_resize="false"
          width="640">
             <layout_stack
              follows="left|right|top|bottom"
@@ -121,7 +119,6 @@
          layout="topleft"
          min_width="10"
          name="panel6"
-         user_resize="false"
          width="150" />
     </layout_stack>
     <button
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index ae0215a5786..b966358f18d 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -96,7 +96,6 @@
          layout="topleft"
          left="0"
          name="local_image_size_lp"
-         user_resize="false" 
          auto_resize="false"
          top="0"
          right="-1"
@@ -145,7 +144,6 @@
          layout="topleft"
          left="0"
          name="local_image_format_quality_lp"
-         user_resize="false" 
          auto_resize="true"
          top="0"
          right="-1"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 91ac9ad6584..5bd383b81e8 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -84,7 +84,6 @@
          layout="topleft"
          left="0"
          name="profile_image_size_lp"
-         user_resize="false" 
          auto_resize="false"
          top="0"
          right="-1"
@@ -132,7 +131,6 @@
          layout="topleft"
          left="0"
          name="profile_image_metadata_lp"
-         user_resize="false" 
          auto_resize="true"
          top="0"
          right="-1"
diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
index 3c69a0cb6cc..58911bed562 100644
--- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
+++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
@@ -20,7 +20,6 @@
                 mouse_opaque="false">
   <layout_panel name="vertical_toolbar_panel"
                 auto_resize="true"
-                user_resize="false"
                 width="1024"
                 height="500"
                 mouse_opaque="false">
@@ -34,7 +33,6 @@
                   mouse_opaque="false">
       <layout_panel name="left_toolbar_panel"
                     auto_resize="false"
-                    user_resize="false"
                     height="500"
                     width="30"
                     mouse_opaque="false">
@@ -61,7 +59,6 @@
       </layout_panel>
       <layout_panel name="non_toolbar_panel"
                     auto_resize="true"
-                    user_resize="false"
                     mouse_opaque="false"
                     height="100"
                     width="200">
@@ -102,7 +99,6 @@
       </layout_panel>
       <layout_panel name="right_toolbar_panel"
                     auto_resize="false"
-                    user_resize="false"
                     height="500"
                     width="30"
                     mouse_opaque="false">
@@ -132,7 +128,6 @@
   </layout_panel>
   <layout_panel name="bottom_toolbar_panel"
                 auto_resize="false"
-                user_resize="false"
                 height="30"
                 width="1024"
                 mouse_opaque="false">
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index b52784d6bc4..d4162f6d9a8 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -34,7 +34,6 @@
                  min_dim="150"
                  width="330"
                  follows="bottom|left|right"
-                 user_resize="false"
                  height="300">
                  <panel
                       class="panel_main_inventory"
@@ -52,12 +51,10 @@
                  width="330"
 								 layout="topleft"
                  auto_resize="true"
-                 user_resize="false"
                  follows="bottom|left|right"
                  name="inbox_outbox_layout_panel"
                  visible="false"
                  min_dim="35"
-                 max_dim="235"
                  expanded_min_dim="125"
                  height="235">
 							 <layout_stack
@@ -75,13 +72,11 @@
                  width="330"
 								 layout="topleft"
                  auto_resize="true"
-                 user_resize="false"
                  follows="left|right|top"
                  name="inbox_layout_panel"
                  visible="false"
                  min_dim="35"
-                 max_dim="200"
-                 expanded_min_dim="90"
+
                  height="200">
                  <panel
                       follows="all"
@@ -157,12 +152,10 @@
                  width="330"
                  layout="topleft"
                  auto_resize="true"
-                 user_resize="false"
                  follows="all"
                  name="outbox_layout_panel"
                  visible="false"
                  min_dim="35"
-                 max_dim="200"
                  expanded_min_dim="90"
                  height="200">
                  <panel
@@ -312,7 +305,6 @@
                      left="0"			
                      mouse_opaque="false"
                      name="info_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="101">
                     <button
@@ -334,7 +326,6 @@
                      left_pad="1"			
                      mouse_opaque="false"
                      name="share_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="100">
                     <button
@@ -356,7 +347,6 @@
                      left_pad="1"			
                      mouse_opaque="false"
                      name="shop_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="100">
                     <button
-- 
GitLab


From da40427a0be28de943988a4961c728384a453119 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 16 Jan 2012 14:27:35 -0500
Subject: [PATCH 563/933] STORM-1795 Ad-hoc messages are received even when
 "Only friends and groups can call or IM me"

---
 doc/contributions.txt      | 1 +
 indra/newview/llimview.cpp | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 84f399cc893..9e662c72e26 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -607,6 +607,7 @@ Jonathan Yap
 	STORM-1737
 	STORM-1733
 	STORM-1790
+	STORM-1795
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index a856bd0bdc6..fa7930503b8 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2458,7 +2458,10 @@ void LLIMMgr::addMessage(
 		make_ui_sound("UISndNewIncomingIMSession");
 	}
 
-	if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat))
+	bool show_message = gSavedSettings.getBOOL("VoiceCallsFriendsOnly") &&
+		LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL ? false : true;
+
+	if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && show_message)
 	{
 		LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
 	}
-- 
GitLab


From 7092a07045e0bc17c503c0bc81e3f038bd1516e8 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 16 Jan 2012 14:35:00 -0800
Subject: [PATCH 564/933] Fix Mac build issue

---
 indra/llui/lllayoutstack.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index b67030dc34e..a1e8eebb47a 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -116,9 +116,9 @@ F32 LLLayoutPanel::getVisibleAmount() const
 
 S32 LLLayoutPanel::getLayoutDim() const
 {
-	return llround((mOrientation == LLLayoutStack::HORIZONTAL)
+	return llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
 					? getRect().getWidth()
-					: getRect().getHeight());
+					: getRect().getHeight()));
 }
  
 S32 LLLayoutPanel::getVisibleDim() const
@@ -132,9 +132,9 @@ S32 LLLayoutPanel::getVisibleDim() const
 void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientation )
 {
 	mOrientation = orientation;
-	S32 layout_dim = llround((mOrientation == LLLayoutStack::HORIZONTAL)
+	S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
 		? getRect().getWidth()
-		: getRect().getHeight());
+		: getRect().getHeight()));
 
 	if (mMinDim == -1)
 	{
-- 
GitLab


From 83138403ec6bb839d38b1d72c286df1121d08be9 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Tue, 17 Jan 2012 13:40:35 +0200
Subject: [PATCH 565/933] EXP-1768 FIXED (incomplete sentence for translation)

The whole sentence was split to two parts:
 First pars was in panel.string and the second one in the text box. I combined them both in "allow_label5" text box and also I deleted unnecessary panel.string with the first part of the sentence.
---
 indra/newview/llfloaterland.cpp                  |  1 -
 .../skins/default/xui/de/floater_about_land.xml  |  5 +----
 .../skins/default/xui/en/floater_about_land.xml  | 16 ++++++----------
 .../skins/default/xui/es/floater_about_land.xml  |  5 +----
 .../skins/default/xui/fr/floater_about_land.xml  |  5 +----
 .../skins/default/xui/it/floater_about_land.xml  |  5 +----
 .../skins/default/xui/ja/floater_about_land.xml  |  5 +----
 .../skins/default/xui/pt/floater_about_land.xml  |  5 +----
 .../skins/default/xui/ru/floater_about_land.xml  |  5 +----
 .../skins/default/xui/tr/floater_about_land.xml  |  5 +----
 10 files changed, 14 insertions(+), 43 deletions(-)

diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index b13a9aab888..d8e4aa03f76 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2025,7 +2025,6 @@ void LLPanelLandOptions::refresh()
 		}
 
 		mSeeAvatarsCtrl->set(parcel->getSeeAVs());
-		mSeeAvatarsCtrl->setLabel(getString("see_avs_text"));
 		mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData());
 
 		BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, 
diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml
index 3cf3a162470..f377c74a3f9 100644
--- a/indra/newview/skins/default/xui/de/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/de/floater_about_land.xml
@@ -309,9 +309,6 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 			<panel.string name="push_restrict_region_text">
 				Kein Stoßen (regional)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Auf dieser Parzelle Einwohner sehen und mit ihnen chatten
-			</panel.string>
 			<text name="allow_label">
 				Anderen Einwohnern gestatten:
 			</text>
@@ -375,7 +372,7 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Klicken Sie hier, um ein Bild auszuwählen"/>
 			<text name="allow_label5">
-				Einwohnern auf anderen Parzellen Folgendes gestatten:
+				Einwohnern auf anderen Parzellen Folgendes gestatten: Auf dieser Parzelle Einwohner sehen und mit ihnen chatten
 			</text>
 			<check_box label="Avatare sehen" name="SeeAvatarsCheck" tool_tip="Gestattet sowohl Einwohnern auf anderen Parzellen, Einwohner auf dieser Parzelle zu sehen und mit ihnen zu chatten, als auch Ihnen, diese Einwohner auf anderen Parzellen zu sehen und mit ihnen zu chatten."/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 4772f744ead..d198cd65a87 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1206,10 +1206,6 @@ Only large parcels can be listed in search.
              name="push_restrict_region_text">
                 No Pushing (Region Override)
             </panel.string>
-            <panel.string
-             name="see_avs_text">
-                    Avatars on other parcels can see
-            </panel.string>
             <text
              type="string"
              length="1"
@@ -1524,24 +1520,24 @@ Only large parcels can be listed in search.
              length="1"
              follows="left|top"
              text_color="LtGray"
-             height="16"
+             height="32"
              layout="topleft"
              left="274"
-             top="166"
+             top="150"
              name="allow_label5"
-             width="278">
-              and chat with avatars on this parcel
+             width="205"
+             wrap="true">
+              Avatars on other parcels can see and chat with avatars on this parcel
             </text>
             <check_box
              height="16"
-             label="See Avatars"
              follows="top"
              layout="topleft"
              left="253"
              top="150"
              name="SeeAvatarsCheck"
              tool_tip="Allows avatars on other parcels to see and chat with avatars on this parcel, and you to see and chat with them."
-             width="120" />
+             width="10" />
             <text
              type="string"
              length="1"
diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml
index b6391e28a01..e34b57fca3a 100644
--- a/indra/newview/skins/default/xui/es/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/es/floater_about_land.xml
@@ -308,9 +308,6 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
 			<panel.string name="push_restrict_region_text">
 				Sin &apos;empujones&apos; (prevalece lo marcado en la región)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Ver a los residentes de esta parcela y chatear con ellos
-			</panel.string>
 			<text name="allow_label">
 				Permitir a otros Residentes:
 			</text>
@@ -374,7 +371,7 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Pulse para elegir una imagen"/>
 			<text name="allow_label5">
-				Permitir a los residentes de otras parcelas:
+				Permitir a los residentes de otras parcelas: Ver a los residentes de esta parcela y chatear con ellos
 			</text>
 			<check_box label="Ver los avatares" name="SeeAvatarsCheck" tool_tip="Permite que los residentes de otras parcelas vean a los residentes de ésta y chateen con ellos, y también que tú puedas verles y chatear con ellos."/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/fr/floater_about_land.xml b/indra/newview/skins/default/xui/fr/floater_about_land.xml
index 9771c3f7fd2..900a856e7b3 100644
--- a/indra/newview/skins/default/xui/fr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/fr/floater_about_land.xml
@@ -312,9 +312,6 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche.
 			<panel.string name="push_restrict_region_text">
 				Pas de bousculades (les règles de la région priment)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Voir et chatter avec les résidents sur cette parcelle
-			</panel.string>
 			<text name="allow_label">
 				Autoriser les autres résidents à :
 			</text>
@@ -378,7 +375,7 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Cliquez pour sélectionner une image"/>
 			<text name="allow_label5">
-				Autoriser les résidents sur les autres parcelles à :
+				Autoriser les résidents sur les autres parcelles à : Voir et chatter avec les résidents sur cette parcelle
 			</text>
 			<check_box label="Voir les avatars" name="SeeAvatarsCheck" tool_tip="Permettre aux résidents présents sur d&apos;autres parcelles de voir et chatter avec les résidents présents sur cette parcelle et vous permettre de les voir et de chatter avec eux."/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml
index b6bfb4aadf1..2e30de42145 100644
--- a/indra/newview/skins/default/xui/it/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/it/floater_about_land.xml
@@ -313,9 +313,6 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
 			<panel.string name="push_restrict_region_text">
 				Nessuna spinta (Impostazione regionale)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Vedi i residenti in questo lotto e chatta con loro
-			</panel.string>
 			<text name="allow_label">
 				Permetti ad altri residenti di:
 			</text>
@@ -379,7 +376,7 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Clicca per scegliere una immagine"/>
 			<text name="allow_label5">
-				Permetti ai residenti in altri lotti di:
+				Permetti ai residenti in altri lotti di: Vedi i residenti in questo lotto e chatta con loro
 			</text>
 			<check_box label="Vedi avatar" name="SeeAvatarsCheck" tool_tip="Consente ai residenti in altri lotti di vedere i residenti in questo lotto e chattare con loro, e ti consente di vederli e chattare con loro."/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml
index 3c88c902f88..61d418b2d85 100644
--- a/indra/newview/skins/default/xui/ja/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml
@@ -310,9 +310,6 @@
 			<panel.string name="push_restrict_region_text">
 				プッシュ禁止 (地域設定優先)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				この区画にいる住人と会ってチャットする
-			</panel.string>
 			<text name="allow_label">
 				他の住人への許可:
 			</text>
@@ -376,7 +373,7 @@
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="写真をクリックして選択"/>
 			<text name="allow_label5">
-				他の区画にいる住人への許可:
+				他の区画にいる住人への許可: この区画にいる住人と会ってチャットする
 			</text>
 			<check_box label="アバターを表示" name="SeeAvatarsCheck" tool_tip="他の区画の住人が、この区画にいる住人に会ってチャットすることを許可し、あなたもそれら住人に会ってチャットできるようにします。"/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/pt/floater_about_land.xml b/indra/newview/skins/default/xui/pt/floater_about_land.xml
index cc098889942..39d44a99495 100644
--- a/indra/newview/skins/default/xui/pt/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about_land.xml
@@ -308,9 +308,6 @@ Apenas lotes maiores podem ser listados na busca.
 			<panel.string name="push_restrict_region_text">
 				Proibido empurrar (regulamento da região)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Veja e bata papo com os residentes deste terreno
-			</panel.string>
 			<text name="allow_label">
 				Autorizar outros residentes a:
 			</text>
@@ -374,7 +371,7 @@ Apenas lotes maiores podem ser listados na busca.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Clique para escolher uma imagem"/>
 			<text name="allow_label5">
-				Permitir que residentes de outros terrenos:
+				Permitir que residentes de outros terrenos: Veja e bata papo com os residentes deste terreno
 			</text>
 			<check_box label="Ver avatares" name="SeeAvatarsCheck" tool_tip="Permite que residentes de outros terrenos vejam e conversem com os residentes deste terreno e vice-versa."/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/ru/floater_about_land.xml b/indra/newview/skins/default/xui/ru/floater_about_land.xml
index 3c278fce52c..2f5c64984d7 100644
--- a/indra/newview/skins/default/xui/ru/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ru/floater_about_land.xml
@@ -306,9 +306,6 @@
 			<panel.string name="push_restrict_region_text">
 				Не толкать (настройки региона)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Видеть жителей этого участка и общаться с ними в чате
-			</panel.string>
 			<text name="allow_label">
 				Позволить другим жителям:
 			</text>
@@ -372,7 +369,7 @@
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Щелкните для выбора изображения"/>
 			<text name="allow_label5">
-				Позволить жителям с других участков:
+				Позволить жителям с других участков: Видеть жителей этого участка и общаться с ними в чате
 			</text>
 			<check_box label="Видны аватары" name="SeeAvatarsCheck" tool_tip="Жители с других участков могут видеть жителей этого участка и общаться с ними в чате (вы также сможете видеть жителей с других участков и общаться с ними)."/>
 			<text name="landing_point">
diff --git a/indra/newview/skins/default/xui/tr/floater_about_land.xml b/indra/newview/skins/default/xui/tr/floater_about_land.xml
index e0350964b59..69abe582e6f 100644
--- a/indra/newview/skins/default/xui/tr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about_land.xml
@@ -306,9 +306,6 @@ Sadece büyük parseller aramada görünür.
 			<panel.string name="push_restrict_region_text">
 				İtme Yok (Bölge Geçersiz Kılma)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Parseldeki sakinleri gör ve onlarla sohbet et
-			</panel.string>
 			<text name="allow_label">
 				Sakinlere şunun için izin ver:
 			</text>
@@ -372,7 +369,7 @@ Sadece büyük parseller aramada görünür.
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Bir resim seçmek için tıklayın"/>
 			<text name="allow_label5">
-				Diğer parsel Sakinlerine şunun için izin verin:
+				Diğer parsel Sakinlerine şunun için izin verin: Parseldeki sakinleri gör ve onlarla sohbet et
 			</text>
 			<check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki sakinlerin bu parseldeki sakinleri görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/>
 			<text name="landing_point">
-- 
GitLab


From 6157386b4c96740e406a49eb9e8f42c6d7f252ff Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 17 Jan 2012 10:38:59 -0500
Subject: [PATCH 566/933] Added tag 3.2.7-start for changeset 4891c46a56fe

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f4ffb61aa60..75dc28b2624 100644
--- a/.hgtags
+++ b/.hgtags
@@ -245,3 +245,4 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
 2174ed1c7129562428a5cfe8651ed77b8d26ae18 3.2.6-start
+4891c46a56fed7512c783b9cbe7cb7260727bf0c 3.2.7-start
-- 
GitLab


From 0e7956a4cbdb0772ff6175307475ee6fc8b620ea Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 17 Jan 2012 07:39:14 -0800
Subject: [PATCH 567/933] EXP-1758 : Fix crash on login on Mac (bad pointer
 reference). Might need more work if the intent was to always get that
 pointer.

---
 indra/llui/lllayoutstack.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index a1e8eebb47a..ac10afe594e 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -156,7 +156,10 @@ void LLLayoutPanel::setVisible( BOOL visible )
 	if (visible != getVisible())
 	{
 		LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent());
-		stackp->mNeedsLayout = true;
+		if (stackp)
+		{
+			stackp->mNeedsLayout = true;
+		}
 	}
 	LLPanel::setVisible(visible);
 }
-- 
GitLab


From 64c45cbd1ace677456db56d1a506f2fe44b6e9c6 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 17 Jan 2012 10:39:14 -0500
Subject: [PATCH 568/933] increment viewer version to 3.2.8

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 7bba3d298f9..99ab053b251 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 7;
+const S32 LL_VERSION_PATCH = 8;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From 1f9529c0c2b02c4ceee912f8ecb35181174cc7cc Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 17 Jan 2012 08:55:19 -0800
Subject: [PATCH 569/933] EXP-1772 : Suppress a useless and confusing assert in
 destructor, called cleanup in there instead.

---
 indra/newview/llwearablelist.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp
index ddbcdfc3f7a..6f6411ce3cc 100644
--- a/indra/newview/llwearablelist.cpp
+++ b/indra/newview/llwearablelist.cpp
@@ -63,7 +63,7 @@ struct LLWearableArrivedData
 
 LLWearableList::~LLWearableList()
 {
-	llassert_always(mList.empty()) ;
+	cleanup();
 }
 
 void LLWearableList::cleanup() 
-- 
GitLab


From 577479a3e53ef152da191e3a004aeb34f0815658 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 17 Jan 2012 09:36:14 -0800
Subject: [PATCH 570/933] EXP-1803 CLEAN-UP -- Modified code to use the
 "unique" tag on the notification.

---
 indra/newview/llinventorybridge.cpp                 | 10 +++++-----
 indra/newview/llinventoryfunctions.cpp              | 13 +------------
 .../newview/skins/default/xui/en/notifications.xml  |  1 +
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 270ef4fddc9..1a4fd17d611 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2244,7 +2244,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	{
 		if (move_is_into_outbox)
 		{
-			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
 			accept = FALSE;
 		}
 		else
@@ -2256,7 +2256,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	{
 		if (move_is_into_outbox)
 		{
-			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
 			accept = FALSE;
 		}
 		else
@@ -3765,7 +3765,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		}
 		else if (move_is_into_outbox)
 		{
-			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
 			accept = FALSE;
 		}
 		
@@ -3796,7 +3796,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 	{
 		if (move_is_into_outbox)
 		{
-			tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+			tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
 			accept = FALSE;
 		}
 		else
@@ -3823,7 +3823,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 
 			if (move_is_into_outbox)
 			{
-				tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
+				tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory");
 				accept = FALSE;
 			}
 			else if (move_is_into_current_outfit || move_is_into_outfit)
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index f5be271a68d..40bc3b76c93 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -533,7 +533,6 @@ void show_item_original(const LLUUID& item_uuid)
 }
 
 
-static S32 create_folder_in_outbox_operation_id = -1;
 static S32 move_to_outbox_operation_id = -1;
 static std::list<LLSD> move_to_outbox_payloads;
 
@@ -542,11 +541,6 @@ void open_outbox()
 	LLFloaterReg::showInstance("outbox");
 }
 
-void folder_created_in_outbox_cb(const LLSD& notification, const LLSD& response)
-{
-	create_folder_in_outbox_operation_id = -1;
-}
-
 LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& destFolderId, S32 operation_id)
 {
 	llassert(item);
@@ -555,12 +549,7 @@ LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& des
 	LLUUID created_folder_id = gInventory.createNewCategory(destFolderId, LLFolderType::FT_NONE, item->getName());
 	gInventory.notifyObservers();
 
-	if (create_folder_in_outbox_operation_id != operation_id)
-	{
-		LLNotificationsUtil::add("OutboxFolderCreated", LLSD(), LLSD(), boost::bind(&folder_created_in_outbox_cb, _1, _2));
-
-		create_folder_in_outbox_operation_id = operation_id;
-	}
+	LLNotificationsUtil::add("OutboxFolderCreated");
 
 	return created_folder_id;
 }
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e44fb3bf28d..af75d493532 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -214,6 +214,7 @@ You don't have permission to copy one or more of these items to the Merchant Out
    icon="OutboxStatus_Success"
    name="OutboxFolderCreated"
    type="outbox">
+    <unique/>
 A new folder has been created for each item you have transferred into the top level of your Merchant Outbox.
 
     <usetemplate
-- 
GitLab


From 74737fa31988b30d0ebdcb6cc28cf660b7ccf607 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Tue, 17 Jan 2012 13:26:35 -0500
Subject: [PATCH 571/933] Added tag DRTVWR-109_3.2.6-beta1, 3.2.6-beta1 for
 changeset 286d73ff5c19

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index f4ffb61aa60..d51435daa56 100644
--- a/.hgtags
+++ b/.hgtags
@@ -245,3 +245,5 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
 2174ed1c7129562428a5cfe8651ed77b8d26ae18 3.2.6-start
+286d73ff5c19f6c00e023dc1b60975ed6bbe2872 DRTVWR-109_3.2.6-beta1
+286d73ff5c19f6c00e023dc1b60975ed6bbe2872 3.2.6-beta1
-- 
GitLab


From 2abb1a81c56a27eab02157851cb9e67730231bb6 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Tue, 17 Jan 2012 13:31:00 -0500
Subject: [PATCH 572/933] Added tag DRTVWR-105_3.2.5-release, 3.2.5-release for
 changeset c6175c955a19

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 3def677a7fd..5c2b0843dd0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -240,3 +240,5 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 3d2d5d244c6398a4214c666d5dd3965b0918709a 3.2.5-beta1
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d DRTVWR-107_3.2.5-beta2
 65a2c1c8d855b88edfbea4e16ef2f27e7cff8b1d 3.2.5-beta2
+c6175c955a19e9b9353d242889ec1779b5762522 DRTVWR-105_3.2.5-release
+c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
-- 
GitLab


From 3a313469c9be4e71384314ebecb2de7434752c02 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 17 Jan 2012 11:44:40 -0800
Subject: [PATCH 573/933] EXP-1799 FIX -- Replace and Add to Outfit options
 appear as grayed out in Inventory

* Updated context menu code to enable visible items that aren't explicitly disabled.
---
 indra/newview/llinventorybridge.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1a4fd17d611..c97d756a310 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -529,14 +529,17 @@ void hide_context_entries(LLMenuGL& menu,
 			// so that some other UI element from multi-select doesn't later set this invisible.
 			menu_item->pushVisible(TRUE);
 
+			BOOL enabled = TRUE;
 			for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2)
 			{
 				if (*itor2 == name)
 				{
-					menu_item->setEnabled(FALSE);
+					enabled = FALSE;
 					break;
 				}
 			}
+
+			menu_item->setEnabled(enabled);
 		}
 	}
 }
-- 
GitLab


From 2589a7e135a9e894eb7bbe0cb1e032c105f72bf8 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 17 Jan 2012 12:17:03 -0800
Subject: [PATCH 574/933] fix for crash in assert when programmatically
 toggling user resize

---
 indra/llui/lllayoutstack.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index ac10afe594e..000f729e29d 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -314,6 +314,8 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au
 	{
 		panel->mAutoResize = auto_resize;
 	}
+
+	mNeedsLayout = true;
 }
 
 void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_resize)
@@ -324,6 +326,8 @@ void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_
 	{
 		panel->mUserResize = user_resize;
 	}
+
+	mNeedsLayout = true;
 }
 
 
-- 
GitLab


From accf83394513c82e98fffa15bc0131ee25f63f00 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 17 Jan 2012 13:07:57 -0800
Subject: [PATCH 575/933] EXP-1805 FIX -- Block calling cards from being added
 to Merchant Outbox EXP-1810 PROGRESS -- Cannot resize Received items panel in
 Inventory window

* Updated "copy to merchant outbox" context menu and drag and drop code to block calling cards.
* Changed user_resize to true on the "Received Items" panel and the main inventory panel
---
 indra/newview/llinventorybridge.cpp           | 20 ++++++++++++++++---
 .../default/xui/en/sidepanel_inventory.xml    |  5 ++++-
 .../newview/skins/default/xui/en/strings.xml  |  1 +
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 2d5e4938c66..3929183be20 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1153,9 +1153,17 @@ bool LLInvFVBridge::canListOnMarketplace() const
 	}
 
 	LLViewerInventoryItem * item = model->getItem(mUUID);
-	if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
+	if (item)
 	{
-		return false;
+		if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
+		{
+			return false;
+		}
+		
+		if (LLAssetType::AT_CALLINGCARD == item->getType())
+		{
+			return false;
+		}
 	}
 
 	return true;
@@ -1897,7 +1905,6 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m
 	}
 	
 	bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
-
 	if (!allow_transfer)
 	{
 		tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer");
@@ -1913,6 +1920,13 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m
 	}
 #endif
 	
+	bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType());
+	if (calling_card)
+	{
+		tooltip_msg = LLTrans::getString("TooltipOutboxCallingCard");
+		return false;
+	}
+	
 	return true;
 }
 
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 5d398a29af2..fcba937bdbb 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -30,6 +30,8 @@
              <layout_panel
                  name="main_inventory_layout_panel"
                  layout="topleft"
+                 auto_resize="true"
+                 user_resize="true"
                  min_dim="150"
                  width="330"
                  follows="bottom|left|right"
@@ -48,8 +50,9 @@
              </layout_panel>
 			 <layout_panel
                  width="330"
-		 layout="topleft"
+                 layout="topleft"
                  auto_resize="true"
+                 user_resize="true"
                  follows="left|right|top"
                  name="inbox_layout_panel"
                  visible="false"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 84fce6630bf..3b00969fd4c 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -169,6 +169,7 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred.</string>
 	<string name="TooltipOutboxNotInInventory">Your merchant outbox can only accept items directly from your inventory</string>
 	<string name="TooltipOutboxWorn">You can not put items you are wearing into your merchant outbox</string>
+	<string name="TooltipOutboxCallingCard">You can not put calling cards into your merchant outbox</string>
 	<string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds 3</string>
 	<string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds 20</string>
 	<string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds 200</string>
-- 
GitLab


From f9a17df4d3ec9e0301b287e0a0df6ac1f8ede1ca Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 17 Jan 2012 23:17:52 +0200
Subject: [PATCH 576/933] EXP-1806 FIXED CTRL-W no longer closes floaters.

Restoring accidentally removed code.
---
 indra/llui/llfloater.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 33548151fd8..cedc4c0aee9 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1681,6 +1681,8 @@ LLFloater* LLFloater::getClosableFloaterFromFocus()
 	{
 		if (it->hasFocus())
 		{
+			LLFloater& floater = *it;
+			focused_floater = &floater;
 			break;
 		}
 	}
-- 
GitLab


From 3b81e882897e1b161e4becaafaf3fc93d482ce65 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 17 Jan 2012 23:20:44 +0200
Subject: [PATCH 577/933] EXP-1807 FIXED Linux viewer didn't start due to
 "libSDL-1.2.so.0: cannot open shared object file".

Package the missing symlink.
---
 indra/newview/viewer_manifest.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 0931c4ec9b8..089b17149d3 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1047,6 +1047,7 @@ def construct(self):
             self.path("libuuid.so.16")
             self.path("libuuid.so.16.0.22")
             self.path("libSDL-1.2.so.0.11.3")
+            self.path("libSDL-1.2.so.0")
             self.path("libdirectfb-1.4.so.5.0.4")
             self.path("libfusion-1.4.so.5.0.4")
             self.path("libdirect-1.4.so.5.0.4")
-- 
GitLab


From e4b63c96b83a1ed8c18946ecd64c21d6bd7c26fe Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 17 Jan 2012 14:59:18 -0800
Subject: [PATCH 578/933] EXP-1804 FIX -- Drag and drop operations can be
 blocked by modal dialogs

* Added support for marketplace notifications that don't display the dialog
  until the next frame, leaving room for the drag and drop operation to
  properly complete before the notification shows up and interferes.
---
 indra/newview/CMakeLists.txt                 |  2 +
 indra/newview/llappviewer.cpp                |  4 +-
 indra/newview/llinventoryfunctions.cpp       | 39 +--------
 indra/newview/llmarketplacenotifications.cpp | 89 ++++++++++++++++++++
 indra/newview/llmarketplacenotifications.h   | 57 +++++++++++++
 5 files changed, 155 insertions(+), 36 deletions(-)
 create mode 100644 indra/newview/llmarketplacenotifications.cpp
 create mode 100644 indra/newview/llmarketplacenotifications.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 78cd33210fb..f85b943c70d 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -316,6 +316,7 @@ set(viewer_SOURCE_FILES
     llmanipscale.cpp
     llmaniptranslate.cpp
     llmarketplacefunctions.cpp
+    llmarketplacenotifications.cpp
     llmediactrl.cpp
     llmediadataclient.cpp
     llmemoryview.cpp
@@ -871,6 +872,7 @@ set(viewer_HEADER_FILES
     llmanipscale.h
     llmaniptranslate.h
     llmarketplacefunctions.h
+    llmarketplacenotifications.h
     llmediactrl.h
     llmediadataclient.h
     llmemoryview.h
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 5c51f1b11ae..a455d359bfc 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -46,6 +46,7 @@
 #include "llviewerstats.h"
 #include "llviewerstatsrecorder.h"
 #include "llmarketplacefunctions.h"
+#include "llmarketplacenotifications.h"
 #include "llmd5.h"
 #include "llmeshrepository.h"
 #include "llpumpio.h"
@@ -4406,8 +4407,9 @@ void LLAppViewer::idle()
 	// update media focus
 	LLViewerMediaFocus::getInstance()->update();
 	
-	// Update marketplace importer
+	// Update marketplace
 	LLMarketplaceInventoryImporter::update();
+	LLMarketplaceInventoryNotifications::update();
 
 	// objects and camera should be in sync, do LOD calculations now
 	{
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 40bc3b76c93..dd92188e9d2 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -58,6 +58,7 @@
 #include "llinventorymodel.h"
 #include "llinventorypanel.h"
 #include "lllineeditor.h"
+#include "llmarketplacenotifications.h"
 #include "llmenugl.h"
 #include "llnotificationsutil.h"
 #include "llpanelmaininventory.h"
@@ -533,9 +534,6 @@ void show_item_original(const LLUUID& item_uuid)
 }
 
 
-static S32 move_to_outbox_operation_id = -1;
-static std::list<LLSD> move_to_outbox_payloads;
-
 void open_outbox()
 {
 	LLFloaterReg::showInstance("outbox");
@@ -614,24 +612,6 @@ void move_to_outbox_cb_action(const LLSD& payload)
 	}
 }
 
-void move_to_outbox_cb(const LLSD& notification, const LLSD& response)
-{
-	const S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-
-	if (option == 0)
-	{
-		llassert(move_to_outbox_payloads.size() > 0);
-
-		BOOST_FOREACH(const LLSD& payload, move_to_outbox_payloads)
-		{
-			move_to_outbox_cb_action(payload);
-		}
-	}
-
-	move_to_outbox_operation_id = -1;
-	move_to_outbox_payloads.clear();
-}
-
 void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id)
 {
 	// Collapse links directly to items/folders
@@ -668,25 +648,14 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL
 			open_outbox();
 		}
 		else
-		{	
-			LLSD args;
-			args["ITEM_NAME"] = inv_item->getName();
-
+		{
 			LLSD payload;
 			payload["item_id"] = inv_item->getUUID();
 			payload["dest_folder_id"] = dest_folder;
 			payload["top_level_folder"] = top_level_folder;
 			payload["operation_id"] = operation_id;
-
-			if (move_to_outbox_operation_id != operation_id)
-			{
-				LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2));
-				
-				move_to_outbox_operation_id = operation_id;
-				move_to_outbox_payloads.clear();
-			}
-
-			move_to_outbox_payloads.push_back(payload);
+			
+			LLMarketplaceInventoryNotifications::addNoCopyNotification(payload, move_to_outbox_cb_action);
 		}
 	}
 }
diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp
new file mode 100644
index 00000000000..25faafb8ea6
--- /dev/null
+++ b/indra/newview/llmarketplacenotifications.cpp
@@ -0,0 +1,89 @@
+/** 
+ * @file llmarketplacenotifications.cpp
+ * @brief Handler for notifications related to marketplace file I/O
+ * class definition
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llmarketplacenotifications.h"
+#include "llnotificationsutil.h"
+
+#include "llerror.h"
+
+#include <boost/foreach.hpp>
+#include <boost/signals2.hpp>
+
+
+namespace LLMarketplaceInventoryNotifications
+{
+	typedef boost::signals2::signal<void (const LLSD& param)>	no_copy_payload_cb_signal_t;
+
+	static no_copy_payload_cb_signal_t*	no_copy_cb_action = NULL;
+	static bool							no_copy_notify_active = false;
+	static std::list<LLSD>				no_copy_payloads;
+
+	void notifyNoCopyCallback(const LLSD& notification, const LLSD& response)
+	{
+		const S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+		
+		if (option == 0)
+		{
+			llassert(!no_copy_payloads.empty());
+			llassert(no_copy_cb_action != NULL);
+			
+			BOOST_FOREACH(const LLSD& payload, no_copy_payloads)
+			{
+				(*no_copy_cb_action)(payload);
+			}
+		}
+		
+		delete no_copy_cb_action;
+		no_copy_cb_action = NULL;
+		
+		no_copy_notify_active = false;
+		no_copy_payloads.clear();
+	}
+
+	void update()
+	{
+		if (!no_copy_notify_active && !no_copy_payloads.empty())
+		{
+			no_copy_notify_active = true;
+			
+			LLNotificationsUtil::add("ConfirmNoCopyToOutbox", LLSD(), LLSD(), boost::bind(&notifyNoCopyCallback, _1, _2));
+		}
+	}
+		
+	void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb)
+	{
+		if (no_copy_cb_action == NULL)
+		{
+			no_copy_cb_action = new no_copy_payload_cb_signal_t;
+			no_copy_cb_action->connect(boost::bind(cb, _1));
+		}
+
+		no_copy_payloads.push_back(payload);
+	}
+}
diff --git a/indra/newview/llmarketplacenotifications.h b/indra/newview/llmarketplacenotifications.h
new file mode 100644
index 00000000000..83a4e163c7c
--- /dev/null
+++ b/indra/newview/llmarketplacenotifications.h
@@ -0,0 +1,57 @@
+/** 
+ * @file llmarketplacenotifications.h
+ * @brief Handler for notifications related to marketplace file I/O
+ * class definition
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLMARKETPLACENOTIFICATIONS_H
+#define LL_LLMARKETPLACENOTIFICATIONS_H
+
+
+#include <llsd.h>
+#include <boost/function.hpp>
+
+
+//
+// This is a set of helper functions to handle a unique notification with multiple
+// payloads, helpful when dragging and dropping items to the merchant outbox that
+// trigger notifications that can potentially interfere with the current drag and
+// drop operation.
+//
+// Notification payloads are cached locally when initiated, the notification itself
+// is triggered on the following frame during the call to "update" and then the
+// response is triggered once per payload.
+//
+
+namespace LLMarketplaceInventoryNotifications
+{
+	void update();
+
+	typedef boost::function<void (const LLSD&)> NoCopyCallbackFunction;
+	
+	void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb);
+};
+
+
+#endif // LL_LLMARKETPLACENOTIFICATIONS_H
-- 
GitLab


From 4b9cca70d7a3db719a9dfcfbf4937cfcb06b3516 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 17 Jan 2012 15:04:47 -0800
Subject: [PATCH 579/933] Fix for precompiled header issue on windows

---
 indra/newview/llmarketplacenotifications.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp
index 25faafb8ea6..0886f9a9904 100644
--- a/indra/newview/llmarketplacenotifications.cpp
+++ b/indra/newview/llmarketplacenotifications.cpp
@@ -25,7 +25,8 @@
  * $/LicenseInfo$
  */
 
-#include "linden_common.h"
+// Precompiled header
+#include "llviewerprecompiledheaders.h"
 
 #include "llmarketplacenotifications.h"
 #include "llnotificationsutil.h"
-- 
GitLab


From 652ef621543497aa947970d374285d8f851ed682 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 17 Jan 2012 15:51:30 -0800
Subject: [PATCH 580/933] EXP-1791 FIX -- Handle case where initialization with
 SLM fails in the Merchant Outbox floater in the viewer

* Timeout now triggers the re-initialization logic in the merchant outbox.
---
 indra/newview/llmarketplacefunctions.cpp | 10 ++++++----
 indra/newview/llmarketplacefunctions.h   |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index ee7505c4f41..a3f0a6062c8 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -132,11 +132,12 @@ namespace LLMarketplaceImport
 			}
 
 			if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) ||
-				(status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR))
+				(status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
+				(status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
 			{
 				if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
 				{
-					llinfos << " SLM POST clearing marketplace cookie due to authentication failure" << llendl;
+					llinfos << " SLM POST clearing marketplace cookie due to authentication failure or timeout" << llendl;
 				}
 
 				sMarketplaceCookie.clear();
@@ -173,11 +174,12 @@ namespace LLMarketplaceImport
 				llinfos << " SLM GET content: " << content.asString() << llendl;
 			}
 			
-			if (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR)
+			if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
+				(status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
 			{
 				if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
 				{
-					llinfos << " SLM GET clearing marketplace cookie due to authentication failure" << llendl;
+					llinfos << " SLM GET clearing marketplace cookie due to authentication failure or timeout" << llendl;
 				}
 
 				sMarketplaceCookie.clear();
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index 47315663661..4b8f7a1ac77 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -50,6 +50,7 @@ namespace MarketplaceErrorCodes
 		IMPORT_AUTHENTICATION_ERROR = 401,
 		IMPORT_DONE_WITH_ERRORS = 409,
 		IMPORT_JOB_FAILED = 410,
+		IMPORT_JOB_TIMEOUT = 499,
 	};
 }
 
-- 
GitLab


From 1fede65af23248293d4033b8f7557875b499e191 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 17 Jan 2012 16:05:10 -0800
Subject: [PATCH 581/933] EXP-1810 FIX Cannot resize Received items panel in
 Inventory window

---
 indra/llui/lllayoutstack.cpp                  | 34 ++++++++++++-------
 .../xui/en/floater_test_layout_stacks.xml     | 29 ++++------------
 2 files changed, 27 insertions(+), 36 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 000f729e29d..f7b34bbb380 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -39,8 +39,6 @@
 static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
 static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
 
-static const F32 MAX_FRACTIONAL_VALUE = 0.99999f;
-
 void LLLayoutStack::OrientationNames::declareValues()
 {
 	declare("horizontal", HORIZONTAL);
@@ -328,6 +326,7 @@ void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_
 	}
 
 	mNeedsLayout = true;
+	updateFractionalSizes();
 }
 
 
@@ -527,8 +526,8 @@ void LLLayoutStack::updateFractionalSizes()
 		if (panelp->mAutoResize)
 		{
 			F32 panel_resizable_dim = llmax(0.f, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
-			panelp->mFractionalSize = llmin(MAX_FRACTIONAL_VALUE, (panel_resizable_dim == 0.f)
-																	? (1.f - MAX_FRACTIONAL_VALUE)
+			panelp->mFractionalSize = llmin(1.f, (panel_resizable_dim == 0.f)
+																	? 0.f
 																	: panel_resizable_dim / total_resizable_dim);
 			total_fractional_size += panelp->mFractionalSize;
 			// check for NaNs
@@ -714,7 +713,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 				F32 fractional_adjustment_factor = total_auto_resize_headroom / updated_auto_resize_headroom;
 				F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
 													0.f,
-													MAX_FRACTIONAL_VALUE);
+													1.f);
 				F32 fraction_delta = (new_fractional_size - panelp->mFractionalSize);
 				fraction_given_up -= fraction_delta;
 				fraction_remaining -= panelp->mFractionalSize;
@@ -731,7 +730,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			{	// freeze new size as fraction
 				F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
 					? 1.f
-					: llmin(MAX_FRACTIONAL_VALUE, ((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom));
+					: llmin(1.f, ((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom));
 				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
 				fraction_remaining -= panelp->mFractionalSize;
 				panelp->mFractionalSize = new_fractional_size;
@@ -747,11 +746,20 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		case NEXT_PANEL:
 			if (panelp->mAutoResize)
 			{
-				F32 new_fractional_size = (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
-												/ updated_auto_resize_headroom;
-				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
 				fraction_remaining -= panelp->mFractionalSize;
-				panelp->mFractionalSize = new_fractional_size;
+				if (fraction_given_up != 0.f)
+				{
+					panelp->mFractionalSize += fraction_given_up;
+					fraction_given_up = 0.f;
+				}
+				else
+				{
+					F32 new_fractional_size = llmin(1.f, 
+													(F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
+														/ updated_auto_resize_headroom);
+					fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
+					panelp->mFractionalSize = new_fractional_size;
+				}
 			}
 			else
 			{
@@ -788,9 +796,9 @@ void LLLayoutStack::updateResizeBarLimits()
 		}
 
 		// toggle resize bars based on panel visibility, resizability, etc
-		if (visible_panelp->mUserResize 
-			&& previous_visible_panelp 
-			&& previous_visible_panelp->mUserResize)
+		if (previous_visible_panelp 
+			&& (visible_panelp->mUserResize 
+				|| previous_visible_panelp->mUserResize))
 		{
 			visible_panelp->mResizeBar->setVisible(TRUE);
 			visible_panelp->mResizeBar->setResizeLimits(visible_panelp->getRelevantMinDim(), 
diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
index dbe75f8b532..f95f21e63a7 100644
--- a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
@@ -26,31 +26,14 @@
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
-    <layout_panel name="fixed"
-                auto_resize="false"
-                  user_resize="true"
-                height="50"
-                  min_height="0"
-                bg_alpha_color="green"
-                background_visible="true">
-      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
-    </layout_panel>
-    <layout_panel name="fixed"
-                auto_resize="false"
+    <layout_panel name="flex"
+                  auto_resize="true"
                   user_resize="true"
-                height="50"
+                  bg_alpha_color="blue"
+                  height="11"
                   min_height="0"
-                bg_alpha_color="green"
-                background_visible="true">
-      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
-    </layout_panel>
-    <layout_panel name="fixed"
-                auto_resize="false"
-                  user_resize="true"
-                height="50"
-                bg_alpha_color="green"
-                background_visible="true">
-      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
   </layout_stack>
   <layout_stack name="test_stack"
-- 
GitLab


From 1eae229cf2470bee506d72ddecbd1305f305670b Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 17 Jan 2012 16:28:12 -0800
Subject: [PATCH 582/933] EXP-1809 FIX Buttons in right toolbar clipped and can
 be out of position

---
 indra/llui/lllayoutstack.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index f7b34bbb380..a309e3ff973 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -167,6 +167,11 @@ void LLLayoutPanel::reshape( S32 width, S32 height, BOOL called_from_parent /*=
 	if (!mIgnoreReshape && !mAutoResize)
 	{
 		mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height;
+		LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent());
+		if (stackp)
+		{
+			stackp->mNeedsLayout = true;
+		}
 	}
 	LLPanel::reshape(width, height, called_from_parent);
 }
-- 
GitLab


From a6c638d882919b58186a6859644d61cdb5e45a7b Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 17 Jan 2012 17:45:52 -0700
Subject: [PATCH 583/933] more exception handlings for llcurl fixes.

---
 indra/llmessage/llpumpio.h      |  1 +
 indra/llmessage/llsdrpcclient.h | 25 ++++++++++++++++++-------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/indra/llmessage/llpumpio.h b/indra/llmessage/llpumpio.h
index e405124403a..d2c5d375713 100644
--- a/indra/llmessage/llpumpio.h
+++ b/indra/llmessage/llpumpio.h
@@ -111,6 +111,7 @@ class LLPumpIO
 	 * @param chain The pipes for the chain
 	 * @param timeout The number of seconds in the future to
 	 * expire. Pass in 0.0f to never expire.
+	 * @param has_curl_request The chain contains LLURLRequest if true.
 	 * @return Returns true if anything was added to the pump.
 	 */
 	bool addChain(const chain_t& chain, F32 timeout, bool has_curl_request = false);
diff --git a/indra/llmessage/llsdrpcclient.h b/indra/llmessage/llsdrpcclient.h
index 235077179e0..0cecf4f6889 100644
--- a/indra/llmessage/llsdrpcclient.h
+++ b/indra/llmessage/llsdrpcclient.h
@@ -239,12 +239,17 @@ class LLSDRPCClientFactory : public LLChainIOFactory
 	LLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {}
 	virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
 	{
-		llerrs << "Can not call this." << llendl ;
-
 		lldebugs << "LLSDRPCClientFactory::build" << llendl;
-		LLIOPipe::ptr_t service(new Client);
-		chain.push_back(service);
 		LLURLRequest* http(new LLURLRequest(LLURLRequest::HTTP_POST));
+		if(!http->isValid())
+		{
+			llwarns << "Creating LLURLRequest failed." << llendl ;
+			delete http;
+			return false;
+		}
+
+		LLIOPipe::ptr_t service(new Client);
+		chain.push_back(service);		
 		LLIOPipe::ptr_t http_pipe(http);
 		http->addHeader("Content-Type: text/llsd");
 		if(mURL.empty())
@@ -284,11 +289,17 @@ class LLXMLSDRPCClientFactory : public LLChainIOFactory
 	LLXMLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {}
 	virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
 	{
-		llerrs << "who calls this?" << llendl ;
 		lldebugs << "LLXMLSDRPCClientFactory::build" << llendl;
-		LLIOPipe::ptr_t service(new Client);
-		chain.push_back(service);
+
 		LLURLRequest* http(new LLURLRequest(LLURLRequest::HTTP_POST));
+		if(!http->isValid())
+		{
+			llwarns << "Creating LLURLRequest failed." << llendl ;
+			delete http;
+			return false ;
+		}
+		LLIOPipe::ptr_t service(new Client);
+		chain.push_back(service);		
 		LLIOPipe::ptr_t http_pipe(http);
 		http->addHeader("Content-Type: text/xml");
 		if(mURL.empty())
-- 
GitLab


From 23773d792d4387a93db6e66bddcfe2035164d7be Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 17 Jan 2012 17:36:59 -0800
Subject: [PATCH 584/933] EXP-1811 FIX Login progress floater has smaller than
 expected size made minimum size reflect default size for 1024 width window of
 old layout stack no way to match behavior

---
 indra/newview/llfloateruipreview.cpp          |  6 ++--
 .../skins/default/xui/en/panel_progress.xml   | 30 +++++++++----------
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 4c9c4cb154a..d741b5b1335 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -915,14 +915,16 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		{
 			panel->buildFromFile(path);										// build it
 			LLRect new_size = panel->getRect();								// get its rectangle
-			panel->setOrigin(0,0);											// reset its origin point so it's not offset by -left or other XUI attributes
+			panel->setOrigin(2,2);											// reset its origin point so it's not offset by -left or other XUI attributes
 			(*floaterp)->setTitle(path);									// use the file name as its title, since panels have no guaranteed meaningful name attribute
 			panel->setUseBoundingRect(TRUE);								// enable the use of its outer bounding rect (normally disabled because it's O(n) on the number of sub-elements)
 			panel->updateBoundingRect();									// update bounding rect
 			LLRect bounding_rect = panel->getBoundingRect();				// get the bounding rect
 			LLRect new_rect = panel->getRect();								// get the panel's rect
 			new_rect.unionWith(bounding_rect);								// union them to make sure we get the biggest one possible
-			(*floaterp)->reshape(new_rect.getWidth(), new_rect.getHeight() + floater_header_size);	// reshape floater to match the union rect's dimensions
+			LLRect floater_rect = new_rect;
+			floater_rect.stretch(4, 4);
+			(*floaterp)->reshape(floater_rect.getWidth(), floater_rect.getHeight() + floater_header_size);	// reshape floater to match the union rect's dimensions
 			panel->reshape(new_rect.getWidth(), new_rect.getHeight());		// reshape panel to match the union rect's dimensions as well (both are needed)
 			(*floaterp)->addChild(panel);					// add panel as child
 			(*floaterp)->openFloater();						// open floater (needed?)
diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml
index 7275e8d89ba..860caf2d217 100644
--- a/indra/newview/skins/default/xui/en/panel_progress.xml
+++ b/indra/newview/skins/default/xui/en/panel_progress.xml
@@ -12,43 +12,43 @@
      height="768"
      layout="topleft"
      left="0"
-     name="stack1"
+     name="horizontal_centering"
      orientation="horizontal"
      top="0"
      width="1024">
         <layout_panel
          layout="topleft"
          min_width="10"
-         name="panel1"
+         name="left"
          width="150" />
         <layout_panel
          height="768"
          layout="topleft"
-         min_width="640"
-         name="panel2"
-         width="640">
+         min_width="670"
+         name="center"
+         width="670">
             <layout_stack
              follows="left|right|top|bottom"
              height="768"
              layout="topleft"
              left="0"
              orientation="vertical" 
-             name="stack2"
+             name="vertical_centering"
              top="0"
-             width="640">
+             width="670">
                 <layout_panel
                  height="200"
                  layout="topleft"
                  min_height="10"
                  name="panel3"
-                 width="640" />
+                 width="670" />
                 <layout_panel
                  auto_resize="false"
                  height="250"
                  layout="topleft"
                  min_height="250"
                  name="panel4"
-                 width="640">
+                 width="670">
                     <icon
                      color="LoginProgressBoxCenterColor"
                      follows="left|right|bottom|top"
@@ -57,7 +57,7 @@
                      layout="topleft"
                      left="0"
                      top="0"
-                     width="640" />
+                     width="670" />
                     <text
                      follows="left|right|top"
                      font="SansSerifHuge"
@@ -69,7 +69,7 @@
                      name="title_text"
                      text_color="LoginProgressBoxTextColor"
                      top_delta="50"
-                     width="593" />
+                     right="-47"/>
                     <text
                      follows="left|right|top"
                      font="SansSerif"
@@ -81,7 +81,7 @@
                      name="progress_text"
                      text_color="LoginProgressBoxTextColor"
                      top_pad="5"
-                     width="593"
+                     right="-47"
                      word_wrap="true"/>
                     <progress_bar
                      bottom="115"
@@ -104,7 +104,7 @@
                      name="message_text"
                      text_color="LoginProgressBoxTextColor"
                      top="145"
-                     width="550"
+                     right="-90"
                      word_wrap="true"/>
                 </layout_panel>
                 <layout_panel
@@ -112,13 +112,13 @@
                  layout="topleft"
                  min_width="10"
                  name="panel5"
-                 width="640" />
+                 width="670" />
             </layout_stack>
         </layout_panel>
         <layout_panel
          layout="topleft"
          min_width="10"
-         name="panel6"
+         name="right"
          width="150" />
     </layout_stack>
     <button
-- 
GitLab


From 25c21c3761d871fa7927e2a5656ed18100084454 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 17 Jan 2012 22:56:28 -0700
Subject: [PATCH 585/933] add more exception handlings for llcurl fix.

---
 indra/llmessage/llcurl.cpp       | 7 ++++++-
 indra/llmessage/llurlrequest.cpp | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 277c274f526..5edf0dc8c00 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -1036,7 +1036,12 @@ LLCurl::Easy* LLCurlRequest::allocEasy()
 	{
 		addMulti();
 	}
-	llassert_always(mActiveMulti);
+	if(!mActiveMulti)
+	{
+		return NULL ;
+	}
+
+	//llassert_always(mActiveMulti);
 	++mActiveRequestCount;
 	LLCurl::Easy* easy = mActiveMulti->allocEasy();
 	return easy;
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index f02c6368380..a16f5c7bf0e 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -459,6 +459,12 @@ void LLURLRequest::initialize()
 	LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
 	mState = STATE_INITIALIZED;
 	mDetail = new LLURLRequestDetail;
+
+	if(!isValid())
+	{
+		return ;
+	}
+
 	mDetail->mCurlRequest->setopt(CURLOPT_NOSIGNAL, 1);
 	mDetail->mCurlRequest->setWriteCallback(&downCallback, (void*)this);
 	mDetail->mCurlRequest->setReadCallback(&upCallback, (void*)this);
-- 
GitLab


From 9025656bba1520b6b442ce0a359fad0217e6d970 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 17 Jan 2012 22:41:25 -0800
Subject: [PATCH 586/933] EXP-1773 : A bit of code cleanup and defensive coding
 in an attempt to alleviate some errand crashes.

---
 indra/llui/lluistring.cpp | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp
index ac69d3bf851..c4e073ccdb9 100644
--- a/indra/llui/lluistring.cpp
+++ b/indra/llui/lluistring.cpp
@@ -128,17 +128,13 @@ void LLUIString::updateResult() const
 	}
 	mResult = mOrig;
 	
-	// get the defailt args + local args
-	if (!mArgs || mArgs->empty())
+	// get the default args + local args
+	LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs();
+	if (mArgs && !mArgs->empty())
 	{
-		LLStringUtil::format(mResult, LLTrans::getDefaultArgs());
-	}
-	else
-	{
-		LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs();
 		combined_args.insert(mArgs->begin(), mArgs->end());
-		LLStringUtil::format(mResult, combined_args);
 	}
+	LLStringUtil::format(mResult, combined_args);
 }
 
 void LLUIString::updateWResult() const
-- 
GitLab


From b75f495526b29fff826fa8bd4e89be7ddf6b2aee Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 18 Jan 2012 17:38:05 +0200
Subject: [PATCH 587/933] EXP-1813 FIXED Unpressable radio button in
 Preferences -> General.

Made the radio group larger so that all its buttons become clickable.
---
 .../skins/default/xui/en/panel_preferences_general.xml      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
index 9827180aa72..24882988b06 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
@@ -331,7 +331,7 @@
    </text>
    <radio_group
      control_name="LetterKeysFocusChatBar" 
-     height="20"
+     height="34"
      layout="topleft"
      left="35"
      top_pad="0" 
@@ -339,7 +339,7 @@
         <radio_item
          label="Starts local chat"
          name="radio_start_chat"
-         top_delta="20" 
+         top="0" 
          layout="topleft"
          height="16" 
          left="0" 
@@ -364,7 +364,7 @@
      layout="topleft"
      left="30"
      name="title_afk_text"
-     top_pad="15" 
+     top_pad="5" 
      width="190">
     	Away timeout:
     </text>
-- 
GitLab


From 0c1fc78bd94014ee19da690f16cef64c13e50771 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 18 Jan 2012 12:40:11 -0600
Subject: [PATCH 588/933] SH-2794 Map buffer now performs as well as
 buffersubdata

---
 indra/llrender/llvertexbuffer.cpp    | 63 +++++++++++++++++++---------
 indra/llrender/llvertexbuffer.h      |  2 +
 indra/newview/lldrawpoolavatar.cpp   |  2 +-
 indra/newview/llface.cpp             |  5 ++-
 indra/newview/llspatialpartition.cpp |  6 ++-
 indra/newview/llviewerobject.cpp     |  5 ++-
 indra/newview/llvovolume.cpp         | 15 ++++---
 indra/newview/llvowater.cpp          |  2 +-
 indra/newview/llvowlsky.cpp          |  2 +-
 9 files changed, 68 insertions(+), 34 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index f8c2a558202..62be5c73685 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -169,7 +169,7 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size)
 		glBufferDataARB(mType, size, 0, mUsage);
 		LLVertexBuffer::sAllocatedBytes += size;
 
-		if (LLVertexBuffer::sDisableVBOMapping)
+		if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB)
 		{
 			ret = (U8*) ll_aligned_malloc_16(size);
 		}
@@ -201,8 +201,15 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
 	rec.mClientData = buffer;
 
 	sBytesPooled += size;
-
-	mFreeList[i].push_back(rec);
+	
+	if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
+	{
+		glDeleteBuffersARB(1, &rec.mGLName);
+	}
+	else
+	{
+		mFreeList[i].push_back(rec);
+	}
 }
 
 void LLVBOPool::cleanup()
@@ -536,7 +543,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
 void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
 {
 	validateRange(start, end, count, indices_offset);
-
+	mMappable = FALSE;
 	gGL.syncMatrices();
 
 	llassert(mNumVerts >= 0);
@@ -591,7 +598,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-
+	mMappable = FALSE;
 	gGL.syncMatrices();
 
 	llassert(mNumIndices >= 0);
@@ -637,7 +644,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-	
+	mMappable = FALSE;
 	gGL.syncMatrices();
 	
 	llassert(mNumVerts >= 0);
@@ -790,6 +797,15 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 		mUsage = GL_DYNAMIC_DRAW_ARB;
 	}
 		
+	if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
+	{
+		mMappable = TRUE;
+	}
+	else
+	{
+		mMappable = FALSE;
+	}
+
 	//zero out offsets
 	for (U32 i = 0; i < TYPE_MAX; i++)
 	{
@@ -1301,7 +1317,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 		
 	if (useVBOs())
 	{
-		if (sDisableVBOMapping || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange)
+		if (!mMappable || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange)
 		{
 			if (count == -1)
 			{
@@ -1326,7 +1342,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 			if (!mapped)
 			{
 				//not already mapped, map new region
-				MappedRegion region(type, !sDisableVBOMapping && map_range ? -1 : index, count);
+				MappedRegion region(type, mMappable && map_range ? -1 : index, count);
 				mMappedVertexRegions.push_back(region);
 			}
 		}
@@ -1343,7 +1359,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 			sMappedCount++;
 			stop_glerror();	
 
-			if(sDisableVBOMapping)
+			if(!mMappable)
 			{
 				map_range = false;
 			}
@@ -1421,7 +1437,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 			//check the availability of memory
 			LLMemory::logMemoryInfo(TRUE) ; 
 			
-				if(!sDisableVBOMapping)
+				if(mMappable)
 				{			
 					//--------------------
 					//print out more debug info before crash
@@ -1453,7 +1469,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 		map_range = false;
 	}
 	
-	if (map_range && gGLManager.mHasMapBufferRange && !sDisableVBOMapping)
+	if (map_range && gGLManager.mHasMapBufferRange && mMappable)
 	{
 		return mMappedData;
 	}
@@ -1482,7 +1498,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 
 	if (useVBOs())
 	{
-		if (sDisableVBOMapping || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange)
+		if (!mMappable || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange)
 		{
 			if (count == -1)
 			{
@@ -1504,7 +1520,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 			if (!mapped)
 			{
 				//not already mapped, map new region
-				MappedRegion region(TYPE_INDEX, !sDisableVBOMapping && map_range ? -1 : index, count);
+				MappedRegion region(TYPE_INDEX, mMappable && map_range ? -1 : index, count);
 				mMappedIndexRegions.push_back(region);
 			}
 		}
@@ -1533,7 +1549,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 				}
 			}
 
-			if(sDisableVBOMapping)
+			if(!mMappable)
 			{
 				map_range = false;
 			}
@@ -1599,7 +1615,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 			log_glerror();
 			LLMemory::logMemoryInfo(TRUE) ;
 
-			if(!sDisableVBOMapping)
+			if(mMappable)
 			{
 				GLint buff;
 				glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
@@ -1621,7 +1637,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 		map_range = false;
 	}
 
-	if (map_range && gGLManager.mHasMapBufferRange && !sDisableVBOMapping)
+	if (map_range && gGLManager.mHasMapBufferRange && mMappable)
 	{
 		return mMappedIndexData;
 	}
@@ -1632,6 +1648,11 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 }
 
 static LLFastTimer::DeclareTimer FTM_VBO_UNMAP("VBO Unmap");
+static LLFastTimer::DeclareTimer FTM_VBO_FLUSH_RANGE("Flush VBO Range");
+
+
+static LLFastTimer::DeclareTimer FTM_IBO_UNMAP("IBO Unmap");
+static LLFastTimer::DeclareTimer FTM_IBO_FLUSH_RANGE("Flush IBO Range");
 
 void LLVertexBuffer::unmapBuffer()
 {
@@ -1641,16 +1662,15 @@ void LLVertexBuffer::unmapBuffer()
 		return ; //nothing to unmap
 	}
 
-	LLFastTimer t(FTM_VBO_UNMAP);
-
 	bool updated_all = false ;
 
 	if (mMappedData && mVertexLocked)
 	{
+		LLFastTimer t(FTM_VBO_UNMAP);
 		bindGLBuffer(true);
 		updated_all = mIndexLocked; //both vertex and index buffers done updating
 
-		if(sDisableVBOMapping)
+		if(!mMappable)
 		{
 			if (!mMappedVertexRegions.empty())
 			{
@@ -1687,6 +1707,7 @@ void LLVertexBuffer::unmapBuffer()
 						S32 length = sTypeSize[region.mType]*region.mCount;
 						if (gGLManager.mHasMapBufferRange)
 						{
+							LLFastTimer t(FTM_VBO_FLUSH_RANGE);
 #ifdef GL_ARB_map_buffer_range
 							glFlushMappedBufferRange(GL_ARRAY_BUFFER_ARB, offset, length);
 #endif
@@ -1714,8 +1735,9 @@ void LLVertexBuffer::unmapBuffer()
 	
 	if (mMappedIndexData && mIndexLocked)
 	{
+		LLFastTimer t(FTM_IBO_UNMAP);
 		bindGLIndices();
-		if(sDisableVBOMapping)
+		if(!mMappable)
 		{
 			if (!mMappedIndexRegions.empty())
 			{
@@ -1750,6 +1772,7 @@ void LLVertexBuffer::unmapBuffer()
 						S32 length = sizeof(U16)*region.mCount;
 						if (gGLManager.mHasMapBufferRange)
 						{
+							LLFastTimer t(FTM_IBO_FLUSH_RANGE);
 #ifdef GL_ARB_map_buffer_range
 							glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length);
 #endif
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 5b93a0389f8..dde2b7e152e 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -254,6 +254,7 @@ class LLVertexBuffer : public LLRefCount
 	volatile U8* getMappedIndices() const			{ return mMappedIndexData; }
 	S32 getOffset(S32 type) const			{ return mOffsets[type]; }
 	S32 getUsage() const					{ return mUsage; }
+	BOOL isWriteable() const				{ return (sDisableVBOMapping || mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
 
 	void draw(U32 mode, U32 count, U32 indices_offset) const;
 	void drawArrays(U32 mode, U32 offset, U32 count) const;
@@ -284,6 +285,7 @@ class LLVertexBuffer : public LLRefCount
 	BOOL	mIndexLocked;			// if TRUE, index buffer is being or has been written to in client memory
 	BOOL	mFinal;			// if TRUE, buffer can not be mapped again
 	BOOL	mEmpty;			// if TRUE, client buffer is empty (or NULL). Old values have been discarded.	
+	mutable BOOL	mMappable;     // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
 	S32		mOffsets[TYPE_MAX];
 
 	std::vector<MappedRegion> mMappedVertexRegions;
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 55b314fbb15..e75e34df066 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1285,7 +1285,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 		face->setGeomIndex(0);
 		face->setIndicesIndex(0);
 		
-		if (buffer.isNull() || buffer->getTypeMask() != data_mask)
+		if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable())
 		{ //make a new buffer
 			if (sShaderLevel > 0)
 			{
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 941b8db2cf5..cd33a19a2a8 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1131,7 +1131,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		updateRebuildFlags();
 	}
 
-	bool map_range = gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange;
+
+	//don't use map range (generates many redundant unmap calls)
+	bool map_range = false; //gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange;
 
 	if (mVertexBuffer.notNull())
 	{
@@ -1921,6 +1923,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		mTexExtents[1][1] *= et ;
 	}
 
+
 	mLastVertexBuffer = mVertexBuffer;
 	mLastGeomCount = mGeomCount;
 	mLastGeomIndex = mGeomIndex;
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 900f126049c..4aa5f32d8a7 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -264,7 +264,7 @@ static LLFastTimer::DeclareTimer FTM_BUILD_OCCLUSION("Build Occlusion");
 
 void LLSpatialGroup::buildOcclusion()
 {
-	if (mOcclusionVerts.isNull())
+	//if (mOcclusionVerts.isNull())
 	{
 		mOcclusionVerts = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, 
 			LLVertexBuffer::sUseStreamDraw ? mBufferUsage : 0); //if GL has a hard time with VBOs, don't use them for occlusion culling.
@@ -726,7 +726,9 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
 	if (vertex_count > 0 && index_count > 0)
 	{ //create vertex buffer containing volume geometry for this node
 		group->mBuilt = 1.f;
-		if (group->mVertexBuffer.isNull() || (group->mBufferUsage != group->mVertexBuffer->getUsage() && LLVertexBuffer::sEnableVBOs))
+		if (group->mVertexBuffer.isNull() ||
+			!group->mVertexBuffer->isWriteable() ||
+			(group->mBufferUsage != group->mVertexBuffer->getUsage() && LLVertexBuffer::sEnableVBOs))
 		{
 			group->mVertexBuffer = createVertexBuffer(mVertexDataMask, group->mBufferUsage);
 			group->mVertexBuffer->allocateBuffer(vertex_count, index_count, true);
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index b8772971aa6..37fb77a10ac 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -5520,11 +5520,12 @@ void LLViewerObject::dirtyMesh()
 {
 	if (mDrawable)
 	{
-		LLSpatialGroup* group = mDrawable->getSpatialGroup();
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL);
+		/*LLSpatialGroup* group = mDrawable->getSpatialGroup();
 		if (group)
 		{
 			group->dirtyMesh();
-		}
+		}*/
 	}
 }
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 20f86746550..e68fd2697a3 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4806,17 +4806,20 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 	
 		//create/delete/resize vertex buffer if needed
 		LLVertexBuffer* buffer = NULL;
-		LLSpatialGroup::buffer_texture_map_t::iterator found_iter = group->mBufferMap[mask].find(*face_iter);
+
+		{ //try to find a buffer to reuse
+			LLSpatialGroup::buffer_texture_map_t::iterator found_iter = group->mBufferMap[mask].find(*face_iter);
 		
-		if (found_iter != group->mBufferMap[mask].end())
-		{
-			if ((U32) buffer_index < found_iter->second.size())
+			if (found_iter != group->mBufferMap[mask].end())
 			{
-				buffer = found_iter->second[buffer_index];
+				if ((U32) buffer_index < found_iter->second.size())
+				{
+					buffer = found_iter->second[buffer_index];
+				}
 			}
 		}
 						
-		if (!buffer)
+		if (!buffer || !buffer->isWriteable())
 		{ //create new buffer if needed
 			buffer = createVertexBuffer(mask, buffer_usage);
 			buffer->allocateBuffer(geom_count, index_count, TRUE);
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 7df50ec8150..315616e8a5c 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -167,7 +167,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
 				  indices_per_quad * num_quads);
 	
 	LLVertexBuffer* buff = face->getVertexBuffer();
-	if (!buff)
+	if (!buff || !buff->isWriteable())
 	{
 		buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB);
 		buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE);
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index f1c5499d847..afd902201bc 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -774,7 +774,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
 	LLStrider<LLColor4U> colorsp;
 	LLStrider<LLVector2> texcoordsp;
 
-	if (mStarsVerts.isNull())
+	if (mStarsVerts.isNull() || !mStarsVerts->isWriteable())
 	{
 		mStarsVerts = new LLVertexBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK, GL_DYNAMIC_DRAW);
 		mStarsVerts->allocateBuffer(getStarsNumVerts()*6, 0, TRUE);
-- 
GitLab


From 2b724e30cf49999f4a4def3d197d739ce2535016 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 18 Jan 2012 20:50:25 +0200
Subject: [PATCH 589/933] EXP-1814 FIXED Added copying the missing symlinks to
 Linux viewer lib dir.

---
 indra/newview/viewer_manifest.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 089b17149d3..9bf755c8f8e 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1049,8 +1049,11 @@ def construct(self):
             self.path("libSDL-1.2.so.0.11.3")
             self.path("libSDL-1.2.so.0")
             self.path("libdirectfb-1.4.so.5.0.4")
+            self.path("libdirectfb-1.4.so.5")
             self.path("libfusion-1.4.so.5.0.4")
+            self.path("libfusion-1.4.so.5")
             self.path("libdirect-1.4.so.5.0.4")
+            self.path("libdirect-1.4.so.5")
             self.path("libopenjpeg.so.1.4.0")
             self.path("libopenjpeg.so.1")
             self.path("libopenjpeg.so")
-- 
GitLab


From 41a43a4125a69835e6a76f5792a267ba0797f41a Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 18 Jan 2012 21:04:19 +0200
Subject: [PATCH 590/933] EXP-1672 FIXED Defensive fix for the crash. Added
 disconnecting notifications manager callbacks. Added check to prevent calling
 the destroyed Notifications object.

---
 indra/newview/llnotificationmanager.cpp | 28 ++++++++++++++++---------
 indra/newview/llnotificationmanager.h   |  5 +++++
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index 6105eff8ea6..f792f53ac58 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -35,6 +35,7 @@
 #include "llnotifications.h"
 
 #include <boost/bind.hpp>
+#include <boost/foreach.hpp>
 
 using namespace LLNotificationsUI;
 
@@ -48,6 +49,10 @@ LLNotificationManager::LLNotificationManager()
 //--------------------------------------------------------------------------
 LLNotificationManager::~LLNotificationManager()
 {
+	BOOST_FOREACH(listener_pair_t& pair, mChannelListeners)
+	{
+		pair.second.disconnect();
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -64,16 +69,16 @@ void LLNotificationManager::init()
 	LLNotificationChannel::buildChannel("Browser", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "browser"));
 	LLNotificationChannel::buildChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"));
   
-	LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("Group Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("Alerts")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
-	LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
-	LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
-	LLNotifications::instance().getChannel("Outbox")->connectChanged(boost::bind(&LLOutboxNotification::processNotification, LLOutboxNotification::getInstance(), _1));
+	mChannelListeners["Notifications"] = LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["NotificationTips"] = LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["Group Notifications"] = LLNotifications::instance().getChannel("Group Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["Alerts"] = LLNotifications::instance().getChannel("Alerts")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["AlertModal"] = LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["IM Notifications"] = LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["Offer"] = LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	mChannelListeners["Hints"] = LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
+	mChannelListeners["Browser"] = LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
+	mChannelListeners["Outbox"] = LLNotifications::instance().getChannel("Outbox")->connectChanged(boost::bind(&LLOutboxNotification::processNotification, LLOutboxNotification::getInstance(), _1));
 
 	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["notifytip"] =  boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
@@ -92,6 +97,9 @@ bool LLNotificationManager::onNotification(const LLSD& notify)
 {
 	LLSysHandler* handle = NULL;
 
+	if (LLNotifications::destroyed())
+		return false;
+
 	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
 	
 	if (!notification) 
diff --git a/indra/newview/llnotificationmanager.h b/indra/newview/llnotificationmanager.h
index 16e82e4cce0..27b6ba1c717 100644
--- a/indra/newview/llnotificationmanager.h
+++ b/indra/newview/llnotificationmanager.h
@@ -28,6 +28,8 @@
 #ifndef LL_LLNOTIFICATIONMANAGER_H
 #define LL_LLNOTIFICATIONMANAGER_H
 
+#include "llevents.h"
+
 #include "lluictrl.h"
 #include "llnotificationhandler.h"
 
@@ -47,6 +49,7 @@ class LLToast;
 class LLNotificationManager : public LLSingleton<LLNotificationManager>
 {
 	typedef std::pair<std::string, LLEventHandler*> eventhandlers;
+	typedef std::pair<const std::string, LLBoundListener> listener_pair_t;
 public:	
 	LLNotificationManager();	
 	virtual ~LLNotificationManager();
@@ -70,6 +73,8 @@ class LLNotificationManager : public LLSingleton<LLNotificationManager>
 	//TODO (*)
 	std::map<std::string, boost::shared_ptr<LLEventHandler> > mNotifyHandlers;
 	// cruft std::map<std::string, LLChatHandler*> mChatHandlers;
+
+	std::map<std::string, LLBoundListener> mChannelListeners;
 };
 
 }
-- 
GitLab


From 40687a930c2e37a4da15ff15f004611a734583d7 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 18 Jan 2012 12:59:44 -0800
Subject: [PATCH 591/933] EXP-1812 FIX Cannot resize location bar / favorites
 in top navigation bar in viewer

---
 indra/llui/lllayoutstack.cpp                  |  13 +-
 indra/llui/lllayoutstack.h                    |   6 +-
 indra/newview/app_settings/settings.xml       |  11 -
 .../default/xui/en/panel_navigation_bar.xml   | 235 +++++++++---------
 4 files changed, 130 insertions(+), 135 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index a309e3ff973..9909032707a 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -201,6 +201,7 @@ LLLayoutStack::Params::Params()
 	clip("clip", true),
 	open_time_constant("open_time_constant", 0.02f),
 	close_time_constant("close_time_constant", 0.03f),
+	resize_bar_overlap("resize_bar_overlap", 1),
 	border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0))
 {}
 
@@ -213,7 +214,8 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p)
 	mNeedsLayout(true),
 	mClip(p.clip),
 	mOpenTimeConstant(p.open_time_constant),
-	mCloseTimeConstant(p.close_time_constant)
+	mCloseTimeConstant(p.close_time_constant),
+	mResizeBarOverlap(p.resize_bar_overlap)
 {}
 
 LLLayoutStack::~LLLayoutStack()
@@ -409,21 +411,20 @@ void LLLayoutStack::updateLayout()
 		panelp->setShape(panel_rect);
 		panelp->setIgnoreReshape(false);
 
-		static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0);
 		LLRect resize_bar_rect(panel_rect);
 
 		F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
 		if (mOrientation == HORIZONTAL)
 		{
-			resize_bar_rect.mLeft = panel_rect.mRight - resize_bar_overlap;
-			resize_bar_rect.mRight = panel_rect.mRight + panel_spacing + resize_bar_overlap;
+			resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap;
+			resize_bar_rect.mRight = panel_rect.mRight + panel_spacing + mResizeBarOverlap;
 
 			cur_pos += panel_visible_dim + panel_spacing;
 		}
 		else //VERTICAL
 		{
-			resize_bar_rect.mTop = panel_rect.mBottom + resize_bar_overlap;
-			resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing - resize_bar_overlap;
+			resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap;
+			resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing - mResizeBarOverlap;
 
 			cur_pos -= panel_visible_dim + panel_spacing;
 		}
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index a343e11cece..f00d5e759b1 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -60,6 +60,7 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 								clip;
 		Optional<F32>			open_time_constant,
 								close_time_constant;
+		Optional<S32>			resize_bar_overlap;
 
 		Params();
 	};
@@ -122,9 +123,10 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	bool mAnimatedThisFrame;
 	bool mAnimate;
 	bool mClip;
-	F32 mOpenTimeConstant;
-	F32 mCloseTimeConstant;
+	F32  mOpenTimeConstant;
+	F32  mCloseTimeConstant;
 	bool mNeedsLayout;
+	S32  mResizeBarOverlap;
 }; // end class LLLayoutStack
 
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a4806e3b77e..28ba9fd704b 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11378,17 +11378,6 @@
       <key>Value</key>
       <real>3</real>
     </map>
-    <key>UIResizeBarOverlap</key>
-    <map>
-      <key>Comment</key>
-      <string>Size of UI resize bar overlap</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <real>1</real>
-    </map>
     <key>UIScaleFactor</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 9dee68efa7c..305ce70fcb7 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -59,6 +59,8 @@
        follows="all"
        height="34"
        layout="topleft"
+       border_size="0"
+       resize_bar_overlap="3"
        left="0"
        mouse_opaque="false"
        name="nvp_stack"
@@ -73,129 +75,130 @@
            min_width="480"
            name="navigation_layout_panel"
            width="480">
-	<panel
-	 background_visible="false"
-	 follows="left|top|right"
-	 top="3"
-	 height="23"
-	 layout="topleft"
-               left="0"
-	 name="navigation_panel"
-     width="480">
-	     <pull_button
-	     follows="left|top"
-	     direction="down"
-	     height="23"
-	     image_overlay="Arrow_Left_Off"
-	     image_bottom_pad="1"
-	     layout="topleft"
-	     left="10"
-	     name="back_btn"
-	     tool_tip="Go back to previous location"
-	     top="2"
-	     width="31" />
-	    <pull_button
-	     follows="left|top"
-	     direction="down"
-	     height="23"
-	     image_overlay="Arrow_Right_Off"
-	     image_bottom_pad="1"
-	     layout="topleft"
-	     left_pad="0"
-	     name="forward_btn"
-	     tool_tip="Go forward one location"
-	     top_delta="0"
-	     width="31" />
-	    <button
-	     follows="left|top"
-	     height="23"
-	     image_bottom_pad="1"
-	     image_overlay="Home_Off"
-	     layout="topleft"
-	     left_pad="7"
-	     name="home_btn"
-	     tool_tip="Teleport to my home location"
-	     top_delta="0"
-	     width="32" />
-	    <location_input
-                   follows="all"
-	     halign="right"
-	     height="23"
-	     label="Location"
-	     layout="topleft"
-	     left_pad="7"
-	     max_chars="254"
-	     mouse_opaque="false"
-	     name="location_combo"
-	     top_delta="0"
-            width="355">
-         <combo_list
-         mouse_wheel_opaque="true"/>
-	    </location_input>
-             </panel>
-         </layout_panel>
-         
-         <layout_panel
-           auto_resize="false"
-           layout="topleft"
-           max_width="5"
-           min_width="5"
-           name="nav_bar_resize_handle_panel"
-           width="5">
-             <icon
-               follows="top|right"
-               height="25"
-               image_name="ChatBarHandle"
-               layout="topleft"
-               left="-6"
-               name="resize_handle"
-               top="4"
-               width="5" />
-         </layout_panel>
-         
+	        <panel
+	         background_visible="false"
+	         follows="left|top|right"
+	         top="3"
+	         height="23"
+	         layout="topleft"
+                       left="0"
+	         name="navigation_panel"
+             width="480">
+	         <pull_button
+	         follows="left|top"
+	         direction="down"
+	         height="23"
+	         image_overlay="Arrow_Left_Off"
+	         image_bottom_pad="1"
+	         layout="topleft"
+	         left="10"
+	         name="back_btn"
+	         tool_tip="Go back to previous location"
+	         top="2"
+	         width="31" />
+	        <pull_button
+	         follows="left|top"
+	         direction="down"
+	         height="23"
+	         image_overlay="Arrow_Right_Off"
+	         image_bottom_pad="1"
+	         layout="topleft"
+	         left_pad="0"
+	         name="forward_btn"
+	         tool_tip="Go forward one location"
+	         top_delta="0"
+	         width="31" />
+	        <button
+	         follows="left|top"
+	         height="23"
+	         image_bottom_pad="1"
+	         image_overlay="Home_Off"
+	         layout="topleft"
+	         left_pad="7"
+	         name="home_btn"
+	         tool_tip="Teleport to my home location"
+	         top_delta="0"
+	         width="32" />
+	        <location_input
+                       follows="all"
+	         halign="right"
+	         height="23"
+	         label="Location"
+	         layout="topleft"
+	         left_pad="7"
+	         max_chars="254"
+	         mouse_opaque="false"
+	         name="location_combo"
+	         top_delta="0"
+                width="355">
+             <combo_list
+             mouse_wheel_opaque="true"/>
+	        </location_input>
+         </panel>
+          <icon
+             follows="top|right"
+             height="25"
+             image_name="ChatBarHandle"
+             layout="topleft"
+             left="-3"
+             name="resize_handle"
+             top="4"
+             width="5" />
+        </layout_panel>
          <layout_panel
            follows="top|left"
-	     layout="topleft"
+	         layout="topleft"
            auto_resize="true"
            user_resize="true"
            min_width="315"
            name="favorites_layout_panel"
            width="315">
-    <favorites_bar
-     follows="left|right|top"
-     font="SansSerifSmall"
-               height="20"
-     layout="topleft"
-     left="0"
-     name="favorite"
-     image_drag_indication="Accordion_ArrowOpened_Off"
-     tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-               width="311">
-        <label
-         follows="left|top"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="favorites_bar_label"
-         text_color="LtGray"
-         tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-         top="12"
-         width="102">
-          Favorites Bar
-        </label>
-                 <!-- More button actually is a text box. -->
-                 <more_button
-                   follows="left|bottom"
-                   name=">>"
-                   tab_stop="false"
-                   tool_tip="Show more of My Favorites"
-                   top="13"
-                   width="50"
-                   bottom="0"
-                   valign="bottom">
-                   More &#9660;
-                   </more_button>
-  </favorites_bar>
+           <icon
+             follows="top|left"
+             height="25"
+             image_name="ChatBarHandle"
+             layout="topleft"
+             left="-318"
+             name="resize_handle"
+             top="4"
+             width="5" />
+
+           <favorites_bar
+             follows="left|right|top"
+             font="SansSerifSmall"
+             height="20"
+             layout="topleft"
+             left="0"
+             top="4"
+             name="favorite"
+             image_drag_indication="Accordion_ArrowOpened_Off"
+             tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
+             width="311">
+            <label
+             follows="left|top"
+             height="15"
+             layout="topleft"
+             left="10"
+             name="favorites_bar_label"
+             text_color="LtGray"
+             tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
+             top="12"
+             width="102">
+              Favorites Bar
+            </label>
+              <!-- More button actually is a text box. -->
+              <more_button
+                follows="left|bottom"
+                name=">>"
+                tab_stop="false"
+                tool_tip="Show more of My Favorites"
+                top="13"
+                width="50"
+                bottom="0"
+                valign="bottom">
+                More &#9660;
+                </more_button>
+         </favorites_bar>
          </layout_panel>
      
      </layout_stack>
-- 
GitLab


From eee28bd007178ac83053dfb891a7951d368bcc6e Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 18 Jan 2012 13:03:19 -0800
Subject: [PATCH 592/933] EXP-1125 FIX -- New tags always shown in Received
 Items inbox when Inventory window is detached from side panel EXP-1578 FIX --
 received items folder shows shadows of content when scrolling through lots of
 folders in same window

* Put in guard to prevent the inventory panel from being created multiple times
---
 indra/newview/llsidepanelinventory.cpp | 28 +++++++++++++++++---------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index e7d486e0586..3761eb57772 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -71,8 +71,6 @@ static const char * const INBOX_BUTTON_NAME = "inbox_btn";
 static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
 static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel";
 
-static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox";
-
 static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
 
 static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
@@ -288,34 +286,44 @@ void LLSidepanelInventory::observeInboxCreation()
 
 void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID)
 {
+	//
+	// Silently do nothing if we already have an inbox inventory panel set up
+	// (this can happen multiple times on the initial session that creates the inbox)
+	//
+
+	if (mInventoryPanelInbox != NULL)
+	{
+		return;
+	}
+
 	//
 	// Track inbox folder changes
 	//
-	
+
 	if (inboxID.isNull())
 	{
-		llwarns << "Attempting to track modifications to non-existant inbox" << llendl;
+		llwarns << "Attempting to track modifications to non-existent inbox" << llendl;
 		return;
 	}
-	
+
 	if (mCategoriesObserver == NULL)
 	{
 		mCategoriesObserver = new LLInventoryCategoriesObserver();
 		gInventory.addObserver(mCategoriesObserver);
 	}
-	
+
 	mCategoriesObserver->addCategory(inboxID, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inboxID));
-	
+
 	//
 	// Trigger a load for the entire contents of the Inbox
 	//
-	
+
 	LLInventoryModelBackgroundFetch::instance().start(inboxID);
-	
+
 	//
 	// Set up the inbox inventory view
 	//
-	
+
 	LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL);
 	mInventoryPanelInbox = inbox->setupInventoryPanel();
 }
-- 
GitLab


From b18d54be9fb4998854e39df8fbaa271ceb2b8f89 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 18 Jan 2012 13:11:57 -0800
Subject: [PATCH 593/933] EXP-1816 FIX -- Drag area in outbox can remain
 highlighted after drag and drop ends

* Added handleHover function to clear highlight
---
 indra/newview/llfloateroutbox.cpp | 10 ++++++++++
 indra/newview/llfloateroutbox.h   |  1 +
 2 files changed, 11 insertions(+)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 297736f3bd8..08cd8082aac 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -419,6 +419,16 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 	return handled;
 }
 
+BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask)
+{
+	if (mOutboxTopLevelDropZone)
+	{
+		mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
+	}
+
+	return LLFloater::handleHover(x, y, mask);
+}
+
 void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask)
 {
 	if (mOutboxTopLevelDropZone)
diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h
index 796c533059f..18baccf1c95 100644
--- a/indra/newview/llfloateroutbox.h
+++ b/indra/newview/llfloateroutbox.h
@@ -66,6 +66,7 @@ class LLFloaterOutbox : public LLFloater
 	
 	void showNotification(const LLSD& notify);
 
+	BOOL handleHover(S32 x, S32 y, MASK mask);
 	void onMouseLeave(S32 x, S32 y, MASK mask);
 
 protected:
-- 
GitLab


From 28fc3cbadb2b4d46b87938b74d61d5537f6c9701 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 18 Jan 2012 13:35:00 -0800
Subject: [PATCH 594/933] removed some invalid attributes

---
 indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 305ce70fcb7..4bf420b79f9 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -54,8 +54,6 @@
     width="800"
     height="2"/>
 	 <layout_stack
-       use_border="true"
-       bevel_style="none"
        follows="all"
        height="34"
        layout="topleft"
-- 
GitLab


From 852700fbfb6fd751a61f295f5f77afe1e2db38ed Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 18 Jan 2012 15:38:25 -0600
Subject: [PATCH 595/933] SH-2598 Fix for crash when rendering mesh silhouette
 (workaround driver bug by rendering from client memory instead of using face
 VBO).

---
 indra/newview/llselectmgr.cpp | 51 +++++++++++++++++------------------
 1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 5d0d1ef9a3f..6111255a664 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5556,38 +5556,37 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power)
 //helper function for pushing relevant vertices from drawable to GL
 void pushWireframe(LLDrawable* drawable)
 {
-	if (drawable->isState(LLDrawable::RIGGED))
-	{ //render straight from rigged volume if this is a rigged attachment
-		LLVOVolume* vobj = drawable->getVOVolume();
-		if (vobj)
-		{
-			vobj->updateRiggedVolume();
-			LLRiggedVolume* rigged_volume = vobj->getRiggedVolume();
-			if (rigged_volume)
-			{
-				LLVertexBuffer::unbind();
-				gGL.pushMatrix();
-				gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
-				for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i)
-				{
-					const LLVolumeFace& face = rigged_volume->getVolumeFace(i);
-					LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, face.mTexCoords, face.mNumIndices, face.mIndices);
-				}
-				gGL.popMatrix();
-			}
-		}
-	}
-	else
+	LLVOVolume* vobj = drawable->getVOVolume();
+	if (vobj)
 	{
-		for (S32 i = 0; i < drawable->getNumFaces(); ++i)
+		LLVertexBuffer::unbind();
+		gGL.pushMatrix();
+		gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
+
+		LLVolume* volume = NULL;
+
+		if (drawable->isState(LLDrawable::RIGGED))
+		{
+				vobj->updateRiggedVolume();
+				volume = vobj->getRiggedVolume();
+		}
+		else
+		{
+			volume = vobj->getVolume();
+		}
+
+		if (volume)
 		{
-			LLFace* face = drawable->getFace(i);
-			if (face->verify())
+			for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
 			{
-				pushVerts(face, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0);
+				const LLVolumeFace& face = volume->getVolumeFace(i);
+				LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, face.mTexCoords, face.mNumIndices, face.mIndices);
 			}
 		}
+
+		gGL.popMatrix();
 	}
+	
 }
 
 void LLSelectNode::renderOneWireframe(const LLColor4& color)
-- 
GitLab


From 245f29ca2646157958f1a86bd2bae6cb54275223 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 18 Jan 2012 13:39:04 -0800
Subject: [PATCH 596/933] EXP-1550 FIX -- New tag shown and not removed on
 click when rezzing an item from Received Items panel and taking back into
 inventory.

* Inventory folder creation dates are now only set once, rather than being
  updated every time a new item is added.
---
 indra/newview/llfolderviewitem.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index aee5a47011b..8d6114c8873 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -2146,8 +2146,14 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
 	
 	item->dirtyFilter();
 
-	// Update the folder creation date if the child is newer than our current date
-	setCreationDate(llmax<time_t>(mCreationDate, item->getCreationDate()));
+	// Update the folder creation date if the folder has no creation date
+	bool setting_date = false;
+	const time_t item_creation_date = item->getCreationDate();
+	if ((item_creation_date > 0) && (mCreationDate == 0))
+	{
+		setCreationDate(item_creation_date);
+		setting_date = true;
+	}
 
 	// Handle sorting
 	requestArrange();
@@ -2157,8 +2163,11 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
 	LLFolderViewFolder* parentp = getParentFolder();
 	while (parentp)
 	{
-		// Update the folder creation date if the child is newer than our current date
-		parentp->setCreationDate(llmax<time_t>(parentp->mCreationDate, item->getCreationDate()));
+		// Update the parent folder creation date
+		if (setting_date && (parentp->mCreationDate == 0))
+		{
+			parentp->setCreationDate(item_creation_date);
+		}
 
 		if (parentp->mSortFunction.isByDate())
 		{
-- 
GitLab


From 098bbfef99b6a52855af9076837ca521d2cdd525 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 18 Jan 2012 13:53:05 -0800
Subject: [PATCH 597/933] EXP-1704 FIX -- Updated text for Empty Received Items
 panel in Viewer

* Updated to latest text per Leo's comment in the JIRA.
---
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3b00969fd4c..3351ffe00fb 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2037,7 +2037,7 @@ Returns a string with the requested data about the region
 	<string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string>
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
-	<string name="InventoryInboxNoItems">When you purchase or otherwise receive an item, it will appear here so you can drag it to a folder in your inventory, or delete it if you do not wish to keep it.</string>
+	<string name="InventoryInboxNoItems">Certain items you receive, such as premium gifts, will appear here.  You may then drag them into your inventory.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
 	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
-- 
GitLab


From 05cff1ad7f71f6ca74af44bdcf1f119cd5149b93 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 18 Jan 2012 15:26:30 -0700
Subject: [PATCH 598/933] fix for SH-2827: [crashhunters] Crash in
 LLPipeline::generateWaterReflection()

---
 indra/llrender/llrender.cpp | 2 --
 indra/newview/pipeline.cpp  | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 03a9884c2bc..cd827f5091e 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1434,8 +1434,6 @@ void LLRender::loadIdentity()
 	flush();
 
 	{
-		llassert_always(mMatrixMode < NUM_MATRIX_MODES) ;
-
 		mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
 		mMatHash[mMatrixMode]++;
 	}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 8449e74fb6e..737c5b51a2f 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3765,6 +3765,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 	LLAppViewer::instance()->pingMainloopTimeout("Pipeline:ForceVBO");
 	
 	// Initialize lots of GL state to "safe" values
+	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
-- 
GitLab


From 916d61e4600df58329524e59c06d9621cab02393 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 18 Jan 2012 15:59:08 -0800
Subject: [PATCH 599/933] Fix Linux compilation failure

---
 indra/llui/lllayoutstack.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 9909032707a..34d13610b7f 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -417,14 +417,14 @@ void LLLayoutStack::updateLayout()
 		if (mOrientation == HORIZONTAL)
 		{
 			resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap;
-			resize_bar_rect.mRight = panel_rect.mRight + panel_spacing + mResizeBarOverlap;
+			resize_bar_rect.mRight = panel_rect.mRight + (S32)(llround(panel_spacing)) + mResizeBarOverlap;
 
 			cur_pos += panel_visible_dim + panel_spacing;
 		}
 		else //VERTICAL
 		{
 			resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap;
-			resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing - mResizeBarOverlap;
+			resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llround(panel_spacing)) - mResizeBarOverlap;
 
 			cur_pos -= panel_visible_dim + panel_spacing;
 		}
-- 
GitLab


From 3a597af700e55e2017c85220b2b97cc9f3aef9aa Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 18 Jan 2012 16:30:53 -0800
Subject: [PATCH 600/933] EXP-1513 FIX Underscore ( _ ) fails to show in first
 chat entry in Local Chat fixed font metrics rounding error and made
 corrective adjustments in layout

---
 indra/llrender/llfontgl.cpp                    | 18 +++++++++---------
 indra/llui/llmenugl.cpp                        |  8 ++++----
 indra/llui/llscrolllistcell.cpp                |  2 +-
 indra/newview/llfloatermediasettings.cpp       |  6 ++++++
 indra/newview/llfloatermediasettings.h         |  1 +
 indra/newview/llfloatertools.cpp               |  5 ++++-
 indra/newview/llhudrender.cpp                  |  2 +-
 indra/newview/llhudtext.cpp                    |  6 ++----
 indra/newview/llpanelgrouproles.cpp            |  5 ++++-
 indra/newview/llpanelvoiceeffect.cpp           |  1 -
 .../default/xui/en/floater_about_land.xml      |  2 +-
 .../default/xui/en/floater_test_textbox.xml    | 15 ++++++---------
 .../skins/default/xui/en/inspect_object.xml    |  1 +
 .../default/xui/en/panel_navigation_bar.xml    |  5 +++--
 .../default/xui/en/panel_preferences_sound.xml |  2 +-
 .../skins/default/xui/en/widgets/button.xml    |  2 +-
 .../skins/default/xui/en/widgets/check_box.xml |  2 +-
 17 files changed, 46 insertions(+), 37 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 82e8227ffe5..12f86cf5993 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -218,13 +218,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	switch (valign)
 	{
 	case TOP:
-		cur_y -= mFontFreetype->getAscenderHeight();
+		cur_y -= getAscenderHeight();
 		break;
 	case BOTTOM:
-		cur_y += mFontFreetype->getDescenderHeight();
+		cur_y += getDescenderHeight();
 		break;
 	case VCENTER:
-		cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
+		cur_y -= (getAscenderHeight() - getDescenderHeight()) / 2.f;
 		break;
 	case BASELINE:
 		// Baseline, do nothing.
@@ -390,12 +390,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	//FIXME: add underline as glyph?
 	if (style_to_add & UNDERLINE)
 	{
-		F32 descender = mFontFreetype->getDescenderHeight();
+		F32 descender = (F32)llfloor(mFontFreetype->getDescenderHeight());
 
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 		gGL.begin(LLRender::LINES);
-		gGL.vertex2f(start_x, cur_y - (descender));
-		gGL.vertex2f(cur_x, cur_y - (descender));
+		gGL.vertex2f(start_x, cur_y - descender);
+		gGL.vertex2f(cur_x, cur_y - descender);
 		gGL.end();
 	}
 
@@ -446,17 +446,17 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y
 // font metrics - override for LLFontFreetype that returns units of virtual pixels
 F32 LLFontGL::getLineHeight() const
 { 
-	return (F32)llround(mFontFreetype->getLineHeight() / sScaleY); 
+	return (F32)llceil(mFontFreetype->getLineHeight() / sScaleY); 
 }
 
 F32 LLFontGL::getAscenderHeight() const
 { 
-	return (F32)llround(mFontFreetype->getAscenderHeight() / sScaleY); 
+	return (F32)llceil(mFontFreetype->getAscenderHeight() / sScaleY); 
 }
 
 F32 LLFontGL::getDescenderHeight() const
 { 
-	return (F32)llround(mFontFreetype->getDescenderHeight() / sScaleY); 
+	return (F32)llceil(mFontFreetype->getDescenderHeight() / sScaleY); 
 }
 
 S32 LLFontGL::getWidth(const std::string& utf8text) const
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 95ecbb1c947..c624ae2e929 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -508,19 +508,19 @@ void LLMenuItemGL::draw( void )
 	{
 		if( !mDrawBoolLabel.empty() )
 		{
-			mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
+			mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
 						   LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
 		}
-		mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
+		mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
 					   LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
 		if( !mDrawAccelLabel.empty() )
 		{
-			mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
+			mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
 						   LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
 		}
 		if( !mDrawBranchLabel.empty() )
 		{
-			mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
+			mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
 						   LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
 		}
 	}
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 9d25c7180dd..b087602a56b 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -329,7 +329,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
 		break;
 	}
 	mFont->render(mText.getWString(), 0, 
-					start_x, 2.f,
+					start_x, 0.f,
 					display_color,
 					mFontAlignment,
 					LLFontGL::BOTTOM, 
diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp
index 895e16adef7..4f2a6ec1b70 100644
--- a/indra/newview/llfloatermediasettings.cpp
+++ b/indra/newview/llfloatermediasettings.cpp
@@ -312,3 +312,9 @@ bool LLFloaterMediaSettings::haveValuesChanged() const
 	return values_changed;
 }
 
+bool LLFloaterMediaSettings::instanceExists()
+{
+	return LLFloaterReg::findTypedInstance<LLFloaterMediaSettings>("media_settings");
+}
+
+
diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h
index ecc55d2cbc9..1d25530986d 100644
--- a/indra/newview/llfloatermediasettings.h
+++ b/indra/newview/llfloatermediasettings.h
@@ -45,6 +45,7 @@ class LLFloaterMediaSettings :
 	/*virtual*/ void onClose(bool app_quitting);
 
 	static LLFloaterMediaSettings* getInstance();
+	static bool instanceExists();
 	static void apply();
 	static void initValues( const LLSD& media_settings , bool editable);
 	static void clearValues( bool editable);
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index bd5b5f4eb0c..0d37d0857ea 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -1144,7 +1144,7 @@ void LLFloaterTools::updateLandImpacts()
 	childSetTextArg("remaining_capacity", "[CAPACITY_STRING]", remaining_capacity_str);
 
 	// Update land impacts info in the weights floater
-	LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::getTypedInstance<LLFloaterObjectWeights>("object_weights");
+	LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::findTypedInstance<LLFloaterObjectWeights>("object_weights");
 	if(object_weights_floater)
 	{
 		object_weights_floater->updateLandImpacts(parcel);
@@ -1153,6 +1153,8 @@ void LLFloaterTools::updateLandImpacts()
 
 void LLFloaterTools::getMediaState()
 {
+	if (!LLFloaterMediaSettings::instanceExists()) return;
+
 	LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection();
 	LLViewerObject* first_object = selected_objects->getFirstObject();
 	LLTextBox* media_info = getChild<LLTextBox>("media_info");
@@ -1234,6 +1236,7 @@ void LLFloaterTools::getMediaState()
 		}
 	} func;
 	
+	
 	// check if all faces have media(or, all dont have media)
 	LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, bool_has_media );
 	
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp
index 122711a86d2..dff310ecf93 100644
--- a/indra/newview/llhudrender.cpp
+++ b/indra/newview/llhudrender.cpp
@@ -138,7 +138,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
 	LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f));
 	F32 right_x;
 	
-	font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, wstr.length(), 1000, &right_x);
+	font.render(wstr, 0, 0, 1, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, wstr.length(), 1000, &right_x);
 
 	LLUI::popMatrix();
 	gGL.popMatrix();
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 24a876c59ad..f116c8ee6ed 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -227,7 +227,7 @@ void LLHUDText::renderText()
 			 segment_iter != mTextSegments.end(); ++segment_iter )
 		{
 			const LLFontGL* fontp = segment_iter->mFont;
-			y_offset -= fontp->getLineHeight();
+			y_offset -= fontp->getLineHeight() - 1;
 
 			U8 style = segment_iter->mStyle;
 			LLFontGL::ShadowType shadow = LLFontGL::DROP_SHADOW;
@@ -480,8 +480,6 @@ void LLHUDText::updateSize()
 	F32 width = 0.f;
 
 	S32 max_lines = getMaxLines();
-	//S32 lines = (max_lines < 0) ? (S32)mTextSegments.size() : llmin((S32)mTextSegments.size(), max_lines);
-	//F32 height = (F32)mFontp->getLineHeight() * (lines + mLabelSegments.size());
 
 	S32 start_segment;
 	if (max_lines < 0) start_segment = 0;
@@ -491,7 +489,7 @@ void LLHUDText::updateSize()
 	while (iter != mTextSegments.end())
 	{
 		const LLFontGL* fontp = iter->mFont;
-		height += fontp->getLineHeight();
+		height += fontp->getLineHeight() - 1;
 		width = llmax(width, llmin(iter->getWidth(fontp), HUD_TEXT_MAX_WIDTH));
 		++iter;
 	}
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index fbe331c7ab9..f825ee3215b 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -749,7 +749,10 @@ LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab()
 
 LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab()
 {
-	gSavedSettings.setString("GroupMembersSortOrder", mMembersList->getSortColumnName());
+	if (mMembersList)
+	{
+		gSavedSettings.setString("GroupMembersSortOrder", mMembersList->getSortColumnName());
+	}
 }
 
 BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp
index 4bbfec8ab71..5fec6d967d4 100644
--- a/indra/newview/llpanelvoiceeffect.cpp
+++ b/indra/newview/llpanelvoiceeffect.cpp
@@ -123,7 +123,6 @@ void LLPanelVoiceEffect::update(bool list_updated)
 	if (mVoiceEffectCombo)
 	{
 		LLVoiceEffectInterface* effect_interface = LLVoiceClient::instance().getVoiceEffectInterface();
-		llassert(effect_interface);
 		if (!effect_interface) return;
 		if (list_updated)
 		{
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index d198cd65a87..28538f78525 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -192,7 +192,7 @@
              type="string"
              length="1"
              follows="left|top"
-             height="20"
+             height="18"
              layout="topleft"
              left_pad="2"
              valign="center" 
diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml
index 2df9bb35fe8..3d1bc0edae5 100644
--- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml
@@ -14,15 +14,12 @@
      height="90"
      layout="topleft"
      left="10"
+     valign="bottom"
+     clip="true"
      top_pad="30"
      width="300">
-        First line of multiple lines
-Second line of multiple lines
-Third line of multiple lines
-Fourth line of multiple lines
-Fifth line of multiple lines
-    </text>
-  <text
+___</text>
+  <!--<text
     clip_partial="true"
     top_pad="10"
     left="10"
@@ -153,7 +150,7 @@ Fifth line of multiple lines
     The 华文细黑 brown fox ヒラキjumped over the lazy dog.
   </text>
   
-<!-- next column -->
+--><!-- next column --><!--
   <text_editor
  height="50"
  follows="top|left|bottom"
@@ -250,5 +247,5 @@ with
 multiple lines
 and too many lines
 to actually fit
-  </text>
+  </text>-->
 </floater>
diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml
index 8d14c974b43..b122e1bcff5 100644
--- a/indra/newview/skins/default/xui/en/inspect_object.xml
+++ b/indra/newview/skins/default/xui/en/inspect_object.xml
@@ -90,6 +90,7 @@ L$30,000
    follows="all"
    font="SansSerifSmall"
    height="13"
+   clip="false"
    name="object_media_url"
    width="207"
    left_pad="2"
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 4bf420b79f9..bb942f2c819 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -174,13 +174,14 @@
              width="311">
             <label
              follows="left|top"
-             height="15"
+             height="13"
              layout="topleft"
              left="10"
              name="favorites_bar_label"
              text_color="LtGray"
              tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-             top="12"
+             top="13"
+	     valign="bottom"
              width="102">
               Favorites Bar
             </label>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
index 1f92244eb97..b71586aab16 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
@@ -63,7 +63,7 @@
       layout="topleft"
       left_pad="0"
       name="mute_chb_label"
-      top_delta="0"
+      top_delta="-1"
       width="150"
       wrap="true">
       Mute when minimized
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index e2baba92a3a..589117fe4cc 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -21,7 +21,7 @@
         font="SansSerifSmall"
         hover_glow_amount="0.15"
         halign="center"
-        pad_bottom="3" 
+        pad_bottom="2" 
         height="23"
         scale_image="true"
         handle_right_mouse="true"
diff --git a/indra/newview/skins/default/xui/en/widgets/check_box.xml b/indra/newview/skins/default/xui/en/widgets/check_box.xml
index cca64fad2a7..8947024e458 100644
--- a/indra/newview/skins/default/xui/en/widgets/check_box.xml
+++ b/indra/newview/skins/default/xui/en/widgets/check_box.xml
@@ -10,7 +10,7 @@
                         text_readonly_color="LabelDisabledColor"/>
   <check_box.check_button name="CheckboxCtrl Button"
                           left="2"
-                          bottom="2"
+                          bottom="1"
                           width="13"
                           height="13" 
                           commit_on_return="false"
-- 
GitLab


From 02641d4ef33fd6f296a9a29700ecdd55ef9dffd8 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 18 Jan 2012 16:32:07 -0800
Subject: [PATCH 601/933] Fix a Linux compilation failure

---
 indra/llui/lllayoutstack.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 9909032707a..34d13610b7f 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -417,14 +417,14 @@ void LLLayoutStack::updateLayout()
 		if (mOrientation == HORIZONTAL)
 		{
 			resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap;
-			resize_bar_rect.mRight = panel_rect.mRight + panel_spacing + mResizeBarOverlap;
+			resize_bar_rect.mRight = panel_rect.mRight + (S32)(llround(panel_spacing)) + mResizeBarOverlap;
 
 			cur_pos += panel_visible_dim + panel_spacing;
 		}
 		else //VERTICAL
 		{
 			resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap;
-			resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing - mResizeBarOverlap;
+			resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llround(panel_spacing)) - mResizeBarOverlap;
 
 			cur_pos -= panel_visible_dim + panel_spacing;
 		}
-- 
GitLab


From 86dc7c4f6dc2a63640b9798a2c41d5e70916d1e0 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 18 Jan 2012 16:32:37 -0800
Subject: [PATCH 602/933] added comments to magic numbers

---
 indra/newview/llhudtext.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index f116c8ee6ed..579b6008ae8 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -227,7 +227,7 @@ void LLHUDText::renderText()
 			 segment_iter != mTextSegments.end(); ++segment_iter )
 		{
 			const LLFontGL* fontp = segment_iter->mFont;
-			y_offset -= fontp->getLineHeight() - 1;
+			y_offset -= fontp->getLineHeight() - 1; // correction factor to match legacy font metrics
 
 			U8 style = segment_iter->mStyle;
 			LLFontGL::ShadowType shadow = LLFontGL::DROP_SHADOW;
@@ -489,7 +489,7 @@ void LLHUDText::updateSize()
 	while (iter != mTextSegments.end())
 	{
 		const LLFontGL* fontp = iter->mFont;
-		height += fontp->getLineHeight() - 1;
+		height += fontp->getLineHeight() - 1; // correction factor to match legacy font metrics
 		width = llmax(width, llmin(iter->getWidth(fontp), HUD_TEXT_MAX_WIDTH));
 		++iter;
 	}
-- 
GitLab


From 19320842ebc39c1b528a2107323f9e918d688177 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 19 Jan 2012 16:57:09 +0200
Subject: [PATCH 603/933] EXP-1767 FIXED Received Items panel state being
 persistent between sessions. Added a setting to store the panel state.

---
 indra/newview/app_settings/settings.xml               | 11 +++++++++++
 indra/newview/llsidepanelinventory.cpp                | 10 ++++++----
 .../skins/default/xui/en/sidepanel_inventory.xml      |  1 +
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 28ba9fd704b..62b8052a507 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4259,6 +4259,17 @@
         <string>Boolean</string>
         <key>Value</key>
         <integer>0</integer>
+    </map>
+    <key>InventoryInboxToggleState</key>
+    <map>
+        <key>Comment</key>
+        <string>Stores the open/closed state of inventory Received items panel</string>
+        <key>Persist</key>
+        <integer>1</integer>
+        <key>Type</key>
+        <string>Boolean</string>
+        <key>Value</key>
+        <integer>0</integer>
     </map>
 	<key>InventoryLinking</key>
 	<map>
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 3761eb57772..e1043c34c71 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -220,15 +220,17 @@ BOOL LLSidepanelInventory::postBuild()
 		// Disable user_resize on main inventory panel by default
 		inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false);
 
-		// Collapse inbox panel
-		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
-		
 		// Set up button states and callbacks
 		LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME);
 
-		inbox_button->setToggleState(false);
 		inbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this));
 
+		// Get the previous inbox state from "InventoryInboxToggleState" setting.
+		bool is_inbox_collapsed = !inbox_button->getToggleState();
+
+		// Restore the collapsed inbox panel state
+		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), is_inbox_collapsed);
+
 		// Set the inbox visible based on debug settings (final setting comes from http request below)
 		enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
 
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index fcba937bdbb..1e06a60f554 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -73,6 +73,7 @@
                      <string name="InboxLabelWithArg">Received items ([NUM])</string>
                      <string name="InboxLabelNoArg">Received items</string>
                      <button
+                        control_name="InventoryInboxToggleState"
                         label="Received items"
 						font="SansSerifMedium"
                         name="inbox_btn"
-- 
GitLab


From f42c3ff51abf4bd33888765630f5491f6d2014b0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 19 Jan 2012 11:10:22 -0600
Subject: [PATCH 604/933] SH-2885 Add mesh requests pending/processing line to
 "Show Render Info"

---
 indra/newview/llmeshrepository.cpp | 8 ++++++++
 indra/newview/llmeshrepository.h   | 2 ++
 indra/newview/llviewerwindow.cpp   | 4 +++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a97e256c899..1d0c262190c 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -88,6 +88,9 @@ const S32 MAX_MESH_VERSION = 999;
 U32 LLMeshRepository::sBytesReceived = 0;
 U32 LLMeshRepository::sHTTPRequestCount = 0;
 U32 LLMeshRepository::sHTTPRetryCount = 0;
+U32 LLMeshRepository::sLODProcessing = 0;
+U32 LLMeshRepository::sLODPending = 0;
+
 U32 LLMeshRepository::sCacheBytesRead = 0;
 U32 LLMeshRepository::sCacheBytesWritten = 0;
 U32 LLMeshRepository::sPeakKbps = 0;
@@ -497,6 +500,7 @@ void LLMeshRepoThread::run()
 					mMutex->lock();
 					LODRequest req = mLODReqQ.front();
 					mLODReqQ.pop();
+					LLMeshRepository::sLODProcessing--;
 					mMutex->unlock();
 					if (fetchMeshLOD(req.mMeshParams, req.mLOD))
 					{
@@ -603,6 +607,7 @@ void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 		{
 			LLMutexLock lock(mMutex);
 			mLODReqQ.push(req);
+			LLMeshRepository::sLODProcessing++;
 		}
 	}
 	else
@@ -1045,6 +1050,7 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
 			{
 				LODRequest req(mesh_params, iter->second[i]);
 				mLODReqQ.push(req);
+				LLMeshRepository::sLODProcessing++;
 			}
 		}
 		mPendingLOD.erase(iter);
@@ -2147,6 +2153,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 			//first request for this mesh
 			mLoadingMeshes[detail][mesh_params].insert(vobj->getID());
 			mPendingRequests.push_back(LLMeshRepoThread::LODRequest(mesh_params, detail));
+			LLMeshRepository::sLODPending++;
 		}
 	}
 
@@ -2359,6 +2366,7 @@ void LLMeshRepository::notifyLoadedMeshes()
 			LLMeshRepoThread::LODRequest& request = mPendingRequests.front();
 			mThread->loadMeshLOD(request.mMeshParams, request.mLOD);
 			mPendingRequests.erase(mPendingRequests.begin());
+			LLMeshRepository::sLODPending--;
 			push_count--;
 		}
 	}
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 31b84ea0d9f..1bdbc2856b0 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -441,6 +441,8 @@ class LLMeshRepository
 	static U32 sBytesReceived;
 	static U32 sHTTPRequestCount;
 	static U32 sHTTPRetryCount;
+	static U32 sLODPending;
+	static U32 sLODProcessing;
 	static U32 sCacheBytesRead;
 	static U32 sCacheBytesWritten;
 	static U32 sPeakKbps;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index bf698e02d2e..0534246559c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -613,7 +613,9 @@ class LLDebugText
 				
 				addText(xpos, ypos, llformat("%d/%d Mesh HTTP Requests/Retries", LLMeshRepository::sHTTPRequestCount,
 					LLMeshRepository::sHTTPRetryCount));
-				
+				ypos += y_inc;
+
+				addText(xpos, ypos, llformat("%d/%d Mesh LOD Pending/Processing", LLMeshRepository::sLODPending, LLMeshRepository::sLODProcessing));
 				ypos += y_inc;
 
 				addText(xpos, ypos, llformat("%.3f/%.3f MB Mesh Cache Read/Write ", LLMeshRepository::sCacheBytesRead/(1024.f*1024.f), LLMeshRepository::sCacheBytesWritten/(1024.f*1024.f)));
-- 
GitLab


From c437c3b5b50fa05727435a37c37f79c34428d2a7 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 19 Jan 2012 20:34:31 +0200
Subject: [PATCH 605/933] EXP-1815 FIXED Favorites list in login screen not
 populated when display names are disabled.

* Fixed LLAvatarName::getLegacyName() to work when display names are disabled
  (it used to return ' ', i.e. empty first and last name separated with a space).
* Added some debugging messages.
---
 indra/llcommon/llavatarname.cpp     |  5 +++++
 indra/newview/llpanellogin.cpp      | 16 ++++++++++++----
 indra/newview/llviewerinventory.cpp | 21 +++++++++++++++++++--
 3 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index ba3dd6d6b4c..3206843bf4a 100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -106,6 +106,11 @@ std::string LLAvatarName::getCompleteName() const
 
 std::string LLAvatarName::getLegacyName() const
 {
+	if (mLegacyFirstName.empty() && mLegacyLastName.empty()) // display names disabled?
+	{
+		return mDisplayName;
+	}
+
 	std::string name;
 	name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() );
 	name = mLegacyFirstName;
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 058d1ad6bc9..76aadcd9138 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -216,6 +216,7 @@ void LLPanelLogin::addUsersWithFavoritesToUsername()
 
 void LLPanelLogin::addFavoritesToStartLocation()
 {
+	// Clear the combo.
 	LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
 	if (!combo) return;
 	int num_items = combo->getItemCount();
@@ -223,6 +224,10 @@ void LLPanelLogin::addFavoritesToStartLocation()
 	{
 		combo->remove(i);
 	}
+
+	// Load favorites into the combo.
+	std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
+	std::string canonical_user_name = canonicalize_username(user_defined_name);
 	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
 	LLSD fav_llsd;
 	llifstream file;
@@ -232,15 +237,18 @@ void LLPanelLogin::addFavoritesToStartLocation()
 	for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
 		iter != fav_llsd.endMap(); ++iter)
 	{
-		std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
-
 		// The account name in stored_favorites.xml has Resident last name even if user has
 		// a single word account name, so it can be compared case-insensitive with the
 		// user defined "firstname lastname".
-		S32 res = LLStringUtil::compareInsensitive(canonicalize_username(user_defined_name), iter->first);
-		if (res != 0) continue;
+		S32 res = LLStringUtil::compareInsensitive(canonical_user_name, iter->first);
+		if (res != 0)
+		{
+			lldebugs << "Skipping favorites for " << iter->first << llendl;
+			continue;
+		}
 
 		combo->addSeparator();
+		lldebugs << "Loading favorites for " << iter->first << llendl;
 		LLSD user_llsd = iter->second;
 		for (LLSD::array_const_iterator iter1 = user_llsd.beginArray();
 			iter1 != user_llsd.endArray(); ++iter1)
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 163581ea7fe..cf52b5165b2 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1462,6 +1462,7 @@ const std::string& LLViewerInventoryItem::getName() const
 class LLFavoritesOrderStorage : public LLSingleton<LLFavoritesOrderStorage>
 	, public LLDestroyClass<LLFavoritesOrderStorage>
 {
+	LOG_CLASS(LLFavoritesOrderStorage);
 public:
 	/**
 	 * Sets sort index for specified with LLUUID favorite landmark
@@ -1620,10 +1621,18 @@ void LLFavoritesOrderStorage::load()
 void LLFavoritesOrderStorage::saveFavoritesSLURLs()
 {
 	// Do not change the file if we are not logged in yet.
-	if (!LLLoginInstance::getInstance()->authSuccess()) return;
+	if (!LLLoginInstance::getInstance()->authSuccess())
+	{
+		llwarns << "Cannot save favorites: not logged in" << llendl;
+		return;
+	}
 	
 	std::string user_dir = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "");
-	if (user_dir.empty()) return;
+	if (user_dir.empty())
+	{
+		llwarns << "Cannot save favorites: empty user dir name" << llendl;
+		return;
+	}
 
 	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
 	llifstream in_file;
@@ -1649,13 +1658,19 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
 		slurls_map_t::iterator slurl_iter = mSLURLs.find(value["asset_id"]);
 		if (slurl_iter != mSLURLs.end())
 		{
+			lldebugs << "Saving favorite: idx=" << (*it)->getSortField() << ", SLURL=" <<  slurl_iter->second << ", value=" << value << llendl;
 			value["slurl"] = slurl_iter->second;
 			user_llsd[(*it)->getSortField()] = value;
 		}
+		else
+		{
+			llwarns << "Not saving favorite " << value["name"] << ": no matching SLURL" << llendl;
+		}
 	}
 
 	LLAvatarName av_name;
 	LLAvatarNameCache::get( gAgentID, &av_name );
+	lldebugs << "Saved favorites for " << av_name.getLegacyName() << llendl;
 	fav_llsd[av_name.getLegacyName()] = user_llsd;
 
 	llofstream file;
@@ -1674,6 +1689,7 @@ void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
 
 	LLAvatarName av_name;
 	LLAvatarNameCache::get( gAgentID, &av_name );
+	lldebugs << "Removed favorites for " << av_name.getLegacyName() << llendl;
 	if (fav_llsd.has(av_name.getLegacyName()))
 	{
 		fav_llsd.erase(av_name.getLegacyName());
@@ -1706,6 +1722,7 @@ void LLFavoritesOrderStorage::onLandmarkLoaded(const LLUUID& asset_id, LLLandmar
 
 void LLFavoritesOrderStorage::storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl)
 {
+	lldebugs << "Saving landmark SLURL: " << slurl << llendl;
 	mSLURLs[asset_id] = slurl;
 }
 
-- 
GitLab


From f7cee997df9d7ca40aa40f56c87ff3968821d13a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 19 Jan 2012 12:40:44 -0600
Subject: [PATCH 606/933] SH-2779 Fix for some transparent rigged attachments
 not being rendered correctly.

---
 indra/newview/lldrawpoolavatar.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index e75e34df066..b002c11af52 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1319,7 +1319,9 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 		LLMatrix3 mat_normal(mat3);				
 
 		//let getGeometryVolume know if alpha should override shiny
-		if (face->getFaceColor().mV[3] < 1.f)
+		U32 type = gPipeline.getPoolTypeFromTE(face->getTextureEntry(), face->getTexture());
+
+		if (type == LLDrawPool::POOL_ALPHA)
 		{
 			face->setPoolType(LLDrawPool::POOL_ALPHA);
 		}
-- 
GitLab


From 25610423cf732aec40c719f7e6c18e4c06968376 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 19 Jan 2012 15:33:48 -0500
Subject: [PATCH 607/933] STORM-1718 For notifications.xml Mute and Ignore in
 ScriptDialog and ScriptDialogGroup can collide with user-supplied fields
 causing unexpected behavior

---
 doc/contributions.txt                                | 1 +
 indra/newview/skins/default/xui/en/notifications.xml | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 9f6de781b41..e294afbbd23 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -589,6 +589,7 @@ Jonathan Yap
 	STORM-1659
 	STORM-1674
 	STORM-1685
+	STORM-1718
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e4458f33b17..9e3962ac864 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6354,11 +6354,11 @@ Grant this request?
     <form name="form">
       <button
        index="-2"
-       name="Mute"
+       name="Client_Side_Mute"
        text="Block"/>
       <button
        index="-1"
-       name="Ignore"
+       name="Client_Side_Ignore"
        text="Ignore"/>
     </form>
   </notification>
@@ -6373,11 +6373,11 @@ Grant this request?
     <form name="form">
       <button
        index="-2"
-       name="Mute"
+       name="Client_Side_Mute"
        text="Block"/>
       <button
        index="-1"
-       name="Ignore"
+       name="Client_Side_Ignore"
        text="Ignore"/>
     </form>
   </notification>
-- 
GitLab


From 810b0286a93ae03d3d986a12a8dec352a7e511d9 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Thu, 19 Jan 2012 15:43:12 -0500
Subject: [PATCH 608/933] Added tag DRTVWR-111_3.2.7-beta1, 3.2.7-beta1 for
 changeset 3d75c836d178

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 7de138937e0..f3deea990ea 100644
--- a/.hgtags
+++ b/.hgtags
@@ -254,3 +254,5 @@ bd6bcde2584491fd9228f1fa51c4575f4e764e19 3.2.4-release
 c6175c955a19e9b9353d242889ec1779b5762522 DRTVWR-105_3.2.5-release
 c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 4891c46a56fed7512c783b9cbe7cb7260727bf0c 3.2.7-start
+3d75c836d178c7c7e788f256afe195f6cab764a2 DRTVWR-111_3.2.7-beta1
+3d75c836d178c7c7e788f256afe195f6cab764a2 3.2.7-beta1
-- 
GitLab


From 655505d304fb527df61ee8222904940ad6c70db8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 19 Jan 2012 14:57:07 -0600
Subject: [PATCH 609/933] SH-2794 Fix for bad textures on some hardware when
 vbo mapping disabled (always use GL_STREAM_DRAW as the usage hint when
 mapping is disabled as geometry will be uploaded again and again)

---
 indra/llrender/llvertexbuffer.cpp | 19 ++++++++++++++++---
 indra/llrender/llvertexbuffer.h   |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 62be5c73685..eb302392bb1 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -166,13 +166,18 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size)
 		//make a new buffer
 		glGenBuffersARB(1, &name);
 		glBindBufferARB(mType, name);
-		glBufferDataARB(mType, size, 0, mUsage);
 		LLVertexBuffer::sAllocatedBytes += size;
 
 		if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB)
 		{
+			glBufferDataARB(mType, size, 0, mUsage);
 			ret = (U8*) ll_aligned_malloc_16(size);
 		}
+		else
+		{ //always use a true hint of static draw when allocating non-client-backed buffers
+			glBufferDataARB(mType, size, 0, GL_STATIC_DRAW_ARB);
+		}
+
 		glBindBufferARB(mType, 0);
 	}
 	else
@@ -794,9 +799,17 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 
 	if (mUsage && mUsage != GL_STREAM_DRAW_ARB)
 	{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
-		mUsage = GL_DYNAMIC_DRAW_ARB;
+		if (sDisableVBOMapping)
+		{ //always use stream draw if VBO mapping is disabled
+			mUsage = GL_STREAM_DRAW_ARB;
+		}
+		else
+		{
+			mUsage = GL_DYNAMIC_DRAW_ARB;
+		}
 	}
-		
+	
+
 	if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
 	{
 		mMappable = TRUE;
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index dde2b7e152e..e1cbfd3b619 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -254,7 +254,7 @@ class LLVertexBuffer : public LLRefCount
 	volatile U8* getMappedIndices() const			{ return mMappedIndexData; }
 	S32 getOffset(S32 type) const			{ return mOffsets[type]; }
 	S32 getUsage() const					{ return mUsage; }
-	BOOL isWriteable() const				{ return (sDisableVBOMapping || mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
+	BOOL isWriteable() const				{ return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
 
 	void draw(U32 mode, U32 count, U32 indices_offset) const;
 	void drawArrays(U32 mode, U32 offset, U32 count) const;
-- 
GitLab


From bb79bbf3209fbb962ca1b284076738eb5ba6019c Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 19 Jan 2012 13:53:48 -0800
Subject: [PATCH 610/933] EXP-1827 FIX -- Drag area in outbox does not always
 highlight green when indicating a top level drop

* Updated the outbox drop area highlight to include top level drops within the
  outbox inventory panel itself.
---
 indra/newview/llfloateroutbox.cpp | 55 ++++++++++++-------------------
 1 file changed, 21 insertions(+), 34 deletions(-)

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 08cd8082aac..540f977305f 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -376,44 +376,37 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 	
 	LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 	BOOL handled = (handled_view != NULL);
+
+	// Determine if the mouse is inside the inventory panel itself or just within the floater
+	bool pointInInventoryPanel = false;
+	bool pointInInventoryPanelChild = false;
+	LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder();
+	if (mOutboxInventoryPanel->getVisible())
+	{
+		S32 inv_x, inv_y;
+		localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel);
+
+		pointInInventoryPanel = mOutboxInventoryPanel->getRect().pointInRect(inv_x, inv_y);
+
+		LLView * inventory_panel_child_at_point = mOutboxInventoryPanel->childFromPoint(inv_x, inv_y, true);
+		pointInInventoryPanelChild = (inventory_panel_child_at_point != root_folder);
+	}
 	
 	// Pass all drag and drop for this floater to the outbox inventory control
 	if (!handled || !isAccepted(*accept))
 	{
-		// Always assume we are going to move the drag and drop operation to the outbox root folder
-		bool move_to_root = true;
-		
-		// If the inventory panel is visible, then only override it to the outbox root if we're outside the inventory panel
+		// Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel
 		// (otherwise the inventory panel itself will handle the drag and drop operation, without any override)
-		if (mOutboxInventoryPanel->getVisible())
-		{
-			S32 inv_x, inv_y;
-			localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel);
-			
-			const LLRect& inv_rect = mOutboxInventoryPanel->getRect();
-
-			move_to_root = !inv_rect.pointInRect(inv_x, inv_y);
-		}
-		
-		// Handle the drag and drop directly to the root of the outbox
-		if (move_to_root)
+		if (!pointInInventoryPanel)
 		{
-			LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder();
-			
 			handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 		}
 
-		if (mOutboxTopLevelDropZone)
-		{
-			mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept));
-		}
+		mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept));
 	}
 	else
 	{
-		if (mOutboxTopLevelDropZone)
-		{
-			mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
-		}
+		mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild);
 	}
 	
 	return handled;
@@ -421,20 +414,14 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 
 BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask)
 {
-	if (mOutboxTopLevelDropZone)
-	{
-		mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
-	}
+	mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
 
 	return LLFloater::handleHover(x, y, mask);
 }
 
 void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask)
 {
-	if (mOutboxTopLevelDropZone)
-	{
-		mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
-	}
+	mOutboxTopLevelDropZone->setBackgroundVisible(FALSE);
 
 	LLFloater::onMouseLeave(x, y, mask);
 }
-- 
GitLab


From 00fc2d5a5c24b1cf2aedd81090bf769207fbf41b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 19 Jan 2012 13:54:32 -0800
Subject: [PATCH 611/933] * Added member variables to avoid several per-frame
 getChild calls.

---
 indra/newview/llpanelmarketplaceinbox.cpp | 19 ++++++++++++-------
 indra/newview/llpanelmarketplaceinbox.h   |  7 +++++--
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp
index a5e964f5633..66c9c323cb7 100644
--- a/indra/newview/llpanelmarketplaceinbox.cpp
+++ b/indra/newview/llpanelmarketplaceinbox.cpp
@@ -48,6 +48,8 @@ const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams
 // protected
 LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
 	: LLPanel(p)
+	, mFreshCountCtrl(NULL)
+	, mInboxButton(NULL)
 	, mInventoryPanel(NULL)
 {
 }
@@ -60,6 +62,9 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
 BOOL LLPanelMarketplaceInbox::postBuild()
 {
 	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this));
+
+	mFreshCountCtrl = getChild<LLUICtrl>("inbox_fresh_new_count");
+	mInboxButton = getChild<LLButton>("inbox_btn");
 	
 	return TRUE;
 }
@@ -216,7 +221,7 @@ void LLPanelMarketplaceInbox::draw()
 {
 	U32 item_count = getTotalItemCount();
 
-	LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count");
+	llassert(mFreshCountCtrl != NULL);
 
 	if (item_count > 0)
 	{
@@ -224,26 +229,26 @@ void LLPanelMarketplaceInbox::draw()
 
 		LLStringUtil::format_map_t args;
 		args["[NUM]"] = item_count_str;
-		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args));
+		mInboxButton->setLabel(getString("InboxLabelWithArg", args));
 
 #if SUPPORTING_FRESH_ITEM_COUNT
 		// set green text to fresh item count
 		U32 fresh_item_count = getFreshItemCount();
-		fresh_new_count_view->setVisible((fresh_item_count > 0));
+		mFreshCountCtrl->setVisible((fresh_item_count > 0));
 
 		if (fresh_item_count > 0)
 		{
-			getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));
+			mFreshCountCtrl->setTextArg("[NUM]", llformat("%d", fresh_item_count));
 		}
 #else
-		fresh_new_count_view->setVisible(FALSE);
+		mFreshCountCtrl->setVisible(FALSE);
 #endif
 	}
 	else
 	{
-		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg"));
+		mInboxButton->setLabel(getString("InboxLabelNoArg"));
 
-		fresh_new_count_view->setVisible(FALSE);
+		mFreshCountCtrl->setVisible(FALSE);
 	}
 		
 	LLPanel::draw();
diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h
index 3531518e518..9eb74581a2f 100644
--- a/indra/newview/llpanelmarketplaceinbox.h
+++ b/indra/newview/llpanelmarketplaceinbox.h
@@ -29,7 +29,9 @@
 
 #include "llpanel.h"
 
+class LLButton;
 class LLInventoryPanel;
+class LLUICtrl;
 
 class LLPanelMarketplaceInbox : public LLPanel
 {
@@ -66,9 +68,10 @@ class LLPanelMarketplaceInbox : public LLPanel
 	void onFocusReceived();
 
 private:
-	LLInventoryPanel* mInventoryPanel;
+	LLUICtrl *			mFreshCountCtrl;
+	LLButton *			mInboxButton;
+	LLInventoryPanel *	mInventoryPanel;
 };
 
 
 #endif //LL_LLPANELMARKETPLACEINBOX_H
-
-- 
GitLab


From bcdecbdae1510a55d5406a85786bab399e180cac Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 19 Jan 2012 14:23:01 -0800
Subject: [PATCH 612/933] EXP-1828 FIX -- Drag and drop to an open folder in
 the outbox causes it to close automatically

* Updated auto-open behavior to ignore items that are already open.
---
 indra/newview/llfolderview.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 6bf0f09747b..e0d7d67f7d7 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1199,7 +1199,9 @@ void LLFolderView::changeType(LLInventoryModel *model, LLFolderType::EType new_f
 
 void LLFolderView::autoOpenItem( LLFolderViewFolder* item )
 {
-	if (mAutoOpenItems.check() == item || mAutoOpenItems.getDepth() >= (U32)AUTO_OPEN_STACK_DEPTH)
+	if ((mAutoOpenItems.check() == item) || 
+		(mAutoOpenItems.getDepth() >= (U32)AUTO_OPEN_STACK_DEPTH) ||
+		item->isOpen())
 	{
 		return;
 	}
-- 
GitLab


From 216ac700431af0ab7ee45ec5fef03c928f235063 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 19 Jan 2012 15:24:29 -0800
Subject: [PATCH 613/933] EXP-1829 FIX -- Selecting a valid item last allows
 other selected invalid items to be copied to Outbox with context menu option

* Updated context menu default enabled state to use the last state rather than
  TRUE.  Once per frame, the states are all reset to TRUE so this has the effect
  of AND'ing together successive buildContextMenu functions rather than ignoring
  previous states.
---
 indra/newview/llinventorybridge.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3929183be20..12322b29211 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -471,7 +471,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 
 void hide_context_entries(LLMenuGL& menu, 
 						  const menuentry_vec_t &entries_to_show,
-						  const menuentry_vec_t &disabled_entries) // If append is TRUE, then new enabled entries 
+						  const menuentry_vec_t &disabled_entries)
 {
 	const LLView::child_list_t *list = menu.getChildList();
 
@@ -493,7 +493,6 @@ void hide_context_entries(LLMenuGL& menu,
 			hide_context_entries(*branchp->getBranch(), entries_to_show, disabled_entries);
 		}
 
-
 		bool found = false;
 		menuentry_vec_t::const_iterator itor2;
 		for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2)
@@ -529,7 +528,7 @@ void hide_context_entries(LLMenuGL& menu,
 			// so that some other UI element from multi-select doesn't later set this invisible.
 			menu_item->pushVisible(TRUE);
 
-			BOOL enabled = TRUE;
+			BOOL enabled = menu_item->getEnabled();
 			for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2)
 			{
 				if (*itor2 == name)
-- 
GitLab


From 3e06171eff0cbddd99e3833d73c40937af346754 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Thu, 19 Jan 2012 17:06:44 -0800
Subject: [PATCH 614/933] EXP-1507 FIX Viewer 3 displays planar texture repeat
 values in Build floater asdouble

---
 indra/newview/llpanelface.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index a4f6921f987..7301b305b2d 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -875,8 +875,15 @@ void LLPanelFace::getState()
 			{
 				getChild<LLUICtrl>("TexScaleU")->setValue(2.0f * getChild<LLUICtrl>("TexScaleU")->getValue().asReal() );
 				getChild<LLUICtrl>("TexScaleV")->setValue(2.0f * getChild<LLUICtrl>("TexScaleV")->getValue().asReal() );
-			}
 
+				// EXP-1507 (change label based on the mapping mode)
+				getChild<LLUICtrl>("rpt")->setValue(getString("string repeats per meter"));
+			}
+			else
+			if (selected_texgen == 0)  // FIXME: should not be magic numbers
+			{
+				getChild<LLUICtrl>("rpt")->setValue(getString("string repeats per face"));
+			}
 		}
 
 		{
-- 
GitLab


From a662b888ed02691b7790c23e31c7d8bcf7cf7f5b Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Jan 2012 19:40:46 -0800
Subject: [PATCH 615/933] EXP-1824 FIX Received Items panel does not collapse
 correct when Height of panel is maximized in Inventory window

---
 indra/llui/lllayoutstack.cpp           | 120 +++++++++++++------------
 indra/llui/lllayoutstack.h             |  12 ++-
 indra/llui/llscrollcontainer.cpp       |  99 ++++++++++----------
 indra/llui/llwindowshade.cpp           |   2 +-
 indra/newview/llsidepanelinventory.cpp |   2 +-
 5 files changed, 123 insertions(+), 112 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 34d13610b7f..073592b6ecf 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -36,6 +36,9 @@
 #include "llcriticaldamp.h"
 #include "boost/foreach.hpp"
 
+static const F32 MIN_FRACTIONAL_SIZE = 0.0001f;
+static const F32 MAX_FRACTIONAL_SIZE = 1.f;
+
 static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
 static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
 
@@ -60,7 +63,6 @@ LLLayoutPanel::Params::Params()
 
 LLLayoutPanel::LLLayoutPanel(const Params& p)	
 :	LLPanel(p),
-	mExpandedMinDimSpecified(false),
 	mExpandedMinDim(p.min_dim),
  	mMinDim(p.min_dim), 
  	mAutoResize(p.auto_resize),
@@ -69,7 +71,7 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
 	mCollapseAmt(0.f),
 	mVisibleAmt(1.f), // default to fully visible
 	mResizeBar(NULL),
-	mFractionalSize(0.f),
+	mFractionalSize(MIN_FRACTIONAL_SIZE),
 	mTargetDim(0),
 	mIgnoreReshape(false),
 	mOrientation(LLLayoutStack::HORIZONTAL)
@@ -77,7 +79,6 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
 	// Set the expanded min dim if it is provided, otherwise it gets the p.min_dim value
 	if (p.expanded_min_dim.isProvided())
 	{
-		mExpandedMinDimSpecified = true;
 		mExpandedMinDim = p.expanded_min_dim();
 	}
 	
@@ -134,18 +135,6 @@ void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientatio
 		? getRect().getWidth()
 		: getRect().getHeight()));
 
-	if (mMinDim == -1)
-	{
-		if (!mAutoResize)
-		{
-			setMinDim(layout_dim);
-		}
-		else
-		{
-			setMinDim(0);
-		}
-	}
-
 	mTargetDim = llmax(layout_dim, getMinDim());
 }
  
@@ -164,6 +153,8 @@ void LLLayoutPanel::setVisible( BOOL visible )
 
 void LLLayoutPanel::reshape( S32 width, S32 height, BOOL called_from_parent /*= TRUE*/ )
 {
+	if (width == getRect().getWidth() && height == getRect().getHeight()) return;
+
 	if (!mIgnoreReshape && !mAutoResize)
 	{
 		mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height;
@@ -347,6 +338,7 @@ void LLLayoutStack::updateLayout()
 
 	bool animation_in_progress = animatePanels();
 	F32 total_visible_fraction = 0.f;
+	F32 total_open_fraction = 0.f;
 	S32 space_to_distribute = (mOrientation == HORIZONTAL)
 							? getRect().getWidth()
 							: getRect().getHeight();
@@ -358,9 +350,13 @@ void LLLayoutStack::updateLayout()
 		if (panelp->mAutoResize)
 		{
 			panelp->mTargetDim = panelp->getRelevantMinDim();
+			if (!panelp->mCollapsed && panelp->getVisible())
+			{
+				total_open_fraction += panelp->mFractionalSize;
+			}
 		}
 		space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
-		total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
+		total_visible_fraction += panelp->mFractionalSize;
 	}
 
 	llassert(total_visible_fraction < 1.01f);
@@ -368,28 +364,45 @@ void LLLayoutStack::updateLayout()
 	// don't need spacing after last panel
 	space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
 
-	// scale up space to distribute, since some of might will go to an invisible fraction of the auto-resize space
-	space_to_distribute = (total_visible_fraction > 0.f)
-						? llround((F32)space_to_distribute / total_visible_fraction)
-						: space_to_distribute;
-
-	if (space_to_distribute > 0)
-	{	// give space proportionally to auto resize panels, even invisible ones
+	F32 fraction_distributed = 0.f;
+	if (space_to_distribute > 0 && total_visible_fraction > 0.f)
+	{	// give space proportionally to visible auto resize panels
 		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 		{
 			if (panelp->mAutoResize == TRUE)
 			{
-				S32 delta = llround((F32)space_to_distribute * panelp->mFractionalSize/* * panelp->getAutoResizeFactor()*/);
+				F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
+				S32 delta = llround((F32)space_to_distribute * fraction_to_distribute);
+				fraction_distributed += fraction_to_distribute;
 				panelp->mTargetDim += delta;
 			}
 		}
 	}
 
+	if (fraction_distributed < total_visible_fraction)
+	{	// distribute any left over pixels to non-collapsed, visible panels
+		F32 fraction_left = total_visible_fraction - fraction_distributed;
+		S32 space_left = llround((F32)space_to_distribute * (fraction_left / total_visible_fraction));
+
+		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		{
+			if (panelp->mAutoResize 
+				&& !panelp->mCollapsed 
+				&& panelp->getVisible())
+			{
+				S32 space_for_panel = llmax(0, llround((F32)space_left * (panelp->mFractionalSize / total_open_fraction)));
+				panelp->mTargetDim += space_for_panel;
+				space_left -= space_for_panel;
+				total_open_fraction -= panelp->mFractionalSize;
+			}
+		}
+	}
+
 	F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight();
 
 	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 	{
-		F32 panel_dim = panelp->mTargetDim;
+		F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
 		F32 panel_visible_dim = panelp->getVisibleDim();
 
 		LLRect panel_rect;
@@ -403,9 +416,9 @@ void LLLayoutStack::updateLayout()
 		else
 		{
 			panel_rect.setLeftTopAndSize(0,
-				llround(cur_pos),
-				getRect().getWidth(),
-				llround(panel_dim));
+										llround(cur_pos),
+										getRect().getWidth(),
+										llround(panel_dim));
 		}
 		panelp->setIgnoreReshape(true);
 		panelp->setShape(panel_rect);
@@ -531,13 +544,12 @@ void LLLayoutStack::updateFractionalSizes()
 	{
 		if (panelp->mAutoResize)
 		{
-			F32 panel_resizable_dim = llmax(0.f, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
-			panelp->mFractionalSize = llmin(1.f, (panel_resizable_dim == 0.f)
-																	? 0.f
-																	: panel_resizable_dim / total_resizable_dim);
+			F32 panel_resizable_dim = llmax(MIN_FRACTIONAL_SIZE, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
+			panelp->mFractionalSize = panel_resizable_dim > 0.f 
+										? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE)
+										: MIN_FRACTIONAL_SIZE;
 			total_fractional_size += panelp->mFractionalSize;
-			// check for NaNs
-			llassert(panelp->mFractionalSize == panelp->mFractionalSize);
+			llassert(!llisnan(panelp->mFractionalSize));
 		}
 	}
 
@@ -547,7 +559,7 @@ void LLLayoutStack::updateFractionalSizes()
 		{
 			if (panelp->mAutoResize)
 			{
-				panelp->mFractionalSize = 1.f / (F32)num_auto_resize_panels;
+				panelp->mFractionalSize = MAX_FRACTIONAL_SIZE / (F32)num_auto_resize_panels;
 			}
 		}
 	}
@@ -685,11 +697,6 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		delta_auto_resize_headroom += delta_dim;
 	}
 
-
-	//delta_auto_resize_headroom = (total_visible_fraction > 0.f)
-	//								? delta_auto_resize_headroom / total_visible_fraction
-	//								: 0.f;
-
 	F32 fraction_given_up = 0.f;
 	F32 fraction_remaining = 1.f;
 	F32 updated_auto_resize_headroom = total_auto_resize_headroom + delta_auto_resize_headroom;
@@ -718,8 +725,8 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			{	// freeze current size as fraction of overall auto_resize space
 				F32 fractional_adjustment_factor = total_auto_resize_headroom / updated_auto_resize_headroom;
 				F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
-													0.f,
-													1.f);
+													MIN_FRACTIONAL_SIZE,
+													MAX_FRACTIONAL_SIZE);
 				F32 fraction_delta = (new_fractional_size - panelp->mFractionalSize);
 				fraction_given_up -= fraction_delta;
 				fraction_remaining -= panelp->mFractionalSize;
@@ -735,8 +742,8 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			if (panelp->mAutoResize)
 			{	// freeze new size as fraction
 				F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
-					? 1.f
-					: llmin(1.f, ((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom));
+					? MAX_FRACTIONAL_SIZE
+					: llclamp((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
 				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
 				fraction_remaining -= panelp->mFractionalSize;
 				panelp->mFractionalSize = new_fractional_size;
@@ -755,14 +762,15 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 				fraction_remaining -= panelp->mFractionalSize;
 				if (fraction_given_up != 0.f)
 				{
-					panelp->mFractionalSize += fraction_given_up;
+					panelp->mFractionalSize = llclamp(panelp->mFractionalSize + fraction_given_up, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
 					fraction_given_up = 0.f;
 				}
 				else
 				{
-					F32 new_fractional_size = llmin(1.f, 
-													(F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
-														/ updated_auto_resize_headroom);
+					F32 new_fractional_size = llclamp((F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
+														/ updated_auto_resize_headroom,
+													MIN_FRACTIONAL_SIZE,
+													MAX_FRACTIONAL_SIZE);
 					fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
 					panelp->mFractionalSize = new_fractional_size;
 				}
@@ -776,7 +784,9 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		case AFTER_RESIZED_PANEL:
 			if (panelp->mAutoResize)
 			{
-				panelp->mFractionalSize += (panelp->mFractionalSize / fraction_remaining) * fraction_given_up;
+				panelp->mFractionalSize = llclamp(panelp->mFractionalSize + (panelp->mFractionalSize / fraction_remaining) * fraction_given_up,
+												MIN_FRACTIONAL_SIZE,
+												MAX_FRACTIONAL_SIZE);
 			}
 		default:
 			break;
@@ -802,15 +812,15 @@ void LLLayoutStack::updateResizeBarLimits()
 		}
 
 		// toggle resize bars based on panel visibility, resizability, etc
-		if (previous_visible_panelp 
-			&& (visible_panelp->mUserResize 
-				|| previous_visible_panelp->mUserResize))
+		if (previous_visible_panelp
+			&& (visible_panelp->mUserResize || previous_visible_panelp->mUserResize)				// one of the pair is user resizable
+			&& (visible_panelp->mAutoResize || visible_panelp->mUserResize)							// current panel is resizable
+			&& (previous_visible_panelp->mAutoResize || previous_visible_panelp->mUserResize))		// previous panel is resizable
 		{
 			visible_panelp->mResizeBar->setVisible(TRUE);
+			S32 previous_panel_headroom = previous_visible_panelp->getVisibleDim() - previous_visible_panelp->getRelevantMinDim();
 			visible_panelp->mResizeBar->setResizeLimits(visible_panelp->getRelevantMinDim(), 
-														visible_panelp->getVisibleDim() 
-															+ (previous_visible_panelp->getVisibleDim() 
-																- previous_visible_panelp->getRelevantMinDim()));
+														visible_panelp->getVisibleDim() + previous_panel_headroom);
 		}
 		else
 		{
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index f00d5e759b1..da63593f7f7 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -157,11 +157,11 @@ friend class LLUICtrlFactory;
 	void setVisible(BOOL visible);
 
 	S32 getLayoutDim() const;
-	S32 getMinDim() const { return mMinDim; }
-	void setMinDim(S32 value) { mMinDim = value; if (!mExpandedMinDimSpecified) mExpandedMinDim = value; }
+	S32 getMinDim() const { return (mMinDim >= 0 || mAutoResize) ? llmax(0, mMinDim) : getLayoutDim(); }
+	void setMinDim(S32 value) { mMinDim = value; }
 
-	S32 getExpandedMinDim() const { return mExpandedMinDim; }
-	void setExpandedMinDim(S32 value) { mExpandedMinDim = value; mExpandedMinDimSpecified = true; }
+	S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : mMinDim; }
+	void setExpandedMinDim(S32 value) { mExpandedMinDim = value; }
 	
 	S32 getRelevantMinDim() const
 	{
@@ -169,7 +169,7 @@ friend class LLUICtrlFactory;
 		
 		if (!mCollapsed)
 		{
-			min_dim = mExpandedMinDim;
+			min_dim = getExpandedMinDim();
 		}
 		
 		return min_dim;
@@ -187,9 +187,7 @@ friend class LLUICtrlFactory;
 protected:
 	LLLayoutPanel(const Params& p);
 	
-	bool	mExpandedMinDimSpecified;
 	S32		mExpandedMinDim;
-	
 	S32		mMinDim;
 	bool	mAutoResize;
 	bool	mUserResize;
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index fe3f688fc50..ad4cc20d9a5 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -424,63 +424,66 @@ void LLScrollContainer::draw()
 		focusFirstItem();
 	}
 
-	// Draw background
-	if( mIsOpaque )
+	if (getRect().isValid()) 
 	{
-		F32 alpha = getCurrentTransparency();
+		// Draw background
+		if( mIsOpaque )
+		{
+			F32 alpha = getCurrentTransparency();
 
-		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-		gl_rect_2d(mInnerRect, mBackgroundColor.get() % alpha);
-	}
+			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+			gl_rect_2d(mInnerRect, mBackgroundColor.get() % alpha);
+		}
 	
-	// Draw mScrolledViews and update scroll bars.
-	// get a scissor region ready, and draw the scrolling view. The
-	// scissor region ensures that we don't draw outside of the bounds
-	// of the rectangle.
-	if( mScrolledView )
-	{
-		updateScroll();
-
-		// Draw the scrolled area.
+		// Draw mScrolledViews and update scroll bars.
+		// get a scissor region ready, and draw the scrolling view. The
+		// scissor region ensures that we don't draw outside of the bounds
+		// of the rectangle.
+		if( mScrolledView )
 		{
-			S32 visible_width = 0;
-			S32 visible_height = 0;
-			BOOL show_v_scrollbar = FALSE;
-			BOOL show_h_scrollbar = FALSE;
-			calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
-
-			LLLocalClipRect clip(LLRect(mInnerRect.mLeft, 
-					mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height,
-					mInnerRect.mRight - (show_v_scrollbar ? scrollbar_size: 0),
-					mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0)
-					));
-			drawChild(mScrolledView);
-		}
-	}
-
-	// Highlight border if a child of this container has keyboard focus
-	if( mBorder->getVisible() )
-	{
-		mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus(this) );
-	}
+			updateScroll();
 
-	// Draw all children except mScrolledView
-	// Note: scrollbars have been adjusted by above drawing code
-	for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin();
-		 child_iter != getChildList()->rend(); ++child_iter)
-	{
-		LLView *viewp = *child_iter;
-		if( sDebugRects )
-		{
-			sDepth++;
+			// Draw the scrolled area.
+			{
+				S32 visible_width = 0;
+				S32 visible_height = 0;
+				BOOL show_v_scrollbar = FALSE;
+				BOOL show_h_scrollbar = FALSE;
+				calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
+
+				LLLocalClipRect clip(LLRect(mInnerRect.mLeft, 
+						mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height,
+						mInnerRect.mRight - (show_v_scrollbar ? scrollbar_size: 0),
+						mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0)
+						));
+				drawChild(mScrolledView);
+			}
 		}
-		if( (viewp != mScrolledView) && viewp->getVisible() )
+
+		// Highlight border if a child of this container has keyboard focus
+		if( mBorder->getVisible() )
 		{
-			drawChild(viewp);
+			mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus(this) );
 		}
-		if( sDebugRects )
+
+		// Draw all children except mScrolledView
+		// Note: scrollbars have been adjusted by above drawing code
+		for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin();
+			 child_iter != getChildList()->rend(); ++child_iter)
 		{
-			sDepth--;
+			LLView *viewp = *child_iter;
+			if( sDebugRects )
+			{
+				sDepth++;
+			}
+			if( (viewp != mScrolledView) && viewp->getVisible() )
+			{
+				drawChild(viewp);
+			}
+			if( sDebugRects )
+			{
+				sDepth--;
+			}
 		}
 	}
 } // end draw
diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index 48a232c33e7..f5c463c9614 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -160,7 +160,7 @@ void LLWindowShade::draw()
 
 	notification_area->reshape(notification_area->getRect().getWidth(), 
 		llclamp(message_rect.getHeight() + 15, 
-				llmin(mFormHeight, MAX_NOTIFICATION_AREA_HEIGHT),
+				llmax(mFormHeight, MIN_NOTIFICATION_AREA_HEIGHT),
 				MAX_NOTIFICATION_AREA_HEIGHT));
 
 	LLUICtrl::draw();
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 3761eb57772..ccf8305c630 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -369,7 +369,7 @@ void LLSidepanelInventory::onToggleInboxBtn()
 	const bool inbox_expanded = inboxButton->getToggleState();
 	
 	// Enable user_resize on main inventory panel only when inbox is expanded
-	inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded);
+	//inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded);
 	
 	// Expand/collapse the indicated panel
 	inv_stack->collapsePanel(inboxPanel, !inbox_expanded);
-- 
GitLab


From 29ad432c8bdc3a69c7241de28e217d27b71947d6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Jan 2012 19:52:49 -0800
Subject: [PATCH 616/933] made layoutPanels have constant user_resize and
 auto_resize attributes

---
 indra/llui/lllayoutstack.cpp                  | 38 ++-----------------
 indra/llui/lllayoutstack.h                    |  8 ++--
 indra/newview/llchicletbar.cpp                |  2 -
 indra/newview/llsidepanelinventory.cpp        |  6 ---
 .../default/xui/en/panel_chiclet_bar.xml      |  1 +
 5 files changed, 7 insertions(+), 48 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 073592b6ecf..2f1c2a47c98 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -63,7 +63,7 @@ LLLayoutPanel::Params::Params()
 
 LLLayoutPanel::LLLayoutPanel(const Params& p)	
 :	LLPanel(p),
-	mExpandedMinDim(p.min_dim),
+	mExpandedMinDim(p.expanded_min_dim.isProvided() ? p.expanded_min_dim : p.min_dim),
  	mMinDim(p.min_dim), 
  	mAutoResize(p.auto_resize),
  	mUserResize(p.user_resize),
@@ -76,12 +76,6 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
 	mIgnoreReshape(false),
 	mOrientation(LLLayoutStack::HORIZONTAL)
 {
-	// Set the expanded min dim if it is provided, otherwise it gets the p.min_dim value
-	if (p.expanded_min_dim.isProvided())
-	{
-		mExpandedMinDim = p.expanded_min_dim();
-	}
-	
 	// panels initialized as hidden should not start out partially visible
 	if (!getVisible())
 	{
@@ -155,7 +149,7 @@ void LLLayoutPanel::reshape( S32 width, S32 height, BOOL called_from_parent /*=
 {
 	if (width == getRect().getWidth() && height == getRect().getHeight()) return;
 
-	if (!mIgnoreReshape && !mAutoResize)
+	if (!mIgnoreReshape && mAutoResize == false)
 	{
 		mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height;
 		LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent());
@@ -302,32 +296,6 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)
 	mNeedsLayout = true;
 }
 
-void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize)
-{
-	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
-	
-	if (panel)
-	{
-		panel->mAutoResize = auto_resize;
-	}
-
-	mNeedsLayout = true;
-}
-
-void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_resize)
-{
-	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
-
-	if (panel)
-	{
-		panel->mUserResize = user_resize;
-	}
-
-	mNeedsLayout = true;
-	updateFractionalSizes();
-}
-
-
 static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks");
 
 void LLLayoutStack::updateLayout()
@@ -369,7 +337,7 @@ void LLLayoutStack::updateLayout()
 	{	// give space proportionally to visible auto resize panels
 		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 		{
-			if (panelp->mAutoResize == TRUE)
+			if (panelp->mAutoResize)
 			{
 				F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
 				S32 delta = llround((F32)space_to_distribute * fraction_to_distribute);
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index da63593f7f7..efe93f6def1 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -88,9 +88,6 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE);
 	S32 getNumPanels() { return mPanels.size(); }
 
-	void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize);
-	void setPanelUserResize(const std::string& panel_name, BOOL user_resize);
-	
 	void updateLayout();
 
 	S32 getPanelSpacing() const { return mPanelSpacing; }
@@ -187,10 +184,11 @@ friend class LLUICtrlFactory;
 protected:
 	LLLayoutPanel(const Params& p);
 	
+	const bool	mAutoResize;
+	const bool	mUserResize;
+
 	S32		mExpandedMinDim;
 	S32		mMinDim;
-	bool	mAutoResize;
-	bool	mUserResize;
 	bool	mCollapsed;
 	F32		mVisibleAmt;
 	F32		mCollapseAmt;
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index a32fd307f16..f1bc51fbe75 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -212,8 +212,6 @@ void LLChicletBar::reshape(S32 width, S32 height, BOOL called_from_parent)
 	{
 		// Firstly, update layout stack to ensure we deal with correct panel sizes.
 		{
-			// Set chiclet panel to be autoresized by default.
-			mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE);
 			// Force the updating of layout to reset panels collapse factor.
 			mToolbarStack->updateLayout();
 		}
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index ccf8305c630..038b18afbdc 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -217,9 +217,6 @@ BOOL LLSidepanelInventory::postBuild()
 	{
 		LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME);
 
-		// Disable user_resize on main inventory panel by default
-		inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false);
-
 		// Collapse inbox panel
 		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true);
 		
@@ -368,9 +365,6 @@ void LLSidepanelInventory::onToggleInboxBtn()
 	
 	const bool inbox_expanded = inboxButton->getToggleState();
 	
-	// Enable user_resize on main inventory panel only when inbox is expanded
-	//inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded);
-	
 	// Expand/collapse the indicated panel
 	inv_stack->collapsePanel(inboxPanel, !inbox_expanded);
 
diff --git a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
index 6d4008a4edf..ff0146490b9 100644
--- a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
@@ -27,6 +27,7 @@
          min_width="95"
          mouse_opaque="false"
          name="chiclet_list_panel"
+         auto_resize="true"
          top="0"
          width="189">
       <chiclet_panel
-- 
GitLab


From f42a8a768c3028e81a48b19ac75943f15bfedf1e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Jan 2012 20:00:42 -0800
Subject: [PATCH 617/933] fixed build

---
 indra/newview/llimfloater.cpp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 228260c41a4..f67464078b2 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -234,12 +234,6 @@ LLIMFloater::~LLIMFloater()
 //virtual
 BOOL LLIMFloater::postBuild()
 {
-	// User-resizable control panels in P2P sessions look ugly (EXT-3470).
-	if (mDialog == IM_NOTHING_SPECIAL || mDialog == IM_SESSION_P2P_INVITE)
-	{
-		getChild<LLLayoutStack>("im_panels")->setPanelUserResize("panel_im_control_panel", FALSE);
-	}
-
 	const LLUUID& other_party_id = LLIMModel::getInstance()->getOtherParticipantID(mSessionID);
 	if (other_party_id.notNull())
 	{
-- 
GitLab


From 82e90a6af580890eb685fc6b684d79ca905e6279 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 20 Jan 2012 08:59:37 +0200
Subject: [PATCH 618/933] EXP-901 FIXED (Can see "typing" messages from users
 who are not allowed to IM you)

- If "Only friends and groups can IM me" option is ON but the user got message from non-friend, show notification one time per session.
---
 indra/newview/llimview.cpp                     | 11 +++++++++++
 indra/newview/llimview.h                       | 12 ++++++++++++
 indra/newview/llviewermessage.cpp              |  9 ++++++++-
 indra/newview/skins/default/xui/en/strings.xml |  1 +
 4 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index a856bd0bdc6..e69c45de585 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2977,6 +2977,17 @@ bool LLIMMgr::isVoiceCall(const LLUUID& session_id)
 	return im_session->mStartedAsIMCall;
 }
 
+void LLIMMgr::addNotifiedNonFriendSessionID(const LLUUID& session_id)
+{
+	mNotifiedNonFriendSessions.insert(session_id);
+}
+
+bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id)
+{
+	return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id);
+
+}
+
 void LLIMMgr::noteOfflineUsers(
 	const LLUUID& session_id,
 	const LLDynamicArray<LLUUID>& ids)
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index b1be26a169e..f07a78e2f77 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -438,6 +438,10 @@ class LLIMMgr : public LLSingleton<LLIMMgr>
 
 	bool isVoiceCall(const LLUUID& session_id);
 
+	void addNotifiedNonFriendSessionID(const LLUUID& session_id);
+
+	bool isNonFriendSessionNotified(const LLUUID& session_id);
+
 private:
 
 	/**
@@ -465,6 +469,14 @@ class LLIMMgr : public LLSingleton<LLIMMgr>
 	typedef std::list <LLIMSessionObserver *> session_observers_list_t;
 	session_observers_list_t mSessionObservers;
 
+	// EXP-901
+	// If "Only friends and groups can IM me" option is ON but the user got message from non-friend,
+	// the user should be notified that to be able to see this message the option should be OFF.
+	// This set stores session IDs in which user was notified. Need to store this IDs so that the user
+	// be notified only one time per session with non-friend.
+	typedef std::set<LLUUID> notified_non_friend_sessions_t;
+	notified_non_friend_sessions_t mNotifiedNonFriendSessions;
+
 	LLSD mPendingInvitations;
 	LLSD mPendingAgentListUpdates;
 };
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3c6770df43f..6bb13bb8d79 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2360,8 +2360,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
 
 			bool mute_im = is_muted;
-			if(accept_im_from_only_friend&&!is_friend)
+			if (accept_im_from_only_friend && !is_friend)
 			{
+				if (!gIMMgr->isNonFriendSessionNotified(session_id))
+				{
+					std::string message = LLTrans::getString("IM_unblock_only_groups_friends");
+					gIMMgr->addMessage(session_id, from_id, name, message);
+					gIMMgr->addNotifiedNonFriendSessionID(session_id);
+				}
+
 				mute_im = true;
 			}
 			if (!mute_im || is_linden) 
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3351ffe00fb..54d5559efc3 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3238,6 +3238,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	<string name="IM_to_label">To</string>
 	<string name="IM_moderator_label">(Moderator)</string>
 	<string name="Saved_message">(Saved [LONG_TIMESTAMP])</string>
+	<string name="IM_unblock_only_groups_friends">To see this message, you must uncheck &apos;Only friends and groups can call or IM me&apos; in Preferences/Privacy.</string>
 
 	<!-- voice calls -->
 	<string name="answered_call">Your call has been answered</string>
-- 
GitLab


From ac924627e29d827992c21200708b870643ec35cf Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 20 Jan 2012 15:39:21 +0200
Subject: [PATCH 619/933] EXP-1820 FIXED Fixed translation to Chinese with
 Microsoft Translator.

Use correct language code for Traditional Chinese.
---
 indra/newview/lltranslate.cpp | 10 ++++++++--
 indra/newview/lltranslate.h   |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index c1cc9c7bc4e..f3d8de1904b 100755
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -162,10 +162,10 @@ void LLBingTranslationHandler::getTranslateURL(
 	const std::string &text) const
 {
 	url = std::string("http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=")
-		+ getAPIKey() + "&text=" + LLURI::escape(text) + "&to=" + to_lang;
+		+ getAPIKey() + "&text=" + LLURI::escape(text) + "&to=" + getAPILanguageCode(to_lang);
 	if (!from_lang.empty())
 	{
-		url += "&from=" + from_lang;
+		url += "&from=" + getAPILanguageCode(from_lang);
 	}
 }
 
@@ -236,6 +236,12 @@ std::string LLBingTranslationHandler::getAPIKey()
 	return gSavedSettings.getString("BingTranslateAPIKey");
 }
 
+// static
+std::string LLBingTranslationHandler::getAPILanguageCode(const std::string& lang)
+{
+	return lang == "zh" ? "zh-CHT" : lang; // treat Chinese as Traditional Chinese
+}
+
 LLTranslate::TranslationReceiver::TranslationReceiver(const std::string& from_lang, const std::string& to_lang)
 :	mFromLang(from_lang)
 ,	mToLang(to_lang)
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h
index 424bc14587f..c58e1adb8ca 100755
--- a/indra/newview/lltranslate.h
+++ b/indra/newview/lltranslate.h
@@ -157,6 +157,7 @@ class LLBingTranslationHandler : public LLTranslationAPIHandler
 	/*virtual*/ bool isConfigured() const;
 private:
 	static std::string getAPIKey();
+	static std::string getAPILanguageCode(const std::string& lang);
 };
 
 /**
-- 
GitLab


From 5c8b24a0553699e83f405f1663d391bc7ed0d265 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 20 Jan 2012 10:47:11 -0800
Subject: [PATCH 620/933] EXP-1825 FIX crash in
 LLSecAPIBasicHandler::_writeProtectedData()

---
 indra/newview/llsechandler_basic.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index 8d64c8c04f4..30400a4c6a6 100644
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -1360,7 +1360,11 @@ void LLSecAPIBasicHandler::_writeProtectedData()
 		// (even though this file isn't really secure.  Perhaps in the future
 		// it may be, however.
 		LLFile::remove(tmp_filename);
-		throw LLProtectedDataException("Error writing Protected Data Store");
+
+		// EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
+		// Decided throwing an exception here was overkill until we figure out why this happens
+		//throw LLProtectedDataException("Error writing Protected Data Store");
+		llinfos << "LLProtectedDataException(Error writing Protected Data Store)" << llendl;
 	}
 
 	// move the temporary file to the specified file location.
@@ -1369,7 +1373,11 @@ void LLSecAPIBasicHandler::_writeProtectedData()
 	   (LLFile::rename(tmp_filename, mProtectedDataFilename)))
 	{
 		LLFile::remove(tmp_filename);
-		throw LLProtectedDataException("Could not overwrite protected data store");
+
+		// EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
+		// Decided throwing an exception here was overkill until we figure out why this happens
+		//throw LLProtectedDataException("Could not overwrite protected data store");
+		llinfos << "LLProtectedDataException(Could not overwrite protected data store)" << llendl;
 	}
 }
 		
-- 
GitLab


From 9e6a5d721193f181c39e58fe00073bece74b081a Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 20 Jan 2012 11:55:15 -0700
Subject: [PATCH 621/933] fix for SH-2823 and SH-2824: LLCurl crash inside
 LLBufferArray::countAfter() and LLBufferArray::copyIntoBuffers

---
 indra/llcommon/llthread.cpp        | 15 +++--
 indra/llcommon/llthread.h          |  1 +
 indra/llmessage/llbuffer.cpp       | 90 +++++++++++++++++++++++++++++-
 indra/llmessage/llbuffer.h         | 25 +++++++++
 indra/llmessage/llbufferstream.cpp |  8 +++
 indra/llmessage/llcurl.cpp         |  3 +
 indra/llmessage/lliohttpserver.cpp |  4 +-
 indra/llmessage/lliosocket.cpp     |  3 +
 indra/llmessage/llpumpio.cpp       |  1 +
 9 files changed, 142 insertions(+), 8 deletions(-)

diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 4063cc730b4..a6ad6b125c1 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -337,11 +337,7 @@ LLMutex::~LLMutex()
 
 void LLMutex::lock()
 {
-#if LL_DARWIN
-	if (mLockingThread == LLThread::currentID())
-#else
-	if (mLockingThread == sThreadID)
-#endif
+	if(isSelfLocked())
 	{ //redundant lock
 		mCount++;
 		return;
@@ -398,6 +394,15 @@ bool LLMutex::isLocked()
 	}
 }
 
+bool LLMutex::isSelfLocked()
+{
+#if LL_DARWIN
+	return mLockingThread == LLThread::currentID();
+#else
+	return mLockingThread == sThreadID;
+#endif
+}
+
 U32 LLMutex::lockingThread() const
 {
 	return mLockingThread;
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index f0e0de6173a..b52e70ab2eb 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -151,6 +151,7 @@ class LL_COMMON_API LLMutex
 	void lock();		// blocks
 	void unlock();
 	bool isLocked(); 	// non-blocking, but does do a lock/unlock so not free
+	bool isSelfLocked(); //return true if locked in a same thread
 	U32 lockingThread() const; //get ID of locking thread
 	
 protected:
diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp
index 0316797f00c..250cace6e96 100644
--- a/indra/llmessage/llbuffer.cpp
+++ b/indra/llmessage/llbuffer.cpp
@@ -32,6 +32,9 @@
 #include "llmath.h"
 #include "llmemtype.h"
 #include "llstl.h"
+#include "llthread.h"
+
+#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED llassert(!mMutexp || mMutexp->isSelfLocked());
 
 /** 
  * LLSegment
@@ -224,7 +227,8 @@ void LLHeapBuffer::allocate(S32 size)
  * LLBufferArray
  */
 LLBufferArray::LLBufferArray() :
-	mNextBaseChannel(0)
+	mNextBaseChannel(0),
+	mMutexp(NULL)
 {
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 }
@@ -233,6 +237,8 @@ LLBufferArray::~LLBufferArray()
 {
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	std::for_each(mBuffers.begin(), mBuffers.end(), DeletePointer());
+
+	delete mMutexp;
 }
 
 // static
@@ -243,14 +249,57 @@ LLChannelDescriptors LLBufferArray::makeChannelConsumer(
 	return rv;
 }
 
+void LLBufferArray::lock()
+{
+	if(mMutexp)
+	{
+		mMutexp->lock() ;
+	}
+}
+
+void LLBufferArray::unlock()
+{
+	if(mMutexp)
+	{
+		mMutexp->unlock() ;
+	}
+}
+
+LLMutex* LLBufferArray::getMutex()
+{
+	return mMutexp ;
+}
+
+void LLBufferArray::setThreaded(bool threaded)
+{
+	if(threaded)
+	{
+		if(!mMutexp)
+		{
+			mMutexp = new LLMutex(NULL);
+		}
+	}
+	else
+	{
+		if(mMutexp)
+		{
+			delete mMutexp ;
+			mMutexp = NULL ;
+		}
+	}
+}
+
 LLChannelDescriptors LLBufferArray::nextChannel()
 {
 	LLChannelDescriptors rv(mNextBaseChannel++);
 	return rv;
 }
 
+//mMutexp should be locked before calling this.
 S32 LLBufferArray::capacity() const
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+
 	S32 total = 0;
 	const_buffer_iterator_t iter = mBuffers.begin();
 	const_buffer_iterator_t end = mBuffers.end();
@@ -263,6 +312,8 @@ S32 LLBufferArray::capacity() const
 
 bool LLBufferArray::append(S32 channel, const U8* src, S32 len)
 {
+	LLMutexLock lock(mMutexp) ;
+
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	std::vector<LLSegment> segments;
 	if(copyIntoBuffers(channel, src, len, segments))
@@ -273,8 +324,11 @@ bool LLBufferArray::append(S32 channel, const U8* src, S32 len)
 	return false;
 }
 
+//mMutexp should be locked before calling this.
 bool LLBufferArray::prepend(S32 channel, const U8* src, S32 len)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	std::vector<LLSegment> segments;
 	if(copyIntoBuffers(channel, src, len, segments))
@@ -293,6 +347,8 @@ bool LLBufferArray::insertAfter(
 {
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	std::vector<LLSegment> segments;
+
+	LLMutexLock lock(mMutexp) ;
 	if(mSegments.end() != segment)
 	{
 		++segment;
@@ -305,8 +361,11 @@ bool LLBufferArray::insertAfter(
 	return false;
 }
 
+//mMutexp should be locked before calling this.
 LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	segment_iterator_t end = mSegments.end();
 	segment_iterator_t it = getSegment(address);
@@ -335,20 +394,26 @@ LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
 	return rv;
 }
 							   
+//mMutexp should be locked before calling this.
 LLBufferArray::segment_iterator_t LLBufferArray::beginSegment()
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	return mSegments.begin();
 }
 
+//mMutexp should be locked before calling this.
 LLBufferArray::segment_iterator_t LLBufferArray::endSegment()
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	return mSegments.end();
 }
 
+//mMutexp should be locked before calling this.
 LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
 	U8* address,
 	LLSegment& segment)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	segment_iterator_t rv = mSegments.begin();
 	segment_iterator_t end = mSegments.end();
@@ -395,8 +460,10 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
 	return rv;
 }
 
+//mMutexp should be locked before calling this.
 LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	segment_iterator_t end = mSegments.end();
 	if(!address)
 	{
@@ -414,9 +481,11 @@ LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address)
 	return end;
 }
 
+//mMutexp should be locked before calling this.
 LLBufferArray::const_segment_iterator_t LLBufferArray::getSegment(
 	U8* address) const
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	const_segment_iterator_t end = mSegments.end();
 	if(!address)
 	{
@@ -466,6 +535,8 @@ S32 LLBufferArray::countAfter(S32 channel, U8* start) const
 	S32 count = 0;
 	S32 offset = 0;
 	const_segment_iterator_t it;
+
+	LLMutexLock lock(mMutexp) ;
 	const_segment_iterator_t end = mSegments.end();
 	if(start)
 	{
@@ -517,6 +588,8 @@ U8* LLBufferArray::readAfter(
 	len = 0;
 	S32 bytes_to_copy = 0;
 	const_segment_iterator_t it;
+
+	LLMutexLock lock(mMutexp) ;
 	const_segment_iterator_t end = mSegments.end();
 	if(start)
 	{
@@ -568,6 +641,7 @@ U8* LLBufferArray::seek(
 	U8* start,
 	S32 delta) const
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	const_segment_iterator_t it;
 	const_segment_iterator_t end = mSegments.end();
@@ -709,9 +783,14 @@ U8* LLBufferArray::seek(
 	return rv;
 }
 
+//test use only
 bool LLBufferArray::takeContents(LLBufferArray& source)
 {
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
+
+	LLMutexLock lock(mMutexp);
+	source.lock();
+
 	std::copy(
 		source.mBuffers.begin(),
 		source.mBuffers.end(),
@@ -723,13 +802,17 @@ bool LLBufferArray::takeContents(LLBufferArray& source)
 		std::back_insert_iterator<segment_list_t>(mSegments));
 	source.mSegments.clear();
 	source.mNextBaseChannel = 0;
+	source.unlock();
+
 	return true;
 }
 
+//mMutexp should be locked before calling this.
 LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
 	S32 channel,
 	S32 len)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	// start at the end of the buffers, because it is the most likely
 	// to have free space.
@@ -765,8 +848,10 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
 	return send;
 }
 
+//mMutexp should be locked before calling this.
 bool LLBufferArray::eraseSegment(const segment_iterator_t& erase_iter)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 
 	// Find out which buffer contains the segment, and if it is found,
@@ -792,13 +877,14 @@ bool LLBufferArray::eraseSegment(const segment_iterator_t& erase_iter)
 	return rv;
 }
 
-
+//mMutexp should be locked before calling this.
 bool LLBufferArray::copyIntoBuffers(
 	S32 channel,
 	const U8* src,
 	S32 len,
 	std::vector<LLSegment>& segments)
 {
+	ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
 	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
 	if(!src || !len) return false;
 	S32 copied = 0;
diff --git a/indra/llmessage/llbuffer.h b/indra/llmessage/llbuffer.h
index 1c42b6fbc65..ccdb9fa7ee9 100644
--- a/indra/llmessage/llbuffer.h
+++ b/indra/llmessage/llbuffer.h
@@ -39,6 +39,7 @@
 #include <list>
 #include <vector>
 
+class LLMutex;
 /** 
  * @class LLChannelDescriptors
  * @brief A way simple interface to accesss channels inside a buffer
@@ -564,6 +565,29 @@ class LLBufferArray
 	 * @return Returns true on success.
 	 */
 	bool eraseSegment(const segment_iterator_t& iter);
+
+	/**
+	* @brief Lock the mutex if it exists
+	* This method locks mMutexp to make accessing LLBufferArray thread-safe
+	*/
+	void lock();
+
+	/**
+	* @brief Unlock the mutex if it exists
+	*/
+	void unlock();
+
+	/**
+	* @brief Return mMutexp
+	*/
+	LLMutex* getMutex();
+
+	/**
+	* @brief Set LLBufferArray to be shared across threads or not
+	* This method is to create mMutexp if is threaded.
+	* @param threaded Indicates this LLBufferArray instance is shared across threads if true.
+	*/
+	void setThreaded(bool threaded);
 	//@}
 
 protected:
@@ -595,6 +619,7 @@ class LLBufferArray
 	S32 mNextBaseChannel;
 	buffer_list_t mBuffers;
 	segment_list_t mSegments;
+	LLMutex* mMutexp;
 };
 
 #endif // LL_LLBUFFER_H
diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp
index 6257983c436..8d8ad05ad5c 100644
--- a/indra/llmessage/llbufferstream.cpp
+++ b/indra/llmessage/llbufferstream.cpp
@@ -31,6 +31,7 @@
 
 #include "llbuffer.h"
 #include "llmemtype.h"
+#include "llthread.h"
 
 static const S32 DEFAULT_OUTPUT_SEGMENT_SIZE = 1024 * 4;
 
@@ -62,6 +63,7 @@ int LLBufferStreamBuf::underflow()
 		return EOF;
 	}
 
+	LLMutexLock lock(mBuffer->getMutex());
 	LLBufferArray::segment_iterator_t iter;
 	LLBufferArray::segment_iterator_t end = mBuffer->endSegment();
 	U8* last_pos = (U8*)gptr();
@@ -149,6 +151,7 @@ int LLBufferStreamBuf::overflow(int c)
 	// since we got here, we have a buffer, and we have a character to
 	// put on it.
 	LLBufferArray::segment_iterator_t it;
+	LLMutexLock lock(mBuffer->getMutex());
 	it = mBuffer->makeSegment(mChannels.out(), DEFAULT_OUTPUT_SEGMENT_SIZE);
 	if(it != mBuffer->endSegment())
 	{
@@ -210,6 +213,7 @@ int LLBufferStreamBuf::sync()
 
 	// *NOTE: I bet we could just --address if address is not NULL.
 	// Need to think about that.
+	LLMutexLock lock(mBuffer->getMutex());
 	address = mBuffer->seek(mChannels.out(), address, -1);
 	if(address)
 	{
@@ -273,6 +277,8 @@ streampos LLBufferStreamBuf::seekoff(
 			// NULL is fine
 			break;
 		}
+
+		LLMutexLock lock(mBuffer->getMutex());
 		address = mBuffer->seek(mChannels.in(), base_addr, off);
 		if(address)
 		{
@@ -304,6 +310,8 @@ streampos LLBufferStreamBuf::seekoff(
 			// NULL is fine
 			break;
 		}
+
+		LLMutexLock lock(mBuffer->getMutex());
 		address = mBuffer->seek(mChannels.out(), base_addr, off);
 		if(address)
 		{
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 5edf0dc8c00..1ab82a273bb 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -228,6 +228,8 @@ LLMutex* LLCurl::Easy::sHandleMutexp = NULL ;
 //static
 CURL* LLCurl::Easy::allocEasyHandle()
 {
+	llassert(LLCurl::getCurlThread()) ;
+
 	CURL* ret = NULL;
 
 	LLMutexLock lock(sHandleMutexp) ;
@@ -489,6 +491,7 @@ void LLCurl::Easy::prepRequest(const std::string& url,
 	LLProxy::getInstance()->applyProxySettings(this);
 
 	mOutput.reset(new LLBufferArray);
+	mOutput->setThreaded(true);
 	setopt(CURLOPT_WRITEFUNCTION, (void*)&curlWriteCallback);
 	setopt(CURLOPT_WRITEDATA, (void*)this);
 
diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp
index 73e8a690851..987f386aa38 100644
--- a/indra/llmessage/lliohttpserver.cpp
+++ b/indra/llmessage/lliohttpserver.cpp
@@ -818,6 +818,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
 
   			// Copy everything after mLast read to the out.
 			LLBufferArray::segment_iterator_t seg_iter;
+
+			buffer->lock();
 			seg_iter = buffer->splitAfter(mLastRead);
 			if(seg_iter != buffer->endSegment())
 			{
@@ -838,7 +840,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
 				}
 #endif
 			}
-
+			buffer->unlock();
 			//
 			// *FIX: get rid of extra bytes off the end
 			//
diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp
index 54ceab3422c..d5b4d458210 100644
--- a/indra/llmessage/lliosocket.cpp
+++ b/indra/llmessage/lliosocket.cpp
@@ -445,6 +445,7 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl(
 	// efficient - not only because writev() is better, but also
 	// because we won't have to do as much work to find the start
 	// address.
+	buffer->lock();
 	LLBufferArray::segment_iterator_t it;
 	LLBufferArray::segment_iterator_t end = buffer->endSegment();
 	LLSegment segment;
@@ -524,6 +525,8 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl(
 		}
 
 	}
+	buffer->unlock();
+
 	PUMP_DEBUG;
 	if(done && eos)
 	{
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index 0ff300efd0e..f3ef4f26844 100644
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -207,6 +207,7 @@ bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request
 	info.mHasCurlRequest = has_curl_request;
 	info.setTimeoutSeconds(timeout);
 	info.mData = LLIOPipe::buffer_ptr_t(new LLBufferArray);
+	info.mData->setThreaded(has_curl_request);
 	LLLinkInfo link;
 #if LL_DEBUG_PIPE_TYPE_IN_PUMP
 	lldebugs << "LLPumpIO::addChain() " << chain[0] << " '"
-- 
GitLab


From d70d57c9387bd94d32cb3e2b71430102f250c6eb Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 20 Jan 2012 14:15:31 -0500
Subject: [PATCH 622/933] STORM-1795 Fix logic error

---
 indra/newview/llimview.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index fa7930503b8..dbdef9d47bf 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2458,8 +2458,14 @@ void LLIMMgr::addMessage(
 		make_ui_sound("UISndNewIncomingIMSession");
 	}
 
-	bool show_message = gSavedSettings.getBOOL("VoiceCallsFriendsOnly") &&
-		LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL ? false : true;
+	bool show_message = true;
+	if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly"))
+	{
+		if (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL)
+		{
+			show_messages = false;
+		}
+	}
 
 	if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && show_message)
 	{
-- 
GitLab


From 44436d0240ceeb384d1a2fc05c46ccf1c4034f94 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 20 Jan 2012 14:26:45 -0500
Subject: [PATCH 623/933] STORM-1795 Fixed misspelled variable

---
 indra/newview/llimview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index dbdef9d47bf..06f57719f5d 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2463,7 +2463,7 @@ void LLIMMgr::addMessage(
 	{
 		if (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL)
 		{
-			show_messages = false;
+			show_message = false;
 		}
 	}
 
-- 
GitLab


From a73013f7081db15aae93cc82feb895139b1847db Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 20 Jan 2012 13:41:43 -0800
Subject: [PATCH 624/933] EXP-1799 FIX -- Replace and Add to Outfit options
 appear as grayed out in Inventory

* Modified build context menu code to not disable items that are invisible so
  secondary background fetch can coalesce menu options with proper state.
* Removed "Move to Merchant Outbox" context menu option.
---
 indra/newview/llinventorybridge.cpp             | 17 +++++------------
 .../skins/default/xui/en/menu_inventory.xml     |  8 --------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 12322b29211..97e61f4c997 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -519,7 +519,6 @@ void hide_context_entries(LLMenuGL& menu,
 			{
 				menu_item->setVisible(FALSE);
 			}
-			menu_item->setEnabled(FALSE);
 		}
 		else
 		{
@@ -528,14 +527,10 @@ void hide_context_entries(LLMenuGL& menu,
 			// so that some other UI element from multi-select doesn't later set this invisible.
 			menu_item->pushVisible(TRUE);
 
-			BOOL enabled = menu_item->getEnabled();
-			for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2)
+			bool enabled = (menu_item->getEnabled() == TRUE);
+			for (itor2 = disabled_entries.begin(); enabled && (itor2 != disabled_entries.end()); ++itor2)
 			{
-				if (*itor2 == name)
-				{
-					enabled = FALSE;
-					break;
-				}
+				enabled &= (*itor2 != name);
 			}
 
 			menu_item->setEnabled(enabled);
@@ -613,12 +608,10 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 					copyable = inv_item->getPermissions().allowCopyBy(gAgent.getID());
 				}
 
-				const std::string merchant_action = ((copyable == true) ? "Merchant Copy" : "Merchant Move");
-				items.push_back(merchant_action);
-
+				items.push_back(std::string("Merchant Copy"));
 				if (!canListOnMarketplaceNow())
 				{
-					disabled_items.push_back(merchant_action);
+					disabled_items.push_back(std::string("Merchant Copy"));
 				}
 			}
 		}
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 31dcdfffbb3..ef4a1bc0618 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -685,14 +685,6 @@
 		 function="Inventory.DoToSelected"
 		 parameter="copy_to_outbox" />
 	</menu_item_call>
-	<menu_item_call
-	 label="Move to Merchant Outbox"
-	 layout="topleft"
-	 name="Merchant Move">
-		<menu_item_call.on_click
-		 function="Inventory.DoToSelected"
-		 parameter="move_to_outbox" />
-	</menu_item_call>
 	<menu_item_call
 	 label="Send to Marketplace"
 	 layout="topleft"
-- 
GitLab


From 18e7f1bffd875bb933212367f0d62dfc4da871b9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 20 Jan 2012 16:42:57 -0600
Subject: [PATCH 625/933] SH-2889 Add visual auto-muting controls

---
 indra/llmath/llvolume.cpp                     |  3 +
 indra/llmath/llvolume.h                       |  2 +
 indra/newview/app_settings/settings.xml       | 22 ++++++
 indra/newview/lldrawable.cpp                  | 10 +++
 indra/newview/llspatialpartition.cpp          | 15 +++-
 indra/newview/llspatialpartition.h            | 18 +++--
 indra/newview/llviewermenu.cpp                |  4 ++
 indra/newview/llvoavatar.cpp                  | 20 +++++-
 indra/newview/llvoavatar.h                    |  5 ++
 indra/newview/llvovolume.cpp                  | 70 ++++++++++++++++---
 indra/newview/pipeline.cpp                    |  2 +-
 indra/newview/pipeline.h                      | 57 +++++++--------
 .../skins/default/xui/en/menu_viewer.xml      | 10 +++
 13 files changed, 193 insertions(+), 45 deletions(-)

diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 0c6cf1dfae1..761fc171c46 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2078,6 +2078,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
 	mFaceMask = 0x0;
 	mDetail = detail;
 	mSculptLevel = -2;
+	mSurfaceArea = 1.f; //only calculated for sculpts, defaults to 1 for all other prims
 	mIsMeshAssetLoaded = FALSE;
 	mLODScaleBias.setVec(1,1,1);
 	mHullPoints = NULL;
@@ -3144,6 +3145,8 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
 		{
 			F32 area = sculptGetSurfaceArea();
 
+			mSurfaceArea = area;
+
 			const F32 SCULPT_MAX_AREA = 384.f;
 
 			if (area < SCULPT_MIN_AREA || area > SCULPT_MAX_AREA)
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index afd1ec5eed1..76cf9de613e 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -963,6 +963,7 @@ class LLVolume : public LLRefCount
 	S32	getNumFaces() const;
 	S32 getNumVolumeFaces() const							{ return mVolumeFaces.size(); }
 	F32 getDetail() const									{ return mDetail; }
+	F32 getSurfaceArea() const								{ return mSurfaceArea; }
 	const LLVolumeParams& getParams() const					{ return mParams; }
 	LLVolumeParams getCopyOfParams() const					{ return mParams; }
 	const LLProfile& getProfile() const						{ return *mProfilep; }
@@ -1065,6 +1066,7 @@ class LLVolume : public LLRefCount
 	BOOL mUnique;
 	F32 mDetail;
 	S32 mSculptLevel;
+	F32 mSurfaceArea; //unscaled surface area
 	BOOL mIsMeshAssetLoaded;
 	
 	LLVolumeParams mParams;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1ea623791d6..3acc8a24468 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9024,6 +9024,28 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+  <key>RenderAutoMuteByteLimit</key>
+  <map>
+    <key>Comment</key>
+    <string>Maximum bytes of attachments before an avatar is automatically visually muted (0 for no limit).</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>U32</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
+  <key>RenderAutoMuteSurfaceAreaLimit</key>
+  <map>
+    <key>Comment</key>
+    <string>Maximum surface area of attachments before an avatar is automatically visually muted (0 for no limit).</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
     <key>RenderUseShaderLOD</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index debac9dcbfd..21b21c152a6 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -1077,6 +1077,7 @@ BOOL LLDrawable::isVisible() const
 LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask)
 : LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB)
 {
+	mBridge = this;
 	mDrawable = root;
 	root->setSpatialBridge(this);
 	
@@ -1105,6 +1106,15 @@ LLSpatialBridge::~LLSpatialBridge()
 	{
 		group->mSpatialPartition->remove(this, group);
 	}
+
+	//delete octree here so listeners will still be able to access bridge specific state
+	destroyTree();
+}
+
+void LLSpatialBridge::destroyTree()
+{
+	delete mOctree;
+	mOctree = NULL;
 }
 
 void LLSpatialBridge::updateSpatialExtents()
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 4aa5f32d8a7..5d196a465f6 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1187,6 +1187,8 @@ void LLSpatialGroup::clearOcclusionState(U32 state, S32 mode)
 
 LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
 	mState(0),
+	mGeometryBytes(0),
+	mSurfaceArea(0.f),
 	mBuilt(0.f),
 	mOctreeNode(node),
 	mSpatialPartition(part),
@@ -1412,6 +1414,17 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
 		}
 	}
 	
+	//clean up avatar attachment stats
+	LLSpatialBridge* bridge = mSpatialPartition->asBridge();
+	if (bridge)
+	{
+		if (bridge->mAvatar.notNull())
+		{
+			bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes;
+			bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea;
+		}
+	}
+
 	clearDrawMap();
 	mVertexBuffer = NULL;
 	mBufferMap.clear();
@@ -1767,7 +1780,7 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
 //==============================================
 
 LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 buffer_usage)
-: mRenderByGroup(render_by_group)
+: mRenderByGroup(render_by_group), mBridge(NULL)
 {
 	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
 	mOcclusionEnabled = TRUE;
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 899547ae4d2..6c14ecf4521 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -405,6 +405,9 @@ class LLSpatialGroup : public LLOctreeListener<LLDrawable>
 	bridge_list_t mBridgeList;
 	buffer_map_t mBufferMap; //used by volume buffers to attempt to reuse vertex buffers
 
+	U32 mGeometryBytes; //used by volumes to track how many bytes of geometry data are in this node
+	F32 mSurfaceArea; //used by volumes to track estimated surface area of geometry in this node
+
 	F32 mBuilt;
 	OctreeNode* mOctreeNode;
 	LLSpatialPartition* mSpatialPartition;
@@ -474,8 +477,8 @@ class LLSpatialPartition: public LLGeometryManager
 	BOOL isVisible(const LLVector3& v);
 	bool isHUDPartition() ;
 	
-	virtual LLSpatialBridge* asBridge() { return NULL; }
-	virtual BOOL isBridge() { return asBridge() != NULL; }
+	LLSpatialBridge* asBridge() { return mBridge; }
+	BOOL isBridge() { return asBridge() != NULL; }
 
 	void renderPhysicsShapes();
 	void renderDebug();
@@ -487,6 +490,9 @@ class LLSpatialPartition: public LLGeometryManager
 
 public:
 	LLSpatialGroup::OctreeNode* mOctree;
+	LLSpatialBridge* mBridge; // NULL for non-LLSpatialBridge instances, otherwise, mBridge == this
+							// use a pointer instead of making "isBridge" and "asBridge" virtual so it's safe
+							// to call asBridge() from the destructor
 	BOOL mOcclusionEnabled; // if TRUE, occlusion culling is performed
 	BOOL mInfiniteFarClip; // if TRUE, frustum culling ignores far clip plane
 	U32 mBufferUsage;
@@ -511,8 +517,9 @@ class LLSpatialBridge : public LLDrawable, public LLSpatialPartition
 	
 	LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask);
 	
-	virtual BOOL isSpatialBridge() const		{ return TRUE; }
+	void destroyTree();
 
+	virtual BOOL isSpatialBridge() const		{ return TRUE; }
 	virtual void updateSpatialExtents();
 	virtual void updateBinRadius();
 	virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE);
@@ -523,11 +530,12 @@ class LLSpatialBridge : public LLDrawable, public LLSpatialPartition
 	virtual void shiftPos(const LLVector4a& vec);
 	virtual void cleanupReferences();
 	virtual LLSpatialPartition* asPartition()		{ return this; }
-	virtual LLSpatialBridge* asBridge()				{ return this; }
-	
+		
 	virtual LLCamera transformCamera(LLCamera& camera);
 	
 	LLDrawable* mDrawable;
+	LLPointer<LLVOAvatar> mAvatar;
+
 };
 
 class LLCullResult 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 0104d35e53a..e6619e3e084 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -947,6 +947,10 @@ U32 info_display_from_string(std::string info_display)
 	{
 		return LLPipeline::RENDER_DEBUG_COMPOSITION;
 	}
+	else if ("attachment bytes" == info_display)
+	{
+		return LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES;
+	}
 	else if ("glow" == info_display)
 	{
 		return LLPipeline::RENDER_DEBUG_GLOW;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 68637a7ed9f..bc7f5a9744a 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -651,6 +651,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
 	LLViewerObject(id, pcode, regionp),
 	mIsDummy(FALSE),
 	mSpecialRenderMode(0),
+	mAttachmentGeometryBytes(0),
+	mAttachmentSurfaceArea(0.f),
 	mTurning(FALSE),
 	mPelvisToFoot(0.f),
 	mLastSkeletonSerialNum( 0 ),
@@ -3363,6 +3365,16 @@ void LLVOAvatar::slamPosition()
 	mRoot.updateWorldMatrixChildren();
 }
 
+bool LLVOAvatar::isVisuallyMuted()
+{
+	static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit");
+	static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit");
+	
+	return LLMuteList::getInstance()->isMuted(getID()) ||
+			(mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) ||
+			(mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f);
+}
+
 //------------------------------------------------------------------------
 // updateCharacter()
 // called on both your avatar and other avatars
@@ -3429,8 +3441,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 		size.setSub(ext[1],ext[0]);
 		F32 mag = size.getLength3().getF32()*0.5f;
 
+		
 		F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f);
-		if (LLMuteList::getInstance()->isMuted(getID()))
+		if (isVisuallyMuted())
 		{ // muted avatars update at 16 hz
 			mUpdatePeriod = 16;
 		}
@@ -8333,6 +8346,11 @@ void LLVOAvatar::idleUpdateRenderCost()
 
 	static std::set<LLUUID> all_textures;
 
+	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES))
+	{ //set debug text to attachment geometry bytes here so render cost will override
+		setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea));
+	}
+
 	if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
 	{
 		return;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 59796370ae6..4cd61cecf95 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -380,6 +380,8 @@ class LLVOAvatar :
 
 public:
 	U32 		renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
+	bool		isVisuallyMuted();
+
 	U32 		renderRigid();
 	U32 		renderSkinned(EAvatarRenderPass pass);
 	F32			getLastSkinTime() { return mLastSkinTime; }
@@ -391,6 +393,9 @@ class LLVOAvatar :
 	static void	restoreGL();
 	BOOL 		mIsDummy; // for special views
 	S32			mSpecialRenderMode; // special lighting
+	U32			mAttachmentGeometryBytes; //number of bytes in attached geometry
+	F32			mAttachmentSurfaceArea; //estimated surface area of attachments
+
 private:
 	bool		shouldAlphaMask();
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e68fd2697a3..7492a067844 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4097,6 +4097,32 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 
 	LLFastTimer ftm2(FTM_REBUILD_VOLUME_VB);
 
+	LLVOAvatar* pAvatarVO = NULL;
+
+	LLSpatialBridge* bridge = group->mSpatialPartition->asBridge();
+	if (bridge)
+	{
+		if (bridge->mAvatar.isNull())
+		{
+			LLViewerObject* vobj = bridge->mDrawable->getVObj();
+			if (vobj)
+			{
+				bridge->mAvatar = vobj->getAvatar();
+			}
+		}
+
+		pAvatarVO = bridge->mAvatar;
+	}
+
+	if (pAvatarVO)
+	{
+		pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes;
+		pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea;
+	}
+
+	group->mGeometryBytes = 0;
+	group->mSurfaceArea = 0;
+	
 	group->clearDrawMap();
 
 	mFaceList.clear();
@@ -4133,12 +4159,24 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 
 		LLVOVolume* vobj = drawablep->getVOVolume();
 
+		if (!vobj)
+		{
+			continue;
+		}
+
 		if (vobj->isMesh() &&
 			(vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded() || !gMeshRepo.meshRezEnabled()))
 		{
 			continue;
 		}
 
+		LLVolume* volume = vobj->getVolume();
+		if (volume)
+		{
+			const LLVector3& scale = vobj->getScale();
+			group->mSurfaceArea += volume->getSurfaceArea() * llmax(llmax(scale.mV[0], scale.mV[1]), scale.mV[2]);
+		}
+
 		llassert_always(vobj);
 		vobj->updateTextureVirtualSize(true);
 		vobj->preRebuild();
@@ -4183,7 +4221,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 				//Determine if we've received skininfo that contains an
 				//alternate bind matrix - if it does then apply the translational component
 				//to the joints of the avatar.
-				LLVOAvatar* pAvatarVO = vobj->getAvatar();
 				bool pelvisGotSet = false;
 
 				if ( pAvatarVO )
@@ -4253,13 +4290,16 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 
 					if (type == LLDrawPool::POOL_ALPHA)
 					{
-						if (te->getFullbright())
+						if (te->getColor().mV[3] > 0.f)
 						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA);
-						}
-						else
-						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA);
+							if (te->getFullbright())
+							{
+								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA);
+							}
+							else
+							{
+								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA);
+							}
 						}
 					}
 					else if (te->getShiny())
@@ -4392,8 +4432,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 					}
 					else
 					{
-						drawablep->setState(LLDrawable::HAS_ALPHA);
-						alpha_faces.push_back(facep);
+						if (te->getColor().mV[3] > 0.f)
+						{
+							drawablep->setState(LLDrawable::HAS_ALPHA);
+							alpha_faces.push_back(facep);
+						}
 					}
 				}
 				else
@@ -4510,6 +4553,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 	}
 
 	mFaceList.clear();
+
+	if (pAvatarVO)
+	{
+		pAvatarVO->mAttachmentGeometryBytes += group->mGeometryBytes;
+		pAvatarVO->mAttachmentSurfaceArea += group->mSurfaceArea;
+	}
 }
 
 static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry");
@@ -4838,6 +4887,9 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 			}
 		}
 
+		group->mGeometryBytes += buffer->getSize() + buffer->getIndicesSize();
+
+
 		buffer_map[mask][*face_iter].push_back(buffer);
 
 		//add face geometry
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 737c5b51a2f..df8f8793d18 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -9420,7 +9420,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 
 	assertInitialized();
 
-	BOOL muted = LLMuteList::getInstance()->isMuted(avatar->getID());
+	bool muted = avatar->isVisuallyMuted();		
 
 	pushRenderTypeMask();
 	
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 2815d736e4a..9c78048c46a 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -432,34 +432,35 @@ class LLPipeline
 
 	enum LLRenderDebugMask
 	{
-		RENDER_DEBUG_COMPOSITION		= 0x0000001,
-		RENDER_DEBUG_VERIFY				= 0x0000002,
-		RENDER_DEBUG_BBOXES				= 0x0000004,
-		RENDER_DEBUG_OCTREE				= 0x0000008,
-		RENDER_DEBUG_WIND_VECTORS		= 0x0000010,
-		RENDER_DEBUG_OCCLUSION			= 0x0000020,
-		RENDER_DEBUG_POINTS				= 0x0000040,
-		RENDER_DEBUG_TEXTURE_PRIORITY	= 0x0000080,
-		RENDER_DEBUG_TEXTURE_AREA		= 0x0000100,
-		RENDER_DEBUG_FACE_AREA			= 0x0000200,
-		RENDER_DEBUG_PARTICLES			= 0x0000400,
-		RENDER_DEBUG_GLOW				= 0x0000800,
-		RENDER_DEBUG_TEXTURE_ANIM		= 0x0001000,
-		RENDER_DEBUG_LIGHTS				= 0x0002000,
-		RENDER_DEBUG_BATCH_SIZE			= 0x0004000,
-		RENDER_DEBUG_ALPHA_BINS			= 0x0008000,
-		RENDER_DEBUG_RAYCAST            = 0x0010000,
-		RENDER_DEBUG_SHAME				= 0x0020000,
-		RENDER_DEBUG_SHADOW_FRUSTA		= 0x0040000,
-		RENDER_DEBUG_SCULPTED           = 0x0080000,
-		RENDER_DEBUG_AVATAR_VOLUME      = 0x0100000,
-		RENDER_DEBUG_BUILD_QUEUE		= 0x0200000,
-		RENDER_DEBUG_AGENT_TARGET       = 0x0400000,
-		RENDER_DEBUG_UPDATE_TYPE		= 0x0800000,
-		RENDER_DEBUG_PHYSICS_SHAPES     = 0x1000000,
-		RENDER_DEBUG_NORMALS	        = 0x2000000,
-		RENDER_DEBUG_LOD_INFO	        = 0x4000000,
-		RENDER_DEBUG_RENDER_COMPLEXITY  = 0x8000000
+		RENDER_DEBUG_COMPOSITION		= 0x00000001,
+		RENDER_DEBUG_VERIFY				= 0x00000002,
+		RENDER_DEBUG_BBOXES				= 0x00000004,
+		RENDER_DEBUG_OCTREE				= 0x00000008,
+		RENDER_DEBUG_WIND_VECTORS		= 0x00000010,
+		RENDER_DEBUG_OCCLUSION			= 0x00000020,
+		RENDER_DEBUG_POINTS				= 0x00000040,
+		RENDER_DEBUG_TEXTURE_PRIORITY	= 0x00000080,
+		RENDER_DEBUG_TEXTURE_AREA		= 0x00000100,
+		RENDER_DEBUG_FACE_AREA			= 0x00000200,
+		RENDER_DEBUG_PARTICLES			= 0x00000400,
+		RENDER_DEBUG_GLOW				= 0x00000800,
+		RENDER_DEBUG_TEXTURE_ANIM		= 0x00001000,
+		RENDER_DEBUG_LIGHTS				= 0x00002000,
+		RENDER_DEBUG_BATCH_SIZE			= 0x00004000,
+		RENDER_DEBUG_ALPHA_BINS			= 0x00008000,
+		RENDER_DEBUG_RAYCAST            = 0x00010000,
+		RENDER_DEBUG_SHAME				= 0x00020000,
+		RENDER_DEBUG_SHADOW_FRUSTA		= 0x00040000,
+		RENDER_DEBUG_SCULPTED           = 0x00080000,
+		RENDER_DEBUG_AVATAR_VOLUME      = 0x00100000,
+		RENDER_DEBUG_BUILD_QUEUE		= 0x00200000,
+		RENDER_DEBUG_AGENT_TARGET       = 0x00400000,
+		RENDER_DEBUG_UPDATE_TYPE		= 0x00800000,
+		RENDER_DEBUG_PHYSICS_SHAPES     = 0x01000000,
+		RENDER_DEBUG_NORMALS	        = 0x02000000,
+		RENDER_DEBUG_LOD_INFO	        = 0x04000000,
+		RENDER_DEBUG_RENDER_COMPLEXITY  = 0x08000000,
+		RENDER_DEBUG_ATTACHMENT_BYTES	= 0x10000000,
 	};
 
 public:
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index ec2dd102480..b3a0c3379d3 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2499,6 +2499,16 @@
           <menu_item_check.on_click
            function="Advanced.ToggleInfoDisplay"
            parameter="rendercomplexity" />
+        </menu_item_check>
+        <menu_item_check
+         label="Attachment Bytes"
+         name="attachment bytes">
+          <menu_item_check.on_check
+           function="Advanced.CheckInfoDisplay"
+           parameter="attachment bytes" />
+          <menu_item_check.on_click
+           function="Advanced.ToggleInfoDisplay"
+           parameter="attachment bytes" />
         </menu_item_check>
 		<menu_item_check
          label="Sculpt"
-- 
GitLab


From 0bf73f73b8167900a2582a494d600fa6e5189b7e Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 20 Jan 2012 15:48:51 -0700
Subject: [PATCH 626/933] trivial: remove debug code for SH-2828 [crashhunters]
 Crash in LLRefCount::unref(), bad stacks

---
 indra/newview/llviewerwindow.cpp | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 0534246559c..5f64dba1004 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1960,43 +1960,34 @@ void LLViewerWindow::shutdownViews()
 	// clean up warning logger
 	LLError::removeRecorder(RecordToChatConsole::getInstance());
 
-	llinfos << "Warning logger is cleaned." << llendl ;
-
 	delete mDebugText;
 	mDebugText = NULL;
 	
-	llinfos << "DebugText deleted." << llendl ;
-
 	// Cleanup global views
 	if (gMorphView)
 	{
 		gMorphView->setVisible(FALSE);
 	}
-	llinfos << "Global views cleaned." << llendl ;
-
+	
 	// DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open
 	// will crump with LL_ERRS.
 	LLModalDialog::shutdownModals();
-	llinfos << "LLModalDialog shut down." << llendl; 
-
+	
 	// destroy the nav bar, not currently part of gViewerWindow
 	// *TODO: Make LLNavigationBar part of gViewerWindow
 	if (LLNavigationBar::instanceExists())
 	{
 		delete LLNavigationBar::getInstance();
 	}
-	llinfos << "LLNavigationBar destroyed." << llendl ;
-
+	
 	// destroy menus after instantiating navbar above, as it needs
 	// access to gMenuHolder
 	cleanup_menus();
-	llinfos << "menus destroyed." << llendl ;
-
+	
 	// Delete all child views.
 	delete mRootView;
 	mRootView = NULL;
-	llinfos << "RootView deleted." << llendl ;
-
+	
 	// Automatically deleted as children of mRootView.  Fix the globals.
 	gStatusBar = NULL;
 	gIMMgr = NULL;
-- 
GitLab


From c8a2f6515a47c625d97802bd9f7bd833be65fe2c Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 20 Jan 2012 16:10:32 -0800
Subject: [PATCH 627/933] EXP-1799 FIX -- Replace and Add to Outfit options
 appear as grayed out in Inventory

* Refactored LLFolderBridge::buildContextMenu fetch to clear and rebuild basic
  context menu options after the fetch rather than trying to merge the two.
---
 indra/newview/llinventorybridge.cpp | 86 ++++++++++++++++++-----------
 indra/newview/llinventorybridge.h   |  8 ++-
 2 files changed, 59 insertions(+), 35 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 97e61f4c997..472be8cf5c1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -519,6 +519,8 @@ void hide_context_entries(LLMenuGL& menu,
 			{
 				menu_item->setVisible(FALSE);
 			}
+
+			menu_item->setEnabled(FALSE);
 		}
 		else
 		{
@@ -601,13 +603,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 			{
 				items.push_back(std::string("Marketplace Separator"));
 
-				bool copyable = true;
-				LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
-				if (inv_item)
-				{
-					copyable = inv_item->getPermissions().allowCopyBy(gAgent.getID());
-				}
-
 				items.push_back(std::string("Merchant Copy"));
 				if (!canListOnMarketplaceNow())
 				{
@@ -1138,12 +1133,6 @@ bool LLInvFVBridge::canListOnMarketplace() const
 		return false;
 	}
 	
-	const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
-	if (outbox_id.isNull())
-	{
-		return false;
-	}
-
 	LLViewerInventoryItem * item = model->getItem(mUUID);
 	if (item)
 	{
@@ -2415,7 +2404,6 @@ class LLRightClickInventoryFetchObserver : public LLInventoryFetchItemsObserver
 		delete this;
 	}
 
-
 protected:
 	LLUUID mCatID;
 	bool mCopyItems;
@@ -2945,12 +2933,38 @@ void LLFolderBridge::staticFolderOptionsMenu()
 	LLFolderBridge* selfp = sSelf.get();
 	if (selfp)
 	{
-		selfp->folderOptionsMenu();
+		selfp->folderOptionsMenuAfterFetch();
 	}
 }
 
-void LLFolderBridge::folderOptionsMenu()
+void LLFolderBridge::folderOptionsMenuAfterFetch()
 {
+	const U32 flags = mContextMenuFlags;
+
+	mItems.clear();
+	mDisabledItems.clear();
+	mContextMenuFlags = 0x0;
+
+	LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get());
+	if (!menup) return;
+
+	// Reset the menu
+	{
+		const LLView::child_list_t *list = menup->getChildList();
+
+		LLView::child_list_t::const_iterator menu_itor;
+		for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor)
+		{
+			(*menu_itor)->setVisible(FALSE);
+			(*menu_itor)->pushVisible(TRUE);
+			(*menu_itor)->setEnabled(TRUE);
+		}
+	}
+
+	// Build basic menu back up
+	buildContextMenuBaseOptions(*menup, flags);
+
+	// Build folder specific options back up
 	LLInventoryModel* model = getInventoryModel();
 	if(!model) return;
 
@@ -3032,15 +3046,12 @@ void LLFolderBridge::folderOptionsMenu()
 		}
 		mItems.push_back(std::string("Outfit Separator"));
 	}
-	LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get());
-	if (menup)
-	{
-		hide_context_entries(*menup, mItems, mDisabledItems);
 
-		// Reposition the menu, in case we're adding items to an existing menu.
-		menup->needsArrange();
-		menup->arrangeAndClear();
-	}
+	hide_context_entries(*menup, mItems, mDisabledItems);
+
+	// Reposition the menu, in case we're adding items to an existing menu.
+	menup->needsArrange();
+	menup->arrangeAndClear();
 }
 
 BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type)
@@ -3055,17 +3066,11 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv
 	return ((item_array.count() > 0) ? TRUE : FALSE );
 }
 
-// Flags unused
-void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
+void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags)
 {
-	mItems.clear();
-	mDisabledItems.clear();
-
-	lldebugs << "LLFolderBridge::buildContextMenu()" << llendl;
-
-//	menuentry_vec_t disabled_items;
 	LLInventoryModel* model = getInventoryModel();
-	if(!model) return;
+	llassert(model != NULL);
+
 	const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
 	const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
 
@@ -3186,6 +3191,21 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 			mDisabledItems.push_back(std::string("Share"));
 		}
 	}
+}
+
+// Flags unused
+void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
+{
+	mItems.clear();
+	mDisabledItems.clear();
+	mContextMenuFlags = flags;
+
+	lldebugs << "LLFolderBridge::buildContextMenu()" << llendl;
+
+	LLInventoryModel* model = getInventoryModel();
+	if(!model) return;
+
+	buildContextMenuBaseOptions(menu, flags);
 
 	hide_context_entries(menu, mItems, mDisabledItems);
 
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index cb378b7d7a3..56301ce728f 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -235,7 +235,8 @@ class LLFolderBridge : public LLInvFVBridge
 				   const LLUUID& uuid) :
 		LLInvFVBridge(inventory, root, uuid),
 		mCallingCards(FALSE),
-		mWearables(FALSE)
+		mWearables(FALSE),
+		mContextMenuFlags(0x0)
 	{}
 		
 	BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg);
@@ -282,6 +283,8 @@ class LLFolderBridge : public LLInvFVBridge
 	LLHandle<LLFolderBridge> getHandle() { mHandle.bind(this); return mHandle; }
 
 protected:
+	void buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags);
+
 	//--------------------------------------------------------------------
 	// Menu callbacks
 	//--------------------------------------------------------------------
@@ -317,7 +320,7 @@ class LLFolderBridge : public LLInvFVBridge
 public:
 	static LLHandle<LLFolderBridge> sSelf;
 	static void staticFolderOptionsMenu();
-	void folderOptionsMenu();
+	void folderOptionsMenuAfterFetch();
 
 private:
 	BOOL				mCallingCards;
@@ -325,6 +328,7 @@ class LLFolderBridge : public LLInvFVBridge
 	LLHandle<LLView>	mMenu;
 	menuentry_vec_t		mItems;
 	menuentry_vec_t		mDisabledItems;
+	U32					mContextMenuFlags;
 	LLRootHandle<LLFolderBridge> mHandle;
 };
 
-- 
GitLab


From 039cd701c4fa1dcc32bc63f57aab5a5f995f7498 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 20 Jan 2012 16:36:25 -0800
Subject: [PATCH 628/933] * Modified so "Copy" context menu option is not
 available for "no copy" items.

---
 indra/newview/llinventorybridge.cpp | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 472be8cf5c1..bce3511c80c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1654,11 +1654,7 @@ BOOL LLItemBridge::isItemCopyable() const
 			return FALSE;
 		}
 
-		// All items can be copied in god mode since you can
-		// at least paste-as-link the item, though you 
-		// still may not be able paste the item.
-		return TRUE;
-		// return (item->getPermissions().allowCopyBy(gAgent.getID()));
+		return item->getPermissions().allowCopyBy(gAgent.getID()) || gSavedSettings.getBOOL("InventoryLinking");
 	}
 	return FALSE;
 }
@@ -1771,12 +1767,8 @@ BOOL LLFolderBridge::isUpToDate() const
 
 BOOL LLFolderBridge::isItemCopyable() const
 {
-	if (gSavedSettings.getBOOL("InventoryLinking"))
-	{
-		// Can copy folders to paste-as-link, but not for straight paste.
-		return TRUE;
-	}
-	return FALSE;
+	// Can copy folders to paste-as-link, but not for straight paste.
+	return gSavedSettings.getBOOL("InventoryLinking");
 }
 
 BOOL LLFolderBridge::copyToClipboard() const
-- 
GitLab


From 6bbcf67db399a46592086c623118d18163a70452 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 20 Jan 2012 17:03:04 -0800
Subject: [PATCH 629/933] EXP-1152 : Fix width computation in inventory panel
 so that the horizontal slider shows up only when really needed.

---
 indra/newview/llfolderviewitem.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 8d6114c8873..9944a9dd3d5 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -423,7 +423,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation)
 		: 0;
 	if (mLabelWidthDirty)
 	{
-		mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mSearchableLabel); 
+		mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix); 
 		mLabelWidthDirty = false;
 	}
 
-- 
GitLab


From a8243c11c4188de46f3d321cb6d8c87fdae18b47 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 20 Jan 2012 18:39:59 -0800
Subject: [PATCH 630/933] EXP-1823 : Don't display the do not show preview
 message on item we have no preview method for in the first place...

---
 indra/newview/llviewermessage.cpp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 6bb13bb8d79..716f47150e3 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -135,6 +135,7 @@ extern BOOL gDebugClicks;
 
 // function prototypes
 bool check_offer_throttle(const std::string& from_name, bool check_only);
+bool check_asset_previewable(const LLAssetType::EType asset_type);
 static void process_money_balance_reply_extended(LLMessageSystem* msg);
 
 //inventory offer throttle globals
@@ -1147,7 +1148,18 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
 		}
 	}
 }
- 
+
+// Return "true" if we have a preview method for that asset type, "false" otherwise
+bool check_asset_previewable(const LLAssetType::EType asset_type)
+{
+	return	(asset_type == LLAssetType::AT_NOTECARD)  || 
+			(asset_type == LLAssetType::AT_LANDMARK)  ||
+			(asset_type == LLAssetType::AT_TEXTURE)   ||
+			(asset_type == LLAssetType::AT_ANIMATION) ||
+			(asset_type == LLAssetType::AT_SCRIPT)    ||
+			(asset_type == LLAssetType::AT_SOUND);
+}
+
 void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name)
 {
 	for (uuid_vec_t::const_iterator obj_iter = objects.begin();
@@ -1171,7 +1183,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
 
 		// Either an inventory item or a category.
 		const LLInventoryItem* item = dynamic_cast<const LLInventoryItem*>(obj);
-		if (item)
+		if (item && check_asset_previewable(asset_type))
 		{
 			////////////////////////////////////////////////////////////////////////////////
 			// Special handling for various types.
@@ -1246,6 +1258,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
 						LLFloaterReg::showInstance("preview_sound", LLSD(obj_id), take_focus);
 						break;
 					default:
+						LL_DEBUGS("Messaging") << "No preview method for previewable asset type : " << LLAssetType::lookupHumanReadable(asset_type)  << LL_ENDL;
 						break;
 				}
 			}
-- 
GitLab


From 535f1b23e83dc88863715c0c5be86b19ed0e5031 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 17:41:40 +0200
Subject: [PATCH 631/933] EXP-1826 WIP Potential fix: prevent dereferencing
 invalid pointer.

---
 indra/newview/llagentwearables.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 13b62cb019d..dd7e509e8d3 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -816,7 +816,10 @@ void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index)
 	if (wearable)
 	{
 		mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
-		gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE);
+		if (isAgentAvatarValid())
+		{
+			gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE);
+		}
 		wearable->setLabelUpdated();
 	}
 }
-- 
GitLab


From b2ef7661a0893d4da884849236441d9ab0552606 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 17:44:33 +0200
Subject: [PATCH 632/933] EXP-1821 FIXED Don't open group chat for the selected
 group if user double-clicks on empty space in the group list.

---
 indra/newview/llgrouplist.cpp | 16 ++++++++++++++++
 indra/newview/llgrouplist.h   |  1 +
 2 files changed, 17 insertions(+)

diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index bbf66ca7503..129cddda455 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -123,6 +123,22 @@ BOOL LLGroupList::handleRightMouseDown(S32 x, S32 y, MASK mask)
 	return handled;
 }
 
+// virtual
+BOOL LLGroupList::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+	BOOL handled = LLView::handleDoubleClick(x, y, mask);
+	// Handle double click only for the selected item in the list, skip clicks on empty space.
+	if (handled)
+	{
+		if (mDoubleClickSignal)
+		{
+			(*mDoubleClickSignal)(this, x, y, mask);
+		}
+	}
+
+	return handled;
+}
+
 void LLGroupList::setNameFilter(const std::string& filter)
 {
 	std::string filter_upper = filter;
diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h
index d7051db891c..8abf14b3d03 100644
--- a/indra/newview/llgrouplist.h
+++ b/indra/newview/llgrouplist.h
@@ -51,6 +51,7 @@ class LLGroupList: public LLFlatListViewEx, public LLOldEvents::LLSimpleListener
 
 	virtual void draw(); // from LLView
 	/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); // from LLView
+	/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); // from LLView
 
 	void setNameFilter(const std::string& filter);
 	void toggleIcons();
-- 
GitLab


From f324e67780cb002149b11d0fbf49f5d1794b7299 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 17:49:09 +0200
Subject: [PATCH 633/933] EXP-1801 FIXED Fixed the "snapshot to disk" shortcut
 (Ctrl+`) to respect preferred snapshot format.

Restoring mistakenly removed code.
---
 indra/newview/llviewermenufile.cpp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 7e830e14bf2..8ee514e7c24 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -527,8 +527,22 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
 									   FALSE))
 		{
 			gViewerWindow->playSnapshotAnimAndSound();
-			
-			LLPointer<LLImageFormatted> formatted = new LLImagePNG;
+			LLPointer<LLImageFormatted> formatted;
+			switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat")))
+			{
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
+				formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
+				break;
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
+				formatted = new LLImagePNG;
+				break;
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
+				formatted = new LLImageBMP;
+				break;
+			default:
+				llwarns << "Unknown Local Snapshot format" << llendl;
+				return true;
+			}
 			formatted->enableOverSize() ;
 			formatted->encode(raw, 0);
 			formatted->disableOverSize() ;
-- 
GitLab


From 8f60dc01366732713be8290a84bc50ba10059e73 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 17:50:04 +0200
Subject: [PATCH 634/933] EXT-1836 FIXED Avoid assigning NULL to an
 std::string.

---
 indra/newview/llfilepicker.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 8024755e866..360e35f6d3d 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -1073,8 +1073,11 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer
 	}
 
 	// set the default path for this usage context.
-	picker->mContextToPathMap[picker->mCurContextName] =
-		gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget));
+	const char* cur_folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget));
+	if (cur_folder != NULL)
+	{
+		picker->mContextToPathMap[picker->mCurContextName] = cur_folder;
+	}
 
 	gtk_widget_destroy(widget);
 	gtk_main_quit();
-- 
GitLab


From 0c528df35ed6d7ecf6b847983f842aa38ef1636a Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 23 Jan 2012 20:17:38 +0200
Subject: [PATCH 635/933] EXP-1671 FIXED Hide "Translate chat" checkbox when
 translation is not configured.

---
 .../newview/llfloatertranslationsettings.cpp  |  2 +-
 indra/newview/llnearbychatbar.cpp             |  6 +-
 indra/newview/llnearbychatbar.h               |  2 +-
 .../default/xui/en/panel_nearby_chat.xml      | 84 ++++++++++++-------
 4 files changed, 61 insertions(+), 33 deletions(-)

diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp
index 428a02e9f05..1a17183efdd 100644
--- a/indra/newview/llfloatertranslationsettings.cpp
+++ b/indra/newview/llfloatertranslationsettings.cpp
@@ -293,6 +293,6 @@ void LLFloaterTranslationSettings::onBtnOK()
 	gSavedSettings.setString("TranslationService", getSelectedService());
 	gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey());
 	gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey());
-	LLNearbyChatBar::getInstance()->enableTranslationCheckbox(LLTranslate::isTranslationConfigured());
+	LLNearbyChatBar::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured());
 	closeFloater(false);
 }
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 4512c14b7a8..b4224e30e68 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -124,7 +124,7 @@ BOOL LLNearbyChatBar::postBuild()
 // virtual
 void LLNearbyChatBar::onOpen(const LLSD& key)
 {
-	enableTranslationCheckbox(LLTranslate::isTranslationConfigured());
+	showTranslationCheckbox(LLTranslate::isTranslationConfigured());
 }
 
 bool LLNearbyChatBar::applyRectControl()
@@ -170,9 +170,9 @@ void LLNearbyChatBar::showHistory()
 	}
 }
 
-void LLNearbyChatBar::enableTranslationCheckbox(BOOL enable)
+void LLNearbyChatBar::showTranslationCheckbox(BOOL show)
 {
-	getChild<LLUICtrl>("translate_chat_checkbox")->setEnabled(enable);
+	getChild<LLUICtrl>("translate_chat_checkbox_lp")->setVisible(show);
 }
 
 void LLNearbyChatBar::draw()
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index baf12a06ea0..8547cf0bced 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -61,7 +61,7 @@ class LLNearbyChatBar :	public LLFloater
 	static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
 
 	void showHistory();
-	void enableTranslationCheckbox(BOOL enable);
+	void showTranslationCheckbox(BOOL show);
 	/*virtual*/void setMinimized(BOOL b);
 
 protected:
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
index d492f9bd68b..6cfd929bc0c 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
@@ -1,35 +1,63 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel
- height="300"
  follows="all"
+ height="300"
+ help_topic="nearby_chat"
  layout="topleft"
  name="nearby_chat"
- help_topic="nearby_chat"
  width="320">
-            <check_box
-             bottom_delta="36"
-             control_name="TranslateChat"
-             enabled="true"
-             height="16"
-             label="Translate chat"
-             layout="topleft"
-             left="5"
-             name="translate_chat_checkbox"
-             width="230" />
-  <chat_history
-    parse_urls="true"
-    bg_readonly_color="ChatHistoryBgColor"
-    bg_writeable_color="ChatHistoryBgColor"
-    follows="all"
-    left="5"
-    top_delta="17"
-    layout="topleft"
-    height="260"
-    name="chat_history"
-    parse_highlights="true"
-    text_color="ChatHistoryTextColor"
-    text_readonly_color="ChatHistoryTextColor"
-    right_widget_pad="5"
-    left_widget_pad="0"
-    width="315" />
+  <layout_stack
+   follows="left|top|right"
+   height="295"
+   layout="topleft"
+   left="0"
+   name="stack"
+   top="5"
+   orientation="vertical"
+   width="320">
+    <layout_panel
+     auto_resize="false"
+     height="26"
+     layout="topleft"
+     left_delta="0"
+     name="translate_chat_checkbox_lp"
+     top_delta="0"
+     visible="true"
+     width="313">
+      <check_box
+       top="10"
+       control_name="TranslateChat"
+       enabled="true"
+       height="16"
+       label="Translate chat"
+       layout="topleft"
+       left="5"
+       name="translate_chat_checkbox"
+       width="300" />
+    </layout_panel>
+    <layout_panel
+     auto_resize="true"
+     height="277"
+     left_delta="0"
+     layout="topleft"
+     name="chat_history_lp"
+     width="318">
+      <chat_history
+       bg_readonly_color="ChatHistoryBgColor"
+       bg_writeable_color="ChatHistoryBgColor"
+       follows="all"
+       layout="topleft"
+       left="5"
+       left_widget_pad="0"
+       height="272"
+       name="chat_history"
+       parse_highlights="true"
+       parse_urls="true"
+       right_widget_pad="5"
+       text_color="ChatHistoryTextColor"
+       text_readonly_color="ChatHistoryTextColor"
+       top="0"
+       width="313" />
+    </layout_panel>
+  </layout_stack>
 </panel>
-- 
GitLab


From 3ebaa5b0a69f7ae63c74bc4a1a80a5ec5b988569 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 23 Jan 2012 11:23:02 -0800
Subject: [PATCH 636/933] made add() method chainable on Multiple<> params

---
 indra/llxuixml/llinitparam.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index ab209577609..4ab1d891a36 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -1253,15 +1253,16 @@ namespace LLInitParam
 			return mValues.back();
 		}
 
-		void add(const value_t& item)
+		self_t& add(const value_t& item)
 		{
 			param_value_t param_value;
 			param_value.setValue(item);
 			mValues.push_back(param_value);
 			setProvided();
+			return *this;
 		}
 
-		void add(const typename name_value_lookup_t::name_t& name)
+		self_t& add(const typename name_value_lookup_t::name_t& name)
 		{
 			value_t value;
 
@@ -1271,6 +1272,8 @@ namespace LLInitParam
 				add(value);
 				mValues.back().setValueName(name);
 			}
+
+			return *this;
 		}
 
 		// implicit conversion
@@ -1441,13 +1444,14 @@ namespace LLInitParam
 			return mValues.back();
 		}
 
-		void add(const value_t& item)
+		self_t& add(const value_t& item)
 		{
 			mValues.push_back(item);
 			setProvided();
+			return *this;
 		}
 
-		void add(const typename name_value_lookup_t::name_t& name)
+		self_t& add(const typename name_value_lookup_t::name_t& name)
 		{
 			value_t value;
 
@@ -1457,6 +1461,7 @@ namespace LLInitParam
 				add(value);
 				mValues.back().setValueName(name);
 			}
+			return *this;
 		}
 
 		// implicit conversion
-- 
GitLab


From e2d4309ba56b103bbcd215b09c9d877ceb71dc38 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 23 Jan 2012 11:45:47 -0800
Subject: [PATCH 637/933] EXP-1799 FIX -- Replace and Add to Outfit options and
 Copy to Merchant Outbox options can appear in invalid state when a valid
 folder is last selection EXP-1834 FIX -- Right click context menus on Folders
 in Merchant Outbox and Library folders can show all inventory options
 including admin options EXP-1835 FIX -- Right clicking on a folder and
 selecting New Folder creates folder under My Inventory not within selected
 folder

* Updated folder context menu building to build full options in one step or
  trigger a load which will rebuild top-level context menu for all selected
  items when complete.  Previous code had an implicit assumption that the
  selected folder was the only selection after background fetch.
---
 indra/newview/llinventorybridge.cpp | 257 ++++++++++++----------------
 indra/newview/llinventorybridge.h   |   9 +-
 2 files changed, 116 insertions(+), 150 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index bce3511c80c..9e21e2fceb0 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2923,127 +2923,11 @@ void LLFolderBridge::pasteLinkFromClipboard()
 void LLFolderBridge::staticFolderOptionsMenu()
 {
 	LLFolderBridge* selfp = sSelf.get();
-	if (selfp)
-	{
-		selfp->folderOptionsMenuAfterFetch();
-	}
-}
-
-void LLFolderBridge::folderOptionsMenuAfterFetch()
-{
-	const U32 flags = mContextMenuFlags;
-
-	mItems.clear();
-	mDisabledItems.clear();
-	mContextMenuFlags = 0x0;
-
-	LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get());
-	if (!menup) return;
-
-	// Reset the menu
-	{
-		const LLView::child_list_t *list = menup->getChildList();
-
-		LLView::child_list_t::const_iterator menu_itor;
-		for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor)
-		{
-			(*menu_itor)->setVisible(FALSE);
-			(*menu_itor)->pushVisible(TRUE);
-			(*menu_itor)->setEnabled(TRUE);
-		}
-	}
-
-	// Build basic menu back up
-	buildContextMenuBaseOptions(*menup, flags);
-
-	// Build folder specific options back up
-	LLInventoryModel* model = getInventoryModel();
-	if(!model) return;
-
-	const LLInventoryCategory* category = model->getCategory(mUUID);
-	if(!category) return;
-
-	const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
-	if (trash_id == mUUID) return;
-	if (isItemInTrash()) return;
-	if (!isAgentInventory()) return;
-	if (isOutboxFolder()) return;
-
-	LLFolderType::EType type = category->getPreferredType();
-	const bool is_system_folder = LLFolderType::lookupIsProtectedType(type);
-	// BAP change once we're no longer treating regular categories as ensembles.
-	const bool is_ensemble = (type == LLFolderType::FT_NONE ||
-							  LLFolderType::lookupIsEnsembleType(type));
-
-	// Only enable calling-card related options for non-system folders.
-	if (!is_system_folder)
-	{
-		LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
-		if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard))
-		{
-			mItems.push_back(std::string("Calling Card Separator"));
-			mItems.push_back(std::string("Conference Chat Folder"));
-			mItems.push_back(std::string("IM All Contacts In Folder"));
-		}
-	}
-
-	if (!isItemRemovable())
-	{
-		mDisabledItems.push_back(std::string("Delete"));
-	}
 
-#ifndef LL_RELEASE_FOR_DOWNLOAD
-	if (LLFolderType::lookupIsProtectedType(type))
+	if (selfp && selfp->mRoot)
 	{
-		mItems.push_back(std::string("Delete System Folder"));
+		selfp->mRoot->updateMenu();
 	}
-#endif
-
-	// wearables related functionality for folders.
-	//is_wearable
-	LLFindWearables is_wearable;
-	LLIsType is_object( LLAssetType::AT_OBJECT );
-	LLIsType is_gesture( LLAssetType::AT_GESTURE );
-
-	if (mWearables ||
-		checkFolderForContentsOfType(model, is_wearable)  ||
-		checkFolderForContentsOfType(model, is_object) ||
-		checkFolderForContentsOfType(model, is_gesture) )
-	{
-		mItems.push_back(std::string("Folder Wearables Separator"));
-
-		// Only enable add/replace outfit for non-system folders.
-		if (!is_system_folder)
-		{
-			// Adding an outfit onto another (versus replacing) doesn't make sense.
-			if (type != LLFolderType::FT_OUTFIT)
-			{
-				mItems.push_back(std::string("Add To Outfit"));
-			}
-
-			mItems.push_back(std::string("Replace Outfit"));
-		}
-		if (is_ensemble)
-		{
-			mItems.push_back(std::string("Wear As Ensemble"));
-		}
-		mItems.push_back(std::string("Remove From Outfit"));
-		if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID))
-		{
-			mDisabledItems.push_back(std::string("Remove From Outfit"));
-		}
-		if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))
-		{
-			mDisabledItems.push_back(std::string("Replace Outfit"));
-		}
-		mItems.push_back(std::string("Outfit Separator"));
-	}
-
-	hide_context_entries(*menup, mItems, mDisabledItems);
-
-	// Reposition the menu, in case we're adding items to an existing menu.
-	menup->needsArrange();
-	menup->arrangeAndClear();
 }
 
 BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type)
@@ -3058,7 +2942,7 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv
 	return ((item_array.count() > 0) ? TRUE : FALSE );
 }
 
-void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags)
+void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
 {
 	LLInventoryModel* model = getInventoryModel();
 	llassert(model != NULL);
@@ -3079,10 +2963,6 @@ void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags)
 		mDisabledItems.push_back(std::string("New Body Parts"));
 	}
 
-	// clear out old menu and folder pointers
-	mMenu.markDead();
-	sSelf.markDead();
-
 	if(trash_id == mUUID)
 	{
 		// This is the trash.
@@ -3185,45 +3065,134 @@ void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags)
 	}
 }
 
+void LLFolderBridge::buildContextMenuFolderOptions(U32 flags)
+{
+	// Build folder specific options back up
+	LLInventoryModel* model = getInventoryModel();
+	if(!model) return;
+
+	const LLInventoryCategory* category = model->getCategory(mUUID);
+	if(!category) return;
+
+	const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
+	if (trash_id == mUUID) return;
+	if (isItemInTrash()) return;
+	if (!isAgentInventory()) return;
+	if (isOutboxFolder()) return;
+
+	LLFolderType::EType type = category->getPreferredType();
+	const bool is_system_folder = LLFolderType::lookupIsProtectedType(type);
+	// BAP change once we're no longer treating regular categories as ensembles.
+	const bool is_ensemble = (type == LLFolderType::FT_NONE ||
+		LLFolderType::lookupIsEnsembleType(type));
+
+	// Only enable calling-card related options for non-system folders.
+	if (!is_system_folder)
+	{
+		LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
+		if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard))
+		{
+			mItems.push_back(std::string("Calling Card Separator"));
+			mItems.push_back(std::string("Conference Chat Folder"));
+			mItems.push_back(std::string("IM All Contacts In Folder"));
+		}
+	}
+
+	if (!isItemRemovable())
+	{
+		mDisabledItems.push_back(std::string("Delete"));
+	}
+
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+	if (LLFolderType::lookupIsProtectedType(type))
+	{
+		mItems.push_back(std::string("Delete System Folder"));
+	}
+#endif
+
+	// wearables related functionality for folders.
+	//is_wearable
+	LLFindWearables is_wearable;
+	LLIsType is_object( LLAssetType::AT_OBJECT );
+	LLIsType is_gesture( LLAssetType::AT_GESTURE );
+
+	if (mWearables ||
+		checkFolderForContentsOfType(model, is_wearable)  ||
+		checkFolderForContentsOfType(model, is_object) ||
+		checkFolderForContentsOfType(model, is_gesture) )
+	{
+		mItems.push_back(std::string("Folder Wearables Separator"));
+
+		// Only enable add/replace outfit for non-system folders.
+		if (!is_system_folder)
+		{
+			// Adding an outfit onto another (versus replacing) doesn't make sense.
+			if (type != LLFolderType::FT_OUTFIT)
+			{
+				mItems.push_back(std::string("Add To Outfit"));
+			}
+
+			mItems.push_back(std::string("Replace Outfit"));
+		}
+		if (is_ensemble)
+		{
+			mItems.push_back(std::string("Wear As Ensemble"));
+		}
+		mItems.push_back(std::string("Remove From Outfit"));
+		if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID))
+		{
+			mDisabledItems.push_back(std::string("Remove From Outfit"));
+		}
+		if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))
+		{
+			mDisabledItems.push_back(std::string("Replace Outfit"));
+		}
+		mItems.push_back(std::string("Outfit Separator"));
+	}
+}
+
 // Flags unused
 void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 {
+	sSelf.markDead();
+
 	mItems.clear();
 	mDisabledItems.clear();
-	mContextMenuFlags = flags;
 
 	lldebugs << "LLFolderBridge::buildContextMenu()" << llendl;
 
 	LLInventoryModel* model = getInventoryModel();
 	if(!model) return;
 
-	buildContextMenuBaseOptions(menu, flags);
-
-	hide_context_entries(menu, mItems, mDisabledItems);
+	buildContextMenuBaseOptions(flags);
 
 	// Add menu items that are dependent on the contents of the folder.
-	uuid_vec_t folders;
-	LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID);
+	LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID);
 	if (category)
 	{
+		uuid_vec_t folders;
 		folders.push_back(category->getUUID());
-	}
 
-	mMenu = menu.getHandle();
-	sSelf = getHandle();
-	LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE);
-	fetch->startFetch();
-	inc_busy_count();
-	if(fetch->isFinished())
-	{
-		// everything is already here - call done.
-		fetch->done();
-	}
-	else
-	{
-		// it's all on its way - add an observer, and the inventory will call done for us when everything is here.
-		gInventory.addObserver(fetch);
+		sSelf = getHandle();
+		LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE);
+		fetch->startFetch();
+		inc_busy_count();
+		if (fetch->isFinished())
+		{
+			buildContextMenuFolderOptions(flags);
+		}
+		else
+		{
+			// it's all on its way - add an observer, and the inventory will call done for us when everything is here.
+			gInventory.addObserver(fetch);
+		}
 	}
+
+	hide_context_entries(menu, mItems, mDisabledItems);
+
+	// Reposition the menu, in case we're adding items to an existing menu.
+	menu.needsArrange();
+	menu.arrangeAndClear();
 }
 
 BOOL LLFolderBridge::hasChildren() const
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 56301ce728f..871657a58ae 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -235,8 +235,7 @@ class LLFolderBridge : public LLInvFVBridge
 				   const LLUUID& uuid) :
 		LLInvFVBridge(inventory, root, uuid),
 		mCallingCards(FALSE),
-		mWearables(FALSE),
-		mContextMenuFlags(0x0)
+		mWearables(FALSE)
 	{}
 		
 	BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg);
@@ -283,7 +282,8 @@ class LLFolderBridge : public LLInvFVBridge
 	LLHandle<LLFolderBridge> getHandle() { mHandle.bind(this); return mHandle; }
 
 protected:
-	void buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags);
+	void buildContextMenuBaseOptions(U32 flags);
+	void buildContextMenuFolderOptions(U32 flags);
 
 	//--------------------------------------------------------------------
 	// Menu callbacks
@@ -320,15 +320,12 @@ class LLFolderBridge : public LLInvFVBridge
 public:
 	static LLHandle<LLFolderBridge> sSelf;
 	static void staticFolderOptionsMenu();
-	void folderOptionsMenuAfterFetch();
 
 private:
 	BOOL				mCallingCards;
 	BOOL				mWearables;
-	LLHandle<LLView>	mMenu;
 	menuentry_vec_t		mItems;
 	menuentry_vec_t		mDisabledItems;
-	U32					mContextMenuFlags;
 	LLRootHandle<LLFolderBridge> mHandle;
 };
 
-- 
GitLab


From ca9f000289f93068386835d7040e5a574507f859 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 23 Jan 2012 13:40:20 -0800
Subject: [PATCH 638/933] * Optimization to not waste some time doing
 std::string assignment all over the graphics code.

Reviewed by davep.
---
 indra/newview/pipeline.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index df8f8793d18..50adbad1409 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1217,10 +1217,12 @@ void LLPipeline::restoreGL()
 
 BOOL LLPipeline::canUseVertexShaders()
 {
+	static const std::string vertex_shader_enable_feature_string = "VertexShaderEnable";
+
 	if (sDisableShaders ||
 		!gGLManager.mHasVertexShader ||
 		!gGLManager.mHasFragmentShader ||
-		!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") ||
+		!LLFeatureManager::getInstance()->isFeatureAvailable(vertex_shader_enable_feature_string) ||
 		(assertInitialized() && mVertexShadersLoaded != 1) )
 	{
 		return FALSE;
-- 
GitLab


From 9003c4c54b82cfa2517d264e9437aa294aef5bb9 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 23 Jan 2012 17:43:05 -0500
Subject: [PATCH 639/933] STORM-1795 Small logic/formatting change

---
 indra/newview/llimview.cpp | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 06f57719f5d..f621475193b 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2458,16 +2458,10 @@ void LLIMMgr::addMessage(
 		make_ui_sound("UISndNewIncomingIMSession");
 	}
 
-	bool show_message = true;
-	if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly"))
-	{
-		if (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL)
-		{
-			show_message = false;
-		}
-	}
+	bool skip_message = (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") &&
+		LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL);
 
-	if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && show_message)
+	if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message)
 	{
 		LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
 	}
-- 
GitLab


From 83ca425158fb56cab08c8a44ddad93ca222e58d7 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 23 Jan 2012 15:34:01 -0800
Subject: [PATCH 640/933] Reverting rev 22217 changes to background fetch so
 search and recent will fully fetch user inventory

---
 .../llinventorymodelbackgroundfetch.cpp       | 328 ++++++------------
 .../newview/llinventorymodelbackgroundfetch.h |  16 +-
 2 files changed, 115 insertions(+), 229 deletions(-)

diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 5f0c7441924..91fdd678063 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -50,7 +50,7 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch() :
 	mMinTimeBetweenFetches(0.3f),
 	mMaxTimeBetweenFetches(10.f),
 	mTimelyFetchPending(FALSE),
-	mFetchCount(0)
+	mBulkFetchCount(0)
 {
 }
 
@@ -60,7 +60,7 @@ LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch()
 
 bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const
 {
-	return mFetchQueue.empty() && mFetchCount<=0;
+	return mFetchQueue.empty() && mBulkFetchCount<=0;
 }
 
 bool LLInventoryModelBackgroundFetch::libraryFetchStarted() const
@@ -103,60 +103,44 @@ BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const
 	return mBackgroundFetchActive;
 }
 
-void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive)
+void LLInventoryModelBackgroundFetch::start(const LLUUID& cat_id, BOOL recursive)
 {
-	if (id.isNull()) return;
+	if (!mAllFoldersFetched || cat_id.notNull())
+	{
+		LL_DEBUGS("InventoryFetch") << "Start fetching category: " << cat_id << ", recursive: " << recursive << LL_ENDL;
 
-	LLViewerInventoryCategory* cat = gInventory.getCategory(id);
-	if (cat)
-	{	// it's a folder, do a bulk fetch
-		if (!mAllFoldersFetched)
+		mBackgroundFetchActive = TRUE;
+		if (cat_id.isNull())
 		{
-			LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL;
-
-			mBackgroundFetchActive = TRUE;
-			if (id.isNull())
+			if (!mRecursiveInventoryFetchStarted)
 			{
-				if (!mRecursiveInventoryFetchStarted)
-				{
-					mRecursiveInventoryFetchStarted |= recursive;
-					mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive));
-					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-				}
-				if (!mRecursiveLibraryFetchStarted)
-				{
-					mRecursiveLibraryFetchStarted |= recursive;
-					mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive));
-					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-				}
+				mRecursiveInventoryFetchStarted |= recursive;
+				mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive));
+				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
 			}
-			else
+			if (!mRecursiveLibraryFetchStarted)
 			{
-				// Specific folder requests go to front of queue.
-				if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id)
-				{
-					mFetchQueue.push_front(FetchQueueInfo(id, recursive));
-					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-				}
-				if (id == gInventory.getLibraryRootFolderID())
-				{
-					mRecursiveLibraryFetchStarted |= recursive;
-				}
-				if (id == gInventory.getRootFolderID())
-				{
-					mRecursiveInventoryFetchStarted |= recursive;
-				}
+				mRecursiveLibraryFetchStarted |= recursive;
+				mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive));
+				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
 			}
 		}
-	}
-	else if (LLViewerInventoryItem* itemp = gInventory.getItem(id))
-	{
-		if (!itemp->mIsComplete && (mFetchQueue.empty() || mFetchQueue.front().mUUID != id))
+		else
 		{
-			mBackgroundFetchActive = TRUE;
-
-			mFetchQueue.push_front(FetchQueueInfo(id, false, false));
-			gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+			// Specific folder requests go to front of queue.
+			if (mFetchQueue.empty() || mFetchQueue.front().mCatUUID != cat_id)
+			{
+				mFetchQueue.push_front(FetchQueueInfo(cat_id, recursive));
+				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+			}
+			if (cat_id == gInventory.getLibraryRootFolderID())
+			{
+				mRecursiveLibraryFetchStarted |= recursive;
+			}
+			if (cat_id == gInventory.getRootFolderID())
+			{
+				mRecursiveInventoryFetchStarted |= recursive;
+			}
 		}
 	}
 }
@@ -174,7 +158,7 @@ void LLInventoryModelBackgroundFetch::stopBackgroundFetch()
 	{
 		mBackgroundFetchActive = FALSE;
 		gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-		mFetchCount=0;
+		mBulkFetchCount=0;
 		mMinTimeBetweenFetches=0.0f;
 	}
 }
@@ -199,9 +183,10 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 	if (mBackgroundFetchActive && gAgent.getRegion())
 	{
 		// If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
-		if (gSavedSettings.getBOOL("UseHTTPInventory")) 
+		std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents2");   
+		if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty()) 
 		{
-			bulkFetch();
+			bulkFetch(url);
 			return;
 		}
 		
@@ -245,7 +230,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 			}
 
 			const FetchQueueInfo info = mFetchQueue.front();
-			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID);
+			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mCatUUID);
 
 			// Category has been deleted, remove from queue.
 			if (!cat)
@@ -273,7 +258,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 				}
 			}
 			// Do I have all my children?
-			else if (gInventory.isCategoryComplete(info.mUUID))
+			else if (gInventory.isCategoryComplete(info.mCatUUID))
 			{
 				// Finished with this category, remove from queue.
 				mFetchQueue.pop_front();
@@ -328,35 +313,15 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 	}
 }
 
-void LLInventoryModelBackgroundFetch::incrFetchCount(S16 fetching) 
+void LLInventoryModelBackgroundFetch::incrBulkFetch(S16 fetching) 
 {  
-	mFetchCount += fetching; 
-	if (mFetchCount < 0)
+	mBulkFetchCount += fetching; 
+	if (mBulkFetchCount < 0)
 	{
-		mFetchCount = 0; 
+		mBulkFetchCount = 0; 
 	}
 }
 
-class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInventoryResponder
-{
-public:
-	LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {};
-	void result(const LLSD& content);			
-	void error(U32 status, const std::string& reason);
-};
-
-void LLInventoryModelFetchItemResponder::result( const LLSD& content )
-{
-	LLInventoryModel::fetchInventoryResponder::result(content);
-	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
-}
-
-void LLInventoryModelFetchItemResponder::error( U32 status, const std::string& reason )
-{
-	LLInventoryModel::fetchInventoryResponder::error(status, reason);
-	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
-}
-
 
 class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder
 {
@@ -493,7 +458,7 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
 		}
 	}
 
-	fetcher->incrFetchCount(-1);
+	fetcher->incrBulkFetch(-1);
 	
 	if (fetcher->isBulkFetchProcessingComplete())
 	{
@@ -512,7 +477,7 @@ void LLInventoryModelFetchDescendentsResponder::error(U32 status, const std::str
 	llinfos << "LLInventoryModelFetchDescendentsResponder::error "
 		<< status << ": " << reason << llendl;
 						
-	fetcher->incrFetchCount(-1);
+	fetcher->incrBulkFetch(-1);
 
 	if (status==499) // timed out
 	{
@@ -543,14 +508,12 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat
 
 // Bundle up a bunch of requests to send all at once.
 // static   
-void LLInventoryModelBackgroundFetch::bulkFetch()
+void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
 {
 	//Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped.
 	//If there are items in mFetchQueue, we want to check the time since the last bulkFetch was 
 	//sent.  If it exceeds our retry time, go ahead and fire off another batch.  
 	//Stopbackgroundfetch will be run from the Responder instead of here.  
-	LLViewerRegion* region = gAgent.getRegion();
-	if (!region) return;
 
 	S16 max_concurrent_fetches=8;
 	F32 new_min_time = 0.5f;			//HACK!  Clean this up when old code goes away entirely.
@@ -560,13 +523,12 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
 	}
 	
 	if (gDisconnected ||
-		(mFetchCount > max_concurrent_fetches) ||
+		(mBulkFetchCount > max_concurrent_fetches) ||
 		(mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches))
 	{
 		return; // just bail if we are disconnected
 	}	
 
-	U32 item_count=0;
 	U32 folder_count=0;
 	U32 max_batch_size=5;
 
@@ -574,159 +536,83 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
 
 	uuid_vec_t recursive_cats;
 
-	LLSD folder_request_body;
-	LLSD folder_request_body_lib;
-	LLSD item_request_body;
-	LLSD item_request_body_lib;
+	LLSD body;
+	LLSD body_lib;
 
-	while (!(mFetchQueue.empty()) && ((item_count + folder_count) < max_batch_size))
+	while (!(mFetchQueue.empty()) && (folder_count < max_batch_size))
 	{
 		const FetchQueueInfo& fetch_info = mFetchQueue.front();
-		if (fetch_info.mIsCategory)
-		{
-
-			const LLUUID &cat_id = fetch_info.mUUID;
-			if (cat_id.isNull()) //DEV-17797
-			{
-				LLSD folder_sd;
-				folder_sd["folder_id"]		= LLUUID::null.asString();
-				folder_sd["owner_id"]		= gAgent.getID();
-				folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
-				folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE;
-				folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
-				folder_request_body["folders"].append(folder_sd);
-				folder_count++;
-			}
-			else
-			{
-				const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+		const LLUUID &cat_id = fetch_info.mCatUUID;
+        if (cat_id.isNull()) //DEV-17797
+        {
+			LLSD folder_sd;
+			folder_sd["folder_id"]		= LLUUID::null.asString();
+			folder_sd["owner_id"]		= gAgent.getID();
+			folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
+			folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE;
+			folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
+			body["folders"].append(folder_sd);
+            folder_count++;
+        }
+        else
+        {
+		    const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
 		
-				if (cat)
-				{
-					if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
-					{
-						LLSD folder_sd;
-						folder_sd["folder_id"]		= cat->getUUID();
-						folder_sd["owner_id"]		= cat->getOwnerID();
-						folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
-						folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
-						folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
+		    if (cat)
+		    {
+			    if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
+			    {
+				    LLSD folder_sd;
+				    folder_sd["folder_id"]		= cat->getUUID();
+				    folder_sd["owner_id"]		= cat->getOwnerID();
+				    folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
+				    folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
+				    folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
 				    
-						if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
-							folder_request_body_lib["folders"].append(folder_sd);
-						else
-							folder_request_body["folders"].append(folder_sd);
-						folder_count++;
-					}
-					// May already have this folder, but append child folders to list.
-					if (fetch_info.mRecursive)
-					{	
-						LLInventoryModel::cat_array_t* categories;
-						LLInventoryModel::item_array_t* items;
-						gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
-						for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
-							 it != categories->end();
-							 ++it)
-						{
-							mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
-						}
-					}
-				}
-			}
-			if (fetch_info.mRecursive)
-				recursive_cats.push_back(cat_id);
-		}
-		else
-		{
-			LLViewerInventoryItem* itemp = gInventory.getItem(fetch_info.mUUID);
-			if (itemp)
-			{
-				LLSD item_sd;
-				item_sd["owner_id"] = itemp->getPermissions().getOwner();
-				item_sd["item_id"] = itemp->getUUID();
-				if (itemp->getPermissions().getOwner() == gAgent.getID())
-				{
-					item_request_body.append(item_sd);
-				}
-				else
-				{
-					item_request_body_lib.append(item_sd);
-				}
-				//itemp->fetchFromServer();
-				item_count++;
-			}
-		}
+				    if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
+					    body_lib["folders"].append(folder_sd);
+				    else
+					    body["folders"].append(folder_sd);
+				    folder_count++;
+			    }
+				// May already have this folder, but append child folders to list.
+			    if (fetch_info.mRecursive)
+			    {	
+					LLInventoryModel::cat_array_t* categories;
+					LLInventoryModel::item_array_t* items;
+					gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
+					for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
+						 it != categories->end();
+						 ++it)
+					{
+						mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
+				    }
+			    }
+		    }
+        }
+		if (fetch_info.mRecursive)
+			recursive_cats.push_back(cat_id);
 
 		mFetchQueue.pop_front();
 	}
 		
-	if (item_count + folder_count > 0)
+	if (folder_count > 0)
 	{
-		if (folder_count)
+		mBulkFetchCount++;
+		if (body["folders"].size())
 		{
-			std::string url = region->getCapability("FetchInventoryDescendents2");   
-			mFetchCount++;
-			if (folder_request_body["folders"].size())
-			{
-				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
-				LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
-			}
-			if (folder_request_body_lib["folders"].size())
-			{
-				std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
-
-				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
-				LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
-			}
+			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body, recursive_cats);
+			LLHTTPClient::post(url, body, fetcher, 300.0);
 		}
-		if (item_count)
+		if (body_lib["folders"].size())
 		{
-			std::string url;
-
-			if (item_request_body.size())
-			{
-				mFetchCount++;
-				url = region->getCapability("FetchInventory2");
-				if (!url.empty())
-				{
-					LLSD body;
-					body["agent_id"]	= gAgent.getID();
-					body["items"] = item_request_body;
-
-					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
-				}
-				//else
-				//{
-				//	LLMessageSystem* msg = gMessageSystem;
-				//	msg->newMessage("FetchInventory");
-				//	msg->nextBlock("AgentData");
-				//	msg->addUUID("AgentID", gAgent.getID());
-				//	msg->addUUID("SessionID", gAgent.getSessionID());
-				//	msg->nextBlock("InventoryData");
-				//	msg->addUUID("OwnerID", mPermissions.getOwner());
-				//	msg->addUUID("ItemID", mUUID);
-				//	gAgent.sendReliableMessage();
-				//}
-			}
-
-			if (item_request_body_lib.size())
-			{
-				mFetchCount++;
-
-				url = region->getCapability("FetchLib2");
-				if (!url.empty())
-				{
-					LLSD body;
-					body["agent_id"]	= gAgent.getID();
-					body["items"] = item_request_body_lib;
-
-					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
-				}
-			}
+			std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
+			
+			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body_lib, recursive_cats);
+			LLHTTPClient::post(url_lib, body_lib, fetcher, 300.0);
 		}
 		mFetchTimer.reset();
 	}
-
 	else if (isBulkFetchProcessingComplete())
 	{
 		setAllFoldersFetched();
@@ -738,7 +624,7 @@ bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LL
 	for (fetch_queue_t::const_iterator it = mFetchQueue.begin();
 		 it != mFetchQueue.end(); ++it)
 	{
-		const LLUUID& fetch_id = (*it).mUUID;
+		const LLUUID& fetch_id = (*it).mCatUUID;
 		if (gInventory.isObjectDescendentOf(fetch_id, cat_id))
 			return false;
 	}
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index 0745407a8c8..c35c785ceb3 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -60,10 +60,10 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	bool inventoryFetchInProgress() const;
 
     void findLostItems();	
-	void incrFetchCount(S16 fetching);
 protected:
+	void incrBulkFetch(S16 fetching);
 	bool isBulkFetchProcessingComplete() const;
-	void bulkFetch();
+	void bulkFetch(std::string url);
 
 	void backgroundFetch();
 	static void backgroundFetchCB(void*); // background fetch idle function
@@ -77,7 +77,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	BOOL mAllFoldersFetched;
 
 	BOOL mBackgroundFetchActive;
-	S16 mFetchCount;
+	S16 mBulkFetchCount;
 	BOOL mTimelyFetchPending;
 	S32 mNumFetchRetries;
 
@@ -87,11 +87,11 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 
 	struct FetchQueueInfo
 	{
-		FetchQueueInfo(const LLUUID& id, BOOL recursive, bool is_category = true) :
-			mUUID(id), mRecursive(recursive), mIsCategory(is_category)
-		{}
-		LLUUID mUUID;
-		bool mIsCategory;
+		FetchQueueInfo(const LLUUID& id, BOOL recursive) :
+			mCatUUID(id), mRecursive(recursive)
+		{
+		}
+		LLUUID mCatUUID;
 		BOOL mRecursive;
 	};
 	typedef std::deque<FetchQueueInfo> fetch_queue_t;
-- 
GitLab


From ea6cbc7b6b1de051a9bb1c311c4399a2b4d42cb3 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 23 Jan 2012 15:55:36 -0800
Subject: [PATCH 641/933] Reverting background fetch on an item to the old
 fetFromServer call to fix regression bug in inventory late loading

---
 indra/newview/llinventorybridge.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9e21e2fceb0..c0065a94e66 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1324,7 +1324,8 @@ void LLItemBridge::selectItem()
 	LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
 	if(item && !item->isFinished())
 	{
-		LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
+		item->fetchFromServer();
+		//LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
 	}
 }
 
-- 
GitLab


From 4140a688548a1139466740c87cdec883f267cfa7 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Mon, 23 Jan 2012 17:00:57 -0800
Subject: [PATCH 642/933] EXP-1818 World/Local/Reference editing mode hidden
 Moved coordinate mode combo back into main build floater from sub-floater.

---
 indra/newview/llfloaterbuildoptions.cpp       | 49 +--------------
 indra/newview/llfloaterbuildoptions.h         |  7 ---
 indra/newview/llfloatertools.cpp              | 39 ++++++++++++
 indra/newview/llfloatertools.h                |  2 +
 indra/newview/llviewermenu.cpp                |  6 --
 indra/newview/llviewerwindow.cpp              |  6 --
 .../default/xui/en/floater_build_options.xml  | 61 +-----------------
 .../skins/default/xui/en/floater_tools.xml    | 62 ++++++++++++++++---
 8 files changed, 99 insertions(+), 133 deletions(-)

diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp
index 86c1bf0534e..1b65d8d6838 100644
--- a/indra/newview/llfloaterbuildoptions.cpp
+++ b/indra/newview/llfloaterbuildoptions.cpp
@@ -41,13 +41,9 @@
 // Methods
 //
 
-void commit_grid_mode(LLUICtrl *);
-
 LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key)
-  : LLFloater(key),
-    mComboGridMode(NULL)
+  : LLFloater(key)
 {
-	mCommitCallbackRegistrar.add("GridOptions.gridMode", boost::bind(&commit_grid_mode,_1));
 }
 
 LLFloaterBuildOptions::~LLFloaterBuildOptions()
@@ -55,45 +51,9 @@ LLFloaterBuildOptions::~LLFloaterBuildOptions()
 
 BOOL LLFloaterBuildOptions::postBuild()
 {
-	mComboGridMode = getChild<LLComboBox>("combobox grid mode");
-
 	return TRUE;
 }
 
-void LLFloaterBuildOptions::setGridMode(EGridMode mode)
-{
-	mComboGridMode->setCurrentByIndex((S32)mode);
-}
-
-void LLFloaterBuildOptions::updateGridMode()
-{
-	if (mComboGridMode)
-	{
-		S32 index = mComboGridMode->getCurrentIndex();
-		mComboGridMode->removeall();
-
-		switch (mObjectSelection->getSelectType())
-		{
-		case SELECT_TYPE_HUD:
-		  mComboGridMode->add(getString("grid_screen_text"));
-		  mComboGridMode->add(getString("grid_local_text"));
-		  break;
-		case SELECT_TYPE_WORLD:
-		  mComboGridMode->add(getString("grid_world_text"));
-		  mComboGridMode->add(getString("grid_local_text"));
-		  mComboGridMode->add(getString("grid_reference_text"));
-		  break;
-		case SELECT_TYPE_ATTACHMENT:
-		  mComboGridMode->add(getString("grid_attachment_text"));
-		  mComboGridMode->add(getString("grid_local_text"));
-		  mComboGridMode->add(getString("grid_reference_text"));
-		  break;
-		}
-
-		mComboGridMode->setCurrentByIndex(index);
-	}
-}
-
 // virtual
 void LLFloaterBuildOptions::onOpen(const LLSD& key)
 {
@@ -105,10 +65,3 @@ void LLFloaterBuildOptions::onClose(bool app_quitting)
 {
 	mObjectSelection = NULL;
 }
-
-void commit_grid_mode(LLUICtrl *ctrl)
-{
-	LLComboBox* combo = (LLComboBox*)ctrl;
-
-	LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
-}
diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h
index 7f3811bf1cb..02c56cb6a92 100644
--- a/indra/newview/llfloaterbuildoptions.h
+++ b/indra/newview/llfloaterbuildoptions.h
@@ -35,7 +35,6 @@
 #include "llfloater.h"
 #include "llselectmgr.h"
 
-class LLComboBox;
 class LLObjectSelection;
 
 typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
@@ -44,23 +43,17 @@ class LLFloaterBuildOptions
 	:	public LLFloater
 {
 public:
-
 	virtual BOOL postBuild();
 
 	/*virtual*/ void onOpen(const LLSD& key);
 	/*virtual*/	void onClose(bool app_quitting);
 
-	void setGridMode(EGridMode mode);
-	void updateGridMode();
-
 private:
-
 	friend class LLFloaterReg;
 
 	LLFloaterBuildOptions(const LLSD& key);
 	~LLFloaterBuildOptions();
 
-	LLComboBox*	mComboGridMode;
 	LLObjectSelectionHandle	mObjectSelection;
 };
 #endif
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 0d37d0857ea..5c8f5a5cc10 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -36,6 +36,7 @@
 #include "llagentcamera.h"
 #include "llbutton.h"
 #include "llcheckboxctrl.h"
+#include "llcombobox.h"
 #include "lldraghandle.h"
 #include "llerror.h"
 #include "llfloaterbuildoptions.h"
@@ -103,6 +104,7 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] =
 
 
 // Local prototypes
+void commit_grid_mode(LLUICtrl *ctrl);
 void commit_select_component(void *data);
 void click_show_more(void*);
 void click_popup_info(void*);
@@ -252,6 +254,7 @@ BOOL	LLFloaterTools::postBuild()
 	getChild<LLUICtrl>("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform"));
 	mCheckStretchTexture	= getChild<LLCheckBoxCtrl>("checkbox stretch textures");
 	getChild<LLUICtrl>("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures"));
+	mComboGridMode			= getChild<LLComboBox>("combobox grid mode");
 	mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label");
 
 	//
@@ -330,6 +333,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mCheckSnapToGrid(NULL),
 	mBtnGridOptions(NULL),
 	mTitleMedia(NULL),
+	mComboGridMode(NULL),
 	mCheckStretchUniform(NULL),
 	mCheckStretchTexture(NULL),
 	mCheckStretchUniformLabel(NULL),
@@ -386,6 +390,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mCommitCallbackRegistrar.add("BuildTool.commitRadioMove",	boost::bind(&commit_radio_group_move,_1));
 	mCommitCallbackRegistrar.add("BuildTool.commitRadioEdit",	boost::bind(&commit_radio_group_edit,_1));
 
+	mCommitCallbackRegistrar.add("BuildTool.gridMode",			boost::bind(&commit_grid_mode,_1));
 	mCommitCallbackRegistrar.add("BuildTool.selectComponent",	boost::bind(&commit_select_component, this));
 	mCommitCallbackRegistrar.add("BuildTool.gridOptions",		boost::bind(&LLFloaterTools::onClickGridOptions,this));
 	mCommitCallbackRegistrar.add("BuildTool.applyToSelection",	boost::bind(&click_apply_to_selection, this));
@@ -687,6 +692,33 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
 		mRadioGroupEdit->setValue("radio select face");
 	}
 
+	if (mComboGridMode) 
+	{
+		mComboGridMode->setVisible( edit_visible );
+		S32 index = mComboGridMode->getCurrentIndex();
+		mComboGridMode->removeall();
+
+		switch (mObjectSelection->getSelectType())
+		{
+			case SELECT_TYPE_HUD:
+				mComboGridMode->add(getString("grid_screen_text"));
+				mComboGridMode->add(getString("grid_local_text"));
+				break;
+			case SELECT_TYPE_WORLD:
+				mComboGridMode->add(getString("grid_world_text"));
+				mComboGridMode->add(getString("grid_local_text"));
+				mComboGridMode->add(getString("grid_reference_text"));
+				break;
+			case SELECT_TYPE_ATTACHMENT:
+				mComboGridMode->add(getString("grid_attachment_text"));
+				mComboGridMode->add(getString("grid_local_text"));
+				mComboGridMode->add(getString("grid_reference_text"));
+				break;
+		}
+
+		mComboGridMode->setCurrentByIndex(index);
+	}
+
 	// Snap to grid disabled for grab tool - very confusing
 	if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
 	if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
@@ -1037,6 +1069,13 @@ void LLFloaterTools::setObjectType( LLPCode pcode )
 	gFocusMgr.setMouseCapture(NULL);
 }
 
+void commit_grid_mode(LLUICtrl *ctrl)
+{
+	LLComboBox* combo = (LLComboBox*)ctrl;
+
+	LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
+}
+
 
 void LLFloaterTools::onClickGridOptions()
 {
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 63ed9dc82ba..7a19d093a42 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -33,6 +33,7 @@
 
 class LLButton;
 class LLCheckBoxCtrl;
+class LLComboBox;
 class LLPanelPermissions;
 class LLPanelObject;
 class LLPanelVolume;
@@ -140,6 +141,7 @@ class LLFloaterTools
 
 	LLCheckBoxCtrl*	mCheckSnapToGrid;
 	LLButton*		mBtnGridOptions;
+	LLComboBox*		mComboGridMode;
 	LLCheckBoxCtrl*	mCheckStretchUniform;
 	LLCheckBoxCtrl*	mCheckStretchTexture;
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 0104d35e53a..4a71e6fc8e8 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7254,12 +7254,6 @@ class LLToolsUseSelectionForGrid : public view_listener_t
 		} func;
 		LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func);
 		LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT);
-
-		LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
-		if (build_options_floater && build_options_floater->getVisible())
-		{
-			build_options_floater->setGridMode(GRID_MODE_REF_OBJECT);
-		}
 		return true;
 	}
 };
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4499955dec0..5730a55a9b3 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3170,12 +3170,6 @@ void LLViewerWindow::updateLayout()
 		//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
 	}
 
-	LLFloaterBuildOptions* build_options_floater = LLFloaterReg::findTypedInstance<LLFloaterBuildOptions>("build_options");
-	if (build_options_floater && build_options_floater->getVisible())
-	{
-		build_options_floater->updateGridMode();
-	}
-
 	// Always update console
 	if(gConsole)
 	{
diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml
index 35918e9705d..38428b36fc6 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -1,70 +1,13 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- height="198"
+ height="170"
  layout="topleft"
  name="build options floater"
  help_topic="build_options_floater"
  save_rect="true"
  title="GRID OPTIONS"
  width="264">
- 	<floater.string
-     name="grid_screen_text">
-        Screen
-    </floater.string>
-    <floater.string
-     name="grid_local_text">
-        Local
-    </floater.string>
-    <floater.string
-     name="grid_world_text">
-        World
-    </floater.string>
-    <floater.string
-     name="grid_reference_text">
-        Reference
-    </floater.string>
-    <floater.string
-     name="grid_attachment_text">
-        Attachment
-    </floater.string>
-    <text
-     type="string"
-     length="1"
-     follows="left|top"
-     height="16"
-     layout="topleft"
-     left="10"
-     tool_tip="Grid opacity"
-     name="grid_mode_label"
-     top_pad="30"
-     width="123">
-        Mode
-    </text>
-    <combo_box
-     height="23"
-     layout="topleft"
-     left_pad="9"
-     follows="left|top"
-     name="combobox grid mode"
-     tool_tip="Choose the type of grid ruler for positioning the object"
-     top_delta="-3"
-     width="108">
-      <combo_box.item
-       label="World grid"
-       name="World"
-       value="World" />
-      <combo_box.item
-       label="Local grid"
-       name="Local"
-       value="Local" />
-      <combo_box.item
-       label="Reference grid"
-       name="Reference"
-       value="Reference" />
-       <combo_box.commit_callback
-      function="GridOptions.gridMode"/>
-    </combo_box>
     <spinner
      control_name="GridResolution"
      follows="left|top"
@@ -77,7 +20,7 @@
      max_val="5"
      min_val="0.01"
      name="GridResolution"
-     top_pad="4"
+     top_pad="30"
      width="200" />
     <spinner
      control_name="GridDrawSize"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index f9147ea650c..2d63c94fe11 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -14,7 +14,27 @@
  save_visibility="true"
  sound_flags="0"
  width="295">
-    <floater.string
+  <floater.string
+     name="grid_screen_text">
+    Screen
+  </floater.string>
+  <floater.string
+   name="grid_local_text">
+    Local
+  </floater.string>
+  <floater.string
+   name="grid_world_text">
+    World
+  </floater.string>
+  <floater.string
+   name="grid_reference_text">
+    Reference
+  </floater.string>
+  <floater.string
+   name="grid_attachment_text">
+    Attachment
+  </floater.string>
+  <floater.string
      name="status_rotate">
         Drag colored bands to rotate object
     </floater.string>
@@ -312,20 +332,48 @@
      top_pad="0"
      name="checkbox snap to grid"
      width="134" />
-    <button
-     left_pad="0"
-     label="Options..."
+    <combo_box
+      height="20"
+      layout="topleft"
+      follows="left|top"
+      name="combobox grid mode"
+      tool_tip="Choose the type of grid ruler for positioning the object"
+      top="83"
+      left="195"
+      top_pad="0"
+      width="60">
+      <combo_box.item
+      label="World"
+      name="World"
+      value="World" />
+      <combo_box.item
+      label="Local"
+      name="Local"
+      value="Local" />
+      <combo_box.item
+      label="Reference"
+      name="Reference"
+      value="Reference" />
+      <combo_box.commit_callback
+      function="BuildTool.gridMode"/>
+    </combo_box>  
+  
+  <button
+     left="259"
+     label=""
+     image_selected="ForwardArrow_Press"
+     image_unselected="ForwardArrow_Off"
      layout="topleft"
      follows="top|left"
      name="Options..."
      tool_tip="See more grid options"
      top="83"
-     right="-35"
-     width="65"
-     height="21" >
+     width="25"
+     height="20" >
 	 <button.commit_callback
 	     function="BuildTool.gridOptions"/>
 	</button>
+  
    <button
      follows="left|top"
      height="20"
-- 
GitLab


From e219fc30ba351e992c3c559f92830a4ca54ca2d3 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 23 Jan 2012 17:38:47 -0800
Subject: [PATCH 643/933] EXP-1837 FIX parsing notifications.xml during startup
 can take > 40 seconds (in non-release builds) removed O(n^2) comparisons of
 XML nodes in favor of O(n)

---
 indra/llxml/llxmlnode.cpp | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 2b4a0fc2a1e..3d4e6f9a0bd 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -631,13 +631,14 @@ bool LLXMLNode::updateNode(
 	}
 
 	//update all of node's children with updateNodes children that match name
-	LLXMLNodePtr child;
+	LLXMLNodePtr child = node->getFirstChild();
+	LLXMLNodePtr last_child = child;
 	LLXMLNodePtr updateChild;
 	
 	for (updateChild = update_node->getFirstChild(); updateChild.notNull(); 
 		 updateChild = updateChild->getNextSibling())
 	{
-		for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
+		while(child.notNull())
 		{
 			std::string nodeName;
 			std::string updateName;
@@ -656,6 +657,22 @@ bool LLXMLNode::updateNode(
 			if ((nodeName != "") && (updateName == nodeName))
 			{
 				updateNode(child, updateChild);
+				last_child = child;
+				child = child->getNextSibling();
+				if (child.isNull())
+				{
+					child = node->getFirstChild();
+				}
+				break;
+			}
+			
+			child = child->getNextSibling();
+			if (child.isNull())
+			{
+				child = node->getFirstChild();
+			}
+			if (child == last_child)
+			{
 				break;
 			}
 		}
@@ -882,11 +899,8 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
 
 	for (itor = paths.begin(), ++itor; itor != paths.end(); ++itor)
 	{
-		std::string nodeName;
-		std::string updateName;
-
 		std::string layer_filename = *itor;
-		if(layer_filename.empty())
+		if(layer_filename.empty() || layer_filename == filename)
 		{
 			// no localized version of this file, that's ok, keep looking
 			continue;
@@ -898,6 +912,9 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
 			return false;
 		}
 
+		std::string nodeName;
+		std::string updateName;
+
 		updateRoot->getAttributeString("name", updateName);
 		root->getAttributeString("name", nodeName);
 
-- 
GitLab


From 77a83dddf54ae5271d2cb3cca4f6102d44a57bcd Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 23 Jan 2012 17:47:23 -0800
Subject: [PATCH 644/933] EXP-1837 FIX parsing notifications.xml during startup
 can take > 40 seconds (in non-release builds) added logging to track length
 of time spent reading notifications templates

---
 indra/llui/llnotifications.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index d232e27ef23..f2c852aba4b 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1412,6 +1412,7 @@ void addPathIfExists(const std::string& new_path, std::vector<std::string>& path
 
 bool LLNotifications::loadTemplates()
 {
+	llinfos << "Reading notifications template" << llcont;
 	std::vector<std::string> search_paths;
 	
 	std::string skin_relative_path = gDirUtilp->getDirDelimiter() + LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + "notifications.xml";
@@ -1484,6 +1485,8 @@ bool LLNotifications::loadTemplates()
 		mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification));
 	}
 
+	llinfos << "...done" << llendl;
+
 	return true;
 }
 
-- 
GitLab


From e09661f6ec467ea98715a2a04db40fc4e6b7ce02 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 23 Jan 2012 17:49:29 -0800
Subject: [PATCH 645/933] fix for compile error

---
 indra/llui/llnotifications.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index f2c852aba4b..8aa548b9749 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1412,7 +1412,7 @@ void addPathIfExists(const std::string& new_path, std::vector<std::string>& path
 
 bool LLNotifications::loadTemplates()
 {
-	llinfos << "Reading notifications template" << llcont;
+	llinfos << "Reading notifications template" << llendl;
 	std::vector<std::string> search_paths;
 	
 	std::string skin_relative_path = gDirUtilp->getDirDelimiter() + LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + "notifications.xml";
-- 
GitLab


From 0d04a4da7e7c1361e1ac805e2a135d826242fd2f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 24 Jan 2012 09:56:11 +0200
Subject: [PATCH 646/933] EXP-1801 FOLLOWUP Default to PNG when saving snapshot
 via hotkey.

---
 indra/newview/llviewermenufile.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 8ee514e7c24..f31f0364b32 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -528,20 +528,20 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
 		{
 			gViewerWindow->playSnapshotAnimAndSound();
 			LLPointer<LLImageFormatted> formatted;
-			switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat")))
+			LLFloaterSnapshot::ESnapshotFormat fmt = (LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat");
+			switch (fmt)
 			{
 			case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
 				formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
 				break;
+			default:
+				llwarns << "Unknown local snapshot format: " << fmt << llendl;
 			case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
 				formatted = new LLImagePNG;
 				break;
 			case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
 				formatted = new LLImageBMP;
 				break;
-			default:
-				llwarns << "Unknown Local Snapshot format" << llendl;
-				return true;
 			}
 			formatted->enableOverSize() ;
 			formatted->encode(raw, 0);
-- 
GitLab


From c34413f9fe77ef11762f644a715146708e79ff1a Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 24 Jan 2012 17:44:23 +0200
Subject: [PATCH 647/933] EXP-1838 FIXED Enabled detaching items from hands in
 the avatar detach menu.

Use the same on_click/on_enable actions as for the other attachment points.
See LLVOAvatarSelf::buildMenus().
---
 indra/newview/llvoavatarself.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 581912f8449..12d08143ee2 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -365,9 +365,9 @@ BOOL LLVOAvatarSelf::buildMenus()
 						item_params.label = sub_piemenu_name;
 					}
 					item_params.name =(item_params.label );
-					item_params.on_click.function_name = "Attachment.Detach";
+					item_params.on_click.function_name = "Attachment.DetachFromPoint";
 					item_params.on_click.parameter = iter->first;
-					item_params.on_enable.function_name = "Attachment.EnableDetach";
+					item_params.on_enable.function_name = "Attachment.PointFilled";
 					item_params.on_enable.parameter = iter->first;
 					LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params);
 
-- 
GitLab


From ae952f2d45265baa4780de6d4a54e27b5e21ece5 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 24 Jan 2012 20:36:29 +0200
Subject: [PATCH 648/933] EXP-1833 FOLLOWUP Fixed a resizing issue in nearby
 chat.

---
 indra/newview/skins/default/xui/en/panel_nearby_chat.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
index 6cfd929bc0c..d683116eb8b 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
@@ -7,7 +7,7 @@
  name="nearby_chat"
  width="320">
   <layout_stack
-   follows="left|top|right"
+   follows="all"
    height="295"
    layout="topleft"
    left="0"
-- 
GitLab


From e02f007d2013e089c07f3abefe2d87d85cbcc834 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 24 Jan 2012 12:59:18 -0600
Subject: [PATCH 649/933] SH-1427 Fix for spot lights not working properly on
 alpha objects, and fix for alpha lighting of point lights not matching
 deferred lights.

---
 indra/llrender/llrender.cpp                            |  2 +-
 .../shaders/class1/deferred/alphaSkinnedV.glsl         |  8 ++++----
 .../app_settings/shaders/class1/deferred/alphaV.glsl   |  9 ++++-----
 .../shaders/class1/deferred/avatarAlphaV.glsl          |  8 ++++----
 .../shaders/class2/deferred/alphaSkinnedV.glsl         | 10 +++++-----
 .../app_settings/shaders/class2/deferred/alphaV.glsl   |  8 ++++----
 .../shaders/class2/deferred/avatarAlphaV.glsl          |  8 ++++----
 indra/newview/pipeline.cpp                             |  6 ++++--
 8 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index cd827f5091e..f26764cc426 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -997,7 +997,7 @@ void LLLightState::setSpotDirection(const LLVector3& direction)
 		const glh::matrix4f& mat = gGL.getModelviewMatrix();
 		mat.mult_matrix_dir(dir);
 
-		mSpotDirection.set(direction);
+		mSpotDirection.set(dir.v);
 	}
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 0170ad4b55f..40b0cf47ac5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -61,17 +61,17 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 	vec3 lv = lp.xyz-v;
 	
 	//get distance
-	float d = length(lv);
+	float d = dot(lv,lv);
 	
 	float da = 0.0;
 
 	if (d > 0.0 && la > 0.0 && fa > 0.0)
 	{
 		//normalize light vector
-		lv *= 1.0/d;
+		lv = normalize(lv);
 	
 		//distance attenuation
-		float dist2 = d*d/(la*la);
+		float dist2 = d/la;
 		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 
 		// spotlight coefficient.
@@ -79,7 +79,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 		da *= spot*spot; // GL_SPOT_EXPONENT=2
 
 		//angular attenuation
-		da *= calcDirectionalLight(n, lv);
+		da *= max(dot(n, lv), 0.0);		
 	}
 
 	return da;	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 93b1a114db1..8c96d553424 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -70,17 +70,17 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 	vec3 lv = lp.xyz-v;
 	
 	//get distance
-	float d = length(lv);
+	float d = dot(lv,lv);
 	
 	float da = 0.0;
 
 	if (d > 0.0 && la > 0.0 && fa > 0.0)
 	{
 		//normalize light vector
-		lv *= 1.0/d;
+		lv = normalize(lv);
 	
 		//distance attenuation
-		float dist2 = d*d/(la*la);
+		float dist2 = d/la;
 		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 
 		// spotlight coefficient.
@@ -88,7 +88,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 		da *= spot*spot; // GL_SPOT_EXPONENT=2
 
 		//angular attenuation
-		da *= calcDirectionalLight(n, lv);
+		da *= max(dot(n, lv), 0.0);		
 	}
 
 	return da;	
@@ -123,7 +123,6 @@ void main()
 	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
 	
 	vary_pointlight_col = col.rgb*diffuse_color.rgb;
-
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index d7b90978ba4..c0edddc40a5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -65,17 +65,17 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 	vec3 lv = lp.xyz-v;
 	
 	//get distance
-	float d = length(lv);
+	float d = dot(lv,lv);
 	
 	float da = 0.0;
 
 	if (d > 0.0 && la > 0.0 && fa > 0.0)
 	{
 		//normalize light vector
-		lv *= 1.0/d;
+		lv = normalize(lv);
 	
 		//distance attenuation
-		float dist2 = d*d/(la*la);
+		float dist2 = d/la;
 		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 
 		// spotlight coefficient.
@@ -83,7 +83,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 		da *= spot*spot; // GL_SPOT_EXPONENT=2
 
 		//angular attenuation
-		da *= calcDirectionalLight(n, lv);
+		da *= max(dot(n, lv), 0.0);		
 	}
 
 	return da;	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index 5a3955ef009..83815b17860 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -63,21 +63,21 @@ uniform vec3 light_diffuse[8];
 
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
-	//get light vector
+//get light vector
 	vec3 lv = lp.xyz-v;
 	
 	//get distance
-	float d = length(lv);
+	float d = dot(lv,lv);
 	
 	float da = 0.0;
 
 	if (d > 0.0 && la > 0.0 && fa > 0.0)
 	{
 		//normalize light vector
-		lv *= 1.0/d;
+		lv = normalize(lv);
 	
 		//distance attenuation
-		float dist2 = d*d/(la*la);
+		float dist2 = d/la;
 		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 
 		// spotlight coefficient.
@@ -85,7 +85,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 		da *= spot*spot; // GL_SPOT_EXPONENT=2
 
 		//angular attenuation
-		da *= calcDirectionalLight(n, lv);
+		da *= max(dot(n, lv), 0.0);		
 	}
 
 	return da;	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 9540ddd2e84..1660f9687eb 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -69,17 +69,17 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 	vec3 lv = lp.xyz-v;
 	
 	//get distance
-	float d = length(lv);
+	float d = dot(lv,lv);
 	
 	float da = 0.0;
 
 	if (d > 0.0 && la > 0.0 && fa > 0.0)
 	{
 		//normalize light vector
-		lv *= 1.0/d;
+		lv = normalize(lv);
 	
 		//distance attenuation
-		float dist2 = d*d/(la*la);
+		float dist2 = d/la;
 		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 
 		// spotlight coefficient.
@@ -87,7 +87,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 		da *= spot*spot; // GL_SPOT_EXPONENT=2
 
 		//angular attenuation
-		da *= calcDirectionalLight(n, lv);
+		da *= max(dot(n, lv), 0.0);		
 	}
 
 	return da;	
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 9c7a3324179..84c27edb268 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -66,17 +66,17 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 	vec3 lv = lp.xyz-v;
 	
 	//get distance
-	float d = length(lv);
+	float d = dot(lv,lv);
 	
 	float da = 0.0;
 
 	if (d > 0.0 && la > 0.0 && fa > 0.0)
 	{
 		//normalize light vector
-		lv *= 1.0/d;
+		lv = normalize(lv);
 	
 		//distance attenuation
-		float dist2 = d*d/(la*la);
+		float dist2 = d/la;
 		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
 
 		// spotlight coefficient.
@@ -84,7 +84,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
 		da *= spot*spot; // GL_SPOT_EXPONENT=2
 
 		//angular attenuation
-		da *= calcDirectionalLight(n, lv);
+		da *= max(dot(n, lv), 0.0);		
 	}
 
 	return da;	
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index df8f8793d18..38f98519292 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5297,7 +5297,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
 			light_state->setConstantAttenuation(0.f);
 			if (sRenderDeferred)
 			{
-				light_state->setLinearAttenuation(light_radius*1.5f);
+				F32 size = light_radius*1.5f;
+				light_state->setLinearAttenuation(size*size);
 				light_state->setQuadraticAttenuation(light->getLightFalloff()*0.5f+1.f);
 			}
 			else
@@ -5319,7 +5320,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
 				light_state->setSpotCutoff(90.f);
 				light_state->setSpotExponent(2.f);
 	
-				light_state->setSpecular(LLColor4::black);
+				const LLColor4 specular(0.f, 0.f, 0.f, 0.f);
+				light_state->setSpecular(specular);
 			}
 			else // omnidirectional (point) light
 			{
-- 
GitLab


From 9e621af3db9fbb0728bf7b338ea4e17c56ab25bb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 24 Jan 2012 17:37:20 -0600
Subject: [PATCH 650/933] SH-2791 Use request class constructor/destructor for
 keeping track of concurrent requests instead of unreliable
 increments/decrements sprinkled around the code.

---
 indra/newview/llmeshrepository.cpp | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 1d0c262190c..03dc7f6bba1 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -208,6 +208,12 @@ class LLMeshHeaderResponder : public LLCurl::Responder
 	LLMeshHeaderResponder(const LLVolumeParams& mesh_params)
 		: mMeshParams(mesh_params)
 	{
+		LLMeshRepoThread::sActiveHeaderRequests++;
+	}
+
+	~LLMeshHeaderResponder()
+	{
+		LLMeshRepoThread::sActiveHeaderRequests--;
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -227,6 +233,12 @@ class LLMeshLODResponder : public LLCurl::Responder
 	LLMeshLODResponder(const LLVolumeParams& mesh_params, S32 lod, U32 offset, U32 requested_bytes)
 		: mMeshParams(mesh_params), mLOD(lod), mOffset(offset), mRequestedBytes(requested_bytes)
 	{
+		LLMeshRepoThread::sActiveLODRequests++;
+	}
+
+	~LLMeshLODResponder()
+	{
+		LLMeshRepoThread::sActiveLODRequests--;
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -710,7 +722,6 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
 										   new LLMeshSkinInfoResponder(mesh_id, offset, size));
@@ -783,7 +794,6 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshDecompositionResponder(mesh_id, offset, size));
@@ -856,7 +866,6 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshPhysicsShapeResponder(mesh_id, offset, size));
@@ -907,7 +916,6 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
 	std::string http_url = constructUrl(mesh_params.getSculptID());
 	if (!http_url.empty())
 	{
-		++sActiveHeaderRequests;
 		retval = true;
 		//grab first 4KB if we're going to bother with a fetch.  Cache will prevent future fetches if a full mesh fits
 		//within the first 4KB
@@ -974,7 +982,6 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				retval = true;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
@@ -1718,7 +1725,6 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
 
-	LLMeshRepoThread::sActiveLODRequests--;
 	S32 data_size = buffer->countAfter(channels.in(), NULL);
 
 	if (status < 200 || status > 400)
@@ -1935,7 +1941,6 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
-	LLMeshRepoThread::sActiveHeaderRequests--;
 	if (status < 200 || status > 400)
 	{
 		//llwarns
-- 
GitLab


From 63398cd53158e683b12546f4cb2bfb27c78b77da Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 24 Jan 2012 17:37:20 -0600
Subject: [PATCH 651/933] SH-2791 Use request class constructor/destructor for
 keeping track of concurrent requests instead of unreliable
 increments/decrements sprinkled around the code.

---
 indra/newview/llmeshrepository.cpp | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 1d0c262190c..03dc7f6bba1 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -208,6 +208,12 @@ class LLMeshHeaderResponder : public LLCurl::Responder
 	LLMeshHeaderResponder(const LLVolumeParams& mesh_params)
 		: mMeshParams(mesh_params)
 	{
+		LLMeshRepoThread::sActiveHeaderRequests++;
+	}
+
+	~LLMeshHeaderResponder()
+	{
+		LLMeshRepoThread::sActiveHeaderRequests--;
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -227,6 +233,12 @@ class LLMeshLODResponder : public LLCurl::Responder
 	LLMeshLODResponder(const LLVolumeParams& mesh_params, S32 lod, U32 offset, U32 requested_bytes)
 		: mMeshParams(mesh_params), mLOD(lod), mOffset(offset), mRequestedBytes(requested_bytes)
 	{
+		LLMeshRepoThread::sActiveLODRequests++;
+	}
+
+	~LLMeshLODResponder()
+	{
+		LLMeshRepoThread::sActiveLODRequests--;
 	}
 
 	virtual void completedRaw(U32 status, const std::string& reason,
@@ -710,7 +722,6 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
 										   new LLMeshSkinInfoResponder(mesh_id, offset, size));
@@ -783,7 +794,6 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshDecompositionResponder(mesh_id, offset, size));
@@ -856,7 +866,6 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(http_url, headers, offset, size,
 										   new LLMeshPhysicsShapeResponder(mesh_id, offset, size));
@@ -907,7 +916,6 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
 	std::string http_url = constructUrl(mesh_params.getSculptID());
 	if (!http_url.empty())
 	{
-		++sActiveHeaderRequests;
 		retval = true;
 		//grab first 4KB if we're going to bother with a fetch.  Cache will prevent future fetches if a full mesh fits
 		//within the first 4KB
@@ -974,7 +982,6 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 			std::string http_url = constructUrl(mesh_id);
 			if (!http_url.empty())
 			{
-				++sActiveLODRequests;
 				retval = true;
 				LLMeshRepository::sHTTPRequestCount++;
 				mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size,
@@ -1718,7 +1725,6 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
 
-	LLMeshRepoThread::sActiveLODRequests--;
 	S32 data_size = buffer->countAfter(channels.in(), NULL);
 
 	if (status < 200 || status > 400)
@@ -1935,7 +1941,6 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 {
-	LLMeshRepoThread::sActiveHeaderRequests--;
 	if (status < 200 || status > 400)
 	{
 		//llwarns
-- 
GitLab


From d264b5b9233650f2bf8668514b9a5f14c9f6fcfe Mon Sep 17 00:00:00 2001
From: Kitty Barnett <none@none>
Date: Wed, 25 Jan 2012 07:41:08 -0500
Subject: [PATCH 652/933] STORM-1804 Details... button on PERMISSION_DEBIT
 dialog triggers run_time_permissions() with a deny action With help from
 Jonathan Yap

---
 doc/contributions.txt             |  2 ++
 indra/newview/llviewermessage.cpp | 18 ++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 274632a8040..8ec9bfb0abf 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -595,6 +595,7 @@ Jonathan Yap
 	STORM-1719
 	STORM-1712
 	STORM-1728
+	STORM-1804
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
@@ -630,6 +631,7 @@ Kitty Barnett
 	STORM-1001
 	STORM-1175
     VWR-24217
+	STORM-1804
 Kolor Fall
 Komiko Okamoto
 Korvel Noh
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ad333a71ff1..2e233b71ce1 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5786,6 +5786,16 @@ bool script_question_cb(const LLSD& notification, const LLSD& response)
 	S32 orig = notification["payload"]["questions"].asInteger();
 	S32 new_questions = orig;
 
+	if (response["Details"])
+	{
+		// respawn notification...
+		LLNotificationsUtil::add(notification["name"], notification["substitutions"], notification["payload"]);
+
+		// ...with description on top
+		LLNotificationsUtil::add("DebitPermissionDetails");
+		return false;
+	}
+
 	// check whether permissions were granted or denied
 	BOOL allowed = TRUE;
 	// the "yes/accept" button is the first button in the template, making it button 0
@@ -5843,14 +5853,6 @@ bool script_question_cb(const LLSD& notification, const LLSD& response)
 				gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(item_id));
 	}
 
-	if (response["Details"])
-	{
-		// respawn notification...
-		LLNotificationsUtil::add(notification["name"], notification["substitutions"], notification["payload"]);
-
-		// ...with description on top
-		LLNotificationsUtil::add("DebitPermissionDetails");
-	}
 	return false;
 }
 static LLNotificationFunctorRegistration script_question_cb_reg_1("ScriptQuestion", script_question_cb);
-- 
GitLab


From 0bbe8d73cb687e34d1b10c58b67c465df076739c Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 25 Jan 2012 15:37:36 -0600
Subject: [PATCH 653/933] SH-2565 Move resetVertexBuffer operation to a
 consistent location (also avoid redundant resetting of vertex buffers on
 detail switches).  Change assertion to a warning with count info.  Fix bytes
 pooled debug display.  Remove unused static vertex buffer.

---
 indra/llrender/llvertexbuffer.cpp   |  3 +--
 indra/newview/llviewerdisplay.cpp   |  3 +++
 indra/newview/llviewerjointmesh.cpp |  1 -
 indra/newview/pipeline.cpp          | 36 +++++++++++++----------------
 indra/newview/pipeline.h            |  3 +++
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index eb302392bb1..518f3898a4a 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -205,14 +205,13 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
 	rec.mGLName = name;
 	rec.mClientData = buffer;
 
-	sBytesPooled += size;
-	
 	if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
 	{
 		glDeleteBuffersARB(1, &rec.mGLName);
 	}
 	else
 	{
+		sBytesPooled += size;
 		mFreeList[i].push_back(rec);
 	}
 }
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index cb40af70612..0adb187dd20 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -260,6 +260,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 	gPipeline.disableLights();
 	
+	//reset vertex buffers if needed
+	gPipeline.doResetVertexBuffers();
+
 	stop_glerror();
 
 	// Don't draw if the window is hidden or minimized.
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 76f4e18c27c..e052e373931 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -63,7 +63,6 @@ extern PFNGLWEIGHTFVARBPROC glWeightfvARB;
 extern PFNGLVERTEXBLENDARBPROC glVertexBlendARB;
 #endif
 
-static LLPointer<LLVertexBuffer> sRenderBuffer = NULL;
 static const U32 sRenderMask = LLVertexBuffer::MAP_VERTEX |
 							   LLVertexBuffer::MAP_NORMAL |
 							   LLVertexBuffer::MAP_TEXCOORD0;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c523a78b221..a64655960f6 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -203,10 +203,6 @@ extern S32 gBoxFrame;
 extern BOOL gDisplaySwapBuffers;
 extern BOOL gDebugGL;
 
-// hack counter for rendering a fixed number of frames after toggling
-// fullscreen to work around DEV-5361
-static S32 sDelayedVBOEnable = 0;
-
 BOOL	gAvatarBacklight = FALSE;
 
 BOOL	gDebugPipeline = FALSE;
@@ -411,6 +407,7 @@ LLPipeline::LLPipeline() :
 	mOldRenderDebugMask(0),
 	mGroupQ1Locked(false),
 	mGroupQ2Locked(false),
+	mResetVertexBuffers(false),
 	mLastRebuildPool(NULL),
 	mAlphaPool(NULL),
 	mSkyPool(NULL),
@@ -692,8 +689,6 @@ void LLPipeline::destroyGL()
 
 	if (LLVertexBuffer::sEnableVBOs)
 	{
-		// render 30 frames after switching to work around DEV-5361
-		sDelayedVBOEnable = 30;
 		LLVertexBuffer::sEnableVBOs = FALSE;
 	}
 }
@@ -2523,15 +2518,6 @@ void LLPipeline::updateGeom(F32 max_dtime)
 
 	assertInitialized();
 
-	if (sDelayedVBOEnable > 0)
-	{
-		if (--sDelayedVBOEnable <= 0)
-		{
-			resetVertexBuffers();
-			LLVertexBuffer::sEnableVBOs = TRUE;
-		}
-	}
-
 	// notify various object types to reset internal cost metrics, etc.
 	// for now, only LLVOVolume does this to throttle LOD changes
 	LLVOVolume::preUpdateGeom();
@@ -6185,7 +6171,7 @@ LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj)
 
 void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
 {
-	if (!drawable || drawable->isDead())
+	if (!drawable)
 	{
 		return;
 	}
@@ -6198,7 +6184,19 @@ void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
 }
 
 void LLPipeline::resetVertexBuffers()
-{	
+{
+	mResetVertexBuffers = true;
+}
+
+void LLPipeline::doResetVertexBuffers()
+{
+	if (!mResetVertexBuffers)
+	{
+		return;
+	}
+	
+	mResetVertexBuffers = false;
+
 	for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); 
 			iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
 	{
@@ -6224,11 +6222,9 @@ void LLPipeline::resetVertexBuffers()
 
 	if (LLVertexBuffer::sGLCount > 0)
 	{
-		llwarns << "VBO wipe failed." << llendl;
+		llwarns << "VBO wipe failed -- " << LLVertexBuffer::sGLCount << " buffers remaining." << llendl;
 	}
 
-	llassert(LLVertexBuffer::sGLCount == 0);
-
 	LLVertexBuffer::unbind();	
 	
 	sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 9c78048c46a..3c4e389ce0c 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -111,6 +111,7 @@ class LLPipeline
 	void destroyGL();
 	void restoreGL();
 	void resetVertexBuffers();
+	void doResetVertexBuffers();
 	void resizeScreenTexture();
 	void releaseGLBuffers();
 	void releaseScreenBuffers();
@@ -653,6 +654,8 @@ class LLPipeline
 	bool mGroupQ2Locked;
 	bool mGroupQ1Locked;
 
+	bool mResetVertexBuffers; //if true, clear vertex buffers on next update
+
 	LLViewerObject::vobj_list_t		mCreateQ;
 		
 	LLDrawable::drawable_set_t		mRetexturedList;
-- 
GitLab


From 1316f3313066beef74729c2be5a8d142d185161d Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 25 Jan 2012 16:01:56 -0700
Subject: [PATCH 654/933] fix for SH-2904: textures remain stuck in HTP state

---
 indra/llmessage/llcurl.cpp | 11 +++++++++++
 indra/llmessage/llcurl.h   |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 1ab82a273bb..32a9cd061f9 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -91,6 +91,7 @@ std::string LLCurl::sCAFile;
 LLCurlThread* LLCurl::sCurlThread = NULL ;
 LLMutex* LLCurl::sHandleMutexp = NULL ;
 S32      LLCurl::sTotalHandles = 0 ;
+bool     LLCurl::sNotQuitting = true;
 
 void check_curl_code(CURLcode code)
 {
@@ -319,6 +320,14 @@ LLCurl::Easy::~Easy()
 	--gCurlEasyCount;
 	curl_slist_free_all(mHeaders);
 	for_each(mStrings.begin(), mStrings.end(), DeletePointerArray());
+
+	if (mResponder && LLCurl::sNotQuitting) //aborted
+	{	
+		std::string reason("Request timeout, aborted.") ;
+		mResponder->completedRaw(408, //HTTP_REQUEST_TIME_OUT, timeout, abort
+			reason, mChannels, mOutput);		
+	}
+	mResponder = NULL;
 }
 
 void LLCurl::Easy::resetState()
@@ -1462,6 +1471,8 @@ void LLCurl::initClass(bool multi_threaded)
 
 void LLCurl::cleanupClass()
 {
+	sNotQuitting = false; //set quitting
+
 	//shut down curl thread
 	while(1)
 	{
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 2b23ac97630..7d2340a6cbc 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -197,6 +197,8 @@ class LLCurl
 
 	static LLMutex* sHandleMutexp ;
 	static S32      sTotalHandles ;
+public:
+	static bool     sNotQuitting;
 };
 
 class LLCurl::Easy
-- 
GitLab


From a2626f0ee8c723781419ae9722e52872c754e0ba Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 26 Jan 2012 01:41:14 +0200
Subject: [PATCH 655/933] EXP-1335 FIXED Enabled DnD and sorting items in
 Recent tab of My inventory. Added filtering the items on DnD, allowing to
 drop only the items which pass the filter in the destinatination inventory
 panel. Added filtering the items from object contents and notecards. Changed
 handle type for LLInventoryPanel in LLInvFVBridge to remove some extra
 dynamic casts.

---
 indra/newview/llinventorybridge.cpp           | 74 ++++++++++++----
 indra/newview/llinventorybridge.h             |  2 +-
 indra/newview/llinventoryfilter.cpp           | 84 +++++++++++++++++++
 indra/newview/llinventoryfilter.h             |  4 +
 indra/newview/llinventorypanel.h              |  2 +
 indra/newview/llplacesinventorybridge.cpp     |  4 +-
 .../default/xui/en/panel_main_inventory.xml   |  1 -
 7 files changed, 152 insertions(+), 19 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c0065a94e66..ff321f77fd7 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -148,7 +148,7 @@ LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory,
 	mInvType(LLInventoryType::IT_NONE),
 	mIsLink(FALSE)
 {
-	mInventoryPanel = inventory->getHandle();
+	mInventoryPanel = inventory->getInventoryPanelHandle();
 	const LLInventoryObject* obj = getInventoryObject();
 	mIsLink = obj && obj->getIsLinkType();
 }
@@ -798,7 +798,7 @@ LLInventoryObject* LLInvFVBridge::getInventoryObject() const
 
 LLInventoryModel* LLInvFVBridge::getInventoryModel() const
 {
-	LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
+	LLInventoryPanel* panel = mInventoryPanel.get();
 	return panel ? panel->getModel() : NULL;
 }
 
@@ -1738,7 +1738,7 @@ BOOL LLFolderBridge::isItemRemovable() const
 		return FALSE;
 	}
 
-	LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
+	LLInventoryPanel* panel = mInventoryPanel.get();
 	LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL);
 	if (folderp)
 	{
@@ -3290,7 +3290,7 @@ void LLFolderBridge::createNewCategory(void* user_data)
 {
 	LLFolderBridge* bridge = (LLFolderBridge*)user_data;
 	if(!bridge) return;
-	LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(bridge->mInventoryPanel.get());
+	LLInventoryPanel* panel = bridge->mInventoryPanel.get();
 	if (!panel) return;
 	LLInventoryModel* model = panel->getModel();
 	if(!model) return;
@@ -3470,7 +3470,7 @@ void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item)
 	// use callback to rearrange favorite landmarks after adding
 	// to have new one placed before target (on which it was dropped). See EXT-4312.
 	LLPointer<AddFavoriteLandmarkCallback> cb = new AddFavoriteLandmarkCallback();
-	LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
+	LLInventoryPanel* panel = mInventoryPanel.get();
 	LLFolderViewItem* drag_over_item = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL;
 	if (drag_over_item && drag_over_item->getListener())
 	{
@@ -3520,6 +3520,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 	if (!isAgentInventory()) return FALSE; // cannot drag into library
 	if (!isAgentAvatarValid()) return FALSE;
 
+	LLInventoryPanel* destination_panel = mInventoryPanel.get();
+	if (!destination_panel) return false;
+
+	LLInventoryFilter* filter = destination_panel->getFilter();
+	if (!filter) return false;
+
 	const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
 	const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false);
 	const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
@@ -3628,6 +3634,21 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			}
 		}
 
+		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
+
+		// Check whether the item being dragged from active inventory panel
+		// passes the filter of the destination panel.
+		if (accept && active_panel)
+		{
+			LLFolderView* active_folder_viev = active_panel->getRootFolder();
+			if (!active_folder_viev) return false;
+
+			LLFolderViewItem* fv_item = active_folder_viev->getItemByID(inv_item->getUUID());
+			if (!fv_item) return false;
+
+			accept = filter->check(fv_item);
+		}
+
 		if (accept && drop)
 		{
 			if (inv_item->getType() == LLAssetType::AT_GESTURE
@@ -3637,14 +3658,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			}
 			// If an item is being dragged between windows, unselect everything in the active window 
 			// so that we don't follow the selection to its new location (which is very annoying).
-			LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
-			if (active_panel)
+			if (active_panel && (destination_panel != active_panel))
 			{
-				LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
-				if (active_panel && (panel != active_panel))
-				{
-					active_panel->unSelectAll();
-				}
+				active_panel->unSelectAll();
 			}
 
 			//--------------------------------------------------------------------------------
@@ -3655,8 +3671,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			// (only reorder the item in Favorites folder)
 			if ((mUUID == inv_item->getParentUUID()) && move_is_into_favorites)
 			{
-				LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
-				LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL;
+				LLFolderViewItem* itemp = destination_panel->getRootFolder()->getDraggingOverItem();
 				if (itemp)
 				{
 					LLUUID srcItemId = inv_item->getUUID();
@@ -3760,6 +3775,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			accept = FALSE;
 		}
 		
+		// Check whether the item being dragged from in world
+		// passes the filter of the destination panel.
+		if (accept)
+		{
+			accept = filter->check(inv_item);
+		}
+
 		if (accept && drop)
 		{
 			LLMoveInv* move_inv = new LLMoveInv;
@@ -3797,6 +3819,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			accept = !(move_is_into_current_outfit || move_is_into_outfit);
 		}
 		
+		// Check whether the item being dragged from notecard
+		// passes the filter of the destination panel.
+		if (accept)
+		{
+			accept = filter->check(inv_item);
+		}
+
 		if (accept && drop)
 		{
 			copy_inventory_from_notecard(mUUID,  // Drop to the chosen destination folder
@@ -3828,6 +3857,21 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 				accept = can_move_to_landmarks(inv_item);
 			}
 
+			LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
+
+			// Check whether the item being dragged from the library
+			// passes the filter of the destination panel.
+			if (accept && active_panel)
+			{
+				LLFolderView* active_folder_viev = active_panel->getRootFolder();
+				if (!active_folder_viev) return false;
+
+				LLFolderViewItem* fv_item = active_folder_viev->getItemByID(inv_item->getUUID());
+				if (!fv_item) return false;
+
+				accept = filter->check(fv_item);
+			}
+
 			if (accept && drop)
 			{
 				// FAVORITES folder
@@ -4184,7 +4228,7 @@ LLCallingCardBridge::~LLCallingCardBridge()
 
 void LLCallingCardBridge::refreshFolderViewItem()
 {
-	LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
+	LLInventoryPanel* panel = mInventoryPanel.get();
 	LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL;
 	if (itemp)
 	{
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 871657a58ae..3bcd71557c0 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -161,7 +161,7 @@ class LLInvFVBridge : public LLFolderViewEventListener
 									 BOOL restamp);
 	void removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*>& batch);
 protected:
-	LLHandle<LLPanel> mInventoryPanel;
+	LLHandle<LLInventoryPanel> mInventoryPanel;
 	LLFolderView* mRoot;
 	const LLUUID mUUID;	// item id
 	LLInventoryType::EType mInvType;
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index d54bce4619d..796251cae5f 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -108,6 +108,19 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item)
 	return passed;
 }
 
+bool LLInventoryFilter::check(const LLInventoryItem* item)
+{
+	mSubStringMatchOffset = mFilterSubString.size() ? item->getName().find(mFilterSubString) : std::string::npos;
+
+	const bool passed_filtertype = checkAgainstFilterType(item);
+	const bool passed_permissions = checkAgainstPermissions(item);
+	const bool passed = (passed_filtertype &&
+						 passed_permissions &&
+						 (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos));
+
+	return passed;
+}
+
 bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
 {
 	// we're showing all folders, overriding filter
@@ -227,6 +240,66 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 	return TRUE;
 }
 
+bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) const
+{
+	LLInventoryType::EType object_type = item->getInventoryType();
+	const LLUUID object_id = item->getUUID();
+
+	const U32 filterTypes = mFilterOps.mFilterTypes;
+
+	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_OBJECT
+	// Pass if this item's type is of the correct filter type
+	if (filterTypes & FILTERTYPE_OBJECT)
+	{
+		// If it has no type, pass it, unless it's a link.
+		if (object_type == LLInventoryType::IT_NONE)
+		{
+			if (item && item->getIsLinkType())
+			{
+				return false;
+			}
+		}
+		else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
+		{
+			return false;
+		}
+	}
+
+	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_UUID
+	// Pass if this item is the target UUID or if it links to the target UUID
+	if (filterTypes & FILTERTYPE_UUID)
+	{
+		if (!item) return false;
+
+		if (item->getLinkedUUID() != mFilterOps.mFilterUUID)
+			return false;
+	}
+
+	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_DATE
+	// Pass if this item is within the date range.
+	if (filterTypes & FILTERTYPE_DATE)
+	{
+		const U16 HOURS_TO_SECONDS = 3600;
+		time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS;
+		if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest)
+		{
+			earliest = mFilterOps.mMinDate;
+		}
+		else if (!mFilterOps.mHoursAgo)
+		{
+			earliest = 0;
+		}
+		if (item->getCreationDate() < earliest ||
+			item->getCreationDate() > mFilterOps.mMaxDate)
+			return false;
+	}
+
+	return true;
+}
+
 BOOL LLInventoryFilter::checkAgainstPermissions(const LLFolderViewItem* item) const
 {
 	const LLFolderViewEventListener* listener = item->getListener();
@@ -244,6 +317,17 @@ BOOL LLInventoryFilter::checkAgainstPermissions(const LLFolderViewItem* item) co
 	return (perm & mFilterOps.mPermissions) == mFilterOps.mPermissions;
 }
 
+bool LLInventoryFilter::checkAgainstPermissions(const LLInventoryItem* item) const
+{
+	if (!item) return false;
+
+	LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
+	PermissionMask perm = new_item->getPermissionMask();
+	new_item = NULL;
+
+	return (perm & mFilterOps.mPermissions) == mFilterOps.mPermissions;
+}
+
 BOOL LLInventoryFilter::checkAgainstFilterLinks(const LLFolderViewItem* item) const
 {
 	const LLFolderViewEventListener* listener = item->getListener();
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index bba24ac6529..343306ae8ed 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -32,6 +32,7 @@
 
 class LLFolderViewItem;
 class LLFolderViewFolder;
+class LLInventoryItem;
 
 class LLInventoryFilter
 {
@@ -115,9 +116,12 @@ class LLInventoryFilter
 	// + Execution And Results
 	// +-------------------------------------------------------------------+
 	BOOL 				check(const LLFolderViewItem* item);
+	bool				check(const LLInventoryItem* item);
 	bool				checkFolder(const LLFolderViewFolder* folder);
 	BOOL 				checkAgainstFilterType(const LLFolderViewItem* item) const;
+	bool 				checkAgainstFilterType(const LLInventoryItem* item) const;
 	BOOL 				checkAgainstPermissions(const LLFolderViewItem* item) const;
+	bool 				checkAgainstPermissions(const LLInventoryItem* item) const;
 	BOOL 				checkAgainstFilterLinks(const LLFolderViewItem* item) const;
 
 	std::string::size_type getStringMatchOffset() const;
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 8279163762f..7d805f6862a 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -160,6 +160,8 @@ class LLInventoryPanel : public LLPanel
 	
 	void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
 	
+	LLHandle<LLInventoryPanel> getInventoryPanelHandle() const { return getDerivedHandle<LLInventoryPanel>(); }
+
 	// Callbacks
 	void doToSelected(const LLSD& userdata);
 	void doCreate(const LLSD& userdata);
diff --git a/indra/newview/llplacesinventorybridge.cpp b/indra/newview/llplacesinventorybridge.cpp
index 225ac6e224f..fe4cc0f55ff 100644
--- a/indra/newview/llplacesinventorybridge.cpp
+++ b/indra/newview/llplacesinventorybridge.cpp
@@ -89,7 +89,7 @@ void LLPlacesFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		std::vector<std::string> items;
 		std::vector<std::string> disabled_items;
 
-		LLInventoryPanel* inv_panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
+		LLInventoryPanel* inv_panel = mInventoryPanel.get();
 		bool is_open = false;
 		if (inv_panel)
 		{
@@ -137,7 +137,7 @@ void LLPlacesFolderBridge::performAction(LLInventoryModel* model, std::string ac
 LLFolderViewFolder* LLPlacesFolderBridge::getFolder()
 {
 	LLFolderViewFolder* folder = NULL;
-	LLInventoryPanel* inv_panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
+	LLInventoryPanel* inv_panel = mInventoryPanel.get();
 	if (inv_panel)
 	{
 		folder = dynamic_cast<LLFolderViewFolder*>(inv_panel->getRootFolder()->getItemByID(mUUID));
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index d6d8b2a83e1..1c882bb099a 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -80,7 +80,6 @@
      top="16"
      width="288" />
     <recent_inventory_panel
-     accepts_drag_and_drop="false"
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
-- 
GitLab


From 717a6f3306d9382ea252c3e0f243b785c9cae15a Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 25 Jan 2012 18:27:40 -0700
Subject: [PATCH 656/933] Introduce two new parameters "CurlUseMultipleThreads"
 and "CurlRequestTimeOut" for QA to test Curl.

---
 indra/llmessage/llcurl.cpp              | 18 ++++++++++--------
 indra/llmessage/llcurl.h                |  4 +++-
 indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++
 indra/newview/llappviewer.cpp           |  4 +++-
 4 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 32a9cd061f9..3bcaffc2758 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -75,9 +75,6 @@ static const S32 MULTI_PERFORM_CALL_REPEAT	= 5;
 static const S32 CURL_REQUEST_TIMEOUT = 30; // seconds per operation
 static const S32 MAX_ACTIVE_REQUEST_COUNT = 100;
 
-static const F32 DEFAULT_MULTI_IDLE_TIME = 120.0f ; //seconds
-static const S32 MAX_NUM_OF_HANDLES = 256 ; //max number of handles, (multi handles and easy handles combined).
-
 // DEBUG //
 S32 gCurlEasyCount = 0;
 S32 gCurlMultiCount = 0;
@@ -92,6 +89,8 @@ LLCurlThread* LLCurl::sCurlThread = NULL ;
 LLMutex* LLCurl::sHandleMutexp = NULL ;
 S32      LLCurl::sTotalHandles = 0 ;
 bool     LLCurl::sNotQuitting = true;
+F32      LLCurl::sCurlRequestTimeOut = 120.f; //seonds
+S32      LLCurl::sMaxHandles = 256; //max number of handles, (multi handles and easy handles combined).
 
 void check_curl_code(CURLcode code)
 {
@@ -573,9 +572,9 @@ LLCurl::Multi::Multi(F32 idle_time_out)
 		LLCurl::getCurlThread()->addMulti(this) ;
 
 		mIdleTimeOut = idle_time_out ;
-		if(mIdleTimeOut < DEFAULT_MULTI_IDLE_TIME)
+		if(mIdleTimeOut < LLCurl::sCurlRequestTimeOut)
 		{
-			mIdleTimeOut = DEFAULT_MULTI_IDLE_TIME ;
+			mIdleTimeOut = LLCurl::sCurlRequestTimeOut ;
 		}
 
 		++gCurlMultiCount;
@@ -1442,8 +1441,11 @@ unsigned long LLCurl::ssl_thread_id(void)
 }
 #endif
 
-void LLCurl::initClass(bool multi_threaded)
+void LLCurl::initClass(F32 curl_reuest_timeout, S32 max_number_handles, bool multi_threaded)
 {
+	sCurlRequestTimeOut = curl_reuest_timeout ; //seconds
+	sMaxHandles = max_number_handles ; //max number of handles, (multi handles and easy handles combined).
+
 	// Do not change this "unless you are familiar with and mean to control 
 	// internal operations of libcurl"
 	// - http://curl.haxx.se/libcurl/c/curl_global_init.html
@@ -1512,7 +1514,7 @@ CURLM* LLCurl::newMultiHandle()
 {
 	LLMutexLock lock(sHandleMutexp) ;
 
-	if(sTotalHandles + 1 > MAX_NUM_OF_HANDLES)
+	if(sTotalHandles + 1 > sMaxHandles)
 	{
 		llwarns << "no more handles available." << llendl ;
 		return NULL ; //failed
@@ -1545,7 +1547,7 @@ CURL*  LLCurl::newEasyHandle()
 {
 	LLMutexLock lock(sHandleMutexp) ;
 
-	if(sTotalHandles + 1 > MAX_NUM_OF_HANDLES)
+	if(sTotalHandles + 1 > sMaxHandles)
 	{
 		llwarns << "no more handles available." << llendl ;
 		return NULL ; //failed
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 7d2340a6cbc..fd664c0fa19 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -163,7 +163,7 @@ class LLCurl
 	/**
 	 * @ brief Initialize LLCurl class
 	 */
-	static void initClass(bool multi_threaded = false);
+	static void initClass(F32 curl_reuest_timeout = 120.f, S32 max_number_handles = 256, bool multi_threaded = false);
 
 	/**
 	 * @ brief Cleanup LLCurl class
@@ -197,8 +197,10 @@ class LLCurl
 
 	static LLMutex* sHandleMutexp ;
 	static S32      sTotalHandles ;
+	static S32      sMaxHandles;
 public:
 	static bool     sNotQuitting;
+	static F32      sCurlRequestTimeOut;	
 };
 
 class LLCurl::Easy
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1ea623791d6..a29d5d29851 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1828,6 +1828,28 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+  <key>CurlMaximumNumberOfHandles</key>
+  <map>
+    <key>Comment</key>
+    <string>Maximum number of handles curl can use (requires restart)</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>S32</string>
+    <key>Value</key>
+    <integer>256</integer>
+  </map>
+  <key>CurlRequestTimeOut</key>
+  <map>
+    <key>Comment</key>
+    <string>Max idle time of a curl request before killed (requires restart)</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>120.0</real>
+  </map>
   <key>CurlUseMultipleThreads</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 40136adbc9f..4fc306e61db 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -720,7 +720,9 @@ bool LLAppViewer::init()
 
     // *NOTE:Mani - LLCurl::initClass is not thread safe. 
     // Called before threads are created.
-    LLCurl::initClass(gSavedSettings.getBOOL("CurlUseMultipleThreads"));
+    LLCurl::initClass(gSavedSettings.getF32("CurlRequestTimeOut"), 
+						gSavedSettings.getS32("CurlMaximumNumberOfHandles"), 
+						gSavedSettings.getBOOL("CurlUseMultipleThreads"));
 	LL_INFOS("InitInfo") << "LLCurl initialized." << LL_ENDL ;
 
     LLMachineID::init();
-- 
GitLab


From 9429d5d2f23c28c47b3f87774e811213cb9e2997 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 26 Jan 2012 19:35:42 +0200
Subject: [PATCH 657/933] EXP-1839 WIP Added some debugging messages.

---
 indra/newview/llcallfloater.cpp     |  1 +
 indra/newview/llparticipantlist.cpp |  1 +
 indra/newview/llspeakers.cpp        | 14 ++++++++++++++
 indra/newview/llspeakers.h          |  7 +++++++
 4 files changed, 23 insertions(+)

diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index e3217668c54..c95e8234fff 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -333,6 +333,7 @@ void LLCallFloater::refreshParticipantList()
 
 	if (!non_avatar_caller)
 	{
+		llassert(mParticipants == NULL); // check for possible memory leak
 		mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);
 		mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1));
 		const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder");
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 5c95e805ce9..c1b931d7e80 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -760,6 +760,7 @@ void LLParticipantList::LLParticipantListMenu::toggleMute(const LLSD& userdata,
 	LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(speaker_id);
 	if (speakerp.isNull())
 	{
+		LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << llendl;
 		return;
 	}
 	LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id));
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index c588bd8fb44..07d2f1ad6f9 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -272,6 +272,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin
 		speakerp->mStatus = status;
 		mSpeakers.insert(std::make_pair(speakerp->mID, speakerp));
 		mSpeakersSorted.push_back(speakerp);
+		LL_DEBUGS("Speakers") << "Added speaker " << id << llendl;
 		fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "add");
 	}
 	else
@@ -290,6 +291,10 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin
 				speakerp->lookupName();
 			}
 		}
+		else
+		{
+			LL_WARNS("Speakers") << "Speaker " << id << " not found" << llendl;
+		}
 	}
 
 	mSpeakerDelayRemover->unsetActionTimer(speakerp->mID);
@@ -354,6 +359,7 @@ void LLSpeakerMgr::update(BOOL resort_ok)
 			if (moderator_muted_voice != speakerp->mModeratorMutedVoice)
 			{
 				speakerp->mModeratorMutedVoice = moderator_muted_voice;
+				LL_DEBUGS("Speakers") << (speakerp->mModeratorMutedVoice? "Muted" : "Umuted") << " speaker " << speaker_id<< llendl;
 				speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp));
 			}
 
@@ -484,6 +490,7 @@ bool LLSpeakerMgr::removeSpeaker(const LLUUID& speaker_id)
 		}
 	}
 
+	LL_DEBUGS("Speakers") << "Removed speaker " << speaker_id << llendl;
 	fireEvent(new LLSpeakerListChangeEvent(this, speaker_id), "remove");
 
 	update(TRUE);
@@ -595,7 +602,10 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
 					speaker_it->second["mutes"]["text"];
 				// Fire event only if moderator changed
 				if ( is_moderator != speakerp->mIsModerator )
+				{
+					LL_DEBUGS("Speakers") << "Speaker " << agent_id << (is_moderator ? "is now" : "no longer is") << " a moderator" << llendl;
 					fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator");
+				}
 			}
 		}
 	}
@@ -665,7 +675,10 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
 					speakerp->mIsModerator = agent_info["is_moderator"];
 					// Fire event only if moderator changed
 					if ( is_moderator != speakerp->mIsModerator )
+					{
+						LL_DEBUGS("Speakers") << "Speaker " << agent_id << (is_moderator ? "is now" : "no longer is") << " a moderator" << llendl;
 						fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator");
+					}
 				}
 
 				if (agent_info.has("mutes"))
@@ -857,6 +870,7 @@ void LLActiveSpeakerMgr::updateSpeakerList()
 	// always populate from active voice channel
 	if (LLVoiceChannel::getCurrentVoiceChannel() != mVoiceChannel) //MA: seems this is always false
 	{
+		LL_DEBUGS("Speakers") << "Removed all speakers" << llendl;
 		fireEvent(new LLSpeakerListChangeEvent(this, LLUUID::null), "clear");
 		mSpeakers.clear();
 		mSpeakersSorted.clear();
diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h
index 35f2ee70562..b9358cf37c0 100644
--- a/indra/newview/llspeakers.h
+++ b/indra/newview/llspeakers.h
@@ -208,6 +208,8 @@ class LLSpeakersDelayActionsStorage
 
 class LLSpeakerMgr : public LLOldEvents::LLObservable
 {
+	LOG_CLASS(LLSpeakerMgr);
+
 public:
 	LLSpeakerMgr(LLVoiceChannel* channelp);
 	virtual ~LLSpeakerMgr();
@@ -271,6 +273,8 @@ class LLSpeakerMgr : public LLOldEvents::LLObservable
 
 class LLIMSpeakerMgr : public LLSpeakerMgr
 {
+	LOG_CLASS(LLIMSpeakerMgr);
+
 public:
 	LLIMSpeakerMgr(LLVoiceChannel* channel);
 	
@@ -320,6 +324,8 @@ class LLIMSpeakerMgr : public LLSpeakerMgr
 
 class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr>
 {
+	LOG_CLASS(LLActiveSpeakerMgr);
+
 public:
 	LLActiveSpeakerMgr();
 protected:
@@ -328,6 +334,7 @@ class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeak
 
 class LLLocalSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLLocalSpeakerMgr>
 {
+	LOG_CLASS(LLLocalSpeakerMgr);
 public:
 	LLLocalSpeakerMgr();
 	~LLLocalSpeakerMgr ();
-- 
GitLab


From 886946d699880e90b8d34d8b8c2e88d59929d4df Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 26 Jan 2012 19:37:53 +0200
Subject: [PATCH 658/933] EXP-1839 FIXED Fixed treating normal nearby speakers
 as text-only chat participants which led to marking muted avatars as
 non-muted.

---
 indra/newview/llparticipantlist.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index c1b931d7e80..183bc7b610f 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -390,7 +390,10 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
 		{
 			const LLPointer<LLSpeaker>& speakerp = *it;
 
-			update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
+			if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
+			{
+				update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
+			}
 		}
 	}
 }
-- 
GitLab


From 041aaf8ea9ac2a15eb5dacc58d25191e56a7c924 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 26 Jan 2012 10:12:10 -0800
Subject: [PATCH 659/933] * Removed old, unused RenderNightBrightness from
 feature table.

Reviewed by davep.
---
 indra/newview/featuretable.txt       | 1 -
 indra/newview/featuretable_linux.txt | 1 -
 indra/newview/featuretable_mac.txt   | 1 -
 indra/newview/featuretable_xp.txt    | 1 -
 4 files changed, 4 deletions(-)

diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 0f33d40ac3a..76bb2b09761 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -42,7 +42,6 @@ RenderGamma					1	0
 RenderGlowResolutionPow		1	9
 RenderGround				1	1
 RenderMaxPartCount			1	8192
-RenderNightBrightness		1	1.0
 RenderObjectBump			1	1
 RenderLocalLights			1	1
 RenderReflectionDetail		1	4
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index 8142311a550..5e217e000a6 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -43,7 +43,6 @@ RenderGlowResolutionPow		1	9
 RenderGround				1	1
 RenderLocalLights			1	1
 RenderMaxPartCount			1	8192
-RenderNightBrightness		1	1.0
 RenderObjectBump			1	1
 RenderReflectionDetail		1	4
 RenderTerrainDetail			1	1
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 942c0430816..915a012a39c 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -43,7 +43,6 @@ RenderGlowResolutionPow			1	9
 RenderGround					1	1
 RenderLocalLights				1	1
 RenderMaxPartCount				1	8192
-RenderNightBrightness			1	1.0
 RenderObjectBump				1	1
 RenderReflectionDetail			1	4
 RenderTerrainDetail				1	1
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt
index 278d6018600..ae2cf910f27 100644
--- a/indra/newview/featuretable_xp.txt
+++ b/indra/newview/featuretable_xp.txt
@@ -43,7 +43,6 @@ RenderGlowResolutionPow		1	9
 RenderGround				1	1
 RenderLocalLights			1	1
 RenderMaxPartCount			1	8192
-RenderNightBrightness		1	1.0
 RenderObjectBump			1	1
 RenderReflectionDetail		1	4
 RenderTerrainDetail			1	1
-- 
GitLab


From 71a660e0060b9aa2c5c01fd94e8070075b373d8d Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 26 Jan 2012 10:17:41 -0800
Subject: [PATCH 660/933] * Fixed up shader compilation errors to get lighting
 and shadows working again on Mac. * Cleaned up vertex buffer allocation to
 guarantee allocation and deallocation using the same allocation methods from
 the same pools. * Added new shader feature for atmospheric helpers in the
 absence of lighting.

Reviewed by davep.
---
 indra/llrender/llglslshader.cpp               |  21 +-
 indra/llrender/llglslshader.h                 |   1 +
 indra/llrender/llshadermgr.cpp                |   5 +-
 indra/llrender/llvertexbuffer.cpp             | 222 +++++++++---------
 indra/llrender/llvertexbuffer.h               |  31 ++-
 .../class1/deferred/alphaSkinnedV.glsl        |   6 +
 .../shaders/class1/deferred/alphaV.glsl       |   6 +
 .../shaders/class1/deferred/avatarAlphaV.glsl |   6 +
 .../class2/deferred/alphaSkinnedV.glsl        |   6 +
 .../shaders/class2/deferred/alphaV.glsl       |   6 +
 .../shaders/class2/deferred/avatarAlphaV.glsl |   6 +
 indra/newview/llviewershadermgr.cpp           |  31 ++-
 12 files changed, 211 insertions(+), 136 deletions(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 6b2852670a4..3773568ad88 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -64,10 +64,23 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2)
 }
 
 LLShaderFeatures::LLShaderFeatures()
-: calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false),
-hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false),
-hasGamma(false), hasLighting(false), isAlphaLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false),
-hasAlphaMask(false)
+	: atmosphericHelpers(false)
+	, calculatesLighting(false)
+	, calculatesAtmospherics(false)
+	, hasLighting(false)
+	, isAlphaLighting(false)
+	, isShiny(false)
+	, isFullbright(false)
+	, isSpecular(false)
+	, hasWaterFog(false)
+	, hasTransport(false)
+	, hasSkinning(false)
+	, hasObjectSkinning(false)
+	, hasAtmospherics(false)
+	, hasGamma(false)
+	, mIndexedTextureChannels(0)
+	, disableTextureIndex(false)
+	, hasAlphaMask(false)
 {
 }
 
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 00b4b0dbd40..7873fe3c4ee 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -33,6 +33,7 @@
 class LLShaderFeatures
 {
 public:
+	bool atmosphericHelpers;
 	bool calculatesLighting;
 	bool calculatesAtmospherics;
 	bool hasLighting; // implies no transport (it's possible to have neither though)
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 1a03aeebb7d..908443e8cf2 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -94,13 +94,16 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 		}
 	}
 
-	if (features->calculatesLighting)
+	if (features->calculatesLighting || features->atmosphericHelpers)
 	{
 		if (!shader->attachObject("windlight/atmosphericsHelpersV.glsl"))
 		{
 			return FALSE;
 		}
+	}
 		
+	if (features->calculatesLighting)
+	{
 		if (features->isSpecular)
 		{
 			if (!shader->attachObject("lighting/lightFuncSpecularV.glsl"))
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 518f3898a4a..90698853414 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -53,19 +53,19 @@ U32 nhpo2(U32 v)
 //============================================================================
 
 //static
-LLVBOPool LLVertexBuffer::sStreamVBOPool;
-LLVBOPool LLVertexBuffer::sDynamicVBOPool;
-LLVBOPool LLVertexBuffer::sStreamIBOPool;
-LLVBOPool LLVertexBuffer::sDynamicIBOPool;
+LLVBOPool LLVertexBuffer::sStreamVBOPool(GL_STREAM_DRAW_ARB, GL_ARRAY_BUFFER_ARB);
+LLVBOPool LLVertexBuffer::sDynamicVBOPool(GL_DYNAMIC_DRAW_ARB, GL_ARRAY_BUFFER_ARB);
+LLVBOPool LLVertexBuffer::sStreamIBOPool(GL_STREAM_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB);
+LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB);
 U32 LLVBOPool::sBytesPooled = 0;
 
-LLPrivateMemoryPool* LLVertexBuffer::sPrivatePoolp = NULL ;
+LLPrivateMemoryPool* LLVertexBuffer::sPrivatePoolp = NULL;
 U32 LLVertexBuffer::sBindCount = 0;
 U32 LLVertexBuffer::sSetCount = 0;
 S32 LLVertexBuffer::sCount = 0;
 S32 LLVertexBuffer::sGLCount = 0;
 S32 LLVertexBuffer::sMappedCount = 0;
-BOOL LLVertexBuffer::sDisableVBOMapping = FALSE ;
+BOOL LLVertexBuffer::sDisableVBOMapping = FALSE;
 BOOL LLVertexBuffer::sEnableVBOs = TRUE;
 U32 LLVertexBuffer::sGLRenderBuffer = 0;
 U32 LLVertexBuffer::sGLRenderArray = 0;
@@ -204,8 +204,8 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
 	Record rec;
 	rec.mGLName = name;
 	rec.mClientData = buffer;
-
-	if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
+	
+	if (buffer == NULL)
 	{
 		glDeleteBuffersARB(1, &rec.mGLName);
 	}
@@ -282,7 +282,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 {
 	if (sLastMask != data_mask)
 	{
-		BOOL error = FALSE;
+		bool error = false;
 
 		if (LLGLSLShader::sNoFixedFunction)
 		{
@@ -343,7 +343,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 						{
 							if (gDebugSession)
 							{
-								error = TRUE;
+								error = true;
 								gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl;
 							}
 							else
@@ -363,7 +363,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 					{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
 						if (gDebugSession)
 						{
-							error = TRUE;
+							error = true;
 							gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl;
 						}
 						else
@@ -547,7 +547,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
 void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
 {
 	validateRange(start, end, count, indices_offset);
-	mMappable = FALSE;
+	mMappable = false;
 	gGL.syncMatrices();
 
 	llassert(mNumVerts >= 0);
@@ -602,7 +602,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-	mMappable = FALSE;
+	mMappable = false;
 	gGL.syncMatrices();
 
 	llassert(mNumIndices >= 0);
@@ -648,7 +648,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-	mMappable = FALSE;
+	mMappable = false;
 	gGL.syncMatrices();
 	
 	llassert(mNumVerts >= 0);
@@ -688,23 +688,13 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 //static
 void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
 {
-	sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ;
-	sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
+	sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject;
+	sDisableVBOMapping = sEnableVBOs && no_vbo_mapping;
 
-	if(!sPrivatePoolp)
+	if (!sPrivatePoolp)
 	{ 
-		sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
+		sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC);
 	}
-
-	sStreamVBOPool.mType = GL_ARRAY_BUFFER_ARB;
-	sStreamVBOPool.mUsage= GL_STREAM_DRAW_ARB;
-	sStreamIBOPool.mType = GL_ELEMENT_ARRAY_BUFFER_ARB;
-	sStreamIBOPool.mUsage= GL_STREAM_DRAW_ARB;
-
-	sDynamicVBOPool.mType = GL_ARRAY_BUFFER_ARB;
-	sDynamicVBOPool.mUsage= GL_DYNAMIC_DRAW_ARB;
-	sDynamicIBOPool.mType = GL_ELEMENT_ARRAY_BUFFER_ARB;
-	sDynamicIBOPool.mUsage= GL_DYNAMIC_DRAW_ARB;
 }
 
 //static 
@@ -757,65 +747,79 @@ void LLVertexBuffer::cleanupClass()
 
 //----------------------------------------------------------------------------
 
-LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
-	LLRefCount(),
-
-	mNumVerts(0),
-	mNumIndices(0),
-	mUsage(usage),
-	mGLBuffer(0),
-	mGLArray(0),
-	mGLIndices(0), 
-	mMappedData(NULL),
-	mMappedIndexData(NULL), 
-	mVertexLocked(FALSE),
-	mIndexLocked(FALSE),
-	mFinal(FALSE),
-	mEmpty(TRUE),
-	mFence(NULL)
+S32 LLVertexBuffer::determineUsage(S32 usage)
 {
-	LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR);
-	mFence = NULL;
+	S32 ret_usage = usage;
+
 	if (!sEnableVBOs)
 	{
-		mUsage = 0 ; 
+		ret_usage = 0;
 	}
-
-	if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
+	
+	if (usage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
 	{
-		mUsage = 0;
+		ret_usage = 0;
 	}
 	
-	if (mUsage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
+	if (usage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
 	{
-		mUsage = GL_STREAM_DRAW_ARB;
+		ret_usage = GL_STREAM_DRAW_ARB;
 	}
-
-	if (mUsage == 0 && LLRender::sGLCoreProfile)
+	
+	if (usage == 0 && LLRender::sGLCoreProfile)
 	{ //MUST use VBOs for all rendering
-		mUsage = GL_STREAM_DRAW_ARB;
+		ret_usage = GL_STREAM_DRAW_ARB;
 	}
-
-	if (mUsage && mUsage != GL_STREAM_DRAW_ARB)
+	
+	if (usage && usage != GL_STREAM_DRAW_ARB)
 	{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
 		if (sDisableVBOMapping)
 		{ //always use stream draw if VBO mapping is disabled
-			mUsage = GL_STREAM_DRAW_ARB;
+			ret_usage = GL_STREAM_DRAW_ARB;
 		}
 		else
 		{
-			mUsage = GL_DYNAMIC_DRAW_ARB;
+			ret_usage = GL_DYNAMIC_DRAW_ARB;
 		}
 	}
 	
+	return ret_usage;
+}
+
+LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
+	LLRefCount(),
+
+	mNumVerts(0),
+	mNumIndices(0),
+	mAlignedOffset(0),
+	mAlignedIndexOffset(0),
+	mSize(0),
+	mIndicesSize(0),
+	mTypeMask(typemask),
+	mUsage(LLVertexBuffer::determineUsage(usage)),
+	mGLBuffer(0),
+	mGLIndices(0),
+	mGLArray(0),
+	mMappedData(NULL),
+	mMappedIndexData(NULL),
+	mMappedDataUsingVBOs(false),
+	mMappedIndexDataUsingVBOs(false),
+	mVertexLocked(false),
+	mIndexLocked(false),
+	mFinal(false),
+	mEmpty(true),
+	mMappable(false),
+	mFence(NULL)
+{
+	LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR);
 
 	if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
 	{
-		mMappable = TRUE;
+		mMappable = true;
 	}
 	else
 	{
-		mMappable = FALSE;
+		mMappable = false;
 	}
 
 	//zero out offsets
@@ -824,12 +828,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 		mOffsets[i] = 0;
 	}
 
-	mTypeMask = typemask;
-	mSize = 0;
-	mIndicesSize = 0;
-	mAlignedOffset = 0;
-	mAlignedIndexOffset = 0;
-
 	sCount++;
 }
 
@@ -1010,9 +1008,11 @@ void LLVertexBuffer::createGLBuffer(U32 size)
 		return;
 	}
 
-	mEmpty = TRUE;
+	mEmpty = true;
 
-	if (useVBOs())
+	mMappedDataUsingVBOs = useVBOs();
+	
+	if (mMappedDataUsingVBOs)
 	{
 		genBuffer(size);
 	}
@@ -1039,12 +1039,14 @@ void LLVertexBuffer::createGLIndices(U32 size)
 		return;
 	}
 
-	mEmpty = TRUE;
+	mEmpty = true;
 
 	//pad by 16 bytes for aligned copies
 	size += 16;
 
-	if (useVBOs())
+	mMappedIndexDataUsingVBOs = useVBOs();
+
+	if (mMappedIndexDataUsingVBOs)
 	{
 		//pad by another 16 bytes for VBO pointer adjustment
 		size += 16;
@@ -1064,15 +1066,15 @@ void LLVertexBuffer::destroyGLBuffer()
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_BUFFER);
 	if (mGLBuffer)
 	{
-		if (useVBOs())
+		if (mMappedDataUsingVBOs)
 		{
 			releaseBuffer();
 		}
 		else
 		{
-			FREE_MEM(sPrivatePoolp, (void*) mMappedData) ;
+			FREE_MEM(sPrivatePoolp, (void*) mMappedData);
 			mMappedData = NULL;
-			mEmpty = TRUE;
+			mEmpty = true;
 		}
 	}
 	
@@ -1085,15 +1087,15 @@ void LLVertexBuffer::destroyGLIndices()
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_INDICES);
 	if (mGLIndices)
 	{
-		if (useVBOs())
+		if (mMappedIndexDataUsingVBOs)
 		{
 			releaseIndices();
 		}
 		else
 		{
-			FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData) ;
+			FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData);
 			mMappedIndexData = NULL;
-			mEmpty = TRUE;
+			mEmpty = true;
 		}
 	}
 
@@ -1278,16 +1280,10 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
 	}
 }
 
-BOOL LLVertexBuffer::useVBOs() const
+bool LLVertexBuffer::useVBOs() const
 {
 	//it's generally ineffective to use VBO for things that are streaming on apple
-		
-	if (!mUsage)
-	{
-		return FALSE;
-	}
-
-	return TRUE;
+	return (mUsage != 0);
 }
 
 //----------------------------------------------------------------------------
@@ -1367,7 +1363,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 		if (!mVertexLocked)
 		{
 			LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES);
-			mVertexLocked = TRUE;
+			mVertexLocked = true;
 			sMappedCount++;
 			stop_glerror();	
 
@@ -1446,8 +1442,8 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 			{
 				log_glerror();
 
-			//check the availability of memory
-			LLMemory::logMemoryInfo(TRUE) ; 
+				//check the availability of memory
+				LLMemory::logMemoryInfo(TRUE) ; 
 			
 				if(mMappable)
 				{			
@@ -1546,7 +1542,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 		{
 			LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES);
 
-			mIndexLocked = TRUE;
+			mIndexLocked = true;
 			sMappedCount++;
 			stop_glerror();	
 
@@ -1741,7 +1737,7 @@ void LLVertexBuffer::unmapBuffer()
 			mMappedData = NULL;
 		}
 
-		mVertexLocked = FALSE ;
+		mVertexLocked = false;
 		sMappedCount--;
 	}
 	
@@ -1808,13 +1804,13 @@ void LLVertexBuffer::unmapBuffer()
 			mMappedIndexData = NULL ;
 		}
 
-		mIndexLocked = FALSE ;
+		mIndexLocked = false ;
 		sMappedCount--;
 	}
 
 	if(updated_all)
 	{
-		mEmpty = FALSE;
+		mEmpty = false;
 	}
 }
 
@@ -1834,12 +1830,12 @@ template <class T,S32 type> struct VertexBufferStrider
 			if (ptr == NULL)
 			{
 				llwarns << "mapIndexBuffer failed!" << llendl;
-				return FALSE;
+				return false;
 			}
 
 			strider = (T*)ptr;
 			strider.setStride(0);
-			return TRUE;
+			return true;
 		}
 		else if (vbo.hasDataType(type))
 		{
@@ -1850,18 +1846,18 @@ template <class T,S32 type> struct VertexBufferStrider
 			if (ptr == NULL)
 			{
 				llwarns << "mapVertexBuffer failed!" << llendl;
-				return FALSE;
+				return false;
 			}
 
 			strider = (T*)ptr;
 			strider.setStride(stride);
-			return TRUE;
+			return true;
 		}
 		else
 		{
 			llerrs << "VertexBufferStrider could not find valid vertex data." << llendl;
 		}
-		return FALSE;
+		return false;
 	}
 };
 
@@ -2014,7 +2010,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER);
 	//set up pointers if the data mask is different ...
-	BOOL setup = (sLastMask != data_mask);
+	bool setup = (sLastMask != data_mask);
 
 	if (gDebugGL && data_mask != 0)
 	{ //make sure data requirements are fulfilled
@@ -2048,21 +2044,17 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 		if (mGLArray)
 		{
 			bindGLArray();
-			setup = FALSE; //do NOT perform pointer setup if using VAO
+			setup = false; //do NOT perform pointer setup if using VAO
 		}
 		else
 		{
-			if (bindGLBuffer())
-			{
-				setup = TRUE;
-			}
-			if (bindGLIndices())
-			{
-				setup = TRUE;
-			}
+			const bool bindBuffer = bindGLBuffer();
+			const bool bindIndices = bindGLIndices();
+			
+			setup = setup || bindBuffer || bindIndices;
 		}
 
-		BOOL error = FALSE;
+		bool error = false;
 		if (gDebugGL && !mGLArray)
 		{
 			GLint buff;
@@ -2071,7 +2063,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 			{
 				if (gDebugSession)
 				{
-					error = TRUE;
+					error = true;
 					gFailLog << "Invalid GL vertex buffer bound: " << buff << std::endl;
 				}
 				else
@@ -2087,7 +2079,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 				{
 					if (gDebugSession)
 					{
-						error = TRUE;
+						error = true;
 						gFailLog << "Invalid GL index buffer bound: " << buff <<  std::endl;
 					}
 					else
@@ -2119,12 +2111,12 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 				glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
 				sBindCount++;
 				sVBOActive = FALSE;
-				setup = TRUE; // ... or a VBO is deactivated
+				setup = true; // ... or a VBO is deactivated
 			}
 			if (sGLRenderBuffer != mGLBuffer)
 			{
 				sGLRenderBuffer = mGLBuffer;
-				setup = TRUE; // ... or a client memory pointer changed
+				setup = true; // ... or a client memory pointer changed
 			}
 		}
 		if (mGLIndices)
@@ -2221,19 +2213,19 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 		{
 			S32 loc = TYPE_WEIGHT;
 			void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
-			glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
+			glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
 		}
 		if (data_mask & MAP_WEIGHT4)
 		{
 			S32 loc = TYPE_WEIGHT4;
 			void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
-			glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
+			glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
 		}
 		if (data_mask & MAP_CLOTHWEIGHT)
 		{
 			S32 loc = TYPE_CLOTHWEIGHT;
 			void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
-			glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
+			glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
 		}
 		if (data_mask & MAP_TEXTURE_INDEX)
 		{
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index e1cbfd3b619..a0d21b4a36c 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -55,9 +55,14 @@ class LLVBOPool
 {
 public:
 	static U32 sBytesPooled;
+	
+	LLVBOPool(U32 vboUsage, U32 vboType)
+		: mUsage(vboUsage)
+		, mType(vboType)
+	{}
 
-	U32 mUsage;
-	U32 mType;
+	const U32 mUsage;
+	const U32 mType;
 
 	//size MUST be a power of 2
 	volatile U8* allocate(U32& name, U32 size);
@@ -103,6 +108,7 @@ class LLVertexBuffer : public LLRefCount
 	};
 
 	LLVertexBuffer(const LLVertexBuffer& rhs)
+		: mUsage(rhs.mUsage)
 	{
 		*this = rhs;
 	}
@@ -201,7 +207,7 @@ class LLVertexBuffer : public LLRefCount
 	void 	destroyGLIndices();
 	void	updateNumVerts(S32 nverts);
 	void	updateNumIndices(S32 nindices); 
-	virtual BOOL	useVBOs() const;
+	bool	useVBOs() const;
 	void	unmapBuffer();
 		
 public:
@@ -274,18 +280,24 @@ class LLVertexBuffer : public LLRefCount
 	S32		mSize;
 	S32		mIndicesSize;
 	U32		mTypeMask;
-	S32		mUsage;			// GL usage
+
+	const S32		mUsage;			// GL usage
+	
 	U32		mGLBuffer;		// GL VBO handle
 	U32		mGLIndices;		// GL IBO handle
 	U32		mGLArray;		// GL VAO handle
 	
 	volatile U8* mMappedData;	// pointer to currently mapped data (NULL if unmapped)
 	volatile U8* mMappedIndexData;	// pointer to currently mapped indices (NULL if unmapped)
-	BOOL	mVertexLocked;			// if TRUE, vertex buffer is being or has been written to in client memory
-	BOOL	mIndexLocked;			// if TRUE, index buffer is being or has been written to in client memory
-	BOOL	mFinal;			// if TRUE, buffer can not be mapped again
-	BOOL	mEmpty;			// if TRUE, client buffer is empty (or NULL). Old values have been discarded.	
-	mutable BOOL	mMappable;     // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
+
+	U32		mMappedDataUsingVBOs : 1;
+	U32		mMappedIndexDataUsingVBOs : 1;
+	U32		mVertexLocked : 1;			// if TRUE, vertex buffer is being or has been written to in client memory
+	U32		mIndexLocked : 1;			// if TRUE, index buffer is being or has been written to in client memory
+	U32		mFinal : 1;			// if TRUE, buffer can not be mapped again
+	U32		mEmpty : 1;			// if TRUE, client buffer is empty (or NULL). Old values have been discarded.	
+	
+	mutable bool	mMappable;     // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
 	S32		mOffsets[TYPE_MAX];
 
 	std::vector<MappedRegion> mMappedVertexRegions;
@@ -296,6 +308,7 @@ class LLVertexBuffer : public LLRefCount
 	void placeFence() const;
 	void waitFence() const;
 
+	static S32 determineUsage(S32 usage);
 
 private:
 	static LLPrivateMemoryPool* sPrivatePoolp ;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 40b0cf47ac5..eada38eaaa0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -55,6 +55,12 @@ uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
 uniform vec3 light_diffuse[8];
 
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 8c96d553424..5c36118a50a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -64,6 +64,12 @@ uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
 uniform vec3 light_diffuse[8];
 
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index c0edddc40a5..d6149fcc32a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -59,6 +59,12 @@ uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
 uniform vec3 light_diffuse[8];
 
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index 83815b17860..9629cfe824e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -61,6 +61,12 @@ uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
 uniform vec3 light_diffuse[8];
 
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 //get light vector
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 1660f9687eb..1586aab0f25 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -63,6 +63,12 @@ uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
 uniform vec3 light_diffuse[8];
 
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 84c27edb268..44aaa98b977 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -60,6 +60,12 @@ uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
 uniform vec3 light_diffuse[8];
 
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
 float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
 {
 	//get light vector
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 5de363e03cc..6db21386887 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -730,7 +730,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 
 	vector< pair<string, S32> > shaders;
 	shaders.push_back( make_pair( "windlight/atmosphericsVarsV.glsl",		mVertexShaderLevel[SHADER_WINDLIGHT] ) );
-	shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterV.glsl",		mVertexShaderLevel[SHADER_WINDLIGHT] ) );
+	shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterV.glsl",	mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	shaders.push_back( make_pair( "windlight/atmosphericsHelpersV.glsl",	mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	shaders.push_back( make_pair( "lighting/lightFuncV.glsl",				mVertexShaderLevel[SHADER_LIGHTING] ) );
 	shaders.push_back( make_pair( "lighting/sumLightsV.glsl",				sum_lights_class ) );
@@ -1102,19 +1102,25 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	if (success)
 	{
 		gDeferredSkinnedAlphaProgram.mName = "Deferred Skinned Alpha Shader";
+		gDeferredSkinnedAlphaProgram.mFeatures.atmosphericHelpers = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.hasObjectSkinning = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.calculatesAtmospherics = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.hasGamma = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.hasAtmospherics = true;
-		gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = true;
-		gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true;
+		gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = false;
+		gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = false;
 		gDeferredSkinnedAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredSkinnedAlphaProgram.mFeatures.disableTextureIndex = true;
 		gDeferredSkinnedAlphaProgram.mShaderFiles.clear();
 		gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+		
 		success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL);
+		
+		// Hack to include uniforms for lighting without linking in lighting file
+		gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = true;
+		gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true;
 	}
 
 	if (success)
@@ -1231,11 +1237,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	if (success)
 	{
 		gDeferredAlphaProgram.mName = "Deferred Alpha Shader";
-		gDeferredAlphaProgram.mFeatures.calculatesLighting = true;
+		gDeferredAlphaProgram.mFeatures.atmosphericHelpers = true;
+		gDeferredAlphaProgram.mFeatures.calculatesLighting = false;
 		gDeferredAlphaProgram.mFeatures.calculatesAtmospherics = true;
 		gDeferredAlphaProgram.mFeatures.hasGamma = true;
 		gDeferredAlphaProgram.mFeatures.hasAtmospherics = true;
-		gDeferredAlphaProgram.mFeatures.hasLighting = true;
+		gDeferredAlphaProgram.mFeatures.hasLighting = false;
 		gDeferredAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels
 		if (mVertexShaderLevel[SHADER_DEFERRED] < 1)
@@ -1251,7 +1258,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+
 		success = gDeferredAlphaProgram.createShader(NULL, NULL);
+
+		// Hack
+		gDeferredAlphaProgram.mFeatures.calculatesLighting = true;
+		gDeferredAlphaProgram.mFeatures.hasLighting = true;
 	}
 
 	if (success)
@@ -1394,19 +1406,24 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	if (success)
 	{
 		gDeferredAvatarAlphaProgram.mName = "Avatar Alpha Shader";
+		gDeferredAvatarAlphaProgram.mFeatures.atmosphericHelpers = true;
 		gDeferredAvatarAlphaProgram.mFeatures.hasSkinning = true;
-		gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true;
+		gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = false;
 		gDeferredAvatarAlphaProgram.mFeatures.calculatesAtmospherics = true;
 		gDeferredAvatarAlphaProgram.mFeatures.hasGamma = true;
 		gDeferredAvatarAlphaProgram.mFeatures.hasAtmospherics = true;
-		gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true;
+		gDeferredAvatarAlphaProgram.mFeatures.hasLighting = false;
 		gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true;
 		gDeferredAvatarAlphaProgram.mShaderFiles.clear();
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+
 		success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms);
+
+		gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true;
+		gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true;
 	}
 
 	if (success)
-- 
GitLab


From 17b21fc197f162a4070083c436920c0640431568 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 26 Jan 2012 12:50:24 -0600
Subject: [PATCH 661/933] Fix for windows build

---
 indra/llrender/llvertexbuffer.cpp | 36 +++++++++++++++----------------
 indra/llrender/llvertexbuffer.h   | 32 +++++++++++++--------------
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 90698853414..a7151afeb1d 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -65,19 +65,19 @@ U32 LLVertexBuffer::sSetCount = 0;
 S32 LLVertexBuffer::sCount = 0;
 S32 LLVertexBuffer::sGLCount = 0;
 S32 LLVertexBuffer::sMappedCount = 0;
-BOOL LLVertexBuffer::sDisableVBOMapping = FALSE;
-BOOL LLVertexBuffer::sEnableVBOs = TRUE;
+bool LLVertexBuffer::sDisableVBOMapping = false;
+bool LLVertexBuffer::sEnableVBOs = true;
 U32 LLVertexBuffer::sGLRenderBuffer = 0;
 U32 LLVertexBuffer::sGLRenderArray = 0;
 U32 LLVertexBuffer::sGLRenderIndices = 0;
 U32 LLVertexBuffer::sLastMask = 0;
-BOOL LLVertexBuffer::sVBOActive = FALSE;
-BOOL LLVertexBuffer::sIBOActive = FALSE;
+bool LLVertexBuffer::sVBOActive = false;
+bool LLVertexBuffer::sIBOActive = false;
 U32 LLVertexBuffer::sAllocatedBytes = 0;
-BOOL LLVertexBuffer::sMapped = FALSE;
-BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
-BOOL LLVertexBuffer::sUseVAO = FALSE;
-BOOL LLVertexBuffer::sPreferStreamDraw = FALSE;
+bool LLVertexBuffer::sMapped = false;
+bool LLVertexBuffer::sUseStreamDraw = true;
+bool LLVertexBuffer::sUseVAO = false;
+bool LLVertexBuffer::sPreferStreamDraw = false;
 
 const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000;  //1 ms
 
@@ -707,18 +707,18 @@ void LLVertexBuffer::unbind()
 #endif
 		sGLRenderArray = 0;
 		sGLRenderIndices = 0;
-		sIBOActive = FALSE;
+		sIBOActive = false;
 	}
 
 	if (sVBOActive)
 	{
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
-		sVBOActive = FALSE;
+		sVBOActive = false;
 	}
 	if (sIBOActive)
 	{
 		glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
-		sIBOActive = FALSE;
+		sIBOActive = false;
 	}
 
 	sGLRenderBuffer = 0;
@@ -1443,7 +1443,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 				log_glerror();
 
 				//check the availability of memory
-				LLMemory::logMemoryInfo(TRUE) ; 
+				LLMemory::logMemoryInfo(true) ; 
 			
 				if(mMappable)
 				{			
@@ -1621,7 +1621,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 		if (!mMappedIndexData)
 		{
 			log_glerror();
-			LLMemory::logMemoryInfo(TRUE) ;
+			LLMemory::logMemoryInfo(true) ;
 
 			if(mMappable)
 			{
@@ -1956,7 +1956,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
 		sGLRenderBuffer = mGLBuffer;
 		sBindCount++;
-		sVBOActive = TRUE;
+		sVBOActive = true;
 
 		if (mGLArray)
 		{
@@ -1988,7 +1988,7 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind)
 		sGLRenderIndices = mGLIndices;
 		stop_glerror();
 		sBindCount++;
-		sIBOActive = TRUE;
+		sIBOActive = true;
 		ret = true;
 	}
 
@@ -2101,7 +2101,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 #endif
 			sGLRenderArray = 0;
 			sGLRenderIndices = 0;
-			sIBOActive = FALSE;
+			sIBOActive = false;
 		}
 
 		if (mGLBuffer)
@@ -2110,7 +2110,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 			{
 				glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
 				sBindCount++;
-				sVBOActive = FALSE;
+				sVBOActive = false;
 				setup = true; // ... or a VBO is deactivated
 			}
 			if (sGLRenderBuffer != mGLBuffer)
@@ -2125,7 +2125,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
 			{
 				glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
 				sBindCount++;
-				sIBOActive = FALSE;
+				sIBOActive = false;
 			}
 			
 			sGLRenderIndices = mGLIndices;
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index a0d21b4a36c..0bf689bfad0 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -124,9 +124,9 @@ class LLVertexBuffer : public LLRefCount
 	static LLVBOPool sStreamIBOPool;
 	static LLVBOPool sDynamicIBOPool;
 
-	static BOOL	sUseStreamDraw;
-	static BOOL sUseVAO;
-	static BOOL	sPreferStreamDraw;
+	static bool	sUseStreamDraw;
+	static bool sUseVAO;
+	static bool	sPreferStreamDraw;
 
 	static void initClass(bool use_vbo, bool no_vbo_mapping);
 	static void cleanupClass();
@@ -245,8 +245,8 @@ class LLVertexBuffer : public LLRefCount
 	bool getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index=0, S32 count = -1, bool map_range = false);
 	
 
-	BOOL isEmpty() const					{ return mEmpty; }
-	BOOL isLocked() const					{ return mVertexLocked || mIndexLocked; }
+	bool isEmpty() const					{ return mEmpty; }
+	bool isLocked() const					{ return mVertexLocked || mIndexLocked; }
 	S32 getNumVerts() const					{ return mNumVerts; }
 	S32 getNumIndices() const				{ return mNumIndices; }
 	
@@ -260,7 +260,7 @@ class LLVertexBuffer : public LLRefCount
 	volatile U8* getMappedIndices() const			{ return mMappedIndexData; }
 	S32 getOffset(S32 type) const			{ return mOffsets[type]; }
 	S32 getUsage() const					{ return mUsage; }
-	BOOL isWriteable() const				{ return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
+	bool isWriteable() const				{ return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? true : false; }
 
 	void draw(U32 mode, U32 count, U32 indices_offset) const;
 	void drawArrays(U32 mode, U32 offset, U32 count) const;
@@ -292,12 +292,12 @@ class LLVertexBuffer : public LLRefCount
 
 	U32		mMappedDataUsingVBOs : 1;
 	U32		mMappedIndexDataUsingVBOs : 1;
-	U32		mVertexLocked : 1;			// if TRUE, vertex buffer is being or has been written to in client memory
-	U32		mIndexLocked : 1;			// if TRUE, index buffer is being or has been written to in client memory
-	U32		mFinal : 1;			// if TRUE, buffer can not be mapped again
-	U32		mEmpty : 1;			// if TRUE, client buffer is empty (or NULL). Old values have been discarded.	
+	U32		mVertexLocked : 1;			// if true, vertex buffer is being or has been written to in client memory
+	U32		mIndexLocked : 1;			// if true, index buffer is being or has been written to in client memory
+	U32		mFinal : 1;			// if true, buffer can not be mapped again
+	U32		mEmpty : 1;			// if true, client buffer is empty (or NULL). Old values have been discarded.	
 	
-	mutable bool	mMappable;     // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
+	mutable bool	mMappable;     // if true, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
 	S32		mOffsets[TYPE_MAX];
 
 	std::vector<MappedRegion> mMappedVertexRegions;
@@ -317,18 +317,18 @@ class LLVertexBuffer : public LLRefCount
 	static S32 sCount;
 	static S32 sGLCount;
 	static S32 sMappedCount;
-	static BOOL sMapped;
+	static bool sMapped;
 	typedef std::list<LLVertexBuffer*> buffer_list_t;
 		
-	static BOOL sDisableVBOMapping; //disable glMapBufferARB
-	static BOOL sEnableVBOs;
+	static bool sDisableVBOMapping; //disable glMapBufferARB
+	static bool sEnableVBOs;
 	static S32 sTypeSize[TYPE_MAX];
 	static U32 sGLMode[LLRender::NUM_MODES];
 	static U32 sGLRenderBuffer;
 	static U32 sGLRenderArray;
 	static U32 sGLRenderIndices;
-	static BOOL sVBOActive;
-	static BOOL sIBOActive;
+	static bool sVBOActive;
+	static bool sIBOActive;
 	static U32 sLastMask;
 	static U32 sAllocatedBytes;
 	static U32 sBindCount;
-- 
GitLab


From ce9ff40c64929cef8c8f422723ce631735774c9a Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 26 Jan 2012 12:11:22 -0800
Subject: [PATCH 662/933] EXP-1844 FIX Selecting a large number of inventory
 items can block the viewer for a long time.

---
 indra/newview/llinventorybridge.cpp           |   3 +-
 .../llinventorymodelbackgroundfetch.cpp       | 283 ++++++++++++------
 .../newview/llinventorymodelbackgroundfetch.h |  16 +-
 3 files changed, 205 insertions(+), 97 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index ff321f77fd7..869cb735d59 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1324,8 +1324,7 @@ void LLItemBridge::selectItem()
 	LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
 	if(item && !item->isFinished())
 	{
-		item->fetchFromServer();
-		//LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
+		LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
 	}
 }
 
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 91fdd678063..cb140cf15c1 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -50,7 +50,7 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch() :
 	mMinTimeBetweenFetches(0.3f),
 	mMaxTimeBetweenFetches(10.f),
 	mTimelyFetchPending(FALSE),
-	mBulkFetchCount(0)
+	mFetchCount(0)
 {
 }
 
@@ -60,7 +60,7 @@ LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch()
 
 bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const
 {
-	return mFetchQueue.empty() && mBulkFetchCount<=0;
+	return mFetchQueue.empty() && mFetchCount<=0;
 }
 
 bool LLInventoryModelBackgroundFetch::libraryFetchStarted() const
@@ -103,14 +103,15 @@ BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const
 	return mBackgroundFetchActive;
 }
 
-void LLInventoryModelBackgroundFetch::start(const LLUUID& cat_id, BOOL recursive)
+void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive)
 {
-	if (!mAllFoldersFetched || cat_id.notNull())
-	{
-		LL_DEBUGS("InventoryFetch") << "Start fetching category: " << cat_id << ", recursive: " << recursive << LL_ENDL;
+	LLViewerInventoryCategory* cat = gInventory.getCategory(id);
+	if (cat || (id.isNull() && !mAllFoldersFetched))
+	{	// it's a folder, do a bulk fetch
+		LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL;
 
 		mBackgroundFetchActive = TRUE;
-		if (cat_id.isNull())
+		if (id.isNull())
 		{
 			if (!mRecursiveInventoryFetchStarted)
 			{
@@ -128,21 +129,31 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& cat_id, BOOL recursive
 		else
 		{
 			// Specific folder requests go to front of queue.
-			if (mFetchQueue.empty() || mFetchQueue.front().mCatUUID != cat_id)
+			if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id)
 			{
-				mFetchQueue.push_front(FetchQueueInfo(cat_id, recursive));
+				mFetchQueue.push_front(FetchQueueInfo(id, recursive));
 				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
 			}
-			if (cat_id == gInventory.getLibraryRootFolderID())
+			if (id == gInventory.getLibraryRootFolderID())
 			{
 				mRecursiveLibraryFetchStarted |= recursive;
 			}
-			if (cat_id == gInventory.getRootFolderID())
+			if (id == gInventory.getRootFolderID())
 			{
 				mRecursiveInventoryFetchStarted |= recursive;
 			}
 		}
 	}
+	else if (LLViewerInventoryItem* itemp = gInventory.getItem(id))
+	{
+		if (!itemp->mIsComplete && (mFetchQueue.empty() || mFetchQueue.front().mUUID != id))
+		{
+			mBackgroundFetchActive = TRUE;
+
+			mFetchQueue.push_front(FetchQueueInfo(id, false, false));
+			gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+		}
+	}
 }
 
 void LLInventoryModelBackgroundFetch::findLostItems()
@@ -158,7 +169,7 @@ void LLInventoryModelBackgroundFetch::stopBackgroundFetch()
 	{
 		mBackgroundFetchActive = FALSE;
 		gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-		mBulkFetchCount=0;
+		mFetchCount=0;
 		mMinTimeBetweenFetches=0.0f;
 	}
 }
@@ -183,10 +194,9 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 	if (mBackgroundFetchActive && gAgent.getRegion())
 	{
 		// If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
-		std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents2");   
-		if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty()) 
+		if (gSavedSettings.getBOOL("UseHTTPInventory")) 
 		{
-			bulkFetch(url);
+			bulkFetch();
 			return;
 		}
 		
@@ -230,7 +240,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 			}
 
 			const FetchQueueInfo info = mFetchQueue.front();
-			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mCatUUID);
+			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID);
 
 			// Category has been deleted, remove from queue.
 			if (!cat)
@@ -258,7 +268,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 				}
 			}
 			// Do I have all my children?
-			else if (gInventory.isCategoryComplete(info.mCatUUID))
+			else if (gInventory.isCategoryComplete(info.mUUID))
 			{
 				// Finished with this category, remove from queue.
 				mFetchQueue.pop_front();
@@ -313,15 +323,35 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 	}
 }
 
-void LLInventoryModelBackgroundFetch::incrBulkFetch(S16 fetching) 
+void LLInventoryModelBackgroundFetch::incrFetchCount(S16 fetching) 
 {  
-	mBulkFetchCount += fetching; 
-	if (mBulkFetchCount < 0)
+	mFetchCount += fetching; 
+	if (mFetchCount < 0)
 	{
-		mBulkFetchCount = 0; 
+		mFetchCount = 0; 
 	}
 }
 
+class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInventoryResponder
+{
+public:
+	LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {};
+	void result(const LLSD& content);			
+	void error(U32 status, const std::string& reason);
+};
+
+void LLInventoryModelFetchItemResponder::result( const LLSD& content )
+{
+	LLInventoryModel::fetchInventoryResponder::result(content);
+	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
+}
+
+void LLInventoryModelFetchItemResponder::error( U32 status, const std::string& reason )
+{
+	LLInventoryModel::fetchInventoryResponder::error(status, reason);
+	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
+}
+
 
 class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder
 {
@@ -458,7 +488,7 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
 		}
 	}
 
-	fetcher->incrBulkFetch(-1);
+	fetcher->incrFetchCount(-1);
 	
 	if (fetcher->isBulkFetchProcessingComplete())
 	{
@@ -477,7 +507,7 @@ void LLInventoryModelFetchDescendentsResponder::error(U32 status, const std::str
 	llinfos << "LLInventoryModelFetchDescendentsResponder::error "
 		<< status << ": " << reason << llendl;
 						
-	fetcher->incrBulkFetch(-1);
+	fetcher->incrFetchCount(-1);
 
 	if (status==499) // timed out
 	{
@@ -508,12 +538,14 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat
 
 // Bundle up a bunch of requests to send all at once.
 // static   
-void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
+void LLInventoryModelBackgroundFetch::bulkFetch()
 {
 	//Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped.
 	//If there are items in mFetchQueue, we want to check the time since the last bulkFetch was 
 	//sent.  If it exceeds our retry time, go ahead and fire off another batch.  
 	//Stopbackgroundfetch will be run from the Responder instead of here.  
+	LLViewerRegion* region = gAgent.getRegion();
+	if (!region) return;
 
 	S16 max_concurrent_fetches=8;
 	F32 new_min_time = 0.5f;			//HACK!  Clean this up when old code goes away entirely.
@@ -523,12 +555,13 @@ void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
 	}
 	
 	if (gDisconnected ||
-		(mBulkFetchCount > max_concurrent_fetches) ||
+		(mFetchCount > max_concurrent_fetches) ||
 		(mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches))
 	{
 		return; // just bail if we are disconnected
 	}	
 
+	U32 item_count=0;
 	U32 folder_count=0;
 	U32 max_batch_size=5;
 
@@ -536,83 +569,159 @@ void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
 
 	uuid_vec_t recursive_cats;
 
-	LLSD body;
-	LLSD body_lib;
+	LLSD folder_request_body;
+	LLSD folder_request_body_lib;
+	LLSD item_request_body;
+	LLSD item_request_body_lib;
 
-	while (!(mFetchQueue.empty()) && (folder_count < max_batch_size))
+	while (!(mFetchQueue.empty()) && ((item_count + folder_count) < max_batch_size))
 	{
 		const FetchQueueInfo& fetch_info = mFetchQueue.front();
-		const LLUUID &cat_id = fetch_info.mCatUUID;
-        if (cat_id.isNull()) //DEV-17797
-        {
-			LLSD folder_sd;
-			folder_sd["folder_id"]		= LLUUID::null.asString();
-			folder_sd["owner_id"]		= gAgent.getID();
-			folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
-			folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE;
-			folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
-			body["folders"].append(folder_sd);
-            folder_count++;
-        }
-        else
-        {
-		    const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+		if (fetch_info.mIsCategory)
+		{
+
+			const LLUUID &cat_id = fetch_info.mUUID;
+			if (cat_id.isNull()) //DEV-17797
+			{
+				LLSD folder_sd;
+				folder_sd["folder_id"]		= LLUUID::null.asString();
+				folder_sd["owner_id"]		= gAgent.getID();
+				folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
+				folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE;
+				folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
+				folder_request_body["folders"].append(folder_sd);
+				folder_count++;
+			}
+			else
+			{
+				const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
 		
-		    if (cat)
-		    {
-			    if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
-			    {
-				    LLSD folder_sd;
-				    folder_sd["folder_id"]		= cat->getUUID();
-				    folder_sd["owner_id"]		= cat->getOwnerID();
-				    folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
-				    folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
-				    folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
-				    
-				    if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
-					    body_lib["folders"].append(folder_sd);
-				    else
-					    body["folders"].append(folder_sd);
-				    folder_count++;
-			    }
-				// May already have this folder, but append child folders to list.
-			    if (fetch_info.mRecursive)
-			    {	
-					LLInventoryModel::cat_array_t* categories;
-					LLInventoryModel::item_array_t* items;
-					gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
-					for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
-						 it != categories->end();
-						 ++it)
+				if (cat)
+				{
+					if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
 					{
-						mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
-				    }
-			    }
-		    }
-        }
-		if (fetch_info.mRecursive)
-			recursive_cats.push_back(cat_id);
+						LLSD folder_sd;
+						folder_sd["folder_id"]		= cat->getUUID();
+						folder_sd["owner_id"]		= cat->getOwnerID();
+						folder_sd["sort_order"]		= (LLSD::Integer)sort_order;
+						folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
+						folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
+				    
+						if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
+							folder_request_body_lib["folders"].append(folder_sd);
+						else
+							folder_request_body["folders"].append(folder_sd);
+						folder_count++;
+					}
+					// May already have this folder, but append child folders to list.
+					if (fetch_info.mRecursive)
+					{	
+						LLInventoryModel::cat_array_t* categories;
+						LLInventoryModel::item_array_t* items;
+						gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
+						for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
+							 it != categories->end();
+							 ++it)
+						{
+							mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive));
+						}
+					}
+				}
+			}
+			if (fetch_info.mRecursive)
+				recursive_cats.push_back(cat_id);
+		}
+		else
+		{
+			LLViewerInventoryItem* itemp = gInventory.getItem(fetch_info.mUUID);
+			if (itemp)
+			{
+				LLSD item_sd;
+				item_sd["owner_id"] = itemp->getPermissions().getOwner();
+				item_sd["item_id"] = itemp->getUUID();
+				if (itemp->getPermissions().getOwner() == gAgent.getID())
+				{
+					item_request_body.append(item_sd);
+				}
+				else
+				{
+					item_request_body_lib.append(item_sd);
+				}
+				//itemp->fetchFromServer();
+				item_count++;
+			}
+		}
 
 		mFetchQueue.pop_front();
 	}
 		
-	if (folder_count > 0)
+	if (item_count + folder_count > 0)
 	{
-		mBulkFetchCount++;
-		if (body["folders"].size())
+		if (folder_count)
 		{
-			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body, recursive_cats);
-			LLHTTPClient::post(url, body, fetcher, 300.0);
+			std::string url = region->getCapability("FetchInventoryDescendents2");   
+			mFetchCount++;
+			if (folder_request_body["folders"].size())
+			{
+				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
+				LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
+			}
+			if (folder_request_body_lib["folders"].size())
+			{
+				std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
+
+				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
+				LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
+			}
 		}
-		if (body_lib["folders"].size())
+		if (item_count)
 		{
-			std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
-			
-			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body_lib, recursive_cats);
-			LLHTTPClient::post(url_lib, body_lib, fetcher, 300.0);
+			std::string url;
+
+			if (item_request_body.size())
+			{
+				mFetchCount++;
+				url = region->getCapability("FetchInventory2");
+				if (!url.empty())
+				{
+					LLSD body;
+					body["agent_id"]	= gAgent.getID();
+					body["items"] = item_request_body;
+
+					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
+				}
+				//else
+				//{
+				//	LLMessageSystem* msg = gMessageSystem;
+				//	msg->newMessage("FetchInventory");
+				//	msg->nextBlock("AgentData");
+				//	msg->addUUID("AgentID", gAgent.getID());
+				//	msg->addUUID("SessionID", gAgent.getSessionID());
+				//	msg->nextBlock("InventoryData");
+				//	msg->addUUID("OwnerID", mPermissions.getOwner());
+				//	msg->addUUID("ItemID", mUUID);
+				//	gAgent.sendReliableMessage();
+				//}
+			}
+
+			if (item_request_body_lib.size())
+			{
+				mFetchCount++;
+
+				url = region->getCapability("FetchLib2");
+				if (!url.empty())
+				{
+					LLSD body;
+					body["agent_id"]	= gAgent.getID();
+					body["items"] = item_request_body_lib;
+
+					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
+				}
+			}
 		}
 		mFetchTimer.reset();
 	}
+
 	else if (isBulkFetchProcessingComplete())
 	{
 		setAllFoldersFetched();
@@ -624,7 +733,7 @@ bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LL
 	for (fetch_queue_t::const_iterator it = mFetchQueue.begin();
 		 it != mFetchQueue.end(); ++it)
 	{
-		const LLUUID& fetch_id = (*it).mCatUUID;
+		const LLUUID& fetch_id = (*it).mUUID;
 		if (gInventory.isObjectDescendentOf(fetch_id, cat_id))
 			return false;
 	}
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index c35c785ceb3..0745407a8c8 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -60,10 +60,10 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	bool inventoryFetchInProgress() const;
 
     void findLostItems();	
+	void incrFetchCount(S16 fetching);
 protected:
-	void incrBulkFetch(S16 fetching);
 	bool isBulkFetchProcessingComplete() const;
-	void bulkFetch(std::string url);
+	void bulkFetch();
 
 	void backgroundFetch();
 	static void backgroundFetchCB(void*); // background fetch idle function
@@ -77,7 +77,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	BOOL mAllFoldersFetched;
 
 	BOOL mBackgroundFetchActive;
-	S16 mBulkFetchCount;
+	S16 mFetchCount;
 	BOOL mTimelyFetchPending;
 	S32 mNumFetchRetries;
 
@@ -87,11 +87,11 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 
 	struct FetchQueueInfo
 	{
-		FetchQueueInfo(const LLUUID& id, BOOL recursive) :
-			mCatUUID(id), mRecursive(recursive)
-		{
-		}
-		LLUUID mCatUUID;
+		FetchQueueInfo(const LLUUID& id, BOOL recursive, bool is_category = true) :
+			mUUID(id), mRecursive(recursive), mIsCategory(is_category)
+		{}
+		LLUUID mUUID;
+		bool mIsCategory;
 		BOOL mRecursive;
 	};
 	typedef std::deque<FetchQueueInfo> fetch_queue_t;
-- 
GitLab


From bbc265a9d5230603b7ee1b3f974ef27154d8507f Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 26 Jan 2012 16:30:38 -0800
Subject: [PATCH 663/933] EXP-1846 FIX Text positioning issues in Floaters,
 Notifications, UI, and toasts with UI size smaller than 1 also, re-enabled
 floater_test_textbox.xml

---
 indra/llrender/llfontgl.cpp                     |  7 ++++---
 .../default/xui/en/floater_test_textbox.xml     | 17 +++--------------
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 12f86cf5993..a4695816370 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -215,16 +215,17 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	cur_y = ((F32)y * sScaleY) + origin.mV[VY];
 
 	// Offset y by vertical alignment.
+	// use unscaled font metrics here
 	switch (valign)
 	{
 	case TOP:
-		cur_y -= getAscenderHeight();
+		cur_y -= mFontFreetype->getAscenderHeight();
 		break;
 	case BOTTOM:
-		cur_y += getDescenderHeight();
+		cur_y += mFontFreetype->getDescenderHeight();
 		break;
 	case VCENTER:
-		cur_y -= (getAscenderHeight() - getDescenderHeight()) / 2.f;
+		cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
 		break;
 	case BASELINE:
 		// Baseline, do nothing.
diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml
index 3d1bc0edae5..1d31fbd6dc0 100644
--- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml
@@ -8,18 +8,7 @@
  help_topic="floater_test_textbox"
  translate="false"
  width="800">
-    <text
-     type="string"
-     length="1"
-     height="90"
-     layout="topleft"
-     left="10"
-     valign="bottom"
-     clip="true"
-     top_pad="30"
-     width="300">
-___</text>
-  <!--<text
+ <text
     clip_partial="true"
     top_pad="10"
     left="10"
@@ -150,7 +139,7 @@ ___</text>
     The 华文细黑 brown fox ヒラキjumped over the lazy dog.
   </text>
   
---><!-- next column --><!--
+<!-- next column -->
   <text_editor
  height="50"
  follows="top|left|bottom"
@@ -247,5 +236,5 @@ with
 multiple lines
 and too many lines
 to actually fit
-  </text>-->
+  </text>
 </floater>
-- 
GitLab


From 3b2511661e98eb5c0dbaf30ab72783b53341e03f Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 27 Jan 2012 08:33:26 -0500
Subject: [PATCH 664/933] STORM-1793 1) Treat all mini-map altitudes above 1020
 m as the same height 2) Improve z-level accuracy With help from Aleric
 Inglewood

---
 doc/contributions.txt            |   4 +
 indra/newview/llnetmap.cpp       | 133 +++++++++++++------------------
 indra/newview/llworld.cpp        |  52 ++++--------
 indra/newview/llworldmapview.cpp |  23 ++++--
 indra/newview/llworldmapview.h   |   4 +-
 5 files changed, 97 insertions(+), 119 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..cd380d63951 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -103,6 +103,7 @@ Aleric Inglewood
 	STORM-163
 	STORM-955
 	STORM-960
+	STORM-1793
 Ales Beaumont
 	VWR-9352
 	SNOW-240
@@ -610,6 +611,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-1793
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
@@ -1239,6 +1241,8 @@ WolfPup Lowenhar
 	VWR-20741
 	VWR-20933
 Wundur Primbee
+Xellessanova Zenith
+	STORM-1793
 Xiki Luik
 xstorm Radek
 YongYong Francois
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 15d5d7c1628..1bda7640bd3 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -74,6 +74,8 @@ const F32 DOT_SCALE = 0.75f;
 const F32 MIN_PICK_SCALE = 2.f;
 const S32 MOUSE_DRAG_SLOP = 2;		// How far the mouse needs to move before we think it's a drag
 
+const F64 COARSEUPDATE_MAX_Z = 1020.0f;
+
 LLNetMap::LLNetMap (const Params & p)
 :	LLUICtrl (p),
 	mBackgroundColor (p.bg_color()),
@@ -300,7 +302,8 @@ void LLNetMap::draw()
 		}
 
 		LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal);
-		map_center_agent -= gAgentCamera.getCameraPositionAgent();
+		LLVector3 camera_position = gAgentCamera.getCameraPositionAgent();
+		map_center_agent -= camera_position;
 		map_center_agent.mV[VX] *= mScale/region_width;
 		map_center_agent.mV[VY] *= mScale/region_width;
 
@@ -321,9 +324,6 @@ void LLNetMap::draw()
 
 		gGL.popMatrix();
 
-		LLVector3d pos_global;
-		LLVector3 pos_map;
-
 		// Mouse pointer in local coordinates
 		S32 local_mouse_x;
 		S32 local_mouse_y;
@@ -333,90 +333,67 @@ void LLNetMap::draw()
 		F32 closest_dist_squared = F32_MAX; // value will be overridden in the loop
 		F32 min_pick_dist_squared = (mDotRadius * MIN_PICK_SCALE) * (mDotRadius * MIN_PICK_SCALE);
 
+		LLVector3 pos_map;
+		uuid_vec_t avatar_ids;
+		std::vector<LLVector3d> positions;
+		bool unknown_relative_z;
+
+		LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgentCamera.getCameraPositionGlobal());
+
 		// Draw avatars
-		for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
-			 iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
+		for (U32 i = 0; i < avatar_ids.size(); i++)
 		{
-			LLViewerRegion* regionp = *iter;
-			const LLVector3d& origin_global = regionp->getOriginGlobal();
-
-			S32 count = regionp->mMapAvatars.count();
-			S32 i;
-			LLVector3 pos_local;
-			U32 compact_local;
-			U8 bits;
-			// TODO: it'd be very cool to draw these in sorted order from lowest Z to highest.
-			// just be careful to sort the avatar IDs along with the positions. -MG
-			for (i = 0; i < count; i++)
-			{
-				compact_local = regionp->mMapAvatars.get(i);
+			pos_map = globalPosToView(positions[i]);
+			LLUUID uuid = avatar_ids[i];
 
-				bits = compact_local & 0xFF;
-				pos_local.mV[VZ] = F32(bits) * 4.f;
-				compact_local >>= 8;
+			bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
 
-				bits = compact_local & 0xFF;
-				pos_local.mV[VY] = (F32)bits;
-				compact_local >>= 8;
+			LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
 
-				bits = compact_local & 0xFF;
-				pos_local.mV[VX] = (F32)bits;
+			unknown_relative_z = positions[i].mdV[VZ] == COARSEUPDATE_MAX_Z &&
+					camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z;
 
-				pos_global.setVec( pos_local );
-				pos_global += origin_global;
+			LLWorldMapView::drawAvatar(
+				pos_map.mV[VX], pos_map.mV[VY], 
+				color, 
+				pos_map.mV[VZ], mDotRadius,
+				unknown_relative_z);
 
-				pos_map = globalPosToView(pos_global);
-
-				LLUUID uuid(NULL);
-				BOOL show_as_friend = FALSE;
-				if( i < regionp->mMapAvatarIDs.count())
+			if(uuid.notNull())
+			{
+				bool selected = false;
+				uuid_vec_t::iterator sel_iter = gmSelected.begin();
+				for (; sel_iter != gmSelected.end(); sel_iter++)
 				{
-					uuid = regionp->mMapAvatarIDs.get(i);
-					show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
+					if(*sel_iter == uuid)
+					{
+						selected = true;
+						break;
+					}
 				}
-
-				LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
-				LLWorldMapView::drawAvatar(
-					pos_map.mV[VX], pos_map.mV[VY], 
-					color, 
-					pos_map.mV[VZ], mDotRadius);
-
-				if(uuid.notNull())
+				if(selected)
 				{
-					bool selected = false;
-					uuid_vec_t::iterator sel_iter = gmSelected.begin();
-					for (; sel_iter != gmSelected.end(); sel_iter++)
+					if( (pos_map.mV[VX] < 0) ||
+						(pos_map.mV[VY] < 0) ||
+						(pos_map.mV[VX] >= getRect().getWidth()) ||
+						(pos_map.mV[VY] >= getRect().getHeight()) )
 					{
-						if(*sel_iter == uuid)
-						{
-							selected = true;
-							break;
-						}
-					}
-					if(selected)
+						S32 x = llround( pos_map.mV[VX] );
+						S32 y = llround( pos_map.mV[VY] );
+						LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10);
+					} else
 					{
-						if( (pos_map.mV[VX] < 0) ||
-							(pos_map.mV[VY] < 0) ||
-							(pos_map.mV[VX] >= getRect().getWidth()) ||
-							(pos_map.mV[VY] >= getRect().getHeight()) )
-						{
-							S32 x = llround( pos_map.mV[VX] );
-							S32 y = llround( pos_map.mV[VY] );
-							LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10);
-						} else
-						{
-							LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f);
-						}
+						LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f);
 					}
 				}
+			}
 
-				F32	dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
-											  LLVector2(local_mouse_x,local_mouse_y));
-				if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared)
-				{
-					closest_dist_squared = dist_to_cursor_squared;
-					mClosestAgentToCursor = regionp->mMapAvatarIDs.get(i);
-				}
+			F32	dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
+										  LLVector2(local_mouse_x,local_mouse_y));
+			if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared)
+			{
+				closest_dist_squared = dist_to_cursor_squared;
+				mClosestAgentToCursor = uuid;
 			}
 		}
 
@@ -440,7 +417,7 @@ void LLNetMap::draw()
 		}
 
 		// Draw dot for self avatar position
-		pos_global = gAgent.getPositionGlobal();
+		LLVector3d pos_global = gAgent.getPositionGlobal();
 		pos_map = globalPosToView(pos_global);
 		S32 dot_width = llround(mDotRadius * 2.f);
 		LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage;
@@ -514,9 +491,11 @@ void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent)
 	createObjectImage();
 }
 
-LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos )
+LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos)
 {
-	LLVector3d relative_pos_global = global_pos - gAgentCamera.getCameraPositionGlobal();
+	LLVector3d camera_position = gAgentCamera.getCameraPositionGlobal();
+
+	LLVector3d relative_pos_global = global_pos - camera_position;
 	LLVector3 pos_local;
 	pos_local.setVec(relative_pos_global);  // convert to floats from doubles
 
@@ -541,7 +520,7 @@ LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos )
 void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, 
 							BOOL draw_arrow )
 {
-	LLVector3 pos_local = globalPosToView( pos_global );
+	LLVector3 pos_local = globalPosToView(pos_global);
 	if( (pos_local.mV[VX] < 0) ||
 		(pos_local.mV[VY] < 0) ||
 		(pos_local.mV[VX] >= getRect().getWidth()) ||
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 676287c0add..86780d0604b 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1161,24 +1161,13 @@ void send_agent_resume()
 
 static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin)
 {
-	LLVector3d pos_global;
-	LLVector3 pos_local;
-	U8 bits;
+	LLVector3d pos_local;
 
-	bits = compact_local & 0xFF;
-	pos_local.mV[VZ] = F32(bits) * 4.f;
-	compact_local >>= 8;
+	pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4;
+	pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU;
+	pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU;
 
-	bits = compact_local & 0xFF;
-	pos_local.mV[VY] = (F32)bits;
-	compact_local >>= 8;
-
-	bits = compact_local & 0xFF;
-	pos_local.mV[VX] = (F32)bits;
-
-	pos_global.setVec( pos_local );
-	pos_global += region_origin;
-	return pos_global;
+	return region_origin + pos_local;
 }
 
 void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const
@@ -1199,24 +1188,17 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 		iter != LLCharacter::sInstances.end(); ++iter)
 	{
 		LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
-		if(!pVOAvatar->isDead() && !pVOAvatar->isSelf())
+		LLVector3d pos_global = pVOAvatar->getPositionGlobal();
+		LLUUID uuid = pVOAvatar->getID();
+		if( !pVOAvatar->isDead() &&
+			!pVOAvatar->isSelf() &&
+			!uuid.isNull() &&
+			dist_vec_squared(pos_global, relative_to) <= radius_squared &&
+			positions != NULL &&
+			avatar_ids != NULL)
 		{
-			LLUUID uuid = pVOAvatar->getID();
-			if(!uuid.isNull())
-			{
-				LLVector3d pos_global = pVOAvatar->getPositionGlobal();
-				if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
-				{
-					if(positions != NULL)
-					{
-						positions->push_back(pos_global);
-					}
-					if(avatar_ids !=NULL)
-					{
-						avatar_ids->push_back(uuid);
-					}
-				}
-			}
+			positions->push_back(pos_global);
+			avatar_ids->push_back(uuid);
 		}
 	}
 	// region avatars added for situations where radius is greater than RenderFarClip
@@ -1233,13 +1215,13 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 			{
 				LLUUID uuid = regionp->mMapAvatarIDs.get(i);
 				// if this avatar doesn't already exist in the list, add it
-				if(uuid.notNull() && avatar_ids!=NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end())
+				if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end())
 				{
 					if(positions != NULL)
 					{
 						positions->push_back(pos_global);
+						avatar_ids->push_back(uuid);
 					}
-					avatar_ids->push_back(uuid);
 				}
 			}
 		}
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index e50851b8e76..fc3ab1a0c0f 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -77,6 +77,7 @@ LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = NULL;
 LLUIImagePtr LLWorldMapView::sAvatarLevelImage = NULL;
 LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL;
 LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL;
+LLUIImagePtr LLWorldMapView::sAvatarUnknownImage = NULL;
 
 LLUIImagePtr LLWorldMapView::sTelehubImage = NULL;
 LLUIImagePtr LLWorldMapView::sInfohubImage = NULL;
@@ -120,6 +121,7 @@ void LLWorldMapView::initClass()
 	sAvatarLevelImage =		LLUI::getUIImage("map_avatar_32.tga");
 	sAvatarAboveImage =		LLUI::getUIImage("map_avatar_above_32.tga");
 	sAvatarBelowImage =		LLUI::getUIImage("map_avatar_below_32.tga");
+	sAvatarUnknownImage =	LLUI::getUIImage("map_avatar_unknown_32.tga");
 
 	sHomeImage =			LLUI::getUIImage("map_home.tga");
 	sTelehubImage = 		LLUI::getUIImage("map_telehub.tga");
@@ -149,6 +151,7 @@ void LLWorldMapView::cleanupClass()
 	sAvatarLevelImage = NULL;
 	sAvatarAboveImage = NULL;
 	sAvatarBelowImage = NULL;
+	sAvatarUnknownImage = NULL;
 
 	sTelehubImage = NULL;
 	sInfohubImage = NULL;
@@ -1147,17 +1150,25 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
 								F32 y_pixels,
 								const LLColor4& color,
 								F32 relative_z,
-								F32 dot_radius)
+								F32 dot_radius,
+								bool unknown_relative_z)
 {
 	const F32 HEIGHT_THRESHOLD = 7.f;
 	LLUIImagePtr dot_image = sAvatarLevelImage;
-	if(relative_z < -HEIGHT_THRESHOLD) 
+	if (unknown_relative_z)
 	{
-		dot_image = sAvatarBelowImage; 
+		dot_image = sAvatarUnknownImage;
 	}
-	else if(relative_z > HEIGHT_THRESHOLD) 
-	{ 
-		dot_image = sAvatarAboveImage;
+	else
+	{
+		if(relative_z < -HEIGHT_THRESHOLD)
+		{
+			dot_image = sAvatarBelowImage; 
+		}
+		else if(relative_z > HEIGHT_THRESHOLD) 
+		{ 
+			dot_image = sAvatarAboveImage;
+		}
 	}
 	S32 dot_width = llround(dot_radius * 2.f);
 	dot_image->draw(llround(x_pixels - dot_radius),
diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h
index 9ab53b1ba38..a2a6dc53fb5 100644
--- a/indra/newview/llworldmapview.h
+++ b/indra/newview/llworldmapview.h
@@ -112,7 +112,8 @@ class LLWorldMapView : public LLPanel
 								F32 y_pixels, 
 								const LLColor4& color,
 								F32 relative_z = 0.f,
-								F32 dot_radius = 3.f);
+								F32 dot_radius = 3.f,
+								bool reached_max_z = false);
 	static void		drawIconName(F32 x_pixels, 
 									F32 y_pixels, 
 									const LLColor4& color,
@@ -138,6 +139,7 @@ class LLWorldMapView : public LLPanel
 	static LLUIImagePtr	sAvatarLevelImage;
 	static LLUIImagePtr	sAvatarAboveImage;
 	static LLUIImagePtr	sAvatarBelowImage;
+	static LLUIImagePtr	sAvatarUnknownImage;
 
 	static LLUIImagePtr	sTelehubImage;
 	static LLUIImagePtr	sInfohubImage;
-- 
GitLab


From 13d510d5f2fa2d9bf654e70d9191f1909b1f299e Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 27 Jan 2012 19:31:52 +0200
Subject: [PATCH 665/933] EXP-1847 FIXED Fixed inability to mute a nearby
 avatar in Voice Settings if the speakers list is sorted by name.

Added missing update of the floater's internal speaker list.
---
 indra/newview/llcallfloater.cpp         | 2 +-
 indra/newview/llpanelimcontrolpanel.cpp | 2 +-
 indra/newview/llparticipantlist.cpp     | 6 +++---
 indra/newview/llparticipantlist.h       | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index c95e8234fff..f2375bfa4f7 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -188,7 +188,7 @@ void LLCallFloater::draw()
 
 	// Need to resort the participant list if it's in sort by recent speaker order.
 	if (mParticipants)
-		mParticipants->updateRecentSpeakersOrder();
+		mParticipants->update();
 
 	LLFloater::draw();
 }
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 0295ad151f4..eda0749cdb5 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -374,7 +374,7 @@ void LLPanelGroupControlPanel::draw()
 {
 	// Need to resort the participant list if it's in sort by recent speaker order.
 	if (mParticipantList)
-		mParticipantList->updateRecentSpeakersOrder();
+		mParticipantList->update();
 	LLPanelChatControlPanel::draw();
 }
 
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 183bc7b610f..975a6c67d80 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -469,12 +469,12 @@ void LLParticipantList::setValidateSpeakerCallback(validate_speaker_callback_t c
 	mValidateSpeakerCallback = cb;
 }
 
-void LLParticipantList::updateRecentSpeakersOrder()
+void LLParticipantList::update()
 {
+	mSpeakerMgr->update(true);
+
 	if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder() && !isHovered())
 	{
-		// Need to update speakers to sort list correctly
-		mSpeakerMgr->update(true);
 		// Resort avatar list
 		sort();
 	}
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index a001d29b671..53966c15fe6 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -72,9 +72,9 @@ class LLParticipantList
 	const EParticipantSortOrder getSortOrder() const;
 
 	/**
-	 * Refreshes the participant list if it's in sort by recent speaker order.
+	 * Refreshes the participant list.
 	 */
-	void updateRecentSpeakersOrder();
+	void update();
 
 	/**
 	 * Set a callback to be called before adding a speaker. Invalid speakers will not be added.
-- 
GitLab


From e0a62d894145a6903727e95890bfab6a925a11b7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 27 Jan 2012 12:41:18 -0600
Subject: [PATCH 666/933] SH-2768 Put transparency checkerboard back in texture
 preview

---
 indra/llui/llui.cpp                           |  54 +++++++++++-------
 .../skins/default/textures/checker.png        | Bin 0 -> 130 bytes
 .../skins/default/textures/textures.xml       |   2 +
 3 files changed, 34 insertions(+), 22 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/checker.png

diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 6b74c5a6be0..a38d0a0b0b3 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -972,43 +972,53 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor
 // Draw gray and white checkerboard with black border
 void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
 {
-	// Initialize the first time this is called.
-	const S32 PIXELS = 32;
-	static GLubyte checkerboard[PIXELS * PIXELS];
-	static BOOL first = TRUE;
-	if( first )
-	{
-		for( S32 i = 0; i < PIXELS; i++ )
+	if (!LLGLSLShader::sNoFixedFunction)
+	{ 
+		// Initialize the first time this is called.
+		const S32 PIXELS = 32;
+		static GLubyte checkerboard[PIXELS * PIXELS];
+		static BOOL first = TRUE;
+		if( first )
 		{
-			for( S32 j = 0; j < PIXELS; j++ )
+			for( S32 i = 0; i < PIXELS; i++ )
 			{
-				checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
+				for( S32 j = 0; j < PIXELS; j++ )
+				{
+					checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
+				}
 			}
+			first = FALSE;
 		}
-		first = FALSE;
-	}
 	
-	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
-	// ...white squares
-	gGL.color4f( 1.f, 1.f, 1.f, alpha );
-	gl_rect_2d(rect);
+		// ...white squares
+		gGL.color4f( 1.f, 1.f, 1.f, alpha );
+		gl_rect_2d(rect);
 
-	// ...gray squares
-	gGL.color4f( .7f, .7f, .7f, alpha );
-	gGL.flush();
+		// ...gray squares
+		gGL.color4f( .7f, .7f, .7f, alpha );
+		gGL.flush();
 
-	if (!LLGLSLShader::sNoFixedFunction)
-	{ //polygon stipple is deprecated
 		glPolygonStipple( checkerboard );
 
 		LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE);
 		gl_rect_2d(rect);
 	}
 	else
-	{
-		gl_rect_2d(rect);
+	{ //polygon stipple is deprecated, use "Checker" texture
+		LLPointer<LLUIImage> img = LLUI::getUIImage("Checker");
+		gGL.getTexUnit(0)->bind(img->getImage());
+		gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
+		gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+
+		LLColor4 color(1.f, 1.f, 1.f, alpha);
+		LLRectf uv_rect(0, 0, rect.getWidth()/32.f, rect.getHeight()/32.f);
+
+		gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(),
+			img->getImage(), color, uv_rect);
 	}
+	
 	gGL.flush();
 }
 
diff --git a/indra/newview/skins/default/textures/checker.png b/indra/newview/skins/default/textures/checker.png
new file mode 100644
index 0000000000000000000000000000000000000000..1ab87e3f02f67f9329f7a7884d4667e3dc7c8e38
GIT binary patch
literal 130
zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1SHiab7}%9#^NA%Cx&(BWL|<~(j9#r85lP9
zbN@+X1@buyJR*x382Ao@Fyrz36)8YLaZeY=5Q*?)3kJ6T2OAh$nFX6U3>AtQoES7;
UGX9&l9H@lB)78&qol`;+0C}Vy00000

literal 0
HcmV?d00001

diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 8702ebde2ab..c4d39e56ba1 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -122,6 +122,8 @@ with the same filename but different name
   <texture name="Checkbox_Press" file_name="widgets/Checkbox_Press.png" preload="true" />
   <texture name="Check_Mark" file_name="icons/check_mark.png" preload="true" />
 
+  <texture name="Checker" file_name="checker.png" preload="false" />
+  
   <texture name="Command_AboutLand_Icon"    file_name="toolbar_icons/land.png"         preload="true" />
   <texture name="Command_Appearance_Icon"   file_name="toolbar_icons/appearance.png"   preload="true" />
   <texture name="Command_Avatar_Icon"       file_name="toolbar_icons/avatars.png"      preload="true" />
-- 
GitLab


From cd46f4a7b9a71f655c8823162b61024f30a94b3f Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 27 Jan 2012 13:56:03 -0500
Subject: [PATCH 667/933] SH-2684 FIX, SH-2716 FIX - bug was specific to
 running in non-english language

---
 indra/newview/llfloatermodelpreview.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 9122e5a8f5e..7448f2bb2a9 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4525,7 +4525,17 @@ void LLModelPreview::updateStatusMessages()
 		}
 	}
 
-	if (mFMP->childGetValue("physics_lod_combo").asString() == "From file")
+	
+	LLCtrlSelectionInterface* iface = fmp->childGetSelectionInterface("physics_lod_combo");
+	S32 which_mode = 0; 
+	S32 file_mode = 1;
+	if (iface)
+	{
+		which_mode = iface->getFirstSelectedIndex();
+		file_mode = iface->getItemCount() - 1;
+	}
+
+	if (which_mode == file_mode)
 	{
 		mFMP->childEnable("physics_file");
 		mFMP->childEnable("physics_browse");
-- 
GitLab


From c1b14fb7bf70a54d9cfb3f86e83ff76d27c0bc03 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 27 Jan 2012 14:58:51 -0600
Subject: [PATCH 668/933] SH-2646 Fix for shiny HUD objects not being
 fullbright

---
 indra/newview/llvovolume.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 7492a067844..63542307965 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4939,6 +4939,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 				fullbright = TRUE;
 			}
 
+			if (hud_group)
+			{ //all hud attachments are fullbright
+				fullbright = TRUE;
+			}
+
 			const LLTextureEntry* te = facep->getTextureEntry();
 			tex = facep->getTexture();
 
@@ -4964,7 +4969,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 				}
 			}
 			else if (gPipeline.canUseVertexShaders()
-				&& group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD 
 				&& LLPipeline::sRenderBump 
 				&& te->getShiny())
 			{ //shiny
@@ -5029,9 +5033,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 					}
 				}
 				
-				//not sure why this is here -- shiny HUD attachments maybe?  -- davep 5/11/2010
-				if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump)
-				{
+				
+				if (!gPipeline.canUseVertexShaders() && 
+					!is_alpha && 
+					te->getShiny() && 
+					LLPipeline::sRenderBump)
+				{ //shiny as an extra pass when shaders are disabled
 					registerFace(group, facep, LLRenderPass::PASS_SHINY);
 				}
 			}
-- 
GitLab


From 987463d9248d7fab9534ff7a9f303c6db42da7a9 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 27 Jan 2012 13:18:27 -0800
Subject: [PATCH 669/933] EXP-1765 POSSIBLE_FIX crash on startup at
 LLWindowWin32::switchContext(...)

---
 indra/llwindow/llwindowwin32.cpp | 4 ++++
 indra/newview/CMakeLists.txt     | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 228fbefd194..67d1a168e6e 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1065,6 +1065,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		return FALSE;
 	}
 
+	LL_INFOS("Window") << "Device context retrieved." << llendl ;
+
 	if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
 	{
 		close();
@@ -1073,6 +1075,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		return FALSE;
 	}
 
+	LL_INFOS("Window") << "Pixel format chosen." << llendl ;
+
 	// Verify what pixel format we actually received.
 	if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
 		&pfd))
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f85b943c70d..69bf1f15a1f 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1345,7 +1345,9 @@ if (WINDOWS)
         DXGUID_LIBRARY
         )
 
+# see EXP-1765 - theory is opengl32.lib needs to be included before gdi32.lib (windows libs)
     set(viewer_LIBRARIES
+        opengl32
         ${WINDOWS_LIBRARIES}
         comdlg32
         ${DINPUT_LIBRARY}
@@ -1355,7 +1357,6 @@ if (WINDOWS)
         odbccp32
         ole32
         oleaut32
-        opengl32
         shell32
         Vfw32
         winspool
-- 
GitLab


From cf02780ddf927a32214b3f4db050f516367d7421 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 27 Jan 2012 17:48:08 -0800
Subject: [PATCH 670/933] EXP-1513 WIP Underscore ( _ ) fails to show in first
 chat entry in Local Chat cleaned up font positioning on buttons

---
 indra/llui/llbutton.cpp                                    | 4 ++--
 indra/llui/lltextbase.cpp                                  | 4 ++--
 indra/newview/lltoast.cpp                                  | 4 +---
 indra/newview/skins/default/xui/en/floater_fast_timers.xml | 1 -
 indra/newview/skins/default/xui/en/panel_status_bar.xml    | 2 --
 indra/newview/skins/default/xui/en/widgets/button.xml      | 2 +-
 6 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index f0d92d597a7..705fe165593 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -908,9 +908,9 @@ void LLButton::draw()
 		// Not sure if it is really needed. Probably S32_MAX should be always passed as max_chars.
 		mLastDrawCharsCount = mGLFont->render(label, 0,
 			(F32)x,
-			(F32)(mBottomVPad + y_offset),
+			(F32)(getRect().getHeight() / 2 + mBottomVPad),
 			label_color % alpha,
-			mHAlign, LLFontGL::BOTTOM,
+			mHAlign, LLFontGL::VCENTER,
 			LLFontGL::NORMAL,
 			mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NO_SHADOW,
 			S32_MAX, text_width,
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 0040be45c71..e3c9c3c561f 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2395,8 +2395,8 @@ void LLTextBase::updateRects()
 		}
 
 		mTextBoundingRect.mTop += mVPad;
-		// subtract a pixel off the bottom to deal with rounding errors in measuring font height
-		mTextBoundingRect.mBottom -= 1;
+		//// subtract a pixel off the bottom to deal with rounding errors in measuring font height
+		//mTextBoundingRect.mBottom -= 1;
 
 		S32 delta_pos = -mTextBoundingRect.mBottom;
 		// move line segments to fit new document rect
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index da691a2d0c3..21120a1b8db 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -296,9 +296,7 @@ void LLToast::reshapeToPanel()
 	if(!panel)
 		return;
 
-	LLRect panel_rect = panel->getRect();
-
-	panel_rect.setLeftTopAndSize(0, panel_rect.getHeight(), panel_rect.getWidth(), panel_rect.getHeight());
+	LLRect panel_rect = panel->getLocalRect();
 	panel->setShape(panel_rect);
 	
 	LLRect toast_rect = getRect();
diff --git a/indra/newview/skins/default/xui/en/floater_fast_timers.xml b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
index 49aa8f38400..77adb5524e7 100644
--- a/indra/newview/skins/default/xui/en/floater_fast_timers.xml
+++ b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
@@ -22,7 +22,6 @@
           top="5"
           width="180"
           height="40"
-          pad_bottom="-5"
           label="Pause"
           font="SansSerifHuge"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index d453a970e75..22c1139cdb5 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -67,7 +67,6 @@
      label_shadow="true"
      name="buyL"
      pad_right="0"
-     pad_bottom="2"
      tool_tip="Click to buy more L$"
      top="0"
      width="80" />
@@ -87,7 +86,6 @@
      left_pad="0"
      label_shadow="true"
      name="goShop"
-     pad_bottom="2"
      tool_tip="Open Second Life Marketplace"
      top="0"
      width="65" />
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index 589117fe4cc..2b2c3faf917 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -21,7 +21,7 @@
         font="SansSerifSmall"
         hover_glow_amount="0.15"
         halign="center"
-        pad_bottom="2" 
+        pad_bottom="1"
         height="23"
         scale_image="true"
         handle_right_mouse="true"
-- 
GitLab


From 2cd7a7550991df90288aa4c7e2fbe2598cc3c296 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 27 Jan 2012 18:40:23 -0800
Subject: [PATCH 671/933] EXP-1747, EXP-1152 : Fixed visual glitches in
 computation of visible width in inventory.

---
 indra/llui/llscrollcontainer.cpp   | 18 ++++++++----------
 indra/newview/llfolderview.cpp     | 12 ++++++------
 indra/newview/llfolderviewitem.cpp |  6 +++---
 indra/newview/llfolderviewitem.h   |  1 +
 4 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index ad4cc20d9a5..20bed050ada 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -378,23 +378,21 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height
 
 	if (!mHideScrollbar)
 	{
-		if( *visible_height < doc_height )
+		// Note: 1 pixel change can happen on final animation and should not trigger 
+		// the display of sliders.
+		if ((doc_height - *visible_height) > 1)
 		{
 			*show_v_scrollbar = TRUE;
 			*visible_width -= scrollbar_size;
 		}
-
-		if( *visible_width < doc_width )
+		if ((doc_width - *visible_width) > 1)
 		{
 			*show_h_scrollbar = TRUE;
 			*visible_height -= scrollbar_size;
-
-			// Must retest now that visible_height has changed
-			if( !*show_v_scrollbar && (*visible_height < doc_height) )
-			{
-				*show_v_scrollbar = TRUE;
-				*visible_width -= scrollbar_size;
-			}
+			// Note: Do *not* recompute *show_v_scrollbar here because with
+			// the (- scrollbar_size) we just did we will always add a vertical scrollbar
+			// even if the height of the items is actually less than the visible size.
+			// Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later.
 		}
 	}
 }
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index e0d7d67f7d7..79c987fa376 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -388,7 +388,7 @@ void LLFolderView::setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse
 
 static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange");
 
-// This view grows and shinks to enclose all of its children items and folders.
+// This view grows and shrinks to enclose all of its children items and folders.
 S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_generation )
 {
 	if (getListener()->getUUID().notNull())
@@ -527,15 +527,15 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		LLView::reshape(width, height, called_from_parent);
 		scroll_rect = mScrollContainer->getContentWindowRect();
 	}
-	width = llmax(mMinWidth, scroll_rect.getWidth());
+	width  = llmax(mMinWidth, scroll_rect.getWidth());
 	height = llmax(mRunningHeight, scroll_rect.getHeight());
 
-	// restrict width with scroll container's width
-	if (mUseEllipses)
+	// Restrict width within scroll container's width
+	if (mUseEllipses && mScrollContainer)
+	{
 		width = scroll_rect.getWidth();
-
+	}
 	LLView::reshape(width, height, called_from_parent);
-
 	mReshapeSignal(mSelectedItems, FALSE);
 }
 
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 9944a9dd3d5..734adbc6486 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -410,8 +410,8 @@ BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* roo
 }
 
 
-// Finds width and height of this object and it's children.  Also
-// makes sure that this view and it's children are the right size.
+// Finds width and height of this object and its children.  Also
+// makes sure that this view and its children are the right size.
 S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation)
 {
 	const Params& p = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
@@ -423,7 +423,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation)
 		: 0;
 	if (mLabelWidthDirty)
 	{
-		mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix); 
+		mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + TEXT_PAD_RIGHT; 
 		mLabelWidthDirty = false;
 	}
 
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 2fc79f57658..4e8dc2da167 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -114,6 +114,7 @@ class LLFolderViewItem : public LLView
 	static const S32 ICON_PAD = 2;
 	static const S32 ICON_WIDTH = 16;
 	static const S32 TEXT_PAD = 1;
+	static const S32 TEXT_PAD_RIGHT = 4;
 	static const S32 ARROW_SIZE = 12;
 	static const S32 MAX_FOLDER_ITEM_OVERLAP = 2;
 	// animation parameters
-- 
GitLab


From 22a6170a7b19b3a6f44536b7552b633416348775 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 27 Jan 2012 19:55:16 -0800
Subject: [PATCH 672/933] EXP-1513 FIX Underscore ( _ ) fails to show in first
 chat entry in Local Chat

---
 indra/llrender/llfontgl.cpp                                  | 4 ++--
 indra/newview/skins/default/xui/en/widgets/tab_container.xml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index a4695816370..7d827ae4831 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -219,10 +219,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	switch (valign)
 	{
 	case TOP:
-		cur_y -= mFontFreetype->getAscenderHeight();
+		cur_y -= llceil(mFontFreetype->getAscenderHeight());
 		break;
 	case BOTTOM:
-		cur_y += mFontFreetype->getDescenderHeight();
+		cur_y += llceil(mFontFreetype->getDescenderHeight());
 		break;
 	case VCENTER:
 		cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
index 3e2202b20fc..8f8126444d8 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -11,7 +11,7 @@ label_pad_left - padding to the left of tab button labels
                halign="center"
                font="SansSerifSmall" 
                tab_height="21"
-               label_pad_bottom="2"
+               label_pad_bottom="0"
                label_pad_left="4">
   <!--
   Possible additional attributes for tabs:
-- 
GitLab


From 619f737abb5c12022537c1f6715d60860152ec79 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sun, 29 Jan 2012 15:34:51 -0500
Subject: [PATCH 673/933] STORM-1803 Adding raw anim file upload support

---
 doc/contributions.txt                         |   1 +
 indra/newview/CMakeLists.txt                  |   4 +-
 indra/newview/llfilepicker.cpp                |  20 ++--
 ...nimpreview.cpp => llfloaterbvhpreview.cpp} | 110 +++++++++---------
 ...teranimpreview.h => llfloaterbvhpreview.h} |  16 +--
 indra/newview/llfloaternamedesc.cpp           |  19 +++
 indra/newview/llfloaternamedesc.h             |   7 ++
 indra/newview/llviewerfloaterreg.cpp          |   5 +-
 indra/newview/llviewermenufile.cpp            |  16 ++-
 .../xui/en/floater_animation_anim_preview.xml |  76 ++++++++++++
 ....xml => floater_animation_bvh_preview.xml} |   0
 11 files changed, 198 insertions(+), 76 deletions(-)
 rename indra/newview/{llfloateranimpreview.cpp => llfloaterbvhpreview.cpp} (92%)
 rename indra/newview/{llfloateranimpreview.h => llfloaterbvhpreview.h} (90%)
 create mode 100644 indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
 rename indra/newview/skins/default/xui/en/{floater_animation_preview.xml => floater_animation_bvh_preview.xml} (100%)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 84f399cc893..39d464e3f49 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -607,6 +607,7 @@ Jonathan Yap
 	STORM-1737
 	STORM-1733
 	STORM-1790
+	STORM-1803
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 6b2fe1e45ae..bced4485eed 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -166,7 +166,7 @@ set(viewer_SOURCE_FILES
     llfirstuse.cpp
     llflexibleobject.cpp
     llfloaterabout.cpp
-    llfloateranimpreview.cpp
+    llfloaterbvhpreview.cpp
     llfloaterauction.cpp
     llfloateravatar.cpp
     llfloateravatarpicker.cpp
@@ -720,7 +720,7 @@ set(viewer_HEADER_FILES
     llfirstuse.h
     llflexibleobject.h
     llfloaterabout.h
-    llfloateranimpreview.h
+    llfloaterbvhpreview.h
     llfloaterauction.h
     llfloateravatar.h
     llfloateravatarpicker.h
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 8024755e866..b426bcf84b7 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -49,7 +49,7 @@ LLFilePicker LLFilePicker::sInstance;
 #if LL_WINDOWS
 #define SOUND_FILTER L"Sounds (*.wav)\0*.wav\0"
 #define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)\0*.tga;*.bmp;*.jpg;*.jpeg;*.png\0"
-#define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0"
+#define ANIM_FILTER L"Animations (*.bvh; *.anim)\0*.bvh;*.anim\0"
 #define COLLADA_FILTER L"Scene (*.dae)\0*.dae\0"
 #ifdef _CORY_TESTING
 #define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0"
@@ -593,8 +593,10 @@ Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callB
 						}
 						else if (filter == FFLOAD_ANIM)
 						{
-							if (fileInfo.filetype != 'BVH ' && 
-								(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
+							if (fileInfo.filetype != 'BVH ' &&
+								fileInfo.filetype != 'ANIM' &&
+								(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) &&
+								fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("anim"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
 							)
 							{
 								result = false;
@@ -1196,10 +1198,14 @@ static std::string add_wav_filter_to_gtkchooser(GtkWindow *picker)
 						    LLTrans::getString("sound_files") + " (*.wav)");
 }
 
-static std::string add_bvh_filter_to_gtkchooser(GtkWindow *picker)
+static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker)
 {
-	return add_simple_pattern_filter_to_gtkchooser(picker,  "*.bvh",
-						       LLTrans::getString("animation_files") + " (*.bvh)");
+	GtkFileFilter *gfilter = gtk_file_filter_new();
+	gtk_file_filter_add_pattern(gfilter, "*.bvh");
+	gtk_file_filter_add_pattern(gfilter, "*.anim");
+	std::string filtername = LLTrans::getString("animation_files") + " (*.bvh; *.anim)");
+	add_common_filters_to_gtkchooser(gfilter, picker, filtername);
+	return filtername;
 }
 
 static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker)
@@ -1351,7 +1357,7 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
 			filtername = add_wav_filter_to_gtkchooser(picker);
 			break;
 		case FFLOAD_ANIM:
-			filtername = add_bvh_filter_to_gtkchooser(picker);
+			filtername = add_anim_filter_to_gtkchooser(picker);
 			break;
 		case FFLOAD_COLLADA:
 			filtername = add_collada_filter_to_gtkchooser(picker);
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
similarity index 92%
rename from indra/newview/llfloateranimpreview.cpp
rename to indra/newview/llfloaterbvhpreview.cpp
index 2a3512e21a9..b050a638dcc 100644
--- a/indra/newview/llfloateranimpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -1,6 +1,6 @@
 /** 
- * @file llfloateranimpreview.cpp
- * @brief LLFloaterAnimPreview class implementation
+ * @file llfloaterbvhpreview.cpp
+ * @brief LLFloaterBvhPreview class implementation
  *
  * $LicenseInfo:firstyear=2004&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -26,7 +26,7 @@
 
 #include "llviewerprecompiledheaders.h"
 
-#include "llfloateranimpreview.h"
+#include "llfloaterbvhpreview.h"
 
 #include "llbvhloader.h"
 #include "lldatapacker.h"
@@ -115,9 +115,9 @@ std::string STATUS[] =
 };
 
 //-----------------------------------------------------------------------------
-// LLFloaterAnimPreview()
+// LLFloaterBvhPreview()
 //-----------------------------------------------------------------------------
-LLFloaterAnimPreview::LLFloaterAnimPreview(const std::string& filename) : 
+LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename) : 
 	LLFloaterNameDesc(filename)
 {
 	mLastMouseX = 0;
@@ -153,35 +153,35 @@ LLFloaterAnimPreview::LLFloaterAnimPreview(const std::string& filename) :
 //-----------------------------------------------------------------------------
 // setAnimCallbacks()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::setAnimCallbacks()
+void LLFloaterBvhPreview::setAnimCallbacks()
 {
-	getChild<LLUICtrl>("playback_slider")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onSliderMove, this));
+	getChild<LLUICtrl>("playback_slider")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onSliderMove, this));
 	
-	getChild<LLUICtrl>("preview_base_anim")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitBaseAnim, this));
+	getChild<LLUICtrl>("preview_base_anim")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitBaseAnim, this));
 	getChild<LLUICtrl>("preview_base_anim")->setValue("Standing");
 
-	getChild<LLUICtrl>("priority")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitPriority, this));
-	getChild<LLUICtrl>("loop_check")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoop, this));
-	getChild<LLUICtrl>("loop_in_point")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoopIn, this));
-	getChild<LLUICtrl>("loop_in_point")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateLoopIn, this, _1));
-	getChild<LLUICtrl>("loop_out_point")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoopOut, this));
-	getChild<LLUICtrl>("loop_out_point")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateLoopOut, this, _1));
+	getChild<LLUICtrl>("priority")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitPriority, this));
+	getChild<LLUICtrl>("loop_check")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoop, this));
+	getChild<LLUICtrl>("loop_in_point")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoopIn, this));
+	getChild<LLUICtrl>("loop_in_point")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateLoopIn, this, _1));
+	getChild<LLUICtrl>("loop_out_point")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoopOut, this));
+	getChild<LLUICtrl>("loop_out_point")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateLoopOut, this, _1));
 
-	getChild<LLUICtrl>("hand_pose_combo")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitHandPose, this));
+	getChild<LLUICtrl>("hand_pose_combo")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitHandPose, this));
 	
-	getChild<LLUICtrl>("emote_combo")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEmote, this));
+	getChild<LLUICtrl>("emote_combo")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEmote, this));
 	getChild<LLUICtrl>("emote_combo")->setValue("[None]");
 
-	getChild<LLUICtrl>("ease_in_time")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEaseIn, this));
-	getChild<LLUICtrl>("ease_in_time")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateEaseIn, this, _1));
-	getChild<LLUICtrl>("ease_out_time")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEaseOut, this));
-	getChild<LLUICtrl>("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateEaseOut, this, _1));
+	getChild<LLUICtrl>("ease_in_time")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEaseIn, this));
+	getChild<LLUICtrl>("ease_in_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseIn, this, _1));
+	getChild<LLUICtrl>("ease_out_time")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEaseOut, this));
+	getChild<LLUICtrl>("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseOut, this, _1));
 }
 
 //-----------------------------------------------------------------------------
 // postBuild()
 //-----------------------------------------------------------------------------
-BOOL LLFloaterAnimPreview::postBuild()
+BOOL LLFloaterBvhPreview::postBuild()
 {
 	LLKeyframeMotion* motionp = NULL;
 	LLBVHLoader* loaderp = NULL;
@@ -191,7 +191,7 @@ BOOL LLFloaterAnimPreview::postBuild()
 		return FALSE;
 	}
 
-	getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitName, this));
+	getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitName, this));
 
 	childSetAction("ok_btn", onBtnOK, this);
 	setDefaultBtn();
@@ -203,15 +203,15 @@ BOOL LLFloaterAnimPreview::postBuild()
 	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
 
 	mPlayButton = getChild<LLButton>( "play_btn");
-	mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay, this));
+	mPlayButton->setClickedCallback(boost::bind(&LLFloaterBvhPreview::onBtnPlay, this));
 	mPlayButton->setVisible(true);
 
 	mPauseButton = getChild<LLButton>( "pause_btn");
-	mPauseButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPause, this));
+	mPauseButton->setClickedCallback(boost::bind(&LLFloaterBvhPreview::onBtnPause, this));
 	mPauseButton->setVisible(false);
 	
 	mStopButton = getChild<LLButton>( "stop_btn");
-	mStopButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnStop, this));
+	mStopButton->setClickedCallback(boost::bind(&LLFloaterBvhPreview::onBtnStop, this));
 
 	getChildView("bad_animation_text")->setVisible(FALSE);
 
@@ -363,9 +363,9 @@ BOOL LLFloaterAnimPreview::postBuild()
 }
 
 //-----------------------------------------------------------------------------
-// LLFloaterAnimPreview()
+// LLFloaterBvhPreview()
 //-----------------------------------------------------------------------------
-LLFloaterAnimPreview::~LLFloaterAnimPreview()
+LLFloaterBvhPreview::~LLFloaterBvhPreview()
 {
 	mAnimPreview = NULL;
 
@@ -375,7 +375,7 @@ LLFloaterAnimPreview::~LLFloaterAnimPreview()
 //-----------------------------------------------------------------------------
 // draw()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::draw()
+void LLFloaterBvhPreview::draw()
 {
 	LLFloater::draw();
 	LLRect r = getRect();
@@ -414,7 +414,7 @@ void LLFloaterAnimPreview::draw()
 //-----------------------------------------------------------------------------
 // resetMotion()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::resetMotion()
+void LLFloaterBvhPreview::resetMotion()
 {
 	LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
 	BOOL paused = avatarp->areAnimationsPaused();
@@ -450,7 +450,7 @@ void LLFloaterAnimPreview::resetMotion()
 //-----------------------------------------------------------------------------
 // handleMouseDown()
 //-----------------------------------------------------------------------------
-BOOL LLFloaterAnimPreview::handleMouseDown(S32 x, S32 y, MASK mask)
+BOOL LLFloaterBvhPreview::handleMouseDown(S32 x, S32 y, MASK mask)
 {
 	if (mPreviewRect.pointInRect(x, y))
 	{
@@ -468,7 +468,7 @@ BOOL LLFloaterAnimPreview::handleMouseDown(S32 x, S32 y, MASK mask)
 //-----------------------------------------------------------------------------
 // handleMouseUp()
 //-----------------------------------------------------------------------------
-BOOL LLFloaterAnimPreview::handleMouseUp(S32 x, S32 y, MASK mask)
+BOOL LLFloaterBvhPreview::handleMouseUp(S32 x, S32 y, MASK mask)
 {
 	gFocusMgr.setMouseCapture(FALSE);
 	gViewerWindow->showCursor();
@@ -478,7 +478,7 @@ BOOL LLFloaterAnimPreview::handleMouseUp(S32 x, S32 y, MASK mask)
 //-----------------------------------------------------------------------------
 // handleHover()
 //-----------------------------------------------------------------------------
-BOOL LLFloaterAnimPreview::handleHover(S32 x, S32 y, MASK mask)
+BOOL LLFloaterBvhPreview::handleHover(S32 x, S32 y, MASK mask)
 {
 	MASK local_mask = mask & ~MASK_ALT;
 
@@ -533,7 +533,7 @@ BOOL LLFloaterAnimPreview::handleHover(S32 x, S32 y, MASK mask)
 //-----------------------------------------------------------------------------
 // handleScrollWheel()
 //-----------------------------------------------------------------------------
-BOOL LLFloaterAnimPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
+BOOL LLFloaterBvhPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
 {
 	mAnimPreview->zoom((F32)clicks * -0.2f);
 	mAnimPreview->requestUpdate();
@@ -544,7 +544,7 @@ BOOL LLFloaterAnimPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
 //-----------------------------------------------------------------------------
 // onMouseCaptureLost()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onMouseCaptureLost()
+void LLFloaterBvhPreview::onMouseCaptureLost()
 {
 	gViewerWindow->showCursor();
 }
@@ -552,7 +552,7 @@ void LLFloaterAnimPreview::onMouseCaptureLost()
 //-----------------------------------------------------------------------------
 // onBtnPlay()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onBtnPlay()
+void LLFloaterBvhPreview::onBtnPlay()
 {
 	if (!getEnabled())
 		return;
@@ -576,7 +576,7 @@ void LLFloaterAnimPreview::onBtnPlay()
 //-----------------------------------------------------------------------------
 // onBtnPause()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onBtnPause()
+void LLFloaterBvhPreview::onBtnPause()
 {
 	if (!getEnabled())
 		return;
@@ -598,7 +598,7 @@ void LLFloaterAnimPreview::onBtnPause()
 //-----------------------------------------------------------------------------
 // onBtnStop()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onBtnStop()
+void LLFloaterBvhPreview::onBtnStop()
 {
 	if (!getEnabled())
 		return;
@@ -614,7 +614,7 @@ void LLFloaterAnimPreview::onBtnStop()
 //-----------------------------------------------------------------------------
 // onSliderMove()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onSliderMove()
+void LLFloaterBvhPreview::onSliderMove()
 {
 	if (!getEnabled())
 		return;
@@ -639,7 +639,7 @@ void LLFloaterAnimPreview::onSliderMove()
 //-----------------------------------------------------------------------------
 // onCommitBaseAnim()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitBaseAnim()
+void LLFloaterBvhPreview::onCommitBaseAnim()
 {
 	if (!getEnabled())
 		return;
@@ -668,7 +668,7 @@ void LLFloaterAnimPreview::onCommitBaseAnim()
 //-----------------------------------------------------------------------------
 // onCommitLoop()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitLoop()
+void LLFloaterBvhPreview::onCommitLoop()
 {
 	if (!getEnabled())
 		return;
@@ -687,7 +687,7 @@ void LLFloaterAnimPreview::onCommitLoop()
 //-----------------------------------------------------------------------------
 // onCommitLoopIn()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitLoopIn()
+void LLFloaterBvhPreview::onCommitLoopIn()
 {
 	if (!getEnabled())
 		return;
@@ -707,7 +707,7 @@ void LLFloaterAnimPreview::onCommitLoopIn()
 //-----------------------------------------------------------------------------
 // onCommitLoopOut()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitLoopOut()
+void LLFloaterBvhPreview::onCommitLoopOut()
 {
 	if (!getEnabled())
 		return;
@@ -727,7 +727,7 @@ void LLFloaterAnimPreview::onCommitLoopOut()
 //-----------------------------------------------------------------------------
 // onCommitName()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitName()
+void LLFloaterBvhPreview::onCommitName()
 {
 	if (!getEnabled())
 		return;
@@ -746,7 +746,7 @@ void LLFloaterAnimPreview::onCommitName()
 //-----------------------------------------------------------------------------
 // onCommitHandPose()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitHandPose()
+void LLFloaterBvhPreview::onCommitHandPose()
 {
 	if (!getEnabled())
 		return;
@@ -757,7 +757,7 @@ void LLFloaterAnimPreview::onCommitHandPose()
 //-----------------------------------------------------------------------------
 // onCommitEmote()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitEmote()
+void LLFloaterBvhPreview::onCommitEmote()
 {
 	if (!getEnabled())
 		return;
@@ -768,7 +768,7 @@ void LLFloaterAnimPreview::onCommitEmote()
 //-----------------------------------------------------------------------------
 // onCommitPriority()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitPriority()
+void LLFloaterBvhPreview::onCommitPriority()
 {
 	if (!getEnabled())
 		return;
@@ -782,7 +782,7 @@ void LLFloaterAnimPreview::onCommitPriority()
 //-----------------------------------------------------------------------------
 // onCommitEaseIn()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitEaseIn()
+void LLFloaterBvhPreview::onCommitEaseIn()
 {
 	if (!getEnabled())
 		return;
@@ -797,7 +797,7 @@ void LLFloaterAnimPreview::onCommitEaseIn()
 //-----------------------------------------------------------------------------
 // onCommitEaseOut()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onCommitEaseOut()
+void LLFloaterBvhPreview::onCommitEaseOut()
 {
 	if (!getEnabled())
 		return;
@@ -812,7 +812,7 @@ void LLFloaterAnimPreview::onCommitEaseOut()
 //-----------------------------------------------------------------------------
 // validateEaseIn()
 //-----------------------------------------------------------------------------
-bool LLFloaterAnimPreview::validateEaseIn(const LLSD& data)
+bool LLFloaterBvhPreview::validateEaseIn(const LLSD& data)
 {
 	if (!getEnabled())
 		return false;
@@ -832,7 +832,7 @@ bool LLFloaterAnimPreview::validateEaseIn(const LLSD& data)
 //-----------------------------------------------------------------------------
 // validateEaseOut()
 //-----------------------------------------------------------------------------
-bool LLFloaterAnimPreview::validateEaseOut(const LLSD& data)
+bool LLFloaterBvhPreview::validateEaseOut(const LLSD& data)
 {
 	if (!getEnabled())
 		return false;
@@ -852,7 +852,7 @@ bool LLFloaterAnimPreview::validateEaseOut(const LLSD& data)
 //-----------------------------------------------------------------------------
 // validateLoopIn()
 //-----------------------------------------------------------------------------
-bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data)
+bool LLFloaterBvhPreview::validateLoopIn(const LLSD& data)
 {
 	if (!getEnabled())
 		return false;
@@ -880,7 +880,7 @@ bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data)
 //-----------------------------------------------------------------------------
 // validateLoopOut()
 //-----------------------------------------------------------------------------
-bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data)
+bool LLFloaterBvhPreview::validateLoopOut(const LLSD& data)
 {
 	if (!getEnabled())
 		return false;
@@ -909,7 +909,7 @@ bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data)
 //-----------------------------------------------------------------------------
 // refresh()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::refresh()
+void LLFloaterBvhPreview::refresh()
 {
 	// Are we showing the play button (default) or the pause button?
 	bool show_play = true;
@@ -958,9 +958,9 @@ void LLFloaterAnimPreview::refresh()
 //-----------------------------------------------------------------------------
 // onBtnOK()
 //-----------------------------------------------------------------------------
-void LLFloaterAnimPreview::onBtnOK(void* userdata)
+void LLFloaterBvhPreview::onBtnOK(void* userdata)
 {
-	LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
+	LLFloaterBvhPreview* floaterp = (LLFloaterBvhPreview*)userdata;
 	if (!floaterp->getEnabled()) return;
 
 	if (floaterp->mAnimPreview)
diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloaterbvhpreview.h
similarity index 90%
rename from indra/newview/llfloateranimpreview.h
rename to indra/newview/llfloaterbvhpreview.h
index f1ffb6547f2..bae98c95d99 100644
--- a/indra/newview/llfloateranimpreview.h
+++ b/indra/newview/llfloaterbvhpreview.h
@@ -1,6 +1,6 @@
 /** 
- * @file llfloateranimpreview.h
- * @brief LLFloaterAnimPreview class definition
+ * @file llfloaterbvhpreview.h
+ * @brief LLFloaterBvhPreview class definition
  *
  * $LicenseInfo:firstyear=2004&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -24,8 +24,8 @@
  * $/LicenseInfo$
  */
 
-#ifndef LL_LLFLOATERANIMPREVIEW_H
-#define LL_LLFLOATERANIMPREVIEW_H
+#ifndef LL_LLFLOATERBVHPREVIEW_H
+#define LL_LLFLOATERBVHPREVIEW_H
 
 #include "llassettype.h"
 #include "llfloaternamedesc.h"
@@ -67,11 +67,11 @@ class LLPreviewAnimation : public LLViewerDynamicTexture
 	LLPointer<LLVOAvatar>			mDummyAvatar;
 };
 
-class LLFloaterAnimPreview : public LLFloaterNameDesc
+class LLFloaterBvhPreview : public LLFloaterNameDesc
 {
 public:
-	LLFloaterAnimPreview(const std::string& filename);
-	virtual ~LLFloaterAnimPreview();
+	LLFloaterBvhPreview(const std::string& filename);
+	virtual ~LLFloaterBvhPreview();
 	
 	BOOL postBuild();
 
@@ -128,4 +128,4 @@ class LLFloaterAnimPreview : public LLFloaterNameDesc
 	std::map<std::string, LLUUID>	mIDList;
 };
 
-#endif  // LL_LLFLOATERANIMPREVIEW_H
+#endif  // LL_LLFLOATERBVHPREVIEW_H
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index 66f0fc3cd77..27b1c3b9cd6 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -206,6 +206,25 @@ BOOL LLFloaterSoundPreview::postBuild()
 }
 
 
+//-----------------------------------------------------------------------------
+// LLFloaterAnimPreview()
+//-----------------------------------------------------------------------------
+
+LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& filename )
+	: LLFloaterNameDesc(filename)
+{
+}
+
+BOOL LLFloaterAnimPreview::postBuild()
+{
+	if (!LLFloaterNameDesc::postBuild())
+	{
+		return FALSE;
+	}
+	getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this));
+	return TRUE;
+}
+
 //-----------------------------------------------------------------------------
 // LLFloaterScriptPreview()
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h
index 69bbccaf804..41643681ac0 100644
--- a/indra/newview/llfloaternamedesc.h
+++ b/indra/newview/llfloaternamedesc.h
@@ -64,6 +64,13 @@ class LLFloaterSoundPreview : public LLFloaterNameDesc
 	virtual BOOL postBuild();
 };
 
+class LLFloaterAnimPreview : public LLFloaterNameDesc
+{
+public:
+	LLFloaterAnimPreview(const LLSD& filename );
+	virtual BOOL postBuild();
+};
+
 class LLFloaterScriptPreview : public LLFloaterNameDesc
 {
 public:
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index cca8f105157..c150a4d22df 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -35,7 +35,6 @@
 #include "llcallfloater.h"
 #include "llfasttimerview.h"
 #include "llfloaterabout.h"
-#include "llfloateranimpreview.h"
 #include "llfloaterauction.h"
 #include "llfloateravatar.h"
 #include "llfloateravatarpicker.h"
@@ -49,6 +48,7 @@
 #include "llfloaterbuyland.h"
 #include "llfloaterbulkpermission.h"
 #include "llfloaterbump.h"
+#include "llfloaterbvhpreview.h"
 #include "llfloatercamera.h"
 #include "llfloaterdeleteenvpreset.h"
 #include "llfloaterdisplayname.h"
@@ -292,7 +292,8 @@ void LLViewerFloaterReg::registerFloaters()
 
 	
 	LLFloaterUIPreviewUtil::registerFloater();
-	LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload");
+	LLFloaterReg::add("upload_anim_bvh", "floater_animation_bvh_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBvhPreview>, "upload");
+	LLFloaterReg::add("upload_anim_anim", "floater_animation_anim_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload");
 	LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload");
 	LLFloaterReg::add("upload_model", "floater_model_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelPreview>, "upload");
 	LLFloaterReg::add("upload_model_wizard", "floater_model_wizard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterModelWizard>);
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 7e830e14bf2..95e3bc9b895 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -183,7 +183,7 @@ void LLFilePickerThread::clearDead()
 #if LL_WINDOWS
 static std::string SOUND_EXTENSIONS = "wav";
 static std::string IMAGE_EXTENSIONS = "tga bmp jpg jpeg png";
-static std::string ANIM_EXTENSIONS =  "bvh";
+static std::string ANIM_EXTENSIONS =  "bvh anim";
 #ifdef _CORY_TESTING
 static std::string GEOMETRY_EXTENSIONS = "slg";
 #endif
@@ -385,7 +385,14 @@ class LLFileUploadAnim : public view_listener_t
 		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM);
 		if (!filename.empty())
 		{
-			LLFloaterReg::showInstance("upload_anim", LLSD(filename));
+			if (filename.rfind(".anim") != std::string::npos)
+			{
+				LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename));
+			}
+			else
+			{
+				LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename));
+			}
 		}
 		return true;
 	}
@@ -785,6 +792,11 @@ LLUUID upload_new_resource(
 		upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args);
 		return LLUUID();
 	}
+	else if (exten == "anim")
+	{
+		asset_type = LLAssetType::AT_ANIMATION;
+		filename = src_filename;
+	}
 	else
 	{
 		// Unknown extension
diff --git a/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..b5538a511c1
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="190"
+ layout="topleft"
+ name="Anim Preview"
+ help_topic="animation_anim_preview"
+ title="ANIMATION.ANIM"
+ width="300">
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="15"
+     layout="topleft"
+     left="10"
+     mouse_opaque="false"
+     name="name_label"
+     top="20"
+     width="275">
+        Name:
+    </text>
+    <line_editor
+     border_style="line"
+     border_thickness="1"
+     follows="left|top|right"
+     height="19"
+     layout="topleft"
+     left_delta="0"
+     max_length_bytes="63"
+     name="name_form"
+     top_pad="0"
+     width="280" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="15"
+     layout="topleft"
+     left_delta="0"
+     mouse_opaque="false"
+     name="description_label"
+     top_pad="10"
+     width="270">
+        Description:
+    </text>
+    <line_editor
+     border_style="line"
+     border_thickness="1"
+     follows="left|top|right"
+     height="19"
+     layout="topleft"
+     left_delta="0"
+     max_length_bytes="127"
+     name="description_form"
+     top_pad="0"
+     width="280" />
+    <button
+     follows="left|bottom"
+     height="22"
+     label="Upload (L$[AMOUNT])"
+     layout="topleft"
+     left="45"
+     name="ok_btn"
+     top_pad="60"
+     width="150" />
+    <button
+     follows="right|bottom"
+     height="22"
+     label="Cancel"
+     label_selected="Cancel"
+     layout="topleft"
+     name="cancel_btn"
+     left_pad="5"
+     width="90" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_animation_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
similarity index 100%
rename from indra/newview/skins/default/xui/en/floater_animation_preview.xml
rename to indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
-- 
GitLab


From 439a7df6ba40e34d390eee7849879a41cc2785de Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 30 Jan 2012 16:12:40 -0500
Subject: [PATCH 674/933] STORM-637 Scripts Progress windows Missing

---
 doc/contributions.txt            |  1 +
 indra/newview/llcompilequeue.cpp | 15 ++++++++-------
 indra/newview/llviewermenu.cpp   |  7 +++++++
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..9ff8b98fe27 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -610,6 +610,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-637
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index a42677845ec..91cf6309323 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -100,6 +100,7 @@ BOOL LLFloaterScriptQueue::postBuild()
 {
 	childSetAction("close",onCloseBtn,this);
 	getChildView("close")->setEnabled(FALSE);
+	setVisible(true);
 	return TRUE;
 }
 
@@ -178,7 +179,7 @@ BOOL LLFloaterScriptQueue::start()
 	args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
 	buffer = getString ("Starting", args);
 	
-	getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer);
+	getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
 
 	return nextObject();
 }
@@ -211,7 +212,7 @@ BOOL LLFloaterScriptQueue::nextObject()
 	if(isDone() && !mDone)
 	{
 		mDone = true;
-		getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("Done"));
+		getChild<LLScrollListCtrl>("queue output")->addSimpleElement(getString("Done"), ADD_BOTTOM);
 		getChildView("close")->setEnabled(TRUE);
 	}
 	return successful_start;
@@ -277,7 +278,7 @@ class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier
 			return;
 		}
 
-		queue->getChild<LLScrollListCtrl>("queue output")->setCommentText(message);
+		queue->getChild<LLScrollListCtrl>("queue output")->addSimpleElement(message, ADD_BOTTOM);
 	}
 		
 private:
@@ -464,7 +465,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
 	}
 	if(queue && (buffer.size() > 0)) 
 	{
-		queue->getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer);
+		queue->getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
 	}
 	delete data;
 }
@@ -637,7 +638,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj,
 				LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
 				std::string buffer;
 				buffer = getString("Resetting") + (": ") + item->getName();
-				getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer);
+				getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
 				LLMessageSystem* msg = gMessageSystem;
 				msg->newMessageFast(_PREHASH_ScriptReset);
 				msg->nextBlockFast(_PREHASH_AgentData);
@@ -690,7 +691,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj,
 				LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
 				std::string buffer;
 				buffer = getString("Running") + (": ") + item->getName();
-				list->setCommentText(buffer);
+				list->addSimpleElement(buffer, ADD_BOTTOM);
 
 				LLMessageSystem* msg = gMessageSystem;
 				msg->newMessageFast(_PREHASH_SetScriptRunning);
@@ -745,7 +746,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
 				LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
 				std::string buffer;
 				buffer = getString("NotRunning") + (": ") +item->getName();
-				list->setCommentText(buffer);
+				list->addSimpleElement(buffer, ADD_BOTTOM);
 	
 				LLMessageSystem* msg = gMessageSystem;
 				msg->newMessageFast(_PREHASH_SetScriptRunning);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 67f6150dbe6..34f13c71a35 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6509,31 +6509,37 @@ class LLToolsSelectedScriptAction : public view_listener_t
 		std::string action = userdata.asString();
 		bool mono = false;
 		std::string msg, name;
+		std::string title;
 		if (action == "compile mono")
 		{
 			name = "compile_queue";
 			mono = true;
 			msg = "Recompile";
+			title = LLTrans::getString("CompileQueueTitle");
 		}
 		if (action == "compile lsl")
 		{
 			name = "compile_queue";
 			msg = "Recompile";
+			title = LLTrans::getString("CompileQueueTitle");
 		}
 		else if (action == "reset")
 		{
 			name = "reset_queue";
 			msg = "Reset";
+			title = LLTrans::getString("ResetQueueTitle");
 		}
 		else if (action == "start")
 		{
 			name = "start_queue";
 			msg = "SetRunning";
+			title = LLTrans::getString("RunQueueTitle");
 		}
 		else if (action == "stop")
 		{
 			name = "stop_queue";
 			msg = "SetRunningNot";
+			title = LLTrans::getString("NotRunQueueTitle");
 		}
 		LLUUID id; id.generate();
 		
@@ -6542,6 +6548,7 @@ class LLToolsSelectedScriptAction : public view_listener_t
 		{
 			queue->setMono(mono);
 			queue_actions(queue, msg);
+			queue->setTitle(title);
 		}
 		else
 		{
-- 
GitLab


From bd4c629e38aa2ab7223a5ef3b8e23ad91229b512 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 30 Jan 2012 16:44:58 -0500
Subject: [PATCH 675/933] Added tag 3.2.8-start for changeset 89980333c99d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 974498551b4..33cd4d37a5d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -258,3 +258,4 @@ c6175c955a19e9b9353d242889ec1779b5762522 DRTVWR-105_3.2.5-release
 c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 3d75c836d178c7c7e788f256afe195f6cab764a2 DRTVWR-111_3.2.7-beta1
 3d75c836d178c7c7e788f256afe195f6cab764a2 3.2.7-beta1
+89980333c99dbaf1787fe20784f1d8849e9b5d4f 3.2.8-start
-- 
GitLab


From 0e609cc95b08c28bd51f5ab48160fd93df7a6b28 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 30 Jan 2012 16:45:50 -0500
Subject: [PATCH 676/933] increment viewer version to 3.2.9

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 99ab053b251..27cdfcaa4e2 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 8;
+const S32 LL_VERSION_PATCH = 9;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From c4084c71386e34f6c28d4c10199eaf1155a2855b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 30 Jan 2012 15:29:53 -0800
Subject: [PATCH 677/933] SH-2592 PROGRESS -- (OS X Lion) Graphics issues with
 Atmospheric Shaders enabled on Intel HD 3000, 10.7.2

Refactored WindLight estate settings to use float uniforms in the shaders that
only need it, rather than vec4's for everything.
---
 .../shaders/class1/deferred/cloudsV.glsl      | 32 +++----
 .../shaders/class1/deferred/skyV.glsl         | 28 +++---
 .../shaders/class1/deferred/softenLightF.glsl | 30 +++---
 .../shaders/class2/deferred/softenLightF.glsl | 30 +++---
 .../class2/windlight/atmosphericsV.glsl       | 34 +++----
 .../shaders/class2/windlight/cloudsV.glsl     | 28 +++---
 .../shaders/class2/windlight/skyV.glsl        | 28 +++---
 indra/newview/llfloatereditsky.cpp            | 37 ++++----
 indra/newview/llvosky.cpp                     | 22 ++---
 indra/newview/llvosky.h                       |  2 +-
 indra/newview/llwlparammanager.cpp            |  5 +-
 indra/newview/llwlparammanager.h              |  9 +-
 indra/newview/llwlparamset.cpp                | 94 +++++++++----------
 indra/newview/llwlparamset.h                  |  2 +-
 14 files changed, 185 insertions(+), 196 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 64e094e3c5b..72f319b8e31 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -50,18 +50,18 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
+uniform float haze_horizon;
+uniform float haze_density;
 
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 max_y;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float max_y;
 
 uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
+uniform float cloud_scale;
 
 void main()
 {
@@ -77,7 +77,7 @@ void main()
 	// Set altitude
 	if (P.y > 0.)
 	{
-		P *= (max_y.x / P.y);
+		P *= (max_y / P.y);
 	}
 	else
 	{
@@ -99,12 +99,12 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
 
 	// Calculate relative weights
-	temp1 = blue_density + haze_density.x;
+	temp1 = blue_density + haze_density;
 	blue_weight = blue_density / temp1;
-	haze_weight = haze_density.x / temp1;
+	haze_weight = haze_density / temp1;
 
 	// Compute sunlight from P & lightnorm (for long rays like sky)
 	temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
@@ -112,7 +112,7 @@ void main()
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// Distance
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
 	// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
@@ -136,14 +136,14 @@ void main()
 
 	// Increase ambient when there are more clouds
 	vec4 tmpAmbient = ambient;
-	tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5; 
+	tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5; 
 
 	// Dim sunlight by cloud shadow percentage
-	sunlight *= (1. - cloud_shadow.x);
+	sunlight *= (1. - cloud_shadow);
 
 	// Haze color below cloud
 	vec4 additiveColorBelowCloud = (	  blue_horizon * blue_weight * (sunlight + tmpAmbient)
-				+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
+				+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
 			 );	
 
 	// CLOUDS
@@ -164,13 +164,13 @@ void main()
 	vec4 oHazeColorBelowCloud = additiveColorBelowCloud * (1. - temp1);
 
 	// Make a nice cloud density based on the cloud_shadow value that was passed in.
-	vary_CloudDensity = 2. * (cloud_shadow.x - 0.25);
+	vary_CloudDensity = 2. * (cloud_shadow - 0.25);
 
 
 	// Texture coords
 	vary_texcoord0 = texcoord0;
 	vary_texcoord0.xy -= 0.5;
-	vary_texcoord0.xy /= cloud_scale.x;
+	vary_texcoord0.xy /= cloud_scale;
 	vary_texcoord0.xy += 0.5;
 
 	vary_texcoord1 = vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 721de18e0b1..deb4f00072d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -44,12 +44,12 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
+uniform float haze_horizon;
+uniform float haze_density;
 
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 max_y;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float max_y;
 
 uniform vec4 glow;
 
@@ -71,7 +71,7 @@ void main()
 	// Set altitude
 	if (P.y > 0.)
 	{
-		P *= (max_y.x / P.y);
+		P *= (max_y / P.y);
 	}
 	else
 	{
@@ -93,12 +93,12 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
 
 	// Calculate relative weights
-	temp1 = blue_density + haze_density.x;
+	temp1 = blue_density + haze_density;
 	blue_weight = blue_density / temp1;
-	haze_weight = haze_density.x / temp1;
+	haze_weight = haze_density / temp1;
 
 	// Compute sunlight from P & lightnorm (for long rays like sky)
 	temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
@@ -106,7 +106,7 @@ void main()
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// Distance
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
 	// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
@@ -131,20 +131,20 @@ void main()
 
 	// Haze color above cloud
 	vary_HazeColor = (	  blue_horizon * blue_weight * (sunlight + ambient)
-				+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + ambient)
+				+ (haze_horizon * haze_weight) * (sunlight * temp2.x + ambient)
 			 );	
 
 
 	// Increase ambient when there are more clouds
 	vec4 tmpAmbient = ambient;
-	tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5; 
+	tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5; 
 
 	// Dim sunlight by cloud shadow percentage
-	sunlight *= (1. - cloud_shadow.x);
+	sunlight *= (1. - cloud_shadow);
 
 	// Haze color below cloud
 	vec4 additiveColorBelowCloud = (	  blue_horizon * blue_weight * (sunlight + tmpAmbient)
-				+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
+				+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
 			 );	
 
 	// Final atmosphere additive
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 51110ae4df7..e32dab9bae5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -51,12 +51,12 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 distance_multiplier;
-uniform vec4 max_y;
+uniform float haze_horizon;
+uniform float haze_density;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float distance_multiplier;
+uniform float max_y;
 uniform vec4 glow;
 uniform float scene_light_strength;
 uniform mat3 env_mat;
@@ -159,13 +159,13 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 
 	//sunlight attenuation effect (hue and brightness) due to atmosphere
 	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + vec4(haze_density) * 0.25) * (density_multiplier * max_y);
 		//I had thought blue_density and haze_density should have equal weighting,
 		//but attenuation due to haze_density tends to seem too strong
 
-	temp1 = blue_density + vec4(haze_density.r);
+	temp1 = blue_density + vec4(haze_density);
 	blue_weight = blue_density / temp1;
-	haze_weight = vec4(haze_density.r) / temp1;
+	haze_weight = vec4(haze_density) / temp1;
 
 	//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
 	temp2.y = max(0.0, tmpLightnorm.y);
@@ -173,12 +173,12 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// main atmospheric scattering line integral
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
-	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
+	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
 	// compiler gets confused.
-	temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
+	temp1 = exp(-temp1 * temp2.z * distance_multiplier);
 
 	//final atmosphere attenuation factor
 	setAtmosAttenuation(temp1.rgb);
@@ -199,7 +199,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 	temp2.x += .25;
 	
 	//increase ambient when there are more clouds
-	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
+	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
 	
 	/*  decrease value and saturation (that in HSV, not HSL) for occluded areas
 	 * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
@@ -213,8 +213,8 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 
 	//haze color
 	setAdditiveColor(
-		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
-	  + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
+		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
+	  + (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
 		  + tmpAmbient)));
 
 	//brightness of surface both sunlight and ambient
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 97f3063a9e1..62b2e3a7968 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -51,12 +51,12 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 distance_multiplier;
-uniform vec4 max_y;
+uniform float haze_horizon;
+uniform float haze_density;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float distance_multiplier;
+uniform float max_y;
 uniform vec4 glow;
 uniform float scene_light_strength;
 uniform mat3 env_mat;
@@ -161,13 +161,13 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 
 	//sunlight attenuation effect (hue and brightness) due to atmosphere
 	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + vec4(haze_density) * 0.25) * (density_multiplier * max_y);
 		//I had thought blue_density and haze_density should have equal weighting,
 		//but attenuation due to haze_density tends to seem too strong
 
-	temp1 = blue_density + vec4(haze_density.r);
+	temp1 = blue_density + vec4(haze_density);
 	blue_weight = blue_density / temp1;
-	haze_weight = vec4(haze_density.r) / temp1;
+	haze_weight = vec4(haze_density) / temp1;
 
 	//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
 	temp2.y = max(0.0, tmpLightnorm.y);
@@ -175,12 +175,12 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// main atmospheric scattering line integral
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
-	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
+	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
 	// compiler gets confused.
-	temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
+	temp1 = exp(-temp1 * temp2.z * distance_multiplier);
 
 	//final atmosphere attenuation factor
 	setAtmosAttenuation(temp1.rgb);
@@ -201,7 +201,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 	temp2.x += .25;
 	
 	//increase ambient when there are more clouds
-	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
+	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
 	
 	/*  decrease value and saturation (that in HSV, not HSL) for occluded areas
 	 * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
@@ -215,8 +215,8 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 
 	//haze color
 	setAdditiveColor(
-		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
-	  + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
+		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
+	  + (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
 		  + tmpAmbient)));
 
 	//brightness of surface both sunlight and ambient
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index 6a83be1426d..bf5d1a1b4db 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -47,12 +47,12 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 distance_multiplier;
-uniform vec4 max_y;
+uniform float haze_horizon;
+uniform float haze_density;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float distance_multiplier;
+uniform float max_y;
 uniform vec4 glow;
 
 void calcAtmospherics(vec3 inPositionEye) {
@@ -61,8 +61,8 @@ void calcAtmospherics(vec3 inPositionEye) {
 	setPositionEye(P);
 	
 	//(TERRAIN) limit altitude
-	if (P.y > max_y.x) P *= (max_y.x / P.y);
-	if (P.y < -max_y.x) P *= (-max_y.x / P.y);
+	if (P.y > max_y) P *= (max_y / P.y);
+	if (P.y < -max_y) P *= (-max_y / P.y);
 
 	vec3 tmpLightnorm = lightnorm.xyz;
 
@@ -78,13 +78,13 @@ void calcAtmospherics(vec3 inPositionEye) {
 
 	//sunlight attenuation effect (hue and brightness) due to atmosphere
 	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + vec4(haze_density) * 0.25) * (density_multiplier * max_y);
 		//I had thought blue_density and haze_density should have equal weighting,
 		//but attenuation due to haze_density tends to seem too strong
 
-	temp1 = blue_density + vec4(haze_density.r);
+	temp1 = blue_density + vec4(haze_density);
 	blue_weight = blue_density / temp1;
-	haze_weight = vec4(haze_density.r) / temp1;
+	haze_weight = vec4(haze_density) / temp1;
 
 	//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
 	temp2.y = max(0.0, tmpLightnorm.y);
@@ -92,12 +92,12 @@ void calcAtmospherics(vec3 inPositionEye) {
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// main atmospheric scattering line integral
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
-	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
+	// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
 	// compiler gets confused.
-	temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
+	temp1 = exp(-temp1 * temp2.z * distance_multiplier);
 
 	//final atmosphere attenuation factor
 	setAtmosAttenuation(temp1.rgb);
@@ -122,12 +122,12 @@ void calcAtmospherics(vec3 inPositionEye) {
 
 
 	//increase ambient when there are more clouds
-	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
+	vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
 
 	//haze color
 	setAdditiveColor(
-		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
-	  + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
+		vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
+	  + (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
 		  + tmpAmbient)));
 
 	//brightness of surface both sunlight and ambient
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index c5bb52169cc..549d04a7773 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -49,12 +49,12 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
+uniform float haze_horizon;
+uniform float haze_density;
 
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 max_y;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float max_y;
 
 uniform vec4 glow;
 
@@ -76,7 +76,7 @@ void main()
 	// Set altitude
 	if (P.y > 0.)
 	{
-		P *= (max_y.x / P.y);
+		P *= (max_y / P.y);
 	}
 	else
 	{
@@ -98,12 +98,12 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
 
 	// Calculate relative weights
-	temp1 = blue_density + haze_density.x;
+	temp1 = blue_density + haze_density;
 	blue_weight = blue_density / temp1;
-	haze_weight = haze_density.x / temp1;
+	haze_weight = haze_density / temp1;
 
 	// Compute sunlight from P & lightnorm (for long rays like sky)
 	temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
@@ -111,7 +111,7 @@ void main()
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// Distance
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
 	// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
@@ -135,14 +135,14 @@ void main()
 
 	// Increase ambient when there are more clouds
 	vec4 tmpAmbient = ambient;
-	tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5; 
+	tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5; 
 
 	// Dim sunlight by cloud shadow percentage
-	sunlight *= (1. - cloud_shadow.x);
+	sunlight *= (1. - cloud_shadow);
 
 	// Haze color below cloud
 	vec4 additiveColorBelowCloud = (	  blue_horizon * blue_weight * (sunlight + tmpAmbient)
-				+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
+				+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
 			 );	
 
 	// CLOUDS
@@ -163,7 +163,7 @@ void main()
 	vec4 oHazeColorBelowCloud = additiveColorBelowCloud * (1. - temp1);
 
 	// Make a nice cloud density based on the cloud_shadow value that was passed in.
-	vary_CloudDensity = 2. * (cloud_shadow.x - 0.25);
+	vary_CloudDensity = 2. * (cloud_shadow - 0.25);
 
 
 	// Texture coords
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 46773cf89f6..7406b0253b5 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -42,12 +42,12 @@ uniform vec4 sunlight_color;
 uniform vec4 ambient;
 uniform vec4 blue_horizon;
 uniform vec4 blue_density;
-uniform vec4 haze_horizon;
-uniform vec4 haze_density;
+uniform float haze_horizon;
+uniform float haze_density;
 
-uniform vec4 cloud_shadow;
-uniform vec4 density_multiplier;
-uniform vec4 max_y;
+uniform float cloud_shadow;
+uniform float density_multiplier;
+uniform float max_y;
 
 uniform vec4 glow;
 
@@ -68,7 +68,7 @@ void main()
 	// Set altitude
 	if (P.y > 0.)
 	{
-		P *= (max_y.x / P.y);
+		P *= (max_y / P.y);
 	}
 	else
 	{
@@ -90,12 +90,12 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
+	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
 
 	// Calculate relative weights
-	temp1 = blue_density + haze_density.x;
+	temp1 = blue_density + haze_density;
 	blue_weight = blue_density / temp1;
-	haze_weight = haze_density.x / temp1;
+	haze_weight = haze_density / temp1;
 
 	// Compute sunlight from P & lightnorm (for long rays like sky)
 	temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
@@ -103,7 +103,7 @@ void main()
 	sunlight *= exp( - light_atten * temp2.y);
 
 	// Distance
-	temp2.z = Plen * density_multiplier.x;
+	temp2.z = Plen * density_multiplier;
 
 	// Transparency (-> temp1)
 	// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
@@ -128,20 +128,20 @@ void main()
 
 	// Haze color above cloud
 	vary_HazeColor = (	  blue_horizon * blue_weight * (sunlight + ambient)
-				+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + ambient)
+				+ (haze_horizon * haze_weight) * (sunlight * temp2.x + ambient)
 			 );	
 
 
 	// Increase ambient when there are more clouds
 	vec4 tmpAmbient = ambient;
-	tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5; 
+	tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5; 
 
 	// Dim sunlight by cloud shadow percentage
-	sunlight *= (1. - cloud_shadow.x);
+	sunlight *= (1. - cloud_shadow);
 
 	// Haze color below cloud
 	vec4 additiveColorBelowCloud = (	  blue_horizon * blue_weight * (sunlight + tmpAmbient)
-				+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
+				+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
 			 );	
 
 	// Final atmosphere additive
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp
index abee7b5dc9e..352361ce9e8 100644
--- a/indra/newview/llfloatereditsky.cpp
+++ b/indra/newview/llfloatereditsky.cpp
@@ -151,8 +151,8 @@ void LLFloaterEditSky::initCallbacks(void)
 	getChild<LLUICtrl>("WLBlueHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &param_mgr.mBlueHorizon));
 
 	// haze density, horizon, mult, and altitude
-	getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &param_mgr.mHazeDensity));
-	getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &param_mgr.mHazeHorizon));
+	getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &param_mgr.mHazeDensity));
+	getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &param_mgr.mHazeHorizon));
 	getChild<LLUICtrl>("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &param_mgr.mDensityMult));
 	getChild<LLUICtrl>("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &param_mgr.mMaxAlt));
 
@@ -220,15 +220,14 @@ void LLFloaterEditSky::syncControls()
 	setColorSwatch("WLBlueHorizon", param_mgr->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE);
 
 	// haze density, horizon, mult, and altitude
-	param_mgr->mHazeDensity = cur_params.getVector(param_mgr->mHazeDensity.mName, err);
-	childSetValue("WLHazeDensity", param_mgr->mHazeDensity.r);
-	param_mgr->mHazeHorizon = cur_params.getVector(param_mgr->mHazeHorizon.mName, err);
-	childSetValue("WLHazeHorizon", param_mgr->mHazeHorizon.r);
-	param_mgr->mDensityMult = cur_params.getVector(param_mgr->mDensityMult.mName, err);
-	childSetValue("WLDensityMult", param_mgr->mDensityMult.x *
-		param_mgr->mDensityMult.mult);
-	param_mgr->mMaxAlt = cur_params.getVector(param_mgr->mMaxAlt.mName, err);
-	childSetValue("WLMaxAltitude", param_mgr->mMaxAlt.x);
+	param_mgr->mHazeDensity = cur_params.getFloat(param_mgr->mHazeDensity.mName, err);
+	childSetValue("WLHazeDensity", (F32) param_mgr->mHazeDensity);
+	param_mgr->mHazeHorizon = cur_params.getFloat(param_mgr->mHazeHorizon.mName, err);
+	childSetValue("WLHazeHorizon", (F32) param_mgr->mHazeHorizon);
+	param_mgr->mDensityMult = cur_params.getFloat(param_mgr->mDensityMult.mName, err);
+	childSetValue("WLDensityMult", ((F32) param_mgr->mDensityMult) * param_mgr->mDensityMult.mult);
+	param_mgr->mMaxAlt = cur_params.getFloat(param_mgr->mMaxAlt.mName, err);
+	childSetValue("WLMaxAltitude", (F32) param_mgr->mMaxAlt);
 
 	// blue density
 	param_mgr->mBlueDensity = cur_params.getVector(param_mgr->mBlueDensity.mName, err);
@@ -273,10 +272,10 @@ void LLFloaterEditSky::syncControls()
 	childSetValue("WLCloudDetailDensity", param_mgr->mCloudDetail.b);
 
 	// Cloud extras
-	param_mgr->mCloudCoverage = cur_params.getVector(param_mgr->mCloudCoverage.mName, err);
-	param_mgr->mCloudScale = cur_params.getVector(param_mgr->mCloudScale.mName, err);
-	childSetValue("WLCloudCoverage", param_mgr->mCloudCoverage.x);
-	childSetValue("WLCloudScale", param_mgr->mCloudScale.x);
+	param_mgr->mCloudCoverage = cur_params.getFloat(param_mgr->mCloudCoverage.mName, err);
+	param_mgr->mCloudScale = cur_params.getFloat(param_mgr->mCloudScale.mName, err);
+	childSetValue("WLCloudCoverage", (F32) param_mgr->mCloudCoverage);
+	childSetValue("WLCloudScale", (F32) param_mgr->mCloudScale);
 
 	// cloud scrolling
 	bool lockX = !param_mgr->mCurParams.getEnableCloudScrollX();
@@ -306,13 +305,13 @@ void LLFloaterEditSky::syncControls()
 	childSetValue("WLCloudScrollX", param_mgr->mCurParams.getCloudScrollX() - 10.0f);
 	childSetValue("WLCloudScrollY", param_mgr->mCurParams.getCloudScrollY() - 10.0f);
 
-	param_mgr->mDistanceMult = cur_params.getVector(param_mgr->mDistanceMult.mName, err);
-	childSetValue("WLDistanceMult", param_mgr->mDistanceMult.x);
+	param_mgr->mDistanceMult = cur_params.getFloat(param_mgr->mDistanceMult.mName, err);
+	childSetValue("WLDistanceMult", (F32) param_mgr->mDistanceMult);
 
 	// Tweak extras
 
-	param_mgr->mWLGamma = cur_params.getVector(param_mgr->mWLGamma.mName, err);
-	childSetValue("WLGamma", param_mgr->mWLGamma.x);
+	param_mgr->mWLGamma = cur_params.getFloat(param_mgr->mWLGamma.mName, err);
+	childSetValue("WLGamma", (F32) param_mgr->mWLGamma);
 
 	childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness());
 }
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index e9db37821b1..312034022ea 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -342,7 +342,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
 	blue_density = LLColor3();
 	blue_horizon = LLColor3();
 	haze_density = 0.f;
-	haze_horizon = LLColor3();
+	haze_horizon = 1.f;
 	density_multiplier = 0.f;
 	max_y = 0.f;
 	glow = LLColor3();
@@ -651,17 +651,17 @@ void LLVOSky::initAtmospherics(void)
 	sunlight_color = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("sunlight_color", error));
 	ambient = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("ambient", error));
 	//lightnorm = LLWLParamManager::getInstance()->mCurParams.getVector("lightnorm", error);
-	gamma = LLWLParamManager::getInstance()->mCurParams.getVector("gamma", error)[0];
+	gamma = LLWLParamManager::getInstance()->mCurParams.getFloat("gamma", error);
 	blue_density = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("blue_density", error));
 	blue_horizon = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("blue_horizon", error));
-	haze_density = LLWLParamManager::getInstance()->mCurParams.getVector("haze_density", error)[0];
-	haze_horizon = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("haze_horizon", error));
-	density_multiplier = LLWLParamManager::getInstance()->mCurParams.getVector("density_multiplier", error)[0];
-	max_y = LLWLParamManager::getInstance()->mCurParams.getVector("max_y", error)[0];
+	haze_density = LLWLParamManager::getInstance()->mCurParams.getFloat("haze_density", error);
+	haze_horizon = LLWLParamManager::getInstance()->mCurParams.getFloat("haze_horizon", error);
+	density_multiplier = LLWLParamManager::getInstance()->mCurParams.getFloat("density_multiplier", error);
+	max_y = LLWLParamManager::getInstance()->mCurParams.getFloat("max_y", error);
 	glow = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("glow", error));
-	cloud_shadow = LLWLParamManager::getInstance()->mCurParams.getVector("cloud_shadow", error)[0];
+	cloud_shadow = LLWLParamManager::getInstance()->mCurParams.getFloat("cloud_shadow", error);
 	cloud_color = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("cloud_color", error));
-	cloud_scale = LLWLParamManager::getInstance()->mCurParams.getVector("cloud_scale", error)[0];
+	cloud_scale = LLWLParamManager::getInstance()->mCurParams.getFloat("cloud_scale", error);
 	cloud_pos_density1 = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("cloud_pos_density1", error));
 	cloud_pos_density2 = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("cloud_pos_density2", error));
 
@@ -825,7 +825,7 @@ void LLVOSky::calcSkyColorWLVert(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLCo
 
 	// Haze color above cloud
 	vary_HazeColor = (blue_horizon * blue_weight * (sunlight + ambient)
-				+ componentMult(haze_horizon.mV[0] * haze_weight, sunlight * temp2.mV[0] + ambient)
+				+ componentMult(haze_horizon * haze_weight, sunlight * temp2.mV[0] + ambient)
 			 );	
 
 	// Increase ambient when there are more clouds
@@ -836,7 +836,7 @@ void LLVOSky::calcSkyColorWLVert(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLCo
 
 	// Haze color below cloud
 	LLColor3 additiveColorBelowCloud = (blue_horizon * blue_weight * (sunlight + tmpAmbient)
-				+ componentMult(haze_horizon.mV[0] * haze_weight, sunlight * temp2.mV[0] + tmpAmbient)
+				+ componentMult(haze_horizon * haze_weight, sunlight * temp2.mV[0] + tmpAmbient)
 			 );	
 
 	// Final atmosphere additive
@@ -1002,7 +1002,7 @@ void LLVOSky::calcAtmospherics(void)
 		//haze color
 		vary_HazeColor =
 			(blue_horizon * blue_weight * (sunlight*(1.f - cloud_shadow) + tmpAmbient)	
-			+ componentMult(haze_horizon.mV[0] * haze_weight, sunlight*(1.f - cloud_shadow) * temp2.mV[0] + tmpAmbient)
+			+ componentMult(haze_horizon * haze_weight, sunlight*(1.f - cloud_shadow) * temp2.mV[0] + tmpAmbient)
 				 );	
 
 		//brightness of surface both sunlight and ambient
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index d3a42583eaa..6e6898d80a1 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -410,7 +410,7 @@ class LLVOSky : public LLStaticViewerObject
 	LLColor3 blue_density;
 	LLColor3 blue_horizon;
 	F32 haze_density;
-	LLColor3 haze_horizon;
+	F32 haze_horizon;
 	F32 density_multiplier;
 	F32 max_y;
 	LLColor3 glow;
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index 55608a059f9..49d9d44d749 100644
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -64,7 +64,6 @@
 LLWLParamManager::LLWLParamManager() :
 
 	//set the defaults for the controls
-	// index is from sWLUniforms in pipeline.cpp line 979
 
 	/// Sun Delta Terrain tweak variables.
 	mSunDeltaYaw(180.0f),
@@ -72,10 +71,10 @@ LLWLParamManager::LLWLParamManager() :
 	mWLGamma(1.0f, "gamma"),
 
 	mBlueHorizon(0.25f, 0.25f, 1.0f, 1.0f, "blue_horizon", "WLBlueHorizon"),
-	mHazeDensity(1.0f, 1.0f, 1.0f, 0.5f, "haze_density"),
+	mHazeDensity(1.0f, "haze_density"),
 	mBlueDensity(0.25f, 0.25f, 0.25f, 1.0f, "blue_density", "WLBlueDensity"),
 	mDensityMult(1.0f, "density_multiplier", 1000),
-	mHazeHorizon(1.0f, 1.0f, 1.0f, 0.5f, "haze_horizon"),
+	mHazeHorizon(1.0f, "haze_horizon"),
 	mMaxAlt(4000.0f, "max_y"),
 
 	// Lighting
diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h
index bc984b9126a..72422500fcc 100644
--- a/indra/newview/llwlparammanager.h
+++ b/indra/newview/llwlparammanager.h
@@ -102,9 +102,8 @@ struct WLFloatControl {
 	{
 	}
 
-	inline WLFloatControl & operator = (LLVector4 const & val) {
-		x = val.mV[0];
-
+	inline WLFloatControl & operator = (F32 val) {
+		x = val;
 		return *this;
 	}
 
@@ -340,10 +339,10 @@ class LLWLParamManager : public LLSingleton<LLWLParamManager>
 	
 	/// Atmospherics
 	WLColorControl mBlueHorizon;
-	WLColorControl mHazeDensity;
+	WLFloatControl mHazeDensity;
 	WLColorControl mBlueDensity;
 	WLFloatControl mDensityMult;
-	WLColorControl mHazeHorizon;
+	WLFloatControl mHazeHorizon;
 	WLFloatControl mMaxAlt;
 
 	/// Lighting
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 5bb70250310..1e95b3ea4a7 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -41,33 +41,7 @@
 LLWLParamSet::LLWLParamSet(void) :
 	mName("Unnamed Preset"),
 	mCloudScrollXOffset(0.f), mCloudScrollYOffset(0.f)	
-{
-/* REMOVE or init the LLSD
-	const std::map<std::string, LLVector4>::value_type hardcodedPreset[] = {
-		std::make_pair("lightnorm",				LLVector4(0.f, 0.707f, -0.707f, 0.f)),
-		std::make_pair("sunlight_color",		LLVector4(0.6f, 0.6f, 2.83f, 2.27f)),
-		std::make_pair("ambient",				LLVector4(0.27f, 0.33f, 0.44f, 1.19f)),
-		std::make_pair("blue_horizon",			LLVector4(0.3f, 0.4f, 0.9f, 1.f)),
-		std::make_pair("blue_density",			LLVector4(0.3f, 0.4f, 0.8f, 1.f)),
-		std::make_pair("haze_horizon",			LLVector4(0.6f, 0.6f, 0.6f, 1.f)),
-		std::make_pair("haze_density",			LLVector4(0.3f, 0.3f, 0.3f, 1.f)),
-		std::make_pair("cloud_shadow",			LLVector4(0.f, 0.f, 0.f, 0.f)),
-		std::make_pair("density_multiplier",	LLVector4(0.001f, 0.001f, 0.001f, 0.001f)),
-		std::make_pair("distance_multiplier",	LLVector4(1.f, 1.f, 1.f, 1.f)),
-		std::make_pair("max_y",					LLVector4(600.f, 600.f, 600.f, 0.f)),
-		std::make_pair("glow",					LLVector4(15.f, 0.001f, -0.03125f, 0.f)),
-		std::make_pair("cloud_color",			LLVector4(0.0f, 0.0f, 0.0f, 0.0f)),
-		std::make_pair("cloud_pos_density1",	LLVector4(0.f, 0.f, 0.f, 1.f)),
-		std::make_pair("cloud_pos_density2",	LLVector4(0.f, 0.f, 0.f, 1.f)),
-		std::make_pair("cloud_scale",			LLVector4(0.42f, 0.f, 0.f, 1.f)),
-		std::make_pair("gamma",					LLVector4(2.0f, 2.0f, 2.0f, 0.0f)),
-	};
-	std::map<std::string, LLVector4>::value_type const * endHardcodedPreset = 
-		hardcodedPreset + LL_ARRAY_SIZE(hardcodedPreset);
-
-	mParamValues.insert(hardcodedPreset, endHardcodedPreset);
-*/
-}
+{}
 
 static LLFastTimer::DeclareTimer FTM_WL_PARAM_UPDATE("WL Param Update");
 
@@ -79,55 +53,78 @@ void LLWLParamSet::update(LLGLSLShader * shader) const
 		i != mParamValues.endMap();
 		++i)
 	{
-		
-
 		const std::string& param = i->first;
 		
-		if(	param == "star_brightness" || param == "preset_num" || param == "sun_angle" ||
+		if (param == "star_brightness" || param == "preset_num" || param == "sun_angle" ||
 			param == "east_angle" || param == "enable_cloud_scroll" ||
 			param == "cloud_scroll_rate" || param == "lightnorm" ) 
 		{
 			continue;
 		}
 		
-		if(param == "cloud_pos_density1") 
+		if (param == "cloud_pos_density1")
 		{
 			LLVector4 val;
 			val.mV[0] = F32(i->second[0].asReal()) + mCloudScrollXOffset;
 			val.mV[1] = F32(i->second[1].asReal()) + mCloudScrollYOffset;
 			val.mV[2] = (F32) i->second[2].asReal();
 			val.mV[3] = (F32) i->second[3].asReal();
+
 			stop_glerror();
 			shader->uniform4fv(param, 1, val.mV);
 			stop_glerror();
-		} 
+		}
+		else if (param == "cloud_scale" || param == "cloud_shadow" ||
+				 param == "density_multiplier" ||
+				 param == "haze_density" || param == "haze_horizon" ||
+				 param == "max_y")
+		{
+			F32 val = (F32) i->second[0].asReal();
+
+			stop_glerror();
+			shader->uniform1f(param, val);
+			stop_glerror();
+		}
 		else // param is the uniform name
 		{
-			LLVector4 val;
-			
 			// handle all the different cases
-			if(i->second.isArray() && i->second.size() == 4) 
+			if (i->second.isArray() && i->second.size() == 4)
 			{
+				LLVector4 val;
+
 				val.mV[0] = (F32) i->second[0].asReal();
 				val.mV[1] = (F32) i->second[1].asReal();
 				val.mV[2] = (F32) i->second[2].asReal();
 				val.mV[3] = (F32) i->second[3].asReal();															
+
+				stop_glerror();
+				shader->uniform4fv(param, 1, val.mV);
+				stop_glerror();
 			} 
-			else if(i->second.isReal()) 
+			else if (i->second.isReal())
 			{
-				val.mV[0] = (F32) i->second.asReal();
+				F32 val = (F32) i->second.asReal();
+
+				stop_glerror();
+				shader->uniform1f(param, val);
+				stop_glerror();
 			} 
-			else if(i->second.isInteger()) 
+			else if (i->second.isInteger())
 			{
-				val.mV[0] = (F32) i->second.asReal();
+				S32 val = (S32) i->second.asInteger();
+
+				stop_glerror();
+				shader->uniform1i(param, val);
+				stop_glerror();
 			} 
-			else if(i->second.isBoolean())
+			else if (i->second.isBoolean())
 			{
-				val.mV[0] = i->second.asBoolean();
+				S32 val = (i->second.asBoolean() ? 1 : 0);
+
+				stop_glerror();
+				shader->uniform1i(param, val);
+				stop_glerror();
 			}
-			stop_glerror();
-			shader->uniform4fv(param, 1, val.mV);
-			stop_glerror();
 		}
 	}
 }
@@ -148,7 +145,8 @@ void LLWLParamSet::set(const std::string& paramName, float x)
 	}
 }
 
-void LLWLParamSet::set(const std::string& paramName, float x, float y) {
+void LLWLParamSet::set(const std::string& paramName, float x, float y)
+{
 	mParamValues[paramName][0] = x;
 	mParamValues[paramName][1] = y;
 }
@@ -194,7 +192,6 @@ void LLWLParamSet::set(const std::string& paramName, const LLColor4 & val)
 
 LLVector4 LLWLParamSet::getVector(const std::string& paramName, bool& error) 
 {
-	
 	// test to see if right type
 	LLSD cur_val = mParamValues.get(paramName);
 	if (!cur_val.isArray()) 
@@ -215,7 +212,6 @@ LLVector4 LLWLParamSet::getVector(const std::string& paramName, bool& error)
 
 F32 LLWLParamSet::getFloat(const std::string& paramName, bool& error) 
 {
-	
 	// test to see if right type
 	LLSD cur_val = mParamValues.get(paramName);
 	if (cur_val.isArray() && cur_val.size() != 0) 
@@ -234,8 +230,6 @@ F32 LLWLParamSet::getFloat(const std::string& paramName, bool& error)
 	return 0;
 }
 
-
-
 void LLWLParamSet::setSunAngle(float val) 
 {
 	// keep range 0 - 2pi
@@ -263,7 +257,6 @@ void LLWLParamSet::setEastAngle(float val)
 	mParamValues["east_angle"] = val;
 }
 
-
 void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight)
 {
 	// set up the iterators
@@ -282,7 +275,6 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight)
 	// Iterate through values
 	for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter)
 	{
-
 		// If param exists in both src and dest, set the holder variables, otherwise skip
 		if(src.mParamValues.has(iter->first) && dest.mParamValues.has(iter->first))
 		{
diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h
index 3c44ed3bb8d..b087119dd50 100644
--- a/indra/newview/llwlparamset.h
+++ b/indra/newview/llwlparamset.h
@@ -110,7 +110,7 @@ class LLWLParamSet {
 	/// \param error		A flag to set if it's not the proper return type
 	LLVector4 getVector(const std::string& paramName, bool& error);
 
-	/// Get an integer parameter
+	/// Get a float parameter
 	/// \param paramName	The name of the parameter to set.
 	/// \param error		A flag to set if it's not the proper return type	
 	F32 getFloat(const std::string& paramName, bool& error);
-- 
GitLab


From 1ff55f293444ff17a9a60c4d489effe5faf1b39b Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 30 Jan 2012 16:44:01 -0800
Subject: [PATCH 678/933] EXP-2592 FIX -- (OS X Lion) Graphics issues with
 Atmospheric Shaders enabled on Intel HD 3000, 10.7.2

* Fixed up shaders to add haze_density and blue_density together correctly as vec4's rather than
  relying on the shader compiler to add them together properly.
---
 indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/skyV.glsl    | 2 +-
 .../app_settings/shaders/class1/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class2/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class2/windlight/atmosphericsV.glsl    | 2 +-
 .../newview/app_settings/shaders/class2/windlight/cloudsV.glsl  | 2 +-
 indra/newview/app_settings/shaders/class2/windlight/skyV.glsl   | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 72f319b8e31..17f425475c8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -99,7 +99,7 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 
 	// Calculate relative weights
 	temp1 = blue_density + haze_density;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index deb4f00072d..2c8808bdcef 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -93,7 +93,7 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 
 	// Calculate relative weights
 	temp1 = blue_density + haze_density;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index e32dab9bae5..0c53a4ffa5a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -159,7 +159,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 
 	//sunlight attenuation effect (hue and brightness) due to atmosphere
 	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density) * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 		//I had thought blue_density and haze_density should have equal weighting,
 		//but attenuation due to haze_density tends to seem too strong
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 62b2e3a7968..27ea77b5a2d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -161,7 +161,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
 
 	//sunlight attenuation effect (hue and brightness) due to atmosphere
 	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density) * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 		//I had thought blue_density and haze_density should have equal weighting,
 		//but attenuation due to haze_density tends to seem too strong
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index bf5d1a1b4db..da3d922017d 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -78,7 +78,7 @@ void calcAtmospherics(vec3 inPositionEye) {
 
 	//sunlight attenuation effect (hue and brightness) due to atmosphere
 	//this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + vec4(haze_density) * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 		//I had thought blue_density and haze_density should have equal weighting,
 		//but attenuation due to haze_density tends to seem too strong
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 549d04a7773..24063597215 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -98,7 +98,7 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 
 	// Calculate relative weights
 	temp1 = blue_density + haze_density;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 7406b0253b5..09ffa14f827 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -90,7 +90,7 @@ void main()
 
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
-	light_atten = (blue_density * 1.0 + haze_density * 0.25) * (density_multiplier * max_y);
+	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
 
 	// Calculate relative weights
 	temp1 = blue_density + haze_density;
-- 
GitLab


From f3ddb75b0373f22fe0bb2f46b0a30f018bddc0ee Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 30 Jan 2012 18:32:35 -0800
Subject: [PATCH 679/933]  EXP-1851 WIP Crash when trying to resize the bottom
 sections  fixed layout logic when dealing with invisibile layout_panels

---
 indra/llui/lllayoutstack.cpp                       |  6 +++---
 indra/llui/lllayoutstack.h                         |  2 +-
 .../default/xui/en/floater_test_layout_stacks.xml  | 14 ++++++++++++--
 .../skins/default/xui/en/sidepanel_inventory.xml   |  2 +-
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 2f1c2a47c98..f43b84794db 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -36,7 +36,7 @@
 #include "llcriticaldamp.h"
 #include "boost/foreach.hpp"
 
-static const F32 MIN_FRACTIONAL_SIZE = 0.0001f;
+static const F32 MIN_FRACTIONAL_SIZE = 0.0f;
 static const F32 MAX_FRACTIONAL_SIZE = 1.f;
 
 static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
@@ -711,7 +711,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			{	// freeze new size as fraction
 				F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
 					? MAX_FRACTIONAL_SIZE
-					: llclamp((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
+					: llclamp(total_visible_fraction * (F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
 				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
 				fraction_remaining -= panelp->mFractionalSize;
 				panelp->mFractionalSize = new_fractional_size;
@@ -735,7 +735,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 				}
 				else
 				{
-					F32 new_fractional_size = llclamp((F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
+					F32 new_fractional_size = llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom) 
 														/ updated_auto_resize_headroom,
 													MIN_FRACTIONAL_SIZE,
 													MAX_FRACTIONAL_SIZE);
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index efe93f6def1..6c14a564443 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -157,7 +157,7 @@ friend class LLUICtrlFactory;
 	S32 getMinDim() const { return (mMinDim >= 0 || mAutoResize) ? llmax(0, mMinDim) : getLayoutDim(); }
 	void setMinDim(S32 value) { mMinDim = value; }
 
-	S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : mMinDim; }
+	S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : getMinDim(); }
 	void setExpandedMinDim(S32 value) { mExpandedMinDim = value; }
 	
 	S32 getRelevantMinDim() const
diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
index f95f21e63a7..f4ef63e73ec 100644
--- a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
@@ -26,6 +26,16 @@
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  visible="false"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
     <layout_panel name="flex"
                   auto_resize="true"
                   user_resize="true"
@@ -51,7 +61,7 @@
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
-    <layout_panel name="flex"
+    <!--<layout_panel name="flex"
                   auto_resize="true"
                   user_resize="true"
                   visible="false"
@@ -59,7 +69,7 @@
                   height="100"
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
-    </layout_panel>
+    </layout_panel>-->
     <layout_panel name="fixed"
                   auto_resize="false"
                   user_resize="true"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 1e06a60f554..29e27cb1460 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -48,7 +48,7 @@
                       height="300"
                       width="330" />
              </layout_panel>
-			 <layout_panel
+			    <layout_panel
                  width="330"
                  layout="topleft"
                  auto_resize="true"
-- 
GitLab


From 3af08cef719a47cfd728e9f8fab204055d50d6a7 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Tue, 31 Jan 2012 17:28:31 +0200
Subject: [PATCH 680/933] EXP-1819 FIXED (Location & Favorites bar splitter
 should be draggable to ~75%)

- Made splitter draggable to ~75%
- Decreased min width of navigation layout panel for user convenience, so that user can make favorites bar bigger and see more favorite landmarks at a time.
---
 .../skins/default/xui/en/panel_navigation_bar.xml      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index bb942f2c819..4ff9dbae0f2 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -70,7 +70,7 @@
            layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="480"
+           min_width="380"
            name="navigation_layout_panel"
            width="480">
 	        <panel
@@ -148,15 +148,15 @@
 	         layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="315"
+           min_width="450"
            name="favorites_layout_panel"
-           width="315">
+           width="500">
            <icon
              follows="top|left"
              height="25"
              image_name="ChatBarHandle"
              layout="topleft"
-             left="-318"
+             left="-503"
              name="resize_handle"
              top="4"
              width="5" />
@@ -171,7 +171,7 @@
              name="favorite"
              image_drag_indication="Accordion_ArrowOpened_Off"
              tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-             width="311">
+             width="496">
             <label
              follows="left|top"
              height="13"
-- 
GitLab


From de26be1ba25a6d3d66dbde50b903bb85d96d9ed4 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 31 Jan 2012 09:58:37 -0800
Subject: [PATCH 681/933] SH-2592 FIX -- (OS X Lion) Graphics issues with
 Atmospheric Shaders enabled on Intel HD 3000, 10.7.2

This is a dummy check-in to get the previous commit associated with SH-2592 instead of EXP-2592, which was a typo.
---
 indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 09ffa14f827..6a87caa8cf3 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -87,7 +87,6 @@ void main()
 	vec4 sunlight = sunlight_color;
 	vec4 light_atten;
 
-
 	// Sunlight attenuation effect (hue and brightness) due to atmosphere
 	// this is used later for sunlight modulation at various altitudes
 	light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
-- 
GitLab


From 4f58bd82a317d5f0748d700da07dadbd82c47c87 Mon Sep 17 00:00:00 2001
From: Hitomi Tiponi <none@none>
Date: Tue, 31 Jan 2012 13:06:53 -0500
Subject: [PATCH 682/933] STORM-1741 Collection of color and skinning issues
 With help from Jonathan Yap

---
 doc/contributions.txt                          |  3 +++
 indra/newview/skins/default/colors.xml         |  6 ++++++
 .../default/xui/en/floater_about_land.xml      |  8 ++++----
 .../default/xui/en/floater_buy_contents.xml    |  2 +-
 .../default/xui/en/floater_buy_currency.xml    |  8 ++++----
 .../default/xui/en/floater_buy_object.xml      |  4 ++--
 .../default/xui/en/floater_voice_controls.xml  |  2 +-
 .../skins/default/xui/en/inspect_object.xml    |  2 +-
 .../xui/en/panel_block_list_sidetray.xml       |  2 +-
 .../xui/en/panel_dummy_clothing_list_item.xml  |  2 +-
 .../default/xui/en/panel_edit_wearable.xml     |  6 +++---
 .../default/xui/en/panel_instant_message.xml   |  6 +++---
 .../default/xui/en/panel_notification.xml      | 18 +++++++++---------
 .../xui/en/panel_online_status_toast.xml       |  2 +-
 .../default/xui/en/panel_sys_well_item.xml     |  4 ++--
 .../xui/en/panel_teleport_history_item.xml     |  2 +-
 .../skins/default/xui/en/panel_toast.xml       |  2 +-
 .../xui/en/widgets/avatar_list_item.xml        |  8 ++++----
 .../xui/en/widgets/bodyparts_list_item.xml     |  2 +-
 .../xui/en/widgets/clothing_list_item.xml      |  2 +-
 .../en/widgets/dummy_clothing_list_item.xml    |  2 +-
 21 files changed, 51 insertions(+), 42 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 1a3fc680bc8..87fc88b83f9 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -466,6 +466,8 @@ Hiro Sommambulist
 	VWR-132
 	VWR-136
 	VWR-143
+Hitomi Tiponi
+	STORM-1741
 Holger Gilruth
 Horatio Freund
 Hoze Menges
@@ -603,6 +605,7 @@ Jonathan Yap
 	STORM-653
 	STORM-1737
 	STORM-1733
+	STORM-1741
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 8baaa14595f..b616e2327bb 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -614,6 +614,9 @@
     <color
      name="PanelFocusBackgroundColor"
      reference="DkGray2" />
+    <color
+     name="PanelNotificationBackground"
+     value="1 0.3 0.3 0" />
     <color
      name="ParcelHoverColor"
      reference="White" />
@@ -746,6 +749,9 @@
     <color
      name="TitleBarFocusColor"
      reference="White_10" />
+    <color
+     name="ToastBackground"
+     value="0.3 0.3 0.3 0" />
     <color
      name="ToolTipBgColor"
      value="0.937 0.89 0.655 1" />
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 4772f744ead..2549a405868 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1214,7 +1214,7 @@ Only large parcels can be listed in search.
              type="string"
              length="1"
              follows="left|top"
-             text_color="white"
+             text_color="White"
              height="16"
              layout="topleft"
              left="10"
@@ -1504,7 +1504,7 @@ Only large parcels can be listed in search.
              layout="topleft"
              left="20"
              name="Snapshot:"
-             text_color="white"
+             text_color="White"
              top="225"
              width="200">
                 Snapshot:
@@ -1550,7 +1550,7 @@ Only large parcels can be listed in search.
              layout="topleft"
              left="255"
              top="282"
-             text_color="white"
+             text_color="White"
              name="landing_point"
              word_wrap="true"
              width="200">
@@ -1580,7 +1580,7 @@ Only large parcels can be listed in search.
             <text
              type="string"
              length="1"
-             text_color="white"
+             text_color="White"
              follows="left|top"
              height="16"
              layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_buy_contents.xml b/indra/newview/skins/default/xui/en/floater_buy_contents.xml
index 92001534e7e..ac96a708057 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_contents.xml
@@ -62,7 +62,7 @@
      layout="topleft"
      left="10"
      name="buy_text"
-     text_color="white"
+     text_color="White"
      top="220"
      use_ellipses="true" 
      width="260">
diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
index 6afa24d04af..553c5d51d01 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
@@ -215,7 +215,7 @@
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
@@ -229,7 +229,7 @@
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
@@ -243,7 +243,7 @@ Re-enter amount to see the latest exchange rate.
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
@@ -257,7 +257,7 @@ Re-enter amount to see the latest exchange rate.
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml
index 8dfb6ba00c0..5fdd4aa49d9 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_object.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml
@@ -89,7 +89,7 @@
      left_delta="0"
 	 line_spacing.pixels="7"
      name="buy_text"
-     text_color="white"
+     text_color="White"
      top_pad="5"
      use_ellipses="true"
      width="260"
@@ -106,7 +106,7 @@ Buy for L$[AMOUNT] from:
      left_delta="0"
 	 line_spacing.pixels="7"
      name="buy_name_text"
-     text_color="white"
+     text_color="White"
      top_pad="5"
      use_ellipses="true"
      width="260">
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index 6807b01fa3e..463af4002bd 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -72,7 +72,7 @@
              layout="topleft"
              left_pad="10"
              name="user_text"
-             text_color="white"
+             text_color="White"
              top="4"
              use_ellipses="true"
              value="My Avatar:"
diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml
index 8d14c974b43..880dddce192 100644
--- a/indra/newview/skins/default/xui/en/inspect_object.xml
+++ b/indra/newview/skins/default/xui/en/inspect_object.xml
@@ -56,7 +56,7 @@ owner secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
    halign="right"
    right="-5"
    name="price_text"
-   text_color="white"
+   text_color="White"
    top="60"
    font_shadow="none"
    width="60">
diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml
index 1e6a31d3883..7c67fd7f835 100644
--- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml
+++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml
@@ -28,7 +28,7 @@
      layout="topleft"
      left_pad="10"
      name="title_text"
-     text_color="white"
+     text_color="White"
      top="5"
      width="250">
         Block List
diff --git a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml
index df459b40836..4b05ab27e46 100644
--- a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml
@@ -29,7 +29,7 @@
      width="380" />
     <icon
      height="16"
-     color="0.75 0.75 0.75 1"
+     color="LtGray"
      follows="top|left"
      image_name="Inv_Object"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
index c8764a6a843..68f1fa10149 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
@@ -164,7 +164,7 @@
      layout="topleft"
      left_pad="8"
      name="edit_wearable_title"
-     text_color="white"
+     text_color="White"
      top="3"
      value="Editing Shape"
      use_ellipses="true"
@@ -190,7 +190,7 @@
          layout="topleft"
          left="10"
          name="description_text"
-         text_color="white"
+         text_color="White"
          top="10"
          value="Shape:"
          width="150" />
@@ -254,7 +254,7 @@
          name="description"
          prevalidate_callback="ascii"
          select_on_focus="true"
-         text_color="black"
+         text_color="Black"
          top_pad="3"
          width="290" />
     </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml
index 4251128714f..2e5d6509022 100644
--- a/indra/newview/skins/default/xui/en/panel_instant_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml
@@ -15,7 +15,7 @@
     <panel
      background_visible="true"
      bevel_style="in"
-     bg_alpha_color="black"
+     bg_alpha_color="Black"
      follows="top"
      height="24"
      label="im_header"
@@ -64,7 +64,7 @@
          left_pad="5"
          name="user_name"
          parse_urls="false"
-         text_color="white"
+         text_color="White"
          top="8"
          translate="false"
          use_ellipses="true"
@@ -90,7 +90,7 @@
      layout="topleft"
      left="10"
      name="message"
-     text_color="white"
+     text_color="White"
      top="33"
      use_ellipses="true"
      value=""
diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index f6f62ac54eb..94c468e1bb0 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -3,8 +3,8 @@
   background_opaque="false"
       border_visible="false"
   background_visible="true"
-  bg_alpha_color="1 0.3 0.3 0"
-  bg_opaque_color="1 0.3 0.3 0"
+  bg_alpha_color="PanelNotificationBackground"
+  bg_opaque_color="PanelNotificationBackground"
   label="notification_panel"
   layout="topleft"
   left="0"
@@ -20,8 +20,8 @@
       border_visible="false"
  bevel_style="none"
     background_visible="true"
-  bg_alpha_color="0.3 0.3 0.3 0"
-  bg_opaque_color="0.3 0.3 0.3 0"
+  bg_alpha_color="ToastBackground"
+  bg_opaque_color="ToastBackground"
     follows="left|right|top"
     height="100"
     label="info_panel"
@@ -39,7 +39,7 @@
       left="10"
       name="text_box"
       read_only="true"
-      text_color="white"
+      text_color="White"
       top="10"
       visible="false" 
       width="285"
@@ -52,7 +52,7 @@
       layout="topleft"
       left="10"
       name="caution_text_box"
-      text_color="1 0.82 0.46 1"
+      text_color="NotifyCautionBoxColor"
       top="10"
       visible="false"
       width="285"
@@ -60,7 +60,7 @@
     <text_editor
     	h_pad="0"
 	v_pad="0"
-      bg_readonly_color="0.0 0.0 0.0 0"
+      bg_readonly_color="Transparent"
       border_visible="false"
       embedded_items="false"
       enabled="false"
@@ -73,8 +73,8 @@
       name="text_editor_box"
       read_only="true"
       tab_stop="false"
-      text_color="white"
-      text_readonly_color="white"
+      text_color="White"
+      text_readonly_color="White"
       top="10"
       visible="false"
       width="285"
diff --git a/indra/newview/skins/default/xui/en/panel_online_status_toast.xml b/indra/newview/skins/default/xui/en/panel_online_status_toast.xml
index b1a7697e833..dadbd9c9abc 100644
--- a/indra/newview/skins/default/xui/en/panel_online_status_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_online_status_toast.xml
@@ -25,7 +25,7 @@
      layout="topleft"
      left_pad="5"
      name="message"
-     text_color="white"
+     text_color="White"
      top="15"
      use_ellipses="true"
      value=""
diff --git a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml
index 5e74689c5a2..007b73a4bc0 100644
--- a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml
@@ -13,7 +13,7 @@
   follows="left|right"
   background_opaque="false"
   background_visible="true"
-  bg_alpha_color="0.0 0.0 0.0 0.0" >
+  bg_alpha_color="SysWellItemUnselected" >
   <text
     clip_partial="true" 
     top="2"
@@ -22,7 +22,7 @@
     height="28"
     layout="topleft"
     follows="right|left"
-    text_color="white"
+    text_color="White"
     use_ellipses="true"
     word_wrap="true"
     mouse_opaque="false"
diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
index c89e1dc215f..c5b0be0616f 100644
--- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
@@ -44,7 +44,7 @@
      parse_urls="false"
      use_ellipses="true"
      name="region"
-     text_color="white"
+     text_color="White"
      top="4"
      value="..."
      width="330" />
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index 062c403a26b..0b5aff54ca8 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -59,7 +59,7 @@
    left="20"
    name="toast_text"
    word_wrap="true"
-   text_color="white"
+   text_color="White"
    top="5"
    translate="false"
    use_ellipses="true"
diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml
index 1bb3188cc8a..8a4ccb19f9d 100644
--- a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml
@@ -17,13 +17,13 @@
   <voice_call_invited_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="0.5 0.5 0.5 0.5"/>
+   color="AvatarListItemIconVoiceInvitedColor"/>
 
   <!-- styles for avatar item JOINED to voice call -->
   <voice_call_joined_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="white"/>
+   color="White"/>
 
   <!-- styles for avatar item which HAS LEFT voice call -->
   <voice_call_left_style
@@ -35,11 +35,11 @@
   <online_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="white"/>
+   color="White"/>
 
   <!-- styles for OFFLINE avatar item -->
   <offline_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="0.5 0.5 0.5 1.0"/>
+   color="Gray"/>
 </avatar_list_item>
diff --git a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml
index 0eec002006d..0016a8cf53c 100644
--- a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml
@@ -24,7 +24,7 @@
    parse_urls="false"
    use_ellipses="true"
    name="item_name"
-   text_color="white"
+   text_color="White"
    top="5"
    value="..."
    width="359" />
diff --git a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml
index 96d72c78a65..d83f44737ec 100644
--- a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml
@@ -24,7 +24,7 @@
    parse_urls="false"
    use_ellipses="true"
    name="item_name"
-   text_color="white"
+   text_color="White"
    top="5"
    value="..."
    width="359" />
diff --git a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml
index 6c606248050..8c805da0482 100644
--- a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml
@@ -9,7 +9,7 @@
  width="380">
   <item_icon
     height="16"
-    color="0.75 0.75 0.75 1"
+    color="LtGray"
     follows="top|left"
     image_name="Inv_Object"
     layout="topleft"
-- 
GitLab


From bb5dc767f7017089368d5164cd16cf983282b9de Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 31 Jan 2012 16:57:46 -0500
Subject: [PATCH 683/933] STORM-1803 Adjust messages in notifications.xml

---
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 1daf2e69482..9bf93fd0b62 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1621,7 +1621,7 @@ Unable to create output file: [FILE]
    icon="alertmodal.tga"
    name="DoNotSupportBulkAnimationUpload"
    type="alertmodal">
-[APP_NAME] does not currently support bulk upload of animation files.
+[APP_NAME] does not currently support bulk upload of BVH format animation files.
   <tag>fail</tag>
   </notification>
 
-- 
GitLab


From 20b46ef6f626c8c7960a4b9c02cae518448497b7 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 31 Jan 2012 15:34:32 -0800
Subject: [PATCH 684/933]  EXP-1851 FIX Crash when trying to resize the bottom
 sections  more layout logic fixes and added renormalization to fractional
 sizes to eliminate drift

---
 indra/llui/lllayoutstack.cpp                  | 56 +++++++++----------
 indra/llui/lllayoutstack.h                    |  6 +-
 .../xui/en/floater_test_layout_stacks.xml     | 14 ++++-
 3 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index f43b84794db..88c2218f249 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -129,6 +129,10 @@ void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientatio
 		? getRect().getWidth()
 		: getRect().getHeight()));
 
+	if (mAutoResize == FALSE && mMinDim == -1)
+	{
+		setMinDim(layout_dim);
+	}
 	mTargetDim = llmax(layout_dim, getMinDim());
 }
  
@@ -246,7 +250,7 @@ void LLLayoutStack::removeChild(LLView* view)
 	{
 		mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
 		delete embedded_panelp;
-		updateFractionalSizes();
+		normalizeFractionalSizes();
 		mNeedsLayout = true;
 	}
 
@@ -271,7 +275,7 @@ bool LLLayoutStack::addChild(LLView* child, S32 tab_group)
 	}
 	BOOL result = LLView::addChild(child, tab_group);
 
-	updateFractionalSizes();
+	normalizeFractionalSizes();
 	return result;
 }
 
@@ -306,7 +310,6 @@ void LLLayoutStack::updateLayout()
 
 	bool animation_in_progress = animatePanels();
 	F32 total_visible_fraction = 0.f;
-	F32 total_open_fraction = 0.f;
 	S32 space_to_distribute = (mOrientation == HORIZONTAL)
 							? getRect().getWidth()
 							: getRect().getHeight();
@@ -318,20 +321,17 @@ void LLLayoutStack::updateLayout()
 		if (panelp->mAutoResize)
 		{
 			panelp->mTargetDim = panelp->getRelevantMinDim();
-			if (!panelp->mCollapsed && panelp->getVisible())
-			{
-				total_open_fraction += panelp->mFractionalSize;
-			}
 		}
 		space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
-		total_visible_fraction += panelp->mFractionalSize;
+		total_visible_fraction += panelp->mFractionalSize * panelp->getVisibleAmount();
 	}
 
-	llassert(total_visible_fraction < 1.01f);
+	llassert(total_visible_fraction < 1.05f);
 
 	// don't need spacing after last panel
 	space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
 
+	S32 remaining_space = space_to_distribute;
 	F32 fraction_distributed = 0.f;
 	if (space_to_distribute > 0 && total_visible_fraction > 0.f)
 	{	// give space proportionally to visible auto resize panels
@@ -343,26 +343,23 @@ void LLLayoutStack::updateLayout()
 				S32 delta = llround((F32)space_to_distribute * fraction_to_distribute);
 				fraction_distributed += fraction_to_distribute;
 				panelp->mTargetDim += delta;
+				remaining_space -= delta;
 			}
 		}
 	}
 
-	if (fraction_distributed < total_visible_fraction)
-	{	// distribute any left over pixels to non-collapsed, visible panels
-		F32 fraction_left = total_visible_fraction - fraction_distributed;
-		S32 space_left = llround((F32)space_to_distribute * (fraction_left / total_visible_fraction));
+	// distribute any left over pixels to non-collapsed, visible panels
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	{
+		if (remaining_space == 0) break;
 
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		if (panelp->mAutoResize 
+			&& !panelp->mCollapsed 
+			&& panelp->getVisible())
 		{
-			if (panelp->mAutoResize 
-				&& !panelp->mCollapsed 
-				&& panelp->getVisible())
-			{
-				S32 space_for_panel = llmax(0, llround((F32)space_left * (panelp->mFractionalSize / total_open_fraction)));
-				panelp->mTargetDim += space_for_panel;
-				space_left -= space_for_panel;
-				total_open_fraction -= panelp->mFractionalSize;
-			}
+			S32 space_for_panel = remaining_space > 0 ? 1 : -1;
+			panelp->mTargetDim += space_for_panel;
+			remaining_space -= space_for_panel;
 		}
 	}
 
@@ -492,7 +489,7 @@ void LLLayoutStack::updateClass()
 	}
 }
 
-void LLLayoutStack::updateFractionalSizes()
+void LLLayoutStack::normalizeFractionalSizes()
 {
 	F32 total_resizable_dim = 0;
 	S32 num_auto_resize_panels = 0;
@@ -691,7 +688,9 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		case BEFORE_RESIZED_PANEL:
 			if (panelp->mAutoResize)
 			{	// freeze current size as fraction of overall auto_resize space
-				F32 fractional_adjustment_factor = total_auto_resize_headroom / updated_auto_resize_headroom;
+				F32 fractional_adjustment_factor = updated_auto_resize_headroom == 0.f
+													? 1.f
+													: total_auto_resize_headroom / updated_auto_resize_headroom;
 				F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
 													MIN_FRACTIONAL_SIZE,
 													MAX_FRACTIONAL_SIZE);
@@ -720,7 +719,6 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			else
 			{	// freeze new size as original size
 				panelp->mTargetDim = new_dim;
-				fraction_remaining -= fraction_given_up;
 			}
 			which_panel = NEXT_PANEL;
 			break;
@@ -728,7 +726,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			if (panelp->mAutoResize)
 			{
 				fraction_remaining -= panelp->mFractionalSize;
-				if (fraction_given_up != 0.f)
+				if (resized_panel->mAutoResize)
 				{
 					panelp->mFractionalSize = llclamp(panelp->mFractionalSize + fraction_given_up, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
 					fraction_given_up = 0.f;
@@ -750,7 +748,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			which_panel = AFTER_RESIZED_PANEL;
 			break;
 		case AFTER_RESIZED_PANEL:
-			if (panelp->mAutoResize)
+			if (panelp->mAutoResize && fraction_given_up != 0.f)
 			{
 				panelp->mFractionalSize = llclamp(panelp->mFractionalSize + (panelp->mFractionalSize / fraction_remaining) * fraction_given_up,
 												MIN_FRACTIONAL_SIZE,
@@ -760,6 +758,8 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			break;
 		}
 	}
+	updateLayout();
+	normalizeFractionalSizes();
 }
 
 void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 6c14a564443..4a8702e318e 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -72,7 +72,7 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	/*virtual*/ void draw();
 	/*virtual*/ void removeChild(LLView*);
 	/*virtual*/ BOOL postBuild();
-	/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
+	/*virtual*/ bool addChild(LLView* child, S32 tab_groupdatefractuiona = 0);
 	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
 
 
@@ -111,7 +111,7 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 
 	LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
 	LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
-	void updateFractionalSizes();
+	void normalizeFractionalSizes();
 	void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect );
 
 	S32 mPanelSpacing;
@@ -154,7 +154,7 @@ friend class LLUICtrlFactory;
 	void setVisible(BOOL visible);
 
 	S32 getLayoutDim() const;
-	S32 getMinDim() const { return (mMinDim >= 0 || mAutoResize) ? llmax(0, mMinDim) : getLayoutDim(); }
+	S32 getMinDim() const { return llmax(0, mMinDim); }
 	void setMinDim(S32 value) { mMinDim = value; }
 
 	S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : getMinDim(); }
diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
index f4ef63e73ec..a04050e7eb7 100644
--- a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
@@ -36,6 +36,16 @@
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  visible="true"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
     <layout_panel name="flex"
                   auto_resize="true"
                   user_resize="true"
@@ -61,7 +71,7 @@
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
-    <!--<layout_panel name="flex"
+    <layout_panel name="flex"
                   auto_resize="true"
                   user_resize="true"
                   visible="false"
@@ -69,7 +79,7 @@
                   height="100"
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
-    </layout_panel>-->
+    </layout_panel>
     <layout_panel name="fixed"
                   auto_resize="false"
                   user_resize="true"
-- 
GitLab


From 127f6d14050bd1d10b3a4b4b8a4c315da43e9f92 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 31 Jan 2012 16:36:25 -0800
Subject: [PATCH 685/933] Fixed up LLVolume memory leak caused by mesh repo
 thread.

Reviewed by Bao.
---
 indra/newview/llmeshrepository.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 03dc7f6bba1..f2a24bf18a5 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1068,17 +1068,19 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
 
 bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size)
 {
-	LLVolume* volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
+	LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
 	std::string mesh_string((char*) data, data_size);
 	std::istringstream stream(mesh_string);
 
 	if (volume->unpackVolumeFaces(stream, data_size))
 	{
-		LoadedMesh mesh(volume, mesh_params, lod);
 		if (volume->getNumFaces() > 0)
 		{
-			LLMutexLock lock(mMutex);
-			mLoadedQ.push(mesh);
+			LoadedMesh mesh(volume, mesh_params, lod);
+			{
+				LLMutexLock lock(mMutex);
+				mLoadedQ.push(mesh);
+			}
 			return true;
 		}
 	}
-- 
GitLab


From c47c31fdbfb1c02de13bc7f17af1e7d173c048f3 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 31 Jan 2012 17:51:43 -0800
Subject: [PATCH 686/933] EXP-1513 FIX Underscore ( _ ) fails to show in first
 chat entry in Local Chat

---
 indra/llrender/llfontgl.cpp                      | 16 +++-------------
 indra/llrender/llfontgl.h                        |  4 +---
 indra/llui/llfloater.cpp                         |  2 +-
 indra/llui/llmenugl.cpp                          |  2 +-
 indra/llui/llscrolllistcell.cpp                  |  4 ++--
 indra/llui/lltextbase.cpp                        | 12 ++++++------
 indra/llui/lltexteditor.cpp                      |  6 +++---
 indra/newview/llexpandabletextbox.cpp            |  2 +-
 indra/newview/llfasttimerview.cpp                |  6 +++---
 indra/newview/llfolderview.cpp                   |  6 +++---
 indra/newview/llmemoryview.cpp                   |  2 +-
 indra/newview/lltexturectrl.cpp                  |  2 +-
 indra/newview/lltextureview.cpp                  | 16 ++++++++--------
 indra/newview/lltoastalertpanel.cpp              |  4 ++--
 indra/newview/lltoastpanel.cpp                   |  2 +-
 indra/newview/lluploaddialog.cpp                 |  2 +-
 indra/newview/llviewertexteditor.cpp             |  2 +-
 indra/newview/llworldmapview.cpp                 |  8 ++++----
 .../default/xui/en/floater_test_toolbar.xml      |  8 ++++----
 19 files changed, 47 insertions(+), 59 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 7d827ae4831..4eb10b2c931 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -225,7 +225,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 		cur_y += llceil(mFontFreetype->getDescenderHeight());
 		break;
 	case VCENTER:
-		cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
+		cur_y -= llceil((llceil(mFontFreetype->getAscenderHeight()) - llceil(mFontFreetype->getDescenderHeight())) / 2.f);
 		break;
 	case BASELINE:
 		// Baseline, do nothing.
@@ -445,19 +445,9 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y
 }
 
 // font metrics - override for LLFontFreetype that returns units of virtual pixels
-F32 LLFontGL::getLineHeight() const
+S32 LLFontGL::getLineHeight() const
 { 
-	return (F32)llceil(mFontFreetype->getLineHeight() / sScaleY); 
-}
-
-F32 LLFontGL::getAscenderHeight() const
-{ 
-	return (F32)llceil(mFontFreetype->getAscenderHeight() / sScaleY); 
-}
-
-F32 LLFontGL::getDescenderHeight() const
-{ 
-	return (F32)llceil(mFontFreetype->getDescenderHeight() / sScaleY); 
+	return llceil(mFontFreetype->getAscenderHeight() / sScaleY) + llceil(mFontFreetype->getDescenderHeight() / sScaleY);
 }
 
 S32 LLFontGL::getWidth(const std::string& utf8text) const
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index dc8d848ed25..9d7e2891e32 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -115,9 +115,7 @@ class LLFontGL
 	S32 renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style = NORMAL, ShadowType shadow = NO_SHADOW) const;
 
 	// font metrics - override for LLFontFreetype that returns units of virtual pixels
-	F32 getLineHeight() const;
-	F32 getAscenderHeight() const;
-	F32 getDescenderHeight() const;
+	S32 getLineHeight() const;
 
 	S32 getWidth(const std::string& utf8text) const;
 	S32 getWidth(const llwchar* wchars) const;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index cedc4c0aee9..cef5ba3fe7d 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1802,7 +1802,7 @@ void LLFloater::draw()
 				
 				const LLFontGL* font = LLFontGL::getFontSansSerif();
 				LLRect r = getRect();
-				gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, 
+				gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - font->getLineHeight() - 1, 
 					titlebar_focus_color % alpha, 0, TRUE);
 			}
 		}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index c624ae2e929..1db1dac2ec1 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1966,7 +1966,7 @@ void LLMenuGL::arrange( void )
 
 		// *FIX: create the item first and then ask for its dimensions?
 		S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::getFontSansSerif()->getWidth( std::string("More") ); // *TODO: Translate
-		S32 spillover_item_height = llround(LLFontGL::getFontSansSerif()->getLineHeight()) + MENU_ITEM_PADDING;
+		S32 spillover_item_height = LLFontGL::getFontSansSerif()->getLineHeight() + MENU_ITEM_PADDING;
 
 		// Scrolling support
 		item_list_t::iterator first_visible_item_iter;
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index b087602a56b..8000efad0e2 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -232,7 +232,7 @@ BOOL LLScrollListText::getVisible() const
 //virtual 
 S32 LLScrollListText::getHeight() const
 {
-	return llround(mFont->getLineHeight());
+	return mFont->getLineHeight();
 }
 
 
@@ -306,7 +306,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
 			break;
 		}
 		LLRect highlight_rect(left - 2, 
-				llround(mFont->getLineHeight()) + 1, 
+				mFont->getLineHeight() + 1, 
 				left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1, 
 				1);
 		mRoundedRectImage->draw(highlight_rect, highlight_color);
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index e3c9c3c561f..7e5974bf0e2 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2157,7 +2157,7 @@ LLRect LLTextBase::getLocalRectFromDocIndex(S32 pos) const
 	{ 
 		// return default height rect in upper left
 		local_rect = content_window_rect;
-		local_rect.mBottom = local_rect.mTop - (S32)(mDefaultFont->getLineHeight());
+		local_rect.mBottom = local_rect.mTop - mDefaultFont->getLineHeight();
 		return local_rect;
 	}
 
@@ -2578,7 +2578,7 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e
 	mToken(NULL),
 	mEditor(editor)
 {
-	mFontHeight = llceil(mStyle->getFont()->getLineHeight());
+	mFontHeight = mStyle->getFont()->getLineHeight();
 
 	LLUIImagePtr image = mStyle->getImage();
 	if (image.notNull())
@@ -2594,7 +2594,7 @@ LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32
 {
 	mStyle = new LLStyle(LLStyle::Params().visible(is_visible).color(color));
 
-	mFontHeight = llceil(mStyle->getFont()->getLineHeight());
+	mFontHeight = mStyle->getFont()->getLineHeight();
 }
 
 LLNormalTextSegment::~LLNormalTextSegment()
@@ -2962,11 +2962,11 @@ LLLineBreakTextSegment::LLLineBreakTextSegment(S32 pos):LLTextSegment(pos,pos+1)
 {
 	LLStyleSP s( new LLStyle(LLStyle::Params().visible(true)));
 
-	mFontHeight = llceil(s->getFont()->getLineHeight());
+	mFontHeight = s->getFont()->getLineHeight();
 }
 LLLineBreakTextSegment::LLLineBreakTextSegment(LLStyleConstSP style,S32 pos):LLTextSegment(pos,pos+1)
 {
-	mFontHeight = llceil(style->getFont()->getLineHeight());
+	mFontHeight = style->getFont()->getLineHeight();
 }
 LLLineBreakTextSegment::~LLLineBreakTextSegment()
 {
@@ -3003,7 +3003,7 @@ static const S32 IMAGE_HPAD = 3;
 bool LLImageTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const
 {
 	width = 0;
-	height = llceil(mStyle->getFont()->getLineHeight());;
+	height = mStyle->getFont()->getLineHeight();
 
 	LLUIImagePtr image = mStyle->getImage();
 	if( num_chars>0 && image.notNull())
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 3a23ce1caca..3409b6817d2 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1992,7 +1992,7 @@ void LLTextEditor::drawPreeditMarker()
 		return;
 	}
 		
-	const S32 line_height = llround( mDefaultFont->getLineHeight() );
+	const S32 line_height = mDefaultFont->getLineHeight();
 
 	S32 line_start = getLineStart(cur_line);
 	S32 line_y = mVisibleTextRect.mTop - line_height;
@@ -2715,7 +2715,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 
     const LLWString textString(getWText());
 	const llwchar * const text = textString.c_str();
-	const S32 line_height = llround(mDefaultFont->getLineHeight());
+	const S32 line_height = mDefaultFont->getLineHeight();
 
 	if (coord)
 	{
@@ -2818,7 +2818,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
 
 S32 LLTextEditor::getPreeditFontSize() const
 {
-	return llround(mDefaultFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]);
+	return llround((F32)mDefaultFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]);
 }
 
 BOOL LLTextEditor::isDirty() const
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index 2abfbf37ca9..935dcb74b0f 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -55,7 +55,7 @@ class LLExpanderSegment : public LLTextSegment
 		else
 		{
 			width = mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad(); 
-			height = llceil(mStyle->getFont()->getLineHeight());
+			height = mStyle->getFont()->getLineHeight();
 		}
 		return true;
 	}
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 233038daba3..9664aa7dbe2 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -149,7 +149,7 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask)
 
 LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y)
 {
-	S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::getFontMonospace()->getLineHeight()+2) - 5;
+	S32 idx = (getRect().getHeight() - y) / (LLFontGL::getFontMonospace()->getLineHeight()+2) - 5;
 
 	if (idx >= 0 && idx < (S32)ft_display_idx.size())
 	{
@@ -552,7 +552,7 @@ void LLFastTimerView::draw()
 	// update rectangle that includes timer bars
 	mBarRect.mLeft = xleft;
 	mBarRect.mRight = getRect().getWidth();
-	mBarRect.mTop = ytop - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4);
+	mBarRect.mTop = ytop - (LLFontGL::getFontMonospace()->getLineHeight() + 4);
 	mBarRect.mBottom = margin + LINE_GRAPH_HEIGHT;
 
 	y = ytop;
@@ -846,7 +846,7 @@ void LLFastTimerView::draw()
 				tdesc = llformat("%4.2f ms", ms);
 							
 			x = mGraphRect.mRight - LLFontGL::getFontMonospace()->getWidth(tdesc)-5;
-			y = mGraphRect.mTop - ((S32)LLFontGL::getFontMonospace()->getLineHeight());
+			y = mGraphRect.mTop - LLFontGL::getFontMonospace()->getLineHeight();
  
 			LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white,
 										 LLFontGL::LEFT, LLFontGL::TOP);
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 79c987fa376..2249f61435e 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -255,7 +255,7 @@ LLFolderView::LLFolderView(const Params& p)
 	LLRect new_r = LLRect(rect.mLeft + ICON_PAD,
 			      rect.mTop - TEXT_PAD,
 			      rect.mRight,
-			      rect.mTop - TEXT_PAD - llfloor(font->getLineHeight()));
+			      rect.mTop - TEXT_PAD - font->getLineHeight());
 	text_p.rect(new_r);
 	text_p.name(std::string(p.name));
 	text_p.font(font);
@@ -414,7 +414,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen
 		getRoot()->getFilter()->getShowFolderState();
 
 	S32 total_width = LEFT_PAD;
-	S32 running_height = mDebugFilters ? llceil(LLFontGL::getFontMonospace()->getLineHeight()) : 0;
+	S32 running_height = mDebugFilters ? LLFontGL::getFontMonospace()->getLineHeight() : 0;
 	S32 target_height = running_height;
 	S32 parent_item_height = getRect().getHeight();
 
@@ -1994,7 +1994,7 @@ void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constr
 		LLRect visible_doc_rect = mScrollContainer->getVisibleContentRect();
 		
 		S32 icon_height = mIcon.isNull() ? 0 : mIcon->getHeight(); 
-		S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); 
+		S32 label_height = getLabelFontForStyle(mLabelStyle)->getLineHeight(); 
 		// when navigating with keyboard, only move top of opened folder on screen, otherwise show whole folder
 		S32 max_height_to_show = item->isOpen() && mScrollContainer->hasFocus() ? (llmax( icon_height, label_height ) + ICON_PAD) : local_rect.getHeight(); 
 		
diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp
index 7e9c3c84a74..c0a323d6cb3 100644
--- a/indra/newview/llmemoryview.cpp
+++ b/indra/newview/llmemoryview.cpp
@@ -220,7 +220,7 @@ void LLMemoryView::draw()
 	S32 x, y;
 
 	S32 margin = 10;
-	S32 texth = (S32)LLFontGL::getFontMonospace()->getLineHeight();
+	S32 texth = LLFontGL::getFontMonospace()->getLineHeight();
 
 	S32 xleft = margin;
 	S32 ytop = height - margin;
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index de22f2ae6b7..e26d2e001c7 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -922,7 +922,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
 	S32 image_top = getRect().getHeight();
 	S32 image_bottom = BTN_HEIGHT_SMALL;
 	S32 image_middle = (image_top + image_bottom) / 2;
-	S32 line_height = llround(LLFontGL::getFontSansSerifSmall()->getLineHeight());
+	S32 line_height = LLFontGL::getFontSansSerifSmall()->getLineHeight();
 
 	LLTextBox::Params tentative_label_p(p.multiselect_text);
 	tentative_label_p.name("Multiple");
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 1c89766b267..5b41a05f2aa 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -386,7 +386,7 @@ class LLAvatarTexBar : public LLView
 		Params()
 		:	texture_view("texture_view")
 		{
-			S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+			S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 			changeDefault(rect, LLRect(0,0,100,line_height * 4));
 		}
 	};
@@ -411,7 +411,7 @@ void LLAvatarTexBar::draw()
 	LLVOAvatarSelf* avatarp = gAgentAvatarp;
 	if (!avatarp) return;
 
-	const S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+	const S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 	const S32 v_offset = 0;
 	const S32 l_offset = 3;
 
@@ -485,7 +485,7 @@ class LLGLTexMemBar : public LLView
 		Params()
 		:	texture_view("texture_view")
 		{
-			S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+			S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 			changeDefault(rect, LLRect(0,0,100,line_height * 4));
 		}
 	};
@@ -512,7 +512,7 @@ void LLGLTexMemBar::draw()
 	F32 discard_bias = LLViewerTexture::sDesiredDiscardBias;
 	F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ;
 	F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ;
-	S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+	S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 	S32 v_offset = (S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f);
 	F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024);
 	F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024);
@@ -1097,7 +1097,7 @@ void LLTextureSizeView::drawTextureSizeGraph()
 {
 	if(mTextureSizeBar.size() == 0)
 	{
-		S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+		S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 		mTextureSizeBar.resize(LLImageGL::sTextureLoadedCounter.size()) ;
 		mTextureSizeBarRect.set(700, line_height * 2 + 400, 700 + mTextureSizeBar.size() * mTextureSizeBarWidth, line_height * 2) ;
 		
@@ -1140,7 +1140,7 @@ F32 LLTextureSizeView::drawTextureSizeDistributionGraph()
 		}
 	}
 
-	S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+	S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 	S32 left = mTextureSizeBarRect.mLeft ;
 	S32 bottom = mTextureSizeBarRect.mBottom ;
 	S32 right = mTextureSizeBarRect.mRight ;
@@ -1222,7 +1222,7 @@ void LLTextureSizeView::drawTextureCategoryGraph()
 {
 	if(mTextureSizeBar.size() == 0)
 	{
-		S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+		S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 		mTextureSizeBar.resize(LLViewerTexture::getTotalNumOfCategories()) ;
 		mTextureSizeBarRect.set(700, line_height * 2 + 400, 700 + mTextureSizeBar.size() * mTextureSizeBarWidth, line_height * 2) ;
 		
@@ -1267,7 +1267,7 @@ F32 LLTextureSizeView::drawTextureCategoryDistributionGraph()
 		}
 	}
 
-	S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
+	S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
 	S32 left = mTextureSizeBarRect.mLeft ;
 	S32 bottom = mTextureSizeBarRect.mBottom ;
 	S32 right = mTextureSizeBarRect.mRight ;
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index 0f337825e92..12ad0717992 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -70,7 +70,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
 		mLineEditor(NULL)
 {
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
-	const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f);
+	const S32 LINE_HEIGHT = font->getLineHeight();
 	const S32 EDITOR_HEIGHT = 20;
 
 	LLNotificationFormPtr form = mNotification->getForm();
@@ -365,7 +365,7 @@ bool LLToastAlertPanel::setCheckBox( const std::string& check_title, const std::
 	}
 
 	const LLFontGL* font =  mCheck->getFont();
-	const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f);
+	const S32 LINE_HEIGHT = font->getLineHeight();
 	
 	// Extend dialog for "check next time"
 	S32 max_msg_width = LLToastPanel::getRect().getWidth() - 2 * HPAD;
diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp
index fc69157a408..d2a4ce8745a 100644
--- a/indra/newview/lltoastpanel.cpp
+++ b/indra/newview/lltoastpanel.cpp
@@ -68,7 +68,7 @@ void LLToastPanel::snapToMessageHeight(LLTextBase* message, S32 maxLineCount)
 	if (message->getVisible())
 	{
 		S32 heightDelta = 0;
-		S32 maxTextHeight = (S32)(message->getDefaultFont()->getLineHeight() * maxLineCount);
+		S32 maxTextHeight = message->getDefaultFont()->getLineHeight() * maxLineCount;
 
 		LLRect messageRect = message->getRect();
 		S32 oldTextHeight = messageRect.getHeight();
diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp
index df7c5be0d6d..e59064c0743 100644
--- a/indra/newview/lluploaddialog.cpp
+++ b/indra/newview/lluploaddialog.cpp
@@ -115,7 +115,7 @@ void LLUploadDialog::setMessage( const std::string& msg)
 		token = strtok( NULL, "\n" );
 	}
 
-	S32 line_height = S32( font->getLineHeight() + 0.99f );
+	S32 line_height = font->getLineHeight();
 	S32 dialog_width = max_msg_width + 2 * HPAD;
 	S32 dialog_height = line_height * msg_lines.size() + 2 * VPAD;
 
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index b41ed00f17c..99102309a16 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -187,7 +187,7 @@ class LLEmbeddedItemSegment : public LLTextSegment
 		else
 		{
 			width = EMBEDDED_ITEM_LABEL_PADDING + mImage->getWidth() + mStyle->getFont()->getWidth(mLabel.c_str());
-			height = llmax(mImage->getHeight(), llceil(mStyle->getFont()->getLineHeight()));
+			height = llmax(mImage->getHeight(), mStyle->getFont()->getLineHeight());
 		}
 		return false;
 	}
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index e50851b8e76..a20ee8686b3 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -513,7 +513,7 @@ void LLWorldMapView::draw()
 					 TRUE,
 					 "You are here",
 					 "",
-					 llround(LLFontGL::getFontSansSerifSmall()->getLineHeight())); // offset vertically by one line, to avoid overlap with target tracking
+					 LLFontGL::getFontSansSerifSmall()->getLineHeight()); // offset vertically by one line, to avoid overlap with target tracking
 	}
 
 	// Draw the current agent viewing angle
@@ -992,7 +992,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
 	const S32 TEXT_PADDING = DEFAULT_TRACKING_ARROW_SIZE + 2;
 	S32 half_text_width = llfloor(font->getWidthF32(label) * 0.5f);
 	text_x = llclamp(text_x, half_text_width + TEXT_PADDING, getRect().getWidth() - half_text_width - TEXT_PADDING);
-	text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - llround(font->getLineHeight()) - TEXT_PADDING - vert_offset);
+	text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - font->getLineHeight() - TEXT_PADDING - vert_offset);
 
 	if (label != "")
 	{
@@ -1005,7 +1005,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
 
 		if (tooltip != "")
 		{
-			text_y -= (S32)font->getLineHeight();
+			text_y -= font->getLineHeight();
 
 			font->renderUTF8(
 				tooltip, 0,
@@ -1203,7 +1203,7 @@ void LLWorldMapView::drawIconName(F32 x_pixels,
 		LLFontGL::NORMAL, 
 		LLFontGL::DROP_SHADOW);
 
-	text_y -= llround(LLFontGL::getFontSansSerif()->getLineHeight());
+	text_y -= LLFontGL::getFontSansSerif()->getLineHeight();
 
 	// render text
 	LLFontGL::getFontSansSerif()->renderUTF8(second_line, 0,
diff --git a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml
index 067c1fed824..0c41c3ba2fd 100644
--- a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml
@@ -7,7 +7,7 @@
  name="floater_test_toolbar"
  translate="false"
  width="500">
-  <toolbar name="test_toolbar_top"
+  <!--<toolbar name="test_toolbar_top"
            button_display_mode="icons_with_text"
            follows="left|right|top"
            height="50"
@@ -20,7 +20,7 @@
     <command name="avatar"/>
     <command name="build"/>
     <command name="chat"/>
-  </toolbar>
+  </toolbar>-->
   <toolbar name="test_toolbar_left"
            button_display_mode="icons_with_text"
            follows="left|bottom|top"
@@ -46,7 +46,7 @@
     <command name="build"/>
     <command name="chat"/>
   </toolbar>
-  <toolbar name="test_toolbar_bottom"
+  <!--<toolbar name="test_toolbar_bottom"
            button_display_mode="icons_with_text"
            follows="left|right|bottom"
            height="50"
@@ -58,5 +58,5 @@
     <command name="avatar"/>
     <command name="build"/>
     <command name="chat"/>
-  </toolbar>
+  </toolbar>-->
 </floater>
-- 
GitLab


From 178b30601b989aa98644c4e5c2ebcd9cd75490f7 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 31 Jan 2012 17:52:01 -0800
Subject: [PATCH 687/933] fixed layout_stack regression resulting in side
 toolbars being truncated

---
 indra/llui/lllayoutstack.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 88c2218f249..05261432e3c 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -129,7 +129,9 @@ void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientatio
 		? getRect().getWidth()
 		: getRect().getHeight()));
 
-	if (mAutoResize == FALSE && mMinDim == -1)
+	if (mAutoResize == FALSE 
+		&& mUserResize == TRUE 
+		&& mMinDim == -1 )
 	{
 		setMinDim(layout_dim);
 	}
-- 
GitLab


From 1404ba1ffa821c3ecc76cde254c5148fec66a2c0 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 1 Feb 2012 16:39:06 +0200
Subject: [PATCH 688/933] fixed Linux build

---
 indra/llui/lldraghandle.cpp | 2 +-
 indra/llui/lllineeditor.cpp | 2 +-
 indra/llui/llmenugl.cpp     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 42e6c3c7862..5f69c6af315 100644
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -244,7 +244,7 @@ void LLDragHandleTop::reshapeTitleBox()
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
 	S32 title_width = getRect().getWidth();
 	title_width -= LEFT_PAD + 2 * BORDER_PAD + getButtonsRect().getWidth();
-	S32 title_height = llround(font->getLineHeight());
+	S32 title_height = font->getLineHeight();
 	LLRect title_rect;
 	title_rect.setLeftTopAndSize( 
 		LEFT_PAD, 
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 06dfc90d83b..c53fb40ca2a 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1630,7 +1630,7 @@ void LLLineEditor::draw()
 	LLRect background( 0, getRect().getHeight(), getRect().getWidth(), 0 );
 	background.stretch( -mBorderThickness );
 
-	S32 lineeditor_v_pad = llround((background.getHeight() - mGLFont->getLineHeight())/2);
+	S32 lineeditor_v_pad = (background.getHeight() - mGLFont->getLineHeight())/2;
 
 	drawBackground();
 	
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 1db1dac2ec1..3e547efd97c 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -317,7 +317,7 @@ void LLMenuItemGL::setJumpKey(KEY key)
 // virtual 
 U32 LLMenuItemGL::getNominalHeight( void ) const 
 { 
-	return llround(mFont->getLineHeight()) + MENU_ITEM_PADDING; 
+	return mFont->getLineHeight() + MENU_ITEM_PADDING;
 }
 
 //virtual
-- 
GitLab


From b3960899066156bc7d3fd5befb2f7e687a328152 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 1 Feb 2012 17:15:22 +0200
Subject: [PATCH 689/933] EXP-1822 FIXED (After deleting an item from inventory
 and confirming "ok" to delete, focus leaves inventory)

-Return focus to the previously focused view
---
 indra/newview/lltoastalertpanel.cpp | 16 ++++++++++++++++
 indra/newview/lltoastalertpanel.h   |  1 +
 2 files changed, 17 insertions(+)

diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index 12ad0717992..ada7570776d 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -69,6 +69,15 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
 		mLabel(notification->getName()),
 		mLineEditor(NULL)
 {
+	// EXP-1822
+	// save currently focused view, so that return focus to it
+	// on destroying this toast.
+	LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus());
+	if (current_selection)
+	{
+		mPreviouslyFocusedView = current_selection->getHandle();
+	}
+
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
 	const S32 LINE_HEIGHT = font->getLineHeight();
 	const S32 EDITOR_HEIGHT = 20;
@@ -408,6 +417,13 @@ LLToastAlertPanel::~LLToastAlertPanel()
 {
 	LLTransientFloaterMgr::instance().removeControlView(
 			LLTransientFloaterMgr::GLOBAL, this);
+
+	// EXP-1822
+	// return focus to the previously focused view
+	if (mPreviouslyFocusedView.get())
+	{
+		gFocusMgr.setKeyboardFocus(mPreviouslyFocusedView.get());
+	}
 }
 
 BOOL LLToastAlertPanel::hasTitleBar() const
diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h
index 7b157f19bb1..d1be5e018ea 100644
--- a/indra/newview/lltoastalertpanel.h
+++ b/indra/newview/lltoastalertpanel.h
@@ -113,6 +113,7 @@ class LLToastAlertPanel
 	LLFrameTimer	mDefaultBtnTimer;
 	// For Dialogs that take a line as text as input:
 	LLLineEditor* mLineEditor;
+	LLHandle<LLView>	mPreviouslyFocusedView;
 
 };
 
-- 
GitLab


From 5a14a67e060e7f325025e924c83489cfa236e3dc Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 1 Feb 2012 13:03:46 -0800
Subject: [PATCH 690/933] converted a bunch of narrowing implicit conversions
 to explicit

---
 indra/llaudio/llaudiodecodemgr.cpp            |  2 +-
 indra/llcommon/linden_common.h                | 20 ++--------
 indra/llcommon/llevents.cpp                   |  4 +-
 indra/llcommon/llmd5.cpp                      |  2 +-
 indra/llcommon/llpreprocessor.h               |  3 +-
 indra/llcommon/llsdserialize.cpp              | 18 ++++-----
 indra/llcommon/llsdserialize_xml.cpp          |  2 +-
 indra/llcommon/llsdutil.h                     |  2 +-
 indra/llcommon/llstat.cpp                     |  2 +-
 indra/llcommon/lltimer.cpp                    |  2 +-
 indra/llcrashlogger/llcrashlogger.cpp         |  2 +-
 indra/llimage/llimagej2c.cpp                  |  8 ++--
 indra/llinventory/llinventory.cpp             |  4 +-
 indra/llmath/llcalcparser.h                   |  2 +-
 indra/llmath/llvolume.cpp                     |  4 +-
 indra/llmath/m4math.cpp                       | 38 +++++++++----------
 indra/llmessage/llbufferstream.cpp            |  4 +-
 indra/llmessage/llcurl.cpp                    |  4 +-
 indra/llmessage/llhttpclient.cpp              |  2 +-
 indra/llmessage/llmime.cpp                    |  4 +-
 indra/llmessage/llsdmessage.cpp               |  2 +-
 indra/llmessage/llsdmessagebuilder.cpp        |  2 +-
 indra/llmessage/message.cpp                   |  6 +--
 indra/llrender/llfontgl.cpp                   | 26 ++++++-------
 indra/llui/lldraghandle.cpp                   |  2 +-
 indra/llvfs/lllfsthread.cpp                   |  2 +-
 indra/llvfs/llvfsthread.cpp                   |  2 +-
 indra/llxml/llxmlnode.cpp                     |  2 +-
 .../quicktime/media_plugin_quicktime.cpp      |  6 +--
 .../webkit/media_plugin_webkit.cpp            | 24 ++++++------
 indra/newview/tests/llworldmipmap_test.cpp    |  4 +-
 .../updater/llupdaterservice.cpp              |  2 +-
 32 files changed, 99 insertions(+), 110 deletions(-)

diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index f0b44f97d28..7f747c2eca7 100644
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -215,7 +215,7 @@ BOOL LLVorbisDecodeState::initDecode()
 		return(FALSE);
 	}
 	
-	S32 sample_count = ov_pcm_total(&mVF, -1);
+	S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
 	size_t size_guess = (size_t)sample_count;
 	vorbis_info* vi = ov_info(&mVF, -1);
 	size_guess *= (vi? vi->channels : 1);
diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h
index bdcc98e4020..2e4885403ea 100644
--- a/indra/llcommon/linden_common.h
+++ b/indra/llcommon/linden_common.h
@@ -52,24 +52,12 @@
 #include <ctime>
 #include <iosfwd>
 
-// Work around Microsoft compiler warnings in STL headers
-#ifdef LL_WINDOWS
-#pragma warning (disable : 4702) // unreachable code
-#pragma warning (disable : 4244) // conversion from time_t to S32
-#endif	//	LL_WINDOWS
-
 // *TODO: Eliminate these, most library .cpp files don't need them.
 // Add them to llviewerprecompiledheaders.h if necessary.
-#include <list>
-#include <map>
-#include <vector>
-#include <string>
-
-#ifdef LL_WINDOWS
-// Reenable warnings we disabled above
-#pragma warning (3 : 4702) // unreachable code, we like level 3, not 4
-// moved msvc warnings to llpreprocessor.h  *TODO - delete this comment after merge conflicts are unlikely -brad
-#endif	//	LL_WINDOWS
+//#include <list>
+//#include <map>
+//#include <vector>
+//#include <string>
 
 // Linden only libs in alpha-order other than stdtypes.h
 // *NOTE: Please keep includes here to a minimum, see above.
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index db1ea4792b3..0855180dcd6 100644
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -430,13 +430,13 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL
     {
         // The new node isn't last. Place it between the previous node and
         // the successor.
-        newNode = (myprev + mydmi->second)/2.0;
+        newNode = (myprev + mydmi->second)/2.f;
     }
     else
     {
         // The new node is last. Bump myprev up to the next integer, add
         // 1.0 and use that.
-        newNode = std::ceil(myprev) + 1.0;
+        newNode = std::ceil(myprev) + 1.f;
     }
     // Now that newNode has a value that places it appropriately in mSignal,
     // connect it.
diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp
index 75fde8e5bae..1409c55d1c5 100644
--- a/indra/llcommon/llmd5.cpp
+++ b/indra/llcommon/llmd5.cpp
@@ -175,7 +175,7 @@ void LLMD5::update(std::istream& stream){
 
   while (stream.good()){
     stream.read( (char*)buffer, BLOCK_LEN); 	/* Flawfinder: ignore */		// note that return value of read is unusable.
-    len=stream.gcount();
+    len=(int)stream.gcount();
     update(buffer, len);
   }
 
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 31d5f3d2c7e..7fdb537ab52 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -132,7 +132,7 @@
 #pragma warning( 3       : 4265 )	// "class has virtual functions, but destructor is not virtual"
 #pragma warning( 3      :  4266 )	// 'function' : no override available for virtual member function from base 'type'; function is hidden
 #pragma warning (disable : 4180)	// qualifier applied to function type has no meaning; ignored
-#pragma warning( disable : 4284 )	// silly MS warning deep inside their <map> include file
+//#pragma warning( disable : 4284 )	// silly MS warning deep inside their <map> include file
 #pragma warning( disable : 4503 )	// 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
 #pragma warning( disable : 4800 )	// 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
 #pragma warning( disable : 4996 )	// warning: deprecated
@@ -152,6 +152,7 @@
 #pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
 #pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
 #pragma warning (disable : 4018) // '<' : signed/unsigned mismatch	
+
 #endif	//	LL_MSVC
 
 #if LL_WINDOWS
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index bf626005143..b419101b7e5 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -110,7 +110,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
 	if (!strncasecmp(LEGACY_NON_HEADER, hdr_buf, strlen(LEGACY_NON_HEADER))) /* Flawfinder: ignore */
 	{
 		legacy_no_header = true;
-		inbuf = str.gcount();
+		inbuf = (int)str.gcount();
 	}
 	else
 	{
@@ -343,7 +343,7 @@ std::istream& LLSDParser::get(
 	char delim) const
 {
 	istr.get(s, n, delim);
-	if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
+	if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
 	return istr;
 }
 
@@ -353,7 +353,7 @@ std::istream& LLSDParser::get(
 		char delim) const		
 {
 	istr.get(sb, delim);
-	if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
+	if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
 	return istr;
 }
 
@@ -377,7 +377,7 @@ std::istream& LLSDParser::read(
 	std::streamsize n) const
 {
 	istr.read(s, n);
-	if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
+	if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
 	return istr;
 }
 
@@ -789,7 +789,7 @@ bool LLSDNotationParser::parseBinary(std::istream& istr, LLSD& data) const
 		if(len)
 		{
 			value.resize(len);
-			account(fullread(istr, (char *)&value[0], len));
+			account((int)fullread(istr, (char *)&value[0], len));
 		}
 		c = get(istr); // strip off the trailing double-quote
 		data = value;
@@ -1069,7 +1069,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
 			if(size > 0)
 			{
 				value.resize(size);
-				account(fullread(istr, (char*)&value[0], size));
+				account((int)fullread(istr, (char*)&value[0], size));
 			}
 			data = value;
 		}
@@ -1200,7 +1200,7 @@ bool LLSDBinaryParser::parseString(
 	if(size)
 	{
 		buf.resize(size);
-		account(fullread(istr, &buf[0], size));
+		account((int)fullread(istr, &buf[0], size));
 		value.assign(buf.begin(), buf.end());
 	}
 	return true;
@@ -1642,7 +1642,7 @@ int deserialize_string_raw(
 	const S32 BUF_LEN = 20;
 	char buf[BUF_LEN];		/* Flawfinder: ignore */
 	istr.get(buf, BUF_LEN - 1, ')');
-	count += istr.gcount();
+	count += (int)istr.gcount();
 	int c = istr.get();
 	c = istr.get();
 	count += 2;
@@ -1657,7 +1657,7 @@ int deserialize_string_raw(
 		if(len)
 		{
 			buf.resize(len);
-			count += fullread(istr, (char *)&buf[0], len);
+			count += (int)fullread(istr, (char *)&buf[0], len);
 			value.assign(buf.begin(), buf.end());
 		}
 		c = istr.get();
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp
index be9db539068..34b3dbb99a3 100644
--- a/indra/llcommon/llsdserialize_xml.cpp
+++ b/indra/llcommon/llsdserialize_xml.cpp
@@ -464,7 +464,7 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data)
 			}
 		}
 
-		status = XML_ParseBuffer(mParser, num_read, false);
+		status = XML_ParseBuffer(mParser, (int)num_read, false);
 		if (status == XML_STATUS_ERROR)
 		{
 			break;
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index 65c7297cbf8..532d3f93413 100644
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -308,7 +308,7 @@ class LLSDParam<T>                              \
 {                                               \
 public:                                         \
     LLSDParam(const LLSD& value):               \
-        _value(value.AS())                      \
+        _value((T)value.AS())                      \
     {}                                          \
                                                 \
     operator T() const { return _value; }       \
diff --git a/indra/llcommon/llstat.cpp b/indra/llcommon/llstat.cpp
index b2c495d093e..057257057f5 100644
--- a/indra/llcommon/llstat.cpp
+++ b/indra/llcommon/llstat.cpp
@@ -593,7 +593,7 @@ void LLStatTime::stop()
 {
     if ( LLStatAccum::SCALE_PER_FRAME == scale )
     {
-        return mTotalTimeInFrame;
+        return (F32)mTotalTimeInFrame;
     }
     else
     {
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index 38054b636ea..9ebc6de7f40 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -83,7 +83,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
 {
     // max_yields is unused; just fiddle with it to avoid warnings.
     max_yields = 0;
-    ms_sleep(us / 1000);
+	ms_sleep((U32)(us / 1000));
     return 0;
 }
 #elif LL_LINUX || LL_SOLARIS || LL_DARWIN
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index 3461aa3e6cc..d6dcde4b9fa 100644
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -250,7 +250,7 @@ void LLCrashLogger::gatherFiles()
 		if(minidump_stream.is_open())
 		{
 			minidump_stream.seekg(0, std::ios::end);
-			size_t length = minidump_stream.tellg();
+			size_t length = (size_t)minidump_stream.tellg();
 			minidump_stream.seekg(0, std::ios::beg);
 			
 			LLSD::Binary data;
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index cc8cb66d739..8241746a745 100644
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
@@ -501,10 +501,10 @@ void LLImageCompressionTester::outputTestRecord(LLSD *sd)
 	F32 decompressionRate = 0.0f;
 	F32 compressionRate   = 0.0f;
 
-	F32 totalkBInDecompression  = (F32)(mTotalBytesInDecompression)  / 1000.0;
-	F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.0;
-	F32 totalkBInCompression    = (F32)(mTotalBytesInCompression)    / 1000.0;
-	F32 totalkBOutCompression   = (F32)(mTotalBytesOutCompression)   / 1000.0;
+	F32 totalkBInDecompression  = (F32)(mTotalBytesInDecompression)  / 1000.f;
+	F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.f;
+	F32 totalkBInCompression    = (F32)(mTotalBytesInCompression)    / 1000.f;
+	F32 totalkBOutCompression   = (F32)(mTotalBytesOutCompression)   / 1000.f;
 	
 	if (!is_approx_zero(mTotalTimeDecompression))
 	{
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 76760aa4143..fbf23bc3f09 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -405,7 +405,7 @@ U32 LLInventoryItem::getCRC32() const
 	//lldebugs << "7 crc: " << std::hex << crc << std::dec << llendl;
 	crc += mSaleInfo.getCRC32();
 	//lldebugs << "8 crc: " << std::hex << crc << std::dec << llendl;
-	crc += mCreationDate;
+	crc += (U32)mCreationDate;
 	//lldebugs << "9 crc: " << std::hex << crc << std::dec << llendl;
 	return crc;
 }
@@ -521,7 +521,7 @@ void LLInventoryItem::packMessage(LLMessageSystem* msg) const
 	mSaleInfo.packMessage(msg);
 	msg->addStringFast(_PREHASH_Name, mName);
 	msg->addStringFast(_PREHASH_Description, mDescription);
-	msg->addS32Fast(_PREHASH_CreationDate, mCreationDate);
+	msg->addS32Fast(_PREHASH_CreationDate, (S32)mCreationDate);
 	U32 crc = getCRC32();
 	msg->addU32Fast(_PREHASH_CRC, crc);
 }
diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h
index bd9c8c25191..3509bd289b7 100644
--- a/indra/llmath/llcalcparser.h
+++ b/indra/llmath/llcalcparser.h
@@ -174,7 +174,7 @@ struct LLCalcParser : grammar<LLCalcParser>
 	F32 _log(const F32& a) const { return log(a); }
 	F32 _exp(const F32& a) const { return exp(a); }
 	F32 _fabs(const F32& a) const { return fabs(a); }
-	F32 _floor(const F32& a) const { return llfloor(a); }
+	F32 _floor(const F32& a) const { return (F3)llfloor(a); }
 	F32 _ceil(const F32& a) const { return llceil(a); }
 
 	F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 0c6cf1dfae1..f08657a75c3 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2903,7 +2903,7 @@ F32 LLVolume::sculptGetSurfaceArea()
 			// compute the area of the quad by taking the length of the cross product of the two triangles
 			LLVector3 cross1 = (p1 - p2) % (p1 - p3);
 			LLVector3 cross2 = (p4 - p2) % (p4 - p3);
-			area += (cross1.magVec() + cross2.magVec()) / 2.0;
+			area += (cross1.magVec() + cross2.magVec()) / 2.f;
 		}
 	}
 
@@ -5887,7 +5887,7 @@ F32 find_vertex_score(LLVCacheVertexData& data)
 	}
 
 	//bonus points for having low valence
-	F32 valence_boost = powf(data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
+	F32 valence_boost = powf((F32)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
 	score += FindVertexScore_ValenceBoostScale * valence_boost;
 
 	return score;
diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp
index bad4deb4dee..6a1b4143cfd 100644
--- a/indra/llmath/m4math.cpp
+++ b/indra/llmath/m4math.cpp
@@ -858,25 +858,25 @@ LLSD LLMatrix4::getValue() const
 
 void LLMatrix4::setValue(const LLSD& data) 
 {
-	mMatrix[0][0] = data[0].asReal();
-	mMatrix[0][1] = data[1].asReal();
-	mMatrix[0][2] = data[2].asReal();
-	mMatrix[0][3] = data[3].asReal();
-
-	mMatrix[1][0] = data[4].asReal();
-	mMatrix[1][1] = data[5].asReal();
-	mMatrix[1][2] = data[6].asReal();
-	mMatrix[1][3] = data[7].asReal();
-
-	mMatrix[2][0] = data[8].asReal();
-	mMatrix[2][1] = data[9].asReal();
-	mMatrix[2][2] = data[10].asReal();
-	mMatrix[2][3] = data[11].asReal();
-
-	mMatrix[3][0] = data[12].asReal();
-	mMatrix[3][1] = data[13].asReal();
-	mMatrix[3][2] = data[14].asReal();
-	mMatrix[3][3] = data[15].asReal();
+	mMatrix[0][0] = (F32)data[0].asReal();
+	mMatrix[0][1] = (F32)data[1].asReal();
+	mMatrix[0][2] = (F32)data[2].asReal();
+	mMatrix[0][3] = (F32)data[3].asReal();
+
+	mMatrix[1][0] = (F32)data[4].asReal();
+	mMatrix[1][1] = (F32)data[5].asReal();
+	mMatrix[1][2] = (F32)data[6].asReal();
+	mMatrix[1][3] = (F32)data[7].asReal();
+
+	mMatrix[2][0] = (F32)data[8].asReal();
+	mMatrix[2][1] = (F32)data[9].asReal();
+	mMatrix[2][2] = (F32)data[10].asReal();
+	mMatrix[2][3] = (F32)data[11].asReal();
+
+	mMatrix[3][0] = (F32)data[12].asReal();
+	mMatrix[3][1] = (F32)data[13].asReal();
+	mMatrix[3][2] = (F32)data[14].asReal();
+	mMatrix[3][3] = (F32)data[15].asReal();
 }
 
 
diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp
index 6257983c436..bb65d166706 100644
--- a/indra/llmessage/llbufferstream.cpp
+++ b/indra/llmessage/llbufferstream.cpp
@@ -273,7 +273,7 @@ streampos LLBufferStreamBuf::seekoff(
 			// NULL is fine
 			break;
 		}
-		address = mBuffer->seek(mChannels.in(), base_addr, off);
+		address = (S32)mBuffer->seek(mChannels.in(), base_addr, off);
 		if(address)
 		{
 			LLBufferArray::segment_iterator_t iter;
@@ -304,7 +304,7 @@ streampos LLBufferStreamBuf::seekoff(
 			// NULL is fine
 			break;
 		}
-		address = mBuffer->seek(mChannels.out(), base_addr, off);
+		address = (S32)mBuffer->seek(mChannels.out(), base_addr, off);
 		if(address)
 		{
 			LLBufferArray::segment_iterator_t iter;
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index e17380fdf5e..344463f036d 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -428,9 +428,9 @@ size_t curlReadCallback(char* data, size_t size, size_t nmemb, void* user_data)
 	LLCurl::Easy* easy = (LLCurl::Easy*)user_data;
 	
 	S32 n = size * nmemb;
-	S32 startpos = easy->getInput().tellg();
+	S32 startpos = (S32)easy->getInput().tellg();
 	easy->getInput().seekg(0, std::ios::end);
-	S32 endpos = easy->getInput().tellg();
+	S32 endpos = (S32)easy->getInput().tellg();
 	easy->getInput().seekg(startpos, std::ios::beg);
 	S32 maxn = endpos - startpos;
 	n = llmin(n, maxn);
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index dd4e3a63007..98983ad28aa 100644
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -158,7 +158,7 @@ namespace
 			if(fstream.is_open())
 			{
 				fstream.seekg(0, std::ios::end);
-				U32 fileSize = fstream.tellg();
+				U32 fileSize = (U32)fstream.tellg();
 				fstream.seekg(0, std::ios::beg);
 				std::vector<char> fileBuffer(fileSize);
 				fstream.read(&fileBuffer[0], fileSize);
diff --git a/indra/llmessage/llmime.cpp b/indra/llmessage/llmime.cpp
index 943a734927b..9d9c4ebd689 100644
--- a/indra/llmessage/llmime.cpp
+++ b/indra/llmessage/llmime.cpp
@@ -388,7 +388,7 @@ bool LLMimeParser::Impl::parseHeaders(
 		// not to read past limit when we get() the newline.
 		S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
 		istr.getline(mBuffer, max_get, '\r');
-		mScanCount += istr.gcount();
+		mScanCount += (S32)istr.gcount();
 		int c = istr.get();
 		if(EOF == c)
 		{
@@ -496,7 +496,7 @@ void LLMimeParser::Impl::scanPastSeparator(
 		// past limit when we get() the newline.
 		S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
 		istr.getline(mBuffer, max_get, '\r');
-		mScanCount += istr.gcount();
+		mScanCount += (S32)istr.gcount();
 		if(istr.gcount() >= LINE_BUFFER_LENGTH - 1)
 		{
 			// that's way too long to be a separator, so ignore it.
diff --git a/indra/llmessage/llsdmessage.cpp b/indra/llmessage/llsdmessage.cpp
index 9148c9dd150..1c93c12d990 100644
--- a/indra/llmessage/llsdmessage.cpp
+++ b/indra/llmessage/llsdmessage.cpp
@@ -88,7 +88,7 @@ bool LLSDMessage::httpListener(const LLSD& request)
                                                        request,
                                                        url, "POST", reply, error),
                        LLSD(),      // headers
-                       timeout);
+                       (F32)timeout);
     return false;
 }
 
diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp
index 2698a271ee9..615221e0ad0 100644
--- a/indra/llmessage/llsdmessagebuilder.cpp
+++ b/indra/llmessage/llsdmessagebuilder.cpp
@@ -317,7 +317,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data)
 
 			// S64 not supported in LLSD so we just truncate it
 			case MVT_S64:
-				addS32(varname, *(S64*)mvci.getData());
+				addS32(varname, (S32)*(S64*)mvci.getData());
 				break;
 
 			case MVT_F32:
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index d0b0e178b83..6a425cfe98a 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -3147,7 +3147,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi
 		LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl;
 	}
 
-	U32 now = time(NULL);
+	U32 now = (U32)time(NULL);
 
 	now /= window;
 
@@ -3167,7 +3167,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons
 	}
 	
 	char our_digest[MD5HEX_STR_SIZE];	/* Flawfinder: ignore */
-	U32 now = time(NULL);
+	U32 now = (U32)time(NULL);
 
 	now /= window;
 
@@ -3213,7 +3213,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co
 		LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl;
 	}
 
-	U32 now = time(NULL);
+	U32 now = (U32)time(NULL);
 
 	now /= window;
 
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 4eb10b2c931..4519c5e7894 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -115,23 +115,23 @@ static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts");
 S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, 
 					 ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const
 {
-	F32 x = rect.mLeft;
+	F32 x = (F32)rect.mLeft;
 	F32 y = 0.f;
 
 	switch(valign)
 	{
 	case TOP:
-		y = rect.mTop;
+		y = (F32)rect.mTop;
 		break;
 	case VCENTER:
-		y = rect.getCenterY();
+		y = (F32)rect.getCenterY();
 		break;
 	case BASELINE:
 	case BOTTOM:
-		y = rect.mBottom;
+		y = (F32)rect.mBottom;
 		break;
 	default:
-		y = rect.mBottom;
+		y = (F32)rect.mBottom;
 		break;
 	}
 	return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses);
@@ -251,7 +251,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	cur_render_y = cur_y;
 	cur_render_x = cur_x;
 
-	F32 start_x = llround(cur_x);
+	F32 start_x = (F32)llround(cur_x);
 
 	const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
 
@@ -335,10 +335,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 				(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
 				(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
 		// snap glyph origin to whole screen pixel
-		LLRectf screen_rect(llround(cur_render_x + (F32)fgi->mXBearing),
-				    llround(cur_render_y + (F32)fgi->mYBearing),
-				    llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
-				    llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
+		LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing),
+				    (F32)llround(cur_render_y + (F32)fgi->mYBearing),
+				    (F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
+				    (F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
 		
 		if (glyph_count >= GLYPH_BATCH_SIZE)
 		{
@@ -636,7 +636,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
 		}
 
 		// Round after kerning.
-		cur_x = llround(cur_x);
+		cur_x = (F32)llround(cur_x);
 		drawn_x = cur_x;
 	}
 
@@ -707,7 +707,7 @@ S32	LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
 		}
 
 		// Round after kerning.
-		total_width = llround(total_width);
+		total_width = (F32)llround(total_width);
 	}
 
 	if (drawable_chars == 0)
@@ -790,7 +790,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
 
 
 		// Round after kerning.
-		cur_x = llround(cur_x);
+		cur_x = (F32)llround(cur_x);
 	}
 
 	return llmin(max_chars, pos - begin_offset);
diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 5f69c6af315..42e6c3c7862 100644
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -244,7 +244,7 @@ void LLDragHandleTop::reshapeTitleBox()
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
 	S32 title_width = getRect().getWidth();
 	title_width -= LEFT_PAD + 2 * BORDER_PAD + getButtonsRect().getWidth();
-	S32 title_height = font->getLineHeight();
+	S32 title_height = llround(font->getLineHeight());
 	LLRect title_rect;
 	title_rect.setLeftTopAndSize( 
 		LEFT_PAD, 
diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp
index 3d3ed9f6d4d..073b1af2a1b 100644
--- a/indra/llvfs/lllfsthread.cpp
+++ b/indra/llvfs/lllfsthread.cpp
@@ -45,7 +45,7 @@ void LLLFSThread::initClass(bool local_is_threaded)
 //static
 S32 LLLFSThread::updateClass(U32 ms_elapsed)
 {
-	sLocal->update(ms_elapsed);
+	sLocal->update((F32)ms_elapsed);
 	return sLocal->getPending();
 }
 
diff --git a/indra/llvfs/llvfsthread.cpp b/indra/llvfs/llvfsthread.cpp
index 254f8b55ba3..a57e2b15abc 100644
--- a/indra/llvfs/llvfsthread.cpp
+++ b/indra/llvfs/llvfsthread.cpp
@@ -46,7 +46,7 @@ void LLVFSThread::initClass(bool local_is_threaded)
 //static
 S32 LLVFSThread::updateClass(U32 ms_elapsed)
 {
-	sLocal->update(ms_elapsed);
+	sLocal->update((F32)ms_elapsed);
 	return sLocal->getPending();
 }
 
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 3d4e6f9a0bd..2ffb0d8503c 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -801,7 +801,7 @@ bool LLXMLNode::parseStream(
 	while(str.good())
 	{
 		str.read((char*)buffer, BUFSIZE);
-		int count = str.gcount();
+		int count = (int)str.gcount();
 		
 		if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK)
 		{
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index 999f754dcf8..24328202cb1 100644
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -705,7 +705,7 @@ class MediaPluginQuickTime : public MediaPluginBase
 		// look up "Display Name" in meta data
 		OSType meta_data_key = kQTMetaDataCommonKeyDisplayName;
 		QTMetaDataItem item = kQTMetaDataItemUninitialized;
-		result = QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard, 
+		result = (OSErr)QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard, 
 										0, kQTMetaDataKeyFormatCommon, 
 										(const UInt8 *)&meta_data_key, 
 										sizeof( meta_data_key ), &item );
@@ -714,14 +714,14 @@ class MediaPluginQuickTime : public MediaPluginBase
 
 		// find the size of the title
 		ByteCount size;
-		result = QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
+		result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
 		if ( noErr != result || size <= 0 /*|| size > 1024  FIXME: arbitrary limit */ ) 
 			return false;
 
 		// allocate some space and grab it
 		UInt8* item_data = new UInt8[ size + 1 ];
 		memset( item_data, 0, ( size + 1 ) * sizeof( UInt8 ) );
-		result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
+		result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
 		if ( noErr != result ) 
 		{
 			delete [] item_data;
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 47f8dcd5459..1812abd7d54 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -991,7 +991,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 		{
 			if(message_name == "set_volume")
 			{
-				F32 volume = message_in.getValueReal("volume");
+				F32 volume = (F32)message_in.getValueReal("volume");
 				setVolume(volume);
 			}
 		}
@@ -1057,9 +1057,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 				S32 height = message_in.getValueS32("height");
 				S32 texture_width = message_in.getValueS32("texture_width");
 				S32 texture_height = message_in.getValueS32("texture_height");
-				mBackgroundR = message_in.getValueReal("background_r");
-				mBackgroundG = message_in.getValueReal("background_g");
-				mBackgroundB = message_in.getValueReal("background_b");
+				mBackgroundR = (F32)message_in.getValueReal("background_r");
+				mBackgroundG = (F32)message_in.getValueReal("background_g");
+				mBackgroundB = (F32)message_in.getValueReal("background_b");
 //				mBackgroundA = message_in.setValueReal("background_a");		// Ignore any alpha
 								
 				if(!name.empty())
@@ -1245,9 +1245,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 			if(message_name == "js_agent_location")
 			{
 #if LLQTWEBKIT_API_VERSION >= 9
-				F32 x = message_in.getValueReal("x");
-				F32 y = message_in.getValueReal("y");
-				F32 z = message_in.getValueReal("z");
+				F32 x = (F32)message_in.getValueReal("x");
+				F32 y = (F32)message_in.getValueReal("y");
+				F32 z = (F32)message_in.getValueReal("z");
 				LLQtWebKit::getInstance()->setAgentLocation( x, y, z );
 				LLQtWebKit::getInstance()->emitLocation();
 #endif
@@ -1256,9 +1256,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 			if(message_name == "js_agent_global_location")
 			{
 #if LLQTWEBKIT_API_VERSION >= 9
-				F32 x = message_in.getValueReal("x");
-				F32 y = message_in.getValueReal("y");
-				F32 z = message_in.getValueReal("z");
+				F32 x = (F32)message_in.getValueReal("x");
+				F32 y = (F32)message_in.getValueReal("y");
+				F32 z = (F32)message_in.getValueReal("z");
 				LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z );
 				LLQtWebKit::getInstance()->emitLocation();
 #endif
@@ -1267,7 +1267,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 			if(message_name == "js_agent_orientation")
 			{
 #if LLQTWEBKIT_API_VERSION >= 9
-				F32 angle = message_in.getValueReal("angle");
+				F32 angle = (F32)message_in.getValueReal("angle");
 				LLQtWebKit::getInstance()->setAgentOrientation( angle );
 				LLQtWebKit::getInstance()->emitLocation();
 #endif
@@ -1323,7 +1323,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 			else if(message_name == "set_page_zoom_factor")
 			{
 #if LLQTWEBKIT_API_VERSION >= 15
-				F32 factor = message_in.getValueReal("factor");
+				F32 factor = (F32)message_in.getValueReal("factor");
 				LLQtWebKit::getInstance()->setPageZoomFactor(factor);
 #else
 				llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl;
diff --git a/indra/newview/tests/llworldmipmap_test.cpp b/indra/newview/tests/llworldmipmap_test.cpp
index 4c0959d1a93..e7ef0177608 100644
--- a/indra/newview/tests/llworldmipmap_test.cpp
+++ b/indra/newview/tests/llworldmipmap_test.cpp
@@ -100,9 +100,9 @@ namespace tut
 	{
 		S32 level = mMap->scaleToLevel(0.0);
 		ensure("scaleToLevel() test 1 failed", level == LLWorldMipmap::MAP_LEVELS);
-		level = mMap->scaleToLevel(LLWorldMipmap::MAP_TILE_SIZE);
+		level = mMap->scaleToLevel((F32)LLWorldMipmap::MAP_TILE_SIZE);
 		ensure("scaleToLevel() test 2 failed", level == 1);
-		level = mMap->scaleToLevel(10 * LLWorldMipmap::MAP_TILE_SIZE);
+		level = mMap->scaleToLevel(10.f * LLWorldMipmap::MAP_TILE_SIZE);
 		ensure("scaleToLevel() test 3 failed", level == 1);
 	}
 	// Test 2 : globalToMipmap()
diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp
index 1888f191e2f..2e18218667c 100644
--- a/indra/viewer_components/updater/llupdaterservice.cpp
+++ b/indra/viewer_components/updater/llupdaterservice.cpp
@@ -447,7 +447,7 @@ void LLUpdaterServiceImpl::restartTimer(unsigned int seconds)
 	LL_INFOS("UpdaterService") << "will check for update again in " << 
 	seconds << " seconds" << LL_ENDL; 
 	mTimer.start();
-	mTimer.setTimerExpirySec(seconds);
+	mTimer.setTimerExpirySec((F32)seconds);
 	LLEventPumps::instance().obtain("mainloop").listen(
 		sListenerName, boost::bind(&LLUpdaterServiceImpl::onMainLoop, this, _1));
 }
-- 
GitLab


From 7314ac3a37d624e6a750fc12df64d08b584ad593 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 1 Feb 2012 23:44:25 +0200
Subject: [PATCH 691/933] EXP-1672 FIXED Various fixes to prevent crashes in
 notifications. - Refactoring of LLToast and LLScreenChannel classes: moved
 LLToast signals to the private section. - Modified the screen channel's lists
 of toasts to store LLHandles instead of pointers and screen channel code to
 work with toast LLHandles.

---
 indra/newview/llinspecttoast.cpp  |   2 +
 indra/newview/llscreenchannel.cpp | 289 ++++++++++++++++++++----------
 indra/newview/llscreenchannel.h   |  30 ++--
 indra/newview/lltoast.cpp         |   7 +
 indra/newview/lltoast.h           |  29 +--
 5 files changed, 239 insertions(+), 118 deletions(-)

diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp
index d7b82667d17..f4fe5dec014 100644
--- a/indra/newview/llinspecttoast.cpp
+++ b/indra/newview/llinspecttoast.cpp
@@ -72,6 +72,8 @@ LLInspectToast::LLInspectToast(const LLSD& notification_id) :
 LLInspectToast::~LLInspectToast()
 {
 	LLTransientFloaterMgr::getInstance()->removeControlView(this);
+
+	mConnection.disconnect();
 }
 
 // virtual
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 5301955964b..1045009a048 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -195,17 +195,18 @@ LLScreenChannel::~LLScreenChannel()
 	
 }
 
-std::list<LLToast*> LLScreenChannel::findToasts(const Matcher& matcher)
+std::list<const LLToast*> LLScreenChannel::findToasts(const Matcher& matcher)
 {
-	std::list<LLToast*> res;
+	std::list<const LLToast*> res;
 
 	// collect stored toasts
 	for (std::vector<ToastElem>::iterator it = mStoredToastList.begin(); it
 			!= mStoredToastList.end(); it++)
 	{
-		if (matcher.matches(it->toast->getNotification()))
+		const LLToast* toast = it->getToast();
+		if (toast && matcher.matches(toast->getNotification()))
 		{
-			res.push_back(it->toast);
+			res.push_back(toast);
 		}
 	}
 
@@ -213,9 +214,10 @@ std::list<LLToast*> LLScreenChannel::findToasts(const Matcher& matcher)
 	for (std::vector<ToastElem>::iterator it = mToastList.begin(); it
 			!= mToastList.end(); it++)
 	{
-		if (matcher.matches(it->toast->getNotification()))
+		const LLToast* toast = it->getToast();
+		if (toast && matcher.matches(toast->getNotification()))
 		{
-			res.push_back(it->toast);
+			res.push_back(toast);
 		}
 	}
 
@@ -260,15 +262,16 @@ void LLScreenChannel::addToast(const LLToast::Params& p)
 		return;
 	}
 
-	ToastElem new_toast_elem(p);
+	LLToast* toast = new LLToast(p);
+	ToastElem new_toast_elem(toast->getHandle());
 
-	new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, _1));
-	new_toast_elem.toast->setOnToastDestroyedCallback(boost::bind(&LLScreenChannel::onToastDestroyed, this, _1));
+	toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, _1));
+	toast->setOnToastDestroyedCallback(boost::bind(&LLScreenChannel::onToastDestroyed, this, _1));
 	if(mControlHovering)
 	{
-		new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2));
-		new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopToastTimer, this, new_toast_elem.toast));
-		new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startToastTimer, this, new_toast_elem.toast));
+		toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2));
+		toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopToastTimer, this, toast));
+		toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startToastTimer, this, toast));
 	}
 	
 	if(show_toast)
@@ -324,8 +327,8 @@ void LLScreenChannel::onToastFade(LLToast* toast)
 		bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored();
 		if(delete_toast)
 		{
-			mToastList.erase(it);
 			deleteToast(toast);
+			mToastList.erase(it);
 		}
 		else
 		{
@@ -340,13 +343,13 @@ void LLScreenChannel::onToastFade(LLToast* toast)
 //--------------------------------------------------------------------------
 void LLScreenChannel::deleteToast(LLToast* toast)
 {
-	if (toast->isDead())
+	if (!toast || toast->isDead())
 	{
 		return;
 	}
 
 	// send signal to observers about destroying of a toast
-	toast->mOnDeleteToastSignal(toast);
+	toast->closeToast();
 	
 	// update channel's Hovering state
 	// turning hovering off manually because onMouseLeave won't happen if a toast was closed using a keyboard
@@ -354,9 +357,6 @@ void LLScreenChannel::deleteToast(LLToast* toast)
 	{
 		mHoveredToast  = NULL;
 	}
-
-	// close the toast
-	toast->closeFloater();
 }
 
 //--------------------------------------------------------------------------
@@ -364,12 +364,16 @@ void LLScreenChannel::deleteToast(LLToast* toast)
 void LLScreenChannel::storeToast(ToastElem& toast_elem)
 {
 	// do not store clones
-	std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(), mStoredToastList.end(), toast_elem.id);
+	std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(), mStoredToastList.end(), toast_elem.getID());
 	if( it != mStoredToastList.end() )
 		return;
 
-	mStoredToastList.push_back(toast_elem);
-	mOnStoreToast(toast_elem.toast->getPanel(), toast_elem.id);
+	const LLToast* toast = toast_elem.getToast();
+	if (toast)
+	{
+		mStoredToastList.push_back(toast_elem);
+		mOnStoreToast(toast->getPanel(), toast->getNotificationID());
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -382,9 +386,13 @@ void LLScreenChannel::loadStoredToastsToChannel()
 
 	for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it)
 	{
-		(*it).toast->setIsHidden(false);
-		(*it).toast->startTimer();
-		mToastList.push_back((*it));
+		LLToast* toast = it->getToast();
+		if (toast)
+		{
+			toast->setIsHidden(false);
+			toast->startTimer();
+			mToastList.push_back(*it);
+		}
 	}
 
 	mStoredToastList.clear();
@@ -399,17 +407,19 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id)
 	if( it == mStoredToastList.end() )
 		return;
 
-	LLToast* toast = (*it).toast;
-
-	if(toast->getVisible())
+	LLToast* toast = it->getToast();
+	if (toast)
 	{
-		// toast is already in channel
-		return;
-	}
+		if(toast->getVisible())
+		{
+			// toast is already in channel
+			return;
+		}
 
-	toast->setIsHidden(false);
-	toast->startTimer();
-	mToastList.push_back((*it));
+		toast->setIsHidden(false);
+		toast->startTimer();
+		mToastList.push_back(*it);
+	}
 
 	redrawToasts();
 }
@@ -423,9 +433,19 @@ void LLScreenChannel::removeStoredToastByNotificationID(LLUUID id)
 	if( it == mStoredToastList.end() )
 		return;
 
-	LLToast* toast = (*it).toast;
-	mStoredToastList.erase(it);
-	mRejectToastSignal(toast->getNotificationID());
+	const LLToast* toast = it->getToast();
+	if (toast)
+	{
+		mRejectToastSignal(toast->getNotificationID());
+	}
+
+	// Call find() once more, because the mStoredToastList could have been changed
+	// in mRejectToastSignal callback and the iterator could have become invalid.
+	it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
+	if (it != mStoredToastList.end())
+	{
+		mStoredToastList.erase(it);
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -436,21 +456,22 @@ void LLScreenChannel::killToastByNotificationID(LLUUID id)
 	
 	if( it != mToastList.end())
 	{
-		LLToast* toast = (*it).toast;
+		LLToast* toast = it->getToast();
 		// if it is a notification toast and notification is UnResponded - then respond on it
 		// else - simply destroy a toast
 		//
 		// NOTE:	if a notification is unresponded this function will be called twice for the same toast.
 		//			At first, the notification will be discarded, at second (it will be caused by discarding),
 		//			the toast will be destroyed.
-		if(toast->isNotificationValid())
+		if(toast && toast->isNotificationValid())
 		{
 			mRejectToastSignal(toast->getNotificationID());
 		}
 		else
 		{
-			mToastList.erase(it);
+
 			deleteToast(toast);
+			mToastList.erase(it);
 			redrawToasts();
 		}
 		return;
@@ -459,20 +480,31 @@ void LLScreenChannel::killToastByNotificationID(LLUUID id)
 	// searching among stored toasts
 	it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
 
-	if( it != mStoredToastList.end() )
+	if (it != mStoredToastList.end())
+	{
+		LLToast* toast = it->getToast();
+		if (toast)
+		{
+			// send signal to a listener to let him perform some action on toast rejecting
+			mRejectToastSignal(toast->getNotificationID());
+			deleteToast(toast);
+		}
+	}
+
+	// Call find() once more, because the mStoredToastList could have been changed
+	// in mRejectToastSignal callback and the iterator could have become invalid.
+	it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
+	if (it != mStoredToastList.end())
 	{
-		LLToast* toast = (*it).toast;
 		mStoredToastList.erase(it);
-		// send signal to a listener to let him perform some action on toast rejecting
-		mRejectToastSignal(toast->getNotificationID());
-		deleteToast(toast);
 	}
+
 }
 
 void LLScreenChannel::killMatchedToasts(const Matcher& matcher)
 {
-	std::list<LLToast*> to_delete = findToasts(matcher);
-	for (std::list<LLToast*>::iterator it = to_delete.begin(); it
+	std::list<const LLToast*> to_delete = findToasts(matcher);
+	for (std::list<const LLToast*>::iterator it = to_delete.begin(); it
 			!= to_delete.end(); it++)
 	{
 		killToastByNotificationID((*it)-> getNotificationID());
@@ -486,12 +518,15 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
 	
 	if( it != mToastList.end() && panel)
 	{
-		LLToast* toast = (*it).toast;
-		LLPanel* old_panel = toast->getPanel();
-		toast->removeChild(old_panel);
-		delete old_panel;
-		toast->insertPanel(panel);
-		toast->startTimer();
+		LLToast* toast = it->getToast();
+		if (toast)
+		{
+			LLPanel* old_panel = toast->getPanel();
+			toast->removeChild(old_panel);
+			delete old_panel;
+			toast->insertPanel(panel);
+			toast->startTimer();
+		}
 		redrawToasts();
 	}
 }
@@ -540,16 +575,29 @@ void LLScreenChannel::showToastsBottom()
 	{
 		if(it != mToastList.rbegin())
 		{
-			LLToast* toast = (*(it-1)).toast;
+			LLToast* toast = (it-1)->getToast();
+			if (!toast)
+			{
+				llwarns << "Attempt to display a deleted toast." << llendl;
+				return;
+			}
+
 			bottom = toast->getRect().mTop - toast->getTopPad();
 			toast_margin = gSavedSettings.getS32("ToastGap");
 		}
 
-		toast_rect = (*it).toast->getRect();
+		LLToast* toast = it->getToast();
+		if(!toast)
+		{
+			llwarns << "Attempt to display a deleted toast." << llendl;
+			return;
+		}
+
+		toast_rect = toast->getRect();
 		toast_rect.setOriginAndSize(getRect().mRight - toast_rect.getWidth(),
 				bottom + toast_margin, toast_rect.getWidth(),
 				toast_rect.getHeight());
-		(*it).toast->setRect(toast_rect);
+		toast->setRect(toast_rect);
 
 		if(floater && floater->overlapsScreenChannel())
 		{
@@ -561,7 +609,7 @@ void LLScreenChannel::showToastsBottom()
 				{
 					shift += floater->getDockControl()->getTongueHeight();
 				}
-				(*it).toast->translate(0, shift);
+				toast->translate(0, shift);
 			}
 
 			LLRect channel_rect = getChannelRect();
@@ -572,13 +620,13 @@ void LLScreenChannel::showToastsBottom()
 			}
 		}
 
-		bool stop_showing_toasts = (*it).toast->getRect().mTop > getRect().mTop;
+		bool stop_showing_toasts = toast->getRect().mTop > getRect().mTop;
 
 		if(!stop_showing_toasts)
 		{
 			if( it != mToastList.rend()-1)
 			{
-				S32 toast_top = (*it).toast->getRect().mTop + gSavedSettings.getS32("ToastGap");
+				S32 toast_top = toast->getRect().mTop + gSavedSettings.getS32("ToastGap");
 				stop_showing_toasts = toast_top > getRect().mTop;
 			}
 		} 
@@ -592,17 +640,17 @@ void LLScreenChannel::showToastsBottom()
 		if(stop_showing_toasts)
 			break;
 
-		if( !(*it).toast->getVisible() )
+		if( !toast->getVisible() )
 		{
 			// HACK
 			// EXT-2653: it is necessary to prevent overlapping for secondary showed toasts
-			(*it).toast->setVisible(TRUE);
+			toast->setVisible(TRUE);
 		}		
-		if(!(*it).toast->hasFocus())
+		if(!toast->hasFocus())
 		{
 			// Fixing Z-order of toasts (EXT-4862)
 			// Next toast will be positioned under this one.
-			gFloaterView->sendChildToBack((*it).toast);
+			gFloaterView->sendChildToBack(toast);
 		}
 	}
 
@@ -612,7 +660,11 @@ void LLScreenChannel::showToastsBottom()
 		mHiddenToastsNum = 0;
 		for(; it != mToastList.rend(); it++)
 		{
-			(*it).toast->hide();
+			LLToast* toast = it->getToast();
+			if (toast)
+			{
+				toast->hide();
+			}
 		}
 	}
 }
@@ -620,17 +672,31 @@ void LLScreenChannel::showToastsBottom()
 //--------------------------------------------------------------------------
 void LLScreenChannel::showToastsCentre()
 {
-	LLRect	toast_rect;	
-	S32		bottom = (getRect().mTop - getRect().mBottom)/2 + mToastList[0].toast->getRect().getHeight()/2;
+	LLToast* toast = mToastList[0].getToast();
+	if (!toast)
+	{
+		llwarns << "Attempt to display a deleted toast." << llendl;
+		return;
+	}
+
+	LLRect	toast_rect;
+	S32		bottom = (getRect().mTop - getRect().mBottom)/2 + toast->getRect().getHeight()/2;
 	std::vector<ToastElem>::reverse_iterator it;
 
 	for(it = mToastList.rbegin(); it != mToastList.rend(); ++it)
 	{
-		toast_rect = (*it).toast->getRect();
+		LLToast* toast = it->getToast();
+		if (!toast)
+		{
+			llwarns << "Attempt to display a deleted toast." << llendl;
+			return;
+		}
+
+		toast_rect = toast->getRect();
 		toast_rect.setLeftTopAndSize(getRect().mLeft - toast_rect.getWidth() / 2, bottom + toast_rect.getHeight() / 2 + gSavedSettings.getS32("ToastGap"), toast_rect.getWidth() ,toast_rect.getHeight());
-		(*it).toast->setRect(toast_rect);
+		toast->setRect(toast_rect);
 
-		(*it).toast->setVisible(TRUE);	
+		toast->setVisible(TRUE);
 	}
 }
 
@@ -652,16 +718,29 @@ void LLScreenChannel::showToastsTop()
 	{
 		if(it != mToastList.rbegin())
 		{
-			LLToast* toast = (*(it-1)).toast;
+			LLToast* toast = (it-1)->getToast();
+			if (!toast)
+			{
+				llwarns << "Attempt to display a deleted toast." << llendl;
+				return;
+			}
+
 			top = toast->getRect().mBottom - toast->getTopPad();
 			toast_margin = gSavedSettings.getS32("ToastGap");
 		}
 
-		toast_rect = (*it).toast->getRect();
+		LLToast* toast = it->getToast();
+		if (!toast)
+		{
+			llwarns << "Attempt to display a deleted toast." << llendl;
+			return;
+		}
+
+		toast_rect = toast->getRect();
 		toast_rect.setLeftTopAndSize(channel_rect.mRight - toast_rect.getWidth(),
 			top, toast_rect.getWidth(),
 			toast_rect.getHeight());
-		(*it).toast->setRect(toast_rect);
+		toast->setRect(toast_rect);
 
 		if(floater && floater->overlapsScreenChannel())
 		{
@@ -673,7 +752,7 @@ void LLScreenChannel::showToastsTop()
 				{
 					shift -= floater->getDockControl()->getTongueHeight();
 				}
-				(*it).toast->translate(0, shift);
+				toast->translate(0, shift);
 			}
 
 			LLRect channel_rect = getChannelRect();
@@ -684,13 +763,13 @@ void LLScreenChannel::showToastsTop()
 			}
 		}
 
-		bool stop_showing_toasts = (*it).toast->getRect().mBottom < channel_rect.mBottom;
+		bool stop_showing_toasts = toast->getRect().mBottom < channel_rect.mBottom;
 
 		if(!stop_showing_toasts)
 		{
 			if( it != mToastList.rend()-1)
 			{
-				S32 toast_bottom = (*it).toast->getRect().mBottom - gSavedSettings.getS32("ToastGap");
+				S32 toast_bottom = toast->getRect().mBottom - gSavedSettings.getS32("ToastGap");
 				stop_showing_toasts = toast_bottom < channel_rect.mBottom;
 			}
 		} 
@@ -704,17 +783,17 @@ void LLScreenChannel::showToastsTop()
 		if(stop_showing_toasts)
 			break;
 
-		if( !(*it).toast->getVisible() )
+		if (!toast->getVisible())
 		{
 			// HACK
 			// EXT-2653: it is necessary to prevent overlapping for secondary showed toasts
-			(*it).toast->setVisible(TRUE);
+			toast->setVisible(TRUE);
 		}		
-		if(!(*it).toast->hasFocus())
+		if (!toast->hasFocus())
 		{
 			// Fixing Z-order of toasts (EXT-4862)
 			// Next toast will be positioned under this one.
-			gFloaterView->sendChildToBack((*it).toast);
+			gFloaterView->sendChildToBack(toast);
 		}
 	}
 
@@ -724,7 +803,11 @@ void LLScreenChannel::showToastsTop()
 		mHiddenToastsNum = 0;
 		for(; it != mToastList.rend(); it++)
 		{
-			(*it).toast->hide();
+			LLToast* toast = it->getToast();
+			if (toast)
+			{
+				toast->hide();
+			}
 		}
 	}
 }
@@ -827,7 +910,17 @@ void LLNotificationsUI::LLScreenChannel::startToastTimer(LLToast* toast)
 void LLScreenChannel::hideToastsFromScreen()
 {
 	for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end(); it++)
-		(*it).toast->setVisible(FALSE);
+	{
+		LLToast* toast = it->getToast();
+		if (toast)
+		{
+			toast->setVisible(FALSE);
+		}
+		else
+		{
+			llwarns << "Attempt to hide a deleted toast." << llendl;
+		}
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -836,8 +929,15 @@ void LLScreenChannel::hideToast(const LLUUID& notification_id)
 	std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), notification_id);
 	if(mToastList.end() != it)
 	{
-		ToastElem te = *it;
-		te.toast->hide();
+		LLToast* toast = it->getToast();
+		if (toast)
+		{
+			toast->hide();
+		}
+		else
+		{
+			llwarns << "Attempt to hide a deleted toast." << llendl;
+		}
 	}
 }
 
@@ -845,24 +945,25 @@ void LLScreenChannel::closeHiddenToasts(const Matcher& matcher)
 {
 	// since we can't guarantee that close toast operation doesn't change mToastList
 	// we collect matched toasts that should be closed into separate list
-	std::list<ToastElem> toasts;
+	std::list<LLToast*> toasts;
 	for (std::vector<ToastElem>::iterator it = mToastList.begin(); it
 			!= mToastList.end(); it++)
 	{
-		LLToast * toast = it->toast;
+		LLToast* toast = it->getToast();
 		// add to list valid toast that match to provided matcher criteria
 		if (toast != NULL && !toast->isDead() && toast->getNotification() != NULL
 				&& !toast->getVisible() && matcher.matches(toast->getNotification()))
 		{
-			toasts.push_back(*it);
+			toasts.push_back(toast);
 		}
 	}
 
 	// close collected toasts
-	for (std::list<ToastElem>::iterator it = toasts.begin(); it
+	for (std::list<LLToast*>::iterator it = toasts.begin(); it
 			!= toasts.end(); it++)
 	{
-		it->toast->closeFloater();
+		LLToast* toast = *it;
+		toast->closeFloater();
 	}
 }
 
@@ -872,7 +973,7 @@ void LLScreenChannel::removeToastsFromChannel()
 	hideToastsFromScreen();
 	for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end(); it++)
 	{
-		deleteToast((*it).toast);
+		deleteToast(it->getToast());
 	}
 	mToastList.clear();
 }
@@ -886,9 +987,10 @@ void LLScreenChannel::removeAndStoreAllStorableToasts()
 	hideToastsFromScreen();
 	for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end();)
 	{
-		if((*it).toast->getCanBeStored())
+		LLToast* toast = it->getToast();
+		if(toast && toast->getCanBeStored())
 		{
-			storeToast(*(it));
+			storeToast(*it);
 			it = mToastList.erase(it);
 		}
 		else
@@ -908,9 +1010,10 @@ void LLScreenChannel::removeToastsBySessionID(LLUUID id)
 	hideToastsFromScreen();
 	for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end();)
 	{
-		if((*it).toast->getSessionID() == id)
+		LLToast* toast = it->getToast();
+		if(toast && toast->getSessionID() == id)
 		{
-			deleteToast((*it).toast);
+			deleteToast(toast);
 			it = mToastList.erase(it);
 		}
 		else
@@ -968,5 +1071,5 @@ LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id)
 	if (it == mStoredToastList.end())
 		return NULL;
 
-	return it->toast;
+	return it->getToast();
 }
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index c9f8855fe63..695b6cd44d5 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -163,7 +163,7 @@ class LLScreenChannel : public LLScreenChannelBase
 		virtual bool matches(const LLNotificationPtr) const = 0;
 	};
 
-	std::list<LLToast*> findToasts(const Matcher& matcher);
+	std::list<const LLToast*> findToasts(const Matcher& matcher);
 
 	// Channel's outfit-functions
 	// update channel's size and position in the World View
@@ -238,31 +238,39 @@ class LLScreenChannel : public LLScreenChannelBase
 	reject_tost_signal_t mRejectToastSignal; boost::signals2::connection setOnRejectToastCallback(reject_tost_callback_t cb) { return mRejectToastSignal.connect(cb); }
 
 private:
-	struct ToastElem
+	class ToastElem
 	{
-		LLUUID		id;
-		LLToast*	toast;
+	public:
+		ToastElem(const LLHandle<LLToast>& toast) : mToast(toast)
+		{
+		}
 
-		ToastElem(LLToast::Params p) : id(p.notif_id)
+		ToastElem(const ToastElem& toast_elem) : mToast(toast_elem.mToast)
 		{
-			toast = new LLToast(p);
 		}
 
-		ToastElem(const ToastElem& toast_elem)
+		LLToast* getToast() const
 		{
-			id = toast_elem.id;
-			toast = toast_elem.toast;
+			return mToast.get();
+		}
+
+		LLUUID getID() const
+		{
+			return mToast.isDead() ? LLUUID() : mToast.get()->getNotificationID();
 		}
 
 		bool operator == (const LLUUID &id_op) const
 		{
-			return (id == id_op);
+			return (getID() == id_op);
 		}
 
 		bool operator == (LLPanel* panel_op) const
 		{
-			return (toast == panel_op);
+			return (mToast.get() == panel_op);
 		}
+
+	private:
+		LLHandle<LLToast>	mToast;
 	};
 
 	// Channel's handlers
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 21120a1b8db..cdc611f7af6 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -215,6 +215,13 @@ void LLToast::setFadingTime(S32 seconds)
 	mToastFadingTime = seconds;
 }
 
+void LLToast::closeToast()
+{
+	mOnDeleteToastSignal(this);
+
+	closeFloater();
+}
+
 S32 LLToast::getTopPad()
 {
 	if(mWrapperPanel)
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 0b067289350..e1d99b1bcba 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -75,6 +75,7 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 public:
 	typedef boost::function<void (LLToast* toast)> toast_callback_t;
 	typedef boost::signals2::signal<void (LLToast* toast)> toast_signal_t;
+	typedef boost::signals2::signal<void (LLToast* toast, bool mouse_enter)> toast_hover_check_signal_t;
 
 	struct Params : public LLInitParam::Block<Params>
 	{
@@ -131,7 +132,7 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 	void reshapeToPanel();
 
 	// get toast's panel
-	LLPanel* getPanel() { return mPanel; }
+	LLPanel* getPanel() const { return mPanel; }
 	// enable/disable Toast's Hide button
 	void setHideButtonEnabled(bool enabled);
 	//
@@ -155,6 +156,8 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 
 	void setFadingTime(S32 seconds);
 
+	void closeToast();
+
 	/**
 	 * Returns padding between floater top and wrapper_panel top.
 	 * This padding should be taken into account when positioning or reshaping toasts
@@ -167,9 +170,9 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 	// get information whether the notification corresponding to the toast is valid or not
 	bool isNotificationValid();
 	// get toast's Notification ID
-	const LLUUID getNotificationID() { return mNotificationID;}
+	const LLUUID getNotificationID() const { return mNotificationID;}
 	// get toast's Session ID
-	const LLUUID getSessionID() { return mSessionID;}
+	const LLUUID getSessionID() const { return mSessionID;}
 	//
 	void setCanFade(bool can_fade);
 	//
@@ -179,19 +182,12 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 	// set whether this toast considered as hidden or not
 	void setIsHidden( bool is_toast_hidden ) { mIsHidden = is_toast_hidden; }
 
-	const LLNotificationPtr& getNotification() { return mNotification;}
+	const LLNotificationPtr& getNotification() const { return mNotification;}
 
 	// Registers signals/callbacks for events
-	toast_signal_t mOnFadeSignal;
-	toast_signal_t mOnDeleteToastSignal;
-	toast_signal_t mOnToastDestroyedSignal;
-	boost::signals2::connection setOnFadeCallback(toast_callback_t cb) { return mOnFadeSignal.connect(cb); }
-	boost::signals2::connection setOnToastDestroyedCallback(toast_callback_t cb) { return mOnToastDestroyedSignal.connect(cb); }
-
-	typedef boost::function<void (LLToast* toast, bool mouse_enter)> toast_hover_check_callback_t;
-	typedef boost::signals2::signal<void (LLToast* toast, bool mouse_enter)> toast_hover_check_signal_t;
-	toast_hover_check_signal_t mOnToastHoverSignal;	
-	boost::signals2::connection setOnToastHoverCallback(toast_hover_check_callback_t cb) { return mOnToastHoverSignal.connect(cb); }
+	boost::signals2::connection setOnFadeCallback(const toast_signal_t::slot_type& cb) { return mOnFadeSignal.connect(cb); }
+	boost::signals2::connection setOnToastDestroyedCallback(const toast_signal_t::slot_type& cb) { return mOnToastDestroyedSignal.connect(cb); }
+	boost::signals2::connection setOnToastHoverCallback(const toast_hover_check_signal_t::slot_type& cb) { return mOnToastHoverSignal.connect(cb); }
 
 	boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseEnterSignal.connect(cb); };
 	boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseLeaveSignal.connect(cb); };
@@ -237,6 +233,11 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 	bool		mIsFading;
 	bool		mIsHovered;
 
+	toast_signal_t mOnFadeSignal;
+	toast_signal_t mOnDeleteToastSignal;
+	toast_signal_t mOnToastDestroyedSignal;
+	toast_hover_check_signal_t mOnToastHoverSignal;
+
 	commit_signal_t mToastMouseEnterSignal;
 	commit_signal_t mToastMouseLeaveSignal;
 };
-- 
GitLab


From d32c1c28b4e2add4e51361d13356b6638c6f0817 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 1 Feb 2012 16:39:27 -0800
Subject: [PATCH 692/933] cleaned up linden_common.h, removing stuff that is
 mostly unused

---
 indra/llaudio/llaudioengine.h        |  1 +
 indra/llcommon/linden_common.h       | 11 -----------
 indra/llmath/llcalcparser.h          |  2 +-
 indra/llmessage/llbufferstream.cpp   |  4 ++--
 indra/llmessage/llxfer.h             |  1 +
 indra/newview/llfloateranimpreview.h |  1 +
 indra/newview/llfloaterregioninfo.h  |  1 +
 indra/newview/llfloaterreporter.h    |  1 +
 indra/newview/llmutelist.h           |  1 +
 indra/newview/llpreview.h            |  1 +
 indra/newview/llviewermessage.h      |  1 +
 11 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h
index a47ee7ca7ca..28b69e19739 100644
--- a/indra/llaudio/llaudioengine.h
+++ b/indra/llaudio/llaudioengine.h
@@ -37,6 +37,7 @@
 #include "lluuid.h"
 #include "llframetimer.h"
 #include "llassettype.h"
+#include "llextendedstatus.h"
 
 #include "lllistener.h"
 
diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h
index 2e4885403ea..5cfcdab41cd 100644
--- a/indra/llcommon/linden_common.h
+++ b/indra/llcommon/linden_common.h
@@ -52,22 +52,11 @@
 #include <ctime>
 #include <iosfwd>
 
-// *TODO: Eliminate these, most library .cpp files don't need them.
-// Add them to llviewerprecompiledheaders.h if necessary.
-//#include <list>
-//#include <map>
-//#include <vector>
-//#include <string>
-
 // Linden only libs in alpha-order other than stdtypes.h
 // *NOTE: Please keep includes here to a minimum, see above.
 #include "stdtypes.h"
 #include "lldefs.h"
 #include "llerror.h"
-#include "llextendedstatus.h"
-// Don't do this, adds 15K lines of header code to every library file.
-//#include "llfasttimer.h"
 #include "llfile.h"
-#include "llformat.h"
 
 #endif
diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h
index 3509bd289b7..e0ad270266e 100644
--- a/indra/llmath/llcalcparser.h
+++ b/indra/llmath/llcalcparser.h
@@ -174,7 +174,7 @@ struct LLCalcParser : grammar<LLCalcParser>
 	F32 _log(const F32& a) const { return log(a); }
 	F32 _exp(const F32& a) const { return exp(a); }
 	F32 _fabs(const F32& a) const { return fabs(a); }
-	F32 _floor(const F32& a) const { return (F3)llfloor(a); }
+	F32 _floor(const F32& a) const { return (F32)llfloor(a); }
 	F32 _ceil(const F32& a) const { return llceil(a); }
 
 	F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp
index bb65d166706..6257983c436 100644
--- a/indra/llmessage/llbufferstream.cpp
+++ b/indra/llmessage/llbufferstream.cpp
@@ -273,7 +273,7 @@ streampos LLBufferStreamBuf::seekoff(
 			// NULL is fine
 			break;
 		}
-		address = (S32)mBuffer->seek(mChannels.in(), base_addr, off);
+		address = mBuffer->seek(mChannels.in(), base_addr, off);
 		if(address)
 		{
 			LLBufferArray::segment_iterator_t iter;
@@ -304,7 +304,7 @@ streampos LLBufferStreamBuf::seekoff(
 			// NULL is fine
 			break;
 		}
-		address = (S32)mBuffer->seek(mChannels.out(), base_addr, off);
+		address = mBuffer->seek(mChannels.out(), base_addr, off);
 		if(address)
 		{
 			LLBufferArray::segment_iterator_t iter;
diff --git a/indra/llmessage/llxfer.h b/indra/llmessage/llxfer.h
index 989e8b2cab1..f9348eb11f1 100644
--- a/indra/llmessage/llxfer.h
+++ b/indra/llmessage/llxfer.h
@@ -29,6 +29,7 @@
 
 #include "message.h"
 #include "lltimer.h"
+#include "llextendedstatus.h"
 
 const S32 LL_XFER_LARGE_PAYLOAD = 7680;
 
diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h
index f1ffb6547f2..b7854c56973 100644
--- a/indra/newview/llfloateranimpreview.h
+++ b/indra/newview/llfloateranimpreview.h
@@ -32,6 +32,7 @@
 #include "lldynamictexture.h"
 #include "llcharacter.h"
 #include "llquaternion.h"
+#include "llextendedstatus.h"
 
 class LLVOAvatar;
 class LLViewerJointMesh;
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index c402de66e86..ae45949b4a4 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -33,6 +33,7 @@
 #include "llfloater.h"
 #include "llhost.h"
 #include "llpanel.h"
+#include "llextendedstatus.h"
 
 #include "llenvmanager.h" // for LLEnvironmentSettings
 
diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h
index cd98f7be573..7d684317103 100644
--- a/indra/newview/llfloaterreporter.h
+++ b/indra/newview/llfloaterreporter.h
@@ -31,6 +31,7 @@
 #include "llfloater.h"
 #include "lluuid.h"
 #include "v3math.h"
+#include "llextendedstatus.h"
 
 class LLAvatarName;
 class LLMessageSystem;
diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h
index 04e15700811..7a70370fe33 100644
--- a/indra/newview/llmutelist.h
+++ b/indra/newview/llmutelist.h
@@ -29,6 +29,7 @@
 
 #include "llstring.h"
 #include "lluuid.h"
+#include "llextendedstatus.h"
 
 class LLViewerObject;
 class LLMessageSystem;
diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h
index 896e17c3c31..759430c3a5e 100644
--- a/indra/newview/llpreview.h
+++ b/indra/newview/llpreview.h
@@ -32,6 +32,7 @@
 #include "llpointer.h"
 #include "lluuid.h"
 #include "llinventoryobserver.h"
+#include "llextendedstatus.h"
 #include <map>
 
 class LLInventoryItem;
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index d8acd999538..46bfb2dad06 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -35,6 +35,7 @@
 #include "message.h"
 #include "stdenums.h"
 #include "llnotifications.h"
+#include "llextendedstatus.h"
 
 //
 // Forward declarations
-- 
GitLab


From c1636911c84f948e542f445d3c7495e6df185912 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 1 Feb 2012 19:09:29 -0800
Subject: [PATCH 693/933] EXP-1862 : Make LLClipboard an LLSingleton and clean
 up the internals (set up for toolbar and never used)

---
 indra/llui/llclipboard.cpp               |  6 ------
 indra/llui/llclipboard.h                 | 15 ++++-----------
 indra/llui/lllineeditor.cpp              | 14 +++++++-------
 indra/llui/llscrolllistctrl.cpp          |  2 +-
 indra/llui/lltexteditor.cpp              | 14 +++++++-------
 indra/newview/llfavoritesbar.cpp         |  2 +-
 indra/newview/llfloatergesture.cpp       |  2 +-
 indra/newview/llpanelteleporthistory.cpp |  2 +-
 indra/newview/llpaneltopinfobar.cpp      |  2 +-
 indra/newview/llpanelwearing.cpp         |  2 +-
 indra/newview/lltoolbarview.cpp          | 15 ++++++++++++++-
 indra/newview/lltoolbarview.h            |  3 +++
 indra/newview/lltooldraganddrop.cpp      |  3 ++-
 indra/newview/llurllineeditorctrl.cpp    |  2 +-
 14 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 6910b962a19..984c4ec5fb7 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -40,7 +40,6 @@ LLClipboard gClipboard;
 
 LLClipboard::LLClipboard()
 {
-	mSourceItem = NULL;
 }
 
 
@@ -135,8 +134,3 @@ BOOL LLClipboard::canPastePrimaryString() const
 {
 	return LLView::getWindow()->isPrimaryTextAvailable();
 }
-
-void LLClipboard::setSourceObject(const LLUUID& source_id, LLAssetType::EType type) 
-{
-	mSourceItem = new LLInventoryObject (source_id, LLUUID::null, type, "");
-}
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 9371b942844..2567eaab488 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -31,10 +31,10 @@
 #include "llstring.h"
 #include "lluuid.h"
 #include "stdenums.h"
+#include "llsingleton.h"
 #include "llinventory.h"
 
-
-class LLClipboard
+class LLClipboard : public LLSingleton<LLClipboard>
 {
 public:
 	LLClipboard();
@@ -54,19 +54,12 @@ class LLClipboard
 	BOOL		canPastePrimaryString() const;
 	const LLWString&	getPastePrimaryWString(LLUUID* source_id = NULL);	
 
-	// Support clipboard for object known only by their uuid and asset type
-	void		  setSourceObject(const LLUUID& source_id, LLAssetType::EType type);
-	const LLInventoryObject* getSourceObject() { return mSourceItem; }
+	// Support clipboard for object known only by their uuid
+	void		  setSourceObject(const LLUUID& source_id) { mSourceID = source_id; }
 	
 private:
 	LLUUID      mSourceID;
 	LLWString	mString;
-	LLInventoryObject* mSourceItem;
 };
 
-
-// Global singleton
-extern LLClipboard gClipboard;
-
-
 #endif  // LL_LLCLIPBOARD_H
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 06dfc90d83b..9292158b7cb 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1047,7 +1047,7 @@ void LLLineEditor::cut()
 		// Prepare for possible rollback
 		LLLineEditorRollback rollback( this );
 
-		gClipboard.copyFromSubstring( mText.getWString(), left_pos, length );
+		LLClipboard::getInstance()->copyFromSubstring( mText.getWString(), left_pos, length );
 		deleteSelection();
 
 		// Validate new string and rollback the if needed.
@@ -1078,13 +1078,13 @@ void LLLineEditor::copy()
 	{
 		S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 		S32 length = llabs( mSelectionStart - mSelectionEnd );
-		gClipboard.copyFromSubstring( mText.getWString(), left_pos, length );
+		LLClipboard::getInstance()->copyFromSubstring( mText.getWString(), left_pos, length );
 	}
 }
 
 BOOL LLLineEditor::canPaste() const
 {
-	return !mReadOnly && gClipboard.canPasteString(); 
+	return !mReadOnly && LLClipboard::getInstance()->canPasteString(); 
 }
 
 void LLLineEditor::paste()
@@ -1117,11 +1117,11 @@ void LLLineEditor::pasteHelper(bool is_primary)
 		LLWString paste;
 		if (is_primary)
 		{
-			paste = gClipboard.getPastePrimaryWString();
+			paste = LLClipboard::getInstance()->getPastePrimaryWString();
 		}
 		else 
 		{
-			paste = gClipboard.getPasteWString();
+			paste = LLClipboard::getInstance()->getPasteWString();
 		}
 
 		if (!paste.empty())
@@ -1209,13 +1209,13 @@ void LLLineEditor::copyPrimary()
 	{
 		S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 		S32 length = llabs( mSelectionStart - mSelectionEnd );
-		gClipboard.copyFromPrimarySubstring( mText.getWString(), left_pos, length );
+		LLClipboard::getInstance()->copyFromPrimarySubstring( mText.getWString(), left_pos, length );
 	}
 }
 
 BOOL LLLineEditor::canPastePrimary() const
 {
-	return !mReadOnly && gClipboard.canPastePrimaryString(); 
+	return !mReadOnly && LLClipboard::getInstance()->canPastePrimaryString(); 
 }
 
 void LLLineEditor::updatePrimary()
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 466fac33ea3..8cbc2a8f993 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -2504,7 +2504,7 @@ void	LLScrollListCtrl::copy()
 	{
 		buffer += (*itor)->getContentsCSV() + "\n";
 	}
-	gClipboard.copyFromSubstring(utf8str_to_wstring(buffer), 0, buffer.length());
+	LLClipboard::getInstance()->copyFromSubstring(utf8str_to_wstring(buffer), 0, buffer.length());
 }
 
 // virtual
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 3a23ce1caca..22a577cda88 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1332,7 +1332,7 @@ void LLTextEditor::cut()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	gClipboard.copyFromSubstring( getWText(), left_pos, length, mSourceID );
+	LLClipboard::getInstance()->copyFromSubstring( getWText(), left_pos, length, mSourceID );
 	deleteSelection( FALSE );
 
 	onKeyStroke();
@@ -1352,12 +1352,12 @@ void LLTextEditor::copy()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	gClipboard.copyFromSubstring(getWText(), left_pos, length, mSourceID);
+	LLClipboard::getInstance()->copyFromSubstring(getWText(), left_pos, length, mSourceID);
 }
 
 BOOL LLTextEditor::canPaste() const
 {
-	return !mReadOnly && gClipboard.canPasteString();
+	return !mReadOnly && LLClipboard::getInstance()->canPasteString();
 }
 
 // paste from clipboard
@@ -1397,11 +1397,11 @@ void LLTextEditor::pasteHelper(bool is_primary)
 	LLWString paste;
 	if (is_primary)
 	{
-		paste = gClipboard.getPastePrimaryWString(&source_id);
+		paste = LLClipboard::getInstance()->getPastePrimaryWString(&source_id);
 	}
 	else 
 	{
-		paste = gClipboard.getPasteWString(&source_id);
+		paste = LLClipboard::getInstance()->getPasteWString(&source_id);
 	}
 
 	if (paste.empty())
@@ -1475,12 +1475,12 @@ void LLTextEditor::copyPrimary()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	gClipboard.copyFromPrimarySubstring(getWText(), left_pos, length, mSourceID);
+	LLClipboard::getInstance()->copyFromPrimarySubstring(getWText(), left_pos, length, mSourceID);
 }
 
 BOOL LLTextEditor::canPastePrimary() const
 {
-	return !mReadOnly && gClipboard.canPastePrimaryString();
+	return !mReadOnly && LLClipboard::getInstance()->canPastePrimaryString();
 }
 
 void LLTextEditor::updatePrimary()
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index f4b6dc2c816..24bd2cf3139 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1118,7 +1118,7 @@ BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
 }
 void copy_slurl_to_clipboard_cb(std::string& slurl)
 {
-	gClipboard.copyFromString(utf8str_to_wstring(slurl));
+	LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(slurl));
 
 	LLSD args;
 	args["SLURL"] = slurl;
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index d495f20a9a8..e025d6edb5c 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -534,7 +534,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 	}
 	else if ("copy_uuid" == command_name)
 	{
-		gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
+		LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
 	}
 }
 
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 1f1cccad856..a4c9af3fad1 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -358,7 +358,7 @@ void LLTeleportHistoryPanel::ContextMenu::onInfo()
 //static
 void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl)
 {
-	gClipboard.copyFromString(utf8str_to_wstring(slurl));
+	LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(slurl));
 }
 
 void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index eb4c7572d43..0e3ff990666 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -467,7 +467,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
 		LLAgentUI::buildSLURL(slurl, false);
 		LLUIString location_str(slurl.getSLURLString());
 
-		gClipboard.copyFromString(location_str);
+		LLClipboard::getInstance()->copyFromString(location_str);
 	}
 }
 
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index e2801c09bde..12867566936 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -302,6 +302,6 @@ void LLPanelWearing::copyToClipboard()
 		}
 	}
 
-	gClipboard.copyFromString(utf8str_to_wstring(text));
+	LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(text));
 }
 // EOF
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index eccb2cf2f15..8a0b0352343 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -75,6 +75,7 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
 	mDragStarted(false),
 	mShowToolbars(true),
 	mDragToolbarButton(NULL),
+	mDragItem(NULL),
 	mToolbarsLoaded(false)
 {
 	for (S32 i = 0; i < TOOLBAR_COUNT; i++)
@@ -579,7 +580,7 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
 			uuid_vec_t cargo_ids;
 			types.push_back(DAD_WIDGET);
 			cargo_ids.push_back(uuid);
-			gClipboard.setSourceObject(uuid,LLAssetType::AT_WIDGET);
+			LLClipboard::getInstance()->setSourceObject(uuid);
 			LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER;
 			LLUUID srcID;
 			LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID);
@@ -662,6 +663,18 @@ void LLToolBarView::resetDragTool(LLToolBarButton* toolbarButton)
 	gToolBarView->mDragToolbarButton = toolbarButton;
 }
 
+// Provide a handle on a free standing inventory item containing references to the tool.
+// This might be used by Drag and Drop to move around references to tool items.
+LLInventoryObject* LLToolBarView::getDragItem()
+{
+	if (mDragToolbarButton)
+	{
+		LLUUID item_uuid = mDragToolbarButton->getCommandId().uuid();
+		mDragItem = new LLInventoryObject (item_uuid, LLUUID::null, LLAssetType::AT_WIDGET, "");
+	}
+	return mDragItem;
+}
+
 void LLToolBarView::setToolBarsVisible(bool visible)
 {
 	mShowToolbars = visible;
diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h
index be66bcae361..9c4194ebed1 100644
--- a/indra/newview/lltoolbarview.h
+++ b/indra/newview/lltoolbarview.h
@@ -31,6 +31,7 @@
 #include "lluictrl.h"
 #include "lltoolbar.h"
 #include "llcommandmanager.h"
+#include "llinventory.h"
 
 class LLUICtrlFactory;
 
@@ -106,6 +107,7 @@ class LLToolBarView : public LLUICtrl
 	static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
 	static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
 	static void resetDragTool(LLToolBarButton* toolbarButton);
+	LLInventoryObject* getDragItem();
 
 	bool isModified() const;
 	
@@ -129,6 +131,7 @@ class LLToolBarView : public LLUICtrl
 	
 	bool				mDragStarted;
 	LLToolBarButton*	mDragToolbarButton;
+	LLInventoryObject*	mDragItem;
 	bool				mShowToolbars;
 };
 
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 8c32dfcb4de..f3637756fee 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -48,6 +48,7 @@
 #include "llpreviewnotecard.h"
 #include "llrootview.h"
 #include "llselectmgr.h"
+#include "lltoolbarview.h"
 #include "lltoolmgr.h"
 #include "lltooltip.h"
 #include "lltrans.h"
@@ -2527,7 +2528,7 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory(
 	}
 	else if(mSource == SOURCE_VIEWER)
 	{
-		item = (LLViewerInventoryItem*)gClipboard.getSourceObject();
+		item = (LLViewerInventoryItem*)gToolBarView->getDragItem();
 	}
 	if(item) return item;
 	if(cat) return cat;
diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp
index 56b5bbf9420..9d7e26d41c9 100644
--- a/indra/newview/llurllineeditorctrl.cpp
+++ b/indra/newview/llurllineeditorctrl.cpp
@@ -89,5 +89,5 @@ void LLURLLineEditor::copyEscapedURLToClipboard()
 	else // human-readable location
 		text_to_copy = utf8str_to_wstring(unescaped_text);
 		
-	gClipboard.copyFromString( text_to_copy );
+	LLClipboard::getInstance()->copyFromString( text_to_copy );
 }
-- 
GitLab


From 8d6665b5c2ac1d42d72dab025623d3ae14291ccb Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 2 Feb 2012 13:29:24 +0200
Subject: [PATCH 694/933] Restoring a call to llround() in lllineeditor.cpp
 mistakenly removed in changeset 0a9ef58e8f7d.

By the way, removing a pointless call to llround() in lldraghandle.cpp.
---
 indra/llui/lldraghandle.cpp | 2 +-
 indra/llui/lllineeditor.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 42e6c3c7862..5f69c6af315 100644
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -244,7 +244,7 @@ void LLDragHandleTop::reshapeTitleBox()
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
 	S32 title_width = getRect().getWidth();
 	title_width -= LEFT_PAD + 2 * BORDER_PAD + getButtonsRect().getWidth();
-	S32 title_height = llround(font->getLineHeight());
+	S32 title_height = font->getLineHeight();
 	LLRect title_rect;
 	title_rect.setLeftTopAndSize( 
 		LEFT_PAD, 
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index c53fb40ca2a..d600f58b963 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1630,7 +1630,7 @@ void LLLineEditor::draw()
 	LLRect background( 0, getRect().getHeight(), getRect().getWidth(), 0 );
 	background.stretch( -mBorderThickness );
 
-	S32 lineeditor_v_pad = (background.getHeight() - mGLFont->getLineHeight())/2;
+	S32 lineeditor_v_pad = llround(((F32)background.getHeight() - mGLFont->getLineHeight())/2);
 
 	drawBackground();
 	
-- 
GitLab


From 9721e4f78362da8fce1c66762290ff72df06441c Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 2 Feb 2012 20:45:08 +0200
Subject: [PATCH 695/933] Removing a call to llround() per Richard.

---
 indra/llui/lllineeditor.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index d600f58b963..7e84814c518 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1630,7 +1630,7 @@ void LLLineEditor::draw()
 	LLRect background( 0, getRect().getHeight(), getRect().getWidth(), 0 );
 	background.stretch( -mBorderThickness );
 
-	S32 lineeditor_v_pad = llround(((F32)background.getHeight() - mGLFont->getLineHeight())/2);
+	S32 lineeditor_v_pad = (background.getHeight() - mGLFont->getLineHeight()) / 2;
 
 	drawBackground();
 	
-- 
GitLab


From 8f1f84212bb0b9ae85ef680ff20acfa4bcacd5cd Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 2 Feb 2012 11:35:36 -0800
Subject: [PATCH 696/933] EXP-1858 FIX Received Items panel heading in
 incorrect position didn't account properly for collapsed panels

---
 indra/llui/lllayoutstack.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 05261432e3c..31e04347534 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -325,7 +325,7 @@ void LLLayoutStack::updateLayout()
 			panelp->mTargetDim = panelp->getRelevantMinDim();
 		}
 		space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
-		total_visible_fraction += panelp->mFractionalSize * panelp->getVisibleAmount();
+		total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
 	}
 
 	llassert(total_visible_fraction < 1.05f);
-- 
GitLab


From c1e47e0acab0d82ae25d65d64ac22afca6f2bd12 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 2 Feb 2012 12:22:00 -0800
Subject: [PATCH 697/933] EXP-1856 FIX -- Calling cards, library items, 'no
 transfer' objects can be copied to Merchant outbox via ctrl-v

* Viewer now applies the same logic as inventory drag and drop to clipboard
  paste operations.
---
 indra/newview/llinventorybridge.cpp | 63 ++++++++++++++++++++++++++---
 indra/newview/lltooldraganddrop.cpp | 17 ++++----
 indra/newview/lltooldraganddrop.h   |  9 ++++-
 3 files changed, 74 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 869cb735d59..76576f7b75b 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2095,7 +2095,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 							// NOTE: The cargo id's count is a total of categories AND items but we err on the side of
 							//       prevention rather than letting too many folders into the hierarchy of the outbox,
 							//       when we're dragging the item to a new parent
-							dragged_folder_count += LLToolDragAndDrop::instance().getCargoIDsCount();
+							dragged_folder_count += LLToolDragAndDrop::instance().getCargoCount();
 						}
 					}
 					
@@ -2819,18 +2819,62 @@ void LLFolderBridge::pasteFromClipboard()
 	if(model && isClipboardPasteable())
 	{
 		const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
+		const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+
 		const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
 		const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
-
-		const LLUUID parent_id(mUUID);
+		const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
 
 		LLDynamicArray<LLUUID> objects;
 		LLInventoryClipboard::instance().retrieve(objects);
+
+		if (move_is_into_outbox)
+		{
+			LLFolderViewItem * outbox_itemp = mRoot->getItemByID(mUUID);
+
+			if (outbox_itemp)
+			{
+				LLToolDragAndDrop::instance().setCargoCount(objects.size());
+
+				BOOL can_list = TRUE;
+
+				for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
+					(iter != objects.end()) && (can_list == TRUE);
+					++iter)
+				{
+					const LLUUID& item_id = (*iter);
+					LLInventoryItem *item = model->getItem(item_id);
+
+					if (item)
+					{
+						MASK mask = 0x0;
+						BOOL drop = FALSE;
+						EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(item->getActualType());
+						void * cargo_data = (void *) item;
+						std::string tooltip_msg;
+
+						can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg);
+					}
+				}
+
+				LLToolDragAndDrop::instance().resetCargoCount();
+
+				if (can_list == FALSE)
+				{
+					// Notify user of failure somehow -- play error sound?  modal dialog?
+					return;
+				}
+			}
+		}
+
+		const LLUUID parent_id(mUUID);
+
 		for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 			 iter != objects.end();
 			 ++iter)
 		{
 			const LLUUID& item_id = (*iter);
+
 			LLInventoryItem *item = model->getItem(item_id);
 			if (item)
 			{
@@ -2873,8 +2917,17 @@ void LLFolderBridge::pasteLinkFromClipboard()
 	if(model)
 	{
 		const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
+		const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+
 		const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
 		const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
+		const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
+
+		if (move_is_into_outbox)
+		{
+			// Notify user of failure somehow -- play error sound?  modal dialog?
+			return;
+		}
 
 		const LLUUID parent_id(mUUID);
 
@@ -3534,7 +3587,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 	const BOOL move_is_into_favorites = (mUUID == favorites_id);
 	const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
 	const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
-	const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); //(mUUID == outbox_id);
+	const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
 	const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_item->getUUID(), outbox_id);
 
 	LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
@@ -3613,7 +3666,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			{
 				const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
 				
-				int existing_item_count = LLToolDragAndDrop::instance().getCargoIDsCount();
+				int existing_item_count = LLToolDragAndDrop::instance().getCargoCount();
 				
 				if (master_folder != NULL)
 				{
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 8c32dfcb4de..c7ab934f9eb 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -333,14 +333,15 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary()
 };
 
 LLToolDragAndDrop::LLToolDragAndDrop()
-:	 LLTool(std::string("draganddrop"), NULL),
-	 mDragStartX(0),
-	 mDragStartY(0),
-	 mSource(SOURCE_AGENT),
-	 mCursor(UI_CURSOR_NO),
-	 mLastAccept(ACCEPT_NO),
-	 mDrop(FALSE),
-	 mCurItemIndex(0)
+:	LLTool(std::string("draganddrop"), NULL),
+	mCargoCount(0),
+	mDragStartX(0),
+	mDragStartY(0),
+	mSource(SOURCE_AGENT),
+	mCursor(UI_CURSOR_NO),
+	mLastAccept(ACCEPT_NO),
+	mDrop(FALSE),
+	mCurItemIndex(0)
 {
 
 }
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index 188d36cd1b9..245c2a23e63 100644
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -86,8 +86,11 @@ class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop>
 	EAcceptance getLastAccept() { return mLastAccept; }
 
 	boost::signals2::connection setEndDragCallback( const enddrag_signal_t::slot_type& cb ) { return mEndDragSignal.connect(cb); }
-	
-	uuid_vec_t::size_type getCargoIDsCount() const { return mCargoIDs.size(); }
+
+	void setCargoCount(U32 count) { mCargoCount = count; }
+	void resetCargoCount() { mCargoCount = 0; }
+	U32 getCargoCount() const { return (mCargoCount > 0) ? mCargoCount : mCargoIDs.size(); }
+
 	static S32 getOperationId() { return sOperationId; }
 
 protected:
@@ -118,6 +121,8 @@ class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop>
 
 protected:
 
+	U32				mCargoCount;
+
 	S32				mDragStartX;
 	S32				mDragStartY;
 	
-- 
GitLab


From 094b3b8f3de20bc6c157fcf94653a9e4f7c9ab5c Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 3 Feb 2012 07:43:34 +0200
Subject: [PATCH 698/933] EXP-1819 FIXED (Location & Favorites bar splitter
 should be draggable to 200 px on left and 150 px on right. )

- Allowed dragging to the left to shrink location to no less than 310 pixels, and to the right to shrink favorites to 185 pixels
---
 .../skins/default/xui/en/panel_navigation_bar.xml      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 4ff9dbae0f2..53a09ce0410 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -70,7 +70,7 @@
            layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="380"
+           min_width="310"
            name="navigation_layout_panel"
            width="480">
 	        <panel
@@ -148,15 +148,15 @@
 	         layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="450"
+           min_width="185"
            name="favorites_layout_panel"
-           width="500">
+           width="320">
            <icon
              follows="top|left"
              height="25"
              image_name="ChatBarHandle"
              layout="topleft"
-             left="-503"
+             left="-323"
              name="resize_handle"
              top="4"
              width="5" />
@@ -171,7 +171,7 @@
              name="favorite"
              image_drag_indication="Accordion_ArrowOpened_Off"
              tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-             width="496">
+             width="320">
             <label
              follows="left|top"
              height="13"
-- 
GitLab


From ca37970a3aa04a3080e80d33036a127802a18450 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 3 Feb 2012 08:49:14 +0200
Subject: [PATCH 699/933] EXP-1840 FIXED (When two inventory windows are open
 and "properties" are viewed, one window suddenly moves in front of the other
 window)

- Modified method LLFloaterSidePanelContainer::openChildPanel so that it doesn't open floater each time it's called. Otherwise each time opening child panel of already opened floater, openFloater() will reposition the floater.
---
 indra/newview/llfloatersidepanelcontainer.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp
index be7a53491d8..5385977d95d 100644
--- a/indra/newview/llfloatersidepanelcontainer.cpp
+++ b/indra/newview/llfloatersidepanelcontainer.cpp
@@ -59,7 +59,10 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na
 	LLView* view = findChildView(panel_name, true);
 	if (!view) return NULL;
 
-	openFloater();
+	if (!getVisible())
+	{
+		openFloater();
+	}
 
 	LLPanel* panel = NULL;
 
-- 
GitLab


From 36aba266155bdb25b9887686016ad62b2250b509 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 3 Feb 2012 11:10:13 +0200
Subject: [PATCH 700/933] EXP-1843 WIP Added an option to output avatar rez
 timing.

Use the new "Avatar Rez" debugging tag to see the output.
---
 indra/newview/llagent.cpp               |  1 +
 indra/newview/llagentwearables.cpp      | 11 +++++++++++
 indra/newview/llagentwearablesfetch.cpp |  8 ++++++++
 indra/newview/llagentwearablesfetch.h   |  2 ++
 indra/newview/llappearancemgr.cpp       |  9 +++++++++
 indra/newview/lltexlayer.h              |  2 ++
 indra/newview/llvoavatar.h              |  2 ++
 indra/newview/llvoavatarself.cpp        | 21 ++++++++++++++++++++-
 indra/newview/llvoavatarself.h          |  3 +++
 9 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 54ad3cd187a..ab9b5ff4368 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3314,6 +3314,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
 	}
 
 	llinfos << "Received cached texture response for " << num_results << " textures." << llendl;
+	gAgentAvatarp->outputRezTiming("Fetched agent wearables textures from cache. Will now load them");
 
 	gAgentAvatarp->updateMeshTextures();
 
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 13b62cb019d..09305a5b4d2 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -185,6 +185,7 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar)
 { 
 	if (avatar)
 	{
+		avatar->outputRezTiming("Sending wearables request");
 		sendAgentWearablesRequest();
 	}
 }
@@ -949,6 +950,11 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
 	if (mInitialWearablesUpdateReceived)
 		return;
 
+	if (isAgentAvatarValid())
+	{
+		gAgentAvatarp->outputRezTiming("Received initial wearables update");
+	}
+
 	// notify subscribers that wearables started loading. See EXT-7777
 	// *TODO: find more proper place to not be called from deprecated method.
 	// Seems such place is found: LLInitialWearablesFetch::processContents()
@@ -1619,6 +1625,11 @@ void LLAgentWearables::queryWearableCache()
 	//VWR-22113: gAgent.getRegion() can return null if invalid, seen here on logout
 	if(gAgent.getRegion())
 	{
+		if (isAgentAvatarValid())
+		{
+			gAgentAvatarp->outputRezTiming("Fetching textures from cache");
+		}
+
 		llinfos << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl;
 		gMessageSystem->sendReliable(gAgent.getRegion()->getHost());
 		gAgentQueryManager.mNumPendingQueries++;
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index 4097ff707c6..8cba54347e3 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -87,6 +87,10 @@ class LLOrderMyOutfitsOnDestroy: public LLInventoryCallback
 LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) :
 	LLInventoryFetchDescendentsObserver(cof_id)
 {
+	if (isAgentAvatarValid())
+	{
+		gAgentAvatarp->outputRezTiming("Initial wearables fetch started");
+	}
 }
 
 LLInitialWearablesFetch::~LLInitialWearablesFetch()
@@ -101,6 +105,10 @@ void LLInitialWearablesFetch::done()
 	// idle tick instead.
 	gInventory.removeObserver(this);
 	doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this));
+	if (isAgentAvatarValid())
+	{
+		gAgentAvatarp->outputRezTiming("Initial wearables fetch done");
+	}
 }
 
 void LLInitialWearablesFetch::add(InitialWearableData &data)
diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h
index 7dafab4a335..bedc445c0eb 100644
--- a/indra/newview/llagentwearablesfetch.h
+++ b/indra/newview/llagentwearablesfetch.h
@@ -40,6 +40,8 @@
 //--------------------------------------------------------------------
 class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver
 {
+	LOG_CLASS(LLInitialWearablesFetch);
+
 public:
 	LLInitialWearablesFetch(const LLUUID& cof_id);
 	~LLInitialWearablesFetch();
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 663257042ee..33f5373d7e8 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -268,6 +268,8 @@ struct LLFoundData
 	
 class LLWearableHoldingPattern
 {
+	LOG_CLASS(LLWearableHoldingPattern);
+
 public:
 	LLWearableHoldingPattern();
 	~LLWearableHoldingPattern();
@@ -436,6 +438,11 @@ void LLWearableHoldingPattern::checkMissingWearables()
 
 void LLWearableHoldingPattern::onAllComplete()
 {
+	if (isAgentAvatarValid())
+	{
+		gAgentAvatarp->outputRezTiming("Agent wearables fetch complete");
+	}
+
 	if (!isMostRecent())
 	{
 		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
@@ -2363,6 +2370,8 @@ void LLAppearanceMgr::autopopulateOutfits()
 // Handler for anything that's deferred until avatar de-clouds.
 void LLAppearanceMgr::onFirstFullyVisible()
 {
+	gAgentAvatarp->outputRezTiming("Avatar fully loaded");
+	gAgentAvatarp->reportAvatarRezTime();
 	gAgentAvatarp->debugAvatarVisible();
 
 	// The auto-populate is failing at the point of generating outfits
diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h
index 85dadb213c5..4f43547dae5 100644
--- a/indra/newview/lltexlayer.h
+++ b/indra/newview/lltexlayer.h
@@ -261,6 +261,8 @@ class LLTexLayerSetInfo
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 class LLTexLayerSetBuffer : public LLViewerDynamicTexture
 {
+	LOG_CLASS(LLTexLayerSetBuffer);
+
 public:
 	LLTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height);
 	virtual ~LLTexLayerSetBuffer();
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 4cd61cecf95..dd0317f555d 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -78,6 +78,8 @@ class LLVOAvatar :
 	public LLCharacter,
 	public boost::signals2::trackable
 {
+	LOG_CLASS(LLVOAvatar);
+
 public:
 	friend class LLVOAvatarSelf;
 protected:
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 581912f8449..f1df67494f7 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1574,7 +1574,7 @@ void LLVOAvatarSelf::invalidateAll()
 	{
 		invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, TRUE);
 	}
-	mDebugSelfLoadTimer.reset();
+	//mDebugSelfLoadTimer.reset();
 }
 
 //-----------------------------------------------------------------------------
@@ -1896,11 +1896,13 @@ BOOL LLVOAvatarSelf::getIsCloud()
 		gAgentWearables.getWearableCount(LLWearableType::WT_EYES) == 0 ||
 		gAgentWearables.getWearableCount(LLWearableType::WT_SKIN) == 0)	
 	{
+		lldebugs << "No body parts" << llendl;
 		return TRUE;
 	}
 
 	if (!isTextureDefined(TEX_HAIR, 0))
 	{
+		lldebugs << "No hair texture" << llendl;
 		return TRUE;
 	}
 
@@ -1909,12 +1911,14 @@ BOOL LLVOAvatarSelf::getIsCloud()
 		if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_LOWER].mTexLayerSet) &&
 			(!isTextureDefined(TEX_LOWER_BAKED, 0)))
 		{
+			lldebugs << "Lower textures not baked" << llendl;
 			return TRUE;
 		}
 
 		if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_UPPER].mTexLayerSet) &&
 			(!isTextureDefined(TEX_UPPER_BAKED, 0)))
 		{
+			lldebugs << "Upper textures not baked" << llendl;
 			return TRUE;
 		}
 
@@ -1931,10 +1935,12 @@ BOOL LLVOAvatarSelf::getIsCloud()
 			const LLViewerTexture* baked_img = getImage( texture_data.mTextureIndex, 0 );
 			if (!baked_img || !baked_img->hasGLTexture())
 			{
+				lldebugs << "Texture at index " << i << " (texture index is " << texture_data.mTextureIndex << ") is not loaded" << llendl;
 				return TRUE;
 			}
 		}
 
+		lldebugs << "Avatar de-clouded" << llendl;
 	}
 	return FALSE;
 }
@@ -2258,6 +2264,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid )
 	}
 }
 
+// FIXME: This is never called. Something may be broken.
 void LLVOAvatarSelf::outputRezDiagnostics() const
 {
 	if(!gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime"))
@@ -2315,6 +2322,18 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
 	}
 }
 
+void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const
+{
+	LL_DEBUGS("Avatar Rez")
+		<< llformat("%s. Time from avatar creation: %.2f", msg.c_str(), mDebugSelfLoadTimer.getElapsedTimeF32())
+		<< llendl;
+}
+
+void LLVOAvatarSelf::reportAvatarRezTime() const
+{
+	// TODO: report mDebugSelfLoadTimer.getElapsedTimeF32() somehow.
+}
+
 //-----------------------------------------------------------------------------
 // setCachedBakedTexture()
 // A baked texture id was received from a cache query, make it active
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 74ff47a3e4b..54dbe819937 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -41,6 +41,7 @@ struct LocalTextureData;
 class LLVOAvatarSelf :
 	public LLVOAvatar
 {
+	LOG_CLASS(LLVOAvatarSelf);
 
 /********************************************************************************
  **                                                                            **
@@ -358,6 +359,8 @@ class LLVOAvatarSelf :
 	void 					debugWearablesLoaded() { mDebugTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); }
 	void 					debugAvatarVisible() { mDebugTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); }
 	void 					outputRezDiagnostics() const;
+	void					outputRezTiming(const std::string& msg) const;
+	void					reportAvatarRezTime() const;
 	void 					debugBakedTextureUpload(LLVOAvatarDefines::EBakedTextureIndex index, BOOL finished);
 	static void				debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
 
-- 
GitLab


From f106ef838397f62261e7ec4e94f96848f37acf19 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 3 Feb 2012 09:02:01 -0500
Subject: [PATCH 701/933] STORM-1793 Fix bad assumption in getAvatars

---
 indra/newview/llworld.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 86780d0604b..bbe440e14f2 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1193,12 +1193,17 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 		if( !pVOAvatar->isDead() &&
 			!pVOAvatar->isSelf() &&
 			!uuid.isNull() &&
-			dist_vec_squared(pos_global, relative_to) <= radius_squared &&
-			positions != NULL &&
-			avatar_ids != NULL)
-		{
-			positions->push_back(pos_global);
-			avatar_ids->push_back(uuid);
+			dist_vec_squared(pos_global, relative_to) <= radius_squared)
+			{
+				if(positions != NULL)
+				{
+					positions->push_back(pos_global);
+				}
+				if(avatar_ids !=NULL)
+				{
+					avatar_ids->push_back(uuid);
+				}
+			}
 		}
 	}
 	// region avatars added for situations where radius is greater than RenderFarClip
-- 
GitLab


From acb1df8b856f49b970a5756bbed24cafad127df8 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 3 Feb 2012 11:48:00 -0500
Subject: [PATCH 702/933] STORM-1793 Fix another logic error in getAvatars

---
 indra/newview/llworld.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index bbe440e14f2..5b2e78477c7 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1222,11 +1222,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 				// if this avatar doesn't already exist in the list, add it
 				if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end())
 				{
-					if(positions != NULL)
+					if (positions != NULL)
 					{
 						positions->push_back(pos_global);
-						avatar_ids->push_back(uuid);
 					}
+					avatar_ids->push_back(uuid);
 				}
 			}
 		}
-- 
GitLab


From 90ba675da4416a7f75f59340633e2c007b6cc029 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Fri, 3 Feb 2012 13:09:20 -0500
Subject: [PATCH 703/933] Escape all strings embedded in TeamCity service
 messages. TeamCity requires that certain characters (notably "'") must be
 escaped when embedded in service messages:
 http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ServiceMessages
 TUT frequently outputs messages containing "'", e.g. from ensure_equals()
 failure. We've seen TC output nesting get confused when it fails to process
 service messages properly due to parsing unescaped messages. Along with
 test<n> number, report test name (from set_test_name()) when available.
 Eliminate horsing around to produce normal output on both std::cout and
 possible output file. When output file is specified, use
 boost::iostreams::tee_device to do fanout for us. Improve placement (and
 possibly reliability) of service messages. Clean up a startling amount of
 redundancy in service-message production.

---
 indra/test/test.cpp | 183 +++++++++++++++++++++++++++-----------------
 1 file changed, 112 insertions(+), 71 deletions(-)

diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index ffdb0cb976a..3e7be29b390 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -37,6 +37,7 @@
 #include "linden_common.h"
 #include "llerrorcontrol.h"
 #include "lltut.h"
+#include "stringize.h"
 
 #include "apr_pools.h"
 #include "apr_getopt.h"
@@ -53,6 +54,13 @@
 #include <gtest/gtest.h>
 #endif
 
+#include <boost/iostreams/tee.hpp>
+#include <boost/iostreams/stream.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/foreach.hpp>
+#include <boost/lambda/lambda.hpp>
+
 namespace tut
 {
 	std::string sSourceDir;
@@ -69,8 +77,24 @@ class LLTestCallback : public tut::callback
 	mPassedTests(0),
 	mFailedTests(0),
 	mSkippedTests(0),
-	mStream(stream)
+	// By default, capture a shared_ptr to std::cout, with a no-op "deleter"
+	// so that destroying the shared_ptr makes no attempt to delete std::cout.
+	mStream(boost::shared_ptr<std::ostream>(&std::cout, boost::lambda::_1))
 	{
+		if (stream)
+		{
+			// We want a boost::iostreams::tee_device that will stream to two
+			// std::ostreams.
+			typedef boost::iostreams::tee_device<std::ostream, std::ostream> TeeDevice;
+			// More than that, though, we want an actual stream using that
+			// device.
+			typedef boost::iostreams::stream<TeeDevice> TeeStream;
+			// Allocate and assign in two separate steps, per Herb Sutter.
+			// (Until we turn on C++11 support, have to wrap *stream with
+			// boost::ref() due to lack of perfect forwarding.)
+			boost::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream)));
+			mStream = pstream;
+		}
 	}
 
 	~LLTestCallback()
@@ -94,7 +118,10 @@ class LLTestCallback : public tut::callback
 	{
 		++mTotalTests;
 		std::ostringstream out;
-		out << "[" << tr.group << ", " << tr.test << "] ";
+		out << "[" << tr.group << ", " << tr.test;
+		if (! tr.name.empty())
+			out << ": " << tr.name;
+		out << "] ";
 		switch(tr.result)
 		{
 			case tut::test_result::ok:
@@ -123,56 +150,43 @@ class LLTestCallback : public tut::callback
 				break;
 			default:
 				++mFailedTests;
-				out << "unknown";
+				out << "unknown (tr.result == " << tr.result << ")";
 		}
 		if(mVerboseMode || (tr.result != tut::test_result::ok))
 		{
+			*mStream << out.str();
 			if(!tr.message.empty())
 			{
-				out << ": '" << tr.message << "'";
+				*mStream << ": '" << tr.message << "'";
 			}
-			if (mStream)
-			{
-				*mStream << out.str() << std::endl;
-			}
-			
-			std::cout << out.str() << std::endl;
-		}
-	}
-
-	virtual void run_completed()
-	{
-		if (mStream)
-		{
-			run_completed_(*mStream);
+			*mStream << std::endl;
 		}
-		run_completed_(std::cout);
 	}
 
 	virtual int getFailedTests() const { return mFailedTests; }
 
-	virtual void run_completed_(std::ostream &stream)
+	virtual void run_completed()
 	{
-		stream << "\tTotal Tests:\t" << mTotalTests << std::endl;
-		stream << "\tPassed Tests:\t" << mPassedTests;
+		*mStream << "\tTotal Tests:\t" << mTotalTests << std::endl;
+		*mStream << "\tPassed Tests:\t" << mPassedTests;
 		if (mPassedTests == mTotalTests)
 		{
-			stream << "\tYAY!! \\o/";
+			*mStream << "\tYAY!! \\o/";
 		}
-		stream << std::endl;
+		*mStream << std::endl;
 
 		if (mSkippedTests > 0)
 		{
-			stream << "\tSkipped known failures:\t" << mSkippedTests
+			*mStream << "\tSkipped known failures:\t" << mSkippedTests
 			<< std::endl;
 		}
 
 		if(mFailedTests > 0)
 		{
-			stream << "*********************************" << std::endl;
-			stream << "Failed Tests:\t" << mFailedTests << std::endl;
-			stream << "Please report or fix the problem." << std::endl;
-			stream << "*********************************" << std::endl;
+			*mStream << "*********************************" << std::endl;
+			*mStream << "Failed Tests:\t" << mFailedTests << std::endl;
+			*mStream << "Please report or fix the problem." << std::endl;
+			*mStream << "*********************************" << std::endl;
 		}
 	}
 
@@ -182,7 +196,7 @@ class LLTestCallback : public tut::callback
 	int mPassedTests;
 	int mFailedTests;
 	int mSkippedTests;
-	std::ostream *mStream;
+	boost::shared_ptr<std::ostream> mStream;
 };
 
 // TeamCity specific class which emits service messages
@@ -192,84 +206,111 @@ class LLTCTestCallback : public LLTestCallback
 {
 public:
 	LLTCTestCallback(bool verbose_mode, std::ostream *stream) :
-		LLTestCallback(verbose_mode, stream),
-		mTCStream()
+		LLTestCallback(verbose_mode, stream)
 	{
 	}
 
 	~LLTCTestCallback()
 	{
-	}	
+	}
 
 	virtual void group_started(const std::string& name) {
 		LLTestCallback::group_started(name);
-		mTCStream << "\n##teamcity[testSuiteStarted name='" << name << "']" << std::endl;
+		std::cout << "\n##teamcity[testSuiteStarted name='" << escape(name) << "']" << std::endl;
 	}
 
 	virtual void group_completed(const std::string& name) {
 		LLTestCallback::group_completed(name);
-		mTCStream << "##teamcity[testSuiteFinished name='" << name << "']" << std::endl;
+		std::cout << "##teamcity[testSuiteFinished name='" << escape(name) << "']" << std::endl;
 	}
 
 	virtual void test_completed(const tut::test_result& tr)
 	{
+		std::string testname(STRINGIZE(tr.group << "." << tr.test));
+		if (! tr.name.empty())
+		{
+			testname.append(":");
+			testname.append(tr.name);
+		}
+		testname = escape(testname);
+
+		// Sadly, tut::callback doesn't give us control at test start; have to
+		// backfill start message into TC output.
+		std::cout << "##teamcity[testStarted name='" << testname << "']" << std::endl;
+
+		// now forward call to base class so any output produced there is in
+		// the right TC context
 		LLTestCallback::test_completed(tr);
 
 		switch(tr.result)
 		{
 			case tut::test_result::ok:
-				mTCStream << "##teamcity[testStarted name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testFinished name='" << tr.group << "." << tr.test << "']" << std::endl;
 				break;
+
 			case tut::test_result::fail:
-				mTCStream << "##teamcity[testStarted name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testFailed name='" << tr.group << "." << tr.test << "' message='" << tr.message << "']" << std::endl;
-				mTCStream << "##teamcity[testFinished name='" << tr.group << "." << tr.test << "']" << std::endl;
-				break;
 			case tut::test_result::ex:
-				mTCStream << "##teamcity[testStarted name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testFailed name='" << tr.group << "." << tr.test << "' message='" << tr.message << "']" << std::endl;
-				mTCStream << "##teamcity[testFinished name='" << tr.group << "." << tr.test << "']" << std::endl;
-				break;
 			case tut::test_result::warn:
-				mTCStream << "##teamcity[testStarted name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testFailed name='" << tr.group << "." << tr.test << "' message='" << tr.message << "']" << std::endl;
-				mTCStream << "##teamcity[testFinished name='" << tr.group << "." << tr.test << "']" << std::endl;
-				break;
 			case tut::test_result::term:
-				mTCStream << "##teamcity[testStarted name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testFailed name='" << tr.group << "." << tr.test << "' message='" << tr.message << "']" << std::endl;
-				mTCStream << "##teamcity[testFinished name='" << tr.group << "." << tr.test << "']" << std::endl;
+				std::cout << "##teamcity[testFailed name='" << testname
+						  << "' message='" << escape(tr.message) << "']" << std::endl;
 				break;
+
 			case tut::test_result::skip:
-				mTCStream << "##teamcity[testStarted name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testIgnored name='" << tr.group << "." << tr.test << "']" << std::endl;
-				mTCStream << "##teamcity[testFinished name='" << tr.group << "." << tr.test << "']" << std::endl;
+				std::cout << "##teamcity[testIgnored name='" << testname << "']" << std::endl;
 				break;
+
 			default:
 				break;
 		}
 
+		std::cout << "##teamcity[testFinished name='" << testname << "']" << std::endl;
 	}
 
-	virtual void run_completed()
-	{
-		LLTestCallback::run_completed();
-
-		// dump the TC reporting results to cout
-		tc_run_completed_(std::cout);
-	}
-
-	virtual void tc_run_completed_(std::ostream &stream)
+	static std::string escape(const std::string& str)
 	{
-		
-		// dump the TC reporting results to cout
-		stream << mTCStream.str() << std::endl;
+		// Per http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ServiceMessages
+		std::string result;
+		BOOST_FOREACH(char c, str)
+		{
+			switch (c)
+			{
+			case '\'':
+				result.append("|'");
+				break;
+			case '\n':
+				result.append("|n");
+				break;
+			case '\r':
+				result.append("|r");
+				break;
+/*==========================================================================*|
+			// These are not possible 'char' values from a std::string.
+			case '\u0085':			// next line
+				result.append("|x");
+				break;
+			case '\u2028':			// line separator
+				result.append("|l");
+				break;
+			case '\u2029':			// paragraph separator
+				result.append("|p");
+				break;
+|*==========================================================================*/
+			case '|':
+				result.append("||");
+				break;
+			case '[':
+				result.append("|[");
+				break;
+			case ']':
+				result.append("|]");
+				break;
+			default:
+				result.push_back(c);
+				break;
+			}
+		}
+		return result;
 	}
-	
-protected:
-	std::ostringstream mTCStream;
-
 };
 
 
-- 
GitLab


From 028d9b3b3433bcb84253a23e98a2027b26b08255 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 3 Feb 2012 10:45:14 -0800
Subject: [PATCH 704/933] EXP-1868 FIX Remove Merchant Outbox from Me menu
 reviewed by Leslie

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1f72984166c..01713c539a0 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -152,13 +152,6 @@
         <menu_item_call.on_click
          function="BuyCurrency" />
       </menu_item_call>
-      <menu_item_call
-         label="Merchant Outbox..."
-         name="MerchantOutbox">
-        <menu_item_call.on_click
-         function="Floater.ToggleOrBringToFront"
-         parameter="outbox" />
-      </menu_item_call>
       <menu_item_call
            label="Account dashboard..."
            name="Manage My Account">
-- 
GitLab


From a3a69b1eb1fd7c346b97b0c3feca6151684fdced Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Fri, 3 Feb 2012 14:01:03 -0500
Subject: [PATCH 705/933] Added tag DRTVWR-114_3.2.8-beta1, 3.2.8-beta1 for
 changeset 16f8e2915f3f

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 33cd4d37a5d..91cb7425cfb 100644
--- a/.hgtags
+++ b/.hgtags
@@ -259,3 +259,5 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 3d75c836d178c7c7e788f256afe195f6cab764a2 DRTVWR-111_3.2.7-beta1
 3d75c836d178c7c7e788f256afe195f6cab764a2 3.2.7-beta1
 89980333c99dbaf1787fe20784f1d8849e9b5d4f 3.2.8-start
+16f8e2915f3f2e4d732fb3125daf229cb0fd1875 DRTVWR-114_3.2.8-beta1
+16f8e2915f3f2e4d732fb3125daf229cb0fd1875 3.2.8-beta1
-- 
GitLab


From a89fbc1d3396d1fe5516571fd6d8651d60709784 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 3 Feb 2012 11:14:54 -0800
Subject: [PATCH 706/933] EXP-1868 FIX Remove Merchant Outbox from Me menu
 removed merchant outbox context menu reviewed by Leslie

---
 indra/newview/llinventorybridge.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c0065a94e66..cebe93f0422 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -73,7 +73,7 @@
 #include "llwearablelist.h"
 
 // Marketplace outbox current disabled
-#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1
+#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	0
 #define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0
 #define BLOCK_WORN_ITEMS_IN_OUTBOX 1
 
-- 
GitLab


From ecb18174d4bdfe48999b3857453c790043b96c12 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 3 Feb 2012 14:37:25 -0800
Subject: [PATCH 707/933] EXP-1845 FIX Media controls cannot be selected or set
 in Build tools texture tab

---
 indra/newview/llfloatertools.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 5c8f5a5cc10..6978e6a430c 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -1192,8 +1192,6 @@ void LLFloaterTools::updateLandImpacts()
 
 void LLFloaterTools::getMediaState()
 {
-	if (!LLFloaterMediaSettings::instanceExists()) return;
-
 	LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection();
 	LLViewerObject* first_object = selected_objects->getFirstObject();
 	LLTextBox* media_info = getChild<LLTextBox>("media_info");
-- 
GitLab


From e0b29b67b6243b84a9c35d3460b91bed5d873d46 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 3 Feb 2012 14:43:38 -0800
Subject: [PATCH 708/933] EXP-1853 FIX Misspelled value in llbvhloader.cpp

---
 indra/llcharacter/llbvhloader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index f3cf950afae..2a0df263849 100644
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -1570,7 +1570,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
 		constraint_it++)
 		{
 			U8 byte = constraint_it->mChainLength;
-			dp.packU8(byte, "chain_lenght");
+			dp.packU8(byte, "chain_length");
 			
 			byte = constraint_it->mConstraintType;
 			dp.packU8(byte, "constraint_type");
-- 
GitLab


From db824cff75696c42fff80ba29dbb60f12d10a1da Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 3 Feb 2012 18:38:03 -0800
Subject: [PATCH 709/933] EXP-1862 : Suppress LLInventoryClipboard, move its
 functions to the unified LLClipboard and use this only

---
 indra/llui/llclipboard.cpp             | 102 +++++++++++++++++++----
 indra/llui/llclipboard.h               |  27 +++++-
 indra/newview/CMakeLists.txt           |   2 -
 indra/newview/llfavoritesbar.cpp       |  10 +--
 indra/newview/llfloatergesture.cpp     |  15 ++--
 indra/newview/llfolderview.cpp         |   8 +-
 indra/newview/llinventorybridge.cpp    |  26 +++---
 indra/newview/llinventoryclipboard.cpp | 110 -------------------------
 indra/newview/llinventoryclipboard.h   |  86 -------------------
 indra/newview/llinventoryfunctions.cpp |   1 -
 indra/newview/lltoolbarview.cpp        |   1 -
 11 files changed, 138 insertions(+), 250 deletions(-)
 delete mode 100644 indra/newview/llinventoryclipboard.cpp
 delete mode 100644 indra/newview/llinventoryclipboard.h

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 984c4ec5fb7..8917dc2d887 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -34,44 +34,104 @@
 #include "llview.h"
 #include "llwindow.h"
 
-// Global singleton
-LLClipboard gClipboard;
+LLClipboard::LLClipboard()
+: mCutMode(false)
+{
+}
 
+LLClipboard::~LLClipboard()
+{
+	reset();
+}
 
-LLClipboard::LLClipboard()
+void LLClipboard::add(const LLUUID& object)
 {
+	mObjects.put(object);
 }
 
+void LLClipboard::store(const LLUUID& object)
+{
+	reset();
+	mObjects.put(object);
+}
 
-LLClipboard::~LLClipboard()
+void LLClipboard::store(const LLDynamicArray<LLUUID>& inv_objects)
 {
+	reset();
+	S32 count = inv_objects.count();
+	for(S32 i = 0; i < count; i++)
+	{
+		mObjects.put(inv_objects[i]);
+	}
+}
+
+void LLClipboard::cut(const LLUUID& object)
+{
+	if(!mCutMode && !mObjects.empty())
+	{
+		//looks like there are some stored items, reset clipboard state
+		reset();
+	}
+	mCutMode = true;
+	add(object);
+}
+void LLClipboard::retrieve(LLDynamicArray<LLUUID>& inv_objects) const
+{
+	inv_objects.reset();
+	S32 count = mObjects.count();
+	for(S32 i = 0; i < count; i++)
+	{
+		inv_objects.put(mObjects[i]);
+	}
+}
+
+void LLClipboard::reset()
+{
+	mObjects.reset();
+	mCutMode = false;
+}
+
+// returns true if the clipboard has something pasteable in it.
+BOOL LLClipboard::hasContents() const
+{
+	return (mObjects.count() > 0);
 }
 
 
 void LLClipboard::copyFromSubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
 {
-	mSourceID = source_id;
+	reset();
+	if (source_id.notNull())
+	{
+		store(source_id);
+	}
 	mString = src.substr(pos, len);
+	llinfos << "Merov debug : copyFromSubstring, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl;
 	LLView::getWindow()->copyTextToClipboard( mString );
 }
 
 void LLClipboard::copyFromString(const LLWString &src, const LLUUID& source_id )
 {
-	mSourceID = source_id;
+	reset();
+	if (source_id.notNull())
+	{
+		store(source_id);
+	}
 	mString = src;
+	llinfos << "Merov debug : copyFromString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl;
 	LLView::getWindow()->copyTextToClipboard( mString );
 }
 
 const LLWString& LLClipboard::getPasteWString( LLUUID* source_id )
 {
-	if( mSourceID.notNull() )
+	if (hasContents())
 	{
 		LLWString temp_string;
 		LLView::getWindow()->pasteTextFromClipboard(temp_string);
 
-		if( temp_string != mString )
+		if (temp_string != mString)
 		{
-			mSourceID.setNull();
+			reset();
 			mString = temp_string;
 		}
 	}
@@ -80,11 +140,13 @@ const LLWString& LLClipboard::getPasteWString( LLUUID* source_id )
 		LLView::getWindow()->pasteTextFromClipboard(mString);
 	}
 
-	if( source_id )
+	if (source_id)
 	{
-		*source_id = mSourceID;
+		*source_id = (hasContents() ? mObjects[0] : LLUUID::null);
 	}
 
+	llinfos << "Merov debug : getPasteWString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl;
+
 	return mString;
 }
 
@@ -97,7 +159,11 @@ BOOL LLClipboard::canPasteString() const
 
 void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
 {
-	mSourceID = source_id;
+	reset();
+	if (source_id.notNull())
+	{
+		store(source_id);
+	}
 	mString = src.substr(pos, len);
 	LLView::getWindow()->copyTextToPrimary( mString );
 }
@@ -105,14 +171,14 @@ void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 le
 
 const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id )
 {
-	if( mSourceID.notNull() )
+	if (hasContents())
 	{
 		LLWString temp_string;
 		LLView::getWindow()->pasteTextFromPrimary(temp_string);
 
-		if( temp_string != mString )
+		if (temp_string != mString)
 		{
-			mSourceID.setNull();
+			reset();
 			mString = temp_string;
 		}
 	}
@@ -121,11 +187,11 @@ const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id )
 		LLView::getWindow()->pasteTextFromPrimary(mString);
 	}
 
-	if( source_id )
+	if (source_id)
 	{
-		*source_id = mSourceID;
+		*source_id = (hasContents() ? mObjects[0] : LLUUID::null);
 	}
-
+	
 	return mString;
 }
 
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 2567eaab488..2cb857145ed 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -34,6 +34,13 @@
 #include "llsingleton.h"
 #include "llinventory.h"
 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLClipboard
+//
+// This class is used to cut/copy/paste text strings and inventory items around 
+// the world. Use LLClipboard::getInstance()->method() to use its methods.
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 class LLClipboard : public LLSingleton<LLClipboard>
 {
 public:
@@ -45,20 +52,36 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	   which is implicitly copied upon selection on platforms which expect this
 	   (i.e. X11/Linux). */
 
+	// Text strings management
 	void		copyFromSubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
 	void		copyFromString(const LLWString &copy_from, const LLUUID& source_id = LLUUID::null );
 	BOOL		canPasteString() const;
 	const LLWString&	getPasteWString(LLUUID* source_id = NULL);
 
+	// Primary text string management (Linux gtk implementation)
 	void		copyFromPrimarySubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
 	BOOL		canPastePrimaryString() const;
 	const LLWString&	getPastePrimaryWString(LLUUID* source_id = NULL);	
 
 	// Support clipboard for object known only by their uuid
-	void		  setSourceObject(const LLUUID& source_id) { mSourceID = source_id; }
+	//void		  setSourceObject(const LLUUID& source_id) { mSourceID = source_id; }
+	
+	// Object list management
+	void add(const LLUUID& object);									// Adds to the current list of objects on the clipboard
+	void store(const LLUUID& object);								// Stores a single inventory object
+	void store(const LLDynamicArray<LLUUID>& inventory_objects);	// Stores an array of objects
+	void cut(const LLUUID& object);									// Adds to the current list of cut objects on the clipboard
+	void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const;	// Gets a copy of the objects on the clipboard
+	void reset();													// Clears the clipboard
 	
+	BOOL hasContents() const;										// true if the clipboard has something pasteable in it
+	bool isCutMode() const { return mCutMode; }
+
 private:
-	LLUUID      mSourceID;
+	// *TODO: To know if an asset ID can be serialized, check out LLAssetType::lookupIsAssetIDKnowable(EType asset_type)
+	LLDynamicArray<LLUUID> mObjects;
+	bool mCutMode;
+
 	LLWString	mString;
 };
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 69bf1f15a1f..325c2a12a65 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -287,7 +287,6 @@ set(viewer_SOURCE_FILES
     llinspectremoteobject.cpp
     llinspecttoast.cpp
     llinventorybridge.cpp
-    llinventoryclipboard.cpp
     llinventoryfilter.cpp
     llinventoryfunctions.cpp
     llinventoryicon.cpp
@@ -842,7 +841,6 @@ set(viewer_HEADER_FILES
     llinspectremoteobject.h
     llinspecttoast.h
     llinventorybridge.h
-    llinventoryclipboard.h
     llinventoryfilter.h
     llinventoryfunctions.h
     llinventoryicon.h
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 24bd2cf3139..c81bff4b5d2 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -39,7 +39,7 @@
 
 #include "llagent.h"
 #include "llclipboard.h"
-#include "llinventoryclipboard.h"
+#include "llclipboard.h"
 #include "llinventorybridge.h"
 #include "llinventoryfunctions.h"
 #include "llfloatersidepanelcontainer.h"
@@ -1187,7 +1187,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
 	}
 	else if (action == "copy")
 	{
-		LLInventoryClipboard::instance().store(mSelectedItemID);
+		LLClipboard::getInstance()->store(mSelectedItemID);
 	}
 	else if (action == "paste")
 	{
@@ -1211,13 +1211,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
 
 BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
 {
-	if (!LLInventoryClipboard::instance().hasContents())
+	if (!LLClipboard::getInstance()->hasContents())
 	{
 		return FALSE;
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLInventoryClipboard::instance().retrieve(objects);
+	LLClipboard::getInstance()->retrieve(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -1246,7 +1246,7 @@ void LLFavoritesBarCtrl::pastFromClipboard() const
 	{
 		LLInventoryItem* item = NULL;
 		LLDynamicArray<LLUUID> objects;
-		LLInventoryClipboard::instance().retrieve(objects);
+		LLClipboard::getInstance()->retrieve(objects);
 		S32 count = objects.count();
 		LLUUID parent_id(mFavoriteFolderId);
 		for(S32 i = 0; i < count; i++)
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index e025d6edb5c..281cafa90d3 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -32,7 +32,7 @@
 #include "llinventorybridge.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
-#include "llinventoryclipboard.h"
+#include "llclipboard.h"
 
 #include "llagent.h"
 #include "llappearancemgr.h"
@@ -391,11 +391,11 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command)
 	std::string command_name = command.asString();
 	if("paste" == command_name)
 	{
-		if(!LLInventoryClipboard::instance().hasContents())
+		if(!LLClipboard::getInstance()->hasContents())
 			return false;
 
 		LLDynamicArray<LLUUID> ids;
-		LLInventoryClipboard::instance().retrieve(ids);
+		LLClipboard::getInstance()->retrieve(ids);
 		for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
 		{
 			LLInventoryItem* item = gInventory.getItem(*it);
@@ -496,21 +496,20 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 		uuid_vec_t ids;
 		getSelectedIds(ids);
 		// make sure that clopboard is empty
-		LLInventoryClipboard::instance().reset();
+		LLClipboard::getInstance()->reset();
 		for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
 		{
 			LLInventoryItem* item = gInventory.getItem(*it);
 			if(item  && item->getInventoryType() == LLInventoryType::IT_GESTURE)
 			{
-				LLInventoryClipboard::instance().add(item->getUUID());
+				LLClipboard::getInstance()->add(item->getUUID());
 			}
 		}
 	}
 	else if ("paste" == command_name)
 	{
-		LLInventoryClipboard& clipbord = LLInventoryClipboard::instance();
 		LLDynamicArray<LLUUID> ids;
-		clipbord.retrieve(ids);
+		LLClipboard::getInstance()->retrieve(ids);
 		if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
 			return;
 		LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
@@ -530,7 +529,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 						gesture_dir->getUUID(), getString("copy_name", string_args), cb);
 			}
 		}
-		clipbord.reset();
+		LLClipboard::getInstance()->reset();
 	}
 	else if ("copy_uuid" == command_name)
 	{
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 79c987fa376..438d7e7ae35 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -30,7 +30,7 @@
 
 #include "llcallbacklist.h"
 #include "llinventorybridge.h"
-#include "llinventoryclipboard.h" // *TODO: remove this once hack below gone.
+#include "llclipboard.h" // *TODO: remove this once hack below gone.
 #include "llinventoryfilter.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodelbackgroundfetch.h"
@@ -1293,7 +1293,7 @@ BOOL LLFolderView::canCopy() const
 void LLFolderView::copy()
 {
 	// *NOTE: total hack to clear the inventory clipboard
-	LLInventoryClipboard::instance().reset();
+	LLClipboard::getInstance()->reset();
 	S32 count = mSelectedItems.size();
 	if(getVisible() && getEnabled() && (count > 0))
 	{
@@ -1334,7 +1334,7 @@ BOOL LLFolderView::canCut() const
 void LLFolderView::cut()
 {
 	// clear the inventory clipboard
-	LLInventoryClipboard::instance().reset();
+	LLClipboard::getInstance()->reset();
 	S32 count = mSelectedItems.size();
 	if(getVisible() && getEnabled() && (count > 0))
 	{
@@ -2111,7 +2111,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
 
 	if ("copy" == action)
 	{	
-		LLInventoryClipboard::instance().reset();
+		LLClipboard::getInstance()->reset();
 	}
 
 	static const std::string change_folder_string = "change_folder_type_";
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 869cb735d59..420b834933c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -47,7 +47,7 @@
 #include "llgiveinventory.h" 
 #include "llimfloater.h"
 #include "llimview.h"
-#include "llinventoryclipboard.h"
+#include "llclipboard.h"
 #include "llinventorydefines.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
@@ -212,7 +212,7 @@ void LLInvFVBridge::cutToClipboard()
 {
 	if(isItemMovable())
 	{
-		LLInventoryClipboard::instance().cut(mUUID);
+		LLClipboard::getInstance()->cut(mUUID);
 	}
 }
 // *TODO: make sure this does the right thing
@@ -397,7 +397,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
 
 BOOL LLInvFVBridge::isClipboardPasteable() const
 {
-	if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory())
+	if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory())
 	{
 		return FALSE;
 	}
@@ -410,7 +410,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 	const LLUUID &agent_id = gAgent.getID();
 
 	LLDynamicArray<LLUUID> objects;
-	LLInventoryClipboard::instance().retrieve(objects);
+	LLClipboard::getInstance()->retrieve(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -437,7 +437,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 
 BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 {
-	if (!LLInventoryClipboard::instance().hasContents() || !isAgentInventory())
+	if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory())
 	{
 		return FALSE;
 	}
@@ -448,7 +448,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLInventoryClipboard::instance().retrieve(objects);
+	LLClipboard::getInstance()->retrieve(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -1663,7 +1663,7 @@ BOOL LLItemBridge::copyToClipboard() const
 {
 	if(isItemCopyable())
 	{
-		LLInventoryClipboard::instance().add(mUUID);
+		LLClipboard::getInstance()->add(mUUID);
 		return TRUE;
 	}
 	return FALSE;
@@ -1775,7 +1775,7 @@ BOOL LLFolderBridge::copyToClipboard() const
 {
 	if(isItemCopyable())
 	{
-		LLInventoryClipboard::instance().add(mUUID);
+		LLClipboard::getInstance()->add(mUUID);
 		return TRUE;
 	}
 	return FALSE;
@@ -1796,7 +1796,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const
 		}
 
 		LLDynamicArray<LLUUID> objects;
-		LLInventoryClipboard::instance().retrieve(objects);
+		LLClipboard::getInstance()->retrieve(objects);
 		const LLViewerInventoryCategory *current_cat = getCategory();
 
 		// Search for the direct descendent of current Friends subfolder among all pasted items,
@@ -1834,7 +1834,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
 		const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat );
 		const LLUUID &current_cat_id = current_cat->getUUID();
 		LLDynamicArray<LLUUID> objects;
-		LLInventoryClipboard::instance().retrieve(objects);
+		LLClipboard::getInstance()->retrieve(objects);
 		S32 count = objects.count();
 		for(S32 i = 0; i < count; i++)
 		{
@@ -2825,7 +2825,7 @@ void LLFolderBridge::pasteFromClipboard()
 		const LLUUID parent_id(mUUID);
 
 		LLDynamicArray<LLUUID> objects;
-		LLInventoryClipboard::instance().retrieve(objects);
+		LLClipboard::getInstance()->retrieve(objects);
 		for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 			 iter != objects.end();
 			 ++iter)
@@ -2841,7 +2841,7 @@ void LLFolderBridge::pasteFromClipboard()
 						dropToOutfit(item, move_is_into_current_outfit);
 					}
 				}
-				else if(LLInventoryClipboard::instance().isCutMode())
+				else if (LLClipboard::getInstance()->isCutMode())
 				{
 					// move_inventory_item() is not enough,
 					//we have to update inventory locally too
@@ -2879,7 +2879,7 @@ void LLFolderBridge::pasteLinkFromClipboard()
 		const LLUUID parent_id(mUUID);
 
 		LLDynamicArray<LLUUID> objects;
-		LLInventoryClipboard::instance().retrieve(objects);
+		LLClipboard::getInstance()->retrieve(objects);
 		for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 			 iter != objects.end();
 			 ++iter)
diff --git a/indra/newview/llinventoryclipboard.cpp b/indra/newview/llinventoryclipboard.cpp
deleted file mode 100644
index 53da34f4486..00000000000
--- a/indra/newview/llinventoryclipboard.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/** 
- * @file llinventoryclipboard.cpp
- * @brief LLInventoryClipboard class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llinventoryclipboard.h"
-
-
-LLInventoryClipboard LLInventoryClipboard::sInstance;
-
-///----------------------------------------------------------------------------
-/// Local function declarations, constants, enums, and typedefs
-///----------------------------------------------------------------------------
-
-
-///----------------------------------------------------------------------------
-/// Class LLInventoryClipboard
-///----------------------------------------------------------------------------
-
-LLInventoryClipboard::LLInventoryClipboard()
-: mCutMode(false)
-{
-}
-
-LLInventoryClipboard::~LLInventoryClipboard()
-{
-	reset();
-}
-
-void LLInventoryClipboard::add(const LLUUID& object)
-{
-	mObjects.put(object);
-}
-
-// this stores a single inventory object
-void LLInventoryClipboard::store(const LLUUID& object)
-{
-	reset();
-	mObjects.put(object);
-}
-
-void LLInventoryClipboard::store(const LLDynamicArray<LLUUID>& inv_objects)
-{
-	reset();
-	S32 count = inv_objects.count();
-	for(S32 i = 0; i < count; i++)
-	{
-		mObjects.put(inv_objects[i]);
-	}
-}
-
-void LLInventoryClipboard::cut(const LLUUID& object)
-{
-	if(!mCutMode && !mObjects.empty())
-	{
-		//looks like there are some stored items, reset clipboard state
-		reset();
-	}
-	mCutMode = true;
-	add(object);
-}
-void LLInventoryClipboard::retrieve(LLDynamicArray<LLUUID>& inv_objects) const
-{
-	inv_objects.reset();
-	S32 count = mObjects.count();
-	for(S32 i = 0; i < count; i++)
-	{
-		inv_objects.put(mObjects[i]);
-	}
-}
-
-void LLInventoryClipboard::reset()
-{
-	mObjects.reset();
-	mCutMode = false;
-}
-
-// returns true if the clipboard has something pasteable in it.
-BOOL LLInventoryClipboard::hasContents() const
-{
-	return (mObjects.count() > 0);
-}
-
-
-///----------------------------------------------------------------------------
-/// Local function definitions
-///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventoryclipboard.h b/indra/newview/llinventoryclipboard.h
deleted file mode 100644
index b9f1451e5c1..00000000000
--- a/indra/newview/llinventoryclipboard.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/** 
- * @file llinventoryclipboard.h
- * @brief LLInventoryClipboard class header file
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLINVENTORYCLIPBOARD_H
-#define LL_LLINVENTORYCLIPBOARD_H
-
-#include "lldarray.h"
-#include "lluuid.h"
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInventoryClipboard
-//
-// This class is used to cut/copy/paste inventory items around the
-// world. This class is accessed through a singleton (only one
-// inventory clipboard for now) which can be referenced using the
-// instance() method.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-class LLInventoryClipboard
-{
-public:
-	// calling this before main() is undefined
-	static LLInventoryClipboard& instance() { return sInstance; }
-
-	// this method adds to the current list.
-	void add(const LLUUID& object);
-
-	// this stores a single inventory object
-	void store(const LLUUID& object);
-
-	// this method stores an array of objects
-	void store(const LLDynamicArray<LLUUID>& inventory_objects);
-
-	void cut(const LLUUID& object);
-	// this method gets the objects in the clipboard by copying them
-	// into the array provided.
-	void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const;
-
-	// this method empties out the clipboard
-	void reset();
-
-	// returns true if the clipboard has something pasteable in it.
-	BOOL hasContents() const;
-	bool isCutMode() const { return mCutMode; }
-
-protected:
-	static LLInventoryClipboard sInstance;
-
-	LLDynamicArray<LLUUID> mObjects;
-	bool mCutMode;
-
-public:
-	// please don't actually call these
-	LLInventoryClipboard();
-	~LLInventoryClipboard();
-private:
-	// please don't implement these
-	LLInventoryClipboard(const LLInventoryClipboard&);
-	LLInventoryClipboard& operator=(const LLInventoryClipboard&);
-};
-
-
-#endif // LL_LLINVENTORYCLIPBOARD_H
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index dd92188e9d2..ea00474b2a5 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -54,7 +54,6 @@
 #include "lliconctrl.h"
 #include "llimview.h"
 #include "llinventorybridge.h"
-#include "llinventoryclipboard.h"
 #include "llinventorymodel.h"
 #include "llinventorypanel.h"
 #include "lllineeditor.h"
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 8a0b0352343..81ad96f39e4 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -580,7 +580,6 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
 			uuid_vec_t cargo_ids;
 			types.push_back(DAD_WIDGET);
 			cargo_ids.push_back(uuid);
-			LLClipboard::getInstance()->setSourceObject(uuid);
 			LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER;
 			LLUUID srcID;
 			LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID);
-- 
GitLab


From e854db064547ae20a87bbeac399295a924cf1c8f Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 3 Feb 2012 19:04:36 -0800
Subject: [PATCH 710/933] EXP-1513 FIX Underscore ( _ ) fails to show in first
 chat entry in Local Chat EXP-1854 FIX Text positioning in mini inspector a
 couple pixels too low

---
 indra/llrender/llfontgl.cpp                   |   3 -
 indra/llui/lltextbase.cpp                     |  51 +++++-
 indra/llui/lltooltip.cpp                      |  10 +-
 indra/newview/llviewermedia.cpp               |   2 +-
 .../skins/default/xui/en/floater_aaa.xml      | 158 +++++++++++-------
 .../default/xui/en/floater_about_land.xml     |   6 +-
 .../xui/en/floater_merchant_outbox.xml        |   6 +-
 .../default/xui/en/floater_model_preview.xml  |  86 +++++-----
 .../floater_test_text_vertical_aligment.xml   | 112 +++++++++++++
 .../skins/default/xui/en/floater_toybox.xml   |   4 +-
 .../default/xui/en/panel_chat_header.xml      |   6 +-
 .../skins/default/xui/en/panel_chat_item.xml  |   4 +-
 .../default/xui/en/widgets/tab_container.xml  |   2 +-
 13 files changed, 319 insertions(+), 131 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 4519c5e7894..6e6d02177db 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -185,9 +185,6 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	//gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f);
 
 	LLVector2 origin(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY));
-	// snap the text origin to a pixel grid to start with
-	origin.mV[VX] -= llround((F32)sCurOrigin.mX) - (sCurOrigin.mX);
-	origin.mV[VY] -= llround((F32)sCurOrigin.mY) - (sCurOrigin.mY);
 
 	// Depth translation, so that floating text appears 'inworld'
 	// and is correclty occluded.
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 7e5974bf0e2..5fe90e1ee3e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2395,10 +2395,21 @@ void LLTextBase::updateRects()
 		}
 
 		mTextBoundingRect.mTop += mVPad;
-		//// subtract a pixel off the bottom to deal with rounding errors in measuring font height
-		//mTextBoundingRect.mBottom -= 1;
 
-		S32 delta_pos = -mTextBoundingRect.mBottom;
+		S32 delta_pos = 0;
+		
+		switch(mVAlign)
+		{
+		case LLFontGL::TOP:
+			delta_pos = llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom);
+			break;
+		case LLFontGL::VCENTER:
+			delta_pos = (llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2;
+			break;
+		case LLFontGL::BOTTOM:
+			delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom;
+			break;
+		}
 		// move line segments to fit new document rect
 		for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it)
 		{
@@ -2408,8 +2419,9 @@ void LLTextBase::updateRects()
 	}
 
 	// update document container dimensions according to text contents
-	LLRect doc_rect = mTextBoundingRect;
+	LLRect doc_rect;
 	// use old mVisibleTextRect constraint document to width of viewable region
+	doc_rect.mBottom = llmin(mVisibleTextRect.mBottom,  mTextBoundingRect.mBottom);
 	doc_rect.mLeft = 0;
 
 	// allow horizontal scrolling?
@@ -2419,11 +2431,22 @@ void LLTextBase::updateRects()
 	doc_rect.mRight = mScroller 
 		? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight)
 		: mVisibleTextRect.getWidth();
+	doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop);
 
 	if (!mScroller)
 	{
 		// push doc rect to top of text widget
-		doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop);
+		switch(mVAlign)
+		{
+		case LLFontGL::TOP:
+			doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop);
+			break;
+		case LLFontGL::VCENTER:
+			doc_rect.translate(0, (mVisibleTextRect.getHeight() - doc_rect.mTop) / 2);
+		case LLFontGL::BOTTOM:
+		default:
+			break;
+		}
 	}
 
 	mDocumentView->setShape(doc_rect);
@@ -2444,9 +2467,27 @@ void LLTextBase::updateRects()
 	}
 
 	// update document container again, using new mVisibleTextRect (that has scrollbars enabled as needed)
+	doc_rect.mBottom = llmin(mVisibleTextRect.mBottom,  mTextBoundingRect.mBottom);
+	doc_rect.mLeft = 0;
 	doc_rect.mRight = mScroller 
 		? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight)
 		: mVisibleTextRect.getWidth();
+	doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop);
+	if (!mScroller)
+	{
+		// push doc rect to top of text widget
+		switch(mVAlign)
+		{
+		case LLFontGL::TOP:
+			doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop);
+			break;
+		case LLFontGL::VCENTER:
+			doc_rect.translate(0, (mVisibleTextRect.getHeight() - doc_rect.mTop) / 2);
+		case LLFontGL::BOTTOM:
+		default:
+			break;
+		}
+	}
 	mDocumentView->setShape(doc_rect);
 }
 
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 23cdd9ad9a4..f737d48abfa 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -180,6 +180,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p)
 	params.font = p.font;
 	params.use_ellipses = true;
 	params.wrap = p.wrap;
+	params.font_valign = LLFontGL::VCENTER;
 	params.parse_urls = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips
 	mTextBox = LLUICtrlFactory::create<LLTextBox> (params);
 	addChild(mTextBox);
@@ -190,7 +191,6 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p)
 	{
 		LLButton::Params icon_params;
 		icon_params.name = "tooltip_info";
-		icon_params.label(""); // provid label but set to empty so name does not overwrite it -angela
 		LLRect icon_rect;
 		LLUIImage* imagep = p.image;
 		TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16);
@@ -291,6 +291,12 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p)
 	S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth());
 	S32 text_height = mTextBox->getTextPixelHeight();
 	mTextBox->reshape(text_width, text_height);
+	if (mInfoButton)
+	{
+		LLRect text_rect = mTextBox->getRect();
+		LLRect icon_rect = mInfoButton->getRect();
+		mTextBox->translate(0, icon_rect.getCenterY() - text_rect.getCenterY());
+	}
 
 	// reshape tooltip panel to fit text box
 	LLRect tooltip_rect = calcBoundingRect();
@@ -299,6 +305,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p)
 	tooltip_rect.mBottom = 0;
 	tooltip_rect.mLeft = 0;
 
+	mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding));
+
 	setShape(tooltip_rect);
 }
 
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 046360e9e9a..d7e79351c25 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1901,7 +1901,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 		}
 	}
 	
-	LL_WARNS_ONCE("Plugin") << "plugin intialization failed for mime type: " << media_type << LL_ENDL;
+	LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL;
 	LLSD args;
 	args["MIME_TYPE"] = media_type;
 	LLNotificationsUtil::add("NoPlugin", args);
diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml
index 930bbaa8cb1..d11373ce1d5 100644
--- a/indra/newview/skins/default/xui/en/floater_aaa.xml
+++ b/indra/newview/skins/default/xui/en/floater_aaa.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- legacy_header_height="18"
  can_minimize="false"
  can_tear_off="false"
  can_resize="true"
@@ -16,67 +15,98 @@
  save_dock_state="true"
  save_visibility="true"
  single_instance="true" 
- width="320">
-  <string name="nudge_parabuild" translate="false">Nudge 1</string>
-  <string name="test_the_vlt">This string CHANGE2 is extracted.</string>
-  <string name="testing_eli">Just a test. changes.</string>
-  <text_editor
-   parse_urls="true"
-   bg_readonly_color="ChatHistoryBgColor"
-   bg_writeable_color="ChatHistoryBgColor" 
-   border_visible="false"
-   follows="all"
-   font="SansSerif" 
-	 left="1"
-   top="20"
-   layout="topleft"
-	 height="260"
-   name="chat_history"
-   max_length="200000" 
-   parse_highlights="true"
-   text_color="ChatHistoryTextColor"
-   text_readonly_color="ChatHistoryTextColor"
-   translate="false"
-   track_end="true" 
-   wrap="true" 
-   width="320">
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    </text_editor>
+ width="650">
+  <text left="0"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned</text>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned
+  </text_editor>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 28538f78525..e05b2150a19 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -197,7 +197,7 @@
              left_pad="2"
              valign="center" 
              name="ContentRatingText"
-             top_delta="0"
+             top_delta="-2"
              width="250">
                 Adult
             </text>
@@ -209,7 +209,7 @@
              layout="topleft"
              left="10"
              name="Owner:"
-             top_pad="1"
+             top_pad="3"
              width="100">
                 Owner:
             </text>
@@ -736,7 +736,7 @@
              height="16"
              layout="topleft"
              left_pad="10"
-             top_delta="-3" 
+             top_delta="-1" 
              mouse_opaque="false"
              name="region_maturity_text"
              valign="center" 
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 498a9b6ce09..b01e5852dcf 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -99,7 +99,7 @@
             halign="center"
             font="SansSerifMedium"
             font_shadow="hard"
-            valign="bottom">
+            valign="top">
           Drag items here to create folders
         </text>
       </panel>
@@ -114,8 +114,8 @@
           height="20"
           wrap="true"
           halign="left"
-          valign="bottom"
-          font="SansSerif" />
+          valign="center"
+          font="SansSerif"/>
       <button
           label="Send to Marketplace"
           tool_tip="Push to my Marketplace Storefront"
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index eebc5ddc72a..0e211551e67 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -117,18 +117,18 @@
              name="lod_tab_border"
              top_pad="0"
              width="619" />
-            <text
-             follows="left|top"
-             height="18"
-             initial_value="Source"
-             layout="topleft"
-             left="75"
-             name="source"
-             text_color="ModelUploaderLabels"
-             top="15"
-             valign="center"
-             value="Source"
-             width="335" />
+          <text
+           follows="left|top"
+           height="18"
+           initial_value="Source"
+           layout="topleft"
+           left="75"
+           name="source"
+           text_color="ModelUploaderLabels"
+           top="15"
+           valign="center"
+           value="Source"
+           width="335"/>
             <text
              follows="left|top"
              halign="right"
@@ -163,7 +163,7 @@
              name="high_label"
              text_color="ModelUploaderLabels"
              top_pad="10"
-             valign="center"
+             valign="top"
              value="High"
              width="65" />
             <combo_box
@@ -240,34 +240,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="high_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="high_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="high_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
@@ -277,7 +277,7 @@
              left_delta="20"
              mouse_opaque="true"
              name="status_icon_high"
-             top_delta="0"
+             top_delta="-2"
              width="16" />
             <text
              follows="left|top"
@@ -288,7 +288,7 @@
              name="medium_label"
              text_color="ModelUploaderLabels"
              top_pad="15"
-             valign="center"
+             valign="top"
              value="Medium"
              width="65" />
             <combo_box
@@ -368,34 +368,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="medium_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="medium_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="medium_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
@@ -405,7 +405,7 @@
              left_delta="20"
              mouse_opaque="true"
              name="status_icon_medium"
-             top_delta="0"
+             top_delta="-2"
              width="16" />
             <text
              follows="left|top"
@@ -416,7 +416,7 @@
              name="low_label"
              text_color="ModelUploaderLabels"
              top_pad="15"
-             valign="center"
+             valign="top"
              value="Low"
              width="65" />
             <combo_box
@@ -496,34 +496,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="low_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="low_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="low_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
@@ -533,7 +533,7 @@
              left_delta="20"
              mouse_opaque="true"
              name="status_icon_low"
-             top_delta="0"
+             top_delta="-2"
              width="16" />
             <text
              follows="left|top"
@@ -544,7 +544,7 @@
              name="lowest_label"
              text_color="ModelUploaderLabels"
              top_pad="15"
-             valign="center"
+             valign="top"
              value="Lowest"
              width="65" />
             <combo_box
@@ -624,34 +624,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="lowest_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="lowest_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="lowest_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
diff --git a/indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..d11373ce1d5
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_minimize="false"
+ can_tear_off="false"
+ can_resize="true"
+ can_drag_on_left="false"
+ can_close="true"
+ can_dock="true"
+ bevel_style="in"
+ height="300"
+ layout="topleft"
+ name="Test Floater"
+ save_rect="true"
+ title="TEST FLOATER"
+ save_dock_state="true"
+ save_visibility="true"
+ single_instance="true" 
+ width="650">
+  <text left="0"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned</text>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned
+  </text_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index 72e6187a14d..fcaae9d172a 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -18,7 +18,7 @@
   <text
     follows="left|top"
     font="SansSerifMedium"
-    valign="bottom"
+    valign="top"
     halign="left"
     height="20"
     layout="topleft"
@@ -33,7 +33,7 @@
   <text
     follows="left|top"
     font="SansSerifMedium"
-    valign="bottom"
+    valign="top"
     halign="left"
     height="20"
     layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml
index 2645d472f98..5c5c718bdf9 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_header.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml
@@ -23,7 +23,7 @@
     <text
       parse_urls="false"
       allow_scroll="false"
-      v_pad = "7"
+      v_pad = "6"
       read_only = "true"
       follows="left|right"
       font.style="BOLD"
@@ -37,7 +37,7 @@
       top="0"
       translate="false"
       use_ellipses="true"
-      valign="bottom" 
+      valign="top" 
       value="TestString PleaseIgnore" />
   <text
     allow_scroll="false"
@@ -49,7 +49,7 @@
     left_pad="5"
     name="time_box"
     right="-5"
-    top="8"
+    top="7"
     value="23:30"
     width="110" />
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml
index 6af11054007..1b97de2b05e 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml
@@ -16,13 +16,13 @@
         top="3"
         width="18" />
 	<text_chat
-      top="5"
+      top="3"
       left="30"
       height="120"
       text_color="white"
       word_wrap="true"
       mouse_opaque="true"
-      valign="bottom"
+      valign="top"
       name="msg_text">
 	</text_chat>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
index 8f8126444d8..0586119681a 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -11,7 +11,7 @@ label_pad_left - padding to the left of tab button labels
                halign="center"
                font="SansSerifSmall" 
                tab_height="21"
-               label_pad_bottom="0"
+               label_pad_bottom="1"
                label_pad_left="4">
   <!--
   Possible additional attributes for tabs:
-- 
GitLab


From d1b00a324b8e9783212d680361a78b01b462e793 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 3 Feb 2012 19:16:33 -0800
Subject: [PATCH 711/933] made hardware settings floater dependent on
 preferences floater

---
 indra/newview/llfloaterpreference.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index a333989e7e5..655dde31454 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -741,7 +741,8 @@ void LLFloaterPreference::onClose(bool app_quitting)
 
 void LLFloaterPreference::onOpenHardwareSettings()
 {
-	LLFloaterReg::showInstance("prefs_hardware_settings");
+	LLFloater* floater = LLFloaterReg::showInstance("prefs_hardware_settings");
+	addDependentFloater(floater, FALSE);
 }
 // static 
 void LLFloaterPreference::onBtnOK()
-- 
GitLab


From 54bc900c952b964206d484aa0b92e42238819fc6 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 6 Feb 2012 10:00:15 -0500
Subject: [PATCH 712/933] Added tag 3.2.9-start for changeset 37dd400ad721

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 33cd4d37a5d..2701d2bab02 100644
--- a/.hgtags
+++ b/.hgtags
@@ -259,3 +259,4 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 3d75c836d178c7c7e788f256afe195f6cab764a2 DRTVWR-111_3.2.7-beta1
 3d75c836d178c7c7e788f256afe195f6cab764a2 3.2.7-beta1
 89980333c99dbaf1787fe20784f1d8849e9b5d4f 3.2.8-start
+37dd400ad721e2a89ee820ffc1e7e433c68f3ca2 3.2.9-start
-- 
GitLab


From 289d756ea86bd3898f41592146d8f549cd056846 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 6 Feb 2012 10:01:09 -0500
Subject: [PATCH 713/933] increment viewer version to 3.3.0

---
 indra/llcommon/llversionviewer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 27cdfcaa4e2..a869c74189b 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -28,8 +28,8 @@
 #define LL_LLVERSIONVIEWER_H
 
 const S32 LL_VERSION_MAJOR = 3;
-const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 9;
+const S32 LL_VERSION_MINOR = 3;
+const S32 LL_VERSION_PATCH = 0;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From 489d02324622fe59e041038916427badf05944e7 Mon Sep 17 00:00:00 2001
From: Tank_Master <none@none>
Date: Mon, 6 Feb 2012 09:31:13 -0800
Subject: [PATCH 714/933] Add more resolutions to the dropdown list in the
 window size floater.

---
 .../default/xui/en/floater_window_size.xml    | 60 ++++++++++++++-----
 1 file changed, 44 insertions(+), 16 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_window_size.xml b/indra/newview/skins/default/xui/en/floater_window_size.xml
index 355d2577854..115fe413f3c 100644
--- a/indra/newview/skins/default/xui/en/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/en/floater_window_size.xml
@@ -28,22 +28,50 @@
      tool_tip="width x height"
      top_pad="5"
      width="179">
-        <combo_box.item
-         label="1000 x 700 (default)"
-         name="item0"
-         value="1000 x 700" />
-        <combo_box.item
-         label="1024 x 768"
-         name="item1"
-         value="1024 x 768" />
-        <combo_box.item
-         label="1280 x 720 (720p)"
-         name="item2"
-         value="1280 x 720" />
-        <combo_box.item
-         label="1920 x 1080 (1080p)"
-         name="item3"
-         value="1920 x 1080" />
+      <combo_box.item
+       label="1000 x 700 (default)"
+       name="item1"
+       value="1000 x 700" />
+      <combo_box.item
+       label="1024 x 768 (4:3 XGA)"
+       name="item2"
+       value="1024 x 768" />
+      <combo_box.item
+       label="1280 x 720 (16:9 HDTV)"
+       name="item3"
+       value="1280 x 720" />
+      <combo_box.item
+       label="1280 x 800 (5:8 WXGA)"
+       name="item4"
+       value="1280 x 800" />
+      <combo_box.item
+       label="1280 x 1024 (5:4 SXGA)"
+       name="item5"
+       value="1280 x 1024" />
+      <combo_box.item
+       label="1440 x 900 (8:5 WSXGA)"
+       name="item7"
+       value="1440 x 900" />
+      <combo_box.item
+       label="1600 x 900 (16:9 HD+)"
+       name="item8"
+       value="1600 x 900" />
+      <combo_box.item
+       label="1600 x 1200 (4:3 UXGA)"
+       name="item9"
+       value="1600 x 1200" />
+      <combo_box.item
+       label="1680 x 1050 (8:5 WSXGA+)"
+       name="item10"
+       value="1680 x 1050" />
+      <combo_box.item
+       label="1920 x 1080 (16:9 HDTV)"
+       name="item11"
+       value="1920 x 1080" />
+      <combo_box.item
+       label="1920 x 1200 (8:5 WUXGA)"
+       name="item12"
+       value="1920 x 1200" />
     </combo_box>
     <button
      follows="right|bottom"
-- 
GitLab


From 836e5e56ee1d726f8047b1b3277281ba6ca93516 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Mon, 6 Feb 2012 14:43:32 -0500
Subject: [PATCH 715/933] Added tag DRTVWR-115_3.2.8-beta2, 3.2.8-beta2 for
 changeset 987425b1acf4

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 33cd4d37a5d..8442f3ce899 100644
--- a/.hgtags
+++ b/.hgtags
@@ -259,3 +259,5 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 3d75c836d178c7c7e788f256afe195f6cab764a2 DRTVWR-111_3.2.7-beta1
 3d75c836d178c7c7e788f256afe195f6cab764a2 3.2.7-beta1
 89980333c99dbaf1787fe20784f1d8849e9b5d4f 3.2.8-start
+987425b1acf4752379b2e1eb20944b4b35d67a85 DRTVWR-115_3.2.8-beta2
+987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
-- 
GitLab


From ae7d475aebc836203984654912df036a11c365fc Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 6 Feb 2012 12:43:23 -0800
Subject: [PATCH 716/933] SH-2794, resolved merge conflict and corrected logic
 in LLVertexBuffer::determineUsage() to work the way it used to.

---
 indra/llrender/llvertexbuffer.cpp | 121 ++++++------------------------
 indra/llrender/llvertexbuffer.h   |  17 +----
 2 files changed, 24 insertions(+), 114 deletions(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 230c1faa404..e4a5cd02995 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -204,26 +204,14 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
 	Record rec;
 	rec.mGLName = name;
 	rec.mClientData = buffer;
-<<<<<<< local
-=======
-
-	sBytesPooled += size;
->>>>>>> other
 	
-<<<<<<< local
 	if (buffer == NULL)
-=======
-	if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
->>>>>>> other
 	{
 		glDeleteBuffersARB(1, &rec.mGLName);
 	}
 	else
 	{
-<<<<<<< local
 		sBytesPooled += size;
-=======
->>>>>>> other
 		mFreeList[i].push_back(rec);
 	}
 }
@@ -441,7 +429,7 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
 
 	U32 count = pos.size();
 	llassert_always(norm.size() >= pos.size());
-	llassert_always(count > 0) ;
+	llassert_always(count > 0);
 
 	unbind();
 	
@@ -559,11 +547,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
 void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
 {
 	validateRange(start, end, count, indices_offset);
-<<<<<<< local
 	mMappable = false;
-=======
-	mMappable = FALSE;
->>>>>>> other
 	gGL.syncMatrices();
 
 	llassert(mNumVerts >= 0);
@@ -618,11 +602,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
 void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-<<<<<<< local
 	mMappable = false;
-=======
-	mMappable = FALSE;
->>>>>>> other
 	gGL.syncMatrices();
 
 	llassert(mNumIndices >= 0);
@@ -668,11 +648,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
 void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
 {
 	llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
-<<<<<<< local
 	mMappable = false;
-=======
-	mMappable = FALSE;
->>>>>>> other
 	gGL.syncMatrices();
 	
 	llassert(mNumVerts >= 0);
@@ -764,8 +740,8 @@ void LLVertexBuffer::cleanupClass()
 
 	if(sPrivatePoolp)
 	{
-		LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp) ;
-		sPrivatePoolp = NULL ;
+		LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp);
+		sPrivatePoolp = NULL;
 	}
 }
 
@@ -780,22 +756,22 @@ S32 LLVertexBuffer::determineUsage(S32 usage)
 		ret_usage = 0;
 	}
 	
-	if (usage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
+	if (ret_usage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
 	{
 		ret_usage = 0;
 	}
 	
-	if (usage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
+	if (ret_usage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
 	{
 		ret_usage = GL_STREAM_DRAW_ARB;
 	}
 	
-	if (usage == 0 && LLRender::sGLCoreProfile)
+	if (ret_usage == 0 && LLRender::sGLCoreProfile)
 	{ //MUST use VBOs for all rendering
 		ret_usage = GL_STREAM_DRAW_ARB;
 	}
 	
-	if (usage && usage != GL_STREAM_DRAW_ARB)
+	if (ret_usage && ret_usage != GL_STREAM_DRAW_ARB)
 	{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
 		if (sDisableVBOMapping)
 		{ //always use stream draw if VBO mapping is disabled
@@ -837,55 +813,8 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
 {
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR);
 
-	if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
-	{
-		mMappable = true;
-	}
-	else
-	{
-		mMappable = false;
-	}
-
-<<<<<<< local
-=======
-	if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
-	{
-		mUsage = 0;
-	}
-	
-	if (mUsage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
-	{
-		mUsage = GL_STREAM_DRAW_ARB;
-	}
-
-	if (mUsage == 0 && LLRender::sGLCoreProfile)
-	{ //MUST use VBOs for all rendering
-		mUsage = GL_STREAM_DRAW_ARB;
-	}
-
-	if (mUsage && mUsage != GL_STREAM_DRAW_ARB)
-	{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
-		if (sDisableVBOMapping)
-		{ //always use stream draw if VBO mapping is disabled
-			mUsage = GL_STREAM_DRAW_ARB;
-		}
-		else
-		{
-			mUsage = GL_DYNAMIC_DRAW_ARB;
-		}
-	}
-	
-
-	if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
-	{
-		mMappable = TRUE;
-	}
-	else
-	{
-		mMappable = FALSE;
-	}
+	mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping);
 
->>>>>>> other
 	//zero out offsets
 	for (U32 i = 0; i < TYPE_MAX; i++)
 	{
@@ -963,7 +892,7 @@ LLVertexBuffer::~LLVertexBuffer()
 	
 	mFence = NULL;
 
-	llassert_always(!mMappedData && !mMappedIndexData) ;
+	llassert_always(!mMappedData && !mMappedIndexData);
 };
 
 void LLVertexBuffer::placeFence() const
@@ -1136,11 +1065,7 @@ void LLVertexBuffer::destroyGLBuffer()
 		}
 		else
 		{
-<<<<<<< local
 			FREE_MEM(sPrivatePoolp, (void*) mMappedData);
-=======
-			FREE_MEM(sPrivatePoolp, (void*) mMappedData) ;
->>>>>>> other
 			mMappedData = NULL;
 			mEmpty = true;
 		}
@@ -1161,11 +1086,7 @@ void LLVertexBuffer::destroyGLIndices()
 		}
 		else
 		{
-<<<<<<< local
 			FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData);
-=======
-			FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData) ;
->>>>>>> other
 			mMappedIndexData = NULL;
 			mEmpty = true;
 		}
@@ -1515,16 +1436,16 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 				log_glerror();
 
 				//check the availability of memory
-				LLMemory::logMemoryInfo(true) ; 
+				LLMemory::logMemoryInfo(true);
 			
 				if(mMappable)
 				{			
 					//--------------------
 					//print out more debug info before crash
-					llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl ;
-					GLint size ;
-					glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size) ;
-					llinfos << "GL_ARRAY_BUFFER_ARB size is " << size << llendl ;
+					llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl;
+					GLint size;
+					glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size);
+					llinfos << "GL_ARRAY_BUFFER_ARB size is " << size << llendl;
 					//--------------------
 
 					GLint buff;
@@ -1539,7 +1460,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
 				}
 				else
 				{
-					llerrs << "memory allocation for vertex data failed." << llendl ;
+					llerrs << "memory allocation for vertex data failed." << llendl;
 				}
 			}
 		}
@@ -1693,7 +1614,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 		if (!mMappedIndexData)
 		{
 			log_glerror();
-			LLMemory::logMemoryInfo(true) ;
+			LLMemory::logMemoryInfo(true);
 
 			if(mMappable)
 			{
@@ -1708,7 +1629,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
 			}
 			else
 			{
-				llerrs << "memory allocation for Index data failed. " << llendl ;
+				llerrs << "memory allocation for Index data failed. " << llendl;
 			}
 		}
 	}
@@ -1739,10 +1660,10 @@ void LLVertexBuffer::unmapBuffer()
 	LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER);
 	if (!useVBOs())
 	{
-		return ; //nothing to unmap
+		return; //nothing to unmap
 	}
 
-	bool updated_all = false ;
+	bool updated_all = false;
 
 	if (mMappedData && mVertexLocked)
 	{
@@ -1873,10 +1794,10 @@ void LLVertexBuffer::unmapBuffer()
 			glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB);
 			stop_glerror();
 
-			mMappedIndexData = NULL ;
+			mMappedIndexData = NULL;
 		}
 
-		mIndexLocked = false ;
+		mIndexLocked = false;
 		sMappedCount--;
 	}
 
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 036f535d812..d8591996630 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -93,7 +93,7 @@ class LLGLFence
 
 //============================================================================
 // base class 
-class LLPrivateMemoryPool ;
+class LLPrivateMemoryPool;
 class LLVertexBuffer : public LLRefCount
 {
 public:
@@ -260,11 +260,7 @@ class LLVertexBuffer : public LLRefCount
 	volatile U8* getMappedIndices() const			{ return mMappedIndexData; }
 	S32 getOffset(S32 type) const			{ return mOffsets[type]; }
 	S32 getUsage() const					{ return mUsage; }
-<<<<<<< local
 	bool isWriteable() const				{ return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? true : false; }
-=======
-	BOOL isWriteable() const				{ return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
->>>>>>> other
 
 	void draw(U32 mode, U32 count, U32 indices_offset) const;
 	void drawArrays(U32 mode, U32 offset, U32 count) const;
@@ -293,7 +289,6 @@ class LLVertexBuffer : public LLRefCount
 	
 	volatile U8* mMappedData;	// pointer to currently mapped data (NULL if unmapped)
 	volatile U8* mMappedIndexData;	// pointer to currently mapped indices (NULL if unmapped)
-<<<<<<< local
 
 	U32		mMappedDataUsingVBOs : 1;
 	U32		mMappedIndexDataUsingVBOs : 1;
@@ -303,13 +298,7 @@ class LLVertexBuffer : public LLRefCount
 	U32		mEmpty : 1;			// if true, client buffer is empty (or NULL). Old values have been discarded.	
 	
 	mutable bool	mMappable;     // if true, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
-=======
-	BOOL	mVertexLocked;			// if TRUE, vertex buffer is being or has been written to in client memory
-	BOOL	mIndexLocked;			// if TRUE, index buffer is being or has been written to in client memory
-	BOOL	mFinal;			// if TRUE, buffer can not be mapped again
-	BOOL	mEmpty;			// if TRUE, client buffer is empty (or NULL). Old values have been discarded.	
-	mutable BOOL	mMappable;     // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
->>>>>>> other
+
 	S32		mOffsets[TYPE_MAX];
 
 	std::vector<MappedRegion> mMappedVertexRegions;
@@ -323,7 +312,7 @@ class LLVertexBuffer : public LLRefCount
 	static S32 determineUsage(S32 usage);
 
 private:
-	static LLPrivateMemoryPool* sPrivatePoolp ;
+	static LLPrivateMemoryPool* sPrivatePoolp;
 
 public:
 	static S32 sCount;
-- 
GitLab


From e328dcf4062177c903d3099d0d16477824d23025 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 6 Feb 2012 23:07:41 +0200
Subject: [PATCH 717/933] EXP-1849 FIXED Privacy settings could be set to
 default when modifying other preferences before login.

---
 indra/llxml/llcontrol.h                       |  4 ++
 indra/newview/llfloaterpreference.cpp         | 39 +++++++++++++++++++
 indra/newview/llfloaterpreference.h           |  8 ++--
 indra/newview/llstartup.cpp                   |  1 -
 .../default/xui/en/floater_preferences.xml    |  2 +-
 5 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index bf38a8b062d..597031ec707 100644
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -92,6 +92,8 @@ typedef enum e_control_type
 
 class LLControlVariable : public LLRefCount
 {
+	LOG_CLASS(LLControlVariable);
+
 	friend class LLControlGroup;
 	
 public:
@@ -180,6 +182,8 @@ T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& contro
 //const U32 STRING_CACHE_SIZE = 10000;
 class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
 {
+	LOG_CLASS(LLControlGroup);
+
 protected:
 	typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
 	ctrl_name_table_t mNameTable;
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 655dde31454..173b0e538ca 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1801,7 +1801,46 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl)
 	}
 }
 
+class LLPanelPreferencePrivacy : public LLPanelPreference
+{
+public:
+	LLPanelPreferencePrivacy()
+	{
+		mAccountIndependentSettings.push_back("VoiceCallsFriendsOnly");
+		mAccountIndependentSettings.push_back("AutoDisengageMic");
+	}
+
+	/*virtual*/ void saveSettings()
+	{
+		LLPanelPreference::saveSettings();
+
+		// Don't save (=erase from the saved values map) per-account privacy settings
+		// if we're not logged in, otherwise they will be reset to defaults on log off.
+		if (LLStartUp::getStartupState() != STATE_STARTED)
+		{
+			// Erase only common settings, assuming there are no color settings on Privacy page.
+			for (control_values_map_t::iterator it = mSavedValues.begin(); it != mSavedValues.end(); )
+			{
+				const std::string setting = it->first->getName();
+				if (std::find(mAccountIndependentSettings.begin(),
+					mAccountIndependentSettings.end(), setting) == mAccountIndependentSettings.end())
+				{
+					mSavedValues.erase(it++);
+				}
+				else
+				{
+					++it;
+				}
+			}
+		}
+	}
+
+private:
+	std::list<std::string> mAccountIndependentSettings;
+};
+
 static LLRegisterPanelClassWrapper<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics");
+static LLRegisterPanelClassWrapper<LLPanelPreferencePrivacy> t_pref_privacy("panel_preference_privacy");
 
 BOOL LLPanelPreferenceGraphics::postBuild()
 {
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 7ee3294478b..ec5994e9175 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -198,15 +198,17 @@ class LLPanelPreference : public LLPanel
 	virtual void saveSettings();
 	
 	class Updater;
+
+protected:
+	typedef std::map<LLControlVariable*, LLSD> control_values_map_t;
+	control_values_map_t mSavedValues;
+
 private:
 	//for "Only friends and groups can call or IM me"
 	static void showFriendsOnlyWarning(LLUICtrl*, const LLSD&);
 	//for "Show my Favorite Landmarks at Login"
 	static void showFavoritesOnLoginWarning(LLUICtrl* checkbox, const LLSD& value);
 
-	typedef std::map<LLControlVariable*, LLSD> control_values_map_t;
-	control_values_map_t mSavedValues;
-
 	typedef std::map<std::string, LLColor4> string_color_map_t;
 	string_color_map_t mSavedColors;
 
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 3923b4510a7..0ac8c1fe397 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -880,7 +880,6 @@ bool idle_startup()
 		LLFile::mkdir(gDirUtilp->getLindenUserDir());
 
 		// Set PerAccountSettingsFile to the default value.
-		std::string per_account_settings_file = LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount");
 		gSavedSettings.setString("PerAccountSettingsFile",
 			gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, 
 				LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount")));
diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index 402868bb977..b2662331b05 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -100,7 +100,7 @@
          help_topic="preferences_colors_tab"
          name="colors" />
         <panel
-		 class="panel_preference"
+         class="panel_preference_privacy"
          filename="panel_preferences_privacy.xml"
          label="Privacy"
          layout="topleft"
-- 
GitLab


From 21f3634d29fda4ea39537102bfdcc29c37e718ba Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 6 Feb 2012 18:00:18 -0500
Subject: [PATCH 718/933] STORM-1793 Fix dumb syntax error

---
 indra/newview/llworld.cpp | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 5b2e78477c7..fbd8b3ada39 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1190,19 +1190,18 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 		LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
 		LLVector3d pos_global = pVOAvatar->getPositionGlobal();
 		LLUUID uuid = pVOAvatar->getID();
-		if( !pVOAvatar->isDead() &&
-			!pVOAvatar->isSelf() &&
-			!uuid.isNull() &&
+		if( !pVOAvatar->isDead()
+			&& !pVOAvatar->isSelf()
+			&& !uuid.isNull() &&
 			dist_vec_squared(pos_global, relative_to) <= radius_squared)
+		{
+			if(positions != NULL)
 			{
-				if(positions != NULL)
-				{
-					positions->push_back(pos_global);
-				}
-				if(avatar_ids !=NULL)
-				{
-					avatar_ids->push_back(uuid);
-				}
+				positions->push_back(pos_global);
+			}
+			if(avatar_ids !=NULL)
+			{
+				avatar_ids->push_back(uuid);
 			}
 		}
 	}
-- 
GitLab


From 9761375ac244af36635899c73e99efc46b68b589 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 6 Feb 2012 15:43:53 -0800
Subject: [PATCH 719/933] EXP-1841 : Refactoring of LLClipboard, simplify the
 API and make it behave like a normal clipboard.

---
 indra/llui/llclipboard.cpp               | 112 +++++++----------------
 indra/llui/llclipboard.h                 |  23 ++---
 indra/llui/lllineeditor.cpp              |  19 ++--
 indra/llui/llscrolllistctrl.cpp          |   2 +-
 indra/llui/lltexteditor.cpp              |  20 ++--
 indra/newview/llfavoritesbar.cpp         |   2 +-
 indra/newview/llfloatergesture.cpp       |   2 +-
 indra/newview/llinventorybridge.cpp      |   3 +
 indra/newview/llpanelteleporthistory.cpp |   2 +-
 indra/newview/llpaneltopinfobar.cpp      |   2 +-
 indra/newview/llpanelwearing.cpp         |   2 +-
 indra/newview/llurllineeditorctrl.cpp    |   2 +-
 12 files changed, 60 insertions(+), 131 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 8917dc2d887..5c8db29ae43 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -91,112 +91,62 @@ void LLClipboard::reset()
 	mCutMode = false;
 }
 
-// returns true if the clipboard has something pasteable in it.
+// Returns true if the LL Clipboard has pasteable items in it
 BOOL LLClipboard::hasContents() const
 {
 	return (mObjects.count() > 0);
 }
 
-
-void LLClipboard::copyFromSubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
+// Copy the input string to the LL and the system clipboard
+bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
 {
 	reset();
-	if (source_id.notNull())
-	{
-		store(source_id);
-	}
 	mString = src.substr(pos, len);
-	llinfos << "Merov debug : copyFromSubstring, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl;
-	LLView::getWindow()->copyTextToClipboard( mString );
+	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
 }
 
-void LLClipboard::copyFromString(const LLWString &src, const LLUUID& source_id )
+// Copy the input uuid to the LL clipboard
+// Convert the uuid to string and copy that string to the system clipboard if legit
+bool LLClipboard::copyToClipboard(const LLUUID& src, const LLAssetType::EType type)
 {
+	bool res = false;
 	reset();
-	if (source_id.notNull())
-	{
-		store(source_id);
-	}
-	mString = src;
-	llinfos << "Merov debug : copyFromString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl;
-	LLView::getWindow()->copyTextToClipboard( mString );
-}
-
-const LLWString& LLClipboard::getPasteWString( LLUUID* source_id )
-{
-	if (hasContents())
+	if (src.notNull())
 	{
-		LLWString temp_string;
-		LLView::getWindow()->pasteTextFromClipboard(temp_string);
-
-		if (temp_string != mString)
+		res = true;
+		if (LLAssetType::lookupIsAssetIDKnowable(type))
 		{
-			reset();
-			mString = temp_string;
+			LLWString source = utf8str_to_wstring(src.asString());
+			res = copyToClipboard(source, 0, source.size());
+		}
+		if (res)
+		{
+			store(src);
 		}
 	}
-	else
-	{
-		LLView::getWindow()->pasteTextFromClipboard(mString);
-	}
-
-	if (source_id)
-	{
-		*source_id = (hasContents() ? mObjects[0] : LLUUID::null);
-	}
-
-	llinfos << "Merov debug : getPasteWString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl;
-
-	return mString;
-}
-
-
-BOOL LLClipboard::canPasteString() const
-{
-	return LLView::getWindow()->isClipboardTextAvailable();
-}
-
-
-void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
-{
-	reset();
-	if (source_id.notNull())
-	{
-		store(source_id);
-	}
-	mString = src.substr(pos, len);
-	LLView::getWindow()->copyTextToPrimary( mString );
+	return res;
 }
 
-
-const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id )
+// Copy the System clipboard to the output string.
+// Manage the LL Clipboard / System clipboard consistency
+bool LLClipboard::pasteFromClipboard(LLWString &dst, bool use_primary)
 {
-	if (hasContents())
+	bool res = (use_primary ? LLView::getWindow()->pasteTextFromPrimary(dst) : LLView::getWindow()->pasteTextFromClipboard(dst));
+	if (res)
 	{
-		LLWString temp_string;
-		LLView::getWindow()->pasteTextFromPrimary(temp_string);
-
-		if (temp_string != mString)
+		if (dst != mString)
 		{
+			// Invalidate the LL clipboard if the System had a different string in it (i.e. some copy/cut was done in some other app)
 			reset();
-			mString = temp_string;
 		}
+		mString = dst;
 	}
-	else
-	{
-		LLView::getWindow()->pasteTextFromPrimary(mString);
-	}
-
-	if (source_id)
-	{
-		*source_id = (hasContents() ? mObjects[0] : LLUUID::null);
-	}
-	
-	return mString;
+	return res;
 }
 
-
-BOOL LLClipboard::canPastePrimaryString() const
+// Return true if there's something on the System clipboard
+bool LLClipboard::isTextAvailable(bool use_primary) const
 {
-	return LLView::getWindow()->isPrimaryTextAvailable();
+	return (use_primary ? LLView::getWindow()->isPrimaryTextAvailable() : LLView::getWindow()->isClipboardTextAvailable());
 }
+
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 2cb857145ed..bb2d003703c 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -32,6 +32,7 @@
 #include "lluuid.h"
 #include "stdenums.h"
 #include "llsingleton.h"
+#include "llassettype.h"
 #include "llinventory.h"
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -52,19 +53,11 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	   which is implicitly copied upon selection on platforms which expect this
 	   (i.e. X11/Linux). */
 
-	// Text strings management
-	void		copyFromSubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
-	void		copyFromString(const LLWString &copy_from, const LLUUID& source_id = LLUUID::null );
-	BOOL		canPasteString() const;
-	const LLWString&	getPasteWString(LLUUID* source_id = NULL);
-
-	// Primary text string management (Linux gtk implementation)
-	void		copyFromPrimarySubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
-	BOOL		canPastePrimaryString() const;
-	const LLWString&	getPastePrimaryWString(LLUUID* source_id = NULL);	
-
-	// Support clipboard for object known only by their uuid
-	//void		  setSourceObject(const LLUUID& source_id) { mSourceID = source_id; }
+	// Text strings and single item management
+	bool		copyToClipboard(const LLWString& src, S32 pos, S32 len, bool use_primary = false);
+	bool		copyToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);
+	bool		pasteFromClipboard(LLWString& dst, bool use_primary = false);
+	bool		isTextAvailable(bool use_primary = false) const;
 	
 	// Object list management
 	void add(const LLUUID& object);									// Adds to the current list of objects on the clipboard
@@ -78,11 +71,9 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	bool isCutMode() const { return mCutMode; }
 
 private:
-	// *TODO: To know if an asset ID can be serialized, check out LLAssetType::lookupIsAssetIDKnowable(EType asset_type)
 	LLDynamicArray<LLUUID> mObjects;
 	bool mCutMode;
-
-	LLWString	mString;
+	LLWString mString;
 };
 
 #endif  // LL_LLCLIPBOARD_H
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 9292158b7cb..e961cfb14f5 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1047,7 +1047,7 @@ void LLLineEditor::cut()
 		// Prepare for possible rollback
 		LLLineEditorRollback rollback( this );
 
-		LLClipboard::getInstance()->copyFromSubstring( mText.getWString(), left_pos, length );
+		LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length );
 		deleteSelection();
 
 		// Validate new string and rollback the if needed.
@@ -1078,13 +1078,13 @@ void LLLineEditor::copy()
 	{
 		S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 		S32 length = llabs( mSelectionStart - mSelectionEnd );
-		LLClipboard::getInstance()->copyFromSubstring( mText.getWString(), left_pos, length );
+		LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length );
 	}
 }
 
 BOOL LLLineEditor::canPaste() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->canPasteString(); 
+	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(); 
 }
 
 void LLLineEditor::paste()
@@ -1115,14 +1115,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
 	if (can_paste_it)
 	{
 		LLWString paste;
-		if (is_primary)
-		{
-			paste = LLClipboard::getInstance()->getPastePrimaryWString();
-		}
-		else 
-		{
-			paste = LLClipboard::getInstance()->getPasteWString();
-		}
+		LLClipboard::getInstance()->pasteFromClipboard(paste, is_primary);
 
 		if (!paste.empty())
 		{
@@ -1209,13 +1202,13 @@ void LLLineEditor::copyPrimary()
 	{
 		S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 		S32 length = llabs( mSelectionStart - mSelectionEnd );
-		LLClipboard::getInstance()->copyFromPrimarySubstring( mText.getWString(), left_pos, length );
+		LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length, true);
 	}
 }
 
 BOOL LLLineEditor::canPastePrimary() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->canPastePrimaryString(); 
+	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(true); 
 }
 
 void LLLineEditor::updatePrimary()
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 8cbc2a8f993..0a9d862b66c 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -2504,7 +2504,7 @@ void	LLScrollListCtrl::copy()
 	{
 		buffer += (*itor)->getContentsCSV() + "\n";
 	}
-	LLClipboard::getInstance()->copyFromSubstring(utf8str_to_wstring(buffer), 0, buffer.length());
+	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(buffer), 0, buffer.length());
 }
 
 // virtual
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 22a577cda88..ffe012c110c 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1332,7 +1332,7 @@ void LLTextEditor::cut()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	LLClipboard::getInstance()->copyFromSubstring( getWText(), left_pos, length, mSourceID );
+	LLClipboard::getInstance()->copyToClipboard( getWText(), left_pos, length);
 	deleteSelection( FALSE );
 
 	onKeyStroke();
@@ -1352,12 +1352,12 @@ void LLTextEditor::copy()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	LLClipboard::getInstance()->copyFromSubstring(getWText(), left_pos, length, mSourceID);
+	LLClipboard::getInstance()->copyToClipboard(getWText(), left_pos, length);
 }
 
 BOOL LLTextEditor::canPaste() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->canPasteString();
+	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable();
 }
 
 // paste from clipboard
@@ -1393,16 +1393,8 @@ void LLTextEditor::pasteHelper(bool is_primary)
 		return;
 	}
 
-	LLUUID source_id;
 	LLWString paste;
-	if (is_primary)
-	{
-		paste = LLClipboard::getInstance()->getPastePrimaryWString(&source_id);
-	}
-	else 
-	{
-		paste = LLClipboard::getInstance()->getPasteWString(&source_id);
-	}
+	LLClipboard::getInstance()->pasteFromClipboard(paste, is_primary);
 
 	if (paste.empty())
 	{
@@ -1475,12 +1467,12 @@ void LLTextEditor::copyPrimary()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	LLClipboard::getInstance()->copyFromPrimarySubstring(getWText(), left_pos, length, mSourceID);
+	LLClipboard::getInstance()->copyToClipboard(getWText(), left_pos, length, true);
 }
 
 BOOL LLTextEditor::canPastePrimary() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->canPastePrimaryString();
+	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(true);
 }
 
 void LLTextEditor::updatePrimary()
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index c81bff4b5d2..4308bf2d3c8 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1118,7 +1118,7 @@ BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
 }
 void copy_slurl_to_clipboard_cb(std::string& slurl)
 {
-	LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(slurl));
+	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
 
 	LLSD args;
 	args["SLURL"] = slurl;
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 281cafa90d3..3c647284f66 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -533,7 +533,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 	}
 	else if ("copy_uuid" == command_name)
 	{
-		LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
+		LLClipboard::getInstance()->copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
 	}
 }
 
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 420b834933c..14f1bb9d410 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -409,6 +409,9 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 
 	const LLUUID &agent_id = gAgent.getID();
 
+	// Merov : This should be suppressed for 2 reasons:
+	// 1. folders should be pastable
+	// 2. when pasting, we should paste what is authorized and let the rest not pasted
 	LLDynamicArray<LLUUID> objects;
 	LLClipboard::getInstance()->retrieve(objects);
 	S32 count = objects.count();
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index a4c9af3fad1..f92fbf32205 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -358,7 +358,7 @@ void LLTeleportHistoryPanel::ContextMenu::onInfo()
 //static
 void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl)
 {
-	LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(slurl));
+	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
 }
 
 void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 0e3ff990666..0ad207ef00a 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -467,7 +467,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
 		LLAgentUI::buildSLURL(slurl, false);
 		LLUIString location_str(slurl.getSLURLString());
 
-		LLClipboard::getInstance()->copyFromString(location_str);
+		LLClipboard::getInstance()->copyToClipboard(location_str,0,location_str.length());
 	}
 }
 
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 12867566936..5199bcb6b17 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -302,6 +302,6 @@ void LLPanelWearing::copyToClipboard()
 		}
 	}
 
-	LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(text));
+	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(text),0,text.size());
 }
 // EOF
diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp
index 9d7e26d41c9..3efebcade97 100644
--- a/indra/newview/llurllineeditorctrl.cpp
+++ b/indra/newview/llurllineeditorctrl.cpp
@@ -89,5 +89,5 @@ void LLURLLineEditor::copyEscapedURLToClipboard()
 	else // human-readable location
 		text_to_copy = utf8str_to_wstring(unescaped_text);
 		
-	LLClipboard::getInstance()->copyFromString( text_to_copy );
+	LLClipboard::getInstance()->copyToClipboard(text_to_copy, 0, text_to_copy.size());
 }
-- 
GitLab


From ba32b72a9eea3ded3ee09675cc56670e618f652e Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 6 Feb 2012 16:20:38 -0800
Subject: [PATCH 720/933] Mac build fix -- added missing enumeration from
 switch

---
 indra/llui/lltextbase.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 5fe90e1ee3e..e2d9a6cb814 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2409,6 +2409,9 @@ void LLTextBase::updateRects()
 		case LLFontGL::BOTTOM:
 			delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom;
 			break;
+		case LLFontGL::BASELINE:
+			// do nothing
+			break;
 		}
 		// move line segments to fit new document rect
 		for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it)
-- 
GitLab


From 38e0b7de96de02243453eeaf5710b924f68abc7a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 6 Feb 2012 18:56:19 -0600
Subject: [PATCH 721/933] SH-2729 Fix for horizontal line of glitching graphics
 when DoF enabled

---
 indra/llrender/llshadermgr.cpp                       |  2 ++
 indra/llrender/llshadermgr.h                         |  2 ++
 .../shaders/class1/deferred/dofCombineF.glsl         | 12 +++++++++++-
 indra/newview/pipeline.cpp                           |  9 +++++++--
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 908443e8cf2..d03d349f0f8 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1070,6 +1070,8 @@ void LLShaderMgr::initAttribsAndUniforms()
 	mReservedUniforms.push_back("magnification");
 	mReservedUniforms.push_back("max_cof");
 	mReservedUniforms.push_back("res_scale");
+	mReservedUniforms.push_back("dof_width");
+	mReservedUniforms.push_back("dof_height");
 
 	mReservedUniforms.push_back("depthMap");
 	mReservedUniforms.push_back("shadowMap0");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 950e6c9c2f0..e28bda6de2d 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -142,6 +142,8 @@ class LLShaderMgr
 		DOF_MAGNIFICATION,
 		DOF_MAX_COF,
 		DOF_RES_SCALE,
+		DOF_WIDTH,
+		DOF_HEIGHT,
 
 		DEFERRED_DEPTH,
 		DEFERRED_SHADOW0,
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index 01e3505359f..0cf5afc5685 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -37,14 +37,24 @@ uniform vec2 screen_res;
 
 uniform float max_cof;
 uniform float res_scale;
+uniform float dof_width;
+uniform float dof_height;
 
 VARYING vec2 vary_fragcoord;
 
+vec4 dofSample(sampler2DRect tex, vec2 tc)
+{
+	tc.x = min(tc.x, dof_width);
+	tc.y = min(tc.y, dof_height);
+
+	return texture2DRect(tex, tc);
+}
+
 void main() 
 {
 	vec2 tc = vary_fragcoord.xy;
 	
-	vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*res_scale);
+	vec4 dof = dofSample(diffuseRect, vary_fragcoord.xy*res_scale);
 	
 	vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index a64655960f6..dffc541001b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6642,9 +6642,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				mDeferredLight.flush();
 			}
 
+			U32 dof_width = mScreen.getWidth()*CameraDoFResScale;
+			U32 dof_height = mScreen.getHeight()*CameraDoFResScale;
+			
 			{ //perform DoF sampling at half-res (preserve alpha channel)
 				mScreen.bindTarget();
-				glViewport(0,0,(GLsizei) (mScreen.getWidth()*CameraDoFResScale), (GLsizei) (mScreen.getHeight()*CameraDoFResScale));
+				glViewport(0,0, dof_width, dof_height);
 				gGL.setColorMask(true, false);
 
 				shader = &gDeferredPostProgram;
@@ -6657,7 +6660,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
 				shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
-
+				
 				gGL.begin(LLRender::TRIANGLE_STRIP);
 				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
 				gGL.vertex2f(-1,-1);
@@ -6702,6 +6705,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 
 				shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF);
 				shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale);
+				shader->uniform1f(LLShaderMgr::DOF_WIDTH, dof_width-1);
+				shader->uniform1f(LLShaderMgr::DOF_HEIGHT, dof_height-1);
 
 				gGL.begin(LLRender::TRIANGLE_STRIP);
 				gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
-- 
GitLab


From 449d2b106fd18bfb6f0e516eaedd395de18c7608 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 7 Feb 2012 10:25:18 -0500
Subject: [PATCH 722/933] STORM-1803 Fix syntax error that the Windows compiler
 did not complain about

---
 indra/newview/llfilepicker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index b426bcf84b7..f741b9b8103 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -1203,7 +1203,7 @@ static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker)
 	GtkFileFilter *gfilter = gtk_file_filter_new();
 	gtk_file_filter_add_pattern(gfilter, "*.bvh");
 	gtk_file_filter_add_pattern(gfilter, "*.anim");
-	std::string filtername = LLTrans::getString("animation_files") + " (*.bvh; *.anim)");
+	std::string filtername = LLTrans::getString("animation_files") + " (*.bvh; *.anim)";
 	add_common_filters_to_gtkchooser(gfilter, picker, filtername);
 	return filtername;
 }
-- 
GitLab


From 33a42b32ca72031a79edca821966f6ebbdcddc93 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 7 Feb 2012 13:06:38 -0500
Subject: [PATCH 723/933] Disable MSVC warning C4702 (unreachable code) in
 Boost headers.

---
 indra/test/test.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 3e7be29b390..1adcfb6f45f 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -54,8 +54,16 @@
 #include <gtest/gtest.h>
 #endif
 
+#if LL_MSVC
+#pragma warning (push)
+#pragma warning (disable : 4702) // warning C4702: unreachable code
+#endif
 #include <boost/iostreams/tee.hpp>
 #include <boost/iostreams/stream.hpp>
+#if LL_MSVC
+#pragma warning (pop)
+#endif
+
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/foreach.hpp>
-- 
GitLab


From d56be1f1751f66bff09f0d223ed4712974e69e09 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 7 Feb 2012 12:31:48 -0800
Subject: [PATCH 724/933] EXP-1181 WIP as a designer I would like to specify
 default floater positions using realtive coordinates refactored LLCoord code
 to be templated, ultimately to support arbitrary conversions

---
 indra/llmath/llcoord.h                   | 74 +++++-------------------
 indra/llrender/llfontgl.cpp              | 40 ++++---------
 indra/llrender/llfontgl.h                |  5 +-
 indra/llui/llaccordionctrltab.cpp        |  2 +-
 indra/llui/llfloater.h                   |  3 +
 indra/llui/llmenugl.cpp                  |  2 +-
 indra/llui/llscrolllistitem.cpp          |  2 +-
 indra/llui/llscrolllistitem.h            |  2 +-
 indra/llui/lltoolbar.cpp                 |  2 +-
 indra/llui/llui.cpp                      |  9 +--
 indra/llui/llview.cpp                    |  6 +-
 indra/llwindow/llwindowcallbacks.cpp     |  2 -
 indra/llwindow/llwindowcallbacks.h       |  2 +-
 indra/llwindow/llwindowwin32.cpp         |  2 +-
 indra/newview/llappviewerwin32.cpp       |  3 +-
 indra/newview/llnetmap.h                 |  2 +-
 indra/newview/llpanelprimmediacontrols.h |  2 +-
 indra/newview/llpopupview.cpp            |  2 +-
 indra/newview/llviewercamera.h           |  2 +-
 indra/newview/llviewerwindow.cpp         | 14 ++---
 20 files changed, 55 insertions(+), 123 deletions(-)

diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h
index 706ad927870..c0623e6d1f9 100644
--- a/indra/llmath/llcoord.h
+++ b/indra/llmath/llcoord.h
@@ -27,79 +27,31 @@
 #define LL_LLCOORD_H
 
 // A two-dimensional pixel value
+template<typename COORD_FRAME, typename VALUE_TYPE>
 class LLCoord
 {
 public:
-	S32		mX;
-	S32		mY;
+	typedef LLCoord<COORD_FRAME, VALUE_TYPE> self_t;
+	VALUE_TYPE		mX;
+	VALUE_TYPE		mY;
 
 	LLCoord():	mX(0), mY(0)
 	{}
 	LLCoord(S32 x, S32 y): mX(x), mY(y)
 	{}
-	virtual ~LLCoord()
-	{}
-
-	virtual void set(S32 x, S32 y)		{ mX = x; mY = y; }
-};
 
+	void set(S32 x, S32 y) { mX = x; mY = y;}
+	bool operator==(const self_t& other) const { return mX == other.mX && mY == other.mY; }
+	bool operator!=(const self_t& other) const { return !(*this == other); }
 
-// GL coordinates start in the client region of a window,
-// with left, bottom = 0, 0
-class LLCoordGL : public LLCoord
-{
-public:
-	LLCoordGL() : LLCoord()
-	{}
-	LLCoordGL(S32 x, S32 y) : LLCoord(x, y)
-	{}
-	bool operator==(const LLCoordGL& other) const { return mX == other.mX && mY == other.mY; }
-	bool operator!=(const LLCoordGL& other) const { return !(*this == other); }
 };
 
-//bool operator ==(const LLCoordGL& a, const LLCoordGL& b);
-
-// Window coords include things like window borders,
-// menu regions, etc.
-class LLCoordWindow : public LLCoord
-{
-public:
-	LLCoordWindow() : LLCoord()
-	{}
-	LLCoordWindow(S32 x, S32 y) : LLCoord(x, y)
-	{}
-	bool operator==(const LLCoordWindow& other) const { return mX == other.mX && mY == other.mY; }
-	bool operator!=(const LLCoordWindow& other) const { return !(*this == other); }
-};
+struct LL_COORD_TYPE_GL {};
+struct LL_COORD_TYPE_WINDOW {};
+struct LL_COORD_TYPE_SCREEN {};
 
-
-// Screen coords start at left, top = 0, 0
-class LLCoordScreen : public LLCoord
-{
-public:
-	LLCoordScreen() : LLCoord()
-	{}
-	LLCoordScreen(S32 x, S32 y) : LLCoord(x, y)
-	{}
-	bool operator==(const LLCoordScreen& other) const { return mX == other.mX && mY == other.mY; }
-	bool operator!=(const LLCoordScreen& other) const { return !(*this == other); }
-};
-
-class LLCoordFont : public LLCoord
-{
-public:
-	F32 mZ;
-	
-	LLCoordFont() : LLCoord(), mZ(0.f)
-	{}
-	LLCoordFont(S32 x, S32 y, F32 z = 0) : LLCoord(x,y), mZ(z)
-	{}
-	
-	void set(S32 x, S32 y) { LLCoord::set(x,y); mZ = 0.f; }
-	void set(S32 x, S32 y, F32 z) { mX = x; mY = y; mZ = z; }
-	bool operator==(const LLCoordFont& other) const { return mX == other.mX && mY == other.mY; }
-	bool operator!=(const LLCoordFont& other) const { return !(*this == other); }
-};
-	
+typedef LLCoord<LL_COORD_TYPE_GL, S32> LLCoordGL;
+typedef LLCoord<LL_COORD_TYPE_WINDOW, S32> LLCoordWindow;
+typedef LLCoord<LL_COORD_TYPE_SCREEN, S32> LLCoordScreen;
 
 #endif
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 6e6d02177db..fccbf37a8dd 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -56,8 +56,9 @@ std::string LLFontGL::sAppDir;
 LLColor4 LLFontGL::sShadowColor(0.f, 0.f, 0.f, 1.f);
 LLFontRegistry* LLFontGL::sFontRegistry = NULL;
 
-LLCoordFont LLFontGL::sCurOrigin;
-std::vector<LLCoordFont> LLFontGL::sOriginStack;
+LLCoordGL LLFontGL::sCurOrigin;
+F32 LLFontGL::sCurDepth;
+std::vector<std::pair<LLCoordGL, F32> > LLFontGL::sOriginStack;
 
 const F32 EXT_X_BEARING = 1.f;
 const F32 EXT_Y_BEARING = 0.f;
@@ -68,20 +69,6 @@ const F32 PIXEL_CORRECTION_DISTANCE = 0.01f;
 const F32 PAD_UVY = 0.5f; // half of vertical padding between glyphs in the glyph texture
 const F32 DROP_SHADOW_SOFT_STRENGTH = 0.3f;
 
-static F32 llfont_round_x(F32 x)
-{
-	//return llfloor((x-LLFontGL::sCurOrigin.mX)/LLFontGL::sScaleX+0.5f)*LLFontGL::sScaleX+LLFontGL::sCurOrigin.mX;
-	//return llfloor(x/LLFontGL::sScaleX+0.5f)*LLFontGL::sScaleY;
-	return x;
-}
-
-static F32 llfont_round_y(F32 y)
-{
-	//return llfloor((y-LLFontGL::sCurOrigin.mY)/LLFontGL::sScaleY+0.5f)*LLFontGL::sScaleY+LLFontGL::sCurOrigin.mY;
-	//return llfloor(y+0.5f);
-	return y;
-}
-
 LLFontGL::LLFontGL()
 {
 }
@@ -177,18 +164,11 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 
 	gGL.loadUIIdentity();
 	
-	//gGL.translateUI(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ);
-
-	// this code snaps the text origin to a pixel grid to start with
-	//F32 pixel_offset_x = llround((F32)sCurOrigin.mX) - (sCurOrigin.mX);
-	//F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY);
-	//gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f);
-
 	LLVector2 origin(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY));
 
-	// Depth translation, so that floating text appears 'inworld'
-	// and is correclty occluded.
-	gGL.translatef(0.f,0.f,sCurOrigin.mZ);
+	// Depth translation, so that floating text appears 'in-world'
+	// and is correctly occluded.
+	gGL.translatef(0.f,0.f,sCurDepth);
 
 	S32 chars_drawn = 0;
 	S32 i;
@@ -1134,22 +1114,22 @@ void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* c
 {
 	S32 index = 0;
 
-	vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mRight), llfont_round_y(screen_rect.mTop), 0.f);
+	vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mTop, 0.f);
 	uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mTop);
 	colors_out[index] = color;
 	index++;
 
-	vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mLeft), llfont_round_y(screen_rect.mTop), 0.f);
+	vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 0.f);
 	uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mTop);
 	colors_out[index] = color;
 	index++;
 
-	vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mLeft), llfont_round_y(screen_rect.mBottom), 0.f);
+	vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 0.f);
 	uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom);
 	colors_out[index] = color;
 	index++;
 
-	vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mRight), llfont_round_y(screen_rect.mBottom), 0.f);
+	vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 0.f);
 	uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom);
 	colors_out[index] = color;
 }
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index 9d7e2891e32..74bdbb43e74 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -186,8 +186,9 @@ class LLFontGL
 	static std::string getFontPathLocal();
 	static std::string getFontPathSystem();
 
-	static LLCoordFont sCurOrigin;
-	static std::vector<LLCoordFont> sOriginStack;
+	static LLCoordGL sCurOrigin;
+	static F32			sCurDepth;
+	static std::vector<std::pair<LLCoordGL, F32> > sOriginStack;
 
 	static LLColor4 sShadowColor;
 
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 7a5f9f9fd6c..c025cd7939e 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -976,7 +976,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child)
 			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
 			{
-				LLUI::translate((F32)child->getRect().mLeft, (F32)child->getRect().mBottom, 0.f);
+				LLUI::translate((F32)child->getRect().mLeft, (F32)child->getRect().mBottom);
 				child->draw();
 
 			}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 59b35d206f2..1eb8c964f9d 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -82,6 +82,9 @@ namespace LLInitParam
 	};
 }
 
+struct LL_COORD_FLOATER;
+
+typedef LLCoord<LL_COORD_FLOATER, F32> LLCoordFloater;
 
 class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 {
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 3e547efd97c..1284231e523 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3425,7 +3425,7 @@ void LLMenuHolderGL::draw()
 		
 		LLUI::pushMatrix();
 		{
-			LLUI::translate((F32)item_rect.mLeft, (F32)item_rect.mBottom, 0.f);
+			LLUI::translate((F32)item_rect.mLeft, (F32)item_rect.mBottom);
 			selecteditem->getMenu()->drawBackground(selecteditem, interpolant);
 			selecteditem->draw();
 		}
diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp
index d95752e31cb..5a1e96ab034 100644
--- a/indra/llui/llscrolllistitem.cpp
+++ b/indra/llui/llscrolllistitem.cpp
@@ -138,7 +138,7 @@ void LLScrollListItem::draw(const LLRect& rect, const LLColor4& fg_color, const
 
 		LLUI::pushMatrix();
 		{
-			LLUI::translate((F32) cur_x, (F32) rect.mBottom, 0.0f);
+			LLUI::translate((F32) cur_x, (F32) rect.mBottom);
 
 			cell->draw( fg_color, highlight_color );
 		}
diff --git a/indra/llui/llscrolllistitem.h b/indra/llui/llscrolllistitem.h
index 611df729b41..13655b5873b 100644
--- a/indra/llui/llscrolllistitem.h
+++ b/indra/llui/llscrolllistitem.h
@@ -33,10 +33,10 @@
 #include "v4color.h"
 #include "llinitparam.h"
 #include "llscrolllistcell.h"
+#include "llcoord.h"
 
 #include <vector>
 
-class LLCoordGL;
 class LLCheckBoxCtrl;
 class LLResizeBar;
 class LLScrollListCtrl;
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 9b31a6449df..81ea0ebf0ca 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -827,7 +827,7 @@ void LLToolBar::draw()
 	// rect may have shifted during layout
 	LLUI::popMatrix();
 	LLUI::pushMatrix();
-	LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom, 0.f);
+	LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
 
 	// Position the caret 
 	LLIconCtrl* caret = getChild<LLIconCtrl>("caret");
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 6b74c5a6be0..931b696c903 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1688,21 +1688,22 @@ void LLUI::translate(F32 x, F32 y, F32 z)
 	gGL.translateUI(x,y,z);
 	LLFontGL::sCurOrigin.mX += (S32) x;
 	LLFontGL::sCurOrigin.mY += (S32) y;
-	LLFontGL::sCurOrigin.mZ += z;
+	LLFontGL::sCurDepth += z;
 }
 
 //static
 void LLUI::pushMatrix()
 {
 	gGL.pushUIMatrix();
-	LLFontGL::sOriginStack.push_back(LLFontGL::sCurOrigin);
+	LLFontGL::sOriginStack.push_back(std::make_pair(LLFontGL::sCurOrigin, LLFontGL::sCurDepth));
 }
 
 //static
 void LLUI::popMatrix()
 {
 	gGL.popUIMatrix();
-	LLFontGL::sCurOrigin = *LLFontGL::sOriginStack.rbegin();
+	LLFontGL::sCurOrigin = LLFontGL::sOriginStack.back().first;
+	LLFontGL::sCurDepth = LLFontGL::sOriginStack.back().second;
 	LLFontGL::sOriginStack.pop_back();
 }
 
@@ -1712,7 +1713,7 @@ void LLUI::loadIdentity()
 	gGL.loadUIIdentity(); 
 	LLFontGL::sCurOrigin.mX = 0;
 	LLFontGL::sCurOrigin.mY = 0;
-	LLFontGL::sCurOrigin.mZ = 0;
+	LLFontGL::sCurDepth = 0.f;
 }
 
 //static
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index e1ee0a5b14f..1a62fe75fcc 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1106,7 +1106,7 @@ void LLView::drawChildren()
 				{
 					LLUI::pushMatrix();
 					{
-						LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom, 0.f);
+						LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom);
 						// flag the fact we are in draw here, in case overridden draw() method attempts to remove this widget
 						viewp->mInDraw = true;
 						viewp->draw();
@@ -1159,7 +1159,7 @@ void LLView::drawDebugRect()
 
 		if (getUseBoundingRect())
 		{
-			LLUI::translate((F32)mBoundingRect.mLeft - (F32)mRect.mLeft, (F32)mBoundingRect.mBottom - (F32)mRect.mBottom, 0.f);
+			LLUI::translate((F32)mBoundingRect.mLeft - (F32)mRect.mLeft, (F32)mBoundingRect.mBottom - (F32)mRect.mBottom);
 		}
 
 		LLRect debug_rect = getUseBoundingRect() ? mBoundingRect : mRect;
@@ -1231,7 +1231,7 @@ void LLView::drawChild(LLView* childp, S32 x_offset, S32 y_offset, BOOL force_dr
 			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
 			{
-				LLUI::translate((F32)childp->getRect().mLeft + x_offset, (F32)childp->getRect().mBottom + y_offset, 0.f);
+				LLUI::translate((F32)childp->getRect().mLeft + x_offset, (F32)childp->getRect().mBottom + y_offset);
 				childp->draw();
 			}
 			LLUI::popMatrix();
diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp
index c2705bbf746..9712ae1d91a 100644
--- a/indra/llwindow/llwindowcallbacks.cpp
+++ b/indra/llwindow/llwindowcallbacks.cpp
@@ -28,8 +28,6 @@
 
 #include "llwindowcallbacks.h"
 
-#include "llcoord.h"
-
 //
 // LLWindowCallbacks
 //
diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h
index 8572b442f1d..7da5959700c 100644
--- a/indra/llwindow/llwindowcallbacks.h
+++ b/indra/llwindow/llwindowcallbacks.h
@@ -26,7 +26,7 @@
 #ifndef LLWINDOWCALLBACKS_H
 #define LLWINDOWCALLBACKS_H
 
-class LLCoordGL;
+#include "llcoord.h"
 class LLWindow;
 
 class LLWindowCallbacks
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 67d1a168e6e..a2459864338 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -3328,7 +3328,7 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position )
 
 			LLWinImm::setCompositionWindow( himc, &ime_form );
 
-			sWinIMEWindowPosition.set( win_pos.mX, win_pos.mY );
+			sWinIMEWindowPosition = win_pos;
 		}
 
 		LLWinImm::releaseContext(mWindowHandle, himc);
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 647ace7ee32..6931b55c4c5 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -30,7 +30,8 @@
 
 #include "llmemtype.h"
 
-#include "llwindowwin32.cpp" // *FIX: for setting gIconResource.
+#include "llwindowwin32.h" // *FIX: for setting gIconResource.
+#include "llgl.h"
 #include "res/resource.h" // *FIX: for setting gIconResource.
 
 #include <fcntl.h>		//_O_APPEND
diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h
index 20fcee0814b..1f7e7d68c60 100644
--- a/indra/newview/llnetmap.h
+++ b/indra/newview/llnetmap.h
@@ -33,9 +33,9 @@
 #include "v3dmath.h"
 #include "v4color.h"
 #include "llpointer.h"
+#include "llcoord.h"
 
 class LLColor4U;
-class LLCoordGL;
 class LLImageRaw;
 class LLViewerTexture;
 class LLFloaterMap;
diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h
index 66956181f2b..eeb433e3062 100644
--- a/indra/newview/llpanelprimmediacontrols.h
+++ b/indra/newview/llpanelprimmediacontrols.h
@@ -30,9 +30,9 @@
 #include "llpanel.h"
 #include "llviewermedia.h"
 #include "llnotificationptr.h"
+#include "llcoord.h"
 
 class LLButton;
-class LLCoordWindow;
 class LLIconCtrl;
 class LLLayoutStack;
 class LLProgressBar;
diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp
index 9fbb67a63aa..08829c11840 100644
--- a/indra/newview/llpopupview.cpp
+++ b/indra/newview/llpopupview.cpp
@@ -83,7 +83,7 @@ void LLPopupView::draw()
 
 			LLUI::pushMatrix();
 			{
-				LLUI::translate( (F32) screen_x, (F32) screen_y, 0.f);
+				LLUI::translate( (F32) screen_x, (F32) screen_y);
 				popup->draw();
 			}
 			LLUI::popMatrix();
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index cc3395115ba..184033de424 100644
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -32,8 +32,8 @@
 #include "llstat.h"
 #include "lltimer.h"
 #include "m4math.h"
+#include "llcoord.h"
 
-class LLCoordGL;
 class LLViewerObject;
 
 // This rotation matrix moves the default OpenGL reference frame 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5730a55a9b3..0de2545596c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -27,9 +27,6 @@
 #include "llviewerprecompiledheaders.h"
 #include "llviewerwindow.h"
 
-#if LL_WINDOWS
-#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
-#endif
 
 // system library includes
 #include <stdio.h>
@@ -49,7 +46,6 @@
 #include "llviewquery.h"
 #include "llxmltree.h"
 #include "llslurl.h"
-//#include "llviewercamera.h"
 #include "llrender.h"
 
 #include "llvoiceclient.h"	// for push-to-talk button handling
@@ -1538,14 +1534,14 @@ LLViewerWindow::LLViewerWindow(const Params& p)
 	mResDirty(false),
 	mStatesDirty(false),
 	mCurrResolutionIndex(0),
+	mProgressView(NULL)
+{
 	// gKeyboard is still NULL, so it doesn't do LLWindowListener any good to
 	// pass its value right now. Instead, pass it a nullary function that
 	// will, when we later need it, return the value of gKeyboard.
 	// boost::lambda::var() constructs such a functor on the fly.
-	mWindowListener(new LLWindowListener(this, boost::lambda::var(gKeyboard))),
-	mViewerWindowListener(new LLViewerWindowListener(this)),
-	mProgressView(NULL)
-{
+	mWindowListener.reset(new LLWindowListener(this, boost::lambda::var(gKeyboard)));
+	mViewerWindowListener.reset(new LLViewerWindowListener(this));
 	LLNotificationChannel::buildChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert"));
 	LLNotificationChannel::buildChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
 
@@ -2362,7 +2358,7 @@ void LLViewerWindow::draw()
 
 			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
-			LLUI::translate( (F32) screen_x, (F32) screen_y, 0.f);
+			LLUI::translate( (F32) screen_x, (F32) screen_y);
 			top_ctrl->draw();	
 			LLUI::popMatrix();
 		}
-- 
GitLab


From 8c15a7e17fceeba9e55e254d7654c1a4f8c3b871 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 7 Feb 2012 14:51:30 -0600
Subject: [PATCH 725/933] SH-2902 Fix for avatar bakes etc. getting garbage
 data sometimes.

---
 indra/newview/lldynamictexture.cpp | 28 ++++++++++++++++++++++++----
 indra/newview/pipeline.cpp         |  5 +++--
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 5d6081a35cf..a93b2b71de3 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -125,8 +125,16 @@ BOOL LLViewerDynamicTexture::render()
 //-----------------------------------------------------------------------------
 void LLViewerDynamicTexture::preRender(BOOL clear_depth)
 {
-	{
-		// force rendering to on-screen portion of frame buffer
+	//only images up to 512x512 are supported
+	llassert(mFullHeight <= 512);
+	llassert(mFullWidth <= 512);
+
+	if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete())
+	{ //using offscreen render target, just use the bottom left corner
+		mOrigin.set(0, 0);
+	}
+	else
+	{ // force rendering to on-screen portion of frame buffer
 		LLCoordScreen window_pos;
 		gViewerWindow->getWindow()->getPosition( &window_pos );
 		mOrigin.set(0, gViewerWindow->getWindowHeightRaw() - mFullHeight);  // top left corner
@@ -140,9 +148,9 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth)
 			mOrigin.mY += window_pos.mY;
 			mOrigin.mY = llmax(mOrigin.mY, 0) ;
 		}
-
-		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	}
+
+	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	// Set up camera
 	LLViewerCamera* camera = LLViewerCamera::getInstance();
 	mCamera.setOrigin(*camera);
@@ -208,6 +216,13 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		return TRUE;
 	}
 
+	bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete();
+
+	if (use_fbo)
+	{
+		gPipeline.mWaterDis.bindTarget();
+	}
+
 	LLGLSLShader::bindNoShader();
 	LLVertexBuffer::unbind();
 	
@@ -241,6 +256,11 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
 		}
 	}
 
+	if (use_fbo)
+	{
+		gPipeline.mWaterDis.flush();
+	}
+
 	return ret;
 }
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index dffc541001b..c8a8b910ea5 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1076,10 +1076,11 @@ void LLPipeline::createGLBuffers()
 
 	if (LLPipeline::sWaterReflections)
 	{ //water reflection texture
-		U32 res = (U32) gSavedSettings.getS32("RenderWaterRefResolution");
+		U32 res = (U32) llmax(gSavedSettings.getS32("RenderWaterRefResolution"), 512);
 			
 		mWaterRef.allocate(res,res,GL_RGBA,TRUE,FALSE);
-		mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE);
+		//always use FBO for mWaterDis so it can be used for avatar texture bakes
+		mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true);
 	}
 
 	mHighlight.allocate(256,256,GL_RGBA, FALSE, FALSE);
-- 
GitLab


From 95be0571537805c238e37e747c4c3bb298be98d8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 7 Feb 2012 17:25:12 -0600
Subject: [PATCH 726/933] SH-2719 Fix for lines in off-sim water

---
 indra/newview/llvowater.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 315616e8a5c..cd781579444 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -160,7 +160,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
 	static const unsigned int vertices_per_quad = 4;
 	static const unsigned int indices_per_quad = 6;
 
-	const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction ? 16 : 1;
+	const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && LLGLSLShader::sNoFixedFunction ? 16 : 1;
 
 	const S32 num_quads = size * size;
 	face->setSize(vertices_per_quad * num_quads,
@@ -197,6 +197,13 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
 
 	F32 size_inv = 1.f / size;
 
+	F32 z_fudge = 0.f;
+
+	if (getIsEdgePatch())
+	{ //bump edge patches down 10 cm to prevent aliasing along edges
+		z_fudge = -0.1f;
+	}
+
 	for (y = 0; y < size; y++)
 	{
 		for (x = 0; x < size; x++)
@@ -205,6 +212,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
 			position_agent = getPositionAgent() - getScale() * 0.5f;
 			position_agent.mV[VX] += (x + 0.5f) * step_x;
 			position_agent.mV[VY] += (y + 0.5f) * step_y;
+			position_agent.mV[VZ] += z_fudge;
 
 			*verticesp++  = position_agent - right + up;
 			*verticesp++  = position_agent - right - up;
-- 
GitLab


From c744603af9b53c6bc73fefbd56de68cf2778ed70 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 7 Feb 2012 17:13:24 -0800
Subject: [PATCH 727/933] EXP-1873 : Implement cut in the inventory contextual
 menu. Works without deleting the items but simply dimming them and moving
 them. Doesn't work for folders yet.

---
 indra/llui/llclipboard.cpp                    |  6 +++++
 indra/llui/llclipboard.h                      |  2 ++
 indra/newview/llfolderview.cpp                |  3 +--
 indra/newview/llfolderviewitem.cpp            |  9 +++++++-
 indra/newview/llinventorybridge.cpp           | 22 ++++++++++++++++++-
 .../skins/default/xui/en/menu_inventory.xml   |  8 +++++++
 6 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 5c8db29ae43..a2a3f7f285a 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -97,6 +97,12 @@ BOOL LLClipboard::hasContents() const
 	return (mObjects.count() > 0);
 }
 
+// Returns true if the input uuid is in the list of clipboard objects
+bool LLClipboard::isOnClipboard(const LLUUID& object) const
+{
+	return (mObjects.find(object) != LLDynamicArray<LLUUID>::FAIL);
+}
+
 // Copy the input string to the LL and the system clipboard
 bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
 {
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index bb2d003703c..8e417a490d5 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -69,6 +69,8 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	
 	BOOL hasContents() const;										// true if the clipboard has something pasteable in it
 	bool isCutMode() const { return mCutMode; }
+	void setCutMode(bool mode) { mCutMode = mode; }
+	bool isOnClipboard(const LLUUID& object) const;
 
 private:
 	LLDynamicArray<LLUUID> mObjects;
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 438d7e7ae35..1d318ca2210 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -2108,8 +2108,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
 		removeSelectedItems();
 		return true;
 	}
-
-	if ("copy" == action)
+	if (("copy" == action) || ("cut" == action))
 	{	
 		LLClipboard::getInstance()->reset();
 	}
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 734adbc6486..37ef27a5d71 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -40,6 +40,7 @@
 #include "llviewerwindow.h"		// Argh, only for setCursor()
 
 // linden library includes
+#include "llclipboard.h"
 #include "llfocusmgr.h"		// gFocusMgr
 #include "lltrans.h"
 
@@ -1002,7 +1003,13 @@ void LLFolderViewItem::draw()
 	LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor;
 	if (highlight_link) color = sLinkColor;
 	if (in_library) color = sLibraryColor;
-
+	
+	// Cut state rendering tweak (experimental)
+	if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(getListener()->getUUID()))
+	{
+		color.setAlpha(0.5);
+	}
+	
 	F32 right_x  = 0;
 	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD;
 	F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation);
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 14f1bb9d410..7ba914eaf6f 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -210,7 +210,7 @@ BOOL LLInvFVBridge::isLink() const
  */
 void LLInvFVBridge::cutToClipboard()
 {
-	if(isItemMovable())
+	if (isItemMovable() && isItemRemovable())
 	{
 		LLClipboard::getInstance()->cut(mUUID);
 	}
@@ -602,6 +602,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 				disabled_items.push_back(std::string("Copy"));
 			}
 
+			items.push_back(std::string("Cut"));
+			if (!isItemMovable() || !isItemRemovable())
+			{
+				disabled_items.push_back(std::string("Cut"));
+			}
+
 			if (canListOnMarketplace())
 			{
 				items.push_back(std::string("Marketplace Separator"));
@@ -1281,6 +1287,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
 		gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(buffer));
 		return;
 	}
+	else if ("cut" == action)
+	{
+		cutToClipboard();
+		return;
+	}
 	else if ("copy" == action)
 	{
 		copyToClipboard();
@@ -2608,6 +2619,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
 		modifyOutfit(TRUE);
 		return;
 	}
+	else if ("cut" == action)
+	{
+		cutToClipboard();
+		return;
+	}
 	else if ("copy" == action)
 	{
 		copyToClipboard();
@@ -2867,6 +2883,8 @@ void LLFolderBridge::pasteFromClipboard()
 				}
 			}
 		}
+		// Change mode to paste for next paste
+		LLClipboard::getInstance()->setCutMode(false);
 	}
 }
 
@@ -2920,6 +2938,8 @@ void LLFolderBridge::pasteLinkFromClipboard()
 					LLPointer<LLInventoryCallback>(NULL));
 			}
 		}
+		// Change mode to paste for next paste
+		LLClipboard::getInstance()->setCutMode(false);
 	}
 }
 
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index ef4a1bc0618..b13bf5b5086 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -452,6 +452,14 @@
     <menu_item_separator
      layout="topleft" 
      name="Copy Separator" />
+    <menu_item_call
+     label="Cut"
+     layout="topleft"
+     name="Cut">
+        <menu_item_call.on_click
+         function="Inventory.DoToSelected"
+         parameter="cut" />
+    </menu_item_call>
     <menu_item_call
      label="Copy"
      layout="topleft"
-- 
GitLab


From 4e08461f8ad23fb75ca8587c781c2cf65351b1ab Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 7 Feb 2012 19:29:10 -0800
Subject: [PATCH 728/933] EXP-1181 WIP as a designer I would like to specify
 default floater positions using realtive coordinates changed over to new
 convert() method added LLCoordFloater

---
 indra/llmath/llcoord.h                     |  69 ++++++++++---
 indra/llui/llfloater.cpp                   |  43 ++++++++
 indra/llui/llfloater.h                     |  35 ++++++-
 indra/llui/llui.cpp                        |   8 +-
 indra/llwindow/lldragdropwin32.cpp         |  10 +-
 indra/llwindow/llwindow.h                  |   2 +-
 indra/llwindow/llwindowwin32.cpp           | 108 +++++++++++++--------
 indra/newview/llpanelprimmediacontrols.cpp |   2 +-
 indra/newview/llviewerwindow.cpp           |   9 +-
 9 files changed, 211 insertions(+), 75 deletions(-)

diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h
index c0623e6d1f9..0b1d7e04f59 100644
--- a/indra/llmath/llcoord.h
+++ b/indra/llmath/llcoord.h
@@ -26,32 +26,79 @@
 #ifndef LL_LLCOORD_H
 #define LL_LLCOORD_H
 
+struct LL_COORD_TYPE_COMMON 
+{
+	typedef S32 value_t;
+};
+
 // A two-dimensional pixel value
-template<typename COORD_FRAME, typename VALUE_TYPE>
-class LLCoord
+template<typename COORD_FRAME>
+class LLCoord : protected COORD_FRAME
 {
 public:
-	typedef LLCoord<COORD_FRAME, VALUE_TYPE> self_t;
-	VALUE_TYPE		mX;
-	VALUE_TYPE		mY;
+	typedef LLCoord<COORD_FRAME> self_t;
+	typename COORD_FRAME::value_t	mX;
+	typename COORD_FRAME::value_t	mY;
 
 	LLCoord():	mX(0), mY(0)
 	{}
 	LLCoord(S32 x, S32 y): mX(x), mY(y)
 	{}
 
+	LLCoord(const LLCoord<LL_COORD_TYPE_COMMON>& other)
+	{
+		COORD_FRAME::convertFromCommon(other);
+	}
+
+	LLCoord<LL_COORD_TYPE_COMMON> convert() const
+	{
+		return COORD_FRAME::convertToCommon();
+	}
+
 	void set(S32 x, S32 y) { mX = x; mY = y;}
 	bool operator==(const self_t& other) const { return mX == other.mX && mY == other.mY; }
 	bool operator!=(const self_t& other) const { return !(*this == other); }
 
 };
 
-struct LL_COORD_TYPE_GL {};
-struct LL_COORD_TYPE_WINDOW {};
-struct LL_COORD_TYPE_SCREEN {};
+typedef LLCoord<LL_COORD_TYPE_COMMON> LLCoordCommon;
+
+struct LL_COORD_TYPE_GL 
+{
+	typedef S32 value_t;
+
+	LLCoordCommon convertToCommon() const
+	{
+		const LLCoord<LL_COORD_TYPE_GL>& self = static_cast<const LLCoord<LL_COORD_TYPE_GL>&>(*this);
+		return LLCoordCommon(self.mX, self.mY);
+	}
+
+	void convertFromCommon(const LLCoordCommon& from)
+	{
+		LLCoord<LL_COORD_TYPE_GL>& self = static_cast<LLCoord<LL_COORD_TYPE_GL>&>(*this);
+		self.mX = from.mX;
+		self.mY = from.mY;
+	}
+};
+
+struct LL_COORD_TYPE_WINDOW 
+{
+	typedef S32 value_t;
+
+	LLCoordCommon convertToCommon() const;
+	void convertFromCommon(const LLCoordCommon& from);
+};
+
+struct LL_COORD_TYPE_SCREEN 
+{
+	typedef S32 value_t;
+
+	LLCoordCommon convertToCommon() const;
+	void convertFromCommon(const LLCoordCommon& from);
+};
 
-typedef LLCoord<LL_COORD_TYPE_GL, S32> LLCoordGL;
-typedef LLCoord<LL_COORD_TYPE_WINDOW, S32> LLCoordWindow;
-typedef LLCoord<LL_COORD_TYPE_SCREEN, S32> LLCoordScreen;
+typedef LLCoord<LL_COORD_TYPE_GL> LLCoordGL;
+typedef LLCoord<LL_COORD_TYPE_WINDOW> LLCoordWindow;
+typedef LLCoord<LL_COORD_TYPE_SCREEN> LLCoordScreen;
 
 #endif
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index cef5ba3fe7d..6274caa97fc 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -270,6 +270,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 	mMinimizeSignal(NULL)
 //	mNotificationContext(NULL)
 {
+	mPosition.setFloater(*this);
 //	mNotificationContext = new LLFloaterNotificationContext(getHandle());
 
 	// Clicks stop here.
@@ -3271,3 +3272,45 @@ void LLFloater::stackWith(LLFloater& other)
 	setShape(next_rect);
 }
 
+LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater)
+:	coord_t(x, y)
+{
+	mFloater = floater.getHandle();
+}
+
+
+LLCoordFloater::LLCoordFloater(const LLCoordCommon& other, LLFloater& floater)
+{
+	mFloater = floater.getHandle();
+	convertFromCommon(other);
+}
+
+LLCoordFloater& LLCoordFloater::operator=(const LLCoordFloater& other)
+{
+	mFloater = other.mFloater;
+	coord_t::operator =(other);
+	return *this;
+}
+
+void LLCoordFloater::setFloater(LLFloater& floater)
+{
+	mFloater = floater.getHandle();
+}
+
+bool LLCoordFloater::operator==(const LLCoordFloater& other) const 
+{ 
+	return mX == other.mX && mY == other.mY && mFloater == other.mFloater; 
+}
+
+LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
+{
+	const LLCoordFloater& self = static_cast<const LLCoordFloater&>(*this);
+	return LLCoordCommon(self.mX, self.mY);
+}
+
+void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from)
+{
+	LLCoordFloater& self = static_cast<LLCoordFloater&>(*this);
+	self.mX = from.mX;
+	self.mY = from.mY;
+}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 1eb8c964f9d..a7cc9ae9617 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -82,9 +82,37 @@ namespace LLInitParam
 	};
 }
 
-struct LL_COORD_FLOATER;
+struct LL_COORD_FLOATER
+{
+	typedef F32 value_t;
+
+	LLCoordCommon convertToCommon() const;
+	void convertFromCommon(const LLCoordCommon& from);
+protected:
+	LLHandle<LLFloater> mFloater;
+};
+
+struct LLCoordFloater : LLCoord<LL_COORD_FLOATER>
+{
+	typedef LLCoord<LL_COORD_FLOATER> coord_t;
 
-typedef LLCoord<LL_COORD_FLOATER, F32> LLCoordFloater;
+	LLCoordFloater() {}
+	LLCoordFloater(F32 x, F32 y, LLFloater& floater);
+	LLCoordFloater(const LLCoordCommon& other, LLFloater& floater);
+
+	LLCoordFloater& operator=(const LLCoordCommon& other)
+	{
+		convertFromCommon(other);
+		return *this;
+	}
+
+	LLCoordFloater& operator=(const LLCoordFloater& other);
+
+	bool operator==(const LLCoordFloater& other) const;
+	bool operator!=(const LLCoordFloater& other) const { return !(*this == other); }
+
+	void setFloater(LLFloater& floater);
+};
 
 class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 {
@@ -187,7 +215,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL);
 
 	/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false);
-	/*virtual*/ BOOL canSnapTo(const LLView* other_view);
+	/*virtual*/ BOOL canSnapTo(const LLView* other_view); 
 	/*virtual*/ void setSnappedTo(const LLView* snap_view);
 	/*virtual*/ void setFocus( BOOL b );
 	/*virtual*/ void setIsChrome(BOOL is_chrome);
@@ -428,6 +456,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	LLFloaterEnums::EOpenPositioning	mOpenPositioning;
 	S32									mSpecifiedLeft;
 	S32									mSpecifiedBottom;
+	LLCoordFloater	mPosition;
 	
 	S32				mMinWidth;
 	S32				mMinHeight;
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 931b696c903..137716743fb 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1736,10 +1736,7 @@ void LLUI::setMousePositionScreen(S32 x, S32 y)
 	screen_x = llround((F32)x * sGLScaleFactor.mV[VX]);
 	screen_y = llround((F32)y * sGLScaleFactor.mV[VY]);
 	
-	LLCoordWindow window_point;
-	LLView::getWindow()->convertCoords(LLCoordGL(screen_x, screen_y), &window_point);
-
-	LLView::getWindow()->setCursorPosition(window_point);
+	LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
 }
 
 //static 
@@ -1747,8 +1744,7 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y)
 {
 	LLCoordWindow cursor_pos_window;
 	getWindow()->getCursorPosition(&cursor_pos_window);
-	LLCoordGL cursor_pos_gl;
-	getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl);
+	LLCoordGL cursor_pos_gl(cursor_pos_window.convert());
 	*x = llround((F32)cursor_pos_gl.mX / sGLScaleFactor.mV[VX]);
 	*y = llround((F32)cursor_pos_gl.mY / sGLScaleFactor.mV[VX]);
 }
diff --git a/indra/llwindow/lldragdropwin32.cpp b/indra/llwindow/lldragdropwin32.cpp
index d4d444eb288..15acddd9876 100644
--- a/indra/llwindow/lldragdropwin32.cpp
+++ b/indra/llwindow/lldragdropwin32.cpp
@@ -124,10 +124,9 @@ class LLDragDropWin32Target:
 						ScreenToClient( mAppWindowHandle, &pt2 );
 
 						LLCoordWindow cursor_coord_window( pt2.x, pt2.y );
-						window_imp->convertCoords(cursor_coord_window, &gl_coord);
 						MASK mask = gKeyboard->currentMask(TRUE);
 
-						LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( gl_coord, mask, 
+						LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( cursor_coord_window.convert(), mask, 
 							LLWindowCallbacks::DNDA_START_TRACKING, mDropUrl );
 
 						switch (result)
@@ -180,10 +179,9 @@ class LLDragDropWin32Target:
 					ScreenToClient( mAppWindowHandle, &pt2 );
 
 					LLCoordWindow cursor_coord_window( pt2.x, pt2.y );
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
 					MASK mask = gKeyboard->currentMask(TRUE);
 
-					LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( gl_coord, mask, 
+					LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( cursor_coord_window.convert(), mask, 
 						LLWindowCallbacks::DNDA_TRACK, mDropUrl );
 					
 					switch (result)
@@ -237,15 +235,13 @@ class LLDragDropWin32Target:
 				LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong( mAppWindowHandle, GWL_USERDATA );
 				if ( NULL != window_imp )
 				{
-					LLCoordGL gl_coord( 0, 0 );
-
 					POINT pt_client;
 					pt_client.x = pt.x;
 					pt_client.y = pt.y;
 					ScreenToClient( mAppWindowHandle, &pt_client );
 
 					LLCoordWindow cursor_coord_window( pt_client.x, pt_client.y );
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					LLCoordGL gl_coord(cursor_coord_window.convert());
 					llinfos << "### (Drop) URL is: " << mDropUrl << llendl;
 					llinfos << "###        raw coords are: " << pt.x << " x " << pt.y << llendl;
 					llinfos << "###	    client coords are: " << pt_client.x << " x " << pt_client.y << llendl;
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index cab2d0a8fb7..d2971581d2f 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -39,7 +39,7 @@ class LLWindowCallbacks;
 
 // Refer to llwindow_test in test/common/llwindow for usage example
 
-class LLWindow
+class LLWindow : public LLInstanceTracker<LLWindow>
 {
 public:
 	struct LLWindowResolution
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index a2459864338..a8d2836f48b 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1545,24 +1545,16 @@ void LLWindowWin32::moveWindow( const LLCoordScreen& position, const LLCoordScre
 
 BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position)
 {
-	LLCoordScreen screen_pos;
-
 	mMousePositionModified = TRUE;
 	if (!mWindowHandle)
 	{
 		return FALSE;
 	}
 
-	if (!convertCoords(position, &screen_pos))
-	{
-		return FALSE;
-	}
 
 	// Inform the application of the new mouse position (needed for per-frame
 	// hover/picking to function).
-	LLCoordGL gl_pos;
-	convertCoords(position, &gl_pos);
-	mCallbacks->handleMouseMove(this, gl_pos, (MASK)0);
+	mCallbacks->handleMouseMove(this, position.convert(), (MASK)0);
 	
 	// DEV-18951 VWR-8524 Camera moves wildly when alt-clicking.
 	// Because we have preemptively notified the application of the new
@@ -1572,24 +1564,23 @@ BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position)
 	while (PeekMessage(&msg, NULL, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE))
 	{ }
 
-	return SetCursorPos(screen_pos.mX, screen_pos.mY);
+	LLCoordScreen screen_pos(position.convert());
+	return ::SetCursorPos(screen_pos.mX, screen_pos.mY);
 }
 
 BOOL LLWindowWin32::getCursorPosition(LLCoordWindow *position)
 {
 	POINT cursor_point;
-	LLCoordScreen screen_pos;
 
-	if (!mWindowHandle ||
-		!GetCursorPos(&cursor_point))
+	if (!mWindowHandle 
+		|| !GetCursorPos(&cursor_point)
+		|| !position)
 	{
 		return FALSE;
 	}
 
-	screen_pos.mX = cursor_point.x;
-	screen_pos.mY = cursor_point.y;
-
-	return convertCoords(screen_pos, position);
+	*position = LLCoordScreen(cursor_point.x, cursor_point.y).convert();
+	return TRUE;
 }
 
 void LLWindowWin32::hideCursor()
@@ -2167,15 +2158,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2197,15 +2188,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2230,15 +2221,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2265,15 +2256,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2294,15 +2285,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2329,15 +2320,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2358,15 +2349,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// If we don't do this, many clicks could get buffered up, and if the
 				// first click changes the cursor position, all subsequent clicks
 				// will occur at the wrong location.  JC
-				LLCoordWindow cursor_coord_window;
 				if (window_imp->mMousePositionModified)
 				{
+					LLCoordWindow cursor_coord_window;
 					window_imp->getCursorPosition(&cursor_coord_window);
-					window_imp->convertCoords(cursor_coord_window, &gl_coord);
+					gl_coord = cursor_coord_window.convert();
 				}
 				else
 				{
-					window_imp->convertCoords(window_coord, &gl_coord);
+					gl_coord = window_coord.convert();
 				}
 				MASK mask = gKeyboard->currentMask(TRUE);
 				// generate move event to update mouse coordinates
@@ -2438,9 +2429,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 		case WM_MOUSEMOVE:
 			{
 				window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MOUSEMOVE");
-				window_imp->convertCoords(window_coord, &gl_coord);
 				MASK mask = gKeyboard->currentMask(TRUE);
-				window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask);
+				window_imp->mCallbacks->handleMouseMove(window_imp, window_coord.convert(), mask);
 				return 0;
 			}
 
@@ -2570,6 +2560,44 @@ BOOL LLWindowWin32::convertCoords(LLCoordGL from, LLCoordWindow *to)
 	return TRUE;
 }
 
+LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
+{
+	const LLCoordWindow& self = static_cast<const LLCoordWindow&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL out;
+	windowp->convertCoords(self, &out);
+	return out.convert();
+}
+
+void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
+{
+	LLCoordWindow& self = static_cast<LLCoordWindow&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL from_gl(from);
+	windowp->convertCoords(from_gl, &self);
+}
+
+LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
+{
+	const LLCoordScreen& self = static_cast<const LLCoordScreen&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL out;
+	windowp->convertCoords(self, &out);
+	return out.convert();
+}
+
+void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from)
+{
+	LLCoordScreen& self = static_cast<LLCoordScreen&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL from_gl(from);
+	windowp->convertCoords(from_gl, &self);
+}
+
 BOOL LLWindowWin32::convertCoords(LLCoordWindow from, LLCoordGL* to)
 {
 	S32		client_height;
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 39c0628cbe0..76d38f067d4 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -818,7 +818,7 @@ bool LLPanelPrimMediaControls::isMouseOver()
 		LLCoordGL cursor_pos_gl;
 		S32 x, y;
 		getWindow()->getCursorPosition(&cursor_pos_window);
-		getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl);
+		cursor_pos_gl = cursor_pos_window.convert();
 				
 		if(mMediaControlsStack->getVisible())
 		{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 0de2545596c..236c828c16f 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4083,14 +4083,11 @@ void LLViewerWindow::resetSnapshotLoc()
 void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 {
 	LLCoordWindow size;
+	LLCoordWindow new_size(new_width, new_height);
 	gViewerWindow->getWindow()->getSize(&size);
-	if ( size.mX != new_width
-		|| size.mY != new_height)
+	if ( size != new_size )
 	{
-		LLCoordWindow new_size(new_width, new_height);
-		LLCoordScreen screen_size;
-		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
-		gViewerWindow->getWindow()->setSize(screen_size);
+		gViewerWindow->getWindow()->setSize(new_size.convert());
 	}
 }
 
-- 
GitLab


From ee3c3c15b714f8f68e98a2d4064afaec665bd64a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 7 Feb 2012 22:46:04 -0800
Subject: [PATCH 729/933] EXP-1841 : Final deep scrub on LLClipboard API, clean
 up the use of copy and cut everywhere.

---
 indra/llui/llclipboard.cpp                | 96 +++++++++++------------
 indra/llui/llclipboard.h                  | 44 ++++++-----
 indra/newview/llfavoritesbar.cpp          |  6 +-
 indra/newview/llfloatergesture.cpp        | 10 +--
 indra/newview/llfoldervieweventlistener.h |  2 +-
 indra/newview/llinventorybridge.cpp       | 52 ++++++------
 indra/newview/llinventorybridge.h         |  6 +-
 indra/newview/llpanelobjectinventory.cpp  |  5 +-
 8 files changed, 107 insertions(+), 114 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index a2a3f7f285a..7794a0537f1 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -35,8 +35,8 @@
 #include "llwindow.h"
 
 LLClipboard::LLClipboard()
-: mCutMode(false)
 {
+	reset();
 }
 
 LLClipboard::~LLClipboard()
@@ -44,55 +44,59 @@ LLClipboard::~LLClipboard()
 	reset();
 }
 
-void LLClipboard::add(const LLUUID& object)
+void LLClipboard::reset()
 {
-	mObjects.put(object);
+	mObjects.reset();
+	mCutMode = false;
+	mString = LLWString();
 }
 
-void LLClipboard::store(const LLUUID& object)
+// Copy the input uuid to the LL clipboard
+bool LLClipboard::copyToClipboard(const LLUUID& src, const LLAssetType::EType type)
 {
 	reset();
-	mObjects.put(object);
+	return addToClipboard(src, type);
 }
 
-void LLClipboard::store(const LLDynamicArray<LLUUID>& inv_objects)
+// Add the input uuid to the LL clipboard
+// Convert the uuid to string and concatenate that string to the system clipboard if legit
+bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType type)
 {
-	reset();
-	S32 count = inv_objects.count();
-	for(S32 i = 0; i < count; i++)
+	bool res = false;
+	if (src.notNull())
 	{
-		mObjects.put(inv_objects[i]);
+		res = true;
+		if (LLAssetType::lookupIsAssetIDKnowable(type))
+		{
+			LLWString source = utf8str_to_wstring(src.asString());
+			res = addToClipboard(source, 0, source.size());
+		}
+		if (res)
+		{
+			mObjects.put(src);
+		}
 	}
+	return res;
 }
 
-void LLClipboard::cut(const LLUUID& object)
+bool LLClipboard::pasteFromClipboard(LLDynamicArray<LLUUID>& inv_objects) const
 {
-	if(!mCutMode && !mObjects.empty())
-	{
-		//looks like there are some stored items, reset clipboard state
-		reset();
-	}
-	mCutMode = true;
-	add(object);
-}
-void LLClipboard::retrieve(LLDynamicArray<LLUUID>& inv_objects) const
-{
-	inv_objects.reset();
+	bool res = false;
 	S32 count = mObjects.count();
-	for(S32 i = 0; i < count; i++)
+	if (count > 0)
 	{
-		inv_objects.put(mObjects[i]);
+		res = true;
+		inv_objects.reset();
+		for (S32 i = 0; i < count; i++)
+		{
+			inv_objects.put(mObjects[i]);
+		}
 	}
-}
-
-void LLClipboard::reset()
-{
-	mObjects.reset();
-	mCutMode = false;
+	return res;
 }
 
 // Returns true if the LL Clipboard has pasteable items in it
-BOOL LLClipboard::hasContents() const
+bool LLClipboard::hasContents() const
 {
 	return (mObjects.count() > 0);
 }
@@ -107,30 +111,22 @@ bool LLClipboard::isOnClipboard(const LLUUID& object) const
 bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
 {
 	reset();
-	mString = src.substr(pos, len);
-	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
+	return addToClipboard(src, pos, len, use_primary);
 }
 
-// Copy the input uuid to the LL clipboard
-// Convert the uuid to string and copy that string to the system clipboard if legit
-bool LLClipboard::copyToClipboard(const LLUUID& src, const LLAssetType::EType type)
+// Concatenate the input string to the LL and the system clipboard
+bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
 {
-	bool res = false;
-	reset();
-	if (src.notNull())
+	const LLWString sep(utf8str_to_wstring(std::string(", ")));
+	if (mString.length() == 0)
 	{
-		res = true;
-		if (LLAssetType::lookupIsAssetIDKnowable(type))
-		{
-			LLWString source = utf8str_to_wstring(src.asString());
-			res = copyToClipboard(source, 0, source.size());
-		}
-		if (res)
-		{
-			store(src);
-		}
+		mString = src.substr(pos, len);
 	}
-	return res;
+	else
+	{
+		mString = mString + sep + src.substr(pos, len);
+	}
+	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
 }
 
 // Copy the System clipboard to the output string.
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 8e417a490d5..608ea246a73 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -48,34 +48,38 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	LLClipboard();
 	~LLClipboard();
 
-	/* We support two flavors of clipboard.  The default is the explicitly
-	   copy-and-pasted clipboard.  The second is the so-called 'primary' clipboard
-	   which is implicitly copied upon selection on platforms which expect this
-	   (i.e. X11/Linux). */
-
-	// Text strings and single item management
-	bool		copyToClipboard(const LLWString& src, S32 pos, S32 len, bool use_primary = false);
-	bool		copyToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);
-	bool		pasteFromClipboard(LLWString& dst, bool use_primary = false);
-	bool		isTextAvailable(bool use_primary = false) const;
+	// Text strings management:
+	// ------------------------
+	// We support two flavors of text clipboards. The default is the explicitly
+	// copy-and-pasted clipboard. The second is the so-called 'primary' clipboard
+	// which is implicitly copied upon selection on platforms which expect this
+	// (i.e. X11/Linux, Mac).
+	bool copyToClipboard(const LLWString& src, S32 pos, S32 len, bool use_primary = false);
+	bool addToClipboard(const LLWString& src, S32 pos, S32 len, bool use_primary = false);
+	bool pasteFromClipboard(LLWString& dst, bool use_primary = false);
+	bool isTextAvailable(bool use_primary = false) const;
 	
-	// Object list management
-	void add(const LLUUID& object);									// Adds to the current list of objects on the clipboard
-	void store(const LLUUID& object);								// Stores a single inventory object
-	void store(const LLDynamicArray<LLUUID>& inventory_objects);	// Stores an array of objects
-	void cut(const LLUUID& object);									// Adds to the current list of cut objects on the clipboard
-	void retrieve(LLDynamicArray<LLUUID>& inventory_objects) const;	// Gets a copy of the objects on the clipboard
-	void reset();													// Clears the clipboard
+	// Object list management:
+	// -----------------------
+	// Clears the clipboard
+	void reset();
+	// Clears and adds one single object to the clipboard
+	bool copyToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);
+	// Adds one object to the current list of objects on the clipboard
+	bool addToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);
+	// Gets a copy of the objects on the clipboard
+	bool pasteFromClipboard(LLDynamicArray<LLUUID>& inventory_objects) const;
 	
-	BOOL hasContents() const;										// true if the clipboard has something pasteable in it
+	bool hasContents() const;										// True if the clipboard has pasteable objects
+	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard
+
 	bool isCutMode() const { return mCutMode; }
 	void setCutMode(bool mode) { mCutMode = mode; }
-	bool isOnClipboard(const LLUUID& object) const;
 
 private:
 	LLDynamicArray<LLUUID> mObjects;
-	bool mCutMode;
 	LLWString mString;
+	bool mCutMode;						// This is a convenience flag for the viewer. It has no influence on the cliboard management.
 };
 
 #endif  // LL_LLCLIPBOARD_H
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 4308bf2d3c8..d4bce1e3a16 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1187,7 +1187,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
 	}
 	else if (action == "copy")
 	{
-		LLClipboard::getInstance()->store(mSelectedItemID);
+		LLClipboard::getInstance()->copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK);
 	}
 	else if (action == "paste")
 	{
@@ -1217,7 +1217,7 @@ BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->retrieve(objects);
+	LLClipboard::getInstance()->pasteFromClipboard(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -1246,7 +1246,7 @@ void LLFavoritesBarCtrl::pastFromClipboard() const
 	{
 		LLInventoryItem* item = NULL;
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->retrieve(objects);
+		LLClipboard::getInstance()->pasteFromClipboard(objects);
 		S32 count = objects.count();
 		LLUUID parent_id(mFavoriteFolderId);
 		for(S32 i = 0; i < count; i++)
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 3c647284f66..d449c4ff1b2 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -395,7 +395,7 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command)
 			return false;
 
 		LLDynamicArray<LLUUID> ids;
-		LLClipboard::getInstance()->retrieve(ids);
+		LLClipboard::getInstance()->pasteFromClipboard(ids);
 		for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
 		{
 			LLInventoryItem* item = gInventory.getItem(*it);
@@ -490,26 +490,26 @@ void LLFloaterGesture::onActivateBtnClick()
 void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 {
 	std::string command_name  = command.asString();
-	// since we select this comman inventory item had  already arrived .
+	// Since we select this command, the inventory items must have already arrived
 	if("copy_gesture" == command_name)
 	{
 		uuid_vec_t ids;
 		getSelectedIds(ids);
-		// make sure that clopboard is empty
+		// Make sure the clipboard is empty
 		LLClipboard::getInstance()->reset();
 		for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
 		{
 			LLInventoryItem* item = gInventory.getItem(*it);
 			if(item  && item->getInventoryType() == LLInventoryType::IT_GESTURE)
 			{
-				LLClipboard::getInstance()->add(item->getUUID());
+				LLClipboard::getInstance()->addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
 			}
 		}
 	}
 	else if ("paste" == command_name)
 	{
 		LLDynamicArray<LLUUID> ids;
-		LLClipboard::getInstance()->retrieve(ids);
+		LLClipboard::getInstance()->pasteFromClipboard(ids);
 		if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
 			return;
 		LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h
index aee31ca0339..06682dcbf1f 100644
--- a/indra/newview/llfoldervieweventlistener.h
+++ b/indra/newview/llfoldervieweventlistener.h
@@ -75,7 +75,7 @@ class LLFolderViewEventListener
 	virtual void move( LLFolderViewEventListener* parent_listener ) = 0;
 	virtual BOOL isItemCopyable() const = 0;
 	virtual BOOL copyToClipboard() const = 0;
-	virtual void cutToClipboard() = 0;
+	virtual BOOL cutToClipboard() const = 0;
 	virtual BOOL isClipboardPasteable() const = 0;
 	virtual void pasteFromClipboard() = 0;
 	virtual void pasteLinkFromClipboard() = 0;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 7ba914eaf6f..9775e54d6ab 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -208,13 +208,27 @@ BOOL LLInvFVBridge::isLink() const
 /**
  * @brief Adds this item into clipboard storage
  */
-void LLInvFVBridge::cutToClipboard()
+BOOL LLInvFVBridge::cutToClipboard() const
 {
-	if (isItemMovable() && isItemRemovable())
+	LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
+	if (inv_item && isItemMovable() && isItemRemovable())
 	{
-		LLClipboard::getInstance()->cut(mUUID);
+		LLClipboard::getInstance()->setCutMode(true);
+		return LLClipboard::getInstance()->addToClipboard(mUUID,inv_item->getType());
 	}
+	return FALSE;
 }
+
+BOOL LLInvFVBridge::copyToClipboard() const
+{
+	LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
+	if (inv_item && isItemCopyable())
+	{
+		return LLClipboard::getInstance()->addToClipboard(mUUID,inv_item->getType());
+	}
+	return FALSE;
+}
+
 // *TODO: make sure this does the right thing
 void LLInvFVBridge::showProperties()
 {
@@ -413,7 +427,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 	// 1. folders should be pastable
 	// 2. when pasting, we should paste what is authorized and let the rest not pasted
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->retrieve(objects);
+	LLClipboard::getInstance()->pasteFromClipboard(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -451,7 +465,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->retrieve(objects);
+	LLClipboard::getInstance()->pasteFromClipboard(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -1673,16 +1687,6 @@ BOOL LLItemBridge::isItemCopyable() const
 	return FALSE;
 }
 
-BOOL LLItemBridge::copyToClipboard() const
-{
-	if(isItemCopyable())
-	{
-		LLClipboard::getInstance()->add(mUUID);
-		return TRUE;
-	}
-	return FALSE;
-}
-
 LLViewerInventoryItem* LLItemBridge::getItem() const
 {
 	LLViewerInventoryItem* item = NULL;
@@ -1785,16 +1789,6 @@ BOOL LLFolderBridge::isItemCopyable() const
 	return gSavedSettings.getBOOL("InventoryLinking");
 }
 
-BOOL LLFolderBridge::copyToClipboard() const
-{
-	if(isItemCopyable())
-	{
-		LLClipboard::getInstance()->add(mUUID);
-		return TRUE;
-	}
-	return FALSE;
-}
-
 BOOL LLFolderBridge::isClipboardPasteable() const
 {
 	if ( ! LLInvFVBridge::isClipboardPasteable() )
@@ -1810,7 +1804,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const
 		}
 
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->retrieve(objects);
+		LLClipboard::getInstance()->pasteFromClipboard(objects);
 		const LLViewerInventoryCategory *current_cat = getCategory();
 
 		// Search for the direct descendent of current Friends subfolder among all pasted items,
@@ -1848,7 +1842,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
 		const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat );
 		const LLUUID &current_cat_id = current_cat->getUUID();
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->retrieve(objects);
+		LLClipboard::getInstance()->pasteFromClipboard(objects);
 		S32 count = objects.count();
 		for(S32 i = 0; i < count; i++)
 		{
@@ -2844,7 +2838,7 @@ void LLFolderBridge::pasteFromClipboard()
 		const LLUUID parent_id(mUUID);
 
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->retrieve(objects);
+		LLClipboard::getInstance()->pasteFromClipboard(objects);
 		for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 			 iter != objects.end();
 			 ++iter)
@@ -2900,7 +2894,7 @@ void LLFolderBridge::pasteLinkFromClipboard()
 		const LLUUID parent_id(mUUID);
 
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->retrieve(objects);
+		LLClipboard::getInstance()->pasteFromClipboard(objects);
 		for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 			 iter != objects.end();
 			 ++iter)
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 3bcd71557c0..f13ff15bc56 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -105,8 +105,8 @@ class LLInvFVBridge : public LLFolderViewEventListener
 	virtual void removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch);
 	virtual void move(LLFolderViewEventListener* new_parent_bridge) {}
 	virtual BOOL isItemCopyable() const { return FALSE; }
-	virtual BOOL copyToClipboard() const { return FALSE; }
-	virtual void cutToClipboard();
+	virtual BOOL copyToClipboard() const;
+	virtual BOOL cutToClipboard() const;
 	virtual BOOL isClipboardPasteable() const;
 	virtual BOOL isClipboardPasteableAsLink() const;
 	virtual void pasteFromClipboard() {}
@@ -211,7 +211,6 @@ class LLItemBridge : public LLInvFVBridge
 	virtual BOOL renameItem(const std::string& new_name);
 	virtual BOOL removeItem();
 	virtual BOOL isItemCopyable() const;
-	virtual BOOL copyToClipboard() const;
 	virtual BOOL hasChildren() const { return FALSE; }
 	virtual BOOL isUpToDate() const { return TRUE; }
 
@@ -274,7 +273,6 @@ class LLFolderBridge : public LLInvFVBridge
 	virtual BOOL isItemCopyable() const;
 	virtual BOOL isClipboardPasteable() const;
 	virtual BOOL isClipboardPasteableAsLink() const;
-	virtual BOOL copyToClipboard() const;
 	
 	static void createWearable(LLFolderBridge* bridge, LLWearableType::EType type);
 
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 98ea6805043..eb0a257defc 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -124,7 +124,7 @@ class LLTaskInvFVBridge : public LLFolderViewEventListener
 	virtual void move(LLFolderViewEventListener* parent_listener);
 	virtual BOOL isItemCopyable() const;
 	virtual BOOL copyToClipboard() const;
-	virtual void cutToClipboard();
+	virtual BOOL cutToClipboard() const;
 	virtual BOOL isClipboardPasteable() const;
 	virtual void pasteFromClipboard();
 	virtual void pasteLinkFromClipboard();
@@ -524,8 +524,9 @@ BOOL LLTaskInvFVBridge::copyToClipboard() const
 	return FALSE;
 }
 
-void LLTaskInvFVBridge::cutToClipboard()
+BOOL LLTaskInvFVBridge::cutToClipboard() const
 {
+	return FALSE;
 }
 
 BOOL LLTaskInvFVBridge::isClipboardPasteable() const
-- 
GitLab


From f27ea1aff738f3222c782a7fac5b9172fc3cf67c Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 7 Feb 2012 22:50:49 -0800
Subject: [PATCH 730/933] EXP-1181 WIP as a designer I would like to specify
 default floater positions using realtive coordinates fixed build moved
 conversion funcs to llwindow.cpp as they work on all platforms refactored
 translateintorect to take overlap as parameter

---
 indra/llmath/llcoord.h           | 13 ++---
 indra/llui/llcombobox.cpp        |  2 +-
 indra/llui/llfloater.cpp         | 81 +++++++++++++++++++++++++++++---
 indra/llui/llview.cpp            | 69 ++++++++-------------------
 indra/llui/llview.h              |  2 +-
 indra/llwindow/llwindow.cpp      | 39 +++++++++++++++
 indra/llwindow/llwindowwin32.cpp | 38 ---------------
 7 files changed, 143 insertions(+), 101 deletions(-)

diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h
index 0b1d7e04f59..1f617e649e9 100644
--- a/indra/llmath/llcoord.h
+++ b/indra/llmath/llcoord.h
@@ -26,9 +26,12 @@
 #ifndef LL_LLCOORD_H
 #define LL_LLCOORD_H
 
-struct LL_COORD_TYPE_COMMON 
+struct LLCoordCommon
 {
-	typedef S32 value_t;
+	LLCoordCommon(S32 x, S32 y) : mX(x), mY(y) {}
+	LLCoordCommon() : mX(0), mY(0) {}
+	S32 mX;
+	S32 mY;
 };
 
 // A two-dimensional pixel value
@@ -45,12 +48,12 @@ class LLCoord : protected COORD_FRAME
 	LLCoord(S32 x, S32 y): mX(x), mY(y)
 	{}
 
-	LLCoord(const LLCoord<LL_COORD_TYPE_COMMON>& other)
+	LLCoord(const LLCoordCommon& other)
 	{
 		COORD_FRAME::convertFromCommon(other);
 	}
 
-	LLCoord<LL_COORD_TYPE_COMMON> convert() const
+	LLCoordCommon convert() const
 	{
 		return COORD_FRAME::convertToCommon();
 	}
@@ -61,8 +64,6 @@ class LLCoord : protected COORD_FRAME
 
 };
 
-typedef LLCoord<LL_COORD_TYPE_COMMON> LLCoordCommon;
-
 struct LL_COORD_TYPE_GL 
 {
 	typedef S32 value_t;
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 89d8842393b..806d2ef3f65 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -613,7 +613,7 @@ void LLComboBox::showList()
 	}
 	mList->setOrigin(rect.mLeft, rect.mBottom);
 	mList->reshape(rect.getWidth(), rect.getHeight());
-	mList->translateIntoRect(root_view_local, FALSE);
+	mList->translateIntoRect(root_view_local);
 
 	// Make sure we didn't go off bottom of screen
 	S32 x, y;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 6274caa97fc..3afa1b8e3ad 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -926,7 +926,7 @@ void LLFloater::applyPositioning(LLFloater* other)
 			setOrigin(mSpecifiedLeft, mSpecifiedBottom);
 			const LLRect& snap_rect = gFloaterView->getSnapRect();
 			translate(snap_rect.mLeft, snap_rect.mBottom);
-			translateIntoRect(snap_rect, FALSE);
+			translateIntoRect(snap_rect);
 		}
 		break;
 
@@ -950,7 +950,7 @@ void LLFloater::applyPositioning(LLFloater* other)
 			setOrigin(horizontal_offset, vertical_offset - rect_height);
 
 			translate(snap_rect.mLeft, snap_rect.mBottom);
-			translateIntoRect(snap_rect, FALSE);
+			translateIntoRect(snap_rect);
 		}
 		break;
 
@@ -2644,6 +2644,8 @@ void LLFloaterView::refresh()
 	}
 }
 
+const S32 FLOATER_MIN_VISIBLE_PIXELS = 16;
+
 void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside)
 {
 	if (floater->getParent() != this)
@@ -2697,7 +2699,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out
 	}
 
 	// move window fully onscreen
-	if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ))
+	if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX ))
 	{
 		floater->clearSnapTarget();
 	}
@@ -3305,12 +3307,79 @@ bool LLCoordFloater::operator==(const LLCoordFloater& other) const
 LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
 {
 	const LLCoordFloater& self = static_cast<const LLCoordFloater&>(*this);
-	return LLCoordCommon(self.mX, self.mY);
+
+	LLRect snap_rect = gFloaterView->getSnapRect();
+	LLFloater* floaterp = mFloater.get();
+	S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
+	S32 floater_height = floaterp ? floaterp->getRect().getHeight() : 0;
+	LLCoordCommon out;
+	if (self.mX < -0.5f)
+	{
+		out.mX = llround(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
+	}
+	else if (self.mX > 0.5f)
+	{
+		out.mX = llround(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
+	}
+	else
+	{
+		out.mX = llround(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
+	}
+
+	if (self.mY < -0.5f)
+	{
+		out.mY = llround(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
+	}
+	else if (self.mY > 0.5f)
+	{
+		out.mY = llround(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
+	}
+	else
+	{
+		out.mY = llround(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
+	}
+
+	// return center point instead of lower left
+	out.mX += floater_width / 2;
+	out.mY += floater_height / 2;
+
+	return out;
 }
 
 void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from)
 {
 	LLCoordFloater& self = static_cast<LLCoordFloater&>(*this);
-	self.mX = from.mX;
-	self.mY = from.mY;
+	LLRect snap_rect = gFloaterView->getSnapRect();
+	LLFloater* floaterp = mFloater.get();
+	S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
+	S32 floater_height = floaterp ? floaterp->getRect().getHeight() : 0;
+
+	S32 from_x = from.mX - floater_width / 2;
+	S32 from_y = from.mY - floater_height / 2;
+
+	if (from_x < snap_rect.mLeft)
+	{
+		self.mX = rescale(from_x, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft, -1.f, -0.5f);
+	}
+	else if (from_x + floater_width > snap_rect.mRight)
+	{
+		self.mX = rescale(from_x, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS, 0.5f, 1.f);
+	}
+	else
+	{
+		self.mX = rescale(from_x, snap_rect.mLeft, snap_rect.mRight - floater_width, -0.5f, 0.5f);
+	}
+
+	if (from_y < snap_rect.mBottom)
+	{
+		self.mY = rescale(from_y, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom, -1.f, -0.5f);
+	}
+	else if (from_y + floater_height > snap_rect.mTop)
+	{
+		self.mY = rescale(from_y, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS, 0.5f, 1.f);
+	}
+	else
+	{
+		self.mY = rescale(from_y, snap_rect.mBottom, snap_rect.mTop - floater_height, -0.5f, 0.5f);
+	}
 }
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 1a62fe75fcc..d22e14745f0 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1616,59 +1616,30 @@ LLView* LLView::findNextSibling(LLView* child)
 }
 
 
-LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, BOOL allow_partial_outside)
+LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, S32 min_overlap_pixels)
 {
 	LLCoordGL delta;
 
-	if (allow_partial_outside)
-	{
-		const S32 KEEP_ONSCREEN_PIXELS = 16;
+	const S32 KEEP_ONSCREEN_PIXELS_WIDTH = llmin(min_overlap_pixels, input.getWidth());
+	const S32 KEEP_ONSCREEN_PIXELS_HEIGHT = llmin(min_overlap_pixels, input.getHeight());
 
-		if( input.mRight - KEEP_ONSCREEN_PIXELS < constraint.mLeft )
-		{
-			delta.mX = constraint.mLeft - (input.mRight - KEEP_ONSCREEN_PIXELS);
-		}
-		else
-		if( input.mLeft + KEEP_ONSCREEN_PIXELS > constraint.mRight )
-		{
-			delta.mX = constraint.mRight - (input.mLeft + KEEP_ONSCREEN_PIXELS);
-		}
+	if( input.mRight - KEEP_ONSCREEN_PIXELS_WIDTH < constraint.mLeft )
+	{
+		delta.mX = constraint.mLeft - (input.mRight - KEEP_ONSCREEN_PIXELS_WIDTH);
+	}
+	else if( input.mLeft + KEEP_ONSCREEN_PIXELS_WIDTH > constraint.mRight )
+	{
+		delta.mX = constraint.mRight - (input.mLeft + KEEP_ONSCREEN_PIXELS_WIDTH);
+	}
 
-		if( input.mTop > constraint.mTop )
-		{
-			delta.mY = constraint.mTop - input.mTop;
-		}
-		else
-		if( input.mTop - KEEP_ONSCREEN_PIXELS < constraint.mBottom )
-		{
-			delta.mY = constraint.mBottom - (input.mTop - KEEP_ONSCREEN_PIXELS);
-		}
+	if( input.mTop > constraint.mTop )
+	{
+		delta.mY = constraint.mTop - input.mTop;
 	}
 	else
+	if( input.mTop - KEEP_ONSCREEN_PIXELS_HEIGHT < constraint.mBottom )
 	{
-		if( input.mLeft < constraint.mLeft )
-		{
-			delta.mX = constraint.mLeft - input.mLeft;
-		}
-		else
-		if( input.mRight > constraint.mRight )
-		{
-			delta.mX = constraint.mRight - input.mRight;
-			// compensate for left edge possible going off screen
-			delta.mX += llmax( 0, input.getWidth() - constraint.getWidth() );
-		}
-
-		if( input.mTop > constraint.mTop )
-		{
-			delta.mY = constraint.mTop - input.mTop;
-		}
-		else
-		if( input.mBottom < constraint.mBottom )
-		{
-			delta.mY = constraint.mBottom - input.mBottom;
-			// compensate for top edge possible going off screen
-			delta.mY -= llmax( 0, input.getHeight() - constraint.getHeight() );
-		}
+		delta.mY = constraint.mBottom - (input.mTop - KEEP_ONSCREEN_PIXELS_HEIGHT);
 	}
 
 	return delta;
@@ -1677,9 +1648,9 @@ LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, BO
 // Moves the view so that it is entirely inside of constraint.
 // If the view will not fit because it's too big, aligns with the top and left.
 // (Why top and left?  That's where the drag bars are for floaters.)
-BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outside )
+BOOL LLView::translateIntoRect(const LLRect& constraint, S32 min_overlap_pixels)
 {
-	LLCoordGL translation = getNeededTranslation(getRect(), constraint, allow_partial_outside);
+	LLCoordGL translation = getNeededTranslation(getRect(), constraint, min_overlap_pixels);
 
 	if (translation.mX != 0 || translation.mY != 0)
 	{
@@ -1691,9 +1662,9 @@ BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outs
 
 // move this view into "inside" but not onto "exclude"
 // NOTE: if this view is already contained in "inside", we ignore the "exclude" rect
-BOOL LLView::translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, BOOL allow_partial_outside )
+BOOL LLView::translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, S32 min_overlap_pixels)
 {
-	LLCoordGL translation = getNeededTranslation(getRect(), inside, allow_partial_outside);
+	LLCoordGL translation = getNeededTranslation(getRect(), inside, min_overlap_pixels);
 	
 	if (translation.mX != 0 || translation.mY != 0)
 	{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index f1fac5f69ce..de2fab963bf 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -370,7 +370,7 @@ class LLView
 	virtual void	reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
 	virtual void	translate( S32 x, S32 y );
 	void			setOrigin( S32 x, S32 y )	{ mRect.translate( x - mRect.mLeft, y - mRect.mBottom ); }
-	BOOL			translateIntoRect( const LLRect& constraint, BOOL allow_partial_outside );
+	BOOL			translateIntoRect( const LLRect& constraint, S32 min_overlap_pixels = S32_MAX);
 	BOOL			translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, BOOL allow_partial_outside );
 	void			centerWithin(const LLRect& bounds);
 
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 2e9e31bfea1..6834b34387c 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -436,3 +436,42 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window)
 {
 	return sWindowList.find(window) != sWindowList.end();
 }
+
+//coordinate conversion utility funcs that forward to llwindow
+LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
+{
+	const LLCoordWindow& self = static_cast<const LLCoordWindow&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL out;
+	windowp->convertCoords(self, &out);
+	return out.convert();
+}
+
+void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
+{
+	LLCoordWindow& self = static_cast<LLCoordWindow&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL from_gl(from);
+	windowp->convertCoords(from_gl, &self);
+}
+
+LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
+{
+	const LLCoordScreen& self = static_cast<const LLCoordScreen&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL out;
+	windowp->convertCoords(self, &out);
+	return out.convert();
+}
+
+void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from)
+{
+	LLCoordScreen& self = static_cast<LLCoordScreen&>(*this);
+
+	LLWindow* windowp = &(*LLWindow::beginInstances());
+	LLCoordGL from_gl(from);
+	windowp->convertCoords(from_gl, &self);
+}
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index a8d2836f48b..ebc3203f14e 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2560,44 +2560,6 @@ BOOL LLWindowWin32::convertCoords(LLCoordGL from, LLCoordWindow *to)
 	return TRUE;
 }
 
-LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
-{
-	const LLCoordWindow& self = static_cast<const LLCoordWindow&>(*this);
-
-	LLWindow* windowp = &(*LLWindow::beginInstances());
-	LLCoordGL out;
-	windowp->convertCoords(self, &out);
-	return out.convert();
-}
-
-void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
-{
-	LLCoordWindow& self = static_cast<LLCoordWindow&>(*this);
-
-	LLWindow* windowp = &(*LLWindow::beginInstances());
-	LLCoordGL from_gl(from);
-	windowp->convertCoords(from_gl, &self);
-}
-
-LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
-{
-	const LLCoordScreen& self = static_cast<const LLCoordScreen&>(*this);
-
-	LLWindow* windowp = &(*LLWindow::beginInstances());
-	LLCoordGL out;
-	windowp->convertCoords(self, &out);
-	return out.convert();
-}
-
-void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from)
-{
-	LLCoordScreen& self = static_cast<LLCoordScreen&>(*this);
-
-	LLWindow* windowp = &(*LLWindow::beginInstances());
-	LLCoordGL from_gl(from);
-	windowp->convertCoords(from_gl, &self);
-}
-
 BOOL LLWindowWin32::convertCoords(LLCoordWindow from, LLCoordGL* to)
 {
 	S32		client_height;
-- 
GitLab


From 0fe14d9d70e247156f98991a484de4f5ece9ae8a Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 8 Feb 2012 10:33:46 -0500
Subject: [PATCH 731/933] Echo group_started, group_completed to test-program
 output file. This isn't recent oversight; in viewer-development the output
 file never contained those lines either. But it should. Using scoped_ptr is
 more robust than using a dumb pointer with inline "Oh yeah, don't forget to
 clean up that pointer" logic.

---
 indra/test/test.cpp | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 1adcfb6f45f..e58e7293fb7 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -64,6 +64,7 @@
 #pragma warning (pop)
 #endif
 
+#include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/foreach.hpp>
@@ -115,11 +116,11 @@ class LLTestCallback : public tut::callback
 	}
 
 	virtual void group_started(const std::string& name) {
-		std::cout << "Unit test group_started name=" << name << std::endl;
+		*mStream << "Unit test group_started name=" << name << std::endl;
 	}
 
 	virtual void group_completed(const std::string& name) {
-		std::cout << "Unit test group_completed name=" << name << std::endl;
+		*mStream << "Unit test group_completed name=" << name << std::endl;
 	}
 
 	virtual void test_completed(const tut::test_result& tr)
@@ -408,7 +409,7 @@ int main(int argc, char **argv)
 	apr_getopt_t* os = NULL;
 	if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv))
 	{
-		std::cerr << "Unable to  pool" << std::endl;
+		std::cerr << "apr_getopt_init() failed" << std::endl;
 		return 1;
 	}
 
@@ -422,7 +423,7 @@ int main(int argc, char **argv)
 	apr_status_t apr_err;
 	const char* opt_arg = NULL;
 	int opt_id = 0;
-	std::ofstream *output = NULL;
+	boost::scoped_ptr<std::ofstream> output;
 	const char *touch = NULL;
 
 	while(true)
@@ -452,7 +453,7 @@ int main(int argc, char **argv)
 				verbose_mode = true;
 				break;
 			case 'o':
-				output = new std::ofstream;
+				output.reset(new std::ofstream);
 				output->open(opt_arg);
 				break;
 			case 's':	// --sourcedir
@@ -486,11 +487,11 @@ int main(int argc, char **argv)
 	LLTestCallback* mycallback;
 	if (getenv("TEAMCITY_PROJECT_NAME"))
 	{
-		mycallback = new LLTCTestCallback(verbose_mode, output);		
+		mycallback = new LLTCTestCallback(verbose_mode, output.get());		
 	}
 	else
 	{
-		mycallback = new LLTestCallback(verbose_mode, output);
+		mycallback = new LLTestCallback(verbose_mode, output.get());
 	}
 
 	tut::runner.get().set_callback(mycallback);
@@ -512,12 +513,6 @@ int main(int argc, char **argv)
 		std::cin.get();
 	}
 
-	if (output)
-	{
-		output->close();
-		delete output;
-	}
-
 	if (touch && success)
 	{
 		std::ofstream s;
-- 
GitLab


From bd1ea1b7643eaedae0853f3eb8380a2f19bd22a3 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 8 Feb 2012 13:02:46 -0500
Subject: [PATCH 732/933] STORM-1810 Display Z coordinate in Script Error
 window

---
 doc/contributions.txt                  | 1 +
 indra/newview/llfloaterscriptdebug.cpp | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..24191c3e6f6 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -610,6 +610,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-1810
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp
index a0d1a32e129..b691db1049f 100644
--- a/indra/newview/llfloaterscriptdebug.cpp
+++ b/indra/newview/llfloaterscriptdebug.cpp
@@ -106,7 +106,11 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std:
 	if (objectp)
 	{
 		objectp->setIcon(LLViewerTextureManager::getFetchedTextureFromFile("script_error.j2c", TRUE, LLViewerTexture::BOOST_UI));
-		floater_label = llformat("%s(%.2f, %.2f)", user_name.c_str(), objectp->getPositionRegion().mV[VX], objectp->getPositionRegion().mV[VY]);
+		floater_label = llformat("%s(%.0f, %.0f, %.0f)",
+						user_name.c_str(),
+						objectp->getPositionRegion().mV[VX],
+						objectp->getPositionRegion().mV[VY],
+						objectp->getPositionRegion().mV[VZ]);
 	}
 	else
 	{
-- 
GitLab


From 1b50125546e898f703879a3fe759fefd442e97b9 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 8 Feb 2012 20:25:36 +0200
Subject: [PATCH 733/933] EXP-1879 FIXED Crash in People floater in mouselook
 mode.

---
 indra/newview/llfloateravatarpicker.cpp | 5 +++++
 indra/newview/llpanelpeople.cpp         | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index aa66fcf9b8d..0290e7cdf08 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -63,6 +63,11 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
 	// *TODO: Use a key to allow this not to be an effective singleton
 	LLFloaterAvatarPicker* floater = 
 		LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
+	if (!floater)
+	{
+		llwarns << "Cannot instantiate avatar picker" << llendl;
+		return NULL;
+	}
 	
 	floater->mSelectionCallback = callback;
 	floater->setAllowMultiple(allow_multiple);
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 9c46f04abfd..f1380e7a362 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1162,8 +1162,13 @@ void LLPanelPeople::onAddFriendWizButtonClicked()
 {
 	// Show add friend wizard.
 	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), FALSE, TRUE);
+	if (!picker)
+	{
+		return;
+	}
+
 	// Need to disable 'ok' button when friend occurs in selection
-	if (picker)	picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1));
+	picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1));
 	LLFloater* root_floater = gFloaterView->getParentFloater(this);
 	if (root_floater)
 	{
-- 
GitLab


From 93c570b38b9d0ebed930f986e071800d643e1b74 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 8 Feb 2012 14:27:55 -0500
Subject: [PATCH 734/933] STORM-1809 The word "Multiple" does NOT show in the
 edit window when editing prims or linksets with mixed textures in LL V3

---
 doc/contributions.txt                          | 1 +
 indra/newview/lltexturectrl.cpp                | 7 +++++++
 indra/newview/skins/default/xui/en/strings.xml | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..e11f98ccc57 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -610,6 +610,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-1809
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index de22f2ae6b7..ddedb1dcfb5 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -929,6 +929,13 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
 	tentative_label_p.rect(LLRect (0, image_middle + line_height / 2, getRect().getWidth(), image_middle - line_height / 2 ));
 	tentative_label_p.follows.flags(FOLLOWS_ALL);
 	mTentativeLabel = LLUICtrlFactory::create<LLTextBox> (tentative_label_p);
+
+	// It is no longer possible to associate a style with a textbox, so it has to be done in this fashion
+	LLStyle::Params style_params;
+	style_params.color = LLColor4::white;
+
+	mTentativeLabel->setText(LLTrans::getString("multiple_textures"), style_params);
+	mTentativeLabel->setHAlign(LLFontGL::HCENTER);
 	addChild( mTentativeLabel );
 
 	LLRect border_rect = getLocalRect();
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3351ffe00fb..9efe78d8ec8 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -369,6 +369,9 @@ Please try logging in again in a minute.</string>
 	<string name="anim_yes_happy">Yes (Happy)</string>
 	<string name="anim_yes_head">Yes</string>
 
+	<!-- build floater -->
+	<string name="multiple_textures">Multiple</string>
+
 	<!-- world map -->
 	<string name="texture_loading">Loading...</string>
 	<string name="worldmap_offline">Offline</string>
-- 
GitLab


From 039c50f2b4831a4caad3313b3e8e1c992793ae90 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 8 Feb 2012 15:41:27 -0500
Subject: [PATCH 735/933] STORM-1807 Play animation floater 2nd play button
 active while animation is playing

---
 doc/contributions.txt                         |   1 +
 indra/newview/llinventorybridge.cpp           |   8 +-
 indra/newview/llpreviewanim.cpp               | 140 ++++++++----------
 indra/newview/llpreviewanim.h                 |  20 +--
 .../xui/en/floater_preview_animation.xml      |  16 +-
 5 files changed, 86 insertions(+), 99 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..434e7626fcc 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -610,6 +610,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-1807
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index cebe93f0422..654ebe78fa7 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4633,14 +4633,14 @@ void LLAnimationBridge::performAction(LLInventoryModel* model, std::string actio
 	{
 		if (getItem())
 		{
-			LLPreviewAnim::e_activation_type activate = LLPreviewAnim::NONE;
-			if ("playworld" == action) activate = LLPreviewAnim::PLAY;
-			if ("playlocal" == action) activate = LLPreviewAnim::AUDITION;
+			LLSD::String activate = "NONE";
+			if ("playworld" == action) activate = "Inworld";
+			if ("playlocal" == action) activate = "Locally";
 
 			LLPreviewAnim* preview = LLFloaterReg::showTypedInstance<LLPreviewAnim>("preview_anim", LLSD(mUUID));
 			if (preview)
 			{
-				preview->activate(activate);
+				preview->play(activate);
 			}
 		}
 	}
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index 8e8b530e135..dcb8bca5126 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -43,19 +43,7 @@ extern LLAgent gAgent;
 LLPreviewAnim::LLPreviewAnim(const LLSD& key)
 	: LLPreview( key )
 {
-}
-
-// static
-void LLPreviewAnim::endAnimCallback( void *userdata )
-{
-	LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata);
-	LLFloater* self = handlep->get();
-	delete handlep; // done with the handle
-	if (self)
-	{
-		self->getChild<LLUICtrl>("Anim play btn")->setValue(FALSE);
-		self->getChild<LLUICtrl>("Anim audition btn")->setValue(FALSE);
-	}
+	mCommitCallbackRegistrar.add("PreviewAnim.Play", boost::bind(&LLPreviewAnim::play, this, _2));
 }
 
 // virtual
@@ -68,105 +56,108 @@ BOOL LLPreviewAnim::postBuild()
 		getChild<LLUICtrl>("desc")->setValue(item->getDescription());
 	}
 
-	childSetAction("Anim play btn",playAnim, this);
-	childSetAction("Anim audition btn",auditionAnim, this);
-
 	childSetCommitCallback("desc", LLPreview::onText, this);
 	getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
-	
+
 	return LLPreview::postBuild();
 }
 
-void LLPreviewAnim::activate(e_activation_type type)
+// static
+// llinventorybridge also calls into here
+void LLPreviewAnim::play(const LLSD& param)
 {
-	switch ( type ) 
+	const LLInventoryItem *item = getItem();
+
+	if(item)
 	{
-		case PLAY:
+		LLUUID itemID=item->getAssetUUID();
+
+		std::string btn_name = param.asString();
+		LLButton* btn_inuse;
+		LLButton* btn_other;
+
+		if ("Inworld" == btn_name)
 		{
-			playAnim( (void *) this );
-			break;
+			btn_inuse = getChild<LLButton>("Inworld");
+			btn_other = getChild<LLButton>("Locally");
 		}
-		case AUDITION:
+		else if ("Locally" == btn_name)
 		{
-			auditionAnim( (void *) this );
-			break;
+			btn_inuse = getChild<LLButton>("Locally");
+			btn_other = getChild<LLButton>("Inworld");
 		}
-		default:
+		else
 		{
-		//do nothing
+			return;
 		}
-	}
-}
 
-// static
-void LLPreviewAnim::playAnim( void *userdata )
-{
-	LLPreviewAnim* self = (LLPreviewAnim*) userdata;
-	const LLInventoryItem *item = self->getItem();
-
-	if(item)
-	{
-		LLUUID itemID=item->getAssetUUID();
+		if (btn_inuse)
+		{
+			btn_inuse->toggleState();
+		}
 
-		LLButton* btn = self->getChild<LLButton>("Anim play btn");
-		if (btn)
+		if (btn_other)
 		{
-			btn->toggleState();
+			btn_other->setEnabled(false);
 		}
 		
-		if (self->getChild<LLUICtrl>("Anim play btn")->getValue().asBoolean() ) 
+		if (getChild<LLUICtrl>(btn_name)->getValue().asBoolean() ) 
 		{
-			self->mPauseRequest = NULL;
-			gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START);
+			"Inworld" == btn_name ? gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START) :
+									gAgentAvatarp->startMotion(item->getAssetUUID());
+
 			LLMotion* motion = gAgentAvatarp->findMotion(itemID);
 			if (motion)
 			{
-				motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLHandle<LLFloater>(self->getHandle())));
+				mItemID = itemID;
+				mDidStart = false;
 			}
 		}
 		else
 		{
 			gAgentAvatarp->stopMotion(itemID);
 			gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_STOP);
+
+			if (btn_other)
+			{
+				btn_other->setEnabled(true);
+			}
 		}
 	}
 }
 
-// static
-void LLPreviewAnim::auditionAnim( void *userdata )
+// virtual
+void LLPreviewAnim::draw()
 {
-	LLPreviewAnim* self = (LLPreviewAnim*) userdata;
-	const LLInventoryItem *item = self->getItem();
-
-	if(item)
+	LLPreview::draw();
+	if (!this->mItemID.isNull())
 	{
-		LLUUID itemID=item->getAssetUUID();
-
-		LLButton* btn = self->getChild<LLButton>("Anim audition btn");
-		if (btn)
-		{
-			btn->toggleState();
-		}
-		
-		if (self->getChild<LLUICtrl>("Anim audition btn")->getValue().asBoolean() ) 
+		LLMotion* motion = gAgentAvatarp->findMotion(this->mItemID);
+		if (motion)
 		{
-			self->mPauseRequest = NULL;
-			gAgentAvatarp->startMotion(item->getAssetUUID());
-			LLMotion* motion = gAgentAvatarp->findMotion(itemID);
-			
-			if (motion)
+			if (motion->isStopped() && this->mDidStart)
 			{
-				motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLHandle<LLFloater>(self->getHandle())));
+				cleanup();
+			}
+			if(gAgentAvatarp->isMotionActive(this->mItemID) && !this->mDidStart)
+			{
+				this->mDidStart = true;
 			}
-		}
-		else
-		{
-			gAgentAvatarp->stopMotion(itemID);
-			gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_STOP);
 		}
 	}
 }
 
+// virtual
+void LLPreviewAnim::cleanup()
+{
+	this->mItemID = LLUUID::null;
+	this->mDidStart = false;
+	getChild<LLUICtrl>("Inworld")->setValue(FALSE);
+	getChild<LLUICtrl>("Locally")->setValue(FALSE);
+	getChild<LLUICtrl>("Inworld")->setEnabled(true);
+	getChild<LLUICtrl>("Locally")->setEnabled(true);
+}
+
 // virtual
 void LLPreviewAnim::onClose(bool app_quitting)
 {
@@ -176,12 +167,5 @@ void LLPreviewAnim::onClose(bool app_quitting)
 	{
 		gAgentAvatarp->stopMotion(item->getAssetUUID());
 		gAgent.sendAnimationRequest(item->getAssetUUID(), ANIM_REQUEST_STOP);
-		LLMotion* motion = gAgentAvatarp->findMotion(item->getAssetUUID());
-		
-		if (motion)
-		{
-			// *TODO: minor memory leak here, user data is never deleted (Use real callbacks)
-			motion->setDeactivateCallback(NULL, (void *)NULL);
-		}
 	}
 }
diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h
index 32e07ee33a0..8eaed6ca1f9 100644
--- a/indra/newview/llpreviewanim.h
+++ b/indra/newview/llpreviewanim.h
@@ -33,24 +33,18 @@
 class LLPreviewAnim : public LLPreview
 {
 public:
-	enum e_activation_type { NONE = 0, PLAY = 1, AUDITION = 2 };
-	LLPreviewAnim(const LLSD& key);
 
-	static void playAnim( void* userdata );
-	static void auditionAnim( void* userdata );
-	static void endAnimCallback( void *userdata );
+	LLPreviewAnim(const LLSD& key);
 	/*virtual*/	BOOL postBuild();
 	/*virtual*/ void onClose(bool app_quitting);
-	void activate(e_activation_type type);
+	void draw();
+	void cleanup();
+	void play(const LLSD& param);
 	
 protected:
 	
-	LLAnimPauseRequest	mPauseRequest;
-	LLUUID		mItemID;
-	std::string	mTitle;
-	LLUUID		mObjectID;
-	LLButton*	mPlayBtn;
-	LLButton*	mAuditionBtn;
+	LLUUID	mItemID;
+	bool	mDidStart;
 };
 
-#endif  // LL_LLPREVIEWSOUND_H
+#endif  // LL_LLPREVIEWANIM_H
diff --git a/indra/newview/skins/default/xui/en/floater_preview_animation.xml b/indra/newview/skins/default/xui/en/floater_preview_animation.xml
index 8427c7b06f2..3ea5f54f2cb 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_animation.xml
@@ -41,18 +41,26 @@
      label_selected="Stop"
      layout="topleft"
      left="10"
-     name="Anim play btn"
+     name="Inworld"
      tool_tip="Play this animation so that others can see it"
      top="47"
-     width="125" />
+     width="125">
+       <button.commit_callback
+        function="PreviewAnim.Play"
+        parameter="Inworld" /> 
+    </button>
     <button
      height="20"
      label="Play Locally"
      label_selected="Stop"
      layout="topleft"
      left_pad="5"
-     name="Anim audition btn"
+     name="Locally"
      tool_tip="Play this animation so that only you can see it"
      top_delta="0"
-     width="125" />
+     width="125">
+       <button.commit_callback
+        function="PreviewAnim.Play"
+        parameter="Locally" /> 
+    </button>
 </floater>
-- 
GitLab


From d10bcca167e2d4332dced910660aa1a6a85bc175 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 8 Feb 2012 15:14:03 -0600
Subject: [PATCH 736/933] SH-2592 Fix for some shader uniforms using the wrong
 vector size.

---
 indra/newview/app_settings/shaders/class1/deferred/skyV.glsl  | 2 --
 .../app_settings/shaders/class2/windlight/cloudsV.glsl        | 4 ++--
 indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 2 --
 indra/newview/llwaterparammanager.cpp                         | 2 +-
 indra/newview/llwlparamset.cpp                                | 4 ++--
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 2c8808bdcef..cb7603f4fd3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -55,8 +55,6 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
-
 void main()
 {
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 24063597215..c1dd45cd672 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -60,7 +60,7 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
+uniform float cloud_scale;
 
 void main()
 {
@@ -169,7 +169,7 @@ void main()
 	// Texture coords
 	vary_texcoord0 = texcoord0;
 	vary_texcoord0.xy -= 0.5;
-	vary_texcoord0.xy /= cloud_scale.x;
+	vary_texcoord0.xy /= cloud_scale;
 	vary_texcoord0.xy += 0.5;
 
 	vary_texcoord1 = vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 6a87caa8cf3..3788ddaf2d4 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -53,8 +53,6 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
-
 void main()
 {
 
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 20b34637b8c..e3861123348 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -194,7 +194,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
 		shader->uniform4fv("waterPlane", 1, mWaterPlane.mV);
 		shader->uniform1f("waterFogDensity", getFogDensity());
 		shader->uniform1f("waterFogKS", mWaterFogKS);
-		shader->uniform4f("distance_multiplier", 0, 0, 0, 0);
+		shader->uniform1f("distance_multiplier", 0);
 	}
 }
 
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 1e95b3ea4a7..b04d30db552 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -75,9 +75,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const
 			stop_glerror();
 		}
 		else if (param == "cloud_scale" || param == "cloud_shadow" ||
-				 param == "density_multiplier" ||
+				 param == "density_multiplier" || param == "distance_multiplier" ||
 				 param == "haze_density" || param == "haze_horizon" ||
-				 param == "max_y")
+				 param == "max_y" )
 		{
 			F32 val = (F32) i->second[0].asReal();
 
-- 
GitLab


From bb1a1f9d01fdbc377ca61f52041f66a86b974086 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 10 Feb 2012 14:28:16 -0600
Subject: [PATCH 737/933] SH-2963 Fix for highlight transparent not
 highlighting 100% transparent objects.

---
 indra/newview/lldrawpool.h        |  1 +
 indra/newview/lldrawpoolalpha.cpp |  1 +
 indra/newview/llvovolume.cpp      | 10 +++++++---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 5a2981e7496..64774d06df7 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -133,6 +133,7 @@ class LLRenderPass : public LLDrawPool
 		PASS_ALPHA,
 		PASS_ALPHA_MASK,
 		PASS_FULLBRIGHT_ALPHA_MASK,
+		PASS_ALPHA_INVISIBLE,
 		NUM_RENDER_TYPES,
 	};
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index ddb7d3ceebd..5b62dbc560c 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -337,6 +337,7 @@ void LLDrawPoolAlpha::render(S32 pass)
 
 		pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 		pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
+		pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 
 		if(shaders) 
 		{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 63542307965..438d578ac5f 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4433,10 +4433,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 					else
 					{
 						if (te->getColor().mV[3] > 0.f)
-						{
+						{ //only treat as alpha in the pipeline if < 100% transparent
 							drawablep->setState(LLDrawable::HAS_ALPHA);
-							alpha_faces.push_back(facep);
 						}
+						alpha_faces.push_back(facep);
 					}
 				}
 				else
@@ -4952,7 +4952,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 			if (is_alpha)
 			{
 				// can we safely treat this as an alpha mask?
-				if (facep->canRenderAsMask())
+				if (facep->getFaceColor().mV[3] <= 0.f)
+				{ //100% transparent, don't render unless we're highlighting transparent
+					registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE);
+				}
+				else if (facep->canRenderAsMask())
 				{
 					if (te->getFullbright() || LLPipeline::sNoAlpha)
 					{
-- 
GitLab


From c6acd4723526ed82e79dccef18aaf4821e53dfeb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 8 Feb 2012 15:14:03 -0600
Subject: [PATCH 738/933] SH-2592 Fix for some shader uniforms using the wrong
 vector size.

---
 indra/newview/app_settings/shaders/class1/deferred/skyV.glsl  | 2 --
 .../app_settings/shaders/class2/windlight/cloudsV.glsl        | 4 ++--
 indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 2 --
 indra/newview/llwaterparammanager.cpp                         | 2 +-
 indra/newview/llwlparamset.cpp                                | 4 ++--
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 2c8808bdcef..cb7603f4fd3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -55,8 +55,6 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
-
 void main()
 {
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 24063597215..c1dd45cd672 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -60,7 +60,7 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
+uniform float cloud_scale;
 
 void main()
 {
@@ -169,7 +169,7 @@ void main()
 	// Texture coords
 	vary_texcoord0 = texcoord0;
 	vary_texcoord0.xy -= 0.5;
-	vary_texcoord0.xy /= cloud_scale.x;
+	vary_texcoord0.xy /= cloud_scale;
 	vary_texcoord0.xy += 0.5;
 
 	vary_texcoord1 = vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 6a87caa8cf3..3788ddaf2d4 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -53,8 +53,6 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
-
 void main()
 {
 
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 20b34637b8c..e3861123348 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -194,7 +194,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
 		shader->uniform4fv("waterPlane", 1, mWaterPlane.mV);
 		shader->uniform1f("waterFogDensity", getFogDensity());
 		shader->uniform1f("waterFogKS", mWaterFogKS);
-		shader->uniform4f("distance_multiplier", 0, 0, 0, 0);
+		shader->uniform1f("distance_multiplier", 0);
 	}
 }
 
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 1e95b3ea4a7..b04d30db552 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -75,9 +75,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const
 			stop_glerror();
 		}
 		else if (param == "cloud_scale" || param == "cloud_shadow" ||
-				 param == "density_multiplier" ||
+				 param == "density_multiplier" || param == "distance_multiplier" ||
 				 param == "haze_density" || param == "haze_horizon" ||
-				 param == "max_y")
+				 param == "max_y" )
 		{
 			F32 val = (F32) i->second[0].asReal();
 
-- 
GitLab


From 1f5c2c056ff2b660b053cf3a7344fdf1c5c15b0e Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 8 Feb 2012 18:25:35 -0500
Subject: [PATCH 739/933] STORM-1808 Indicate ability to build

---
 doc/contributions.txt                   | 1 +
 indra/newview/app_settings/commands.xml | 2 ++
 indra/newview/llagent.cpp               | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..bbaee68d02d 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -610,6 +610,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-1808
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 1d1d39c786b..16a7e0b3149 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -37,6 +37,8 @@
            tooltip_ref="Command_Build_Tooltip"
            execute_function="Build.Toggle"
            execute_parameters="build"
+           is_enabled_function="Agent.IsActionAllowed"
+           is_enabled_parameters="build"
            is_running_function="Floater.IsOpen"
            is_running_parameters="build"
            />
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index ab9b5ff4368..f0add8ddc44 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -171,7 +171,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
 
 	if (param == "build")
 	{
-		retval = gAgent.canEditParcel();
+		retval = LLViewerParcelMgr::getInstance()->allowAgentBuild();
 	}
 	else if (param == "speak")
 	{
-- 
GitLab


From 91f77318db63d4b2560390551306056c4a6cc2d5 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 8 Feb 2012 15:44:02 -0800
Subject: [PATCH 740/933] EXP-1873 : Implement the hiding of cut items on the
 clipboard

---
 indra/llui/llclipboard.cpp          |  6 +++++-
 indra/llui/llclipboard.h            | 14 +++++++++-----
 indra/newview/llfolderviewitem.cpp  |  6 ------
 indra/newview/llinventoryfilter.cpp | 19 ++++++++++++++++++-
 indra/newview/llinventoryfilter.h   |  4 +++-
 indra/newview/llinventorypanel.cpp  | 13 +++++++++++++
 indra/newview/llinventorypanel.h    |  1 +
 7 files changed, 49 insertions(+), 14 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 7794a0537f1..ee1f1aa816f 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -34,7 +34,8 @@
 #include "llview.h"
 #include "llwindow.h"
 
-LLClipboard::LLClipboard()
+LLClipboard::LLClipboard() :
+	mState(0)
 {
 	reset();
 }
@@ -46,6 +47,7 @@ LLClipboard::~LLClipboard()
 
 void LLClipboard::reset()
 {
+	mState++;
 	mObjects.reset();
 	mCutMode = false;
 	mString = LLWString();
@@ -74,6 +76,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
 		if (res)
 		{
 			mObjects.put(src);
+			mState++;
 		}
 	}
 	return res;
@@ -126,6 +129,7 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us
 	{
 		mString = mString + sep + src.substr(pos, len);
 	}
+	mState++;
 	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
 }
 
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 608ea246a73..0231169748c 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -47,6 +47,11 @@ class LLClipboard : public LLSingleton<LLClipboard>
 public:
 	LLClipboard();
 	~LLClipboard();
+	
+	// Clears the clipboard
+	void reset();
+	// Returns the state of the clipboard so client can know if it has been modified (comparing with tracked state)
+	int	getState() const { return mState; }
 
 	// Text strings management:
 	// ------------------------
@@ -61,8 +66,6 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	
 	// Object list management:
 	// -----------------------
-	// Clears the clipboard
-	void reset();
 	// Clears and adds one single object to the clipboard
 	bool copyToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);
 	// Adds one object to the current list of objects on the clipboard
@@ -74,12 +77,13 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard
 
 	bool isCutMode() const { return mCutMode; }
-	void setCutMode(bool mode) { mCutMode = mode; }
+	void setCutMode(bool mode) { mCutMode = mode; mState++; }
 
 private:
-	LLDynamicArray<LLUUID> mObjects;
-	LLWString mString;
+	LLDynamicArray<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
+	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).
 	bool mCutMode;						// This is a convenience flag for the viewer. It has no influence on the cliboard management.
+	int mState;							// Incremented when the clipboard change so that interested parties can check its state.
 };
 
 #endif  // LL_LLCLIPBOARD_H
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 37ef27a5d71..884cddfe7f9 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -1004,12 +1004,6 @@ void LLFolderViewItem::draw()
 	if (highlight_link) color = sLinkColor;
 	if (in_library) color = sLibraryColor;
 	
-	// Cut state rendering tweak (experimental)
-	if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(getListener()->getUUID()))
-	{
-		color.setAlpha(0.5);
-	}
-	
 	F32 right_x  = 0;
 	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD;
 	F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation);
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 796251cae5f..9d124780195 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -39,6 +39,7 @@
 #include "llviewerfoldertype.h"
 
 // linden library includes
+#include "llclipboard.h"
 #include "lltrans.h"
 
 LLInventoryFilter::FilterOps::FilterOps() :
@@ -236,7 +237,18 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 			}
 		}
 	}
-	
+
+	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_CLIPBOARD
+	// Pass if this item is not on the clipboard
+	if (filterTypes & FILTERTYPE_CLIPBOARD)
+	{
+		if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(object_id))
+		{
+			return FALSE;
+		}
+	}
+		
 	return TRUE;
 }
 
@@ -450,6 +462,11 @@ void LLInventoryFilter::setFilterEmptySystemFolders()
 	mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
 }
 
+void LLInventoryFilter::setFilterClipboard()
+{
+	mFilterOps.mFilterTypes |= FILTERTYPE_CLIPBOARD;
+}
+
 void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
 {
 	if (mFilterOps.mFilterUUID == LLUUID::null)
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 343306ae8ed..fb4f84b139f 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -59,7 +59,8 @@ class LLInventoryFilter
 		FILTERTYPE_UUID	= 0x1 << 2,		// find the object with UUID and any links to it
 		FILTERTYPE_DATE = 0x1 << 3,		// search by date range
 		FILTERTYPE_WEARABLE = 0x1 << 4,	// search by wearable type
-		FILTERTYPE_EMPTYFOLDERS = 0x1 << 5	// pass if folder is not a system folder to be hidden if empty
+		FILTERTYPE_EMPTYFOLDERS = 0x1 << 5,	// pass if folder is not a system folder to be hidden if empty
+		FILTERTYPE_CLIPBOARD = 0x1 << 6	// pass if item is not on the clipboard
 	};
 
 	enum EFilterLink
@@ -91,6 +92,7 @@ class LLInventoryFilter
 	void 				setFilterUUID(const LLUUID &object_id);
 	void				setFilterWearableTypes(U64 types);
 	void				setFilterEmptySystemFolders();
+	void				setFilterClipboard();
 	void				updateFilterTypes(U64 types, U64& current_types);
 
 	void 				setFilterSubString(const std::string& string);
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 382569fa3a3..27f97ad26f7 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -33,6 +33,7 @@
 #include "llagentwearables.h"
 #include "llappearancemgr.h"
 #include "llavataractions.h"
+#include "llclipboard.h"
 #include "llfloaterinventory.h"
 #include "llfloaterreg.h"
 #include "llfloatersidepanelcontainer.h"
@@ -247,6 +248,10 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 		getFilter()->setFilterEmptySystemFolders();
 	}
 	
+	// hide items that are on the clipboard
+	getFilter()->setFilterClipboard();
+	mClipboardState = LLClipboard::getInstance()->getState();
+	
 	// Initialize base class params.
 	LLPanel::initFromParams(params);
 }
@@ -277,6 +282,14 @@ void LLInventoryPanel::draw()
 {
 	// Select the desired item (in case it wasn't loaded when the selection was requested)
 	mFolderRoot->updateSelection();
+	
+	// Nudge the filter if the clipboard state changed
+	if (mClipboardState != LLClipboard::getInstance()->getState())
+	{
+		mClipboardState = LLClipboard::getInstance()->getState();
+		getFilter()->setModified(LLInventoryFilter::FILTER_RESTART);
+	}
+	
 	LLPanel::draw();
 }
 
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 7d805f6862a..6db59afb9b9 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -222,6 +222,7 @@ class LLInventoryPanel : public LLPanel
 
 private:
 	std::string					mSortOrderSetting;
+	int							mClipboardState;
 
 	//--------------------------------------------------------------------
 	// Hidden folders
-- 
GitLab


From e482e677b2dece8cc46008f4fb05e4927ec70b4e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 8 Feb 2012 16:51:19 -0800
Subject: [PATCH 741/933] EXP-1767 WIP Received Items panel state does not
 persist between sessions fixed layout stack so programmatic size updates will
 work correctly

---
 indra/llui/lllayoutstack.cpp                  | 68 ++++++++++++-------
 indra/llui/lllayoutstack.h                    |  1 +
 .../default/xui/en/floater_test_toolbar.xml   |  8 +--
 3 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 31e04347534..ae262f794ea 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -252,7 +252,7 @@ void LLLayoutStack::removeChild(LLView* view)
 	{
 		mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
 		delete embedded_panelp;
-		normalizeFractionalSizes();
+		updateFractionalSizes();
 		mNeedsLayout = true;
 	}
 
@@ -277,7 +277,7 @@ bool LLLayoutStack::addChild(LLView* child, S32 tab_group)
 	}
 	BOOL result = LLView::addChild(child, tab_group);
 
-	normalizeFractionalSizes();
+	updateFractionalSizes();
 	return result;
 }
 
@@ -491,35 +491,48 @@ void LLLayoutStack::updateClass()
 	}
 }
 
-void LLLayoutStack::normalizeFractionalSizes()
+void LLLayoutStack::updateFractionalSizes()
 {
-	F32 total_resizable_dim = 0;
-	S32 num_auto_resize_panels = 0;
+	F32 total_resizable_dim = 0.f;
 
 	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
 			total_resizable_dim += llmax(0, panelp->getLayoutDim() - panelp->getRelevantMinDim());
-			num_auto_resize_panels++;
 		}
 	}
 
-	F32 total_fractional_size = 0.f;
-	
 	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
 			F32 panel_resizable_dim = llmax(MIN_FRACTIONAL_SIZE, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
 			panelp->mFractionalSize = panel_resizable_dim > 0.f 
-										? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE)
-										: MIN_FRACTIONAL_SIZE;
-			total_fractional_size += panelp->mFractionalSize;
+				? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE)
+				: MIN_FRACTIONAL_SIZE;
 			llassert(!llisnan(panelp->mFractionalSize));
 		}
 	}
 
+	normalizeFractionalSizes();
+}
+
+
+void LLLayoutStack::normalizeFractionalSizes()
+{
+	S32 num_auto_resize_panels = 0;
+	F32 total_fractional_size = 0.f;
+	
+	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	{
+		if (panelp->mAutoResize)
+		{
+			total_fractional_size += panelp->mFractionalSize;
+			num_auto_resize_panels++;
+		}
+	}
+
 	if (total_fractional_size == 0.f)
 	{ // equal distribution
 		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
@@ -631,7 +644,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 
 	F32 total_visible_fraction = 0.f;
 	F32 delta_auto_resize_headroom = 0.f;
-	F32 total_auto_resize_headroom = 0.f;
+	F32 original_auto_resize_headroom = 0.f;
 
 	LLLayoutPanel* other_resize_panel = NULL;
 	LLLayoutPanel* following_panel = NULL;
@@ -640,8 +653,11 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 	{
 		if (panelp->mAutoResize)
 		{
-			total_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
-			total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
+			original_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
+			if (panelp->getVisible() && !panelp->mCollapsed)
+			{
+				total_visible_fraction += panelp->mFractionalSize;
+			}
 		}
 
 		if (panelp == resized_panel)
@@ -655,18 +671,25 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		}
 	}
 
-	if (resized_panel->mAutoResize == FALSE)
+
+	if (resized_panel->mAutoResize)
 	{
-		delta_auto_resize_headroom += -delta_dim;
+		if (!other_resize_panel || !other_resize_panel->mAutoResize)
+		{
+			delta_auto_resize_headroom += delta_dim;	
+		}
 	}
-	if (other_resize_panel && other_resize_panel->mAutoResize == FALSE)
+	else 
 	{
-		delta_auto_resize_headroom += delta_dim;
+		if (!other_resize_panel || other_resize_panel->mAutoResize)
+		{
+			delta_auto_resize_headroom -= delta_dim;
+		}
 	}
 
 	F32 fraction_given_up = 0.f;
 	F32 fraction_remaining = 1.f;
-	F32 updated_auto_resize_headroom = total_auto_resize_headroom + delta_auto_resize_headroom;
+	F32 updated_auto_resize_headroom = original_auto_resize_headroom + delta_auto_resize_headroom;
 
 	enum
 	{
@@ -692,14 +715,13 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 			{	// freeze current size as fraction of overall auto_resize space
 				F32 fractional_adjustment_factor = updated_auto_resize_headroom == 0.f
 													? 1.f
-													: total_auto_resize_headroom / updated_auto_resize_headroom;
+													: original_auto_resize_headroom / updated_auto_resize_headroom;
 				F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
 													MIN_FRACTIONAL_SIZE,
 													MAX_FRACTIONAL_SIZE);
-				F32 fraction_delta = (new_fractional_size - panelp->mFractionalSize);
-				fraction_given_up -= fraction_delta;
+				fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
 				fraction_remaining -= panelp->mFractionalSize;
-				panelp->mFractionalSize += fraction_delta;
+				panelp->mFractionalSize = new_fractional_size;
 				llassert(!llisnan(panelp->mFractionalSize));
 			}
 			else
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 4a8702e318e..d32caec5f92 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -111,6 +111,7 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 
 	LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
 	LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
+	void updateFractionalSizes();
 	void normalizeFractionalSizes();
 	void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect );
 
diff --git a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml
index 0c41c3ba2fd..067c1fed824 100644
--- a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml
@@ -7,7 +7,7 @@
  name="floater_test_toolbar"
  translate="false"
  width="500">
-  <!--<toolbar name="test_toolbar_top"
+  <toolbar name="test_toolbar_top"
            button_display_mode="icons_with_text"
            follows="left|right|top"
            height="50"
@@ -20,7 +20,7 @@
     <command name="avatar"/>
     <command name="build"/>
     <command name="chat"/>
-  </toolbar>-->
+  </toolbar>
   <toolbar name="test_toolbar_left"
            button_display_mode="icons_with_text"
            follows="left|bottom|top"
@@ -46,7 +46,7 @@
     <command name="build"/>
     <command name="chat"/>
   </toolbar>
-  <!--<toolbar name="test_toolbar_bottom"
+  <toolbar name="test_toolbar_bottom"
            button_display_mode="icons_with_text"
            follows="left|right|bottom"
            height="50"
@@ -58,5 +58,5 @@
     <command name="avatar"/>
     <command name="build"/>
     <command name="chat"/>
-  </toolbar>-->
+  </toolbar>
 </floater>
-- 
GitLab


From e0582d4bc71e2f367b4cf4a6f0b808451620b52f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 8 Feb 2012 19:01:08 -0600
Subject: [PATCH 742/933] Fix for Debug GL generating errors when changing
 graphics preferences (reloading shaders).

---
 indra/llrender/llglslshader.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 3773568ad88..7eba62e59e7 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -109,7 +109,10 @@ void LLGLSLShader::unload()
 		glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
 		for (GLsizei i = 0; i < count; i++)
 		{
-			glDeleteObjectARB(obj[i]);
+			if (glIsProgramARB(obj[i]))
+			{
+				glDeleteObjectARB(obj[i]);
+			}
 		}
 
 		glDeleteObjectARB(mProgramObject);
-- 
GitLab


From 10dadc6b0dd646faa251c0935e75d07c97b3052d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 8 Feb 2012 17:22:04 -0800
Subject: [PATCH 743/933] EXP-1873 : Move cut items to trash in cut/copy over
 cut situations.

---
 indra/newview/llfolderview.cpp         | 25 ++++++++++++++++++++++++-
 indra/newview/llfolderview.h           |  1 +
 indra/newview/llinventoryfunctions.cpp | 25 +++++++++++++++++++++++++
 indra/newview/llinventoryfunctions.h   |  2 ++
 4 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 1d318ca2210..51a5839b75d 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1014,6 +1014,24 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector<LLFol
 	return false;
 }
 
+void LLFolderView::removeCutItems()
+{
+	// There's no item in "cut" mode on the clipboard -> exit
+	if (!LLClipboard::getInstance()->isCutMode())
+		return;
+
+	// Get the list of clipboard item uuids and iterate through them
+	LLDynamicArray<LLUUID> objects;
+	LLClipboard::getInstance()->pasteFromClipboard(objects);
+	for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
+		 iter != objects.end();
+		 ++iter)
+	{
+		const LLUUID& item_id = (*iter);
+		remove_item(&gInventory, item_id);
+	}
+}
+
 void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response)
 {
 	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -2109,7 +2127,12 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
 		return true;
 	}
 	if (("copy" == action) || ("cut" == action))
-	{	
+	{
+		// If there are things on the clipboard that have not been pasted but 
+		// already disappeared from view, we need to move them to the trash
+		removeCutItems();
+		
+		// Clear the clipboard before we start adding things on it
 		LLClipboard::getInstance()->reset();
 	}
 
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 1d018b5e6a7..2f148d4e257 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -159,6 +159,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 
 	// deletion functionality
  	void removeSelectedItems();
+ 	void removeCutItems();
 
 	// open the selected item.
 	void openSelectedItems( void );
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index ea00474b2a5..8313b23f444 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -160,6 +160,31 @@ void change_category_parent(LLInventoryModel* model,
 	model->notifyObservers();
 }
 
+// Move the item to the trash. Works for folders and objects.
+// Caution: This method assumes that the item is removable!
+void remove_item(LLInventoryModel* model, const LLUUID& id)
+{
+	LLViewerInventoryItem* item = model->getItem(id);
+	if (!item)
+		return;
+	
+	if (item->getType() == LLAssetType::AT_CATEGORY)
+	{
+		// Call the general helper function to delete a folder
+		remove_category(model, id);
+	}
+	else
+	{
+		// Get the trash UUID
+		LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false);
+		if (trash_id.notNull())
+		{
+			// Finally, move the item to the trash
+			change_item_parent(model, item, trash_id, true);
+		}
+	}
+}
+
 void remove_category(LLInventoryModel* model, const LLUUID& cat_id)
 {
 	if (!model || !get_is_category_removable(model, cat_id))
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index ce2b89b22e6..f8ecca22b6c 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -62,6 +62,8 @@ void change_item_parent(LLInventoryModel* model,
 									 const LLUUID& new_parent_id,
 									 BOOL restamp);
 
+void remove_item(LLInventoryModel* model, const LLUUID& id);
+
 void change_category_parent(LLInventoryModel* model,
 	LLViewerInventoryCategory* cat,
 	const LLUUID& new_parent_id,
-- 
GitLab


From 94b8cd3fa602025e59f4395dc971c8ffa1ac86c5 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Thu, 9 Feb 2012 09:27:18 -0800
Subject: [PATCH 744/933] Enabled the 'Merchant Outbox' menu item and context
 menu

---
 indra/newview/llinventorybridge.cpp                | 2 +-
 indra/newview/skins/default/xui/en/menu_viewer.xml | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index cebe93f0422..c0065a94e66 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -73,7 +73,7 @@
 #include "llwearablelist.h"
 
 // Marketplace outbox current disabled
-#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	0
+#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU	1
 #define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0
 #define BLOCK_WORN_ITEMS_IN_OUTBOX 1
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index cd8550b00db..1d11abcf73e 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -152,6 +152,13 @@
         <menu_item_call.on_click
          function="BuyCurrency" />
       </menu_item_call>
+      <menu_item_call
+         label="Merchant Outbox..."
+         name="MerchantOutbox">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="outbox" />
+      </menu_item_call>
       <menu_item_call
            label="Account dashboard..."
            name="Manage My Account">
-- 
GitLab


From 41bc3eded93b1af306d492d40646c5cff34afd1c Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 9 Feb 2012 11:32:40 -0800
Subject: [PATCH 745/933] EXP-1880 WIP Update Media affects framerate even when
 Media is disabled.

---
 indra/newview/llviewermedia.cpp | 43 +++++++++++----------------------
 indra/newview/llviewermedia.h   |  3 ---
 2 files changed, 14 insertions(+), 32 deletions(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index d7e79351c25..efc725896fe 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -387,7 +387,6 @@ class LLViewerMediaMuteListObserver : public LLMuteListObserver
 
 static LLViewerMediaMuteListObserver sViewerMediaMuteListObserver;
 static bool sViewerMediaMuteListObserverInitialized = false;
-static bool sInWorldMediaDisabled = false;
 
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -652,20 +651,6 @@ void LLViewerMedia::muteListChanged()
 	}
 }
 
-//////////////////////////////////////////////////////////////////////////////////////////
-// static
-void LLViewerMedia::setInWorldMediaDisabled(bool disabled)
-{
-	sInWorldMediaDisabled = disabled;
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// static
-bool LLViewerMedia::getInWorldMediaDisabled()
-{
-	return sInWorldMediaDisabled;
-}
-
 //////////////////////////////////////////////////////////////////////////////////////////
 // static
 bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &object_interest)
@@ -1568,7 +1553,6 @@ LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource()
 
 bool LLViewerMedia::hasInWorldMedia()
 {
-	if (sInWorldMediaDisabled) return false;
 	impl_list::iterator iter = sViewerMediaImplList.begin();
 	impl_list::iterator end = sViewerMediaImplList.end();
 	// This should be quick, because there should be very few non-in-world-media impls
@@ -3107,15 +3091,6 @@ bool LLViewerMediaImpl::isForcedUnloaded() const
 		return true;
 	}
 	
-	if(sInWorldMediaDisabled)
-	{
-		// When inworld media is disabled, all instances that aren't marked as "used in UI" will not be loaded.
-		if(!mUsedInUI)
-		{
-			return true;
-		}
-	}
-	
 	// If this media's class is not supposed to be shown, unload
 	if (!shouldShowBasedOnClass())
 	{
@@ -3783,12 +3758,22 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
 	
 	// If it is attached to an avatar and the pref is off, we shouldn't show it
 	if (attached_to_another_avatar)
-		return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING);
-	
+	{
+		static LLCachedControl<BOOL> show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING);
+		return show_media_on_others;
+	}
 	if (inside_parcel)
-		return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING);
+	{
+		static LLCachedControl<BOOL> show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING);
+
+		return show_media_within_parcel;
+	}
 	else 
-		return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING);
+	{
+		static LLCachedControl<BOOL> show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING);
+
+		return show_media_outside_parcel;
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 15dcda59cfb..fff5b3fc089 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -112,9 +112,6 @@ class LLViewerMedia
 	
 	static F32 getVolume();	
 	static void muteListChanged();
-	static void setInWorldMediaDisabled(bool disabled);
-	static bool getInWorldMediaDisabled();
-	
 	static bool isInterestingEnough(const LLVOVolume* object, const F64 &object_interest);
 	
 	// Returns the priority-sorted list of all media impls.
-- 
GitLab


From ed137f40d137dd78d0ec916ca91814cf5534a9f6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 9 Feb 2012 11:40:55 -0800
Subject: [PATCH 746/933] fix for cached controls in media sorting

---
 indra/newview/llviewermedia.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index efc725896fe..1eb4bedfaf9 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3759,18 +3759,18 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
 	// If it is attached to an avatar and the pref is off, we shouldn't show it
 	if (attached_to_another_avatar)
 	{
-		static LLCachedControl<BOOL> show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING);
+		static LLCachedControl<bool> show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING);
 		return show_media_on_others;
 	}
 	if (inside_parcel)
 	{
-		static LLCachedControl<BOOL> show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING);
+		static LLCachedControl<bool> show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING);
 
 		return show_media_within_parcel;
 	}
 	else 
 	{
-		static LLCachedControl<BOOL> show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING);
+		static LLCachedControl<bool> show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING);
 
 		return show_media_outside_parcel;
 	}
-- 
GitLab


From e5f81fdcc98ded831c48c4e31a4a215877e0a1e4 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Thu, 9 Feb 2012 15:17:34 -0500
Subject: [PATCH 747/933] Added tag DRTVWR-117_3.2.9-beta1, 3.2.9-beta1 for
 changeset e9c82fca5ae6

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 57b89e78b3c..d4bf3a81f80 100644
--- a/.hgtags
+++ b/.hgtags
@@ -264,3 +264,5 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 987425b1acf4752379b2e1eb20944b4b35d67a85 DRTVWR-115_3.2.8-beta2
 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
 37dd400ad721e2a89ee820ffc1e7e433c68f3ca2 3.2.9-start
+e9c82fca5ae6fb8a8af29012d78fb194a29323f3 DRTVWR-117_3.2.9-beta1
+e9c82fca5ae6fb8a8af29012d78fb194a29323f3 3.2.9-beta1
-- 
GitLab


From 4523b3137850df8922b12cc966633a3d5bb84374 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 9 Feb 2012 12:58:43 -0800
Subject: [PATCH 748/933] EXP-1844 FIX Selecting a large number of inventory
 items can block the viewer for a long time. only show hourglass and fetching
 text when downloading folders, not item metadata

---
 indra/newview/llfolderview.cpp                |   4 +-
 indra/newview/llfolderviewitem.cpp            |   2 +-
 indra/newview/llinventorybridge.cpp           |   1 +
 indra/newview/llinventoryfilter.cpp           |   2 +-
 .../llinventorymodelbackgroundfetch.cpp       | 170 ++++++++++--------
 .../newview/llinventorymodelbackgroundfetch.h |   4 +-
 indra/newview/llinventorypanel.cpp            |   2 +-
 indra/newview/llpanelmaininventory.cpp        |   2 +-
 indra/newview/llviewerinventory.cpp           |   5 -
 9 files changed, 108 insertions(+), 84 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 2249f61435e..86001e41461 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -912,7 +912,7 @@ void LLFolderView::draw()
 	}
 	else if (mShowEmptyMessage)
 	{
-		if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration())
+		if (LLInventoryModelBackgroundFetch::instance().folderFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration())
 		{
 			mStatusText = LLTrans::getString("Searching");
 		}
@@ -1966,7 +1966,7 @@ void LLFolderView::scrollToShowSelection()
 	// However we allow scrolling for folder views with mAutoSelectOverride
 	// (used in Places SP) as an exception because the selection in them
 	// is not reset during items filtering. See STORM-133.
-	if ( (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mAutoSelectOverride)
+	if ( (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() || mAutoSelectOverride)
 			&& mSelectedItems.size() )
 	{
 		mNeedsScroll = TRUE;
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 734adbc6486..afad27b4e0e 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -1045,7 +1045,7 @@ void LLFolderViewItem::draw()
 	}
 	if ((mIsLoading
 		&&	mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime"))
-			||	(LLInventoryModelBackgroundFetch::instance().backgroundFetchActive()
+			||	(LLInventoryModelBackgroundFetch::instance().folderFetchActive()
 				&&	root_is_loading
 				&&	mShowLoadStatus))
 	{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 257ceed9127..daebfb5c86c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1324,6 +1324,7 @@ void LLItemBridge::selectItem()
 	LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
 	if(item && !item->isFinished())
 	{
+		//item->fetchFromServer();
 		LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
 	}
 }
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 796251cae5f..f818e337265 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -888,7 +888,7 @@ const std::string& LLInventoryFilter::getFilterText()
 		filtered_by_all_types = FALSE;
 	}
 
-	if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive()
+	if (!LLInventoryModelBackgroundFetch::instance().folderFetchActive()
 		&& filtered_by_type
 		&& !filtered_by_all_types)
 	{
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index cb140cf15c1..f4d0110b0f4 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -43,6 +43,7 @@ const S32 MAX_FETCH_RETRIES = 10;
 
 LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch() :
 	mBackgroundFetchActive(FALSE),
+	mFolderFetchActive(false),
 	mAllFoldersFetched(FALSE),
 	mRecursiveInventoryFetchStarted(FALSE),
 	mRecursiveLibraryFetchStarted(FALSE),
@@ -98,19 +99,20 @@ bool LLInventoryModelBackgroundFetch::isEverythingFetched() const
 	return mAllFoldersFetched;
 }
 
-BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const
+BOOL LLInventoryModelBackgroundFetch::folderFetchActive() const
 {
-	return mBackgroundFetchActive;
+	return mFolderFetchActive;
 }
 
 void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive)
 {
 	LLViewerInventoryCategory* cat = gInventory.getCategory(id);
-	if (cat || (id.isNull() && !mAllFoldersFetched))
+	if (cat || (id.isNull() && !isEverythingFetched()))
 	{	// it's a folder, do a bulk fetch
 		LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL;
 
 		mBackgroundFetchActive = TRUE;
+		mFolderFetchActive = true;
 		if (id.isNull())
 		{
 			if (!mRecursiveInventoryFetchStarted)
@@ -159,21 +161,11 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive)
 void LLInventoryModelBackgroundFetch::findLostItems()
 {
 	mBackgroundFetchActive = TRUE;
+	mFolderFetchActive = true;
     mFetchQueue.push_back(FetchQueueInfo(LLUUID::null, TRUE));
     gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
 }
 
-void LLInventoryModelBackgroundFetch::stopBackgroundFetch()
-{
-	if (mBackgroundFetchActive)
-	{
-		mBackgroundFetchActive = FALSE;
-		gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
-		mFetchCount=0;
-		mMinTimeBetweenFetches=0.0f;
-	}
-}
-
 void LLInventoryModelBackgroundFetch::setAllFoldersFetched()
 {
 	if (mRecursiveInventoryFetchStarted &&
@@ -181,7 +173,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched()
 	{
 		mAllFoldersFetched = TRUE;
 	}
-	stopBackgroundFetch();
+	mFolderFetchActive = false;
 }
 
 void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *)
@@ -211,6 +203,9 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 			llinfos << "Inventory fetch completed" << llendl;
 
 			setAllFoldersFetched();
+			mBackgroundFetchActive = false;
+			mFolderFetchActive = false;
+
 			return;
 		}
 
@@ -240,80 +235,114 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
 			}
 
 			const FetchQueueInfo info = mFetchQueue.front();
-			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID);
 
-			// Category has been deleted, remove from queue.
-			if (!cat)
+			if (info.mIsCategory)
 			{
-				mFetchQueue.pop_front();
-				continue;
-			}
+
+				LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID);
+
+				// Category has been deleted, remove from queue.
+				if (!cat)
+				{
+					mFetchQueue.pop_front();
+					continue;
+				}
 			
-			if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches && 
-				LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
-			{
-				// Category exists but has no children yet, fetch the descendants
-				// for now, just request every time and rely on retry timer to throttle.
-				if (cat->fetch())
+				if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches && 
+					LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
 				{
-					mFetchTimer.reset();
-					mTimelyFetchPending = TRUE;
+					// Category exists but has no children yet, fetch the descendants
+					// for now, just request every time and rely on retry timer to throttle.
+					if (cat->fetch())
+					{
+						mFetchTimer.reset();
+						mTimelyFetchPending = TRUE;
+					}
+					else
+					{
+						//  The catagory also tracks if it has expired and here it says it hasn't
+						//  yet.  Get out of here because nothing is going to happen until we
+						//  update the timers.
+						break;
+					}
 				}
-				else
+				// Do I have all my children?
+				else if (gInventory.isCategoryComplete(info.mUUID))
 				{
-					//  The catagory also tracks if it has expired and here it says it hasn't
-					//  yet.  Get out of here because nothing is going to happen until we
-					//  update the timers.
+					// Finished with this category, remove from queue.
+					mFetchQueue.pop_front();
+
+					// Add all children to queue.
+					LLInventoryModel::cat_array_t* categories;
+					LLInventoryModel::item_array_t* items;
+					gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
+					for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
+						 it != categories->end();
+						 ++it)
+					{
+						mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(),info.mRecursive));
+					}
+
+					// We received a response in less than the fast time.
+					if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() < fast_fetch_time)
+					{
+						// Shrink timeouts based on success.
+						mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f);
+						mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f);
+						lldebugs << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl;
+					}
+
+					mTimelyFetchPending = FALSE;
+					continue;
+				}
+				else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches)
+				{
+					// Received first packet, but our num descendants does not match db's num descendants
+					// so try again later.
+					mFetchQueue.pop_front();
+
+					if (mNumFetchRetries++ < MAX_FETCH_RETRIES)
+					{
+						// push on back of queue
+						mFetchQueue.push_back(info);
+					}
+					mTimelyFetchPending = FALSE;
+					mFetchTimer.reset();
 					break;
 				}
+
+				// Not enough time has elapsed to do a new fetch
+				break;
 			}
-			// Do I have all my children?
-			else if (gInventory.isCategoryComplete(info.mUUID))
+			else
 			{
-				// Finished with this category, remove from queue.
-				mFetchQueue.pop_front();
+				LLViewerInventoryItem* itemp = gInventory.getItem(info.mUUID);
 
-				// Add all children to queue.
-				LLInventoryModel::cat_array_t* categories;
-				LLInventoryModel::item_array_t* items;
-				gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items);
-				for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
-					 it != categories->end();
-					 ++it)
+				mFetchQueue.pop_front();
+				if (!itemp) 
 				{
-					mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(),info.mRecursive));
+					continue;
 				}
 
-				// We received a response in less than the fast time.
-				if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() < fast_fetch_time)
+				if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches)
 				{
-					// Shrink timeouts based on success.
-					mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f);
-					mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f);
-					lldebugs << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl;
+					itemp->fetchFromServer();
+					mFetchTimer.reset();
+					mTimelyFetchPending = TRUE;
 				}
-
-				mTimelyFetchPending = FALSE;
-				continue;
-			}
-			else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches)
-			{
-				// Received first packet, but our num descendants does not match db's num descendants
-				// so try again later.
-				mFetchQueue.pop_front();
-
-				if (mNumFetchRetries++ < MAX_FETCH_RETRIES)
+				else if (itemp->mIsComplete)
+				{
+					mTimelyFetchPending = FALSE;
+				}
+				else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches)
 				{
-					// push on back of queue
 					mFetchQueue.push_back(info);
+					mFetchTimer.reset();
+					mTimelyFetchPending = FALSE;
 				}
-				mTimelyFetchPending = FALSE;
-				mFetchTimer.reset();
+				// Not enough time has elapsed to do a new fetch
 				break;
 			}
-
-			// Not enough time has elapsed to do a new fetch
-			break;
 		}
 
 		//
@@ -543,7 +572,6 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
 	//Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped.
 	//If there are items in mFetchQueue, we want to check the time since the last bulkFetch was 
 	//sent.  If it exceeds our retry time, go ahead and fire off another batch.  
-	//Stopbackgroundfetch will be run from the Responder instead of here.  
 	LLViewerRegion* region = gAgent.getRegion();
 	if (!region) return;
 
@@ -574,12 +602,12 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
 	LLSD item_request_body;
 	LLSD item_request_body_lib;
 
-	while (!(mFetchQueue.empty()) && ((item_count + folder_count) < max_batch_size))
+	while (!mFetchQueue.empty() 
+			&& (item_count + folder_count) < max_batch_size)
 	{
 		const FetchQueueInfo& fetch_info = mFetchQueue.front();
 		if (fetch_info.mIsCategory)
 		{
-
 			const LLUUID &cat_id = fetch_info.mUUID;
 			if (cat_id.isNull()) //DEV-17797
 			{
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index 0745407a8c8..9dfedddd6d2 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -48,7 +48,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	// This gets triggered when performing a filter-search.
 	void start(const LLUUID& cat_id = LLUUID::null, BOOL recursive = TRUE);
 
-	BOOL backgroundFetchActive() const;
+	BOOL folderFetchActive() const;
 	bool isEverythingFetched() const; // completing the fetch once per session should be sufficient
 
 	bool libraryFetchStarted() const;
@@ -67,7 +67,6 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 
 	void backgroundFetch();
 	static void backgroundFetchCB(void*); // background fetch idle function
-	void stopBackgroundFetch(); // stop fetch process
 
 	void setAllFoldersFetched();
 	bool fetchQueueContainsNoDescendentsOf(const LLUUID& cat_id) const;
@@ -77,6 +76,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	BOOL mAllFoldersFetched;
 
 	BOOL mBackgroundFetchActive;
+	bool mFolderFetchActive;
 	S16 mFetchCount;
 	BOOL mTimelyFetchPending;
 	S32 mNumFetchRetries;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 382569fa3a3..01a8ecfb5d8 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -817,7 +817,7 @@ BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask)
 	if(handled)
 	{
 		ECursorType cursor = getWindow()->getCursor();
-		if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && cursor == UI_CURSOR_ARROW)
+		if (LLInventoryModelBackgroundFetch::instance().folderFetchActive() && cursor == UI_CURSOR_ARROW)
 		{
 			// replace arrow cursor with arrow and hourglass cursor
 			getWindow()->setCursor(UI_CURSOR_WORKING);
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 374afb90be4..c3c62920d33 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -567,7 +567,7 @@ void LLPanelMainInventory::updateItemcountText()
 
 	std::string text = "";
 
-	if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive())
+	if (LLInventoryModelBackgroundFetch::instance().folderFetchActive())
 	{
 		text = getString("ItemcountFetching", string_args);
 	}
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index cf52b5165b2..45ca23cdfe2 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -436,11 +436,6 @@ void LLViewerInventoryItem::fetchFromServer(void) const
 			gAgent.sendReliableMessage();
 		}
 	}
-	else
-	{
-		// *FIX: this can be removed after a bit.
-		llwarns << "request to fetch complete item" << llendl;
-	}
 }
 
 // virtual
-- 
GitLab


From ca80e17e90ce5b70feca76ddf41d3c25d01ac830 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Thu, 9 Feb 2012 23:34:12 +0200
Subject: [PATCH 749/933] EXP-1822 FIXED (After deleting an item from inventory
 and confirming "ok" to delete, focus leaves inventory)

- Return focus to the previously focused root view
---
 indra/newview/lltoastalertpanel.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index ada7570776d..9ba8431fdea 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -73,9 +73,14 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
 	// save currently focused view, so that return focus to it
 	// on destroying this toast.
 	LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus());
-	if (current_selection)
+	while(current_selection)
 	{
-		mPreviouslyFocusedView = current_selection->getHandle();
+		if (current_selection->isFocusRoot())
+		{
+			mPreviouslyFocusedView = current_selection->getHandle();
+			break;
+		}
+		current_selection = current_selection->getParent();
 	}
 
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
@@ -422,7 +427,7 @@ LLToastAlertPanel::~LLToastAlertPanel()
 	// return focus to the previously focused view
 	if (mPreviouslyFocusedView.get())
 	{
-		gFocusMgr.setKeyboardFocus(mPreviouslyFocusedView.get());
+		mPreviouslyFocusedView.get()->setFocus(TRUE);
 	}
 }
 
-- 
GitLab


From b3e56527a751aa2b87f50b33cf3439c07704c1d5 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Thu, 9 Feb 2012 23:42:07 +0200
Subject: [PATCH 750/933] EXP-1546 FIXED (received items - purchasing some
 bodyparts and clothing from a prim marked for sale show wrong inventory
 icons)

- In buy floater, for multiple WEARABLES inventory items show corresponding wearable icon
---
 indra/newview/llfloaterbuy.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp
index ee8487b1605..087b0007e19 100644
--- a/indra/newview/llfloaterbuy.cpp
+++ b/indra/newview/llfloaterbuy.cpp
@@ -239,8 +239,9 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
 
 		// Compute icon for this item
 		BOOL item_is_multi = FALSE;
-		if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED 
+		if (( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED
 			|| inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
+			&& !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK))
 		{
 			item_is_multi = TRUE;
 		}
-- 
GitLab


From 21efa498a140bdc05c858cfa1be7e247d2b89278 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Thu, 9 Feb 2012 23:47:00 +0200
Subject: [PATCH 751/933] EXP-1819 FIXED (Location & Favorites bar splitter
 should be draggable to 200 px on left and 150 px on right. )

- Allowed dragging to the left to shrink location to no less than 410 pixels, and to the right to shrink favorites to 185 pixels
---
 indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 53a09ce0410..3edeb9aa367 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -70,7 +70,7 @@
            layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="310"
+           min_width="410"
            name="navigation_layout_panel"
            width="480">
 	        <panel
-- 
GitLab


From be2e3b846ed6480f300eea240bc4f45b837a7712 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 9 Feb 2012 23:54:22 +0200
Subject: [PATCH 752/933] EXP-1335 FIXED Disabled dragging the items from
 notecards and objects into Recent tab. Disabled DnD from Recent to Received
 Items. Fixed updating FILTERTYPE_DATE flag of LLInventoryFilter when time
 limits are applied.

---
 indra/newview/llinventoryfilter.cpp           | 37 ++++++++++---------
 indra/newview/llinventoryfilter.h             |  2 +
 .../default/xui/en/panel_inbox_inventory.xml  |  1 +
 3 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 796251cae5f..177ab28b369 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -282,19 +282,9 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
 	// Pass if this item is within the date range.
 	if (filterTypes & FILTERTYPE_DATE)
 	{
-		const U16 HOURS_TO_SECONDS = 3600;
-		time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS;
-		if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest)
-		{
-			earliest = mFilterOps.mMinDate;
-		}
-		else if (!mFilterOps.mHoursAgo)
-		{
-			earliest = 0;
-		}
-		if (item->getCreationDate() < earliest ||
-			item->getCreationDate() > mFilterOps.mMaxDate)
-			return false;
+		// We don't get the updated item creation date for the task inventory or
+		// a notecard embedded item. See LLTaskInvFVBridge::getCreationDate().
+		return false;
 	}
 
 	return true;
@@ -548,7 +538,9 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date)
 		mFilterOps.mMaxDate = llmax(mFilterOps.mMinDate, max_date);
 		setModified();
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+
+	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
+			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
 }
 
 void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
@@ -560,10 +552,12 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
 	}
 	if (!sl && isSinceLogoff())
 	{
-		setDateRange(0, time_max());
+		setDateRange(time_min(), time_max());
 		setModified();
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+
+	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
+			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
 }
 
 BOOL LLInventoryFilter::isSinceLogoff() const
@@ -608,7 +602,9 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
 			setModified(FILTER_RESTART);
 		}
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+
+	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
+			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
 }
 
 void LLInventoryFilter::setFilterLinks(U64 filter_links)
@@ -1058,3 +1054,10 @@ const std::string& LLInventoryFilter::getEmptyLookupMessage() const
 	return mEmptyLookupMessage;
 
 }
+
+bool LLInventoryFilter::areDateLimitsSet()
+{
+	return     mFilterOps.mMinDate != time_min()
+			|| mFilterOps.mMaxDate != time_max()
+			|| mFilterOps.mHoursAgo != 0;
+}
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 343306ae8ed..8635d5d5b38 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -179,6 +179,8 @@ class LLInventoryFilter
 	void 				fromLLSD(LLSD& data);
 
 private:
+	bool				areDateLimitsSet();
+
 	struct FilterOps
 	{
 		FilterOps();
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index 383e637ace1..413e22e4449 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <inbox_inventory_panel
+    accepts_drag_and_drop="false"
     name="inventory_inbox"
     start_folder="Received Items"
     follows="all" layout="topleft"
-- 
GitLab


From b72f1b59e8b673d9834bf18a466ec38e40650511 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 10 Feb 2012 02:33:22 +0200
Subject: [PATCH 753/933] EXP-1876 FIXED Landmark notes editor height increased
 to accommodate 5 lines of new font height.

---
 indra/newview/skins/default/xui/en/panel_landmark_info.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
index d2088594dd9..fd6e96b9a7e 100644
--- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
@@ -271,7 +271,7 @@
                 <text_editor
                  bg_readonly_color="DkGray2"
                  follows="all"
-                 height="70"
+                 height="75"
                  layout="topleft"
                  left="0"
                  max_length="127"
@@ -288,7 +288,7 @@
                  layout="topleft"
                  left="0"
                  name="folder_label"
-                 top_pad="15"
+                 top_pad="10"
                  value="Landmark location:"
                  width="290" />
                 <combo_box
-- 
GitLab


From aa345bd8f3844bdc2c5318d14b26343b91e6e573 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 9 Feb 2012 17:14:37 -0800
Subject: [PATCH 754/933] EXP-1874 FIX Unexpected scrollbar in text
 notification

---
 indra/llui/lltextbase.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index e2d9a6cb814..35abe48510d 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2380,6 +2380,8 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction)
 
 void LLTextBase::updateRects()
 {
+	mVisibleTextRect = getLocalRect();
+
 	if (mLineInfoList.empty()) 
 	{
 		mTextBoundingRect = LLRect(0, mVPad, mHPad, 0);
@@ -2604,8 +2606,7 @@ BOOL LLTextSegment::handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE;
 BOOL LLTextSegment::handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; }
 const std::string&	LLTextSegment::getName() const 
 {
-	static std::string empty_string("");
-	return empty_string; 
+	return LLStringUtil::null;
 }
 void LLTextSegment::onMouseCaptureLost() {}
 void LLTextSegment::screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}
-- 
GitLab


From e9ee15d9420d8987028ec0267ac5d1f46a918b6f Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 9 Feb 2012 17:45:30 -0800
Subject: [PATCH 755/933] EXP-1877 FIX Scroll list listings in group roles tab
 and other areas shows vertical scroll bar before needed

---
 indra/newview/skins/default/xui/en/floater_about_land.xml   | 4 ++--
 indra/newview/skins/default/xui/en/floater_choose_group.xml | 2 +-
 indra/newview/skins/default/xui/en/panel_group_roles.xml    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 2781717f0b5..a737c123c66 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -2085,7 +2085,7 @@ Only large parcels can be listed in search.
              column_padding="0"
              follows="top|bottom"
              heading_height="14"
-             height="120"
+             height="125"
              layout="topleft"
              left="0"
              multi_select="true"
@@ -2134,7 +2134,7 @@ Only large parcels can be listed in search.
              column_padding="0"
              follows="top|bottom"
              heading_height="14"
-             height="120"
+             height="125"
              layout="topleft"
              left="0"
              multi_select="true"
diff --git a/indra/newview/skins/default/xui/en/floater_choose_group.xml b/indra/newview/skins/default/xui/en/floater_choose_group.xml
index dc1ee5f24e2..2cf6e682fde 100644
--- a/indra/newview/skins/default/xui/en/floater_choose_group.xml
+++ b/indra/newview/skins/default/xui/en/floater_choose_group.xml
@@ -20,7 +20,7 @@
         Choose a group:
     </text>
     <scroll_list
-     height="160"
+     height="165"
      layout="topleft"
      left_delta="0"
      name="group list"
diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml
index a7178dc2886..eea26061256 100644
--- a/indra/newview/skins/default/xui/en/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml
@@ -172,7 +172,7 @@ including the Everyone and Owner Roles.
              draw_heading="true"
              draw_stripes="false"
              heading_height="23"
-             height="130"
+             height="132"
              layout="topleft"
              search_column="1"
              left="0"
-- 
GitLab


From 45e30f35dc1a3dc07862ca9f67bbbdb238d364fe Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 9 Feb 2012 17:50:09 -0800
Subject: [PATCH 756/933] EXP-1883 FIX Toolbar button tooltips display off
 screen for right hand tool bar, bottom tool bar, and tooltips on top bar
 items show off screen

---
 indra/llui/llmenugl.cpp | 2 +-
 indra/llui/llui.cpp     | 2 +-
 indra/llui/llview.h     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 1284231e523..ff6928ffda1 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3082,7 +3082,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
 		mouse_y + MOUSE_CURSOR_PADDING, 
 		CURSOR_WIDTH + MOUSE_CURSOR_PADDING * 2, 
 		CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2);
-	menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect, FALSE );
+	menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect );
 	menu->getParent()->sendChildToFront(menu);
 }
 
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 137716743fb..31ccec0d2af 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -2049,7 +2049,7 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y)
 	// Start at spawn position (using left/top)
 	view->setOrigin( local_x, local_y - view->getRect().getHeight());
 	// Make sure we're on-screen and not overlapping the mouse
-	view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect, FALSE );
+	view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect );
 }
 
 LLView* LLUI::resolvePath(LLView* context, const std::string& path)
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index de2fab963bf..fd19309a56e 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -371,7 +371,7 @@ class LLView
 	virtual void	translate( S32 x, S32 y );
 	void			setOrigin( S32 x, S32 y )	{ mRect.translate( x - mRect.mLeft, y - mRect.mBottom ); }
 	BOOL			translateIntoRect( const LLRect& constraint, S32 min_overlap_pixels = S32_MAX);
-	BOOL			translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, BOOL allow_partial_outside );
+	BOOL			translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, S32 min_overlap_pixels = S32_MAX);
 	void			centerWithin(const LLRect& bounds);
 
 	void	setShape(const LLRect& new_rect, bool by_user = false);
-- 
GitLab


From 2a4aa438f5798c34f1eef3ef75dc3289492138e1 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 9 Feb 2012 23:37:24 -0800
Subject: [PATCH 757/933] EXP-1863 : Implemented cut, copy, paste for folders.
 Issues with folder filtering though.

---
 indra/newview/llinventorybridge.cpp    | 82 ++++++++++++++++----------
 indra/newview/llinventoryfilter.cpp    | 45 +++++++++++++-
 indra/newview/llinventoryfunctions.cpp | 36 +++++++++++
 indra/newview/llinventoryfunctions.h   |  2 +
 4 files changed, 131 insertions(+), 34 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9775e54d6ab..1fa6820d2de 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -210,21 +210,21 @@ BOOL LLInvFVBridge::isLink() const
  */
 BOOL LLInvFVBridge::cutToClipboard() const
 {
-	LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
-	if (inv_item && isItemMovable() && isItemRemovable())
+	const LLInventoryObject* obj = gInventory.getObject(mUUID);
+	if (obj && isItemMovable() && isItemRemovable())
 	{
 		LLClipboard::getInstance()->setCutMode(true);
-		return LLClipboard::getInstance()->addToClipboard(mUUID,inv_item->getType());
+		return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType());
 	}
 	return FALSE;
 }
 
 BOOL LLInvFVBridge::copyToClipboard() const
 {
-	LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
-	if (inv_item && isItemCopyable())
+	const LLInventoryObject* obj = gInventory.getObject(mUUID);
+	if (obj && isItemCopyable())
 	{
-		return LLClipboard::getInstance()->addToClipboard(mUUID,inv_item->getType());
+		return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType());
 	}
 	return FALSE;
 }
@@ -423,9 +423,6 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 
 	const LLUUID &agent_id = gAgent.getID();
 
-	// Merov : This should be suppressed for 2 reasons:
-	// 1. folders should be pastable
-	// 2. when pasting, we should paste what is authorized and let the rest not pasted
 	LLDynamicArray<LLUUID> objects;
 	LLClipboard::getInstance()->pasteFromClipboard(objects);
 	S32 count = objects.count();
@@ -433,12 +430,9 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 	{
 		const LLUUID &item_id = objects.get(i);
 
-		// Can't paste folders
+		// Always paste folders
 		const LLInventoryCategory *cat = model->getCategory(item_id);
-		if (cat)
-		{
-			return FALSE;
-		}
+		if (cat) continue;
 
 		const LLInventoryItem *item = model->getItem(item_id);
 		if (item)
@@ -1313,7 +1307,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
 	}
 	else if ("paste" == action)
 	{
-		// Single item only
 		LLInventoryItem* itemp = model->getItem(mUUID);
 		if (!itemp) return;
 
@@ -1785,8 +1778,9 @@ BOOL LLFolderBridge::isUpToDate() const
 
 BOOL LLFolderBridge::isItemCopyable() const
 {
+	return TRUE;
 	// Can copy folders to paste-as-link, but not for straight paste.
-	return gSavedSettings.getBOOL("InventoryLinking");
+	//return gSavedSettings.getBOOL("InventoryLinking");
 }
 
 BOOL LLFolderBridge::isClipboardPasteable() const
@@ -2829,7 +2823,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
 void LLFolderBridge::pasteFromClipboard()
 {
 	LLInventoryModel* model = getInventoryModel();
-	if(model && isClipboardPasteable())
+	if (model && isClipboardPasteable())
 	{
 		const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
 		const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
@@ -2845,7 +2839,8 @@ void LLFolderBridge::pasteFromClipboard()
 		{
 			const LLUUID& item_id = (*iter);
 			LLInventoryItem *item = model->getItem(item_id);
-			if (item)
+			LLInventoryObject *obj = model->getObject(item_id);
+			if (obj)
 			{
 				if (move_is_into_current_outfit || move_is_into_outfit)
 				{
@@ -2856,24 +2851,49 @@ void LLFolderBridge::pasteFromClipboard()
 				}
 				else if (LLClipboard::getInstance()->isCutMode())
 				{
-					// move_inventory_item() is not enough,
-					//we have to update inventory locally too
-					LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item);
-					llassert(viitem);
-					if (viitem)
+					// Do a move to "paste" a "cut"
+					// move_inventory_item() is not enough, as we have to update inventory locally too
+					if (LLAssetType::AT_CATEGORY == obj->getType())
 					{
-						changeItemParent(model, viitem, parent_id, FALSE);
+						LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id);
+						llassert(vicat);
+						if (vicat)
+						{
+							changeCategoryParent(model, vicat, parent_id, FALSE);
+						}
+					}
+					else
+					{
+						LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item);
+						llassert(viitem);
+						if (viitem)
+						{
+							changeItemParent(model, viitem, parent_id, FALSE);
+						}
 					}
 				}
 				else
 				{
-					copy_inventory_item(
-						gAgent.getID(),
-						item->getPermissions().getOwner(),
-						item->getUUID(),
-						parent_id,
-						std::string(),
-						LLPointer<LLInventoryCallback>(NULL));
+					// Do a "copy" to "paste" a regular copy clipboard
+					if (LLAssetType::AT_CATEGORY == obj->getType())
+					{
+						LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id);
+						llassert(vicat);
+						if (vicat)
+						{
+							copy_inventory_category(model, vicat, parent_id);
+						}
+					}
+					else
+					{
+						copy_inventory_item(
+											gAgent.getID(),
+											item->getPermissions().getOwner(),
+											item->getUUID(),
+											parent_id,
+											std::string(),
+											LLPointer<LLInventoryCallback>(NULL));
+					}
 				}
 			}
 		}
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 9d124780195..808b7619eb5 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -240,12 +240,26 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 
 	////////////////////////////////////////////////////////////////////////////////
 	// FILTERTYPE_CLIPBOARD
-	// Pass if this item is not on the clipboard
+	// Pass if this item is not on the clipboard or is not a descendant of a folder 
+	// which is on the clipboard
 	if (filterTypes & FILTERTYPE_CLIPBOARD)
 	{
-		if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(object_id))
+		if (LLClipboard::getInstance()->isCutMode())
 		{
-			return FALSE;
+			LLUUID current_id = object_id;
+			LLInventoryObject *current_object = gInventory.getObject(object_id);
+			while (current_id.notNull())
+			{
+				if (LLClipboard::getInstance()->isOnClipboard(current_id))
+				{
+					return FALSE;
+				}
+				current_id = current_object->getParentUUID();
+				if (current_id.notNull())
+				{
+					current_object = gInventory.getObject(current_id);
+				}
+			}
 		}
 	}
 		
@@ -309,6 +323,31 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
 			return false;
 	}
 
+	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_CLIPBOARD
+	// Pass if this item is not on the clipboard or is not a descendant of a folder 
+	// which is on the clipboard
+	if (filterTypes & FILTERTYPE_CLIPBOARD)
+	{
+		if (LLClipboard::getInstance()->isCutMode())
+		{
+			LLUUID current_id = object_id;
+			LLInventoryObject *current_object = gInventory.getObject(object_id);
+			while (current_id.notNull())
+			{
+				if (LLClipboard::getInstance()->isOnClipboard(current_id))
+				{
+					return false;
+				}
+				current_id = current_object->getParentUUID();
+				if (current_id.notNull())
+				{
+					current_object = gInventory.getObject(current_id);
+				}
+			}
+		}
+	}
+
 	return true;
 }
 
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 8313b23f444..4fb06f82c1e 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -238,6 +238,42 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
 	model->notifyObservers();
 }
 
+void copy_inventory_category(LLInventoryModel* model,
+							 LLViewerInventoryCategory* cat,
+							 const LLUUID& parent_id)
+{
+	// Create the initial folder
+	LLUUID new_cat_uuid = gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName());
+	model->notifyObservers();
+
+	// Get the content of the folder
+	LLInventoryModel::cat_array_t* cat_array;
+	LLInventoryModel::item_array_t* item_array;
+	gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array);
+
+	// Copy all the items
+	LLInventoryModel::item_array_t item_array_copy = *item_array;
+	for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
+	{
+		LLInventoryItem* item = *iter;
+		copy_inventory_item(
+							gAgent.getID(),
+							item->getPermissions().getOwner(),
+							item->getUUID(),
+							new_cat_uuid,
+							std::string(),
+							LLPointer<LLInventoryCallback>(NULL));
+	}
+	
+	// Copy all the folders
+	LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
+	for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
+	{
+		LLViewerInventoryCategory* category = *iter;
+		copy_inventory_category(model, category, new_cat_uuid);
+	}
+}
+
 class LLInventoryCollectAllItems : public LLInventoryCollectFunctor
 {
 public:
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index f8ecca22b6c..72c48c64f2e 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -73,6 +73,8 @@ void remove_category(LLInventoryModel* model, const LLUUID& cat_id);
 
 void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
 
+void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id);
+
 // Generates a string containing the path to the item specified by item_id.
 void append_path(const LLUUID& id, std::string& path);
 
-- 
GitLab


From 5d276be881593b9e2c247edf8e6361447e964d52 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 10 Feb 2012 20:36:53 +0200
Subject: [PATCH 758/933] EXP-1885 FIXED the crash when receiving multiple
 inventory offer notifications. Fixed erasing the iterator which was becoming
 invalid on recursive calls.

---
 indra/newview/llscreenchannel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 1045009a048..a0f146e506b 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -327,8 +327,8 @@ void LLScreenChannel::onToastFade(LLToast* toast)
 		bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored();
 		if(delete_toast)
 		{
-			deleteToast(toast);
 			mToastList.erase(it);
+			deleteToast(toast);
 		}
 		else
 		{
-- 
GitLab


From 788343db01ed4f6c0e786745d4f01bf6f5d2dba5 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 10 Feb 2012 10:56:55 -0800
Subject: [PATCH 759/933] * Added timers to track the http transactions,
 visible through the same   "InventoryOutboxLogging" debug flag.

---
 indra/newview/llmarketplacefunctions.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index a3f0a6062c8..93dd82957f5 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -30,6 +30,7 @@
 
 #include "llagent.h"
 #include "llhttpclient.h"
+#include "lltimer.h"
 #include "lltrans.h"
 #include "llviewercontrol.h"
 #include "llviewermedia.h"
@@ -115,6 +116,9 @@ namespace LLMarketplaceImport
 	static U32 sImportResultStatus = 0;
 	static LLSD sImportResults = LLSD::emptyMap();
 
+	static LLTimer slmGetTimer;
+	static LLTimer slmPostTimer;
+
 	// Responders
 	
 	class LLImportPostResponder : public LLHTTPClient::Responder
@@ -124,11 +128,15 @@ namespace LLMarketplaceImport
 		
 		void completed(U32 status, const std::string& reason, const LLSD& content)
 		{
+			slmPostTimer.stop();
+
 			if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
 			{
 				llinfos << " SLM POST status: " << status << llendl;
 				llinfos << " SLM POST reason: " << reason << llendl;
 				llinfos << " SLM POST content: " << content.asString() << llendl;
+
+				llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl;
 			}
 
 			if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) ||
@@ -167,11 +175,15 @@ namespace LLMarketplaceImport
 		
 		void completed(U32 status, const std::string& reason, const LLSD& content)
 		{
+			slmGetTimer.stop();
+
 			if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
 			{
 				llinfos << " SLM GET status: " << status << llendl;
 				llinfos << " SLM GET reason: " << reason << llendl;
 				llinfos << " SLM GET content: " << content.asString() << llendl;
+
+				llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
 			}
 			
 			if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
@@ -247,6 +259,7 @@ namespace LLMarketplaceImport
 			llinfos << " SLM GET: " << url << llendl;
 		}
 
+		slmGetTimer.start();
 		LLHTTPClient::get(url, new LLImportGetResponder(), LLViewerMedia::getHeaders());
 		
 		return true;
@@ -277,6 +290,7 @@ namespace LLMarketplaceImport
 			llinfos << " SLM GET: " << url << llendl;
 		}
 
+		slmGetTimer.start();
 		LLHTTPClient::get(url, new LLImportGetResponder(), headers);
 		
 		return true;
@@ -310,6 +324,7 @@ namespace LLMarketplaceImport
 			llinfos << " SLM POST: " << url << llendl;
 		}
 
+		slmPostTimer.start();
 		LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers);
 		
 		return true;
-- 
GitLab


From 8d22adbbed589125c89ea8e28610816361615753 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 10 Feb 2012 14:28:16 -0600
Subject: [PATCH 760/933] SH-2963 Fix for highlight transparent not
 highlighting 100% transparent objects.

---
 indra/newview/lldrawpool.h        |  1 +
 indra/newview/lldrawpoolalpha.cpp |  1 +
 indra/newview/llvovolume.cpp      | 10 +++++++---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 5a2981e7496..64774d06df7 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -133,6 +133,7 @@ class LLRenderPass : public LLDrawPool
 		PASS_ALPHA,
 		PASS_ALPHA_MASK,
 		PASS_FULLBRIGHT_ALPHA_MASK,
+		PASS_ALPHA_INVISIBLE,
 		NUM_RENDER_TYPES,
 	};
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index ddb7d3ceebd..5b62dbc560c 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -337,6 +337,7 @@ void LLDrawPoolAlpha::render(S32 pass)
 
 		pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 		pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
+		pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 
 		if(shaders) 
 		{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 63542307965..438d578ac5f 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4433,10 +4433,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 					else
 					{
 						if (te->getColor().mV[3] > 0.f)
-						{
+						{ //only treat as alpha in the pipeline if < 100% transparent
 							drawablep->setState(LLDrawable::HAS_ALPHA);
-							alpha_faces.push_back(facep);
 						}
+						alpha_faces.push_back(facep);
 					}
 				}
 				else
@@ -4952,7 +4952,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 			if (is_alpha)
 			{
 				// can we safely treat this as an alpha mask?
-				if (facep->canRenderAsMask())
+				if (facep->getFaceColor().mV[3] <= 0.f)
+				{ //100% transparent, don't render unless we're highlighting transparent
+					registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE);
+				}
+				else if (facep->canRenderAsMask())
 				{
 					if (te->getFullbright() || LLPipeline::sNoAlpha)
 					{
-- 
GitLab


From 077130eaee30883cb9e666584b3362e2481bd6dd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 10 Feb 2012 14:28:16 -0600
Subject: [PATCH 761/933] SH-2963 Fix for highlight transparent not
 highlighting 100% transparent objects.

---
 indra/newview/lldrawpool.h        |  1 +
 indra/newview/lldrawpoolalpha.cpp |  1 +
 indra/newview/llvovolume.cpp      | 10 +++++++---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 5a2981e7496..64774d06df7 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -133,6 +133,7 @@ class LLRenderPass : public LLDrawPool
 		PASS_ALPHA,
 		PASS_ALPHA_MASK,
 		PASS_FULLBRIGHT_ALPHA_MASK,
+		PASS_ALPHA_INVISIBLE,
 		NUM_RENDER_TYPES,
 	};
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index ddb7d3ceebd..5b62dbc560c 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -337,6 +337,7 @@ void LLDrawPoolAlpha::render(S32 pass)
 
 		pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 		pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
+		pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 
 		if(shaders) 
 		{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 7492a067844..03d4c51aff5 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4433,10 +4433,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 					else
 					{
 						if (te->getColor().mV[3] > 0.f)
-						{
+						{ //only treat as alpha in the pipeline if < 100% transparent
 							drawablep->setState(LLDrawable::HAS_ALPHA);
-							alpha_faces.push_back(facep);
 						}
+						alpha_faces.push_back(facep);
 					}
 				}
 				else
@@ -4947,7 +4947,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 			if (is_alpha)
 			{
 				// can we safely treat this as an alpha mask?
-				if (facep->canRenderAsMask())
+				if (facep->getFaceColor().mV[3] <= 0.f)
+				{ //100% transparent, don't render unless we're highlighting transparent
+					registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE);
+				}
+				else if (facep->canRenderAsMask())
 				{
 					if (te->getFullbright() || LLPipeline::sNoAlpha)
 					{
-- 
GitLab


From bb5797efd955cd6bd496a13104f6b84715afef06 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Fri, 10 Feb 2012 12:41:20 -0800
Subject: [PATCH 762/933] Resized the Merchant Outbox spinner to its native
 size

---
 .../skins/default/xui/en/floater_merchant_outbox.xml   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 498a9b6ce09..6f387f4800b 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -132,16 +132,16 @@
     </panel>
     <layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
       <layout_panel />
-      <layout_panel height="45" auto_resize="false">
-        <layout_stack orientation="horizontal" left="0" height="45" top="0" width="333" follows="all">
+      <layout_panel height="24" auto_resize="false">
+        <layout_stack orientation="horizontal" left="0" height="24" top="0" width="333" follows="all">
           <layout_panel width="0" />
-          <layout_panel width="45" auto_resize="false">
+          <layout_panel width="24" auto_resize="false">
             <loading_indicator
-                height="45"
+                height="24"
                 layout="topleft"
                 left="0"
                 top="0"
-                width="45" />
+                width="24" />
           </layout_panel>
           <layout_panel width="0" />
         </layout_stack>
-- 
GitLab


From e0f86bfb2d85c8dd3c84b6a56fa42aae431f6fe3 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 10 Feb 2012 16:41:24 -0500
Subject: [PATCH 763/933] STORM-1793 Supply missing new artwork

---
 .../default/textures/map_avatar_unknown_32.tga   | Bin 0 -> 4140 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/map_avatar_unknown_32.tga

diff --git a/indra/newview/skins/default/textures/map_avatar_unknown_32.tga b/indra/newview/skins/default/textures/map_avatar_unknown_32.tga
new file mode 100644
index 0000000000000000000000000000000000000000..d1192478c67cb93677e7942b2f491e1bc413e48b
GIT binary patch
literal 4140
zcmbW3T}WhQ7{{lg+R9w33$-N`N)WT%Ffs8WMA!wFCC$Es7`xe}3(dqE1#he*x+-tN
zSY`9V*lrBL8!>67a6p3@Ok-wsE|gr<X3EsYW||M5{{Q!!clPX{GiQ8;AJ6;oJpcE+
zUuTZP@t{Lng#*8Hs7ap05Z?tJ0@_&q92|pu_0AH%f^nV)4**&v_#2!>ONxt&rPJvY
zCs4lA^yzx1IMK#9bBri_KX?p0488`cud%UF=}^n*>`dz#bz=;c3knJt&-F?%cYJ(Y
zTrSt?xZN@^Frde04%gsCPz`p0l$4Yp-)(3h-eu8qyA5qO+J=XRwN4UwYs{^ztdxa?
zg)|;Z+1g%OTB>vZLEaeP+z+WSI5>!WPg=v8r`kOWGCMmf77af4`(TgxH?H51rNt$K
zC3wZ6EYh<bespwHkI!d60{?<UZEdX)w`9hr^GzKyzoVl==kpwY2A%|8fjE%cx4#pw
z*DF4s&+sUFSvKoluTSb;snZ&1KX!8r@jA{YK9+&chkR;)n~32UfcxhH7XXdtcM+tj
zs;XpVWhD!%^3APVT1WZj=H?UPS7l|DI`F0*wJ`?y6I=t@c#qx#+=t`tu5Jkg{2(BH
zg<tuAA07n!0jaOA*IF_^KX1k}$BaRqDw{gggf>Zl5pWJz?HN=ifVvMeGc(7*U{Kag
zST<N!e)8K%rPtoxF6-+?Trh~fb)(-J>&BgcF5!Lq1(bu6tQL(yAl22?vazv|m4=1}
zb=K{~Q4@s08{jnKd$bRz_h?^VpKNVyoeKBj^#0#f-_X#Io;%O?r{GbL&7MH#5>R>E
z+wJWg+1}ZaolMZqHuh=m#ca!+J8M!{SV$et=O^$iuwxeyv<;-Drbfcyu!KXQL^vFh
zP$(=RRi_UbeW<f+)QvXAT)o<&=g#-c6*~i)F}x2S0iIRq@9&qry}kSSE2Ey#KRIcf
zPvmp%TzBqmK30lgzT?##JRXl693FxLIXpO!gA5MQuG{Y7%#@Xt>ACx%@mxLwo3T&9
zPXndXh5H+c97*IT0^m_TLYc6x$`O=7cUPAlo1W{KuRVf<I<ODqe9?LNV|Q1g(P)}j
zG-fGBB^HY*7&A9FXC41XXz)ziHSYZd!1JnfrlzJOo`_2#o{)Gv4or`>`|9XRsQ$S0
z^z`Uw;QoIM_??i;I5y}01>paiw6?ZNDw&d0Dk;g-J)cCKZ7H^)KdEBakFwc!>E%oM
z8UBM-8^~oG|1}T-$3;a&vcJDCXSL<!Wj#JU?{hiGW;}Cz_i)W*dU`tN&>SP1S>Atq
zhVMb<{|=gz@qP{h^~`N;ZP{d1-^9d(R8&;tjB9FYQku}_ygmdcSv?y0T`6|gontee
z&ymeGH#e0gV*$V0_|0gwr&0M0C_OvtJ~A?*=VWUQtnnDf4IT$H-it4R((CQ*%{CR)
z$1}+_(mC|h&t=?GGl&0$yp!DXR{`&bnune9&Szvi;C`y_6+3&D@!TAf-(WugrRT;s
zdoIhkQ@p2cozJtL%ec2X9)1m|GiPVrsckvSoc9oD0{pJAeQquLz%@|sIX)NXpN)(&
z^eb|Cj`?o?1gL$Wb~X+6WvqdkKk}{XlB>+~^8qLVd}o$}^fwdAx$>?3KO<hf@AAlV
pA@&8JzbW{i@h&*aT#)8)yw(2p<#$@%Y-xS{rH(5t*Dhal{13%J6Jh`W

literal 0
HcmV?d00001

-- 
GitLab


From 6c3d44449032e386c2b4163c3635f1fe6934e5d7 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Fri, 10 Feb 2012 14:02:09 -0800
Subject: [PATCH 764/933] EXP-1889 FIX As a Second Life viewer developer, I
 would like a tool that helps me find memory leaks.

---
 indra/cmake/VisualLeakDetector.cmake          | 15 ++++++
 indra/newview/CMakeLists.txt                  |  1 +
 indra/newview/app_settings/settings.xml       | 35 +++++++++-----
 indra/newview/llappviewerwin32.cpp            | 12 +++++
 indra/newview/llviewermenu.cpp                | 47 ++++++++++++++++++-
 .../skins/default/xui/en/menu_viewer.xml      | 10 +++-
 6 files changed, 106 insertions(+), 14 deletions(-)
 create mode 100644 indra/cmake/VisualLeakDetector.cmake

diff --git a/indra/cmake/VisualLeakDetector.cmake b/indra/cmake/VisualLeakDetector.cmake
new file mode 100644
index 00000000000..d3ba554e462
--- /dev/null
+++ b/indra/cmake/VisualLeakDetector.cmake
@@ -0,0 +1,15 @@
+# -*- cmake -*-
+
+if (VIEWER)
+
+  set(INCLUDE_VLD_CMAKE OFF CACHE BOOL "Build the Windows viewer with Visual Leak Detector turned on or off")
+
+  if (INCLUDE_VLD_CMAKE)
+
+    if (WINDOWS)
+      add_definitions(-DINCLUDE_VLD=1)
+    endif (WINDOWS)
+
+  endif (INCLUDE_VLD_CMAKE)
+
+endif (VIEWER)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 69bf1f15a1f..66361c8fbf8 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -41,6 +41,7 @@ include(UnixInstall)
 include(LLKDU)
 include(ViewerMiscLibs)
 include(LLLogin)
+include(VisualLeakDetector)
 include(GLOD)
 include(CMakeCopyIfDifferent)
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ee8c15752b2..caeaf714845 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9619,18 +9619,29 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>ShowConsoleWindow</key>
-    <map>
-      <key>Comment</key>
-      <string>Show log in separate OS window</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>NavBarShowCoordinates</key>
+  <key>ShowConsoleWindow</key>
+  <map>
+    <key>Comment</key>
+    <string>Show log in separate OS window</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
+  <key>EnableVisualLeakDetector</key>
+  <map>
+    <key>Comment</key>
+    <string>EnableVisualLeakDetector</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
+  <key>NavBarShowCoordinates</key>
     <map>
       <key>Comment</key>
       <string>Show coordinates in navigation bar</string>
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 6931b55c4c5..bad60a9757a 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -26,6 +26,10 @@
 
 #include "llviewerprecompiledheaders.h"
 
+#ifdef INCLUDE_VLD
+#include "vld.h"
+#endif
+
 #include "llappviewerwin32.h"
 
 #include "llmemtype.h"
@@ -105,6 +109,14 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
                      LPSTR     lpCmdLine,
                      int       nCmdShow)
 {
+#ifdef INCLUDE_VLD
+	// only works for debug builds (hard coded into vld.h)
+	#ifdef _DEBUG
+		// start with Visual Leak Detector turned off
+		VLDGlobalDisable();
+	#endif // _DEBUG
+#endif // INCLUDE_VLD
+
 	LLMemType mt1(LLMemType::MTYPE_STARTUP);
 
 	const S32 MAX_HEAPS = 255;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 12aed8f448c..37cf9164236 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -25,6 +25,11 @@
  */
 
 #include "llviewerprecompiledheaders.h"
+
+#ifdef INCLUDE_VLD
+#include "vld.h"
+#endif
+
 #include "llviewermenu.h" 
 
 // linden library includes
@@ -214,7 +219,7 @@ void near_sit_down_point(BOOL success, void *);
 
 
 void velocity_interpolate( void* );
-
+void handle_visual_leak_detector_toggle(void*);
 void handle_rebake_textures(void*);
 BOOL check_admin_override(void*);
 void handle_admin_override_toggle(void*);
@@ -2018,6 +2023,15 @@ class LLAdvancedToggleViewAdminOptions : public view_listener_t
 	}
 };
 
+class LLAdvancedToggleVisualLeakDetector : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		handle_visual_leak_detector_toggle(NULL);
+		return true;
+	}
+};
+
 class LLAdvancedCheckViewAdminOptions : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
@@ -3444,6 +3458,35 @@ void handle_admin_override_toggle(void*)
 	show_debug_menus();
 }
 
+void handle_visual_leak_detector_toggle(void*)
+{
+	static bool vld_enabled = false;
+
+	if ( vld_enabled )
+	{
+#ifdef INCLUDE_VLD
+		// only works for debug builds (hard coded into vld.h)
+#ifdef _DEBUG
+		// start with Visual Leak Detector turned off
+		VLDDisable();
+#endif // _DEBUG
+#endif // INCLUDE_VLD
+		vld_enabled = false;
+	}
+	else
+	{
+#ifdef INCLUDE_VLD
+		// only works for debug builds (hard coded into vld.h)
+	#ifdef _DEBUG
+		// start with Visual Leak Detector turned off
+		VLDEnable();
+	#endif // _DEBUG
+#endif // INCLUDE_VLD
+
+		vld_enabled = true;
+	};
+}
+
 void handle_god_mode(void*)
 {
 	gAgent.requestEnterGodMode();
@@ -8237,6 +8280,8 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions");
 	view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions");
 	view_listener_t::addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions");
+	view_listener_t::addMenu(new LLAdvancedToggleVisualLeakDetector(), "Advanced.ToggleVisualLeakDetector");
+
 	view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus");
 	view_listener_t::addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus");
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index cd8550b00db..6443e432fe6 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3261,7 +3261,15 @@
             <menu_item_call.on_click
              function="Advanced.CompressImage" />
         </menu_item_call>
-        <menu_item_check
+
+      <menu_item_call
+         label="Enable Visual Leak Detector"
+         name="Enable Visual Leak Detector">
+        <menu_item_call.on_click
+           function="Advanced.ToggleVisualLeakDetector" />
+        </menu_item_call>
+      
+      <menu_item_check
          label="Output Debug Minidump"
          name="Output Debug Minidump">
             <menu_item_check.on_check
-- 
GitLab


From 6a6cf3aa78b328c5a4cb78ad1b4f9f2fb831c8e4 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 10 Feb 2012 16:35:22 -0800
Subject: [PATCH 765/933] EXP-1884 FIX Errors in navigating text when editing
 Landmarks and picks once a vertical scrollbar is shown

---
 indra/llui/lltextbase.cpp | 10 +++++-----
 indra/llui/llview.cpp     |  5 ++++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 35abe48510d..15c2d4946c8 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1192,7 +1192,7 @@ void LLTextBase::reflow()
 
 		// shrink document to minimum size (visible portion of text widget)
 		// to force inlined widgets with follows set to shrink
-		mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight());
+		//mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight());
 
 		S32 cur_top = 0;
 
@@ -2380,7 +2380,8 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction)
 
 void LLTextBase::updateRects()
 {
-	mVisibleTextRect = getLocalRect();
+	LLRect old_text_rect = mVisibleTextRect;
+	mVisibleTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect();
 
 	if (mLineInfoList.empty()) 
 	{
@@ -2403,10 +2404,10 @@ void LLTextBase::updateRects()
 		switch(mVAlign)
 		{
 		case LLFontGL::TOP:
-			delta_pos = llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom);
+			delta_pos = llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom);
 			break;
 		case LLFontGL::VCENTER:
-			delta_pos = (llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2;
+			delta_pos = (llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2;
 			break;
 		case LLFontGL::BOTTOM:
 			delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom;
@@ -2459,7 +2460,6 @@ void LLTextBase::updateRects()
 	//update mVisibleTextRect *after* mDocumentView has been resized
 	// so that scrollbars are added if document needs to scroll
 	// since mVisibleTextRect does not include scrollbars
-	LLRect old_text_rect = mVisibleTextRect;
 	mVisibleTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect();
 	//FIXME: replace border with image?
 	if (mBorderVisible)
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index d22e14745f0..421166dcd4d 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1300,7 +1300,10 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
 			S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft;
 			S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom;
 			viewp->translate( delta_x, delta_y );
-			viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
+			if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight())
+			{
+				viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
+			}
 		}
 	}
 
-- 
GitLab


From 3710c6110d65d3a604f7b419cd764cf5b9b98600 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 10 Feb 2012 20:04:19 -0600
Subject: [PATCH 766/933] SH-2908 Rework indexed texture rendering to use a
 uvec4 instead of a float for texture indices in the data stream.  Also rework
 gl_FragColor overrides to not collide with some odd driver implementations.

---
 indra/llrender/llgl.cpp                       | 62 ++++++++++++-
 indra/llrender/llgl.h                         |  2 +
 indra/llrender/llglheaders.h                  |  3 +
 indra/llrender/llglslshader.cpp               |  5 +-
 indra/llrender/llshadermgr.cpp                | 92 +++++++++----------
 indra/llrender/llvertexbuffer.cpp             | 46 +++++++++-
 .../shaders/class1/avatar/pickAvatarF.glsl    |  6 +-
 .../shaders/class1/deferred/alphaF.glsl       |  6 +-
 .../class1/deferred/alphaNonIndexedF.glsl     | 10 +-
 .../deferred/alphaNonIndexedNoColorF.glsl     |  6 +-
 .../class1/deferred/attachmentShadowF.glsl    |  8 +-
 .../shaders/class1/deferred/avatarF.glsl      | 10 +-
 .../class1/deferred/avatarShadowF.glsl        |  6 +-
 .../shaders/class1/deferred/blurLightF.glsl   |  6 +-
 .../shaders/class1/deferred/bumpF.glsl        | 12 ++-
 .../shaders/class1/deferred/cloudsF.glsl      | 10 +-
 .../shaders/class1/deferred/cofF.glsl         |  8 +-
 .../class1/deferred/diffuseAlphaMaskF.glsl    | 10 +-
 .../deferred/diffuseAlphaMaskIndexedF.glsl    | 10 +-
 .../deferred/diffuseAlphaMaskNoColorF.glsl    | 10 +-
 .../shaders/class1/deferred/diffuseF.glsl     | 12 ++-
 .../class1/deferred/diffuseIndexedF.glsl      | 12 ++-
 .../shaders/class1/deferred/dofCombineF.glsl  |  6 +-
 .../shaders/class1/deferred/emissiveF.glsl    |  6 +-
 .../shaders/class1/deferred/fullbrightF.glsl  |  6 +-
 .../shaders/class1/deferred/fxaaF.glsl        |  6 +-
 .../shaders/class1/deferred/giF.glsl          |  6 +-
 .../shaders/class1/deferred/giV.glsl          | 48 ----------
 .../shaders/class1/deferred/impostorF.glsl    | 10 +-
 .../shaders/class1/deferred/luminanceF.glsl   |  6 +-
 .../class1/deferred/multiPointLightF.glsl     |  8 +-
 .../class1/deferred/multiSpotLightF.glsl      |  8 +-
 .../shaders/class1/deferred/normgenF.glsl     |  6 +-
 .../shaders/class1/deferred/pointLightF.glsl  |  8 +-
 .../class1/deferred/postDeferredF.glsl        |  6 +-
 .../class1/deferred/postDeferredNoDoFF.glsl   |  6 +-
 .../shaders/class1/deferred/postgiF.glsl      |  8 +-
 .../shaders/class1/deferred/postgiV.glsl      | 40 --------
 .../class1/deferred/shadowAlphaMaskF.glsl     |  6 +-
 .../shaders/class1/deferred/shadowF.glsl      |  6 +-
 .../shaders/class1/deferred/skyF.glsl         | 10 +-
 .../shaders/class1/deferred/softenLightF.glsl |  8 +-
 .../shaders/class1/deferred/spotLightF.glsl   |  8 +-
 .../shaders/class1/deferred/starsF.glsl       | 10 +-
 .../shaders/class1/deferred/sunLightF.glsl    |  6 +-
 .../class1/deferred/sunLightSSAOF.glsl        | 12 ++-
 .../shaders/class1/deferred/terrainF.glsl     | 10 +-
 .../shaders/class1/deferred/treeF.glsl        | 10 +-
 .../shaders/class1/deferred/treeShadowF.glsl  |  6 +-
 .../shaders/class1/deferred/waterF.glsl       | 10 +-
 .../shaders/class1/effects/glowExtractF.glsl  |  8 +-
 .../shaders/class1/effects/glowF.glsl         |  6 +-
 .../shaders/class1/environment/terrainF.glsl  |  6 +-
 .../class1/environment/terrainWaterF.glsl     |  6 +-
 .../class1/environment/underWaterF.glsl       |  6 +-
 .../shaders/class1/environment/waterF.glsl    |  6 +-
 .../shaders/class1/interface/alphamaskF.glsl  |  6 +-
 .../class1/interface/customalphaF.glsl        |  6 +-
 .../shaders/class1/interface/debugF.glsl      |  6 +-
 .../class1/interface/glowcombineF.glsl        |  6 +-
 .../class1/interface/glowcombineFXAAF.glsl    |  6 +-
 .../shaders/class1/interface/highlightF.glsl  |  6 +-
 .../shaders/class1/interface/occlusionF.glsl  |  6 +-
 .../class1/interface/onetexturenocolorF.glsl  |  6 +-
 .../shaders/class1/interface/solidcolorF.glsl |  6 +-
 .../class1/interface/splattexturerectF.glsl   |  6 +-
 .../class1/interface/twotextureaddF.glsl      |  6 +-
 .../shaders/class1/interface/uiF.glsl         |  6 +-
 .../class1/lighting/lightAlphaMaskF.glsl      |  6 +-
 .../lighting/lightAlphaMaskNonIndexedF.glsl   |  6 +-
 .../shaders/class1/lighting/lightF.glsl       |  6 +-
 .../lighting/lightFullbrightAlphaMaskF.glsl   |  6 +-
 .../class1/lighting/lightFullbrightF.glsl     |  6 +-
 .../lightFullbrightNonIndexedAlphaMaskF.glsl  |  6 +-
 .../lighting/lightFullbrightNonIndexedF.glsl  |  6 +-
 .../lighting/lightFullbrightShinyF.glsl       |  6 +-
 .../lightFullbrightShinyNonIndexedF.glsl      |  6 +-
 .../lighting/lightFullbrightShinyWaterF.glsl  |  6 +-
 .../lightFullbrightShinyWaterNonIndexedF.glsl |  6 +-
 .../lightFullbrightWaterAlphaMaskF.glsl       |  6 +-
 .../lighting/lightFullbrightWaterF.glsl       |  6 +-
 ...htFullbrightWaterNonIndexedAlphaMaskF.glsl |  6 +-
 .../lightFullbrightWaterNonIndexedF.glsl      |  6 +-
 .../class1/lighting/lightNonIndexedF.glsl     |  6 +-
 .../shaders/class1/lighting/lightShinyF.glsl  |  6 +-
 .../lighting/lightShinyNonIndexedF.glsl       |  6 +-
 .../class1/lighting/lightShinyWaterF.glsl     |  6 +-
 .../lighting/lightShinyWaterNonIndexedF.glsl  |  6 +-
 .../class1/lighting/lightWaterAlphaMaskF.glsl |  6 +-
 .../lightWaterAlphaMaskNonIndexedF.glsl       |  6 +-
 .../shaders/class1/lighting/lightWaterF.glsl  |  8 +-
 .../lighting/lightWaterNonIndexedF.glsl       |  6 +-
 .../shaders/class1/objects/bumpF.glsl         |  6 +-
 .../shaders/class1/objects/impostorF.glsl     |  6 +-
 .../class1/objects/indexedTextureV.glsl       |  4 +-
 .../shaders/class2/deferred/alphaF.glsl       |  6 +-
 .../class2/deferred/alphaNonIndexedF.glsl     |  6 +-
 .../deferred/alphaNonIndexedNoColorF.glsl     |  6 +-
 .../class2/deferred/multiSpotLightF.glsl      |  8 +-
 .../shaders/class2/deferred/softenLightF.glsl |  8 +-
 .../shaders/class2/deferred/spotLightF.glsl   |  8 +-
 .../shaders/class2/deferred/sunLightF.glsl    | 18 ++--
 .../class2/deferred/sunLightSSAOF.glsl        | 18 ++--
 .../shaders/class2/windlight/cloudsF.glsl     |  8 +-
 .../shaders/class2/windlight/skyF.glsl        |  8 +-
 indra/newview/llface.cpp                      | 12 ++-
 indra/newview/llviewershadermgr.cpp           | 14 ++-
 indra/newview/llvovolume.cpp                  |  6 +-
 108 files changed, 624 insertions(+), 412 deletions(-)
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/giV.glsl
 delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 946e602fee6..79d4415117f 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -97,6 +97,8 @@ void APIENTRY gl_debug_callback(GLenum source,
 }
 #endif
 
+void parse_glsl_version(S32& major, S32& minor);
+
 void ll_init_fail_log(std::string filename)
 {
 	gFailLog.open(filename.c_str());
@@ -295,6 +297,7 @@ PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB = NULL;
 PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB = NULL;
 PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = NULL;
 PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = NULL;
+PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
 
 #if LL_WINDOWS
 PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
@@ -341,6 +344,7 @@ PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB = NULL;
 PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB = NULL;
 PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB = NULL;
 PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB = NULL;
+PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
 PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB = NULL;
 PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB = NULL;
 PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL;
@@ -443,7 +447,8 @@ LLGLManager::LLGLManager() :
 	mDriverVersionMinor(0),
 	mDriverVersionRelease(0),
 	mGLVersion(1.0f),
-		
+	mGLSLVersionMajor(0),
+	mGLSLVersionMinor(0),		
 	mVRAM(0),
 	mGLMaxVertexRange(0),
 	mGLMaxIndexRange(0)
@@ -554,6 +559,11 @@ bool LLGLManager::initGL()
 
 	mGLVersion = mDriverVersionMajor + mDriverVersionMinor * .1f;
 
+	if (mGLVersion >= 2.f)
+	{
+		parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor);
+	}
+
 	// Trailing space necessary to keep "nVidia Corpor_ati_on" cards
 	// from being recognized as ATI.
 	if (mGLVendor.substr(0,4) == "ATI ")
@@ -1300,6 +1310,7 @@ void LLGLManager::initExtensions()
 		glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4uivARB");
 		glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4usvARB");
 		glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttribPointerARB");
+		glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIPointer");
 		glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC) GLH_EXT_GET_PROC_ADDRESS("glEnableVertexAttribArrayARB");
 		glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDisableVertexAttribArrayARB");
 		glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glProgramStringARB");
@@ -2098,6 +2109,55 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor
 	}
 }
 
+
+void parse_glsl_version(S32& major, S32& minor)
+{
+	// GL_SHADING_LANGUAGE_VERSION returns a null-terminated string with the format: 
+	// <major>.<minor>[.<release>] [<vendor specific>]
+
+	const char* version = (const char*) glGetString(GL_SHADING_LANGUAGE_VERSION);
+	major = 0;
+	minor = 0;
+	
+	if( !version )
+	{
+		return;
+	}
+
+	std::string ver_copy( version );
+	S32 len = (S32)strlen( version );	/* Flawfinder: ignore */
+	S32 i = 0;
+	S32 start;
+	// Find the major version
+	start = i;
+	for( ; i < len; i++ )
+	{
+		if( '.' == version[i] )
+		{
+			break;
+		}
+	}
+	std::string major_str = ver_copy.substr(start,i-start);
+	LLStringUtil::convertToS32(major_str, major);
+
+	if( '.' == version[i] )
+	{
+		i++;
+	}
+
+	// Find the minor version
+	start = i;
+	for( ; i < len; i++ )
+	{
+		if( ('.' == version[i]) || isspace(version[i]) )
+		{
+			break;
+		}
+	}
+	std::string minor_str = ver_copy.substr(start,i-start);
+	LLStringUtil::convertToS32(minor_str, minor);
+}
+
 LLGLUserClipPlane::LLGLUserClipPlane(const LLPlane& p, const glh::matrix4f& modelview, const glh::matrix4f& projection, bool apply)
 {
 	mApply = apply;
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 6a147b8e19a..5a33c987083 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -138,6 +138,8 @@ class LLGLManager
 	S32 mDriverVersionMinor;
 	S32 mDriverVersionRelease;
 	F32 mGLVersion; // e.g = 1.4
+	S32 mGLSLVersionMajor;
+	S32 mGLSLVersionMinor;
 	std::string mDriverVersionVendorString;
 
 	S32 mVRAM; // VRAM in MB
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 10aad202e17..d61ec707f06 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -199,6 +199,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
 extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
 extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
 extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
+extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
 extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
 extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
 extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
@@ -460,6 +461,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
 extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
 extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
 extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
+extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
 extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
 extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
 extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
@@ -693,6 +695,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
 extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
 extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
 extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
+extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
 extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
 extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
 extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 7eba62e59e7..a879a188950 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -164,8 +164,9 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
 		return FALSE;
 	}
 
-	if (gGLManager.mGLVersion < 3.1f)
-	{ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
+	if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3)
+	{ //indexed texture rendering requires GLSL 1.3 or later
+		//attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
 		mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
 	}
 
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index d03d349f0f8..321b1391811 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -575,31 +575,39 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 	GLcharARB* text[4096];
 	GLuint count = 0;
 
-	F32 version = gGLManager.mGLVersion;
-
-//hack to never use GLSL > 1.20 on OSX
-#if LL_DARWIN
-	version = llmin(version, 2.9f);
-#endif
-
-	if (version < 2.1f)
-	{
-		text[count++] = strdup("#version 110\n");
-		text[count++] = strdup("#define ATTRIBUTE attribute\n");
-		text[count++] = strdup("#define VARYING varying\n");
-	}
-	else if (version < 3.3f)
+	S32 major_version = gGLManager.mGLSLVersionMajor;
+	S32 minor_version = gGLManager.mGLSLVersionMinor;
+	
+	if (major_version == 1 && minor_version < 30)
 	{
-		//set version to 1.20
-		text[count++] = strdup("#version 120\n");
-		text[count++] = strdup("#define FXAA_GLSL_120 1\n");
-		text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n");
-		text[count++] = strdup("#define ATTRIBUTE attribute\n");
-		text[count++] = strdup("#define VARYING varying\n");
+		if (minor_version < 10)
+		{
+			//should NEVER get here -- if major version is 1 and minor version is less than 10, 
+			// viewer should never attempt to use shaders, continuing will result in undefined behavior
+			llerrs << "Unsupported GLSL Version." << llendl;
+		}
+
+		if (minor_version <= 19)
+		{
+			text[count++] = strdup("#version 110\n");
+			text[count++] = strdup("#define ATTRIBUTE attribute\n");
+			text[count++] = strdup("#define VARYING varying\n");
+			text[count++] = strdup("#define VARYING_FLAT varying\n");
+		}
+		else if (minor_version <= 29)
+		{
+			//set version to 1.20
+			text[count++] = strdup("#version 120\n");
+			text[count++] = strdup("#define FXAA_GLSL_120 1\n");
+			text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n");
+			text[count++] = strdup("#define ATTRIBUTE attribute\n");
+			text[count++] = strdup("#define VARYING varying\n");
+			text[count++] = strdup("#define VARYING_FLAT varying\n");
+		}
 	}
 	else
 	{  
-		if (version < 4.f)
+		if (major_version < 4)
 		{
 			//set version to 1.30
 			text[count++] = strdup("#version 130\n");
@@ -618,13 +626,17 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		{ //"varying" state is "out" in a vertex program, "in" in a fragment program 
 			// ("varying" is deprecated after version 1.20)
 			text[count++] = strdup("#define VARYING out\n");
+			text[count++] = strdup("#define VARYING_FLAT flat out\n");
 		}
 		else
 		{
 			text[count++] = strdup("#define VARYING in\n");
+			text[count++] = strdup("#define VARYING_FLAT flat in\n");
 		}
 
 		//backwards compatibility with legacy texture lookup syntax
+		text[count++] = strdup("#define texture2D texture\n");
+		text[count++] = strdup("#define texture2DRect texture\n");
 		text[count++] = strdup("#define textureCube texture\n");
 		text[count++] = strdup("#define texture2DLod textureLod\n");
 		text[count++] = strdup("#define	shadow2D(a,b) vec2(texture(a,b))\n");
@@ -651,11 +663,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		.
 		uniform sampler2D texN;
 		
-		VARYING float vary_texture_index;
+		VARYING uvec4 vary_texture_index;
 
 		vec4 diffuseLookup(vec2 texcoord)
 		{
-			switch (int(vary_texture_index+0.25))
+			switch (vary_texture_index.r))
 			{
 				case 0: return texture2D(tex0, texcoord);
 				case 1: return texture2D(tex1, texcoord);
@@ -679,7 +691,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 
 		if (texture_index_channels > 1)
 		{
-			text[count++] = strdup("VARYING float vary_texture_index;\n");
+			text[count++] = strdup("VARYING_FLAT uvec4 vary_texture_index;\n");
 		}
 
 		text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n");
@@ -691,9 +703,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 			text[count++] = strdup("return texture2D(tex0, texcoord);\n");
 			text[count++] = strdup("}\n");
 		}
-		else if (gGLManager.mGLVersion >= 3.f)
-		{ 
-			text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n");
+		else if (major_version > 1 || minor_version >= 30)
+		{  //switches are supported in GLSL 1.30 and later
+			text[count++] = strdup("\tswitch (vary_texture_index.r)\n");
 			text[count++] = strdup("\t{\n");
 		
 			//switch body
@@ -708,28 +720,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 			text[count++] = strdup("}\n");
 		}
 		else
-		{
-			//switches aren't supported, make block that looks like:
-			/*
-				int ti = int(vary_texture_index+0.25);
-				if (ti == 0) return texture2D(tex0, texcoord);
-				if (ti == 1) return texture2D(tex1, texcoord);
-				.
-				.
-				.
-				if (ti == N) return texture2D(texN, texcoord);
-			*/
-				
-			text[count++] = strdup("int ti = int(vary_texture_index+0.25);\n");
-			for (S32 i = 0; i < texture_index_channels; ++i)
-			{
-				std::string if_str = llformat("if (ti == %d) return texture2D(tex%d, texcoord);\n", i, i);
-				text[count++] = strdup(if_str.c_str());
-			}
-
-			text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
-			text[count++] = strdup("}\n");
-		}			
+		{ //should never get here.  Indexed texture rendering requires GLSL 1.30 or later 
+			// (for passing integers between vertex and fragment shaders)
+			llerrs << "Indexed texture rendering requires GLSL 1.30 or later." << llendl;
+		}
 	}
 
 	//copy file into memory
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index e4a5cd02995..b2438ef8247 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -284,6 +284,12 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
 	{
 		bool error = false;
 
+		if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 30)
+		{
+			//make sure texture index is disabled
+			data_mask = data_mask & ~MAP_TEXTURE_INDEX;
+		}
+
 		if (LLGLSLShader::sNoFixedFunction)
 		{
 			for (U32 i = 0; i < TYPE_MAX; ++i)
@@ -1193,7 +1199,7 @@ void LLVertexBuffer::setupVertexArray()
 		1, //TYPE_WEIGHT,
 		4, //TYPE_WEIGHT4,
 		4, //TYPE_CLOTHWEIGHT,
-		1, //TYPE_TEXTURE_INDEX
+		4, //TYPE_TEXTURE_INDEX
 	};
 
 	U32 attrib_type[] =
@@ -1210,7 +1216,24 @@ void LLVertexBuffer::setupVertexArray()
 		GL_FLOAT, //TYPE_WEIGHT,
 		GL_FLOAT, //TYPE_WEIGHT4,
 		GL_FLOAT, //TYPE_CLOTHWEIGHT,
-		GL_FLOAT, //TYPE_TEXTURE_INDEX
+		GL_UNSIGNED_BYTE, //TYPE_TEXTURE_INDEX
+	};
+
+	bool attrib_integer[] = 
+	{
+		false, //TYPE_VERTEX,
+		false, //TYPE_NORMAL,
+		false, //TYPE_TEXCOORD0,
+		false, //TYPE_TEXCOORD1,
+		false, //TYPE_TEXCOORD2,
+		false, //TYPE_TEXCOORD3,
+		false, //TYPE_COLOR,
+		false, //TYPE_EMISSIVE,
+		false, //TYPE_BINORMAL,
+		false, //TYPE_WEIGHT,
+		false, //TYPE_WEIGHT4,
+		false, //TYPE_CLOTHWEIGHT,
+		true, //TYPE_TEXTURE_INDEX
 	};
 
 	U32 attrib_normalized[] =
@@ -1238,7 +1261,19 @@ void LLVertexBuffer::setupVertexArray()
 		if (mTypeMask & (1 << i))
 		{
 			glEnableVertexAttribArrayARB(i);
-			glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]); 
+
+			if (attrib_integer)
+			{
+				//glVertexattribIPointer requires GLSL 1.30 or later
+				if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
+				{
+					glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]); 
+				}
+			}
+			else
+			{
+				glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]); 
+			}
 		}
 		else
 		{
@@ -2220,11 +2255,12 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 			void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
 			glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE,  LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
 		}
-		if (data_mask & MAP_TEXTURE_INDEX)
+		if (data_mask & MAP_TEXTURE_INDEX && 
+				(gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later
 		{
 			S32 loc = TYPE_TEXTURE_INDEX;
 			void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
-			glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
+			glVertexAttribIPointer(loc, 4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
 		}
 		if (data_mask & MAP_VERTEX)
 		{
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
index 3e4d438ed37..54e2f044590 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -34,5 +36,5 @@ uniform sampler2D diffuseMap;
 
 void main() 
 {
-	gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
+	frag_color = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index c012efa0563..37fd63b7d5a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect depthMap;
@@ -69,6 +71,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index 86418277775..14ac9f1f786 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect depthMap;
@@ -81,9 +83,9 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	gl_FragColor = color;
-	//gl_FragColor = vec4(1,0,1,1);
-	//gl_FragColor = vec4(1,0,1,1)*shadow;
+	frag_color = color;
+	//frag_color = vec4(1,0,1,1);
+	//frag_color = vec4(1,0,1,1)*shadow;
 	
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index c13ea702dba..654e272b067 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect depthMap;
@@ -79,6 +81,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index 402f6816310..b88041490ac 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -23,7 +23,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -33,7 +35,7 @@ VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	//gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
-	gl_FragColor = vec4(1,1,1,1);
+	//frag_color = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
+	frag_color = vec4(1,1,1,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index 9a3b2e3e8a5..4912c9a50c5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -41,9 +43,9 @@ void main()
 		discard;
 	}
 	
-	gl_FragData[0] = vec4(diff.rgb, 0.0);
-	gl_FragData[1] = vec4(0,0,0,0);
+	frag_data[0] = vec4(diff.rgb, 0.0);
+	frag_data[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index 558a88009aa..594ed778e3e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -33,7 +35,7 @@ VARYING vec4 post_pos;
 
 void main() 
 {
-	gl_FragColor = vec4(1,1,1,1);
+	frag_color = vec4(1,1,1,1);
 
 	gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 60d4dae99f0..a08b018702a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect depthMap;
@@ -111,6 +113,6 @@ void main()
 	col /= defined_weight.xyxx;
 	col.y *= col.y;
 	
-	gl_FragColor = col;
+	frag_color = col;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
index 6cc5f23acaf..141738023d7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -46,9 +48,9 @@ void main()
 			  dot(norm,vary_mat1),
 			  dot(norm,vary_mat2));
 						
-	gl_FragData[0] = vec4(col, 0.0);
-	gl_FragData[1] = vertex_color.aaaa; // spec
-	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
+	frag_data[0] = vec4(col, 0.0);
+	frag_data[1] = vertex_color.aaaa; // spec
+	//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(tnorm);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index db272cf601e..d2afc148b12 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -25,7 +25,9 @@
  
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 /////////////////////////////////////////////////////////////////////////
@@ -98,8 +100,8 @@ void main()
 	color *= 2.;
 
 	/// Gamma correct for WL (soft clip effect).
-	gl_FragData[0] = vec4(scaleSoftClip(color.rgb), alpha1);
-	gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
-	gl_FragData[2] = vec4(0,0,1,0);
+	frag_data[0] = vec4(scaleSoftClip(color.rgb), alpha1);
+	frag_data[1] = vec4(0.0,0.0,0.0,0.0);
+	frag_data[2] = vec4(0,0,1,0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index e612efba61f..3fcfbf55c45 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -83,6 +85,6 @@ void main()
 	sc = max(sc, -max_cof);
 	
 	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor.rgb = diff.rgb + bloom.rgb;
-	gl_FragColor.a = sc/max_cof*0.5+0.5;
+	frag_color.rgb = diff.rgb + bloom.rgb;
+	frag_color.a = sc/max_cof*0.5+0.5;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index e9989a4e489..c8acaee1349 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform float minimum_alpha;
@@ -44,9 +46,9 @@ void main()
 		discard;
 	}
 
-	gl_FragData[0] = vec4(col.rgb, 0.0);
-	gl_FragData[1] = vec4(0,0,0,0); // spec
+	frag_data[0] = vec4(col.rgb, 0.0);
+	frag_data[1] = vec4(0,0,0,0); // spec
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index fdf8d72b38f..d960cbc2fe8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 VARYING vec3 vary_normal;
@@ -43,8 +45,8 @@ void main()
 		discard;
 	}
 
-	gl_FragData[0] = vec4(col.rgb, 0.0);
-	gl_FragData[1] = vec4(0,0,0,0);
+	frag_data[0] = vec4(col.rgb, 0.0);
+	frag_data[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index bb20e2ca476..b1c9b525699 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -25,7 +25,9 @@
  
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform float minimum_alpha;
@@ -44,9 +46,9 @@ void main()
 		discard;
 	}
 
-	gl_FragData[0] = vec4(col.rgb, 0.0);
-	gl_FragData[1] = vec4(0,0,0,0); // spec
+	frag_data[0] = vec4(col.rgb, 0.0);
+	frag_data[1] = vec4(0,0,0,0); // spec
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index 7bde49eb86b..caefe84957a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -36,10 +38,10 @@ VARYING vec2 vary_texcoord0;
 void main() 
 {
 	vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
-	gl_FragData[0] = vec4(col, 0.0);
-	gl_FragData[1] = vertex_color.aaaa; // spec
-	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
+	frag_data[0] = vec4(col, 0.0);
+	frag_data[1] = vertex_color.aaaa; // spec
+	//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index 75b45111e0e..c89f3899548 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 VARYING vec3 vary_normal;
@@ -35,9 +37,9 @@ void main()
 {
 	vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
 
-	gl_FragData[0] = vec4(col, 0.0);
-	gl_FragData[1] = vertex_color.aaaa; // spec
-	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
+	frag_data[0] = vec4(col, 0.0);
+	frag_data[1] = vertex_color.aaaa; // spec
+	//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index 0cf5afc5685..f05ea557e31 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -73,5 +75,5 @@ void main()
 		diff = mix(diff, col*0.25, a);
 	}
 
-	gl_FragColor = mix(diff, dof, a);
+	frag_color = mix(diff, dof, a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index 92f78125d84..ebe9a66bb44 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 vec3 fullbrightAtmosTransport(vec3 light);
@@ -45,6 +47,6 @@ void main()
 
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 84ae2f9f109..616ffca2d11 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -46,6 +48,6 @@ void main()
 
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
index 5af94064526..76b1748813e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 #define FXAA_PC 1
@@ -2113,6 +2115,6 @@ void main()
 
 	//diff = texture2D(diffuseMap, vary_tc);
 	
-	gl_FragColor = diff;
+	frag_color = diff;
 	
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
index 29ca80ae92d..28ed70d49dc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect depthMap;
@@ -184,5 +186,5 @@ void main()
 	vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
 	
-	gl_FragColor.xyz = giAmbient(pos, norm);
+	frag_color.xyz = giAmbient(pos, norm);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
deleted file mode 100644
index e5d3bb8ea61..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ /dev/null
@@ -1,48 +0,0 @@
-/** 
- * @file giV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_fragcoord;
-
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 
-	
-	vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;	
-	vec4 tex = vec4(texcoord0,0,1);
-	tex.w = 1.0;
-
-	vertex_color = diffuse_color;
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index a44173a2a4d..d7bc8d02d9d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform float minimum_alpha;
@@ -45,7 +47,7 @@ void main()
 		discard;
 	}
 
-	gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
-	gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy);
-	gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
+	frag_data[0] = vec4(col.rgb, col.a * 0.005);
+	frag_data[1] = texture2D(specularMap, vary_texcoord0.xy);
+	frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index e014a14ad86..31da124cb12 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -26,12 +26,14 @@
 uniform sampler2DRect diffuseMap;
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec2 vary_fragcoord;
 
 void main() 
 {
-	gl_FragColor = texture2DRect(diffuseMap, vary_fragcoord.xy);
+	frag_color = texture2DRect(diffuseMap, vary_fragcoord.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 179c721a2fa..cd50e17d7ec 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect depthMap;
@@ -141,6 +143,6 @@ void main()
 		discard;
 	}
 	
-	gl_FragColor.rgb = out_col;
-	gl_FragColor.a = 0.0;
+	frag_color.rgb = out_col;
+	frag_color.a = 0.0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 2196d14895b..40dd3630614 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 //class 1 -- no shadows
@@ -242,6 +244,6 @@ void main()
 		}
 	}
 	
-	gl_FragColor.rgb = col;	
-	gl_FragColor.a = 0.0;
+	frag_color.rgb = col;	
+	frag_color.a = 0.0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
index 879942d8faa..32881ef0429 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D alphaMap;
@@ -52,5 +54,5 @@ void main()
 	norm *= 0.5;
 	norm += 0.5;	
 	
-	gl_FragColor = vec4(norm, alpha);
+	frag_color = vec4(norm, alpha);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index b673d00d6e2..619b7bcd03f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -118,6 +120,6 @@ void main()
 		discard;
 	}
 		
-	gl_FragColor.rgb = col;	
-	gl_FragColor.a = 0.0;
+	frag_color.rgb = col;	
+	frag_color.a = 0.0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 18d451bf878..e7b21742809 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -122,5 +124,5 @@ void main()
 		diff /= w;
 	}
 		
-	gl_FragColor = diff;
+	frag_color = diff;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index c2754347772..ed2352b51f8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -40,6 +42,6 @@ void main()
 	vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
 	
 	vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
-	gl_FragColor = diff + bloom;
+	frag_color = diff + bloom;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index 84d65d5b3b2..18550b2e12f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -24,8 +24,10 @@
  */
 
  #ifdef DEFINE_GL_FRAGCOLOR
- out vec4 gl_FragColor;
- #endif
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
+#endif
  
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
@@ -96,5 +98,5 @@ void main()
 	
 	col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z;
 	
-	gl_FragColor.rgb = col;
+	frag_color.rgb = col;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
deleted file mode 100644
index 0d5c8e72874..00000000000
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ /dev/null
@@ -1,40 +0,0 @@
-/** 
- * @file postgiV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-uniform mat4 modelview_projection_matrix;
- 
-ATTRIBUTE vec3 position;
-
-
-VARYING vec2 vary_fragcoord;
-uniform vec2 screen_res;
-
-void main()
-{
-	//transform vertex
-	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	gl_Position = pos; 	
-	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
-}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index c1fb7b55d4f..7d75b50aa2a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -44,7 +46,7 @@ void main()
 		discard;
 	}
 
-	gl_FragColor = vec4(1,1,1,1);
+	frag_color = vec4(1,1,1,1);
 	
 	gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index bf75ca262ec..3eb733aa517 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -24,14 +24,16 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 post_pos;
 
 void main() 
 {
-	gl_FragColor = vec4(1,1,1,1);
+	frag_color = vec4(1,1,1,1);
 	
 	gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 96ad0aa93a3..7d80f07da44 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 /////////////////////////////////////////////////////////////////////////
@@ -57,8 +59,8 @@ void main()
 	color *= 2.;
 
 	/// Gamma correct for WL (soft clip effect).
-	gl_FragData[0] = vec4(scaleSoftClip(color.rgb), 1.0);
-	gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
-	gl_FragData[2] = vec4(0,0,1,0);
+	frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0);
+	frag_data[1] = vec4(0.0,0.0,0.0,0.0);
+	frag_data[2] = vec4(0,0,1,0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 0c53a4ffa5a..70b0f6fbd09 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -322,7 +324,7 @@ void main()
 		col = diffuse.rgb;
 	}
 
-	gl_FragColor.rgb = col;
+	frag_color.rgb = col;
 
-	gl_FragColor.a = bloom;
+	frag_color.a = bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index cc0f4e5b6bf..d3d6a155f0d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -27,7 +27,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -184,6 +186,6 @@ void main()
 		}
 	}
 	
-	gl_FragColor.rgb = col;	
-	gl_FragColor.a = 0.0;
+	frag_color.rgb = col;	
+	frag_color.a = 0.0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 03fccd27661..1cfcca4f5d9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 VARYING vec4 vertex_color;
@@ -36,7 +38,7 @@ void main()
 {
 	vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
 	
-	gl_FragData[0] = col;
-	gl_FragData[1] = vec4(0,0,0,0);
-	gl_FragData[2] = vec4(0,0,1,0);	
+	frag_data[0] = col;
+	frag_data[1] = vec4(0,0,0,0);
+	frag_data[2] = vec4(0,0,1,0);	
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
index adc7c5d0058..aa29be09a16 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
@@ -28,10 +28,12 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 void main() 
 {
-	gl_FragColor = vec4(0,0,0,0);
+	frag_color = vec4(0,0,0,0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index fc5959a33c4..9bee6324721 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 //class 1 -- no shadow, SSAO only
@@ -128,8 +130,8 @@ void main()
 	vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
 	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
 		
-	gl_FragColor[0] = 1.0;
-	gl_FragColor[1] = calcAmbientOcclusion(pos, norm);
-	gl_FragColor[2] = 1.0; 
-	gl_FragColor[3] = 1.0;
+	frag_color[0] = 1.0;
+	frag_color[1] = calcAmbientOcclusion(pos, norm);
+	frag_color[2] = 1.0; 
+	frag_color[3] = 1.0;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index 5522e6c41d0..021c23f76c4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform sampler2D detail_0;
@@ -51,9 +53,9 @@ void main()
 	float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
 	vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
 	
-	gl_FragData[0] = vec4(outColor.rgb, 0.0);
-	gl_FragData[1] = vec4(0,0,0,0);
+	frag_data[0] = vec4(outColor.rgb, 0.0);
+	frag_data[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index ea98d6884ca..10d8a5c3215 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -43,8 +45,8 @@ void main()
 		discard;
 	}
 
-	gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
-	gl_FragData[1] = vec4(0,0,0,0);
+	frag_data[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
+	frag_data[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 20d01705358..6be66a402fb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -43,7 +45,7 @@ void main()
 		discard;
 	}
 
-	gl_FragColor = vec4(1,1,1,1);
+	frag_color = vec4(1,1,1,1);
 	
 	gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index 4c9ea24a249..e4c655ed7de 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragData[3];
+out vec4 frag_data[3];
+#else
+#define frag_data gl_FragData;
 #endif
 
 vec3 scaleSoftClip(vec3 inColor);
@@ -157,7 +159,7 @@ void main()
 	//wavef = normalize(wavef);
 	vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz;
 	
-	gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse
-	gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
-	gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
+	frag_data[0] = vec4(color.rgb, 0.5); // diffuse
+	frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
+	frag_data[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index 9a3d7922244..952706841d0 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseMap;
@@ -46,7 +48,7 @@ void main()
 	float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
 	float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) ); 
 	
-	gl_FragColor.rgb = col.rgb; 
-	gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
+	frag_color.rgb = col.rgb; 
+	frag_color.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
 	
 }
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 90bb84323cc..289c5b367fa 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -54,5 +56,5 @@ void main()
 	col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw);	
 	col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw);	
 	
-	gl_FragColor = vec4(col.rgb * glowStrength, col.a);
+	frag_color = vec4(col.rgb * glowStrength, col.a);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index 18f6d91804d..51efdd4b399 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -59,6 +61,6 @@ void main()
 	/// Add WL Components
 	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
 	
-	gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);
+	frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index e5c7ced52c0..d9b5c5f7f5e 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -60,6 +62,6 @@ void main()
 	outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
 	
 	outColor = applyWaterFog(outColor);
-	gl_FragColor = outColor;
+	frag_color = outColor;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 1fdb90f7926..32459eff6ae 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -106,5 +108,5 @@ void main()
 		
 	vec4 fb = texture2D(screenTex, distort);
 	
-	gl_FragColor = applyWaterFog(fb,view.xyz);
+	frag_color = applyWaterFog(fb,view.xyz);
 }
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 444c896d388..0cde7d0133d 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 vec3 scaleSoftClip(vec3 inColor);
@@ -135,5 +137,5 @@ void main()
 	color.rgb = scaleSoftClip(color.rgb);
 	color.a = spec * sunAngle2;
 
-	gl_FragColor = color;
+	frag_color = color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
index d2f5e1987aa..e8b8513bd10 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -42,5 +44,5 @@ void main()
 		discard;
 	}
 
-	gl_FragColor = col;
+	frag_color = col;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
index 4b481ba834a..b990ce9f03d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -38,5 +40,5 @@ void main()
 {
 	vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
 	color.a *= custom_alpha;
-	gl_FragColor = color;
+	frag_color = color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
index 6bcc97ba188..ad05f17a307 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -24,12 +24,14 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform vec4 color;
 
 void main() 
 {
-	gl_FragColor = color;
+	frag_color = color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index f67703b8390..7e4515db406 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 #extension GL_ARB_texture_rectangle : enable
@@ -37,6 +39,6 @@ VARYING vec2 vary_texcoord1;
 
 void main() 
 {
-	gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) +
+	frag_color = texture2D(glowMap, vary_texcoord0.xy) +
 					texture2DRect(screenMap, vary_texcoord1.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index c66a6e5b481..5a5894523d8 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -38,5 +40,5 @@ void main()
 {
 	vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb;
 	
-	gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
+	frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index ecbc30f05ff..d1d140d2a66 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform vec4 color;
@@ -34,5 +36,5 @@ VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
+	frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
index 85f819f4c29..a18a3cdb50c 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
@@ -24,10 +24,12 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 void main() 
 {
-	gl_FragColor = vec4(1,1,1,1);
+	frag_color = vec4(1,1,1,1);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
index fafeb5a7b49..bfaa4774d9d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D tex0;
@@ -33,5 +35,5 @@ VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	gl_FragColor = texture2D(tex0, vary_texcoord0.xy);
+	frag_color = texture2D(tex0, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index f7901227494..5d7edf33a92 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D tex0;
@@ -36,5 +38,5 @@ void main()
 {
 	float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a;
 
-	gl_FragColor = vec4(vertex_color.rgb, alpha);
+	frag_color = vec4(vertex_color.rgb, alpha);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
index a0bb255cfaa..7a28ca847a2 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect screenMap;
@@ -36,5 +38,5 @@ VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	gl_FragColor = 	texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
+	frag_color = 	texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
index cdb48163dd4..73a58390283 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D tex0;
@@ -35,5 +37,5 @@ VARYING vec2 vary_texcoord1;
 
 void main() 
 {
-	gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
+	frag_color = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 36d6e06fc5f..8fac2862b15 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D diffuseMap;
@@ -34,5 +36,5 @@ VARYING vec4 vertex_color;
 
 void main() 
 {
-	gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
+	frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
 }
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
index 10413bdeb09..aabff3196a1 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void default_lighting()
 
 	color.rgb = scaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
index 1164e5b0a69..6e6aec8532a 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -50,6 +52,6 @@ void default_lighting()
 
 	color.rgb = scaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 735f5b38137..f9a3eb8d90f 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void default_lighting()
 
 	color.rgb = scaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
index ba99c0ed71e..a3eb1331331 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void fullbright_lighting()
 	
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index c3edc0bd708..222c6bbf0e3 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void fullbright_lighting()
 	
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
index 276fad4f448..441fcd0d7a1 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -50,6 +52,6 @@ void fullbright_lighting()
 	
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
index 4e1e664e6b5..7020fbc72b1 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -43,6 +45,6 @@ void fullbright_lighting()
 	
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index c981e9eba25..889a3e48bab 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -50,6 +52,6 @@ void fullbright_shiny_lighting()
 
 	color.a = max(color.a, vertex_color.a);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
index a4893f03599..f0727c377be 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -51,6 +53,6 @@ void fullbright_shiny_lighting()
 
 	color.a = max(color.a, vertex_color.a);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index c10cde98e0d..aac13462b39 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -23,7 +23,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -48,6 +50,6 @@ void fullbright_shiny_lighting_water()
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 	color.a = max(color.a, vertex_color.a);
 
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
index e9b26087f46..4f57b7a9f5c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
@@ -23,7 +23,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -49,6 +51,6 @@ void fullbright_shiny_lighting_water()
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 	color.a = max(color.a, vertex_color.a);
 
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
index 754b2922d97..6c277cddc14 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void fullbright_lighting_water()
 
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index 2547f9e7505..5c4bedefcc7 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void fullbright_lighting_water()
 
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
-	gl_FragColor = applyWaterFog(color);
+	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 f69b907dc75..df07071236a 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void fullbright_lighting_water()
 
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
index aa3ef8cdd91..91208bc56a2 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void fullbright_lighting_water()
 
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
index 9f1a358b538..1a0473b9e24 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
  
 VARYING vec4 vertex_color;
@@ -43,6 +45,6 @@ void default_lighting()
 
 	color.rgb = scaleSoftClip(color.rgb);
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index e9c27dbefd5..a24d8d4ecd5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -49,6 +51,6 @@ void shiny_lighting()
 
 	color.rgb = scaleSoftClip(color.rgb);
 	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
index 595ad743650..16f64633ac4 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
  
 VARYING vec4 vertex_color;
@@ -50,6 +52,6 @@ void shiny_lighting()
 
 	color.rgb = scaleSoftClip(color.rgb);
 	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index 68c727d62c4..cf781497332 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -46,6 +48,6 @@ void shiny_lighting_water()
 
 	color.rgb = atmosLighting(color.rgb);
 	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
index f32b9e1958b..97531fd9376 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -47,6 +49,6 @@ void shiny_lighting_water()
 
 	color.rgb = atmosLighting(color.rgb);
 	color.a = max(color.a, vertex_color.a);
-	gl_FragColor = applyWaterFog(color);
+	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 103dd633c92..4fcdad09fc2 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -46,6 +48,6 @@ void default_lighting_water()
 
 	color.rgb = atmosLighting(color.rgb);
 
-	gl_FragColor = applyWaterFog(color);
+	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 bef72752daf..d235ed2491c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -50,6 +52,6 @@ void default_lighting_water()
 
 	color = applyWaterFog(color);
 	
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index e9537d1e9d5..c2955790280 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -24,8 +24,10 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
-#endif 
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
+#endif
 
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
@@ -39,6 +41,6 @@ void default_lighting_water()
 
 	color.rgb = atmosLighting(color.rgb);
 
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
index 8b0c25b7053..5a5cc2c821f 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void default_lighting_water()
 
 	color.rgb = atmosLighting(color.rgb);
 
-	gl_FragColor = applyWaterFog(color);
+	frag_color = applyWaterFog(color);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index 4b85d61aca8..df6130cc584 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2D texture0;
@@ -38,5 +40,5 @@ void main()
 	float tex0 = texture2D(texture0, vary_texcoord0.xy).a;
 	float tex1 = texture2D(texture1, vary_texcoord1.xy).a;
 
-	gl_FragColor = vec4(tex0+(1.0-tex1)-0.5);
+	frag_color = vec4(tex0+(1.0-tex1)-0.5);
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index 3c6e22b2959..6358fdfeae3 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -24,7 +24,9 @@
  */
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform float minimum_alpha;
@@ -42,5 +44,5 @@ void main()
 		discard;
 	}
 
-	gl_FragColor = color;
+	frag_color = color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
index a95c9e0ab9e..a0f513d73d1 100644
--- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
@@ -23,9 +23,9 @@
  * $/LicenseInfo$
  */
 
-ATTRIBUTE float texture_index;
+ATTRIBUTE uvec4 texture_index;
 
-VARYING float vary_texture_index;
+VARYING_FLAT uvec4 vary_texture_index;
 
 void passTextureIndex()
 {
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 1179b212aeb..373a6c157b3 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -125,6 +127,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index 0df557f2aad..04460ea7c07 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRectShadow shadowMap0;
@@ -138,6 +140,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	gl_FragColor = color;	
+	frag_color = color;	
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 331dbc70793..c50145f7538 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRectShadow shadowMap0;
@@ -137,6 +139,6 @@ void main()
 
 	color.rgb += diff.rgb * vary_pointlight_col.rgb;
 
-	gl_FragColor = color;
+	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 14a683971a4..7d78a888a59 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -253,6 +255,6 @@ void main()
 		}
 	}
 	
-	gl_FragColor.rgb = col;	
-	gl_FragColor.a = 0.0;
+	frag_color.rgb = col;	
+	frag_color.a = 0.0;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 27ea77b5a2d..f73163898ec 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 uniform sampler2DRect diffuseRect;
@@ -330,6 +332,6 @@ void main()
 		col = diffuse.rgb;
 	}
 		
-	gl_FragColor.rgb = col;
-	gl_FragColor.a = bloom;
+	frag_color.rgb = col;
+	frag_color.a = bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 31bd0c79dab..7cc621b1f69 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 VARYING vec4 vertex_color;
@@ -201,6 +203,6 @@ void main()
 		}
 	}
 	
-	gl_FragColor.rgb = col;	
-	gl_FragColor.a = 0.0;
+	frag_color.rgb = col;	
+	frag_color.a = 0.0;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 229c2f4b675..a92a9fc8e83 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -26,7 +26,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 //class 2, shadows, no SSAO
@@ -129,7 +131,7 @@ void main()
 	
 	/*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL
 	{
-		gl_FragColor = vec4(0.0); // doesn't matter
+		frag_color = vec4(0.0); // doesn't matter
 		return;
 	}*/
 	
@@ -198,19 +200,19 @@ void main()
 		shadow = 1.0;
 	}
 	
-	gl_FragColor[0] = shadow;
-	gl_FragColor[1] = 1.0;
+	frag_color[0] = shadow;
+	frag_color[1] = 1.0;
 	
 	spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0);
 	
 	//spotlight shadow 1
 	vec4 lpos = shadow_matrix[4]*spos;
-	gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); 
+	frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8); 
 	
 	//spotlight shadow 2
 	lpos = shadow_matrix[5]*spos;
-	gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); 
+	frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8); 
 
-	//gl_FragColor.rgb = pos.xyz;
-	//gl_FragColor.b = shadow;
+	//frag_color.rgb = pos.xyz;
+	//frag_color.b = shadow;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 6b420833b95..45b8db5adcf 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -25,7 +25,9 @@
 #extension GL_ARB_texture_rectangle : enable
 
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 //class 2 -- shadows and SSAO
@@ -190,7 +192,7 @@ void main()
 	
 	/*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL
 	{
-		gl_FragColor = vec4(0.0); // doesn't matter
+		frag_color = vec4(0.0); // doesn't matter
 		return;
 	}*/
 	
@@ -259,19 +261,19 @@ void main()
 		shadow = 1.0;
 	}
 	
-	gl_FragColor[0] = shadow;
-	gl_FragColor[1] = calcAmbientOcclusion(pos, norm);
+	frag_color[0] = shadow;
+	frag_color[1] = calcAmbientOcclusion(pos, norm);
 	
 	spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0);
 	
 	//spotlight shadow 1
 	vec4 lpos = shadow_matrix[4]*spos;
-	gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); 
+	frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8); 
 	
 	//spotlight shadow 2
 	lpos = shadow_matrix[5]*spos;
-	gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); 
+	frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8); 
 
-	//gl_FragColor.rgb = pos.xyz;
-	//gl_FragColor.b = shadow;
+	//frag_color.rgb = pos.xyz;
+	//frag_color.b = shadow;
 }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index 4ab06c6e21f..c8d89095d89 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 /////////////////////////////////////////////////////////////////////////
@@ -96,7 +98,7 @@ void main()
 	color *= 2.;
 
 	/// Gamma correct for WL (soft clip effect).
-	gl_FragColor.rgb = scaleSoftClip(color.rgb);
-	gl_FragColor.a = alpha1;
+	frag_color.rgb = scaleSoftClip(color.rgb);
+	frag_color.a = alpha1;
 }
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
index c9d96b2cf46..4aece6e0323 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -24,7 +24,9 @@
  */
  
 #ifdef DEFINE_GL_FRAGCOLOR
-out vec4 gl_FragColor;
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor;
 #endif
 
 /////////////////////////////////////////////////////////////////////////
@@ -57,7 +59,7 @@ void main()
 	color *= 2.;
 
 	/// Gamma correct for WL (soft clip effect).
-	gl_FragColor.rgb = scaleSoftClip(color.rgb);
-	gl_FragColor.a = 1.0;
+	frag_color.rgb = scaleSoftClip(color.rgb);
+	frag_color.a = 1.0;
 }
 
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index cd33a19a2a8..838e5411459 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1742,14 +1742,22 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 
 		LLVector4a texIdx;
 
-		F32 index = (F32) (mTextureIndex < 255 ? mTextureIndex : 0);
+		U8 index = mTextureIndex < 255 ? mTextureIndex : 0;
+
+		F32 val = 0.f;
+		U8* vp = (U8*) &val;
+		vp[0] = index;
+		vp[1] = 0;
+		vp[2] = 0;
+		vp[3] = 0;
+
 		llassert(index <= LLGLSLShader::sIndexedTextureChannels-1);
 
 		LLVector4Logical mask;
 		mask.clear();
 		mask.setElement<3>();
 		
-		texIdx.set(0,0,0,index);
+		texIdx.set(0,0,0,val);
 
 		{
 			LLFastTimer t(FTM_FACE_POSITION_STORE);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 6db21386887..36a402e05e3 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -416,6 +416,7 @@ void LLViewerShaderMgr::setShaders()
 	LLGLSLShader::sNoFixedFunction = false;
 	LLVertexBuffer::unbind();
 	if (LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") 
+		&& (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10)
 		&& gSavedSettings.getBOOL("VertexShaderEnable"))
 	{
 		//using shaders, disable fixed function
@@ -741,7 +742,10 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 	shaders.push_back( make_pair( "windlight/atmosphericsV.glsl",			mVertexShaderLevel[SHADER_WINDLIGHT] ) );
 	shaders.push_back( make_pair( "avatar/avatarSkinV.glsl",				1 ) );
 	shaders.push_back( make_pair( "avatar/objectSkinV.glsl",				1 ) );
-	shaders.push_back( make_pair( "objects/indexedTextureV.glsl",			1 ) );
+	if (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)
+	{
+		shaders.push_back( make_pair( "objects/indexedTextureV.glsl",			1 ) );
+	}
 	shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl",		1 ) );
 
 	// We no longer have to bind the shaders to global glhandles, they are automatically added to a map now.
@@ -758,11 +762,11 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
 	// (in order of shader function call depth for reference purposes, deepest level first)
 
 	shaders.clear();
-	S32 ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
+	S32 ch = 1;
 
-	if (gGLManager.mGLVersion < 3.1f)
-	{ //force to 1 texture index channel for old drivers
-		ch = 1;
+	if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
+	{ //use indexed texture rendering for GLSL >= 1.30
+		ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 	}
 
 	std::vector<S32> index_channels;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 63542307965..4d50a920d9e 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4714,11 +4714,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 		buffer_index = -1;
 	}
 
-	S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity
+	S32 texture_index_channels = 1;
 	
-	if (gGLManager.mGLVersion < 3.1f)
+	if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
 	{
-		texture_index_channels = 1;
+		texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity;
 	}
 
 	if (LLPipeline::sRenderDeferred && distance_sort)
-- 
GitLab


From d245dad7ddbac36b013c70326ad25eb9247784f6 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 10 Feb 2012 18:05:07 -0800
Subject: [PATCH 767/933] EXP-1863 : Fix the filtering of cut folders, also fix
 the move to trash of folders in double cut scenarios

---
 indra/newview/llfolderview.cpp      | 13 ++++-
 indra/newview/llinventoryfilter.cpp | 77 ++++++++++-------------------
 indra/newview/llinventoryfilter.h   |  5 +-
 indra/newview/llinventorypanel.cpp  |  3 +-
 4 files changed, 42 insertions(+), 56 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 51a5839b75d..0abfa9db8e9 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1028,7 +1028,18 @@ void LLFolderView::removeCutItems()
 		 ++iter)
 	{
 		const LLUUID& item_id = (*iter);
-		remove_item(&gInventory, item_id);
+		LLInventoryObject *obj = gInventory.getObject(item_id);
+		if (obj)
+		{
+			if (LLAssetType::AT_CATEGORY == obj->getType())
+			{
+				remove_category(&gInventory, item_id);
+			}
+			else
+			{
+				remove_item(&gInventory, item_id);
+			}
+		}
 	}
 }
 
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 808b7619eb5..f3d4667034e 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -97,13 +97,16 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item)
 	}
 
 	mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos;
+	const LLFolderViewEventListener* listener = item->getListener();
 
 	const BOOL passed_filtertype = checkAgainstFilterType(item);
 	const BOOL passed_permissions = checkAgainstPermissions(item);
 	const BOOL passed_filterlink = checkAgainstFilterLinks(item);
+	const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE);
 	const BOOL passed = (passed_filtertype &&
 						 passed_permissions &&
 						 passed_filterlink &&
+						 passed_clipboard &&
 						 (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos));
 
 	return passed;
@@ -115,8 +118,10 @@ bool LLInventoryFilter::check(const LLInventoryItem* item)
 
 	const bool passed_filtertype = checkAgainstFilterType(item);
 	const bool passed_permissions = checkAgainstPermissions(item);
+	const BOOL passed_clipboard = checkAgainstClipboard(item->getUUID());
 	const bool passed = (passed_filtertype &&
 						 passed_permissions &&
+						 passed_clipboard &&
 						 (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos));
 
 	return passed;
@@ -145,7 +150,10 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
 			return false;
 	}
 
-	return true;
+	// Always check against the clipboard
+	const BOOL passed_clipboard = checkAgainstClipboard(folder_id);
+
+	return passed_clipboard;
 }
 
 BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const
@@ -238,31 +246,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 		}
 	}
 
-	////////////////////////////////////////////////////////////////////////////////
-	// FILTERTYPE_CLIPBOARD
-	// Pass if this item is not on the clipboard or is not a descendant of a folder 
-	// which is on the clipboard
-	if (filterTypes & FILTERTYPE_CLIPBOARD)
-	{
-		if (LLClipboard::getInstance()->isCutMode())
-		{
-			LLUUID current_id = object_id;
-			LLInventoryObject *current_object = gInventory.getObject(object_id);
-			while (current_id.notNull())
-			{
-				if (LLClipboard::getInstance()->isOnClipboard(current_id))
-				{
-					return FALSE;
-				}
-				current_id = current_object->getParentUUID();
-				if (current_id.notNull())
-				{
-					current_object = gInventory.getObject(current_id);
-				}
-			}
-		}
-	}
-		
 	return TRUE;
 }
 
@@ -323,31 +306,30 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
 			return false;
 	}
 
-	////////////////////////////////////////////////////////////////////////////////
-	// FILTERTYPE_CLIPBOARD
-	// Pass if this item is not on the clipboard or is not a descendant of a folder 
-	// which is on the clipboard
-	if (filterTypes & FILTERTYPE_CLIPBOARD)
+	return true;
+}
+
+// Items and folders that are on the clipboard or, recursively, in a folder which  
+// is on the clipboard must be filtered out if the clipboard is in the "cut" mode.
+bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const
+{
+	if (LLClipboard::getInstance()->isCutMode())
 	{
-		if (LLClipboard::getInstance()->isCutMode())
+		LLUUID current_id = object_id;
+		LLInventoryObject *current_object = gInventory.getObject(object_id);
+		while (current_id.notNull())
 		{
-			LLUUID current_id = object_id;
-			LLInventoryObject *current_object = gInventory.getObject(object_id);
-			while (current_id.notNull())
+			if (LLClipboard::getInstance()->isOnClipboard(current_id))
 			{
-				if (LLClipboard::getInstance()->isOnClipboard(current_id))
-				{
-					return false;
-				}
-				current_id = current_object->getParentUUID();
-				if (current_id.notNull())
-				{
-					current_object = gInventory.getObject(current_id);
-				}
+				return false;
+			}
+			current_id = current_object->getParentUUID();
+			if (current_id.notNull())
+			{
+				current_object = gInventory.getObject(current_id);
 			}
 		}
 	}
-
 	return true;
 }
 
@@ -501,11 +483,6 @@ void LLInventoryFilter::setFilterEmptySystemFolders()
 	mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
 }
 
-void LLInventoryFilter::setFilterClipboard()
-{
-	mFilterOps.mFilterTypes |= FILTERTYPE_CLIPBOARD;
-}
-
 void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
 {
 	if (mFilterOps.mFilterUUID == LLUUID::null)
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index fb4f84b139f..1ac90788b20 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -59,8 +59,7 @@ class LLInventoryFilter
 		FILTERTYPE_UUID	= 0x1 << 2,		// find the object with UUID and any links to it
 		FILTERTYPE_DATE = 0x1 << 3,		// search by date range
 		FILTERTYPE_WEARABLE = 0x1 << 4,	// search by wearable type
-		FILTERTYPE_EMPTYFOLDERS = 0x1 << 5,	// pass if folder is not a system folder to be hidden if empty
-		FILTERTYPE_CLIPBOARD = 0x1 << 6	// pass if item is not on the clipboard
+		FILTERTYPE_EMPTYFOLDERS = 0x1 << 5	// pass if folder is not a system folder to be hidden if empty
 	};
 
 	enum EFilterLink
@@ -92,7 +91,6 @@ class LLInventoryFilter
 	void 				setFilterUUID(const LLUUID &object_id);
 	void				setFilterWearableTypes(U64 types);
 	void				setFilterEmptySystemFolders();
-	void				setFilterClipboard();
 	void				updateFilterTypes(U64 types, U64& current_types);
 
 	void 				setFilterSubString(const std::string& string);
@@ -125,6 +123,7 @@ class LLInventoryFilter
 	BOOL 				checkAgainstPermissions(const LLFolderViewItem* item) const;
 	bool 				checkAgainstPermissions(const LLInventoryItem* item) const;
 	BOOL 				checkAgainstFilterLinks(const LLFolderViewItem* item) const;
+	bool				checkAgainstClipboard(const LLUUID& object_id) const;
 
 	std::string::size_type getStringMatchOffset() const;
 
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 27f97ad26f7..4508e7e083d 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -248,8 +248,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 		getFilter()->setFilterEmptySystemFolders();
 	}
 	
-	// hide items that are on the clipboard
-	getFilter()->setFilterClipboard();
+	// keep track of the clipboard state so that we avoid filtering too much
 	mClipboardState = LLClipboard::getInstance()->getState();
 	
 	// Initialize base class params.
-- 
GitLab


From 51a8134f62ff0705ede2534945e808ccbd9d6b7e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 10 Feb 2012 20:09:48 -0800
Subject: [PATCH 768/933] EXP-1885 FIX Viewer crashes when receiving multiple
 inventory offer notifications

---
 indra/newview/llscreenchannel.cpp | 10 +++++++++-
 indra/newview/lltoast.cpp         | 13 ++++++++-----
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index a0f146e506b..d340b304ca8 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -798,6 +798,7 @@ void LLScreenChannel::showToastsTop()
 	}
 
 	// Dismiss toasts we don't have space for (STORM-391).
+	std::vector<LLToast*> toasts_to_hide;
 	if(it != mToastList.rend())
 	{
 		mHiddenToastsNum = 0;
@@ -806,10 +807,17 @@ void LLScreenChannel::showToastsTop()
 			LLToast* toast = it->getToast();
 			if (toast)
 			{
-				toast->hide();
+				toasts_to_hide.push_back(toast);
 			}
 		}
 	}
+
+	for (std::vector<LLToast*>::iterator it = toasts_to_hide.begin(), end_it = toasts_to_hide.end();
+		it != end_it;
+		++it)
+	{
+		(*it)->hide();
+	}
 }
 
 //--------------------------------------------------------------------------
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index cdc611f7af6..0eec7f0afd1 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -180,11 +180,14 @@ LLToast::~LLToast()
 //--------------------------------------------------------------------------
 void LLToast::hide()
 {
-	setVisible(FALSE);
-	setFading(false);
-	mTimer->stop();
-	mIsHidden = true;
-	mOnFadeSignal(this); 
+	if (!mIsHidden)
+	{
+		setVisible(FALSE);
+		setFading(false);
+		mTimer->stop();
+		mIsHidden = true;
+		mOnFadeSignal(this); 
+	}
 }
 
 void LLToast::onFocusLost()
-- 
GitLab


From 47425d67fe032804d8a10123cd1a7daf9bff84f7 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 13 Feb 2012 17:12:03 +0200
Subject: [PATCH 769/933] EXP-1882 FIXED Crashes when invoking avatar picker
 from mouse look mode.

Fixing the cases missed in EXP-1879.
---
 indra/newview/llavataractions.cpp     |  5 +++++
 indra/newview/llfloatergodtools.cpp   |  6 +++++-
 indra/newview/llfloaterland.cpp       | 14 ++++++++++++--
 indra/newview/llfloaterregioninfo.cpp | 10 ++++++++--
 indra/newview/llfloaterreporter.cpp   |  6 +++++-
 indra/newview/llfloatersellland.cpp   |  6 +++++-
 indra/newview/llpanelgroupinvite.cpp  | 12 ++++++------
 7 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 9a7cdcfa21b..f618af95367 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -738,6 +738,11 @@ void LLAvatarActions::shareWithAvatars()
 
 	LLFloaterAvatarPicker* picker =
 		LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE);
+	if (!picker)
+	{
+		return;
+	}
+
 	picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable));
 	picker->openFriendsTab();
 	LLNotificationsUtil::add("ShareNotification");
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index a34e0353ec5..fb905eae116 100644
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -1123,8 +1123,12 @@ bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const
 
 void LLPanelObjectTools::onClickSet()
 {
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2));
 	// grandparent is a floater, which can have a dependent
-	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2)));
+	if (picker)
+	{
+		gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+	}
 }
 
 void LLPanelObjectTools::onClickSetBySelection(void* data)
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 95da8ff948b..ee18c95b347 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2739,7 +2739,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
 
 void LLPanelLandAccess::onClickAddAccess()
 {
-	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)) );
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
+		boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1));
+	if (picker)
+	{
+		gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+	}
 }
 
 void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids)
@@ -2783,7 +2788,12 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data)
 // static
 void LLPanelLandAccess::onClickAddBanned()
 {
-	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1)));
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
+		boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1));
+	if (picker)
+	{
+		gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+	}
 }
 
 // static
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 676059779c7..1f746ed31ab 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -650,7 +650,10 @@ void LLPanelRegionGeneralInfo::onClickKick()
 	// in order to set up floater dependency
 	LLFloater* parent_floater = gFloaterView->getParentFloater(this);
 	LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1), FALSE, TRUE);
-	parent_floater->addDependentFloater(child_floater);
+	if (child_floater)
+	{
+		parent_floater->addDependentFloater(child_floater);
+	}
 }
 
 void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids)
@@ -1470,7 +1473,10 @@ void LLPanelEstateInfo::onClickKickUser()
 	// in order to set up floater dependency
 	LLFloater* parent_floater = gFloaterView->getParentFloater(this);
 	LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1), FALSE, TRUE);
-	parent_floater->addDependentFloater(child_floater);
+	if (child_floater)
+	{
+		parent_floater->addDependentFloater(child_floater);
+	}
 }
 
 void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids)
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index c08848b1ea4..3ec1e372eb1 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -285,7 +285,11 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
 
 void LLFloaterReporter::onClickSelectAbuser()
 {
-	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE ));
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE );
+	if (picker)
+	{
+		gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+	}
 }
 
 void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names)
diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp
index 3434841d09b..64c0dfa0236 100644
--- a/indra/newview/llfloatersellland.cpp
+++ b/indra/newview/llfloatersellland.cpp
@@ -392,8 +392,12 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata)
 
 void LLFloaterSellLandUI::doSelectAgent()
 {
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE);
 	// grandparent is a floater, in order to set up dependency
-	addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE));
+	if (picker)
+	{
+		addDependentFloater(picker);
+	}
 }
 
 void LLFloaterSellLandUI::callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName> names)
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index ca48e8561b1..7a15d931811 100644
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -289,12 +289,12 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata)
 		//Soon the avatar picker will be embedded into this panel
 		//instead of being it's own separate floater.  But that is next week.
 		//This will do for now. -jwolk May 10, 2006
-		LLFloater* parentp;
-
-		parentp = gFloaterView->getParentFloater(panelp);
-		parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1,
-																panelp->mImplementation),
-																 TRUE));
+		LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
+			boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE);
+		if (picker)
+		{
+			gFloaterView->getParentFloater(panelp)->addDependentFloater(picker);
+		}
 	}
 }
 
-- 
GitLab


From 12b4862330adcaca275967d45e97395ef7709c8f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 13 Feb 2012 19:57:35 +0200
Subject: [PATCH 770/933] EXP-1832 FIXED Viewer Size not persistent across
 logins.

Symptoms: Viewer window shrank by a few pixels on each startup.
Reason:   We used client rect (which did not include the window border) to create the viewer window.
Solution: Convert client rect into window rect, i.e. expand it by the border size.
---
 indra/llwindow/llwindowwin32.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index ebc3203f14e..3a3e4a90dd6 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -886,7 +886,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 	DWORD	current_refresh;
 	DWORD	dw_ex_style;
 	DWORD	dw_style;
-	RECT	window_rect;
+	RECT	window_rect = {0, 0, 0, 0};
 	S32 width = size.mX;
 	S32 height = size.mY;
 	BOOL auto_show = FALSE;
@@ -985,9 +985,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 			window_rect.bottom = (long) height;
 			dw_ex_style = WS_EX_APPWINDOW;
 			dw_style = WS_POPUP;
-
-			// Move window borders out not to cover window contents
-			AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
 		}
 		// If it failed, we don't want to run fullscreen
 		else
@@ -1014,6 +1011,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		dw_style = WS_OVERLAPPEDWINDOW;
 	}
 
+	// Move window borders out not to cover window contents.
+	// This converts client rect to window rect, i.e. expands it by the window border size.
+	AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
+
 	// don't post quit messages when destroying old windows
 	mPostQuit = FALSE;
 
-- 
GitLab


From 632c8c138c94fae24729ef75ac29967cd4758eb3 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 13 Feb 2012 10:09:33 -0800
Subject: [PATCH 771/933] EXP-1863 : Add comment and dead code cleanup

---
 indra/newview/llinventorybridge.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1fa6820d2de..eb0f9803b0b 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1778,9 +1778,9 @@ BOOL LLFolderBridge::isUpToDate() const
 
 BOOL LLFolderBridge::isItemCopyable() const
 {
+	// Folders are always copyable as they have no permissions attached to them as items.
+	// The story is different of course for items within folders.
 	return TRUE;
-	// Can copy folders to paste-as-link, but not for straight paste.
-	//return gSavedSettings.getBOOL("InventoryLinking");
 }
 
 BOOL LLFolderBridge::isClipboardPasteable() const
-- 
GitLab


From 76a27f5100666739aae53c0988318a6dae647666 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 13:55:51 -0600
Subject: [PATCH 772/933] SH-2964 Fix for shader compilation error on some
 older NVIDIA cards.

---
 indra/llrender/llshadermgr.cpp                                | 4 ++--
 .../app_settings/shaders/class1/objects/indexedTextureV.glsl  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 321b1391811..269f78c8cd2 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -663,7 +663,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		.
 		uniform sampler2D texN;
 		
-		VARYING uvec4 vary_texture_index;
+		VARYING ivec4 vary_texture_index;
 
 		vec4 diffuseLookup(vec2 texcoord)
 		{
@@ -691,7 +691,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 
 		if (texture_index_channels > 1)
 		{
-			text[count++] = strdup("VARYING_FLAT uvec4 vary_texture_index;\n");
+			text[count++] = strdup("VARYING_FLAT ivec4 vary_texture_index;\n");
 		}
 
 		text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n");
diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
index a0f513d73d1..7c0699d72f7 100644
--- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
@@ -23,9 +23,9 @@
  * $/LicenseInfo$
  */
 
-ATTRIBUTE uvec4 texture_index;
+ATTRIBUTE ivec4 texture_index;
 
-VARYING_FLAT uvec4 vary_texture_index;
+VARYING_FLAT ivec4 vary_texture_index;
 
 void passTextureIndex()
 {
-- 
GitLab


From 80505ddf68c8a0a962a720a1c1d2a894df47157f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 15:02:07 -0600
Subject: [PATCH 773/933] SH-2908 Fix for linux build.

---
 indra/llrender/llgl.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 79d4415117f..e855dda57d4 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -344,7 +344,6 @@ PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB = NULL;
 PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB = NULL;
 PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB = NULL;
 PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB = NULL;
-PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
 PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB = NULL;
 PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB = NULL;
 PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL;
-- 
GitLab


From 001e32074d4fbc5d115c9a2fa1cb5de4b5932731 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 15:32:15 -0600
Subject: [PATCH 774/933] SH-2908 More linux build fixes.

---
 indra/newview/pipeline.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c8a8b910ea5..ce3a4893bf0 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6643,8 +6643,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
 				mDeferredLight.flush();
 			}
 
-			U32 dof_width = mScreen.getWidth()*CameraDoFResScale;
-			U32 dof_height = mScreen.getHeight()*CameraDoFResScale;
+			U32 dof_width = (U32) (mScreen.getWidth()*CameraDoFResScale);
+			U32 dof_height = (U32) (mScreen.getHeight()*CameraDoFResScale);
 			
 			{ //perform DoF sampling at half-res (preserve alpha channel)
 				mScreen.bindTarget();
-- 
GitLab


From 64c89ee2c51c539d38d4d55807b18172d6606514 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 15:41:21 -0600
Subject: [PATCH 775/933] SH-2908 Fix for mac build

---
 indra/llrender/llgl.cpp           | 9 +++++++++
 indra/llrender/llvertexbuffer.cpp | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index e855dda57d4..197bc2b422d 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -561,6 +561,15 @@ bool LLGLManager::initGL()
 	if (mGLVersion >= 2.f)
 	{
 		parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor);
+
+#if LL_DARWIN
+		//never use GLSL greater than 1.20 on OSX
+		if (mGLSLVersionMajor > 1 || mGLSLVersionMinor >= 30)
+		{
+			mGLSLVersionMajor = 1;
+			mGLSLVersionMinor = 20;
+		}
+#endif
 	}
 
 	// Trailing space necessary to keep "nVidia Corpor_ati_on" cards
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index b2438ef8247..a7f01706584 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1264,11 +1264,13 @@ void LLVertexBuffer::setupVertexArray()
 
 			if (attrib_integer)
 			{
+#if !LL_DARWIN
 				//glVertexattribIPointer requires GLSL 1.30 or later
 				if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
 				{
 					glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]); 
 				}
+#endif
 			}
 			else
 			{
@@ -2258,9 +2260,11 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
 		if (data_mask & MAP_TEXTURE_INDEX && 
 				(gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later
 		{
+#if !LL_DARWIN
 			S32 loc = TYPE_TEXTURE_INDEX;
 			void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
 			glVertexAttribIPointer(loc, 4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
+#endif
 		}
 		if (data_mask & MAP_VERTEX)
 		{
-- 
GitLab


From 03c002641ed1720f07a8c704219abd704a369043 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Mon, 13 Feb 2012 15:43:47 -0800
Subject: [PATCH 776/933] EXP-1888 FIX -- Update text for emtpy Received Items
 folder in the Viewer

---
 indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 2 +-
 indra/newview/skins/default/xui/en/strings.xml             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index fcba937bdbb..29aa6d10395 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -112,7 +112,7 @@
                         bg_opaque_color="InventoryBackgroundColor"
                         background_visible="true"
                         background_opaque="true"
-                        tool_tip="Drag and drop items to your inventory to manage and use them"
+                        tool_tip="Drag and drop items to your inventory to use them"
                         >
                         <text
 							name="inbox_inventory_placeholder"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3351ffe00fb..c82f99ffe6e 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2037,7 +2037,7 @@ Returns a string with the requested data about the region
 	<string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string>
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
-	<string name="InventoryInboxNoItems">Certain items you receive, such as premium gifts, will appear here.  You may then drag them into your inventory.</string>
+	<string name="InventoryInboxNoItems">Certain items you receive, such as Marketplace purchases and objects shared with you in world, will appear here. You may then drag them into your inventory to use them.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
 	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
-- 
GitLab


From e8b8be637bf63f4ff530c2ec6d0abb89da50035f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 13 Feb 2012 15:53:41 -0800
Subject: [PATCH 777/933] Fix Linux compile issue : make templated type casting
 explicit

---
 indra/llmath/llcoord.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h
index 1f617e649e9..533aa2978b4 100644
--- a/indra/llmath/llcoord.h
+++ b/indra/llmath/llcoord.h
@@ -45,7 +45,7 @@ class LLCoord : protected COORD_FRAME
 
 	LLCoord():	mX(0), mY(0)
 	{}
-	LLCoord(S32 x, S32 y): mX(x), mY(y)
+	LLCoord(S32 x, S32 y): mX((typename COORD_FRAME::value_t)(x)), mY((typename COORD_FRAME::value_t)(y))
 	{}
 
 	LLCoord(const LLCoordCommon& other)
-- 
GitLab


From 3267b42ee521a7a059e0e87cba75a3d32af678e5 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 18:26:48 -0600
Subject: [PATCH 778/933] SH-2908 Temporary fix for mac build

---
 indra/llrender/llglslshader.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index a879a188950..4b7e639aed3 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -109,7 +109,9 @@ void LLGLSLShader::unload()
 		glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
 		for (GLsizei i = 0; i < count; i++)
 		{
+#if !LL_DARWIN
 			if (glIsProgramARB(obj[i]))
+#endif
 			{
 				glDeleteObjectARB(obj[i]);
 			}
-- 
GitLab


From 5c8bcc4643e8f2e02c96847e3eeeced0d2b4157a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 13 Feb 2012 16:39:35 -0800
Subject: [PATCH 779/933] Fix Linux compile issue : make templated type casting
 explicit (2)

---
 indra/llmath/llcoord.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h
index 533aa2978b4..756e23dbdf4 100644
--- a/indra/llmath/llcoord.h
+++ b/indra/llmath/llcoord.h
@@ -45,7 +45,7 @@ class LLCoord : protected COORD_FRAME
 
 	LLCoord():	mX(0), mY(0)
 	{}
-	LLCoord(S32 x, S32 y): mX((typename COORD_FRAME::value_t)(x)), mY((typename COORD_FRAME::value_t)(y))
+	LLCoord(typename COORD_FRAME::value_t x, typename COORD_FRAME::value_t y): mX(x), mY(y)
 	{}
 
 	LLCoord(const LLCoordCommon& other)
@@ -58,7 +58,7 @@ class LLCoord : protected COORD_FRAME
 		return COORD_FRAME::convertToCommon();
 	}
 
-	void set(S32 x, S32 y) { mX = x; mY = y;}
+	void set(typename COORD_FRAME::value_t x, typename COORD_FRAME::value_t y) { mX = x; mY = y;}
 	bool operator==(const self_t& other) const { return mX == other.mX && mY == other.mY; }
 	bool operator!=(const self_t& other) const { return !(*this == other); }
 
-- 
GitLab


From 7206160fb5d1e8ef2e7fa4d037f34ba1633b0981 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 19:13:22 -0600
Subject: [PATCH 780/933] SH-2973 Potential fix for crash in ~LLVOAvatarSelf

---
 indra/newview/llappviewer.cpp    | 2 ++
 indra/newview/lldriverparam.cpp  | 2 +-
 indra/newview/llvoavatarself.cpp | 5 +++--
 indra/newview/llvoavatarself.h   | 2 +-
 indra/newview/llwearable.cpp     | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 49fbdbf1dff..3a257e1f1cf 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1769,6 +1769,8 @@ bool LLAppViewer::cleanup()
 
 	LLAvatarIconIDCache::getInstance()->save();
 	
+	gAgentAvatarp = NULL;
+
 	LLViewerMedia::saveCookieFile();
 
 	// Stop the plugin read thread if it's running.
diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp
index 8f47d3c5e5f..64eb11fc9b2 100644
--- a/indra/newview/lldriverparam.cpp
+++ b/indra/newview/lldriverparam.cpp
@@ -139,7 +139,7 @@ void LLDriverParamInfo::toStream(std::ostream &out)
 			}
 			else
 			{
-				llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp << " for driver parameter " << getID() << llendl;
+				llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp.get() << " for driver parameter " << getID() << llendl;
 			}
 			out << std::endl;
 		}
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index f1df67494f7..e525d6bad07 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -66,10 +66,11 @@
 
 #include <boost/lexical_cast.hpp>
 
-LLVOAvatarSelf *gAgentAvatarp = NULL;
+LLPointer<LLVOAvatarSelf> gAgentAvatarp = NULL;
+
 BOOL isAgentAvatarValid()
 {
-	return (gAgentAvatarp &&
+	return (gAgentAvatarp.notNull() &&
 			(gAgentAvatarp->getRegion() != NULL) &&
 			(!gAgentAvatarp->isDead()));
 }
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 54dbe819937..655fb3a012a 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -383,7 +383,7 @@ class LLVOAvatarSelf :
 
 };
 
-extern LLVOAvatarSelf *gAgentAvatarp;
+extern LLPointer<LLVOAvatarSelf> gAgentAvatarp;
 
 BOOL isAgentAvatarValid();
 
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index d8aa0b7d5c6..0f7f63061be 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -221,7 +221,7 @@ void LLWearable::createVisualParams()
 		param->resetDrivenParams();
 		if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
 		{
-			if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp,_1 ), true))
+			if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp.get(),_1 ), true))
 			{
 				llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
 				continue;
-- 
GitLab


From ca179444a1fb56bb42896c735b23906460c40d88 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 19:13:22 -0600
Subject: [PATCH 781/933] SH-2973 Potential fix for crash in ~LLVOAvatarSelf

---
 indra/newview/llappviewer.cpp    | 2 ++
 indra/newview/lldriverparam.cpp  | 2 +-
 indra/newview/llvoavatarself.cpp | 5 +++--
 indra/newview/llvoavatarself.h   | 2 +-
 indra/newview/llwearable.cpp     | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 49fbdbf1dff..3a257e1f1cf 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1769,6 +1769,8 @@ bool LLAppViewer::cleanup()
 
 	LLAvatarIconIDCache::getInstance()->save();
 	
+	gAgentAvatarp = NULL;
+
 	LLViewerMedia::saveCookieFile();
 
 	// Stop the plugin read thread if it's running.
diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp
index 8f47d3c5e5f..64eb11fc9b2 100644
--- a/indra/newview/lldriverparam.cpp
+++ b/indra/newview/lldriverparam.cpp
@@ -139,7 +139,7 @@ void LLDriverParamInfo::toStream(std::ostream &out)
 			}
 			else
 			{
-				llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp << " for driver parameter " << getID() << llendl;
+				llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp.get() << " for driver parameter " << getID() << llendl;
 			}
 			out << std::endl;
 		}
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index f1df67494f7..e525d6bad07 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -66,10 +66,11 @@
 
 #include <boost/lexical_cast.hpp>
 
-LLVOAvatarSelf *gAgentAvatarp = NULL;
+LLPointer<LLVOAvatarSelf> gAgentAvatarp = NULL;
+
 BOOL isAgentAvatarValid()
 {
-	return (gAgentAvatarp &&
+	return (gAgentAvatarp.notNull() &&
 			(gAgentAvatarp->getRegion() != NULL) &&
 			(!gAgentAvatarp->isDead()));
 }
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 54dbe819937..655fb3a012a 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -383,7 +383,7 @@ class LLVOAvatarSelf :
 
 };
 
-extern LLVOAvatarSelf *gAgentAvatarp;
+extern LLPointer<LLVOAvatarSelf> gAgentAvatarp;
 
 BOOL isAgentAvatarValid();
 
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index d8aa0b7d5c6..0f7f63061be 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -221,7 +221,7 @@ void LLWearable::createVisualParams()
 		param->resetDrivenParams();
 		if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
 		{
-			if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp,_1 ), true))
+			if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp.get(),_1 ), true))
 			{
 				llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
 				continue;
-- 
GitLab


From 60fa5c3d4e23967d1ecd1e5189685ca94223cfb4 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 13 Feb 2012 19:53:39 -0600
Subject: [PATCH 782/933] SH-2908 Fix for shaders failing to compile when using
 GLSL 1.20 or 1.10 profile.

---
 .../newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl  | 2 +-
 .../app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl  | 2 +-
 .../shaders/class1/deferred/alphaNonIndexedNoColorF.glsl        | 2 +-
 .../app_settings/shaders/class1/deferred/attachmentShadowF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/avatarShadowF.glsl     | 2 +-
 .../app_settings/shaders/class1/deferred/blurLightF.glsl        | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/cofF.glsl    | 2 +-
 .../app_settings/shaders/class1/deferred/dofCombineF.glsl       | 2 +-
 .../newview/app_settings/shaders/class1/deferred/emissiveF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/fullbrightF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl   | 2 +-
 .../app_settings/shaders/class1/deferred/luminanceF.glsl        | 2 +-
 .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl   | 2 +-
 .../newview/app_settings/shaders/class1/deferred/normgenF.glsl  | 2 +-
 .../app_settings/shaders/class1/deferred/pointLightF.glsl       | 2 +-
 .../app_settings/shaders/class1/deferred/postDeferredF.glsl     | 2 +-
 .../shaders/class1/deferred/postDeferredNoDoFF.glsl             | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl  | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class1/deferred/spotLightF.glsl        | 2 +-
 .../newview/app_settings/shaders/class1/deferred/sunLightF.glsl | 2 +-
 .../app_settings/shaders/class1/deferred/sunLightSSAOF.glsl     | 2 +-
 .../app_settings/shaders/class1/deferred/treeShadowF.glsl       | 2 +-
 .../app_settings/shaders/class1/effects/glowExtractF.glsl       | 2 +-
 indra/newview/app_settings/shaders/class1/effects/glowF.glsl    | 2 +-
 .../app_settings/shaders/class1/environment/terrainF.glsl       | 2 +-
 .../app_settings/shaders/class1/environment/terrainWaterF.glsl  | 2 +-
 .../app_settings/shaders/class1/environment/underWaterF.glsl    | 2 +-
 .../newview/app_settings/shaders/class1/environment/waterF.glsl | 2 +-
 .../app_settings/shaders/class1/interface/alphamaskF.glsl       | 2 +-
 .../app_settings/shaders/class1/interface/customalphaF.glsl     | 2 +-
 indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 2 +-
 .../app_settings/shaders/class1/interface/glowcombineF.glsl     | 2 +-
 .../app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 2 +-
 .../app_settings/shaders/class1/interface/highlightF.glsl       | 2 +-
 .../app_settings/shaders/class1/interface/occlusionF.glsl       | 2 +-
 .../shaders/class1/interface/onetexturenocolorF.glsl            | 2 +-
 .../app_settings/shaders/class1/interface/solidcolorF.glsl      | 2 +-
 .../shaders/class1/interface/splattexturerectF.glsl             | 2 +-
 .../app_settings/shaders/class1/interface/twotextureaddF.glsl   | 2 +-
 indra/newview/app_settings/shaders/class1/interface/uiF.glsl    | 2 +-
 .../app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl   | 2 +-
 .../shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl      | 2 +-
 indra/newview/app_settings/shaders/class1/lighting/lightF.glsl  | 2 +-
 .../shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl      | 2 +-
 .../app_settings/shaders/class1/lighting/lightFullbrightF.glsl  | 2 +-
 .../class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl    | 2 +-
 .../shaders/class1/lighting/lightFullbrightNonIndexedF.glsl     | 2 +-
 .../shaders/class1/lighting/lightFullbrightShinyF.glsl          | 2 +-
 .../class1/lighting/lightFullbrightShinyNonIndexedF.glsl        | 2 +-
 .../shaders/class1/lighting/lightFullbrightShinyWaterF.glsl     | 2 +-
 .../class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl   | 2 +-
 .../shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl | 2 +-
 .../shaders/class1/lighting/lightFullbrightWaterF.glsl          | 2 +-
 .../lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl      | 2 +-
 .../class1/lighting/lightFullbrightWaterNonIndexedF.glsl        | 2 +-
 .../app_settings/shaders/class1/lighting/lightNonIndexedF.glsl  | 2 +-
 .../app_settings/shaders/class1/lighting/lightShinyF.glsl       | 2 +-
 .../shaders/class1/lighting/lightShinyNonIndexedF.glsl          | 2 +-
 .../app_settings/shaders/class1/lighting/lightShinyWaterF.glsl  | 2 +-
 .../shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl     | 2 +-
 .../shaders/class1/lighting/lightWaterAlphaMaskF.glsl           | 2 +-
 .../shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl | 2 +-
 .../app_settings/shaders/class1/lighting/lightWaterF.glsl       | 2 +-
 .../shaders/class1/lighting/lightWaterNonIndexedF.glsl          | 2 +-
 .../newview/app_settings/shaders/class1/objects/impostorF.glsl  | 2 +-
 indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl  | 2 +-
 .../app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl  | 2 +-
 .../shaders/class2/deferred/alphaNonIndexedNoColorF.glsl        | 2 +-
 .../app_settings/shaders/class2/deferred/multiSpotLightF.glsl   | 2 +-
 .../app_settings/shaders/class2/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class2/deferred/spotLightF.glsl        | 2 +-
 .../newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 2 +-
 .../app_settings/shaders/class2/deferred/sunLightSSAOF.glsl     | 2 +-
 .../newview/app_settings/shaders/class2/windlight/cloudsF.glsl  | 2 +-
 indra/newview/app_settings/shaders/class2/windlight/skyF.glsl   | 2 +-
 79 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
index 54e2f044590..7a359052801 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 37fd63b7d5a..73f05a5dd4b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index 14ac9f1f786..bfbd30a4553 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index 654e272b067..dae1131bbb2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index b88041490ac..92e3f7f3886 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -25,7 +25,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index 594ed778e3e..3686f2f647c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index a08b018702a..f400eb7a5bc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index 3fcfbf55c45..ccbc3c557cc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index f05ea557e31..a425e5062eb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index ebe9a66bb44..6aa4d7b4ed1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 vec3 fullbrightAtmosTransport(vec3 light);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 616ffca2d11..36433a5827d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
index 76b1748813e..d93e897029e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 #define FXAA_PC 1
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index 31da124cb12..dcf474824da 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -28,7 +28,7 @@ uniform sampler2DRect diffuseMap;
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec2 vary_fragcoord;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 40dd3630614..75de47614cf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 //class 1 -- no shadows
diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
index 32881ef0429..62cfa5c3167 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D alphaMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 619b7bcd03f..a5e04fba575 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index e7b21742809..bf362e21a4d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index ed2352b51f8..eb5beeef39a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index 18550b2e12f..96f96284246 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -26,7 +26,7 @@
  #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
  
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index 7d75b50aa2a..cf8cf8364a4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index 3eb733aa517..7e55fdc12a4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 post_pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 70b0f6fbd09..b5501c28203 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index d3d6a155f0d..7ed8ed33701 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -29,7 +29,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
index aa29be09a16..5ca817aff6e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl
@@ -30,7 +30,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 void main() 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 9bee6324721..7fa666a739b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 //class 1 -- no shadow, SSAO only
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 6be66a402fb..d4d2f5f5713 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index 952706841d0..0f5eb288fd0 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 289c5b367fa..c1f6af9f577 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index 51efdd4b399..668a710c042 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index d9b5c5f7f5e..a9565623960 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 32459eff6ae..0d8dab0a419 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 0cde7d0133d..79bffab745c 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 vec3 scaleSoftClip(vec3 inColor);
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
index e8b8513bd10..f520f301d9b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
index b990ce9f03d..a96d04cc39d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
index ad05f17a307..67c6baddbbd 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform vec4 color;
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index 7e4515db406..ed803de2773 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 #extension GL_ARB_texture_rectangle : enable
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index 5a5894523d8..59520bb99f7 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index d1d140d2a66..6cc9bbbea23 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform vec4 color;
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
index a18a3cdb50c..db130e456ca 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 void main() 
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
index bfaa4774d9d..415181126b2 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D tex0;
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index 5d7edf33a92..67dc5004933 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D tex0;
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
index 7a28ca847a2..772bb374e82 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect screenMap;
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
index 73a58390283..95679e93e74 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D tex0;
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 8fac2862b15..299bfb72aa7 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
index aabff3196a1..cf29939cb23 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
index 6e6aec8532a..4070d41f478 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index f9a3eb8d90f..d6ebfcb8257 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
index a3eb1331331..6c34643aab0 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index 222c6bbf0e3..2ff7f795b05 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
index 441fcd0d7a1..f4477bd29ac 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
index 7020fbc72b1..2738ff89477 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index 889a3e48bab..777c8b45bb3 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
index f0727c377be..4fa3b1d939c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index aac13462b39..58984a42631 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -25,7 +25,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
index 4f57b7a9f5c..a39b7205d79 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl
@@ -25,7 +25,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
index 6c277cddc14..99a6fe85fe8 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index 5c4bedefcc7..df182168f3c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
index df07071236a..63f92a88440 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
index 91208bc56a2..0e68091e7cb 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
index 1a0473b9e24..0aca768021b 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
  
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index a24d8d4ecd5..52e3b2ad026 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
index 16f64633ac4..474d5ea4969 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
  
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index cf781497332..d2a4c47aac5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
index 97531fd9376..f3bd6623644 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
index 4fcdad09fc2..b68240ba0d6 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
index d235ed2491c..da3b20012d8 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index c2955790280..00609e93cd3 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
index 5a5cc2c821f..13ecb7a6368 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index 6358fdfeae3..add437d144d 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 373a6c157b3..e5edb482a93 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index 04460ea7c07..c467e6c5cbd 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRectShadow shadowMap0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index c50145f7538..8aaf87a1b5a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRectShadow shadowMap0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 7d78a888a59..f7f1f649ced 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index f73163898ec..61a7f1e32fe 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect diffuseRect;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 7cc621b1f69..99a277fbfcc 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index a92a9fc8e83..a40b29d2c46 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 //class 2, shadows, no SSAO
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 45b8db5adcf..774f70262af 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -27,7 +27,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 //class 2 -- shadows and SSAO
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index c8d89095d89..96c70651b11 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 /////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
index 4aece6e0323..e2a2367626a 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 /////////////////////////////////////////////////////////////////////////
-- 
GitLab


From 7bb8373d7cb746af8814e09373ed89c332e14619 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Tue, 14 Feb 2012 20:08:10 +0200
Subject: [PATCH 783/933] EXP-1546 FIXED (received items - purchasing some
 bodyparts and clothing from a prim marked for sale show wrong inventory
 icons)

- In buy floater, for multiple WEARABLES inventory items show corresponding wearable icons
---
 indra/newview/llfloaterbuycontents.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index a7388d21a37..bca4b5e4471 100644
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -210,7 +210,9 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
 		LLSD row;
 
 		BOOL item_is_multi = FALSE;
-		if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED )
+		if ((inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED
+			|| inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
+			&& !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK))
 		{
 			item_is_multi = TRUE;
 		}
-- 
GitLab


From d660d1ad65614068e6134ad83c4beca46415165f Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Tue, 14 Feb 2012 20:13:26 +0200
Subject: [PATCH 784/933] EXP-1890 FIXED (The "Shop" button is partially not
 clickable)

- Adjusted width of the panel which contains the shop button
---
 indra/newview/skins/default/xui/de/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/en/panel_status_bar.xml | 4 ++--
 indra/newview/skins/default/xui/es/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/fr/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/it/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/ja/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/pt/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/ru/panel_status_bar.xml | 2 +-
 indra/newview/skins/default/xui/tr/panel_status_bar.xml | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml
index 2493d60df66..14ace0ac3af 100644
--- a/indra/newview/skins/default/xui/de/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-415" name="balance_bg" width="205">
 		<text name="balance" tool_tip="Klicken, um L$-Guthaben zu aktualisieren" value="20 L$"/>
 		<button label="L$ kaufen" name="buyL" tool_tip="Hier klicken, um mehr L$ zu kaufen"/>
 		<button label="Einkaufen" name="goShop" tool_tip="Second Life-Marktplatz öffnen" width="85"/>
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index 22c1139cdb5..3aa34439f13 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -35,8 +35,8 @@
     </panel.string>
   <panel
     height="18"
-    left="-370"
-    width="160"
+    left="-395"
+    width="185"
     top="1"
     follows="right|top" 
     name="balance_bg">
diff --git a/indra/newview/skins/default/xui/es/panel_status_bar.xml b/indra/newview/skins/default/xui/es/panel_status_bar.xml
index 79b2c32b236..7eead3bc184 100644
--- a/indra/newview/skins/default/xui/es/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-410" name="balance_bg" width="200">
 		<text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Pulsa para comprar más L$"/>
 		<button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life" width="80"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
index c0d59a3182d..ba36a7d2991 100644
--- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-405" name="balance_bg" width="195">
 		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
 		<button label="Acheter L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$."/>
 		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life." width="75"/>
diff --git a/indra/newview/skins/default/xui/it/panel_status_bar.xml b/indra/newview/skins/default/xui/it/panel_status_bar.xml
index 4abc90113f4..0aaf89d8c89 100644
--- a/indra/newview/skins/default/xui/it/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/it/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-405" name="balance_bg" width="195">
 		<text name="balance" tool_tip="Clicca per aggiornare il tuo saldo in L$" value="L$ 20"/>
 		<button label="Acquista L$" name="buyL" tool_tip="Clicca per acquistare più L$"/>
 		<button label="Acquisti" name="goShop" tool_tip="Apri Mercato Second Life" width="75"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_status_bar.xml b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
index 4fb876f690b..f09643d5622 100644
--- a/indra/newview/skins/default/xui/ja/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-370" name="balance_bg" width="160">
 		<text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/>
 		<button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/>
 		<button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"  width="40"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_status_bar.xml b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
index 22853f0643c..cb9a6eb7576 100644
--- a/indra/newview/skins/default/xui/pt/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-410" name="balance_bg" width="200">
 		<text name="balance" tool_tip="Atualizar saldo de L$" value="L$20"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Comprar mais L$"/>
 		<button label="Comprar" name="goShop" tool_tip="Abrir Mercado do Second Life" width="80"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_status_bar.xml b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
index babe5811ace..9c84ff1fd89 100644
--- a/indra/newview/skins/default/xui/ru/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-450" name="balance_bg" width="240">
 		<text name="balance" tool_tip="Щелкните для обновления вашего баланса L$" value="L$20"/>
 		<button label="Купить L$" name="buyL" tool_tip="Щелкните для покупки L$"/>
 		<button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life" width="121"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_status_bar.xml b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
index 81c304a5d80..178cbda4a2e 100644
--- a/indra/newview/skins/default/xui/tr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-425" name="balance_bg" width="215">
 		<text name="balance" tool_tip="L$ bakiyenizi yenilemek için buraya tıklayın" value="L$20"/>
 		<button label="L$ Satın Al" name="buyL" tool_tip="Daha fazla L$ satın almak için tıklayın"/>
 		<button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç" width="95"/>
-- 
GitLab


From 54900461f98a57c602e624aec86338a07b825462 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Tue, 14 Feb 2012 20:15:45 +0200
Subject: [PATCH 785/933] EXP-1891 FIXED ('Vehicles' category overlays avatar
 thumnail after setting minimal width in Avatar picker floater)

- Increased min width of the floater
---
 indra/newview/skins/default/xui/en/floater_avatar.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml
index 82c34030082..defb8e2d1f0 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar.xml
@@ -7,7 +7,7 @@
  can_close="true"
  can_resize="true"
  min_height="230"
- min_width="450"
+ min_width="515"
  height="230"
  layout="topleft"
  name="Avatar"
-- 
GitLab


From 4f18f9d6bd1e11b92040fbcc5ca1c2a173d38fc9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 14 Feb 2012 16:11:30 -0600
Subject: [PATCH 786/933] SH-2908 More complete GLSL 1.20 compatibility pass.

---
 .../shaders/class1/deferred/avatarF.glsl      |  2 +-
 .../shaders/class1/deferred/bumpF.glsl        |  2 +-
 .../shaders/class1/deferred/cloudsF.glsl      |  2 +-
 .../class1/deferred/diffuseAlphaMaskF.glsl    |  2 +-
 .../deferred/diffuseAlphaMaskIndexedF.glsl    |  2 +-
 .../deferred/diffuseAlphaMaskNoColorF.glsl    |  2 +-
 .../shaders/class1/deferred/diffuseF.glsl     |  2 +-
 .../class1/deferred/diffuseIndexedF.glsl      |  2 +-
 .../shaders/class1/deferred/fxaaF.glsl        | 21 ++++++++++++-------
 .../shaders/class1/deferred/giF.glsl          |  2 +-
 .../shaders/class1/deferred/impostorF.glsl    |  2 +-
 .../class1/deferred/multiPointLightF.glsl     |  2 +-
 .../shaders/class1/deferred/skyF.glsl         |  2 +-
 .../shaders/class1/deferred/starsF.glsl       |  2 +-
 .../shaders/class1/deferred/terrainF.glsl     |  2 +-
 .../shaders/class1/deferred/treeF.glsl        |  2 +-
 .../shaders/class1/deferred/waterF.glsl       |  2 +-
 .../shaders/class1/objects/bumpF.glsl         |  2 +-
 indra/newview/llviewershadermgr.cpp           |  6 ++++++
 19 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index 4912c9a50c5..46d2aa4877e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
index 141738023d7..680eadb8524 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index d2afc148b12..1d8ca04ccd3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -27,7 +27,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 /////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index c8acaee1349..b2027d3a5d0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index d960cbc2fe8..ead384b07c1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 VARYING vec3 vary_normal;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index b1c9b525699..f73fa6f2310 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -27,7 +27,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index caefe84957a..227aa2aae3c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index c89f3899548..d442e5403a4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 VARYING vec3 vary_normal;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
index d93e897029e..e02a7b405b8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
@@ -343,18 +343,23 @@ A. Or use FXAA_GREEN_AS_LUMA.
     // 1 = API supports gather4 on alpha channel.
     // 0 = API does not support gather4 on alpha channel.
     //
+	#if (FXAA_GLSL_130 == 0)
+		#define FXAA_GATHER4_ALPHA 0
+	#endif
     #if (FXAA_HLSL_5 == 1)
         #define FXAA_GATHER4_ALPHA 1
     #endif
-    #ifdef GL_ARB_gpu_shader5
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
-    #ifdef GL_NV_gpu_shader5
-        #define FXAA_GATHER4_ALPHA 1
-    #endif
     #ifndef FXAA_GATHER4_ALPHA
-        #define FXAA_GATHER4_ALPHA 0
-    #endif
+		#ifdef GL_ARB_gpu_shader5
+			#define FXAA_GATHER4_ALPHA 1
+		#endif
+	    #ifdef GL_NV_gpu_shader5
+		    #define FXAA_GATHER4_ALPHA 1
+		#endif
+		#ifndef FXAA_GATHER4_ALPHA
+			#define FXAA_GATHER4_ALPHA 0
+		#endif
+	#endif
 #endif
 
 /*============================================================================
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
index 28ed70d49dc..da1b2342400 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index d7bc8d02d9d..bc0719cb82d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform float minimum_alpha;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index cd50e17d7ec..53a2a13392d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2DRect depthMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 7d80f07da44..faa54a316e8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 /////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 1cfcca4f5d9..821058804c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 VARYING vec4 vertex_color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index 021c23f76c4..8a5e482e80a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform sampler2D detail_0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index 10d8a5c3215..6cf6106b519 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index e4c655ed7de..42dc7c09807 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -28,7 +28,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_data[3];
 #else
-#define frag_data gl_FragData;
+#define frag_data gl_FragData
 #endif
 
 vec3 scaleSoftClip(vec3 inColor);
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index df6130cc584..d55f0db530b 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -26,7 +26,7 @@
 #ifdef DEFINE_GL_FRAGCOLOR
 out vec4 frag_color;
 #else
-#define frag_color gl_FragColor;
+#define frag_color gl_FragColor
 #endif
 
 uniform sampler2D texture0;
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 36a402e05e3..c84fb8facb8 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -363,6 +363,12 @@ void LLViewerShaderMgr::setShaders()
 	//NEVER use more than 16 texture channels (work around for prevalent driver bug)
 	LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16);
 
+	if (gGLManager.mGLSLVersionMajor < 1 ||
+		(gGLManager.mGLSLVersionMajor == 1 && gGLManager.mGLSLVersionMinor <= 20))
+	{ //NEVER use indexed texture rendering when GLSL version is 1.20 or earlier
+		LLGLSLShader::sIndexedTextureChannels = 1;
+	}
+
 	reentrance = true;
 
 	if (LLRender::sGLCoreProfile)
-- 
GitLab


From 54b1847b3ca7678d7c9b65e9b8e701f6f9869b98 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 14 Feb 2012 17:09:42 -0600
Subject: [PATCH 787/933] SH-2973 Rearrange shutdown operations to prevent
 crash on exit on OSX

---
 indra/newview/llappviewer.cpp    |  5 +++--
 indra/newview/llviewerwindow.cpp | 10 ++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3a257e1f1cf..1174d108d2b 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1487,6 +1487,9 @@ void LLAppViewer::flushVFSIO()
 
 bool LLAppViewer::cleanup()
 {
+	//ditch LLVOAvatarSelf instance
+	gAgentAvatarp = NULL;
+
 	// workaround for DEV-35406 crash on shutdown
 	LLEventPumps::instance().reset();
 
@@ -1769,8 +1772,6 @@ bool LLAppViewer::cleanup()
 
 	LLAvatarIconIDCache::getInstance()->save();
 	
-	gAgentAvatarp = NULL;
-
 	LLViewerMedia::saveCookieFile();
 
 	// Stop the plugin read thread if it's running.
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8a713ae22cb..e0653fec306 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2021,6 +2021,12 @@ void LLViewerWindow::shutdownGL()
 	gSky.cleanup();
 	stop_glerror();
 
+	llinfos << "Cleaning up pipeline" << llendl;
+	gPipeline.cleanup();
+	stop_glerror();
+
+	//MUST clean up pipeline before cleaning up wearables
+	llinfos << "Cleaning up wearables" << llendl;
 	LLWearableList::instance().cleanup() ;
 
 	gTextureList.shutdown();
@@ -2031,10 +2037,6 @@ void LLViewerWindow::shutdownGL()
 
 	LLWorldMapView::cleanupTextures();
 
-	llinfos << "Cleaning up pipeline" << llendl;
-	gPipeline.cleanup();
-	stop_glerror();
-
 	LLViewerTextureManager::cleanup() ;
 	LLImageGL::cleanupClass() ;
 
-- 
GitLab


From 52782548c83dc0ca0fc8352e1a3ad68784116a91 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 14 Feb 2012 17:09:42 -0600
Subject: [PATCH 788/933] SH-2973 Rearrange shutdown operations to prevent
 crash on exit on OSX

---
 indra/newview/llappviewer.cpp    |  5 +++--
 indra/newview/llviewerwindow.cpp | 10 ++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3a257e1f1cf..1174d108d2b 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1487,6 +1487,9 @@ void LLAppViewer::flushVFSIO()
 
 bool LLAppViewer::cleanup()
 {
+	//ditch LLVOAvatarSelf instance
+	gAgentAvatarp = NULL;
+
 	// workaround for DEV-35406 crash on shutdown
 	LLEventPumps::instance().reset();
 
@@ -1769,8 +1772,6 @@ bool LLAppViewer::cleanup()
 
 	LLAvatarIconIDCache::getInstance()->save();
 	
-	gAgentAvatarp = NULL;
-
 	LLViewerMedia::saveCookieFile();
 
 	// Stop the plugin read thread if it's running.
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8a713ae22cb..e0653fec306 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2021,6 +2021,12 @@ void LLViewerWindow::shutdownGL()
 	gSky.cleanup();
 	stop_glerror();
 
+	llinfos << "Cleaning up pipeline" << llendl;
+	gPipeline.cleanup();
+	stop_glerror();
+
+	//MUST clean up pipeline before cleaning up wearables
+	llinfos << "Cleaning up wearables" << llendl;
 	LLWearableList::instance().cleanup() ;
 
 	gTextureList.shutdown();
@@ -2031,10 +2037,6 @@ void LLViewerWindow::shutdownGL()
 
 	LLWorldMapView::cleanupTextures();
 
-	llinfos << "Cleaning up pipeline" << llendl;
-	gPipeline.cleanup();
-	stop_glerror();
-
 	LLViewerTextureManager::cleanup() ;
 	LLImageGL::cleanupClass() ;
 
-- 
GitLab


From 24cf1a475ab3f8d1a44163d0824f230ead72844e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 15 Feb 2012 11:00:32 -0800
Subject: [PATCH 789/933] fixed bad idiom of using statements in a ternary
 operator

---
 indra/newview/llinventoryfilter.cpp | 30 +++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 4971ded6345..21d309707af 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -539,8 +539,14 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date)
 		setModified();
 	}
 
-	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
-			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
+	if (areDateLimitsSet())
+	{
+		mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+	}
+	else
+	{
+		mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
+	}
 }
 
 void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
@@ -556,8 +562,14 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
 		setModified();
 	}
 
-	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
-			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
+	if (areDateLimitsSet())
+	{
+		mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+	}
+	else
+	{
+		mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
+	}
 }
 
 BOOL LLInventoryFilter::isSinceLogoff() const
@@ -603,8 +615,14 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
 		}
 	}
 
-	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
-			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
+	if (areDateLimitsSet())
+	{
+		mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+	}
+	else
+	{
+		mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
+	}
 }
 
 void LLInventoryFilter::setFilterLinks(U64 filter_links)
-- 
GitLab


From 0a8d6ab699471816b6129cf224d27756525660b5 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 15 Feb 2012 16:07:55 -0800
Subject: [PATCH 790/933] sync with viewer-development

---
 .../skins/default/xui/da/menu_viewer.xml      |  68 ++---
 .../default/xui/en/floater_about_land.xml     |  54 ++--
 .../default/xui/en/floater_help_browser.xml   |   1 -
 .../default/xui/en/floater_im_session.xml     |   5 +-
 .../default/xui/en/floater_media_browser.xml  |   4 -
 .../xui/en/floater_merchant_outbox.xml        | 152 +++++++++++
 .../default/xui/en/floater_model_wizard.xml   |  32 +--
 .../xui/en/floater_test_layout_stacks.xml     | 206 +++++++++++++++
 .../skins/default/xui/en/floater_toybox.xml   |  12 +-
 .../default/xui/en/floater_ui_preview.xml     |   2 +
 .../default/xui/en/floater_voice_controls.xml |   5 +-
 .../default/xui/en/floater_web_content.xml    |   5 +-
 .../skins/default/xui/en/main_view.xml        |   2 -
 .../xui/en/menu_inspect_object_gear.xml       |   9 +
 .../skins/default/xui/en/menu_inventory.xml   |   6 +-
 .../default/xui/en/menu_inventory_add.xml     |   1 +
 .../skins/default/xui/en/menu_viewer.xml      | 159 +++---------
 .../skins/default/xui/en/notifications.xml    |  78 ++++--
 .../xui/en/panel_adhoc_control_panel.xml      |   6 +-
 .../default/xui/en/panel_bottomtray_lite.xml  |   8 +-
 .../default/xui/en/panel_chiclet_bar.xml      |   5 +-
 .../default/xui/en/panel_classified_info.xml  |  12 +-
 .../default/xui/en/panel_edit_classified.xml  |   2 -
 .../skins/default/xui/en/panel_edit_pick.xml  |   2 -
 .../default/xui/en/panel_edit_profile.xml     |   2 -
 .../default/xui/en/panel_edit_wearable.xml    |   2 -
 .../xui/en/panel_group_control_panel.xml      |  11 +-
 .../xui/en/panel_group_info_sidetray.xml      |   5 +-
 .../default/xui/en/panel_im_control_panel.xml |  23 +-
 .../skins/default/xui/en/panel_landmarks.xml  |   4 -
 .../skins/default/xui/en/panel_login.xml      |   2 -
 .../default/xui/en/panel_main_inventory.xml   |  11 -
 .../default/xui/en/panel_navigation_bar.xml   | 238 +++++++++---------
 .../default/xui/en/panel_nearby_media.xml     |  10 +-
 .../default/xui/en/panel_outbox_inventory.xml |   1 -
 .../default/xui/en/panel_outfit_edit.xml      |   6 +-
 .../xui/en/panel_outfits_inventory.xml        |   2 -
 .../skins/default/xui/en/panel_people.xml     |  12 -
 .../skins/default/xui/en/panel_pick_info.xml  |   3 -
 .../skins/default/xui/en/panel_picks.xml      |   5 -
 .../default/xui/en/panel_place_profile.xml    |   2 -
 .../skins/default/xui/en/panel_places.xml     |  10 -
 .../xui/en/panel_postcard_settings.xml        |   2 -
 .../xui/en/panel_preferences_privacy.xml      |   1 -
 .../xui/en/panel_prim_media_controls.xml      |  35 +--
 .../skins/default/xui/en/panel_progress.xml   |  33 ++-
 .../default/xui/en/panel_region_estate.xml    |  10 +-
 .../default/xui/en/panel_snapshot_local.xml   |   2 -
 .../default/xui/en/panel_snapshot_profile.xml |   2 -
 .../default/xui/en/panel_toolbar_view.xml     |   5 -
 .../default/xui/en/sidepanel_inventory.xml    | 189 ++------------
 .../newview/skins/default/xui/en/strings.xml  |  70 +++---
 .../en/widgets/outbox_folder_view_folder.xml  |  10 -
 .../xui/en/widgets/outbox_inventory_panel.xml |   2 +-
 .../skins/default/xui/pl/menu_viewer.xml      |  68 ++---
 .../skins/default/xui/zh/menu_viewer.xml      |  70 +++---
 56 files changed, 817 insertions(+), 867 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml

diff --git a/indra/newview/skins/default/xui/da/menu_viewer.xml b/indra/newview/skins/default/xui/da/menu_viewer.xml
index ba183066865..d695cd1f896 100644
--- a/indra/newview/skins/default/xui/da/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/da/menu_viewer.xml
@@ -20,8 +20,6 @@
 			<menu_item_call label="Væk" name="Set Away"/>
 			<menu_item_call label="Optaget" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Anmod om administrator status" name="Request Admin Options"/>
-		<menu_item_call label="Stop administrator status" name="Leave Admin Options"/>
 		<menu_item_call label="Afslut [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Kommunikér" name="Communicate">
@@ -36,11 +34,10 @@
 		<menu_item_check label="Søg" name="Search"/>
 		<menu_item_call label="Foto" name="Take Snapshot"/>
 		<menu_item_call label="Opret landemærke for dette sted" name="Create Landmark Here"/>
-		<menu label="Profil for sted" name="Land">
-			<menu_item_call label="Profil for sted" name="Place Profile"/>
-			<menu_item_call label="Om land" name="About Land"/>
-			<menu_item_call label="Region/Estate" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profil for sted" name="Place Profile"/>
+		<menu_item_call label="Om land" name="About Land"/>
+		<menu_item_call label="Region/Estate" name="Region/Estate"/>
 		<menu_item_call label="Køb dette land" name="Buy Land"/>
 		<menu_item_call label="Mit land" name="My Land"/>
 		<menu label="Vis" name="LandShow">
@@ -56,7 +53,7 @@
 		</menu>
 		<menu_item_call label="Teleport hjem" name="Teleport Home"/>
 		<menu_item_call label="Sæt dette sted som &apos;Hjem&apos;" name="Set Home to Here"/>
-		<menu label="Sol" name="Environment Settings">
+		<menu label="Sol" name="Sun">
 			<menu_item_call label="Solopgang" name="Sunrise"/>
 			<menu_item_call label="Middag" name="Noon"/>
 			<menu_item_call label="Solnedgang" name="Sunset"/>
@@ -155,22 +152,22 @@
 			<menu_item_check label="Vis muse-sigte" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Gengivelsestyper" name="Rendering Types">
-			<menu_item_check label="Simpel" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Træer" name="Tree"/>
-			<menu_item_check label="Avatarer" name="Character"/>
-			<menu_item_check label="Surface Patch" name="Surface Patch"/>
-			<menu_item_check label="Himmel" name="Sky"/>
-			<menu_item_check label="Vand" name="Water"/>
-			<menu_item_check label="Jord" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Græs" name="Grass"/>
-			<menu_item_check label="Skyer" name="Clouds"/>
-			<menu_item_check label="Partikler" name="Particles"/>
-			<menu_item_check label="Bump" name="Bump"/>
+			<menu_item_check label="Simpel" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Træer" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatarer" name="Rendering Type Character"/>
+			<menu_item_check label="Surface Patch" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Himmel" name="Rendering Type Sky"/>
+			<menu_item_check label="Vand" name="Rendering Type Water"/>
+			<menu_item_check label="Jord" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Græs" name="Rendering Type Grass"/>
+			<menu_item_check label="Skyer" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partikler" name="Rendering Type Particles"/>
+			<menu_item_check label="Bump" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Gengivelsesegenskaber" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Valgte" name="Selected"/>
 			<menu_item_check label="Fremhævede" name="Highlighted"/>
 			<menu_item_check label="Dynamiske teksturer" name="Dynamic Textures"/>
@@ -182,10 +179,7 @@
 		<menu_item_call label="Tøm gruppe cache" name="ClearGroupCache"/>
 		<menu_item_check label="Muse udjævning" name="Mouse Smoothing"/>
 		<menu label="Shortcuts" name="Shortcuts">
-			<menu_item_call label="Billede (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Søg" name="Search"/>
 			<menu_item_call label="Frigør taster" name="Release Keys"/>
-			<menu_item_call label="Sæt UI størrelse til standard" name="Set UI Size to Default"/>
 			<menu_item_check label="Vis avanceret menu (gammel genvej)" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Luk vindue" name="Close Window"/>
 			<menu_item_call label="Luk alle vinduer" name="Close All Windows"/>
@@ -194,13 +188,6 @@
 			<menu_item_check label="&quot;Joystick Flycam&quot;" name="Joystick Flycam"/>
 			<menu_item_call label="Nulstil udsyn" name="Reset View"/>
 			<menu_item_call label="Se på den sidste der chattede" name="Look at Last Chatter"/>
-			<menu label="Vælg byggeværktøj" name="Select Tool">
-				<menu_item_call label="Fokuseringsværktøj" name="Focus"/>
-				<menu_item_call label="Flyt værktøj" name="Move"/>
-				<menu_item_call label="Redigeringsværktøj" name="Edit"/>
-				<menu_item_call label="Opret værktøj" name="Create"/>
-				<menu_item_call label="Land værktøj" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoom ind" name="Zoom In"/>
 			<menu_item_call label="Zoom standard" name="Zoom Default"/>
 			<menu_item_call label="Zoom ud" name="Zoom Out"/>
@@ -276,9 +263,8 @@
 			<menu_item_call label="Mist en netværkspakke" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Stød, skub &amp; slag" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Verden" name="World">
+		<menu label="Verden" name="DevelopWorld">
 			<menu_item_check label="Vælg anden sol end region" name="Sim Sun Override"/>
-			<menu_item_check label="Pejlelys blink effekt" name="Cheesy Beacon"/>
 			<menu_item_check label="Fast vejr" name="Fixed Weather"/>
 			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
 		</menu>
@@ -300,11 +286,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Hovede" name="Head"/>
-				<menu_item_call label="Overkrop" name="Upper Body"/>
-				<menu_item_call label="Underkrop" name="Lower Body"/>
-				<menu_item_call label="Nederdel" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Hovede" name="Grab Head"/>
+				<menu_item_call label="Overkrop" name="Grab Upper Body"/>
+				<menu_item_call label="Underkrop" name="Grab Lower Body"/>
+				<menu_item_call label="Nederdel" name="Grab Skirt"/>
 			</menu>
 			<menu label="Avatar tests" name="Character Tests">
 				<menu_item_call label="Skift avatar geometri" name="Toggle Character Geometry"/>
@@ -326,8 +312,8 @@
 		<menu_item_check label="Vis administrationsmenu" name="View Admin Options"/>
 	</menu>
 	<menu label="Administrér" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Tag kopi" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Tag kopi" name="Admin Take Copy"/>
 			<menu_item_call label="Gennemtving ejer til mig" name="Force Owner To Me"/>
 			<menu_item_call label="Gennemtving ejer tolerance" name="Force Owner Permissive"/>
 			<menu_item_call label="Slet" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 4772f744ead..1d5a6740b74 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1206,10 +1206,6 @@ Only large parcels can be listed in search.
              name="push_restrict_region_text">
                 No Pushing (Region Override)
             </panel.string>
-            <panel.string
-             name="see_avs_text">
-                    Avatars on other parcels can see
-            </panel.string>
             <text
              type="string"
              length="1"
@@ -1524,24 +1520,24 @@ Only large parcels can be listed in search.
              length="1"
              follows="left|top"
              text_color="LtGray"
-             height="16"
+             height="32"
              layout="topleft"
              left="274"
-             top="166"
+             top="150"
              name="allow_label5"
-             width="278">
-              and chat with avatars on this parcel
+             width="205"
+             wrap="true">
+              Avatars on other parcels can see and chat with avatars on this parcel
             </text>
             <check_box
              height="16"
-             label="See Avatars"
              follows="top"
              layout="topleft"
              left="253"
              top="150"
              name="SeeAvatarsCheck"
              tool_tip="Allows avatars on other parcels to see and chat with avatars on this parcel, and you to see and chat with them."
-             width="120" />
+             width="10" />
             <text
              type="string"
              length="1"
@@ -1955,36 +1951,18 @@ Only large parcels can be listed in search.
 			 name="access_estate_defined">
 				(Defined by the Estate)
 			</panel.string>
-      <panel.string
-       name="allow_public_access">
-        Allow Public Access ([MATURITY]) (Note: Unchecking this will create ban lines)
-      </panel.string>
             <panel.string
              name="estate_override">
                 One or more of these options is set at the estate level
             </panel.string>
-            <text
-             type="string"
-             length="1"
-             follows="left|top"
-             height="16"
-             layout="topleft"
-             left="10"
-             name="Limit access to this parcel to:"
-             text_color="White"
-             top="10"
-             width="400">
-                Access To This Parcel
-            </text>
             <check_box
              follows="top|left"
              height="16"
              layout="topleft"
-             left_delta="0"
+             left="8"
              name="public_access"
-             top_pad="5"
-             label_text.valign="center"
-             label_text.v_pad="-2" 
+             label="Allow Public Access (Unchecking this will create ban lines)"
+             top_pad="10" 
              width="278" />
             <text
              type="string"
@@ -1994,28 +1972,28 @@ Only large parcels can be listed in search.
              layout="topleft"
              left_delta="20"
              name="Only Allow"
-             top="49"
+             top="30"
              width="325">
-                Restrict Access to Residents verified by:
+                Allow access only to Residents who:
             </text>
             <check_box
              follows="top|left"
              height="16"
-             label="Payment Information on File [ESTATE_PAYMENT_LIMIT]"
+             label="Have payment Information on File [ESTATE_PAYMENT_LIMIT]"
              layout="topleft"
              left_delta="0"
              name="limit_payment"
-             tool_tip="Ban unidentified Residents."
+             tool_tip="Residents must have payment information on file to access this parcel.  See the [SUPPORT_SITE] for more information."
              top_pad="4"
              width="278" />
             <check_box
              follows="top|left"
              height="16"
-             label="Age Verification [ESTATE_AGE_LIMIT]"
+             label="Have been age-verified [ESTATE_AGE_LIMIT]"
              layout="topleft"
              left_delta="0"
              name="limit_age_verified"
-             tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information."
+             tool_tip="Residents must be age verified to access this parcel. See the [SUPPORT_SITE] for more information."
              top_pad="4"
              width="278" />
             <check_box
@@ -2025,7 +2003,7 @@ Only large parcels can be listed in search.
              left="8"
              name="GroupCheck"
              tool_tip="Set group in the General tab."
-             top="109"
+             top="89"
              width="278" />
             <check_box
              enabled="false"
diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml
index d101bca6943..cd075abc415 100644
--- a/indra/newview/skins/default/xui/en/floater_help_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml
@@ -34,7 +34,6 @@
          left_delta="0"
          top_delta="0"
          name="external_controls"
-         user_resize="false"
          width="620">
             <web_browser
              trusted_content="true" 
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index a2739a8339f..ca73883e534 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -16,7 +16,7 @@
  min_width="250"
  min_height="190">
   <layout_stack
-   animate="false" 
+   animate="true" 
    default_tab_group="2"
   follows="all"
   height="320"
@@ -32,8 +32,7 @@
       min_width="115"
       width="150" 
       height="320" 
-      auto_resize="false"
-      user_resize="false">
+      auto_resize="false">
       <panel
         name="panel_im_control_panel"
         layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml
index c3324a6aa40..ce788654aa3 100644
--- a/indra/newview/skins/default/xui/en/floater_media_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml
@@ -37,7 +37,6 @@
          min_height="20"
          name="nav_controls"
          top="400"
-         user_resize="false"
          width="800">
             <button
              follows="left|top"
@@ -113,7 +112,6 @@
          min_height="20"         
          name="time_controls"
          top_delta="0"
-         user_resize="false"
          width="800">
             <button
              follows="left|top"
@@ -171,7 +169,6 @@
          min_height="20"         
          name="parcel_owner_controls"
          top_delta="0"
-         user_resize="false"
          width="540">
             <button
              enabled="false"
@@ -193,7 +190,6 @@
          left_delta="0"
          name="external_controls"
          top_delta="0"
-         user_resize="false"
          width="540">
           <web_browser
              bottom="-30"
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..498a9b6ce09
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<floater
+    open_positioning="cascading"
+    can_close="true"
+    can_resize="true"
+    height="440"
+    help_topic="floater_merchant_outbox"
+    min_width="300"
+    min_height="200"
+    name="floater_merchant_outbox"
+    save_rect="true"
+    save_visibility="false"
+    reuse_instance="true"
+    title="MERCHANT OUTBOX"
+    width="333">
+  <string name="OutboxFolderCount0"></string>
+  <string name="OutboxFolderCount1">1 folder</string>
+  <string name="OutboxFolderCountN">[NUM] folders</string>
+  <string name="OutboxImporting">Sending folders...</string>
+  <string name="OutboxInitializing">Initializing...</string>
+  <panel
+      follows="all"
+      layout="topleft"
+      left="0"
+      top="0"
+      label=""
+      height="440"
+      width="333">
+    <panel
+        follows="all"
+        left="10"
+        bottom="370"
+        width="313"
+        top="0"
+        bg_opaque_color="InventoryBackgroundColor">
+      <panel
+          name="outbox_inventory_placeholder_panel"
+          follows="all"
+          layout="topleft"
+          top="0"
+          left="0"
+          width="308"
+          height="370"
+          bg_opaque_color="InventoryBackgroundColor">
+        <text
+            name="outbox_inventory_placeholder_title"
+            type="string"
+            follows="top|left|right"
+            layout="topleft"
+            top="10"
+            left="0"
+            width="308"
+            height="25"
+            wrap="true"
+            halign="center"
+            font="SansSerifBold">
+          Loading...
+        </text>
+        <text
+            name="outbox_inventory_placeholder_text"
+            type="string"
+            follows="top|left|right"
+            layout="topleft"
+            top="35"
+            left="0"
+            width="308"
+            height="130"
+            wrap="true"
+            halign="left" />
+      </panel>
+    </panel>
+    <panel
+        follows="bottom|left|right"
+        left="10"
+        bottom="435"
+        width="313"
+        top="370">
+      <panel
+          name="outbox_generic_drag_target"
+          mouse_opaque="false"
+          follows="all"
+          top="5"
+          left="5"
+          width="303"
+          height="25"
+          background_visible="false"
+          bg_alpha_color="EmphasisColor_35"
+          border="true"
+          bevel_style="in"
+          visible="true">
+        <text
+            type="string"
+            follows="all"
+            layout="topleft"
+            top="6"
+            height="20"
+            left="5"
+            width="293"
+            halign="center"
+            font="SansSerifMedium"
+            font_shadow="hard"
+            valign="bottom">
+          Drag items here to create folders
+        </text>
+      </panel>
+      <text
+          name="outbox_folder_count"
+          type="string"
+          follows="all"
+          layout="topleft"
+          top="40"
+          left="5"
+          width="150"
+          height="20"
+          wrap="true"
+          halign="left"
+          valign="bottom"
+          font="SansSerif" />
+      <button
+          label="Send to Marketplace"
+          tool_tip="Push to my Marketplace Storefront"
+          is_toggle="false"
+          name="outbox_import_btn"
+          follows="bottom|right"
+          tab_stop="false"
+          halign="center"
+          top="37"
+          left="160"
+          height="25"
+          width="150"
+          enabled="false" />
+    </panel>
+    <layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
+      <layout_panel />
+      <layout_panel height="45" auto_resize="false">
+        <layout_stack orientation="horizontal" left="0" height="45" top="0" width="333" follows="all">
+          <layout_panel width="0" />
+          <layout_panel width="45" auto_resize="false">
+            <loading_indicator
+                height="45"
+                layout="topleft"
+                left="0"
+                top="0"
+                width="45" />
+          </layout_panel>
+          <layout_panel width="0" />
+        </layout_stack>
+      </layout_panel>
+      <layout_panel />
+    </layout_stack>
+  </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
index 9c0af7d9ba5..62b8c5f96ed 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -108,7 +108,7 @@
 		 height="22"
 		 top_pad="15"
 		 width="505"
-		 name="header_panel"
+		 name="choose_file_header_panel"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true"
@@ -117,7 +117,7 @@
 			 width="200"
 			 left="10"
 			 top="3"
-			 name="header_text"
+			 name="choose_file_header_text"
 			 text_color="White"
 			 height="10"
 			 font="SansSerifBig"
@@ -130,7 +130,7 @@
 		 left="15"
 		 height="310"
 		 width="505"
-		 name="content"
+		 name="choose_file_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -287,7 +287,7 @@
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="optimize_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -296,7 +296,7 @@
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="optimize_header_text"
 			 top="3"
 			 text_color="White"
 			 height="10"
@@ -311,7 +311,7 @@
 		 height="20"
 		 font="SansSerifSmall"
 		 layout="topleft"
-		 name="description"
+		 name="optimize_description"
 		 word_wrap="true"
 		 left_delta="5">
 			We have optimized the model for performance. Adjust it further if you wish.
@@ -322,7 +322,7 @@
 		 left="15"
 		 height="270"
 		 width="505"
-		 name="content"
+		 name="optimize_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -497,7 +497,7 @@ Higher prim weight</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="physics_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -506,7 +506,7 @@ Higher prim weight</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="physics_header_text"
 			 top="3"
 			 height="10"
 			 font="SansSerifBig"
@@ -521,7 +521,7 @@ Higher prim weight</text>
 		 height="50"
 		 font="SansSerifSmall"
 		 layout="topleft"
-		 name="description"
+		 name="physics_description"
 		 word_wrap="true"
 		 left_delta="5">
 			We will create a shape for the outer hull of the model. Adjust the shape's detail level as needed for the intended purpose of your model.
@@ -531,7 +531,7 @@ Higher prim weight</text>
 		 left="15"
 		 height="270"
 		 width="505"
-		 name="content"
+		 name="physics_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -635,7 +635,7 @@ Buildings</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="review_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -644,7 +644,7 @@ Buildings</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="review_header_text"
 			 text_color="White" 
 			 top="3"
 			 height="10"
@@ -658,7 +658,7 @@ Buildings</text>
 		 left="15"
 		 height="310"
 		 width="505"
-		 name="content"
+		 name="review_content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -706,7 +706,7 @@ Buildings</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="header_panel"
+		 name="upload_header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -715,7 +715,7 @@ Buildings</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="header_text"
+			 name="upload_header_text"
 			 top="3"
 			 text_color="White" 
 			 height="10"
diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..f95f21e63a7
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_resize="true"
+ can_close="true"
+ bevel_style="in"
+ height="300"
+ layout="topleft"
+ min_height="40"
+ min_width="420"
+ name="Test Floater"
+ title="LAYOUTSTACK TESTS"
+ width="420">
+  <layout_stack name="test_stack"
+              left="0"
+              top="0"
+              width="100"
+              height="250"
+              follows="left|top|bottom"
+              orientation="vertical">
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+  <layout_stack name="test_stack"
+              left_pad="5"
+              top="0"
+              width="100"
+              height="250"
+              follows="left|top|bottom"
+              orientation="vertical">
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  visible="false"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                  auto_resize="false"
+                  user_resize="true"
+                  height="50"
+                  min_height="10"
+                  bg_alpha_color="green"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                min_height="10"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="100"
+                  visible="true"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+  <layout_stack name="test_stack"
+               left_pad="5"
+               top="0"
+               width="100"
+               height="250"
+               follows="left|top|bottom"
+               orientation="vertical">
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  height="11"
+                  bg_alpha_color="blue"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+  <layout_stack name="test_stack"
+               left_pad="5"
+               top="0"
+               width="100"
+               height="250"
+               follows="left|top|bottom"
+               orientation="vertical">
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="fixed"
+                auto_resize="false"
+                  user_resize="true"
+                height="50"
+                bg_alpha_color="green"
+                background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="black">fixed</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+  </layout_stack>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index 493d44a9cf8..72e6187a14d 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -5,7 +5,7 @@
   can_minimize="false"
   can_resize="false"
   default_tab_group="1"
-  height="330"
+  height="375"
   help_topic="toybox"
   layout="topleft"
   legacy_header_height="18"
@@ -46,7 +46,7 @@
       Buttons will appear as shown or as icon-only depending on each toolbar's settings.
   </text>
   <toolbar
-    bottom="265"
+    bottom="310"
     button_display_mode="icons_with_text"
     follows="all"
     left="20"
@@ -82,11 +82,11 @@
   <panel
     bevel_style="none"
     border="true"
-    bottom="266"
+    bottom="311"
     follows="left|bottom|right"
     left="20"
     right="-20"
-    top="266" />
+    top="311" />
   <button
     follows="left|bottom|right"
     height="23"
@@ -95,7 +95,7 @@
     layout="topleft"
     left="185"
     name="btn_clear_all"
-    top="285"
+    top="330"
     width="130">
     <button.commit_callback function="Toybox.ClearAll" />
   </button>
@@ -107,7 +107,7 @@
     layout="topleft"
     left="335"
     name="btn_restore_defaults"
-    top="285"
+    top="330"
     width="130">
     <button.commit_callback function="Toybox.RestoreDefaults" />
   </button>
diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml
index 3921cfcd2c9..06d43272935 100644
--- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml
@@ -22,6 +22,7 @@ or specifying its path in the "Editor Path" field.</string>
      layout="topleft"
      left="0"
      mouse_opaque="false"
+     default_tab_group="1"
      name="main_panel"
      right="750"
      top="0">
@@ -196,6 +197,7 @@ or specifying its path in the "Editor Path" field.</string>
          left="10"
          name="name_list"
          right="-10"
+         tab_group="1"
          search_column="1"
          top="80">
             <scroll_list.columns
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index 6807b01fa3e..cea19ec75c7 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -49,7 +49,6 @@
          width="263">
         <layout_panel
          follows="top|left|right"
-         user_resize="false"
          auto_resize="false"
          layout="topleft"
          min_height="20"
@@ -89,7 +88,7 @@
              visible="true"
              width="20" />
         </layout_panel>
-        <layout_panel name="leave_call_panel" height="26" min_height="26" user_resize="false" auto_resize="false">
+        <layout_panel name="leave_call_panel" height="26" min_height="26" auto_resize="false">
         <layout_stack
          clip="true"
          follows="left|top|right"
@@ -110,7 +109,6 @@
           </layout_panel>
           <layout_panel
            auto_resize="false"
-           user_resize="false"
            follows="top|right"
            height="23"
            visible="true"
@@ -133,7 +131,6 @@
           top_pad="0"
           height="132"
           name="callers_panel"
-          user_resize="false" 
           auto_resize="true"
           width="280">
         <avatar_list
diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml
index 57d1c92acbf..cea10adca8e 100644
--- a/indra/newview/skins/default/xui/en/floater_web_content.xml
+++ b/indra/newview/skins/default/xui/en/floater_web_content.xml
@@ -31,7 +31,6 @@
       min_height="20"
       name="nav_controls"
       top="400"
-      user_resize="false"
       width="770">
       <button
         image_overlay="Arrow_Left_Off"
@@ -160,7 +159,6 @@
       left_delta="0"
       name="external_controls"
       top_delta="0"
-      user_resize="false"
       auto_resize="true"
       width="585">
       <web_browser
@@ -173,8 +171,7 @@
     </layout_panel>
     <layout_panel name="status_bar" 
                   height="23"
-                  auto_resize="false"
-                  user_resize="false">
+                  auto_resize="false">
       <text
         type="string"
         length="200"
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index b4be17e677b..a87027a1136 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -23,7 +23,6 @@
               left="0"
               top="0"
               width="1024"
-              user_resize="false"
               auto_resize="false"
               visible="true">
       <view mouse_opaque="false"
@@ -40,7 +39,6 @@
                   name="nav_bar_container"
                   tab_stop="false"
                   width="1024"
-                  user_resize="false"
                   visible="false"/>
     <layout_panel auto_resize="true"  
                   follows="all"
diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml
index f818ebe2d7d..63e154697ba 100644
--- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml
@@ -113,6 +113,15 @@
     <menu_item_call.on_visible
      function="Object.EnableMute" />
   </menu_item_call>
+  <menu_item_call
+   label="Unblock"
+   layout="topleft"
+   name="unblock">
+    <menu_item_call.on_click
+     function="Object.Mute" />
+    <menu_item_call.on_visible
+     function="Object.EnableUnmute" />
+  </menu_item_call>
   <menu_item_call
     label="Zoom In"
     layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index fb85e5278a0..ef4a1bc0618 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -686,12 +686,12 @@
 		 parameter="copy_to_outbox" />
 	</menu_item_call>
 	<menu_item_call
-	 label="Move to Merchant Outbox"
+	 label="Send to Marketplace"
 	 layout="topleft"
-	 name="Merchant Move">
+	 name="Marketplace Send">
 		<menu_item_call.on_click
 		 function="Inventory.DoToSelected"
-		 parameter="move_to_outbox" />
+		 parameter="send_to_marketplace" />
 	</menu_item_call>
 	<menu_item_call
      label="--no options--"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
index 0f42000ae79..e91f5af3d53 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
@@ -3,6 +3,7 @@
  layout="topleft"
  left="0"
  mouse_opaque="false"
+ can_tear_off="true"
  name="menu_inventory_add"
  visible="false">
             <menu
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index ec2dd102480..cd8550b00db 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -118,7 +118,7 @@
         </menu_item_call>
         <menu_item_call
          label="Walk / run / fly..."
-         name="Stop Animating My Avatar">
+         name="Walk / run / fly">
           <menu_item_call.on_click
            function="Floater.ToggleOrBringToFront"
            parameter="moveview" />
@@ -144,27 +144,10 @@
         </menu_item_call>
       </menu>
 
-      <menu_item_call
-       label="Request Admin Status"
-       name="Request Admin Options"
-       shortcut="control|alt|G"
-       visible="false">
-        <menu_item_call.on_click
-         function="Advanced.RequestAdminStatus" />
-      </menu_item_call>
-      <menu_item_call
-       label="Leave Admin Status"
-       name="Leave Admin Options"
-       shortcut="control|alt|shift|G"
-       visible="false">
-        <menu_item_call.on_click
-         function="Advanced.LeaveAdminStatus" />
-      </menu_item_call>
-
       <menu_item_separator/>
 
       <menu_item_call
-         label="Buy L$"
+         label="Buy L$..."
          name="Buy and Sell L$">
         <menu_item_call.on_click
          function="BuyCurrency" />
@@ -525,7 +508,7 @@
         <menu
          create_jump_keys="true"
          label="Sun"
-         name="Environment Settings"
+         name="Sun"
          tear_off="true">
             <menu_item_call
              label="Sunrise"
@@ -1452,7 +1435,7 @@
          tear_off="true">
             <menu_item_check
              label="Simple"
-             name="Simple"
+             name="Rendering Type Simple"
              shortcut="control|alt|shift|1">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1463,7 +1446,7 @@
             </menu_item_check>
             <menu_item_check
              label="Alpha"
-             name="Alpha"
+             name="Rendering Type Alpha"
              shortcut="control|alt|shift|2">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1474,7 +1457,7 @@
             </menu_item_check>
             <menu_item_check
              label="Tree"
-             name="Tree"
+             name="Rendering Type Tree"
              shortcut="control|alt|shift|3">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1485,7 +1468,7 @@
             </menu_item_check>
             <menu_item_check
              label="Avatars"
-             name="Character"
+             name="Rendering Type Character"
              shortcut="control|alt|shift|4">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1496,7 +1479,7 @@
             </menu_item_check>
             <menu_item_check
              label="Surface Patch"
-             name="Surface Patch"
+             name="Rendering Type Surface Patch"
              shortcut="control|alt|shift|5">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1507,7 +1490,7 @@
             </menu_item_check>
             <menu_item_check
              label="Sky"
-             name="Sky"
+             name="Rendering Type Sky"
              shortcut="control|alt|shift|6">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1518,7 +1501,7 @@
             </menu_item_check>
             <menu_item_check
              label="Water"
-             name="Water"
+             name="Rendering Type Water"
              shortcut="control|alt|shift|7">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1529,7 +1512,7 @@
             </menu_item_check>
             <menu_item_check
              label="Ground"
-             name="Ground"
+             name="Rendering Type Ground"
              shortcut="control|alt|shift|8">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1540,7 +1523,7 @@
             </menu_item_check>
             <menu_item_check
              label="Volume"
-             name="Volume"
+             name="Rendering Type Volume"
              shortcut="control|alt|shift|9">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1551,7 +1534,7 @@
             </menu_item_check>
             <menu_item_check
              label="Grass"
-             name="Grass"
+             name="Rendering Type Grass"
              shortcut="control|alt|shift|0">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1562,7 +1545,7 @@
             </menu_item_check>
             <menu_item_check
              label="Clouds"
-             name="Clouds"
+             name="Rendering Type Clouds"
              shortcut="control|alt|shift|-">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1573,7 +1556,7 @@
             </menu_item_check>
             <menu_item_check
              label="Particles"
-             name="Particles"
+             name="Rendering Type Particles"
              shortcut="control|alt|shift|=">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1584,7 +1567,7 @@
             </menu_item_check>
             <menu_item_check
              label="Bump"
-             name="Bump"
+             name="Rendering Type Bump"
              shortcut="control|alt|shift|\">
                 <menu_item_check.on_check
                  function="Advanced.CheckRenderType"
@@ -1601,7 +1584,7 @@
          tear_off="true">
             <menu_item_check
              label="UI"
-             name="UI"
+             name="ToggleUI"
              shortcut="control|alt|F1">
                 <menu_item_check.on_check
                  function="Advanced.CheckFeature"
@@ -1734,28 +1717,6 @@
          name="Shortcuts"
          tear_off="true"
          visible="false">
-          <menu_item_call
-             label="Image (L$[COST])..."
-             name="Upload Image"
-             shortcut="control|U">
-            <menu_item_call.on_click
-               function="File.UploadImage"
-               parameter="" />
-            <menu_item_call.on_enable
-               function="File.EnableUpload" />
-            </menu_item_call>
-            <menu_item_check
-               label="Search"
-               name="Search"
-               shortcut="control|F">
-            <menu_item_check.on_check
-             function="Floater.Visible"
-             parameter="search" />
-            <menu_item_check.on_click
-             function="Floater.Toggle"
-             parameter="search" />
-            </menu_item_check>
-
             <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
             <menu_item_check
                label="Show Advanced Menu - legacy shortcut"
@@ -1842,55 +1803,6 @@
 
             <menu_item_separator/>
 
-            <menu
-             create_jump_keys="true"
-             label="Select Build Tool"
-             name="Select Tool"
-             tear_off="true">
-                <menu_item_call
-                 label="Focus Tool"
-                 name="Focus"
-                 shortcut="control|1">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="focus" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Move Tool"
-                 name="Move"
-                 shortcut="control|2">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="move" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Edit Tool"
-                 name="Edit"
-                 shortcut="control|3">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="edit" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Create Tool"
-                 name="Create"
-                 shortcut="control|4">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="create" />
-                </menu_item_call>
-                <menu_item_call
-                 label="Land Tool"
-                 name="Land"
-                 shortcut="control|5">
-                    <menu_item_call.on_click
-                     function="Tools.SelectTool"
-                     parameter="land" />
-                </menu_item_call>
-            </menu>
-
-            <menu_item_separator/>
-
             <menu_item_call
              label="Zoom In"
              name="Zoom In"
@@ -2499,6 +2411,16 @@
           <menu_item_check.on_click
            function="Advanced.ToggleInfoDisplay"
            parameter="rendercomplexity" />
+        </menu_item_check>
+        <menu_item_check
+         label="Attachment Bytes"
+         name="attachment bytes">
+          <menu_item_check.on_check
+           function="Advanced.CheckInfoDisplay"
+           parameter="attachment bytes" />
+          <menu_item_check.on_click
+           function="Advanced.ToggleInfoDisplay"
+           parameter="attachment bytes" />
         </menu_item_check>
 		<menu_item_check
          label="Sculpt"
@@ -2853,7 +2775,7 @@
         <menu
          create_jump_keys="true"
          label="World"
-         name="World"
+         name="DevelopWorld"
          tear_off="true">
             <menu_item_check
              label="Sim Sun Override"
@@ -2865,16 +2787,6 @@
                  function="ToggleControl"
                  parameter="SkyOverrideSimSunPosition" />
             </menu_item_check>
-            <menu_item_check
-             label="Cheesy Beacon"
-             name="Cheesy Beacon">
-                <menu_item_check.on_check
-                 function="CheckControl"
-                 parameter="CheesyBeacon" />
-                <menu_item_check.on_click
-                 function="ToggleControl"
-                 parameter="CheesyBeacon" />
-            </menu_item_check>
             <menu_item_check
              label="Fixed Weather"
              name="Fixed Weather">
@@ -3099,7 +3011,7 @@
              tear_off="true">
                 <menu_item_call
                  label="Iris"
-                 name="Iris">
+                 name="Grab Iris">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="iris" />
@@ -3109,7 +3021,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Head"
-                 name="Head">
+                 name="Grab Head">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="head" />
@@ -3119,7 +3031,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Upper Body"
-                 name="Upper Body">
+                 name="Grab Upper Body">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="upper" />
@@ -3129,7 +3041,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Lower Body"
-                 name="Lower Body">
+                 name="Grab Lower Body">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="lower" />
@@ -3139,7 +3051,7 @@
                 </menu_item_call>
                 <menu_item_call
                  label="Skirt"
-                 name="Skirt">
+                 name="Grab Skirt">
                     <menu_item_call.on_click
                      function="Advanced.GrabBakedTexture"
                      parameter="skirt" />
@@ -3458,10 +3370,11 @@
         <menu
          create_jump_keys="true"
          label="Object"
+         name="AdminObject"
          tear_off="true">
             <menu_item_call
              label="Take Copy"
-             name="Take Copy"
+             name="Admin Take Copy"
              shortcut="control|alt|shift|O">
                 <menu_item_call.on_click
                  function="Admin.ForceTakeCopy" />
@@ -3730,7 +3643,7 @@
         <menu
          create_jump_keys="true"
          label="Help"
-         name="Help"
+         name="DeprecatedHelp"
          tear_off="true">
             <menu_item_call
              label="Official Linden Blog"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 1daf2e69482..af75d493532 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -203,34 +203,80 @@ Save changes to current clothing/body part?
    icon="alertmodal.tga"
      name="ConfirmNoCopyToOutbox"
      type="alertmodal">
-        You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item?
-        [ITEM_NAME]
+You don't have permission to copy one or more of these items to the Merchant Outbox.  You can move them or leave them behind.
+    <usetemplate
+     name="okcancelbuttons"
+     notext="Don't move item(s)"
+     yestext="Move item(s)"/>
+  </notification>
+
+  <notification
+   icon="OutboxStatus_Success"
+   name="OutboxFolderCreated"
+   type="outbox">
+    <unique/>
+A new folder has been created for each item you have transferred into the top level of your Merchant Outbox.
+
+    <usetemplate
+     ignoretext="A new folder was created in the Merchant Outbox"
+     name="okignore"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="OutboxStatus_Success"
+   name="OutboxImportComplete"
+   type="outbox">
+Success
+
+All folders were successfully sent to the Marketplace.
+
         <usetemplate
-         name="okcancelbuttons"
-         notext="No"
-         yestext="Yes"/>
-    </notification>
+         ignoretext="All folders sent to the Marketplace"
+         name="okignore"
+         yestext="OK"/>
+  </notification>
 
   <notification
-   icon="alertmodal.tga"
-   name="OutboxUploadComplete"
-   type="alertmodal">
-Marketplace upload complete.
+   icon="OutboxStatus_Warning"
+   name="OutboxImportHadErrors"
+   type="outbox">
+Some folders did not transfer
+
+Errors occurred when some folders were sent to the Marketplace.  Those folders are still in your Merchant Outbox.
+
+See the [[MARKETPLACE_IMPORTS_URL] error log] for more information.
+
         <usetemplate
          name="okbutton"
-         yestext="Hooray!"/>
+         yestext="OK"/>
   </notification>
 
   <notification
-   icon="alertmodal.tga"
-   name="OutboxUploadHadErrors"
-   type="alertmodal">
-Marketplace upload completed with errors!  Please correct the problems in your outbox and retry.  Thanks.
+   icon="OutboxStatus_Error"
+   name="OutboxImportFailed"
+   type="outbox">
+Transfer failed
+
+No folders were sent to the Marketplace because of a system or network error.  Try again later.
+
         <usetemplate
          name="okbutton"
-         yestext="Boo!"/>
+         yestext="OK"/>
   </notification>
 
+  <notification
+   icon="OutboxStatus_Error"
+   name="OutboxInitFailed"
+   type="outbox">
+Marketplace initialization failed
+
+Initialization with the Marketplace failed because of a system or network error.  Try again later.
+
+        <usetemplate
+         name="okbutton"
+         yestext="OK"/>
+  </notification>
     
 
     <notification
diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
index 93cafd4a53e..d68fa6ca6c2 100644
--- a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml
@@ -27,8 +27,7 @@
          mouse_opaque="false"
          width="147"
          top="0"
-         name="speakers_list_panel"
-         user_resize="false">
+         name="speakers_list_panel">
             <avatar_list
              color="DkGray2"
              follows="all"
@@ -50,7 +49,6 @@
          min_height="25"
          width="130"
          name="call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
@@ -68,7 +66,6 @@
          min_height="25"
          width="130"
          name="end_call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
@@ -85,7 +82,6 @@
          min_height="25"
          width="130"
          name="voice_ctrls_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
index b5e1a5f16df..f4722b05d69 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
@@ -31,7 +31,6 @@
      width="1000">
         <layout_panel
          auto_resize="false"
-         user_resize="false" 
          min_width="2"
          width="2" />
         <layout_panel
@@ -40,8 +39,7 @@
          height="28"
          layout="topleft"
          width="310"
-         min_width="188"
-         user_resize="false">
+         min_width="188">
           <panel
             left="0"
             filename="panel_nearby_chat_bar.xml"
@@ -61,8 +59,7 @@
          width="82"
          top_delta="0"
          min_width="52"
-         name="gesture_panel"
-         user_resize="false">
+         name="gesture_panel">
             <gesture_combo_list
              follows="left|right"
              height="23"
@@ -80,7 +77,6 @@
         </layout_panel>
         <layout_panel
          auto_resize="false"
-         user_resize="false" 
          min_width="3"
          name="after_gesture_panel"
          width="3"/>
diff --git a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
index 41d1036a4d4..ff0146490b9 100644
--- a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
@@ -27,8 +27,8 @@
          min_width="95"
          mouse_opaque="false"
          name="chiclet_list_panel"
+         auto_resize="true"
          top="0"
-         user_resize="false"
          width="189">
       <chiclet_panel
              chiclet_padding="4"
@@ -78,7 +78,6 @@
       </chiclet_panel>
     </layout_panel>
     <layout_panel auto_resize="false"
-                      user_resize="false"
                       width="4"
                       min_width="4"/>
     <layout_panel
@@ -90,7 +89,6 @@
          min_width="37"
          name="im_well_panel"
          top="0"
-         user_resize="false"
          width="37">
       <chiclet_im_well
              follows="right"
@@ -139,7 +137,6 @@ image_pressed_selected  "Lit" + "Selected" - there are new messages and the Well
          min_width="37"
          name="notification_well_panel"
          top="0"
-         user_resize="false"
          width="37">
       <chiclet_notification
              follows="right"
diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml
index 6c8d994bc63..d4a2745d1d6 100644
--- a/indra/newview/skins/default/xui/en/panel_classified_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml
@@ -289,8 +289,7 @@
           left="0"
           top="0"
           width="290"
-          height="16"
-          user_resize="false">
+          height="16">
         <text
          follows="left|top"
          font.style="BOLD"
@@ -327,8 +326,7 @@
           left="0"
           top="0"
           width="290"
-          height="16"
-          user_resize="false">
+          height="16">
         <text
          follows="left|top"
          font.style="BOLD"
@@ -357,8 +355,7 @@
           left="0"
           top="0"
           width="290"
-          height="215"
-          user_resize="false">
+          height="215">
         <text
          auto_resize="false"
          follows="left|top"
@@ -416,7 +413,6 @@
 			  layout="bottomleft"
 			  left="0"
 			  name="layout_panel1"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
@@ -436,7 +432,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="100">
 			  <button
@@ -455,7 +450,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="edit_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml
index e512d63f9e2..3509eaa2851 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml
@@ -319,7 +319,6 @@
 			  layout="bottomleft"
 			  left="0"
 			  name="save_changes_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="156">
 			  <button
@@ -339,7 +338,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="157">
 			  <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
index 2ec2e03e8c9..0faa1598b1b 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
@@ -201,7 +201,6 @@
 			  layout="topleft"
 			  left="0"
 			  name="layout_panel1"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="150">
 		        <button
@@ -221,7 +220,6 @@
 			  layout="topleft"
 			  left_pad="4"
 			  name="layout_panel2"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="146">
 		        <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
index 442eb8c28d7..2c7c8133d13 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
@@ -435,7 +435,6 @@
 			  layout="bottomleft"
 			  name="save_changes_btn_lp"
 			  top="0"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="153">
         <button
@@ -456,7 +455,6 @@
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
 			  top="0"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="154">
         <button
diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
index c8764a6a843..69a692e2c4c 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
@@ -454,7 +454,6 @@
              left="0"			
              mouse_opaque="false"
              name="save_as_btn_lp"
-             user_resize="false" 
              auto_resize="true"
              width="154">
                 <button
@@ -474,7 +473,6 @@
              left_pad="3"			
              mouse_opaque="false"
              name="revert_btn_lp"
-             user_resize="false" 
              auto_resize="true"
              width="152">
                 <button
diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml
index c1dc2aaaf78..ad10e53a4e3 100644
--- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml
@@ -26,8 +26,7 @@
          mouse_opaque="false"
          width="145"
          top="0"
-         name="speakers_list_panel"
-         user_resize="false">
+         name="speakers_list_panel">
             <avatar_list
              color="DkGray2"
              follows="all"
@@ -48,8 +47,7 @@
          layout="topleft"
          min_height="28"
          width="130"
-         name="group_info_btn_panel"
-         user_resize="false">
+         name="group_info_btn_panel">
             <button
              follows="left|right|bottom"
              height="23"
@@ -66,8 +64,7 @@
          layout="topleft"
          min_height="28"
          width="130"
-         name="call_btn_panel"
-         user_resize="false">
+         name="call_btn_panel">
             <button
              follows="all"
              height="23"
@@ -84,7 +81,6 @@
          min_height="28"
          width="130"
          name="end_call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
@@ -101,7 +97,6 @@
          min_height="28"
          width="130"
          name="voice_ctrls_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
index ec3f3b48bcb..206496cc0e8 100644
--- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
@@ -97,6 +97,7 @@ background_visible="true"
        follows="all"
        layout="topleft"
        auto_resize="true"
+       user_resize="true"
        height="513"
        width="313">
    <accordion
@@ -195,7 +196,6 @@ background_visible="true"
 				layout="bottomleft"
 				left="0"
 				name="btn_refresh_lp"
-			    user_resize="false" 
 			    auto_resize="false"
 				width="24">
 					<button
@@ -215,7 +215,6 @@ background_visible="true"
 				layout="bottomleft"
 				left_pad="3"
 				name="btn_chat_lp"
-			    user_resize="false" 
 			    auto_resize="true"
 				width="91">
 					<button
@@ -234,7 +233,6 @@ background_visible="true"
 				layout="bottomleft"
 				left_pad="3"
 				name="call_btn_lp"
-			    user_resize="false" 
 			    auto_resize="true"
 				width="91">
 					<button
@@ -255,7 +253,6 @@ background_visible="true"
 				layout="bottomleft"
 				left_pad="3"
 				name="btn_apply_lp"
-			    user_resize="false" 
 			    auto_resize="true"
 				width="91">
 					<button
diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
index 9f73b7c5402..8fcd6ccbaf2 100644
--- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
@@ -32,8 +32,7 @@
          min_height="20"
          width="140"
          name="view_profile_btn_panel"
-         top="0" 
-         user_resize="false">
+         top="0" >
             <button
              follows="left|top|right"
              height="23"
@@ -49,8 +48,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="add_friend_btn_panel"
-         user_resize="false">
+         name="add_friend_btn_panel">
             <button
              follows="left|top|right"
              height="23"
@@ -66,8 +64,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="teleport_btn_panel"
-         user_resize="false">
+         name="teleport_btn_panel">
         <button
              auto_resize="false"
              follows="left|top|right"
@@ -84,8 +81,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="share_btn_panel"
-         user_resize="false">
+         name="share_btn_panel">
            <button
              auto_resize="true"
              follows="left|top|right"
@@ -101,8 +97,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="pay_btn_panel"
-         user_resize="false">
+         name="pay_btn_panel">
            <button
              auto_resize="true"
              follows="left|top|right"
@@ -118,8 +113,7 @@
          layout="topleft"
          min_height="25"
          width="140"
-         name="call_btn_panel"
-         user_resize="false">
+         name="call_btn_panel">
             <button
              follows="left|top|right"
              height="23"
@@ -135,7 +129,6 @@
          min_height="25"
          width="140"
          name="end_call_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="left|top|right"
@@ -152,7 +145,6 @@
          min_height="25"
          width="140"
          name="voice_ctrls_btn_panel"
-         user_resize="false"
          visible="false">
             <button
              follows="left|top|right"
@@ -169,7 +161,6 @@
        layout="topleft"
        min_height="0"
        width="140"
-       name="spacer"
-       user_resize="false" />
+       name="spacer"/>
     </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml
index 23d8cb11cac..2a5933e3e93 100644
--- a/indra/newview/skins/default/xui/en/panel_landmarks.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml
@@ -114,7 +114,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="options_gear_btn_panel"
-		       user_resize="false"
 		       width="32">
 		          <menu_button
 		           follows="bottom|left"
@@ -135,7 +134,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="add_btn_panel"
-		       user_resize="false"
 		       width="32">
 		          <button
 		           follows="bottom|left"
@@ -156,7 +154,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="dummy_panel"
-		       user_resize="false"
 		       width="212">
 		          <icon
 		           follows="bottom|left|right"
@@ -173,7 +170,6 @@
 		       height="25"
 		       layout="topleft"
 		       name="trash_btn_panel"
-		       user_resize="false"
 		       width="31">
 		          <dnd_button
 		           follows="bottom|left"
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 6521bf2a4ea..223326dd06e 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -48,7 +48,6 @@ name="login"
 layout="topleft"
 width="705"
 min_width="705"
-user_resize="false"
 height="80">
 <text
 follows="left|bottom"
@@ -165,7 +164,6 @@ follows="right|bottom"
 name="links"
 width="205"
 min_width="205"
-user_resize="false"
 height="80">
    <text
 follows="right|bottom"
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index e6c5110999d..d6d8b2a83e1 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
- background_visible="true"
  default_tab_group="1"
  follows="all"
  height="423"
@@ -51,10 +50,6 @@
    top="18"
    width="303" />
   <tab_container
-     bg_alpha_color="DkGray"
-     bg_opaque_color="DkGray"
-     background_visible="true"
-     background_opaque="true"
      follows="all"
      halign="center"
      height="339"
@@ -71,7 +66,6 @@
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
-     background_opaque="true"
      border="false"
      bevel_style="none"
      follows="all"
@@ -90,7 +84,6 @@
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
-     background_opaque="true"
      border="false"
      bevel_style="none"
      follows="all"
@@ -119,7 +112,6 @@
        height="25"
        layout="topleft"
        name="options_gear_btn_panel"
-       user_resize="false"
        width="32">
           <menu_button
            follows="bottom|left"
@@ -140,7 +132,6 @@
        height="25"
        layout="topleft"
        name="add_btn_panel"
-       user_resize="false"
        width="32">
           <button
            follows="bottom|left"
@@ -161,7 +152,6 @@
        height="25"
        layout="topleft"
        name="dummy_panel"
-       user_resize="false"
        width="212">
           <icon
            follows="bottom|left|right"
@@ -178,7 +168,6 @@
        height="25"
        layout="topleft"
        name="trash_btn_panel"
-       user_resize="false"
        width="31">
           <dnd_button
            follows="bottom|left"
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 7a8e872dc96..4bf420b79f9 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -54,11 +54,11 @@
     width="800"
     height="2"/>
 	 <layout_stack
-       use_border="true"
-       bevel_style="none"
        follows="all"
        height="34"
        layout="topleft"
+       border_size="0"
+       resize_bar_overlap="3"
        left="0"
        mouse_opaque="false"
        name="nvp_stack"
@@ -73,130 +73,130 @@
            min_width="480"
            name="navigation_layout_panel"
            width="480">
-	<panel
-	 background_visible="false"
-	 follows="left|top|right"
-	 top="3"
-	 height="23"
-	 layout="topleft"
-               left="0"
-	 name="navigation_panel"
-     width="480">
-	     <pull_button
-	     follows="left|top"
-	     direction="down"
-	     height="23"
-	     image_overlay="Arrow_Left_Off"
-	     image_bottom_pad="1"
-	     layout="topleft"
-	     left="10"
-	     name="back_btn"
-	     tool_tip="Go back to previous location"
-	     top="2"
-	     width="31" />
-	    <pull_button
-	     follows="left|top"
-	     direction="down"
-	     height="23"
-	     image_overlay="Arrow_Right_Off"
-	     image_bottom_pad="1"
-	     layout="topleft"
-	     left_pad="0"
-	     name="forward_btn"
-	     tool_tip="Go forward one location"
-	     top_delta="0"
-	     width="31" />
-	    <button
-	     follows="left|top"
-	     height="23"
-	     image_bottom_pad="1"
-	     image_overlay="Home_Off"
-	     layout="topleft"
-	     left_pad="7"
-	     name="home_btn"
-	     tool_tip="Teleport to my home location"
-	     top_delta="0"
-	     width="32" />
-	    <location_input
-                   follows="all"
-	     halign="right"
-	     height="23"
-	     label="Location"
-	     layout="topleft"
-	     left_pad="7"
-	     max_chars="254"
-	     mouse_opaque="false"
-	     name="location_combo"
-	     top_delta="0"
-            width="355">
-         <combo_list
-         mouse_wheel_opaque="true"/>
-	    </location_input>
-             </panel>
-         </layout_panel>
-         
-         <layout_panel
-           auto_resize="false"
-           layout="topleft"
-           max_width="5"
-           min_width="5"
-           name="nav_bar_resize_handle_panel"
-           user_resize="false"
-           width="5">
-             <icon
-               follows="top|right"
-               height="25"
-               image_name="ChatBarHandle"
-               layout="topleft"
-               left="-6"
-               name="resize_handle"
-               top="4"
-               width="5" />
-         </layout_panel>
-         
+	        <panel
+	         background_visible="false"
+	         follows="left|top|right"
+	         top="3"
+	         height="23"
+	         layout="topleft"
+                       left="0"
+	         name="navigation_panel"
+             width="480">
+	         <pull_button
+	         follows="left|top"
+	         direction="down"
+	         height="23"
+	         image_overlay="Arrow_Left_Off"
+	         image_bottom_pad="1"
+	         layout="topleft"
+	         left="10"
+	         name="back_btn"
+	         tool_tip="Go back to previous location"
+	         top="2"
+	         width="31" />
+	        <pull_button
+	         follows="left|top"
+	         direction="down"
+	         height="23"
+	         image_overlay="Arrow_Right_Off"
+	         image_bottom_pad="1"
+	         layout="topleft"
+	         left_pad="0"
+	         name="forward_btn"
+	         tool_tip="Go forward one location"
+	         top_delta="0"
+	         width="31" />
+	        <button
+	         follows="left|top"
+	         height="23"
+	         image_bottom_pad="1"
+	         image_overlay="Home_Off"
+	         layout="topleft"
+	         left_pad="7"
+	         name="home_btn"
+	         tool_tip="Teleport to my home location"
+	         top_delta="0"
+	         width="32" />
+	        <location_input
+                       follows="all"
+	         halign="right"
+	         height="23"
+	         label="Location"
+	         layout="topleft"
+	         left_pad="7"
+	         max_chars="254"
+	         mouse_opaque="false"
+	         name="location_combo"
+	         top_delta="0"
+                width="355">
+             <combo_list
+             mouse_wheel_opaque="true"/>
+	        </location_input>
+         </panel>
+          <icon
+             follows="top|right"
+             height="25"
+             image_name="ChatBarHandle"
+             layout="topleft"
+             left="-3"
+             name="resize_handle"
+             top="4"
+             width="5" />
+        </layout_panel>
          <layout_panel
            follows="top|left"
-	     layout="topleft"
+	         layout="topleft"
            auto_resize="true"
            user_resize="true"
            min_width="315"
            name="favorites_layout_panel"
            width="315">
-    <favorites_bar
-     follows="left|right|top"
-     font="SansSerifSmall"
-               height="20"
-     layout="topleft"
-     left="0"
-     name="favorite"
-     image_drag_indication="Accordion_ArrowOpened_Off"
-     tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-               width="311">
-        <label
-         follows="left|top"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="favorites_bar_label"
-         text_color="LtGray"
-         tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-         top="12"
-         width="102">
-          Favorites Bar
-        </label>
-                 <!-- More button actually is a text box. -->
-                 <more_button
-                   follows="left|bottom"
-                   name=">>"
-                   tab_stop="false"
-                   tool_tip="Show more of My Favorites"
-                   top="13"
-                   width="50"
-                   bottom="0"
-                   valign="bottom">
-                   More &#9660;
-                   </more_button>
-  </favorites_bar>
+           <icon
+             follows="top|left"
+             height="25"
+             image_name="ChatBarHandle"
+             layout="topleft"
+             left="-318"
+             name="resize_handle"
+             top="4"
+             width="5" />
+
+           <favorites_bar
+             follows="left|right|top"
+             font="SansSerifSmall"
+             height="20"
+             layout="topleft"
+             left="0"
+             top="4"
+             name="favorite"
+             image_drag_indication="Accordion_ArrowOpened_Off"
+             tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
+             width="311">
+            <label
+             follows="left|top"
+             height="15"
+             layout="topleft"
+             left="10"
+             name="favorites_bar_label"
+             text_color="LtGray"
+             tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
+             top="12"
+             width="102">
+              Favorites Bar
+            </label>
+              <!-- More button actually is a text box. -->
+              <more_button
+                follows="left|bottom"
+                name=">>"
+                tab_stop="false"
+                tool_tip="Show more of My Favorites"
+                top="13"
+                width="50"
+                bottom="0"
+                valign="bottom">
+                More &#9660;
+                </more_button>
+         </favorites_bar>
          </layout_panel>
      
      </layout_stack>
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
index bfc503f05b0..d1cb64f7ad3 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_media.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
@@ -196,7 +196,6 @@
 			name="stop"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="22"
@@ -224,7 +223,6 @@
 			name="play"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="22"
@@ -252,7 +250,6 @@
 			name="pause"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			min_width="22"
@@ -279,7 +276,6 @@
 			name="volume_slider_ctrl"
 			mouse_opaque="false"
 			auto_resize="true"
-			user_resize="false"
 			follows="left|right"
 			layout="topleft"
 			top="0"
@@ -304,7 +300,6 @@
 			name="mute"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="72"
@@ -333,7 +328,6 @@
 			name="zoom"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			height="28"
@@ -361,7 +355,6 @@
 			name="unzoom"
 			mouse_opaque="false"
 			auto_resize="false"
-			user_resize="false"
 			layout="topleft"
 			top="0"
 			min_width="21"
@@ -388,8 +381,7 @@
 		<layout_panel
 			name="right_bookend"
 			width="0"
-			mouse_opaque="false"
-			user_resize="false" />
+			mouse_opaque="false"/>
 	  </layout_stack>
 	</panel>
   </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index 66117615e42..a3d39e55af5 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -8,7 +8,6 @@
     bg_opaque_color="DkGray2"
     bg_alpha_color="DkGray2"
     background_visible="true"
-    background_opaque="true"
     border="false"
     bevel_style="none"
     show_item_link_overlays="true"
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
index e1cd78bad8a..b61f110e32f 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -198,7 +198,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                  height="154"
                  name="add_button_and_combobox"
                  width="311"
-                 user_resize="false"
                  visible="true">
 
             <!-- List containing items from the COF and Base outfit -->
@@ -271,8 +270,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                  height="30"
                  name="filter_panel"
                  width="311"
-                 visible="false"
-                 user_resize="false">
+                 visible="false">
 
                     <filter_editor
 		             background_image="TextField_Search_Off"
@@ -515,7 +513,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                      left="0"			
                      mouse_opaque="false"
                      name="save_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="156">
         <button
@@ -550,7 +547,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                      left_pad="3"			
                      mouse_opaque="false"
                      name="revert_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="147">
         <button
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
index 2ad2416179d..405d9513db3 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
@@ -84,7 +84,6 @@
                      left="0"			
                      mouse_opaque="false"
                      name="save_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="156">
                     <button
@@ -118,7 +117,6 @@
                      left_pad="3"			
                      mouse_opaque="false"
                      name="wear_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="147">
                     <button
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 0ebfd9c037a..98c7c49ff47 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -284,7 +284,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="options_gear_btn_panel"
-				       user_resize="false"
 				       width="32">
 				          <menu_button
 				           follows="bottom|left"
@@ -305,7 +304,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="add_btn_panel"
-				       user_resize="false"
 				       width="32">
 				          <button
 				           follows="bottom|left"
@@ -326,7 +324,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="dummy_panel"
-				       user_resize="false"
 				       width="210">
 				          <icon
 				           follows="bottom|left|right"
@@ -343,7 +340,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 				       height="25"
 				       layout="topleft"
 				       name="trash_btn_panel"
-				       user_resize="false"
 				       width="31">
 				          <dnd_button
 				           follows="bottom|left"
@@ -602,7 +598,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left="0"
 			name="view_profile_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="68">
 				<button
@@ -623,7 +618,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="im_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="41">
 				<button
@@ -644,7 +638,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="call_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="52">
 				<button
@@ -665,7 +658,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="share_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="66">
 				<button
@@ -686,7 +678,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			layout="bottomleft"
 			left_pad="3"
 			name="teleport_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="77">
 				<button
@@ -720,7 +711,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			left="0"			
 			mouse_opaque="false"
 			name="group_info_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="108">
 				<button
@@ -743,7 +733,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			left_pad="3"
 			mouse_opaque="false"
 			name="chat_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="101">
 				<button
@@ -766,7 +755,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
 			left_pad="3"
 			mouse_opaque="false"
 			name="group_call_btn_lp"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="96">
 				<button
diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml
index 24046d5cca6..79d190e1e09 100644
--- a/indra/newview/skins/default/xui/en/panel_pick_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml
@@ -139,7 +139,6 @@
 			  layout="bottomleft"
 			  left="0"
 			  name="layout_panel1"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
@@ -158,7 +157,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="100">
 			  <button
@@ -177,7 +175,6 @@
 			  layout="bottomleft"
 			  left_pad="3"
 			  name="edit_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="101">
 			  <button
diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml
index 85f402dfa24..8def96cada1 100644
--- a/indra/newview/skins/default/xui/en/panel_picks.xml
+++ b/indra/newview/skins/default/xui/en/panel_picks.xml
@@ -102,7 +102,6 @@ bg_opaque_color="DkGray2"
 			  layout="bottomleft"
 			  left="0"
 			  name="gear_menu_btn"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="51">
 				<button
@@ -124,7 +123,6 @@ bg_opaque_color="DkGray2"
 			  height="18"
 			  layout="bottomleft"
 			  name="trash_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="18">
 				<button
@@ -170,7 +168,6 @@ bg_opaque_color="DkGray2"
 			  layout="topleft"
 			  left="0"
 			  name="info_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  top="0"
 			  width="95">
@@ -192,7 +189,6 @@ bg_opaque_color="DkGray2"
 			  layout="bottomleft" 
 			  left_pad="2"
 			  name="teleport_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true"
 			  width="117">
 		        <button
@@ -212,7 +208,6 @@ bg_opaque_color="DkGray2"
 			  height="28"
 			  layout="bottomleft"
 			  name="show_on_map_btn_lp"
-		      user_resize="false" 
 		      auto_resize="true" 
 			  left_pad="2"
 			  width="90">
diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml
index e280115bda0..308acf0c0c5 100644
--- a/indra/newview/skins/default/xui/en/panel_place_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml
@@ -238,7 +238,6 @@
                  mouse_opaque="false"
                  name="here_panel"
                  top="0"
-                 user_resize="false"
                  width="60">
                     <icon
                      follows="top|left"
@@ -259,7 +258,6 @@
                  mouse_opaque="false"
                  name="for_sale_panel"
                  top="0"
-                 user_resize="false"
                  width="60">
                     <icon
                      follows="top|left"
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index 670aa47313d..f169dbb7027 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -92,7 +92,6 @@ background_visible="true"
 			left="0"			
 			mouse_opaque="false"
 			name="lp1"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="193">
 			
@@ -115,7 +114,6 @@ background_visible="true"
 					left="0"			
 					mouse_opaque="false"
 					name="teleport_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="109">
 						<button
@@ -137,7 +135,6 @@ background_visible="true"
 					left_pad="3"
 					mouse_opaque="false"
 					name="chat_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="86">
 						<button
@@ -161,7 +158,6 @@ background_visible="true"
 			left_pad="0"			
 			mouse_opaque="false"
 			name="lp2"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="116">
 			
@@ -185,7 +181,6 @@ background_visible="true"
 					left_pad="0"
 					mouse_opaque="false"
 					name="edit_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="84">
 						<button
@@ -208,7 +203,6 @@ background_visible="true"
 					left_pad="0"
 					mouse_opaque="false"
 					name="overflow_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="24">
 						<menu_button
@@ -246,7 +240,6 @@ background_visible="true"
 					left_pad="3"			
 					mouse_opaque="false"
 					name="profile_btn_lp"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="102">
 						<button
@@ -283,7 +276,6 @@ background_visible="true"
 					mouse_opaque="false"
 					name="close_btn_lp"
 					top="0"
-				    user_resize="false" 
 				    auto_resize="true"
 					width="51">
 						<button
@@ -324,7 +316,6 @@ background_visible="true"
 			mouse_opaque="false"
 			name="save_btn_lp"
 			top="0"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="153">
 				<button
@@ -347,7 +338,6 @@ background_visible="true"
 			mouse_opaque="false"
 			name="cancel_btn_lp"
 			top="0"
-		    user_resize="false" 
 		    auto_resize="true"
 			width="154">
 				<button
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index 2e0bb88f530..e9427a23882 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -50,7 +50,6 @@
          layout="topleft"
          left="0"
          name="postcard_image_size_lp"
-         user_resize="false" 
          auto_resize="false"
          top="0"
          right="-1"
@@ -99,7 +98,6 @@
          layout="topleft"
          left="0"
          name="postcard_image_format_quality_lp"
-         user_resize="false" 
          auto_resize="true"
          top="0"
          right="-1"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
index 47236c1a48b..587c461bee9 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
@@ -59,7 +59,6 @@
      top_pad="30"
      width="350" />
     <check_box
-     enabled_control="EnableVoiceChat"
      control_name="VoiceCallsFriendsOnly"
      height="16"
      label="Only friends and groups can call or IM me"
diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
index 273c2524742..198ccd6e2f7 100644
--- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
@@ -31,8 +31,7 @@
 		width="0"
 		name="left_bookend_bottom"
 		mouse_opaque="false"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
 	<layout_panel
 		name="media_progress_indicator"
 		mouse_opaque="false"
@@ -41,7 +40,6 @@
 		left="0"
 		top="0"
 		auto_resize="false"
-		user_resize="false"
 		min_width="100"
 		width="200">
 	  <progress_bar
@@ -59,8 +57,7 @@
 		name="right_bookend_bottom"
 		width="0"
 		mouse_opaque="false"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
   </layout_stack>
   <layout_stack
 	  name="media_controls"
@@ -79,13 +76,11 @@
 		top="0"
 		width="0"
 		mouse_opaque="false"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
 	<layout_panel
 		name="back"
 		top="0"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		mouse_opaque="false"
 		min_width="22"
@@ -114,7 +109,6 @@
 		name="fwd"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		min_width="22"
 		top="0"
@@ -142,7 +136,6 @@
 		name="home"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -170,7 +163,6 @@
 		name="media_stop"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -198,7 +190,6 @@
 		name="reload"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -226,7 +217,6 @@
 		name="stop"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -254,7 +244,6 @@
 		name="play"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="22"
@@ -282,7 +271,6 @@
 		name="pause"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -310,7 +298,6 @@
 		name="media_address"
 		mouse_opaque="false"
 		auto_resize="true"
-		user_resize="false"
 		height="24"
 		follows="left|right|bottom"
 		layout="topleft"
@@ -343,8 +330,7 @@
 			layout="topleft"
 			width="16"
 			mouse_opaque="false"
-			auto_resize="false"
-			user_resize="false">
+			auto_resize="false">
 		  <icon
 			  name="media_whitelist_flag"
 			  follows="top|right"
@@ -358,8 +344,7 @@
 			layout="topleft"
 			width="16"
 			mouse_opaque="false"
-			auto_resize="false"
-			user_resize="false">
+			auto_resize="false">
 		  <icon
 			  name="media_secure_lock_flag"
 			  height="16"
@@ -374,7 +359,6 @@
 		name="media_play_position"
 		mouse_opaque="false"
 		auto_resize="true"
-		user_resize="false"
 		follows="left|right"
 		layout="topleft"
 		top="0"
@@ -399,7 +383,6 @@
 		name="skip_back"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -428,7 +411,6 @@
 		name="skip_forward"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -455,7 +437,6 @@
 		name="media_volume"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="72"
@@ -511,7 +492,6 @@
 		name="zoom_frame"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		height="28"
@@ -539,7 +519,6 @@
 		name="close"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="21"
@@ -567,7 +546,6 @@
 		name="new_window"
 		mouse_opaque="false"
 		auto_resize="false"
-		user_resize="false"
 		layout="topleft"
 		top="0"
 		min_width="22"
@@ -596,8 +574,7 @@
 		mouse_opaque="false"
 		top="0"
 		width="0"
-		layout="topleft"
-		user_resize="false" />
+		layout="topleft"/>
   </layout_stack>
   <panel
 	  name="media_region"
diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml
index 4535c563398..860caf2d217 100644
--- a/indra/newview/skins/default/xui/en/panel_progress.xml
+++ b/indra/newview/skins/default/xui/en/panel_progress.xml
@@ -12,45 +12,43 @@
      height="768"
      layout="topleft"
      left="0"
-     name="stack1"
+     name="horizontal_centering"
      orientation="horizontal"
      top="0"
      width="1024">
         <layout_panel
          layout="topleft"
          min_width="10"
-         name="panel1"
-         user_resize="false"
+         name="left"
          width="150" />
         <layout_panel
          height="768"
          layout="topleft"
-         min_width="640"
-         name="panel2"
-         user_resize="false"
-         width="640">
+         min_width="670"
+         name="center"
+         width="670">
             <layout_stack
              follows="left|right|top|bottom"
              height="768"
              layout="topleft"
              left="0"
              orientation="vertical" 
-             name="stack2"
+             name="vertical_centering"
              top="0"
-             width="640">
+             width="670">
                 <layout_panel
                  height="200"
                  layout="topleft"
                  min_height="10"
                  name="panel3"
-                 width="640" />
+                 width="670" />
                 <layout_panel
                  auto_resize="false"
                  height="250"
                  layout="topleft"
                  min_height="250"
                  name="panel4"
-                 width="640">
+                 width="670">
                     <icon
                      color="LoginProgressBoxCenterColor"
                      follows="left|right|bottom|top"
@@ -59,7 +57,7 @@
                      layout="topleft"
                      left="0"
                      top="0"
-                     width="640" />
+                     width="670" />
                     <text
                      follows="left|right|top"
                      font="SansSerifHuge"
@@ -71,7 +69,7 @@
                      name="title_text"
                      text_color="LoginProgressBoxTextColor"
                      top_delta="50"
-                     width="593" />
+                     right="-47"/>
                     <text
                      follows="left|right|top"
                      font="SansSerif"
@@ -83,7 +81,7 @@
                      name="progress_text"
                      text_color="LoginProgressBoxTextColor"
                      top_pad="5"
-                     width="593"
+                     right="-47"
                      word_wrap="true"/>
                     <progress_bar
                      bottom="115"
@@ -106,7 +104,7 @@
                      name="message_text"
                      text_color="LoginProgressBoxTextColor"
                      top="145"
-                     width="550"
+                     right="-90"
                      word_wrap="true"/>
                 </layout_panel>
                 <layout_panel
@@ -114,14 +112,13 @@
                  layout="topleft"
                  min_width="10"
                  name="panel5"
-                 width="640" />
+                 width="670" />
             </layout_stack>
         </layout_panel>
         <layout_panel
          layout="topleft"
          min_width="10"
-         name="panel6"
-         user_resize="false"
+         name="right"
          width="150" />
     </layout_stack>
     <button
diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml
index 6b28639a777..bfd796a62bd 100644
--- a/indra/newview/skins/default/xui/en/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml
@@ -134,26 +134,26 @@
      name="Only Allow"
      top_delta="-30"
      width="278">
-        Restrict Access to accounts verified by:
+        Allow access only to Residents who:
     </text>
     <check_box
      follows="top|left"
      height="16"
-     label="Payment Information on File"
+     label="Have payment information on file"
      layout="topleft"
      left_delta="0"
      name="limit_payment"
-     tool_tip="Ban unidentified Residents"
+     tool_tip="Residents must have payment information on file to access this estate.  See the [SUPPORT_SITE] for more information."
      top_pad="2"
      width="278" />
     <check_box
      follows="top|left"
      height="16"
-     label="Age Verification"
+     label="Have been age-verified"
      layout="topleft"
      left_delta="0"
      name="limit_age_verified"
-     tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information."
+     tool_tip="Residents must be age verified to access this estate. See the [SUPPORT_SITE] for more information."
      top_pad="2"
      width="278" />
 
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index ae0215a5786..b966358f18d 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -96,7 +96,6 @@
          layout="topleft"
          left="0"
          name="local_image_size_lp"
-         user_resize="false" 
          auto_resize="false"
          top="0"
          right="-1"
@@ -145,7 +144,6 @@
          layout="topleft"
          left="0"
          name="local_image_format_quality_lp"
-         user_resize="false" 
          auto_resize="true"
          top="0"
          right="-1"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 91ac9ad6584..5bd383b81e8 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -84,7 +84,6 @@
          layout="topleft"
          left="0"
          name="profile_image_size_lp"
-         user_resize="false" 
          auto_resize="false"
          top="0"
          right="-1"
@@ -132,7 +131,6 @@
          layout="topleft"
          left="0"
          name="profile_image_metadata_lp"
-         user_resize="false" 
          auto_resize="true"
          top="0"
          right="-1"
diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
index 3c69a0cb6cc..58911bed562 100644
--- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
+++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
@@ -20,7 +20,6 @@
                 mouse_opaque="false">
   <layout_panel name="vertical_toolbar_panel"
                 auto_resize="true"
-                user_resize="false"
                 width="1024"
                 height="500"
                 mouse_opaque="false">
@@ -34,7 +33,6 @@
                   mouse_opaque="false">
       <layout_panel name="left_toolbar_panel"
                     auto_resize="false"
-                    user_resize="false"
                     height="500"
                     width="30"
                     mouse_opaque="false">
@@ -61,7 +59,6 @@
       </layout_panel>
       <layout_panel name="non_toolbar_panel"
                     auto_resize="true"
-                    user_resize="false"
                     mouse_opaque="false"
                     height="100"
                     width="200">
@@ -102,7 +99,6 @@
       </layout_panel>
       <layout_panel name="right_toolbar_panel"
                     auto_resize="false"
-                    user_resize="false"
                     height="500"
                     width="30"
                     mouse_opaque="false">
@@ -132,7 +128,6 @@
   </layout_panel>
   <layout_panel name="bottom_toolbar_panel"
                 auto_resize="false"
-                user_resize="false"
                 height="30"
                 width="1024"
                 mouse_opaque="false">
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index b52784d6bc4..fcba937bdbb 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
-	  background_visible="true"
 	  follows="all"
 	  height="570"
 	  label="Things"
@@ -30,11 +29,12 @@
               width="330">
              <layout_panel
                  name="main_inventory_layout_panel"
-								 layout="topleft"
+                 layout="topleft"
+                 auto_resize="true"
+                 user_resize="true"
                  min_dim="150"
                  width="330"
                  follows="bottom|left|right"
-                 user_resize="false"
                  height="300">
                  <panel
                       class="panel_main_inventory"
@@ -48,41 +48,18 @@
                       height="300"
                       width="330" />
              </layout_panel>
-					   <layout_panel
-                 width="330"
-								 layout="topleft"
-                 auto_resize="true"
-                 user_resize="false"
-                 follows="bottom|left|right"
-                 name="inbox_outbox_layout_panel"
-                 visible="false"
-                 min_dim="35"
-                 max_dim="235"
-                 expanded_min_dim="125"
-                 height="235">
-							 <layout_stack
-										follows="left|right|top|bottom"
-										layout="topleft"
-										left="0"
-										top="0"
-										orientation="vertical"
-										name="inbox_outbox_layout_stack"
-                    open_time_constant="0.02"
-                    close_time_constant="0.02"
-										height="235"
-										width="330">
-								 <layout_panel
+			 <layout_panel
                  width="330"
-								 layout="topleft"
+                 layout="topleft"
                  auto_resize="true"
-                 user_resize="false"
+                 user_resize="true"
                  follows="left|right|top"
                  name="inbox_layout_panel"
                  visible="false"
                  min_dim="35"
-                 max_dim="200"
+                 max_dim="235"
                  expanded_min_dim="90"
-                 height="200">
+                 height="235">
                  <panel
                       follows="all"
                       layout="topleft"
@@ -91,13 +68,13 @@
                       class="panel_marketplace_inbox"
                       top="0"
                       label=""
-                      height="200"
+                      height="235"
                       width="330">
                      <string name="InboxLabelWithArg">Received items ([NUM])</string>
                      <string name="InboxLabelNoArg">Received items</string>
                      <button
                         label="Received items"
-												font="SansSerifMedium"
+						font="SansSerifMedium"
                         name="inbox_btn"
                         height="35"
                         width="308"
@@ -129,7 +106,7 @@
                      <panel
                         follows="all"
                         left="10"
-                        bottom="200"
+                        bottom="235"
                         width="308"
                         top="35"
                         bg_opaque_color="InventoryBackgroundColor"
@@ -145,7 +122,7 @@
 							top="0"
 							left="0"
 							width="308"
-							height="165"
+							height="200"
 							wrap="true"
 							halign="center">
 							Purchases from the marketplace will be delivered here.
@@ -153,139 +130,6 @@
                     </panel>
                  </panel>
              </layout_panel>
-             <layout_panel
-                 width="330"
-                 layout="topleft"
-                 auto_resize="true"
-                 user_resize="false"
-                 follows="all"
-                 name="outbox_layout_panel"
-                 visible="false"
-                 min_dim="35"
-                 max_dim="200"
-                 expanded_min_dim="90"
-                 height="200">
-                 <panel
-                      follows="all"
-                      layout="topleft"
-                      left="0"
-                      name="marketplace_outbox"
-                      class="panel_marketplace_outbox"
-                      top="0"
-                      label=""
-                      height="200"
-                      width="330">
-                     <string name="OutboxLabelWithArg">Merchant outbox ([NUM])</string>
-                     <string name="OutboxLabelNoArg">Merchant outbox</string>
-                     <button
-                        label="Merchant outbox"
-                        font="SansSerifMedium"
-                        name="outbox_btn"
-                        height="35"
-                        width="308"
-                        image_unselected="MarketplaceBtn_Off"
-                        image_selected="MarketplaceBtn_Selected"
-                        halign="left"
-                        handle_right_mouse="false"
-                        follows="top|left|right"
-                        is_toggle="true"
-                        tab_stop="false"
-                        pad_left="35"
-                        top="0"
-                        left="10" />
-                     <button
-                         image_unselected="OutboxPush_Off"
-                         image_selected="OutboxPush_Selected"
-                         image_hover_selected="OutboxPush_Selected_Over"
-                         image_hover_unselected="OutboxPush_Over"
-                         image_disabled_selected="OutboxPush_Selected_Disabled"
-                         image_disabled="OutboxPush_Disabled"
-                         image_pressed="OutboxPush_Press"
-                         image_pressed_selected="OutboxPush_Selected_Press"
-                         label=""
-                         tool_tip="Push to my Marketplace Storefront"
-                         is_toggle="false"
-                         name="outbox_sync_btn"
-                         follows="top|right"
-                         tab_stop="false"
-                         halign="center"
-                         top="6"
-                         left="-50"
-                         height="23"
-                         width="32"
-                         enabled="false" />
-                     <loading_indicator
-                        follows="top|right"
-                        name="outbox_sync_indicator"
-                        top="6"
-                        left="-50"
-                        height="23"
-                        width="32"
-                        images_per_sec="1.15"
-                        tab_stop="false"
-                        visible="false">
-                         <images>
-                             <image name="OutboxPush_Progress_1"/>
-                             <image name="OutboxPush_Progress_2"/>
-                             <image name="OutboxPush_Progress_3"/>
-                             <image name="OutboxPush_Progress_4"/>
-                             <image name="OutboxPush_Progress_5"/>
-                             <image name="OutboxPush_Progress_6"/>
-                         </images>
-                     </loading_indicator>
-                     <panel
-                        follows="all"
-                        left="10"
-                        bottom="200"
-                        width="308"
-                        top="35"
-                        bg_opaque_color="InventoryBackgroundColor"
-                        background_visible="true"
-                        background_opaque="true"
-                        >
-						<panel
-							name="outbox_inventory_placeholder_panel"
-							follows="all"
-							layout="topleft"
-							top="0"
-							left="0"
-							width="308"
-							height="165"
-							bg_opaque_color="InventoryBackgroundColor"
-							background_visible="true"
-							background_opaque="true"
-							>
-							<text
-								name="outbox_inventory_placeholder_title"
-								type="string"
-								follows="all"
-								layout="topleft"
-								top="10"
-								left="0"
-								width="308"
-								height="25"
-								wrap="true"
-								halign="center"
-								font="SansSerifBold">
-								Loading...
-							</text>
-							<text
-								name="outbox_inventory_placeholder_text"
-								type="string"
-								follows="all"
-								layout="topleft"
-								top="35"
-								left="0"
-								width="308"
-								height="130"
-								wrap="true"
-								halign="left" />
-						</panel>
-                    </panel>
-                 </panel>
-             </layout_panel>
-						 </layout_stack>
-						 </layout_panel>
          </layout_stack>
 		<panel
 		     follows="bottom|left|right"
@@ -312,7 +156,6 @@
                      left="0"			
                      mouse_opaque="false"
                      name="info_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="101">
                     <button
@@ -334,7 +177,6 @@
                      left_pad="1"			
                      mouse_opaque="false"
                      name="share_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="100">
                     <button
@@ -356,7 +198,6 @@
                      left_pad="1"			
                      mouse_opaque="false"
                      name="shop_btn_lp"
-                     user_resize="false" 
                      auto_resize="true"
                      width="100">
                     <button
@@ -406,8 +247,7 @@
 			</layout_stack>
 		</panel>
 	</panel>
-
-<panel
+	<panel
 		 follows="all"
 		 layout="topleft"
 		 left="0"
@@ -420,8 +260,7 @@
 		 visible="false"
 		 width="330">
 	</panel>
-
-<panel
+	<panel
 		 follows="all"
 		 layout="topleft"
 		 left="0"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 2b0dcdfecaf..3351ffe00fb 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -18,7 +18,7 @@
 	<string name="StartupClearingCache">Clearing cache...</string>
 	<string name="StartupInitializingTextureCache">Initializing texture cache...</string>
 	<string name="StartupInitializingVFS">Initializing VFS...</string>
-  <string name="StartupRequireDriverUpdate">Graphics initialization failed. Please update your graphics driver!</string>
+	<string name="StartupRequireDriverUpdate">Graphics initialization failed. Please update your graphics driver!</string>
 
 	<!--  progress -->
 	<string name="ProgressRestoring">Restoring...</string>
@@ -35,9 +35,9 @@
 	<string name="LoginAttempt">Previous login attempt failed. Logging in, attempt [NUMBER]</string>
 	<string name="LoginPrecaching">Loading world...</string>
 	<string name="LoginInitializingBrowser">Initializing embedded web browser...</string>
-  <string name="LoginInitializingMultimedia">Initializing multimedia...</string>
-  <string name="LoginInitializingFonts">Loading fonts...</string>
-  <string name="LoginVerifyingCache">Verifying cache files (can take 60-90 seconds)...</string>
+	<string name="LoginInitializingMultimedia">Initializing multimedia...</string>
+	<string name="LoginInitializingFonts">Loading fonts...</string>
+	<string name="LoginVerifyingCache">Verifying cache files (can take 60-90 seconds)...</string>
 	<string name="LoginProcessingResponse">Processing response...</string>
 	<string name="LoginInitializingWorld">Initializing world...</string>
 	<string name="LoginDecodingImages">Decoding images...</string>
@@ -49,12 +49,12 @@
 	<string name="LoginWaitingForRegionHandshake">Waiting for region handshake...</string>
 	<string name="LoginConnectingToRegion">Connecting to region...</string>
 	<string name="LoginDownloadingClothing">Downloading clothing...</string>
-        <string name="InvalidCertificate">The server returned an invalid or corrupt certificate. Please contact the Grid administrator.</string>
-        <string name="CertInvalidHostname">An invalid hostname was used to access the server, please check your SLURL or Grid hostname.</string>
-        <string name="CertExpired">The certificate returned by the Grid appears to be expired.  Please check your system clock, or contact your Grid administrator.</string>
-        <string name="CertKeyUsage">The certificate returned by the server could not be used for SSL.  Please contact your Grid administrator.</string>
-        <string name="CertBasicConstraints">Too many certificates were in the servers Certificate chain.  Please contact your Grid administrator.</string>
-        <string name="CertInvalidSignature">The certificate signature returned by the Grid server could not be verified.  Please contact your Grid administrator.</string>
+	<string name="InvalidCertificate">The server returned an invalid or corrupt certificate. Please contact the Grid administrator.</string>
+	<string name="CertInvalidHostname">An invalid hostname was used to access the server, please check your SLURL or Grid hostname.</string>
+	<string name="CertExpired">The certificate returned by the Grid appears to be expired.  Please check your system clock, or contact your Grid administrator.</string>
+	<string name="CertKeyUsage">The certificate returned by the server could not be used for SSL.  Please contact your Grid administrator.</string>
+	<string name="CertBasicConstraints">Too many certificates were in the servers Certificate chain.  Please contact your Grid administrator.</string>
+	<string name="CertInvalidSignature">The certificate signature returned by the Grid server could not be verified.  Please contact your Grid administrator.</string>
 
 	<string name="LoginFailedNoNetwork">Network error: Could not establish connection, please check your network connection.</string>
 	<string name="LoginFailed">Login failed.</string>
@@ -164,11 +164,19 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipLand">Land:</string>
 	<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]: "/>
-	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred to another user.</string>
-	<string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
-	<string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
-	<string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
 
+	<string name="TooltipOutboxDragToWorld">You can not rez items in your merchant outbox</string>
+	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred.</string>
+	<string name="TooltipOutboxNotInInventory">Your merchant outbox can only accept items directly from your inventory</string>
+	<string name="TooltipOutboxWorn">You can not put items you are wearing into your merchant outbox</string>
+	<string name="TooltipOutboxCallingCard">You can not put calling cards into your merchant outbox</string>
+	<string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds 3</string>
+	<string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds 20</string>
+	<string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds 200</string>
+	
+	<string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string>
+	<string name="TooltipDragOntoSelf">You can't move a folder into itself</string>
+	
 	<!-- tooltips for Urls -->
 	<string name="TooltipHttpUrl">Click to view this web page</string>
 	<string name="TooltipSLURL">Click to view this location's information</string>
@@ -2029,24 +2037,28 @@ Returns a string with the requested data about the region
 	<string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string>
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
-	<string name="InventoryInboxNoItems">When you purchase or otherwise receive an item, it will appear here so you can drag it to a folder in your inventory, or delete it if you do not wish to keep it.</string>
-	<string name="MarketplaceURL">http://marketplace.[DOMAIN_NAME]</string>
-	<string name="MarketplaceURL_CreateStore">http://marketplace.[DOMAIN_NAME]/create_store</string>
-	<string name="MarketplaceURL_LearnMore">http://marketplace.[DOMAIN_NAME]/learn_more</string>
-	<string name="InventoryOutboxCreationErrorTitle">Your Merchant Outbox is not properly configured</string>
-	<string name="InventoryOutboxCreationErrorTooltip">Merchant Outbox configuration error</string>
-	<string name="InventoryOutboxCreationError">Please contact Customer Service to correct the problem.</string>
-	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace</string>
-	<string name="InventoryOutboxNotMerchantTooltip">Become a merchant!</string>
-	<string name="InventoryOutboxNotMerchant">[[MARKETPLACE_URL] The Second Life Marketplace] offers more than one million virtual products for sale, all of them created by Residents. You, too, can sell items you create, as well as some of the items you have purchased. It’s easy and setup is free.  [[LEARN_MORE_URL] Learn more] or [[CREATE_STORE_URL] create a store] on the Marketplace to get started.</string>
-	<string name="InventoryOutboxNoItemsTitle">A new way to send items to the Marketplace</string>
-	<string name="InventoryOutboxNoItemsTooltip">Drag and drop items here to prepare them for sale on the Marketplace</string>
-	<string name="InventoryOutboxNoItems">Drag items or folders that you wish to sell into this area.  A copy of the item will appear, leaving your inventory unchanged, unless you have dragged a no-copy item.  When you are ready to send the items to the Marketplace, click the Upload button. Once your items have been moved to your Marketplace Inventory, they will disappear from this folder.</string>
+	<string name="InventoryInboxNoItems">Certain items you receive, such as premium gifts, will appear here.  You may then drag them into your inventory.</string>
+	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
+	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
+	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
+	<string name="MarketplaceURL_Imports">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports</string>
+	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
+	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace.</string>
+	<string name="InventoryOutboxNotMerchantTooltip"></string>
+	<string name="InventoryOutboxNotMerchant">
+If you'd like to become a merchant, you'll need to [[MARKETPLACE_CREATE_STORE_URL] create a Marketplace store].
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">Your outbox is empty.</string>
+	<string name="InventoryOutboxNoItemsTooltip"></string>
+	<string name="InventoryOutboxNoItems">
+Drag folders to this area and click "Send to Marketplace" to list them for sale on the [[MARKETPLACE_DASHBOARD_URL] Marketplace].
+	</string>
 
 	<string name="Marketplace Error None">No errors</string>
 	<string name="Marketplace Error Not Merchant">Error: Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string>
 	<string name="Marketplace Error Empty Folder">Error: This folder has no contents.</string>
-	<string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products.  To fix this error, login to the marketplace website and reduce your unassociated item count.</string>
+	<string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products.  To fix this error, log in to the marketplace website and reduce your unassociated item count.</string>
+
 	<string name="Marketplace Error Object Limit">Error: This item contains too many objects.  Fix this error by placing objects together in boxes to reduce the total count to less than 200.</string>
 	<string name="Marketplace Error Folder Depth">Error: This item contains too many levels of nested folders.  Reorganize it to a maximum of 3 levels of nested folders.</string>
 	<string name="Marketplace Error Unsellable Item">Error: This item can not be sold on the marketplace.</string>
@@ -3681,6 +3693,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Marketplace_Label">Marketplace</string>
   <string name="Command_MiniMap_Label">Mini-map</string>
   <string name="Command_Move_Label">Walk / run / fly</string>
+  <string name="Command_Outbox_Label">Merchant outbox</string>
   <string name="Command_People_Label">People</string>
   <string name="Command_Picks_Label">Picks</string>
   <string name="Command_Places_Label">Places</string>
@@ -3706,6 +3719,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Marketplace_Tooltip">Go shopping</string>
   <string name="Command_MiniMap_Tooltip">Show nearby people</string>
   <string name="Command_Move_Tooltip">Moving your avatar</string>
+  <string name="Command_Outbox_Tooltip">Transfer items to your marketplace for sale</string>
   <string name="Command_People_Tooltip">Friends, groups, and nearby people</string>
   <string name="Command_Picks_Tooltip">Places to show as favorites in your profile</string>
   <string name="Command_Places_Tooltip">Places you've saved</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
index 07929961075..d19c47f54f3 100644
--- a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
@@ -6,14 +6,4 @@
   item_top_pad="4"
   selection_image="Rounded_Square"
   >
-  <error_badge 
-    label=" " 
-    label_offset_horiz="-1"
-    location="right" 
-    padding_horiz="12.5" 
-    padding_vert="2"
-    location_offset_hcenter="-23"
-    image="Error_Tag_Background"
-    image_color="Black"
-    />
 </outbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
index e3f20728196..3964569da24 100644
--- a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_inventory_panel show_load_status="false" />
+<outbox_inventory_panel show_empty_message="false" show_load_status="false" />
diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml
index c072ea9b5af..24c961fa265 100644
--- a/indra/newview/skins/default/xui/pl/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml
@@ -20,8 +20,6 @@
 			<menu_item_call label="Tryb oddalenia" name="Set Away"/>
 			<menu_item_call label="Tryb pracy" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Zażądaj statusu administratora" name="Request Admin Options"/>
-		<menu_item_call label="Wyłącz atatus administratora" name="Leave Admin Options"/>
 		<menu_item_call label="Wyłącz [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="Komunikacja" name="Communicate">
@@ -36,11 +34,10 @@
 		<menu_item_check label="Szukaj" name="Search"/>
 		<menu_item_call label="Zrób zdjęcie" name="Take Snapshot"/>
 		<menu_item_call label="Zapamiętaj to miejsce (LM)" name="Create Landmark Here"/>
-		<menu label="Miejsce" name="Land">
-			<menu_item_call label="Profil miejsca" name="Place Profile"/>
-			<menu_item_call label="O posiadłości" name="About Land"/>
-			<menu_item_call label="Region/MajÄ…tek" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="Profil miejsca" name="Place Profile"/>
+		<menu_item_call label="O posiadłości" name="About Land"/>
+		<menu_item_call label="Region/MajÄ…tek" name="Region/Estate"/>
 		<menu_item_call label="Kup posiadłość" name="Buy Land"/>
 		<menu_item_call label="Moje posiadłości" name="My Land"/>
 		<menu label="Pokaż" name="LandShow">
@@ -56,7 +53,7 @@
 		</menu>
 		<menu_item_call label="Teleportuj do Miejsca Startu" name="Teleport Home"/>
 		<menu_item_call label="Ustaw Miejsce Startu" name="Set Home to Here"/>
-		<menu label="Słońce" name="Environment Settings">
+		<menu label="Słońce" name="Sun">
 			<menu_item_call label="Wschód Słońca" name="Sunrise"/>
 			<menu_item_call label="Południe" name="Noon"/>
 			<menu_item_call label="Zachód Słońca" name="Sunset"/>
@@ -153,22 +150,22 @@
 			<menu_item_check label="Pokaż celownik myszki" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Rodzaje renderowania" name="Rendering Types">
-			<menu_item_check label="Podstawowe" name="Simple"/>
-			<menu_item_check label="Maska alpha" name="Alpha"/>
-			<menu_item_check label="Drzewo" name="Tree"/>
-			<menu_item_check label="Awatary" name="Character"/>
-			<menu_item_check label="PÅ‚aszczyzna powierzchni" name="SurfacePath"/>
-			<menu_item_check label="Niebo" name="Sky"/>
-			<menu_item_check label="Woda" name="Water"/>
-			<menu_item_check label="Ziemia" name="Ground"/>
-			<menu_item_check label="Głośność" name="Volume"/>
-			<menu_item_check label="Trawa" name="Grass"/>
-			<menu_item_check label="Chmury" name="Clouds"/>
-			<menu_item_check label="CzÄ…steczki" name="Particles"/>
-			<menu_item_check label="Zderzenie" name="Bump"/>
+			<menu_item_check label="Podstawowe" name="Rendering Type Simple"/>
+			<menu_item_check label="Maska alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Drzewo" name="Rendering Type Tree"/>
+			<menu_item_check label="Awatary" name="Rendering Type Character"/>
+			<menu_item_check label="PÅ‚aszczyzna powierzchni" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Niebo" name="Rendering Type Sky"/>
+			<menu_item_check label="Woda" name="Rendering Type Water"/>
+			<menu_item_check label="Ziemia" name="Rendering Type Ground"/>
+			<menu_item_check label="Głośność" name="Rendering Type Volume"/>
+			<menu_item_check label="Trawa" name="Rendering Type Grass"/>
+			<menu_item_check label="Chmury" name="Rendering Type Clouds"/>
+			<menu_item_check label="CzÄ…steczki" name="Rendering Type Particles"/>
+			<menu_item_check label="Zderzenie" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Opcje renderowania" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Zaznaczone" name="Selected"/>
 			<menu_item_check label="Podświetlenie" name="Highlighted"/>
 			<menu_item_check label="Tekstury dynamiczne" name="Dynamic Textures"/>
@@ -180,10 +177,7 @@
 		<menu_item_call label="Wyczyść bufor danych grupy" name="ClearGroupCache"/>
 		<menu_item_check label="Wygładzanie ruchu myszki" name="Mouse Smoothing"/>
 		<menu label="Skróty" name="Shortcuts">
-			<menu_item_call label="Obraz (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Szukaj" name="Search"/>
 			<menu_item_call label="Zwolnij klawisze" name="Release Keys"/>
-			<menu_item_call label="Domyślne ustawienia rozmiaru interfejsu" name="Set UI Size to Default"/>
 			<menu_item_check label="Pokaż menu Zaawansowane - skrót" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Zamknij okno" name="Close Window"/>
 			<menu_item_call label="Zamknij wszystkie okna" name="Close All Windows"/>
@@ -192,13 +186,6 @@
 			<menu_item_check label="Wolna kamera" name="Joystick Flycam"/>
 			<menu_item_call label="Reset widoku" name="Reset View"/>
 			<menu_item_call label="Zobacz ostatniego rozmówcę" name="Look at Last Chatter"/>
-			<menu label="Wybierz narzędzie budowania" name="Select Tool">
-				<menu_item_call label="Narzędzie ogniskowej" name="Focus"/>
-				<menu_item_call label="Narzędzie ruchu" name="Move"/>
-				<menu_item_call label="Narzędzie edycji" name="Edit"/>
-				<menu_item_call label="Stwórz narzędzie" name="Create"/>
-				<menu_item_call label="Narzędzia posiadłości" name="Land"/>
-			</menu>
 			<menu_item_call label="Przybliż" name="Zoom In"/>
 			<menu_item_call label="Domyślne przybliżenie" name="Zoom Default"/>
 			<menu_item_call label="Oddal" name="Zoom Out"/>
@@ -267,9 +254,8 @@
 			<menu_item_call label="Upuść pakiet pamięci" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Zderzenia, popchnięcia &amp;  uderzenia" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Åšwiat" name="World">
+		<menu label="Åšwiat" name="DevelopWorld">
 			<menu_item_check label="Domyślne ustawienia środowiska Regionu" name="Sim Sun Override"/>
-			<menu_item_check label="Efekty emiterów" name="Cheesy Beacon"/>
 			<menu_item_check label="Ustalona pogoda" name="Fixed Weather"/>
 			<menu_item_call label="Zachowaj bufor pamięci obiektów regionu" name="Dump Region Object Cache"/>
 		</menu>
@@ -291,11 +277,11 @@
 		</menu>
 		<menu label="Awatar" name="Character">
 			<menu label="Przesuń bakowaną teksturę" name="Grab Baked Texture">
-				<menu_item_call label="Tęczówka oka" name="Iris"/>
-				<menu_item_call label="GÅ‚owa" name="Head"/>
-				<menu_item_call label="Górna część ciała" name="Upper Body"/>
-				<menu_item_call label="Dolna część ciała" name="Lower Body"/>
-				<menu_item_call label="Spódnica" name="Skirt"/>
+				<menu_item_call label="Tęczówka oka" name="Grab Iris"/>
+				<menu_item_call label="GÅ‚owa" name="Grab Head"/>
+				<menu_item_call label="Górna część ciała" name="Grab Upper Body"/>
+				<menu_item_call label="Dolna część ciała" name="Grab Lower Body"/>
+				<menu_item_call label="Spódnica" name="Grab Skirt"/>
 			</menu>
 			<menu label="Testy postaci" name="Character Tests">
 				<menu_item_call label="Przesuń geometrię postaci" name="Toggle Character Geometry"/>
@@ -316,8 +302,8 @@
 		<menu_item_check label="Pokaż menu administratora" name="View Admin Options"/>
 	</menu>
 	<menu label="Administrator" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Weź kopię" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="Weź kopię" name="Admin Take Copy"/>
 			<menu_item_call label="Reset właściciela" name="Force Owner To Me"/>
 			<menu_item_call label="Reset przyzwolenia właściciela" name="Force Owner Permissive"/>
 			<menu_item_call label="Usuń" name="Delete"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml
index f7be781caca..b6bb79bcbcc 100644
--- a/indra/newview/skins/default/xui/zh/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml
@@ -20,8 +20,6 @@
 			<menu_item_call label="離開" name="Set Away"/>
 			<menu_item_call label="忙碌" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="要求 Admin 狀態" name="Request Admin Options"/>
-		<menu_item_call label="離開 Admin 狀態" name="Leave Admin Options"/>
 		<menu_item_call label="結束退出 [APP_NAME]" name="Quit"/>
 	</menu>
 	<menu label="溝通" name="Communicate">
@@ -36,11 +34,10 @@
 		<menu_item_check label="搜尋" name="Search"/>
 		<menu_item_call label="拍攝快照" name="Take Snapshot"/>
 		<menu_item_call label="將此處記下地標" name="Create Landmark Here"/>
-		<menu label="地點檔案" name="Land">
-			<menu_item_call label="地點檔案" name="Place Profile"/>
-			<menu_item_call label="關於土地" name="About Land"/>
-			<menu_item_call label="地區 / 領地" name="Region/Estate"/>
-		</menu>
+		<menu_item_separator/>
+		<menu_item_call label="地點檔案" name="Place Profile"/>
+		<menu_item_call label="關於土地" name="About Land"/>
+		<menu_item_call label="地區 / 領地" name="Region/Estate"/>
 		<menu_item_call label="購買這塊土地" name="Buy Land"/>
 		<menu_item_call label="我的土地" name="My Land"/>
 		<menu label="顯示" name="LandShow">
@@ -56,7 +53,7 @@
 		</menu>
 		<menu_item_call label="瞬間瞬間傳送回家" name="Teleport Home"/>
 		<menu_item_call label="設定家在此處" name="Set Home to Here"/>
-		<menu label="太陽" name="Environment Settings">
+		<menu label="太陽" name="Sun">
 			<menu_item_call label="日出" name="Sunrise"/>
 			<menu_item_call label="中午" name="Noon"/>
 			<menu_item_call label="日落" name="Sunset"/>
@@ -154,22 +151,22 @@
 			<menu_item_check label="顯示第一人稱視角準星" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Rendering Types" name="Rendering Types">
-			<menu_item_check label="ç°¡å–®" name="Simple"/>
-			<menu_item_check label="半透明" name="Alpha"/>
-			<menu_item_check label="樹木" name="Tree"/>
-			<menu_item_check label="化身" name="Character"/>
-			<menu_item_check label="地表" name="SurfacePath"/>
-			<menu_item_check label="天空" name="Sky"/>
-			<menu_item_check label="æ°´æ–‡" name="Water"/>
-			<menu_item_check label="地面" name="Ground"/>
-			<menu_item_check label="體積" name="Volume"/>
-			<menu_item_check label="草地" name="Grass"/>
-			<menu_item_check label="雲彩" name="Clouds"/>
-			<menu_item_check label="粒子效果" name="Particles"/>
-			<menu_item_check label="碰撞" name="Bump"/>
+			<menu_item_check label="ç°¡å–®" name="Rendering Type Simple"/>
+			<menu_item_check label="半透明" name="Rendering Type Alpha"/>
+			<menu_item_check label="樹木" name="Rendering Type Tree"/>
+			<menu_item_check label="化身" name="Rendering Type Character"/>
+			<menu_item_check label="地表" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="天空" name="Rendering Type Sky"/>
+			<menu_item_check label="æ°´æ–‡" name="Rendering Type Water"/>
+			<menu_item_check label="地面" name="Rendering Type Ground"/>
+			<menu_item_check label="體積" name="Rendering Type Volume"/>
+			<menu_item_check label="草地" name="Rendering Type Grass"/>
+			<menu_item_check label="雲彩" name="Rendering Type Clouds"/>
+			<menu_item_check label="粒子效果" name="Rendering Type Particles"/>
+			<menu_item_check label="碰撞" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Rendering Features" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Selected" name="Selected"/>
 			<menu_item_check label="Highlighted" name="Highlighted"/>
 			<menu_item_check label="Dynamic Textures" name="Dynamic Textures"/>
@@ -182,10 +179,7 @@
 		<menu_item_call label="清除群組快取資料" name="ClearGroupCache"/>
 		<menu_item_check label="滑鼠平滑移動" name="Mouse Smoothing"/>
 		<menu label="快速鍵" name="Shortcuts">
-			<menu_item_call label="圖像(L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="搜尋" name="Search"/>
 			<menu_item_call label="釋出按鍵" name="Release Keys"/>
-			<menu_item_call label="設定使用者界面大小至預設值" name="Set UI Size to Default"/>
 			<menu_item_check label="顯示進階選單 - 舊版捷徑" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="關閉視窗" name="Close Window"/>
 			<menu_item_call label="關閉全部視窗" name="Close All Windows"/>
@@ -194,13 +188,6 @@
 			<menu_item_check label="Joystick Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="重設視角" name="Reset View"/>
 			<menu_item_call label="注視上一位聊天者" name="Look at Last Chatter"/>
-			<menu label="選擇建造工具" name="Select Tool">
-				<menu_item_call label="聚焦工具" name="Focus"/>
-				<menu_item_call label="移動工具" name="Move"/>
-				<menu_item_call label="編輯工具" name="Edit"/>
-				<menu_item_call label="創造工具" name="Create"/>
-				<menu_item_call label="土地工具" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoom In" name="Zoom In"/>
 			<menu_item_call label="Zoom Default" name="Zoom Default"/>
 			<menu_item_call label="Zoom Out" name="Zoom Out"/>
@@ -306,9 +293,8 @@
 			<menu_item_call label="開始錄製" name="Start Record"/>
 			<menu_item_call label="停止錄製" name="Stop Record"/>
 		</menu>
-		<menu label="世界" name="World">
+		<menu label="世界" name="DevelopWorld">
 			<menu_item_check label="模擬器太陽設定覆蓋" name="Sim Sun Override"/>
-			<menu_item_check label="Cheesy Beacon" name="Cheesy Beacon"/>
 			<menu_item_check label="固定天氣" name="Fixed Weather"/>
 			<menu_item_call label="傾印地區物件快取" name="Dump Region Object Cache"/>
 		</menu>
@@ -340,11 +326,11 @@
 		</menu>
 		<menu label="化身" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="頭部" name="Head"/>
-				<menu_item_call label="Upper Body" name="Upper Body"/>
-				<menu_item_call label="Lower Body" name="Lower Body"/>
-				<menu_item_call label="裙子" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="頭部" name="Grab Head"/>
+				<menu_item_call label="Upper Body" name="Grab Upper Body"/>
+				<menu_item_call label="Lower Body" name="Grab Lower Body"/>
+				<menu_item_call label="裙子" name="Grab Skirt"/>
 			</menu>
 			<menu label="Character Tests" name="Character Tests">
 				<menu_item_call label="Appearance To XML" name="Appearance To XML"/>
@@ -378,8 +364,8 @@
 		<menu_item_check label="Show Admin Menu" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="取得副本" name="Take Copy"/>
+		<menu label="Object" name="AdminObject">
+			<menu_item_call label="取得副本" name="Admin Take Copy"/>
 			<menu_item_call label="強制擁有者為我" name="Force Owner To Me"/>
 			<menu_item_call label="Force Owner Permissive" name="Force Owner Permissive"/>
 			<menu_item_call label="刪除" name="Delete"/>
@@ -415,7 +401,7 @@
 			<menu_item_call label="身體物理" name="Physics"/>
 			<menu_item_call label="全部衣服" name="All Clothes"/>
 		</menu>
-		<menu label="幫助" name="Help">
+		<menu label="幫助" name="DeprecatedHelp">
 			<menu_item_call label="林登官方部落格" name="Official Linden Blog"/>
 			<menu_item_call label="Scripting Portal" name="Scripting Portal"/>
 			<menu label="臭蟲回報" name="Bug Reporting">
-- 
GitLab


From 9dde773a5a6b7dd8c48dd373774935c2d8415fef Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 15 Feb 2012 18:11:43 -0600
Subject: [PATCH 791/933] SH-2961 Fix for bumpiness not working on rigged
 meshes when L&S enabled.

---
 .../app_settings/shaders/class1/deferred/bumpSkinnedV.glsl    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
index 6c205074b4e..8ba75010a2c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -30,7 +30,7 @@ ATTRIBUTE vec3 position;
 ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec3 normal;
 ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord2;
+ATTRIBUTE vec3 binormal;
 
 VARYING vec3 vary_mat0;
 VARYING vec3 vary_mat1;
@@ -52,7 +52,7 @@ void main()
 	
 	
 	vec3 n = normalize((mat * vec4(normal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
-	vec3 b = normalize((mat * vec4(vec4(texcoord2,0,1).xyz+position.xyz, 1.0)).xyz-pos.xyz);
+	vec3 b = normalize((mat * vec4(binormal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
 	vec3 t = cross(b, n);
 	
 	vary_mat0 = vec3(t.x, b.x, n.x);
-- 
GitLab


From 785aa25ad4a7bd4ede8538dc0f547ebb0b46582e Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 15 Feb 2012 16:15:18 -0800
Subject: [PATCH 792/933] FIX INTL-92 8-language translation for set30

---
 .../default/xui/de/floater_about_land.xml     | 10 +--
 .../xui/de/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/de/floater_model_wizard.xml   | 42 ++++-----
 .../xui/de/floater_test_layout_stacks.xml     |  2 +
 .../xui/de/menu_inspect_object_gear.xml       |  5 +-
 .../skins/default/xui/de/menu_inventory.xml   |  2 +-
 .../skins/default/xui/de/menu_login.xml       |  2 +-
 .../skins/default/xui/de/menu_viewer.xml      | 75 +++++++---------
 .../skins/default/xui/de/notifications.xml    | 53 ++++++++---
 .../default/xui/de/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/de/panel_script_ed.xml  |  2 +
 .../default/xui/de/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/de/strings.xml  | 84 +++++++++++-------
 .../default/xui/es/floater_about_land.xml     | 10 +--
 .../xui/es/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/es/floater_model_wizard.xml   | 34 +++----
 .../xui/es/floater_test_layout_stacks.xml     |  2 +
 .../xui/es/menu_inspect_object_gear.xml       |  5 +-
 .../skins/default/xui/es/menu_inventory.xml   |  2 +-
 .../skins/default/xui/es/menu_login.xml       |  2 +-
 .../skins/default/xui/es/menu_viewer.xml      | 87 +++++++++---------
 .../skins/default/xui/es/notifications.xml    | 55 +++++++++---
 .../default/xui/es/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/es/panel_script_ed.xml  |  2 +
 .../default/xui/es/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/es/strings.xml  | 82 ++++++++++-------
 .../default/xui/fr/floater_about_land.xml     | 10 +--
 .../skins/default/xui/fr/floater_chat_bar.xml |  4 +-
 .../xui/fr/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/fr/floater_model_wizard.xml   | 34 +++----
 .../xui/fr/floater_test_layout_stacks.xml     |  2 +
 .../xui/fr/menu_inspect_object_gear.xml       |  5 +-
 .../skins/default/xui/fr/menu_inventory.xml   |  2 +-
 .../skins/default/xui/fr/menu_login.xml       |  2 +-
 .../skins/default/xui/fr/menu_viewer.xml      | 71 +++++++--------
 .../skins/default/xui/fr/notifications.xml    | 51 +++++++++--
 .../default/xui/fr/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/fr/panel_script_ed.xml  |  2 +
 .../default/xui/fr/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/fr/strings.xml  | 82 ++++++++++-------
 .../default/xui/it/floater_about_land.xml     | 10 +--
 .../xui/it/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/it/floater_model_wizard.xml   | 32 +++----
 .../xui/it/floater_test_layout_stacks.xml     |  2 +
 .../xui/it/menu_inspect_object_gear.xml       |  5 +-
 .../skins/default/xui/it/menu_inventory.xml   |  2 +-
 .../skins/default/xui/it/menu_login.xml       |  2 +-
 .../skins/default/xui/it/menu_viewer.xml      | 77 ++++++++--------
 .../skins/default/xui/it/notifications.xml    | 55 +++++++++---
 .../default/xui/it/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/it/panel_script_ed.xml  |  2 +
 .../default/xui/it/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/it/strings.xml  | 82 ++++++++++-------
 .../default/xui/ja/floater_about_land.xml     | 10 +--
 .../skins/default/xui/ja/floater_chat_bar.xml |  2 +-
 .../xui/ja/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/ja/floater_model_wizard.xml   | 44 +++++-----
 .../xui/ja/floater_test_layout_stacks.xml     |  2 +
 .../xui/ja/menu_inspect_object_gear.xml       |  5 +-
 .../skins/default/xui/ja/menu_inventory.xml   |  2 +-
 .../skins/default/xui/ja/menu_login.xml       |  2 +-
 .../skins/default/xui/ja/menu_viewer.xml      | 73 +++++++--------
 .../skins/default/xui/ja/notifications.xml    | 55 +++++++++---
 .../default/xui/ja/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/ja/panel_script_ed.xml  |  2 +
 .../default/xui/ja/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/ja/strings.xml  | 86 +++++++++++-------
 .../default/xui/pt/floater_about_land.xml     | 10 +--
 .../xui/pt/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/pt/floater_model_wizard.xml   | 34 +++----
 .../xui/pt/floater_test_layout_stacks.xml     |  2 +
 .../xui/pt/menu_inspect_object_gear.xml       |  5 +-
 .../skins/default/xui/pt/menu_inventory.xml   |  2 +-
 .../skins/default/xui/pt/menu_login.xml       |  2 +-
 .../skins/default/xui/pt/menu_viewer.xml      | 87 +++++++++---------
 .../skins/default/xui/pt/notifications.xml    | 48 +++++++---
 .../default/xui/pt/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/pt/panel_script_ed.xml  |  2 +
 .../default/xui/pt/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/pt/strings.xml  | 88 ++++++++++++-------
 .../default/xui/ru/floater_about_land.xml     | 18 ++--
 .../xui/ru/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/ru/floater_model_wizard.xml   | 48 +++++-----
 .../xui/ru/floater_test_layout_stacks.xml     |  2 +
 .../xui/ru/menu_inspect_object_gear.xml       |  1 +
 .../skins/default/xui/ru/menu_inventory.xml   |  2 +-
 .../skins/default/xui/ru/menu_login.xml       |  2 +-
 .../skins/default/xui/ru/menu_viewer.xml      | 67 ++++++--------
 .../skins/default/xui/ru/notifications.xml    | 53 ++++++++---
 .../default/xui/ru/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/ru/panel_script_ed.xml  |  2 +
 .../default/xui/ru/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/ru/strings.xml  | 81 ++++++++++-------
 .../default/xui/tr/floater_about_land.xml     | 18 ++--
 .../skins/default/xui/tr/floater_chat_bar.xml |  2 +-
 .../xui/tr/floater_merchant_outbox.xml        | 27 ++++++
 .../default/xui/tr/floater_model_wizard.xml   | 32 +++----
 .../xui/tr/floater_test_layout_stacks.xml     |  2 +
 .../xui/tr/menu_inspect_object_gear.xml       |  1 +
 .../skins/default/xui/tr/menu_inventory.xml   |  2 +-
 .../skins/default/xui/tr/menu_login.xml       |  2 +-
 .../skins/default/xui/tr/menu_viewer.xml      | 71 +++++++--------
 .../skins/default/xui/tr/notifications.xml    | 51 +++++++++--
 .../default/xui/tr/panel_region_estate.xml    |  6 +-
 .../skins/default/xui/tr/panel_script_ed.xml  |  2 +
 .../default/xui/tr/sidepanel_inventory.xml    | 59 ++++---------
 .../newview/skins/default/xui/tr/strings.xml  | 80 ++++++++++-------
 107 files changed, 1683 insertions(+), 1247 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/de/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/de/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/es/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/es/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/ru/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/ru/floater_test_layout_stacks.xml
 create mode 100644 indra/newview/skins/default/xui/tr/floater_merchant_outbox.xml
 create mode 100644 indra/newview/skins/default/xui/tr/floater_test_layout_stacks.xml

diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml
index b893ab79e50..9e330f97662 100644
--- a/indra/newview/skins/default/xui/de/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/de/floater_about_land.xml
@@ -374,7 +374,7 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Klicken Sie hier, um ein Bild auszuwählen"/>
 			<text name="allow_label5">
-				Avatare auf dieser Parzelle sehen und mit ihnen chatten
+				Avatare in anderen Parzellen können Avatare in dieser Parzelle sehen und mit ihnen chatten
 			</text>
 			<check_box label="Avatare sehen" name="SeeAvatarsCheck" tool_tip="Gestattet sowohl Avataren auf anderen Parzellen, Avatare auf dieser Parzelle zu sehen und mit ihnen zu chatten, als auch Ihnen, diese Avatare auf anderen Parzellen zu sehen und mit ihnen zu chatten."/>
 			<text name="landing_point">
@@ -458,12 +458,12 @@ Nur große Parzellen können in der Suche aufgeführt werden.
 			<text name="Limit access to this parcel to:">
 				Zugang zu dieser Parzelle
 			</text>
-			<check_box label="Öffentlichen Zugang erlauben [MATURITY]" name="public_access"/>
+			<check_box label="Öffentlichen Zugang gestatten (bei Deaktivierung dieser Option werden Bannlinien generiert)" name="public_access"/>
 			<text name="Only Allow" width="400">
-				Zugang auf Einwohner beschränken, die überprüft wurden von:
+				Zugang nur Einwohnern gestatten, die:
 			</text>
-			<check_box label="Zahlungsinformation gespeichert [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Einwohner ohne Zahlungsinformation nicht zulassen."/>
-			<check_box label="Altersüberprüfung [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Einwohner ohne Altersüberprüfung nicht zulassen. Weitere Informationen finden Sie im [SUPPORT_SITE]."/>
+			<check_box label="Zahlungsinformationen hinterlegt haben [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Um diese Parzelle besuchen zu können, müssen Einwohner Zahlungsinformationen hinterlegt haben. Weitere Informationen finden Sie auf [SUPPORT_SITE]."/>
+			<check_box label="ihr Alter bestätigt haben [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Um diese Parzelle besuchen zu können, müssen Einwohner ihr Alter bestätigt haben. Weitere Informationen finden Sie auf [SUPPORT_SITE]."/>
 			<check_box label="Gruppenzugang erlauben: [GROUP]" name="GroupCheck" tool_tip="Gruppe im Register „Allgemein“ festlegen."/>
 			<check_box label="Pässe verkaufen an:" name="PassCheck" tool_tip="Ermöglicht befristeten Zugang zu dieser Parzelle"/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/de/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/de/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..a412b530a40
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="HÄNDLER-OUTBOX">
+	<string name="OutboxFolderCount1">
+		1 Ordner
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] Ordner
+	</string>
+	<string name="OutboxImporting">
+		Ordner übertragen...
+	</string>
+	<string name="OutboxInitializing">
+		Initialisieren...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Laden...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="In Marktplatz übertragen" name="outbox_import_btn" tool_tip="In meinen Marktplatz-Laden verschieben"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_model_wizard.xml b/indra/newview/skins/default/xui/de/floater_model_wizard.xml
index a90f36f2026..ee26d51d32e 100644
--- a/indra/newview/skins/default/xui/de/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/de/floater_model_wizard.xml
@@ -6,12 +6,12 @@
 	<button label="2. Optimieren" name="optimize_btn"/>
 	<button label="1. Datei auswählen" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Modelldatei auswählen
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
 				Fortgeschrittene Benutzer: Wenn Sie bereits mit Tools zur Erstellung von 3D-Inhalten vertraut sind, können Sie den erweiterten Uploader verwenden.
 			</text>
@@ -35,26 +35,26 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Modell optimieren
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			Wir haben das Modell auf Leistung optimiert. Sie können es bei Bedarf weiter anpassen.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
-				Detailstufe generieren: Hoch
+				Detailstufe generieren: hoch
 			</text>
 			<text name="medium_detail_text">
-				Detailstufe generieren: Mittel
+				Detailstufe generieren: mittel
 			</text>
 			<text name="low_detail_text">
-				Detailstufe generieren: Niedrig
+				Detailstufe generieren: niedrig
 			</text>
 			<text name="lowest_detail_text">
-				Detailstufe generieren: Niedrigste
+				Detailstufe generieren: niedrigste
 			</text>
 		</panel>
 		<panel name="content2">
@@ -79,15 +79,15 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				Physik anpassen
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Wir erstellen eine Form für die Außenhülle des Modells. Passen Sie die Detailstufe der Form wie für den beabsichtigten Zweck erforderlich an.
 		</text>
-		<panel name="content">
+		<panel name="physics_content">
 			<button label="Physik neu berechnen" name="recalculate_physics_btn"/>
 			<button label="Neu berechnen..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
@@ -110,17 +110,17 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Überprüfen
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Auswirkung auf Parzelle/Region: Prim-Äquivalenzwert [EQUIV]
 			</text>
 			<text name="review_fee">
-				Die für das Hochladen anfallende Gebühr in Höhe von [FEE] L$ wird von Ihrem Konto abgebucht.
+				Die für das Hochladen anfallende Gebühr in Höhe von L$ [FEE] wird von Ihrem Konto abgebucht.
 			</text>
 			<text name="review_confirmation">
 				Durch Klicken auf „Hochladen“ bestätigen Sie, dass Sie die erforderlichen Rechte für das im Modell enthaltene Material besitzen.
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Upload abgeschlossen
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/de/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/de/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..429447c3784
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK-TESTS"/>
diff --git a/indra/newview/skins/default/xui/de/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/de/menu_inspect_object_gear.xml
index 7c47913e30f..73e0029b76c 100644
--- a/indra/newview/skins/default/xui/de/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/de/menu_inspect_object_gear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu name="Gear Menu">
+<toggleable_menu name="Gear Menu">
 	<menu_item_call label="Berühren" name="touch"/>
 	<menu_item_call label="Sitzen" name="sit"/>
 	<menu_item_call label="Bezahlen" name="pay"/>
@@ -12,7 +12,8 @@
 	<menu_item_call label="Hinzufügen" name="add"/>
 	<menu_item_call label="Melden" name="report"/>
 	<menu_item_call label="Ignorieren" name="block"/>
+	<menu_item_call label="Freischalten" name="unblock"/>
 	<menu_item_call label="Hineinzoomen" name="zoom_in"/>
 	<menu_item_call label="Entfernen" name="remove"/>
 	<menu_item_call label="Weitere Infos" name="more_info"/>
-</menu>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml
index 733a0b85c38..a82982f9863 100644
--- a/indra/newview/skins/default/xui/de/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/de/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Hinzufügen" name="Wearable Add"/>
 	<menu_item_call label="Ausziehen" name="Take Off"/>
 	<menu_item_call label="In Händler-Outbox kopieren" name="Merchant Copy"/>
-	<menu_item_call label="In Händler-Outbox verschieben" name="Merchant Move"/>
+	<menu_item_call label="In Marktplatz übertragen" name="Marketplace Send"/>
 	<menu_item_call label="--keine Optionen--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/de/menu_login.xml b/indra/newview/skins/default/xui/de/menu_login.xml
index c90205fbe48..b43b41a5dc2 100644
--- a/indra/newview/skins/default/xui/de/menu_login.xml
+++ b/indra/newview/skins/default/xui/de/menu_login.xml
@@ -17,8 +17,8 @@
 		<menu_item_call label="Fenstergröße einstellen..." name="Set Window Size..."/>
 		<menu_item_call label="Servicebedingungen anzeigen" name="TOS"/>
 		<menu_item_call label="Wichtige Meldung anzeigen" name="Critical"/>
-		<menu_item_call label="Test Medienbrowser" name="Web Browser Test"/>
 		<menu_item_call label="Web Content Floater Debug Test" name="Web Content Floater Debug Test"/>
+		<menu label="Protokollierungsstufe festlegen" name="Set Logging Level"/>
 		<menu_item_check label="Grid-Auswahl anzeigen" name="Show Grid Picker"/>
 		<menu_item_call label="Benachrichtigungs-Konsole anzeigen" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index a81874bee9c..a870a4c84d2 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Fliegen" name="Fly"/>
 			<menu_item_check label="Immer rennen" name="Always Run"/>
 			<menu_item_call label="Animation meines Avatars stoppen" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Gehen/Rennen/Fliegen..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Status" name="Status">
 			<menu_item_call label="Abwesend" name="Set Away"/>
 			<menu_item_call label="Beschäftigt" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Admin-Status anfordern" name="Request Admin Options"/>
-		<menu_item_call label="Admin-Status verlassen" name="Leave Admin Options"/>
-		<menu_item_call label="L$ kaufen" name="Buy and Sell L$"/>
+		<menu_item_call label="L$ kaufen..." name="Buy and Sell L$"/>
 		<menu_item_call label="Kontoübersicht..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=de"/>
 		</menu_item_call>
@@ -63,7 +62,7 @@
 			<menu_item_check label="Parzelleneigenschaften" name="Parcel Properties"/>
 			<menu_item_check label="Menü „Erweitert“" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Sonne" name="Environment Settings">
+		<menu label="Sonne" name="Sun">
 			<menu_item_call label="Sonnenaufgang" name="Sunrise"/>
 			<menu_item_call label="Mittag" name="Noon"/>
 			<menu_item_call label="Sonnenuntergang" name="Sunset"/>
@@ -178,22 +177,22 @@
 			<menu_item_check label="Fadenkreuz für Mouselook anzeigen" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Darstellungstypen" name="Rendering Types">
-			<menu_item_check label="Einfach" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Baum" name="Tree"/>
-			<menu_item_check label="Avatare" name="Character"/>
-			<menu_item_check label="Flächenpatch" name="Surface Patch"/>
-			<menu_item_check label="Himmel" name="Sky"/>
-			<menu_item_check label="Wasser" name="Water"/>
-			<menu_item_check label="Boden" name="Ground"/>
-			<menu_item_check label="Volumen" name="Volume"/>
-			<menu_item_check label="Gras" name="Grass"/>
-			<menu_item_check label="Wolken" name="Clouds"/>
-			<menu_item_check label="Partikel" name="Particles"/>
-			<menu_item_check label="Unebenheiten" name="Bump"/>
+			<menu_item_check label="Einfach" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Baum" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatare" name="Rendering Type Character"/>
+			<menu_item_check label="Flächenpatch" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Himmel" name="Rendering Type Sky"/>
+			<menu_item_check label="Wasser" name="Rendering Type Water"/>
+			<menu_item_check label="Boden" name="Rendering Type Ground"/>
+			<menu_item_check label="Volumen" name="Rendering Type Volume"/>
+			<menu_item_check label="Gras" name="Rendering Type Grass"/>
+			<menu_item_check label="Wolken" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partikel" name="Rendering Type Particles"/>
+			<menu_item_check label="Unebenheiten" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Rendering-Eigenschaften" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Ausgewählt" name="Selected"/>
 			<menu_item_check label="Farblich hervorgehoben" name="Highlighted"/>
 			<menu_item_check label="Dynamische Texturen" name="Dynamic Textures"/>
@@ -207,8 +206,6 @@
 		<menu_item_check label="Weiche Mausbewegung" name="Mouse Smoothing"/>
 		<menu_item_call label="Tasten freigeben" name="Release Keys"/>
 		<menu label="Tastaturkürzel" name="Shortcuts">
-			<menu_item_call label="Bild ([COST] L$)..." name="Upload Image"/>
-			<menu_item_check label="Suchen" name="Search"/>
 			<menu_item_check label="Erweitert-Menü anzeigen - veraltetet" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fenster schließen" name="Close Window"/>
 			<menu_item_call label="Alle Fenster schließen" name="Close All Windows"/>
@@ -217,13 +214,6 @@
 			<menu_item_check label="Joystick-Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Ansicht zurücksetzen" name="Reset View"/>
 			<menu_item_call label="Letzten Chatter ansehen" name="Look at Last Chatter"/>
-			<menu label="Bauwerkzeug auswählen" name="Select Tool">
-				<menu_item_call label="Fokus-Werkzeug" name="Focus"/>
-				<menu_item_call label="Werkzeug „Bewegen“" name="Move"/>
-				<menu_item_call label="Bearbeiten" name="Edit"/>
-				<menu_item_call label="Werkzeug „Erstellen&quot;" name="Create"/>
-				<menu_item_call label="Land-Werkzeug" name="Land"/>
-			</menu>
 			<menu_item_call label="Hineinzoomen" name="Zoom In"/>
 			<menu_item_call label="Zoom-Standard" name="Zoom Default"/>
 			<menu_item_call label="Wegzoomen" name="Zoom Out"/>
@@ -296,6 +286,7 @@
 			<menu_item_check label="Raycast" name="Raycast"/>
 			<menu_item_check label="Windvektoren" name="Wind Vectors"/>
 			<menu_item_check label="Komplexität beim Rendern" name="rendercomplexity"/>
+			<menu_item_check label="Byte in Anhängen" name="attachment bytes"/>
 			<menu_item_check label="Formen" name="Sculpt"/>
 		</menu>
 		<menu label="Rendering" name="Rendering">
@@ -337,9 +328,8 @@
 			<menu_item_call label="Aufnahme starten" name="Start Record"/>
 			<menu_item_call label="Aufnahme stoppen" name="Stop Record"/>
 		</menu>
-		<menu label="Welt" name="World">
+		<menu label="Welt" name="DevelopWorld">
 			<menu_item_check label="Sonnen-Override für Sim" name="Sim Sun Override"/>
-			<menu_item_check label="Pulsierender Strahl" name="Cheesy Beacon"/>
 			<menu_item_check label="Festgelegtes Wetter" name="Fixed Weather"/>
 			<menu_item_call label="Regionsobjekt-Cache ausgeben" name="Dump Region Object Cache"/>
 		</menu>
@@ -371,11 +361,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Geladene Textur nehmen" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Kopf" name="Head"/>
-				<menu_item_call label="Oberkörper" name="Upper Body"/>
-				<menu_item_call label="Unterkörper" name="Lower Body"/>
-				<menu_item_call label="Rock" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Kopf" name="Grab Head"/>
+				<menu_item_call label="Oberkörper" name="Grab Upper Body"/>
+				<menu_item_call label="Unterkörper" name="Grab Lower Body"/>
+				<menu_item_call label="Rock" name="Grab Skirt"/>
 			</menu>
 			<menu label="Avatar-Tests" name="Character Tests">
 				<menu_item_call label="Aussehen als XML speichern" name="Appearance To XML"/>
@@ -405,18 +395,19 @@
 		<menu_item_call label="Bilder komprimieren" name="Compress Images"/>
 		<menu_item_check label="Ausgabe Fehlerbeseitigung ausgeben" name="Output Debug Minidump"/>
 		<menu_item_check label="Bei nächster Ausführung Fenster öffnen" name="Console Window"/>
+		<menu label="Protokollierungsstufe festlegen" name="Set Logging Level"/>
 		<menu_item_call label="Admin-Status anfordern" name="Request Admin Options"/>
 		<menu_item_call label="Admin-Status verlassen" name="Leave Admin Options"/>
 		<menu_item_check label="Admin-Menü anzeigen" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Kopie nehmen" name="Take Copy"/>
-			<menu_item_call label="Besitzer zu mir zwingen" name="Force Owner To Me"/>
-			<menu_item_call label="Erlaubnis des Besitzers erzwingen" name="Force Owner Permissive"/>
+		<menu label="Objekt" name="AdminObject">
+			<menu_item_call label="Kopie nehmen" name="Admin Take Copy"/>
+			<menu_item_call label="Mich zum Besitzer machen" name="Force Owner To Me"/>
+			<menu_item_call label="Besitzererlaubnis erzwingen" name="Force Owner Permissive"/>
 			<menu_item_call label="Löschen" name="Delete"/>
-			<menu_item_call label="Fest" name="Lock"/>
-			<menu_item_call label="Asset-ID zulassen" name="Get Assets IDs"/>
+			<menu_item_call label="Sperren" name="Lock"/>
+			<menu_item_call label="Asset-IDs abrufen" name="Get Assets IDs"/>
 		</menu>
 		<menu label="Parzelle" name="Parcel">
 			<menu_item_call label="Besitzer zu mir zwingen" name="Owner To Me"/>
@@ -447,14 +438,14 @@
 			<menu_item_call label="Physik" name="Physics"/>
 			<menu_item_call label="Alle Kleider" name="All Clothes"/>
 		</menu>
-		<menu label="Hilfe" name="Help">
+		<menu label="Hilfe" name="DeprecatedHelp">
 			<menu_item_call label="Offizielles Linden-Blog" name="Official Linden Blog"/>
 			<menu_item_call label="Scripting-Portal" name="Scripting Portal"/>
 			<menu label="Fehlermeldungen" name="Bug Reporting">
 				<menu_item_call label="Allgemeiner Probleme-Tracker" name="Public Issue Tracker"/>
 				<menu_item_call label="Hilfe zum Allgemeinen Probleme-Tracker" name="Publc Issue Tracker Help"/>
 				<menu_item_call label="Fehlermeldungs-1x1" name="Bug Reporing 101"/>
-				<menu_item_call label="Sicherheitsfragen" name="Security Issues"/>
+				<menu_item_call label="Sicherheitsprobleme" name="Security Issues"/>
 				<menu_item_call label="QA-Wiki" name="QA Wiki"/>
 			</menu>
 		</menu>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index a34b938a7a6..b69bb197c8d 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -86,17 +86,38 @@ Stellen Sie sicher, dass Ihre Internetverbindung funktioniert.
 		<usetemplate canceltext="Abbrechen" name="yesnocancelbuttons" notext="Nicht speichern" yestext="Speichern"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		Ihnen fehlt die Berechtigung zum Kopieren dieses Artikels in die Händler-Outbox. Möchten Sie wirklich den folgenden Artikel verschieben?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="Nein" yestext="Ja"/>
+		Sie sind nicht berechtigt, einen oder mehrere dieser Artikel in die Händler-Outbox zu kopieren. Sie können sie verschieben oder zurücklassen.
+		<usetemplate name="okcancelbuttons" notext="Artikel nicht verschieben" yestext="Artikel verschieben"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		Für jeden Artikel, den Sie in die oberste Ebene Ihrer Händler-Outbox übertragen haben, wurde ein neuer Ordner erstellt.
+		<usetemplate ignoretext="Neuer Ordner in Händler-Outbox erstellt" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportComplete">
+		Erfolg
+
+Alle Ordner wurden erfolgreich an den Marktplatz übertragen.
+		<usetemplate ignoretext="Alle Ordner an den Marktplatz übertragen" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		Einige Ordner wurden nicht übertragen
+
+Beim Übertragen bestimmter Ordner an den Marktplatz ist ein Fehler aufgetreten. Diese Ordner befinden sich noch in Ihrer Händler-Outbox.
+
+Weitere Informationen finden Sie im [[MARKETPLACE_IMPORTS_URL] Fehlerprotokoll].
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Marktplatz-Upload abgeschlossen.
-		<usetemplate name="okbutton" yestext="Hurra!"/>
+	<notification name="OutboxImportFailed">
+		Ãœbertragung fehlgeschlagen
+
+Aufgrund eines System- oder Netzwerkfehlers wurden keine Ordner an den Marktplatz übertragen. Versuchen Sie es später erneut.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		Marktplatz-Upload mit Fehlern abgeschlossen. Korrigieren Sie die Fehler in Ihrer Outbox und versuchen Sie es erneut. Vielen Dank!
-		<usetemplate name="okbutton" yestext="Erneut versuchen"/>
+	<notification name="OutboxInitFailed">
+		Marktplatzinitialisierung fehlgeschlagen
+
+Marktplatzinitialisierung aufgrund eines System- oder Netzwerkfehlers fehlgeschlagen. Versuchen Sie es später erneut.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		Der Text für ein Skript konnte aus folgendem Grund nicht hochgeladen werden: [REASON]. Bitte versuchen Sie es erneut.
@@ -1448,7 +1469,7 @@ Zur Installation des Updates muss [APP_NAME] neu gestartet werden.
 		<usetemplate ignoretext="Bestätigen, bevor Objekte an Ihre Eigentümer zurückgegeben werden" name="okcancelignore" notext="Abbrechen" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Sie sind Mitglied der Gruppe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
+		Sie sind gegenwärtig Mitglied der Gruppe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Diese Gruppe verlassen?
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
 	</notification>
@@ -2828,6 +2849,18 @@ Details finden Sie in der Protokolldatei.
 
 für folgende Einwohner freigeben:
 
+[RESIDENTS]
+		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
+	</notification>
+	<notification name="ShareFolderConfirmation">
+		Es kann nur jeweils ein Ordner geteilt werden.
+
+Möchten Sie wirklich die folgenden Artikel:
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+mit den folgenden Einwohnern teilen:
+
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/de/panel_region_estate.xml b/indra/newview/skins/default/xui/de/panel_region_estate.xml
index b93bd3e4421..aecf6f62fc5 100644
--- a/indra/newview/skins/default/xui/de/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/de/panel_region_estate.xml
@@ -16,10 +16,10 @@
 		(unbekannt)
 	</text>
 	<text name="Only Allow">
-		Zugang nur dann, wenn überprüft mit:
+		Zugang nur Einwohnern gestatten, die:
 	</text>
-	<check_box label="Zahlungsinformation gespeichert" name="limit_payment" tool_tip="Einwohner ohne Zahlungsinformation nicht zulassen."/>
-	<check_box label="Altersüberprüfung" name="limit_age_verified" tool_tip="Einwohner ohne Altersüberprüfung verbannen. Weitere Informationen finden Sie auf [SUPPORT_SITE]."/>
+	<check_box label="Zahlungsinformationen hinterlegt haben" name="limit_payment" tool_tip="Um diesen Grundbesitz besuchen zu können, müssen Einwohner Zahlungsinformationen hinterlegt haben. Weitere Informationen finden Sie auf [SUPPORT_SITE]."/>
+	<check_box label="ihr Alter bestätigt haben" name="limit_age_verified" tool_tip="Um diesen Grundbesitz besuchen zu können, müssen Einwohner ihr Alter bestätigt haben. Weitere Informationen finden Sie auf [SUPPORT_SITE]."/>
 	<check_box label="Voice-Chat erlauben" name="voice_chat_check"/>
 	<button label="?" name="voice_chat_help"/>
 	<text name="abuse_email_text" width="222">
diff --git a/indra/newview/skins/default/xui/de/panel_script_ed.xml b/indra/newview/skins/default/xui/de/panel_script_ed.xml
index adfe2a342b7..7e03aeff15f 100644
--- a/indra/newview/skins/default/xui/de/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/de/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="Datei" name="File">
 			<menu_item_call label="Speichern" name="Save"/>
 			<menu_item_call label="Alle Änderungen zurücksetzen" name="Revert All Changes"/>
+			<menu_item_call label="Aus Datei laden..." name="LoadFromFile"/>
+			<menu_item_call label="In Datei speichern..." name="SaveToFile"/>
 		</menu>
 		<menu label="Bearbeiten" name="Edit">
 			<menu_item_call label="Rückgängig" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
index 674ea3376b3..4fc397e7d27 100644
--- a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="Sonstiges" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Erhaltene Artikel ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Erhaltene Artikel
-							</string>
-							<button label="Erhaltene Artikel" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] neu
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Einkäufe auf dem Marktplatz werden hierher geliefert.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Händler-Outbox ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Händler-Outbox
-							</string>
-							<button label="Händler-Outbox" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="In meinen Marktplatz-Laden verschieben"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Laden...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Erhaltene Artikel ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Erhaltene Artikel
+					</string>
+					<button label="Erhaltene Artikel" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] neu
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Einkäufe auf dem Marktplatz werden hierher geliefert.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 14e9fcdb7f3..44296f2619f 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -181,8 +181,8 @@ Aktuelle Informationen finden Sie unter www.secondlife.com/status.
 	</string>
 	<string name="LoginFailedPremiumOnly">
 		Die Anmeldung bei Second Life ist vorübergehend eingeschränkt, um sicherzustellen, dass Einwohner, die sich bereits inworld aufhalten, das bestmögliche Erlebnis haben.
-	 	
-Benutzer mit kostenlosen Konten können sich während dieses Zeitraums nicht bei Second Life anmelden, damit die Kapazität den Benutzern zur Verfügung steht, die ein gebührenpflichtiges Premium-Konto besitzen.
+
+Benutzer mit kostenlosen Konten können sich während dieses Zeitraums nicht bei Second Life anmelden, damit die Kapazität Benutzern zur Verfügung steht, die ein gebührenpflichtiges Premium-Konto besitzen.
 	</string>
 	<string name="LoginFailedComputerProhibited">
 		Der Zugriff auf Second Life ist von diesem Computer aus nicht möglich.
@@ -339,17 +339,35 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		Sie können nur ein einzelnes Objekt hierher ziehen
 	</string>
 	<string name="TooltipPrice" value="[AMOUNT] L$"/>
+	<string name="TooltipOutboxDragToWorld">
+		Sie können Artikel nicht in Ihrer Händler-Outbox rezzen
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Eines oder mehrere dieser Objekte können nicht verkauft oder an einen anderen Benutzer übertragen werden.
+		Einer oder mehrere dieser Artikel können nicht verkauft oder übertragen werden.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		Nur Artikel direkt aus Ihrem Inventar können in Ihre Händler-Outbox gelegt werden
 	</string>
 	<string name="TooltipOutboxWorn">
-		Sie tragen eines oder mehrere dieser Objekte. Nehmen Sie es/sie von Ihrem Avatar ab und versuchen Sie dann erneut, es/sie zu verschieben.
+		Artikel, die Sie tragen, können nicht in Ihre Händler-Outbox gelegt werden.
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		Sie können keine Visitenkarten in Ihre Händler-Outbox legen
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		Dieser Ordner hat zu viele Unterordnerebenen. Ordnen Sie die Unterordner so an, dass maximal vier Verschachtelungsebenen vorhanden sind (Stammordner enthält A enthält B enthält C).
+		Tiefe der verschachtelten Ordner überschreitet 3
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		Anzahl von Unterordnern im obersten Ordner überschreitet 20
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Dieser Ordner enthält mehr als 200 Objekte. Verpacken Sie einige dieser Artikel in Behältern, um die Anzahl zu verringern.
+		Anzahl von Artikeln im obersten Ordner überschreitet 200
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		Sie können einen Ordner nicht in einen seiner untergeordneten Ordner verschieben
+	</string>
+	<string name="TooltipDragOntoSelf">
+		Sie können einen Ordner nicht in sich selbst verschieben
 	</string>
 	<string name="TooltipHttpUrl">
 		Anklicken, um Webseite anzuzeigen
@@ -976,6 +994,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="choose_the_directory">
 		Verzeichnis auswählen
 	</string>
+	<string name="script_files">
+		Skripts
+	</string>
 	<string name="AvatarSetNotAway">
 		Nicht abwesend
 	</string>
@@ -1214,43 +1235,36 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		Sie haben keine Kopie dieser Textur in Ihrem Inventar.
 	</string>
 	<string name="InventoryInboxNoItems">
-		Wenn Sie einen Artikel kaufen oder anderweitig erhalten, erscheint er hier, damit Sie ihn in einen Ordner in Ihrem Inventar ziehen bzw. löschen können, wenn Sie ihn nicht behalten möchten.
+		Hier erscheinen bestimmte Artikel, die Sie erhalten, wie z. B. Premium-Geschenke. Sie können diese dann in Ihr Inventar ziehen.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		Ihre Händler-Outbox ist nicht richtig konfiguriert
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Konfigurationsfehler in Händler-Outbox
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Wenden Sie sich zur Behebung des Problems an den Kundendienst.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Jeder kann Artikel im Marktplatz verkaufen
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		Werden Sie Händler!
+		Jeder kann Artikel im Marktplatz verkaufen.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] Im Second Life Marktplatz] werden über eine Million virtuelle Produkte zum Verkauf angeboten, die alle von Einwohnern erstellt wurden. Auch Sie können selbst erstellte Artikel sowie bestimmte gekaufte Artikel verkaufen. Die Einrichtung eines Händlerkontos geht blitzschnell und ist kostenlos. [[LEARN_MORE_URL] Lesen Sie weitere Informationen] oder [[CREATE_STORE_URL] öffnen Sie einen Laden] im Marktplatz, um Ihre Objekte zu verkaufen.
+		Wenn Sie als Händler aktiv werden möchten, müssen Sie einen [[MARKETPLACE_CREATE_STORE_URL] Laden im Marktplatz erstellen].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Eine neue Methode, um Artikel in den Marktplatz zu übertragen
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Legen Sie Artikel hier ab, um sie zum Verkauf im Marktplatz vorzubereiten
+		Ihre Outbox ist leer.
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Ziehen Sie zu verkaufende Artikel oder Ordner in diesen Bereich. Es erscheinen Kopien der Artikel; Ihr Inventar bleibt unverändert, es sei denn, es handelt sich um einen nicht kopierbaren Artikel. Wenn die Artikel in den Marktplatz übertragen werden sollen, klicken Sie auf die Schaltfläche „Hochladen“. Nach Übertragung der Artikel in Ihr Marktplatz-Inventar verschwinden sie aus diesem Ordner.
+		Ziehen Sie Ordner in dien Bereich und klicken Sie auf „In Marktplatz übertragen“, um sie im [[MARKETPLACE_DASHBOARD_URL] Marktplatz] zum Verkauf anzubieten.
 	</string>
 	<string name="Marketplace Error None">
 		Keine Fehler
@@ -4103,8 +4117,8 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_
 		Online
 	</string>
 	<string name="uploading_abuse_report">
-		Bericht wird hochgeladen...
-  
+		Hochladen...
+
 Missbrauchsbericht
 	</string>
 	<string name="New Shape">
@@ -4372,8 +4386,8 @@ Missbrauchsbericht
 	<string name="server_is_down">
 		Trotz all unserer Bemühungen ist ein unerwarteter Fehler aufgetreten.
 
-	Bitte überprüfen Sie status.secondlifegrid.net, um festzustellen, ob ein Problem besteht.  
-        Falls Sie weiterhin Problem haben, überprüfen Sie bitte Ihre Netzwerk- und Firewalleinstellungen.
+	Bitte überprüfen Sie status.secondlifegrid.net, um herauszufinden, ob ein Problem besteht.
+ Falls Sie weiterhin Problem haben, überprüfen Sie bitte Ihre Netzwerk- und Firewalleinstellungen.
 	</string>
 	<string name="dateTimeWeekdaysNames">
 		Sonntag:Montag:Dienstag:Mittwoch:Donnerstag:Freitag:Samstag
@@ -4839,6 +4853,9 @@ Setzen Sie den Editorpfad in Anführungszeichen
 	<string name="Command_Move_Label">
 		Gehen / Rennen / Fliegen
 	</string>
+	<string name="Command_Outbox_Label">
+		Händler-Outbox
+	</string>
 	<string name="Command_People_Label">
 		Leute
 	</string>
@@ -4911,6 +4928,9 @@ Setzen Sie den Editorpfad in Anführungszeichen
 	<string name="Command_Move_Tooltip">
 		Ihren Avatar bewegen
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Artikel zum Verkauf in den Marktplatz übertragen
+	</string>
 	<string name="Command_People_Tooltip">
 		Freunde, Gruppen und Leute in der Nähe
 	</string>
diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml
index 6b8a1ff906d..fd54d74af28 100644
--- a/indra/newview/skins/default/xui/es/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/es/floater_about_land.xml
@@ -373,7 +373,7 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Pulse para elegir una imagen"/>
 			<text name="allow_label5">
-				a los avatares de esta parcela y chatear con ellos
+				Los avatares de otras parcelas pueden ver a los avatares de esta parcela y chatear con ellos
 			</text>
 			<check_box label="Ver los avatares" name="SeeAvatarsCheck" tool_tip="Permite que los avatares de otras parcelas vean a los avatares de ésta y chateen con ellos, y también que tú puedas verles y chatear con ellos."/>
 			<text name="landing_point">
@@ -460,12 +460,12 @@ los media:
 			<text name="Limit access to this parcel to:">
 				Acceso a esta parcela
 			</text>
-			<check_box label="Permitir el acceso público [MATURITY]" name="public_access"/>
+			<check_box label="Permitir el acceso público (si no seleccionas esta opción, se crearán líneas de prohibición)" name="public_access"/>
 			<text name="Only Allow">
-				Restringir el acceso a residentes verificados con:
+				Permitir únicamente el acceso a los Residentes que:
 			</text>
-			<check_box label="Información de pago aportada [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Expulsa a los Residentes no identificados."/>
-			<check_box label="Verificación de edad [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Expulsa a los Residentes que no hayan verificado su edad. Más información en [SUPPORT_SITE]."/>
+			<check_box label="Han aportado información de pago [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Para poder acceder a esta parcela los Residentes deben haber aportado información de pago en su cuenta. Para más información, ver [SUPPORT_SITE]."/>
+			<check_box label="Han verificado su edad [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Para poder acceder a esta parcela los Residentes deben haber verificado su edad. Para más información, ver [SUPPORT_SITE]."/>
 			<check_box label="Acceso permitido al grupo: [GROUP]" name="GroupCheck" tool_tip="Elija el grupo en la pestaña General."/>
 			<check_box label="Vender pases a:" name="PassCheck" tool_tip="Permitir acceso temporal a esta parcela"/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/es/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/es/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..a7c17fc136c
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="BUZÓN DE SALIDA DE COMERCIANTE">
+	<string name="OutboxFolderCount1">
+		1 carpeta
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] carpetas
+	</string>
+	<string name="OutboxImporting">
+		Enviando carpetas...
+	</string>
+	<string name="OutboxInitializing">
+		Inicializando...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Cargando...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="Enviar al Mercado" name="outbox_import_btn" tool_tip="Poner en el escaparate de Mi Mercado"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_model_wizard.xml b/indra/newview/skins/default/xui/es/floater_model_wizard.xml
index e27db5a1c4a..5bd6b5e0e55 100644
--- a/indra/newview/skins/default/xui/es/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/es/floater_model_wizard.xml
@@ -6,12 +6,12 @@
 	<button label="2. Optimizar" name="optimize_btn"/>
 	<button label="1. Seleccionar archivo" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Elige el archivo de modelo
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
 				Usuarios avanzados: si tienes experiencia con las herramientas de creación de contenidos 3D, quizá te interese utilizar la función de subida avanzada.
 			</text>
@@ -19,7 +19,7 @@
 			<text name="Cache location">
 				Elige el archivo de modelo que deseas subir
 			</text>
-			<button label="Buscar..." label_selected="Buscar..." name="browse"/>
+			<button label="Examinar..." label_selected="Examinar..." name="browse"/>
 			<text name="Model types">
 				‎Second Life admite los archivos COLLADA (.dae)
 			</text>
@@ -35,15 +35,15 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Optimizar el modelo
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			Hemos optimizado el rendimiento del modelo, pero puedes ajustarlo más si lo deseas.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
 				Generar el nivel de detalle: Alto
 			</text>
@@ -79,15 +79,15 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				Ajustar la física
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Crearemos una forma para la apariencia exterior del modelo. Ajusta el nivel de detalle de la forma según se necesite para el propósito proyectado del modelo.
 		</text>
-		<panel name="content">
+		<panel name="physics_content">
 			<button label="Recalcular física" name="recalculate_physics_btn"/>
 			<button label="Recalculando..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Revisar
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Impacto en la parcela/región: [EQUIV] equivalentes en prim
 			</text>
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Subida finalizada
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/es/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/es/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..b479d5f6d6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK TESTS"/>
diff --git a/indra/newview/skins/default/xui/es/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/es/menu_inspect_object_gear.xml
index bcdc25894f4..9d0a8c50ef4 100644
--- a/indra/newview/skins/default/xui/es/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/es/menu_inspect_object_gear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu name="Gear Menu">
+<toggleable_menu name="Gear Menu">
 	<menu_item_call label="Tocar" name="touch"/>
 	<menu_item_call label="Sentarse" name="sit"/>
 	<menu_item_call label="Pagar" name="pay"/>
@@ -12,7 +12,8 @@
 	<menu_item_call label="Añadir" name="add"/>
 	<menu_item_call label="Denunciar" name="report"/>
 	<menu_item_call label="Ignorar" name="block"/>
+	<menu_item_call label="No ignorar" name="unblock"/>
 	<menu_item_call label="Acercar el zoom" name="zoom_in"/>
 	<menu_item_call label="Quitar" name="remove"/>
 	<menu_item_call label="Más información" name="more_info"/>
-</menu>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/es/menu_inventory.xml b/indra/newview/skins/default/xui/es/menu_inventory.xml
index f1f1ef091fc..4a8f37dee4d 100644
--- a/indra/newview/skins/default/xui/es/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/es/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Añadir" name="Wearable Add"/>
 	<menu_item_call label="Quitarse" name="Take Off"/>
 	<menu_item_call label="Copiar al Buzón de salida de comerciante" name="Merchant Copy"/>
-	<menu_item_call label="Mover al Buzón de salida de comerciante" name="Merchant Move"/>
+	<menu_item_call label="Enviar al Mercado" name="Marketplace Send"/>
 	<menu_item_call label="--sin opciones--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/es/menu_login.xml b/indra/newview/skins/default/xui/es/menu_login.xml
index e3abf7ad629..289ac3f0757 100644
--- a/indra/newview/skins/default/xui/es/menu_login.xml
+++ b/indra/newview/skins/default/xui/es/menu_login.xml
@@ -16,8 +16,8 @@
 		<menu_item_call label="Definir el tamaño de la ventana..." name="Set Window Size..."/>
 		<menu_item_call label="Mostrar los &apos;TOS&apos;" name="TOS"/>
 		<menu_item_call label="Mostrar mensaje crítico" name="Critical"/>
-		<menu_item_call label="Prueba de navegadores de medios" name="Web Browser Test"/>
 		<menu_item_call label="Prueba de depuración de ventanas de contenido web" name="Web Content Floater Debug Test"/>
+		<menu label="Configurar el nivel de registro" name="Set Logging Level"/>
 		<menu_item_check label="Mostrar el selector de Grid" name="Show Grid Picker"/>
 		<menu_item_call label="Mostrar la consola de notificaciones" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index 4762e3f4a43..9522d4eac66 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Volar" name="Fly"/>
 			<menu_item_check label="Correr siempre" name="Always Run"/>
 			<menu_item_call label="Parar mis animaciones" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Caminar / Correr / Volar..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Estado" name="Status">
 			<menu_item_call label="Ausente" name="Set Away"/>
 			<menu_item_call label="Ocupado" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Solicitar estatus de Administrador" name="Request Admin Options"/>
-		<menu_item_call label="Dejar el estatus de Administrador" name="Leave Admin Options"/>
-		<menu_item_call label="Comprar L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Comprar L$..." name="Buy and Sell L$"/>
 		<menu_item_call label="Panel de control de la cuenta..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=es"/>
 		</menu_item_call>
@@ -63,7 +62,7 @@
 			<menu_item_check label="Propiedades de la parcela" name="Parcel Properties"/>
 			<menu_item_check label="Menú Avanzado" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Sol" name="Environment Settings">
+		<menu label="Sol" name="Sun">
 			<menu_item_call label="Amanecer" name="Sunrise"/>
 			<menu_item_call label="Mediodía" name="Noon"/>
 			<menu_item_call label="Atardecer" name="Sunset"/>
@@ -178,22 +177,22 @@
 			<menu_item_check label="Mostrar el Punto de Mira en la vista subjetiva" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Objetos representados" name="Rendering Types">
-			<menu_item_check label="Simple" name="Simple"/>
-			<menu_item_check label="Alfa" name="Alpha"/>
-			<menu_item_check label="Árbol" name="Tree"/>
-			<menu_item_check label="Avatares" name="Character"/>
-			<menu_item_check label="Parche de superficie" name="Surface Patch"/>
-			<menu_item_check label="Cielo" name="Sky"/>
-			<menu_item_check label="Agua" name="Water"/>
-			<menu_item_check label="Terreno" name="Ground"/>
-			<menu_item_check label="volumen" name="Volume"/>
-			<menu_item_check label="Hierba" name="Grass"/>
-			<menu_item_check label="Nubes" name="Clouds"/>
-			<menu_item_check label="Partículas" name="Particles"/>
-			<menu_item_check label="Efectos de relieve" name="Bump"/>
+			<menu_item_check label="Simple" name="Rendering Type Simple"/>
+			<menu_item_check label="Alfa" name="Rendering Type Alpha"/>
+			<menu_item_check label="Árbol" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatares" name="Rendering Type Character"/>
+			<menu_item_check label="Parcela de superficie" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Cielo" name="Rendering Type Sky"/>
+			<menu_item_check label="Agua" name="Rendering Type Water"/>
+			<menu_item_check label="Terreno" name="Rendering Type Ground"/>
+			<menu_item_check label="Volumen" name="Rendering Type Volume"/>
+			<menu_item_check label="Hierba" name="Rendering Type Grass"/>
+			<menu_item_check label="Nubes" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partículas" name="Rendering Type Particles"/>
+			<menu_item_check label="Efectos de relieve" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Rasgos renderizados" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="Seleccionado" name="Selected"/>
 			<menu_item_check label="Realzados" name="Highlighted"/>
 			<menu_item_check label="Texturas dinámicas" name="Dynamic Textures"/>
@@ -206,8 +205,6 @@
 		<menu_item_check label="Vista subjetiva suavizada" name="Mouse Smoothing"/>
 		<menu_item_call label="Recuperar las teclas" name="Release Keys"/>
 		<menu label="Atajos de teclado" name="Shortcuts">
-			<menu_item_call label="Imagen ([COST] L$)..." name="Upload Image"/>
-			<menu_item_check label="Buscar" name="Search"/>
 			<menu_item_check label="Mostrar el menú Avanzado - acceso directo antiguo" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Cerrar la ventana" name="Close Window"/>
 			<menu_item_call label="Cerrar todas las ventanas" name="Close All Windows"/>
@@ -216,13 +213,6 @@
 			<menu_item_check label="Flycam del joystick" name="Joystick Flycam"/>
 			<menu_item_call label="Volver a la vista por defecto" name="Reset View"/>
 			<menu_item_call label="Mirar al último que habló" name="Look at Last Chatter"/>
-			<menu label="Seleccionar la herramienta de construcción" name="Select Tool">
-				<menu_item_call label="Herramienta Visión" name="Focus"/>
-				<menu_item_call label="Herramienta Mover" name="Move"/>
-				<menu_item_call label="Herramienta Editar" name="Edit"/>
-				<menu_item_call label="Herramienta Crear" name="Create"/>
-				<menu_item_call label="Herramienta Terreno" name="Land"/>
-			</menu>
 			<menu_item_call label="Acercar el zoom" name="Zoom In"/>
 			<menu_item_call label="Zoom por defecto" name="Zoom Default"/>
 			<menu_item_call label="Alejar el zoom" name="Zoom Out"/>
@@ -278,6 +268,7 @@
 			<menu_item_check label="Crear cola" name="Build Queue"/>
 			<menu_item_check label="Vectores de viento" name="Wind Vectors"/>
 			<menu_item_check label="Complejidad del renderizado" name="rendercomplexity"/>
+			<menu_item_check label="Bytes de adjunto" name="attachment bytes"/>
 			<menu_item_check label="Esculpir" name="Sculpt"/>
 		</menu>
 		<menu label="Rendering" name="Rendering">
@@ -300,11 +291,10 @@
 			<menu_item_call label="Drop a Packet" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Bumps, Pushes &amp; Hits" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="World" name="World">
-			<menu_item_check label="Region Sun Override" name="Sim Sun Override"/>
-			<menu_item_check label="Beacon flashing effect" name="Cheesy Beacon"/>
-			<menu_item_check label="Fixed Weather" name="Fixed Weather"/>
-			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
+		<menu label="Mundo virtual" name="DevelopWorld">
+			<menu_item_check label="Anular el sol del Sim" name="Sim Sun Override"/>
+			<menu_item_check label="Meteorología fija" name="Fixed Weather"/>
+			<menu_item_call label="Volcar la caché de objetos de la región" name="Dump Region Object Cache"/>
 		</menu>
 		<menu label="UI" name="UI">
 			<menu_item_call label="Prueba de navegadores de medios" name="Web Browser Test"/>
@@ -324,11 +314,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Head" name="Head"/>
-				<menu_item_call label="Upper Body" name="Upper Body"/>
-				<menu_item_call label="Lower Body" name="Lower Body"/>
-				<menu_item_call label="Skirt" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Cabeza" name="Grab Head"/>
+				<menu_item_call label="Parte superior del cuerpo" name="Grab Upper Body"/>
+				<menu_item_call label="Parte inferior del cuerpo" name="Grab Lower Body"/>
+				<menu_item_call label="Falda" name="Grab Skirt"/>
 			</menu>
 			<menu label="Character Tests" name="Character Tests">
 				<menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/>
@@ -345,17 +335,19 @@
 		<menu_item_check label="HTTP Textures" name="HTTP Textures"/>
 		<menu_item_check label="Inventario HTTP" name="HTTP Inventory"/>
 		<menu_item_check label="Console Window on next Run" name="Console Window"/>
+		<menu label="Configurar el nivel de registro" name="Set Logging Level"/>
 		<menu_item_call label="Request Admin Status" name="Request Admin Options"/>
 		<menu_item_call label="Leave Admin Status" name="Leave Admin Options"/>
 		<menu_item_check label="Show Admin Menu" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Coger una copia" name="Take Copy"/>
-			<menu_item_call label="Force Owner To Me" name="Force Owner To Me"/>
-			<menu_item_call label="Force Owner Permissive" name="Force Owner Permissive"/>
+		<menu label="Objeto" name="AdminObject">
+			<menu_item_call label="Tomar una copia" name="Admin Take Copy"/>
+			<menu_item_call label="Forzar que yo sea el propietario" name="Force Owner To Me"/>
+			<menu_item_call label="Forzar permiso al propietario" name="Force Owner Permissive"/>
 			<menu_item_call label="Eliminar" name="Delete"/>
-			<menu_item_call label="Lock" name="Lock"/>
+			<menu_item_call label="Bloquear" name="Lock"/>
+			<menu_item_call label="Obtener ID de objetos" name="Get Assets IDs"/>
 		</menu>
 		<menu label="Parcel" name="Parcel">
 			<menu_item_call label="Force Owner To Me" name="Owner To Me"/>
@@ -372,5 +364,16 @@
 		<menu label="Take Off Clothing" name="Take Off Clothing">
 			<menu_item_call label="Física" name="Physics"/>
 		</menu>
+		<menu label="Ayuda" name="DeprecatedHelp">
+			<menu_item_call label="Blog oficial" name="Official Linden Blog"/>
+			<menu_item_call label="Portal de programación" name="Scripting Portal"/>
+			<menu label="Informes de fallos" name="Bug Reporting">
+				<menu_item_call label="Public Issue Tracker" name="Public Issue Tracker"/>
+				<menu_item_call label="Ayuda del Public Issue Tracker" name="Publc Issue Tracker Help"/>
+				<menu_item_call label="Informes de fallos - instrucciones" name="Bug Reporing 101"/>
+				<menu_item_call label="Problemas de seguridad" name="Security Issues"/>
+				<menu_item_call label="Wiki QA" name="QA Wiki"/>
+			</menu>
+		</menu>
 	</menu>
 </menu_bar>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index e0a20683c50..d47c3d7ad88 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -86,17 +86,38 @@ Asegúrate de que tu conexión a Internet está funcionando adecuadamente.
 		<usetemplate canceltext="Cancelar" name="yesnocancelbuttons" notext="No guardarlos" yestext="Guardarlos"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		No tienes permiso para copiar este objeto en el Buzón de salida de comerciante. ¿Estás seguro de que quieres mover el objeto siguiente?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="No" yestext="Sí"/>
+		No tienes permiso para copiar uno o varios de estos objetos en el Buzón de salida de comerciante. Puedes moverlos o dejártelos.
+		<usetemplate name="okcancelbuttons" notext="No mover objeto(s)" yestext="Mover objeto(s)"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		Se ha creado una carpeta nueva para cada objeto que has transferido al nivel superior de tu Buzón de salida de comerciante.
+		<usetemplate ignoretext="Se ha creado una carpeta nueva en el Buzón de salida de comerciante" name="okignore" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Envío al mercado finalizado.
-		<usetemplate name="okbutton" yestext="¡Hurra!"/>
+	<notification name="OutboxImportComplete">
+		Éxito
+
+Todas las carpetas se han enviado correctamente al Mercado.
+		<usetemplate ignoretext="Todas las carpetas enviadas al Mercado" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		Algunas carpetas no se han transferido
+
+Han ocurrido errores al enviar algunas carpetas al Mercado. Dichas carpetas todavía están en tu Buzón de salida de comerciante.
+
+Puedes consultar más información en el [[MARKETPLACE_IMPORTS_URL] registro de errores].
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		El envío al mercado ha tenido errores. Corrige los problemas de tu buzón de salida y repite la operación. Muchas gracias.
-		<usetemplate name="okbutton" yestext="Reintentar"/>
+	<notification name="OutboxImportFailed">
+		Error de transferencia
+
+No se han enviado carpetas al Mercado a causa de un error del sistema o de la red. Vuelve a intentarlo más tarde.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxInitFailed">
+		Error al inicializar el mercado
+
+La inicialización del mercado ha fallado por un error del sistema o de la red. Vuelve a intentarlo más tarde.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		Hubo un problema al subir el texto de un script por la siguiente razón: [REASON]. Por favor, inténtalo más tarde.
@@ -1442,8 +1463,8 @@ Debemos reiniciar [APP_NAME] para instalar la actualización.
 		<usetemplate ignoretext="Confirmar antes de devolver objetos a sus propietarios." name="okcancelignore" notext="Cancelar" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Actualmente, eres miembro del grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
-¿Dejar el grupo?
+		Actualmente perteneces al grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
+¿Deseas abandonar el grupo?
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmKick">
@@ -2823,6 +2844,18 @@ Con los siguientes residentes:
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
+	<notification name="ShareFolderConfirmation">
+		Sólo puedes compartir una carpeta en cada momento.
+
+¿Estás seguro de que quieres compartir los elementos siguientes?
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+Con los siguientes Residentes:
+
+[RESIDENTS]
+		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Aceptar"/>
+	</notification>
 	<notification name="ItemsShared">
 		Los elementos se han compartido correctamente.
 	</notification>
diff --git a/indra/newview/skins/default/xui/es/panel_region_estate.xml b/indra/newview/skins/default/xui/es/panel_region_estate.xml
index 3d0de4f083d..84c1ed7686c 100644
--- a/indra/newview/skins/default/xui/es/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_estate.xml
@@ -23,10 +23,10 @@
 	<check_box label="Permitir el acceso público" name="externally_visible_check"/>
 	<button label="?" name="externally_visible_help"/>
 	<text name="Only Allow">
-		Restringir el acceso a cuentas verificadas por:
+		Permitir únicamente el acceso a los Residentes que:
 	</text>
-	<check_box label="Información de pago aportada" name="limit_payment" tool_tip="Expulsa a los Residentes no identificados."/>
-	<check_box label="Verificación de la edad" name="limit_age_verified" tool_tip="Expulsa a los Residentes que no hayan verificado su edad. Más información en [SUPPORT_SITE]."/>
+	<check_box label="Han aportado la información de pago." name="limit_payment" tool_tip="Para poder acceder a este estado los Residentes deben haber aportado información de pago en su cuenta. Para más información, ver [SUPPORT_SITE]."/>
+	<check_box label="Han verificado su edad" name="limit_age_verified" tool_tip="Para poder acceder a este estado los Residentes deben haber verificado su edad. Para más información, ver [SUPPORT_SITE]."/>
 	<check_box label="Permitir el chat de voz" name="voice_chat_check"/>
 	<button label="?" name="voice_chat_help"/>
 	<check_box label="Permitir el teleporte a cualquier punto" name="allow_direct_teleport"/>
diff --git a/indra/newview/skins/default/xui/es/panel_script_ed.xml b/indra/newview/skins/default/xui/es/panel_script_ed.xml
index 46952c6974f..4c4077b96f0 100644
--- a/indra/newview/skins/default/xui/es/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/es/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="Archivo" name="File">
 			<menu_item_call label="Guardar" name="Save"/>
 			<menu_item_call label="Deshacer todos los cambios" name="Revert All Changes"/>
+			<menu_item_call label="Cargar desde archivo..." name="LoadFromFile"/>
+			<menu_item_call label="Guardar en archivo..." name="SaveToFile"/>
 		</menu>
 		<menu label="Editar" name="Edit">
 			<menu_item_call label="Deshacer" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
index 79d0cb84e89..f68dcc65e39 100644
--- a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="Cosas" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Objetos recibidos ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Objetos recibidos
-							</string>
-							<button label="Objetos recibidos" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] nuevos
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Aquí se entregarán las compras realizadas en el mercado.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Buzón de salida de comerciante ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Buzón de salida de comerciante
-							</string>
-							<button label="Buzón de salida de comerciante" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="Poner en el escaparate de Mi Mercado"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Cargando...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Objetos recibidos ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Objetos recibidos
+					</string>
+					<button label="Objetos recibidos" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] nuevos
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Aquí se entregarán las compras realizadas en el mercado.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 2a6f32f84f5..67c65c6ce9a 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -171,9 +171,9 @@ Actualmente, solo se permite iniciar sesión a los empleados.
 Consulta www.secondlife.com/status si deseas obtener actualizaciones.
 	</string>
 	<string name="LoginFailedPremiumOnly">
-		Se ha restringido de manera temporal el inicio de sesión en Second Life con el fin de garantizar una experiencia óptima a nuestros residentes.
-	 	
-Aquellos usuarios que dispongan de cuentas gratuitas no podrán acceder a Second Life durante este período de tiempo, ya que el propósito de esta medida es obtener espacio suficiente para los residentes que hayan pagado por acceder a Second Life.
+		Las conexiones a Second Life se han restringido provisionalmente para garantizar que los usuarios que ya están conectados tengan la mejor experiencia posible.
+
+Durante este tiempo, las personas con cuentas gratuitas no podrán acceder a Second Life, ya que tienen prioridad los usuarios con una cuenta de pago.
 	</string>
 	<string name="LoginFailedComputerProhibited">
 		No se puede acceder a Second Life desde este ordenador.
@@ -330,17 +330,35 @@ Intenta iniciar sesión de nuevo en unos instantes.
 		Aquí se puede arrastrar sólo un ítem
 	</string>
 	<string name="TooltipPrice" value="[AMOUNT] L$:"/>
+	<string name="TooltipOutboxDragToWorld">
+		No puedes colocar objetos en tu buzón de salida de comerciante
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Uno o varios de estos objetos no se pueden vender o transferir a otro usuario.
+		Uno o varios de estos objetos no se pueden vender o transferir.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		Tu buzón de salida de comerciante sólo puede aceptar objetos procedentes directamente de tu inventario
 	</string>
 	<string name="TooltipOutboxWorn">
-		Llevas puestos uno o más de estos objetos. Quítatelos del avatar y vuelve a intentar moverlos.
+		No puedes poner artículos que llevas puestos en el buzón de salida de comerciante
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		No puedes poner tarjetas de visita en tu buzón de salida de comerciante
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		Esta carpeta tiene demasiados niveles de subcarpetas. Reorganiza las carpetas interiores de forma que tengas como máximo 4 niveles de profundidad (la carpeta raíz contiene A, que contiene B, que contiene C).
+		La profundidad de carpetas anidadas excede de 3
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		El número de subcarpetas de la carpeta de nivel superior excede de 20
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Esta carpeta contiene más de 200 objetos. Guarda algunos objetos en una caja para disminuir su cantidad.
+		El número de elementos de la carpeta de nivel superior excede de 200
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		No puedes mover una carpeta a su carpeta secundaria
+	</string>
+	<string name="TooltipDragOntoSelf">
+		No puedes mover una carpeta dentro de sí misma
 	</string>
 	<string name="TooltipHttpUrl">
 		Pulsa para ver esta página web
@@ -961,6 +979,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="choose_the_directory">
 		Elegir directorio
 	</string>
+	<string name="script_files">
+		Scripts
+	</string>
 	<string name="AvatarSetNotAway">
 		Salir del estado ausente
 	</string>
@@ -1199,43 +1220,36 @@ Intenta iniciar sesión de nuevo en unos instantes.
 		No tienes en tu inventario una copia de esta textura
 	</string>
 	<string name="InventoryInboxNoItems">
-		Cuando compres un objeto o lo recibas por otra vía, aparecerá aquí, para que puedas arrastrarlo a una carpeta de tu inventario o eliminarlo si no deseas conservarlo.
+		Aquí aparecerán algunos de los objetos que recibas, como los regalos Premium. Después puedes arrastrarlos a tu inventario.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		Tu Buzón de salida de comerciante no está configurado correctamente
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Error de configuración del Buzón de salida de comerciante
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Ponte en contacto con el servicio de atención al cliente para resolver el problema.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Cualquiera puede vender objetos en el mercado
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		¡Hazte comerciante!
+		Cualquier usuario puede vender objetos en el mercado.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] El Mercado de Second Life] pone en venta más de un millón de productos virtuales, todos ellos creados por residentes. Tú también puedes vender los objetos que crees, así como algunos de los objetos que hayas comprado. Es fácil y es gratuito. [[LEARN_MORE_URL] Más información] o [[CREATE_STORE_URL] crea una tienda] en el mercado para empezar.
+		Para hacerte comerciante debes [[MARKETPLACE_CREATE_STORE_URL] crear una tienda del Mercado].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Una nueva forma para enviar objetos al mercado
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Arrastra y coloca aquí los objetos que desees preparar para venderlos en el mercado
+		El buzón de salida está vacío.
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Arrastra a esta zona los objetos o carpetas que desees vender. Aparecerá una copia del objeto, sin quitarlo de tu inventario, salvo que el objeto arrastrado sea &quot;no copiable&quot;. Cuando estés listo para enviar los objetos al mercado, pulsa en el botón Subir. Cuando se hayan trasladado los objetos a tu inventario en el mercado, desaparecerán de esta carpeta.
+		Arrastra carpetas a esta sección y pulsa en &quot;Enviar al Mercado&quot; para incluirlas en la lista de venta del [[MARKETPLACE_DASHBOARD_URL] Mercado].
 	</string>
 	<string name="Marketplace Error None">
 		Sin errores
@@ -4017,7 +4031,7 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE].
 	</string>
 	<string name="uploading_abuse_report">
 		Subiendo...
-  
+
 Denuncia de infracción
 	</string>
 	<string name="New Shape">
@@ -4285,7 +4299,7 @@ Denuncia de infracción
 	<string name="server_is_down">
 		Parece que hay algún problema que ha escapado a nuestros controles.
 
-	Visita status.secondlifegrid.net para ver si hay alguna incidencia conocida que esté afectando al servicio.  
+	Visita status.secondlifegrid.net para ver si hay alguna incidencia conocida que esté afectando al servicio.
         Si sigues teniendo problemas, comprueba la configuración de la red y del servidor de seguridad.
 	</string>
 	<string name="dateTimeWeekdaysNames">
@@ -4752,6 +4766,9 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 	<string name="Command_Move_Label">
 		Caminar / Correr / Volar
 	</string>
+	<string name="Command_Outbox_Label">
+		Buzón de salida de comerciante
+	</string>
 	<string name="Command_People_Label">
 		Gente
 	</string>
@@ -4824,6 +4841,9 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
 	<string name="Command_Move_Tooltip">
 		Desplazando el avatar
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Transfiere objetos a tu mercado para venderlos
+	</string>
 	<string name="Command_People_Tooltip">
 		Amigos, grupos y personas próximas
 	</string>
diff --git a/indra/newview/skins/default/xui/fr/floater_about_land.xml b/indra/newview/skins/default/xui/fr/floater_about_land.xml
index b554a0a892f..6f8885487a0 100644
--- a/indra/newview/skins/default/xui/fr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/fr/floater_about_land.xml
@@ -377,7 +377,7 @@ Seules les parcelles de grande taille peuvent apparaître dans la recherche.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Cliquez pour sélectionner une image"/>
 			<text name="allow_label5">
-				et chatter avec les avatars sur cette parcelle
+				Les avatars présents sur d&apos;autres parcelles peuvent voir et chatter avec les avatars présents sur cette parcelle.
 			</text>
 			<check_box label="Voir les avatars" name="SeeAvatarsCheck" tool_tip="Permettre aux avatars présents sur d&apos;autres parcelles de voir et chatter avec les avatars présents sur cette parcelle et à vous de les voir et de chatter avec eux."/>
 			<text name="landing_point">
@@ -465,12 +465,12 @@ musique :
 			<text name="Limit access to this parcel to:">
 				Accès à cette parcelle
 			</text>
-			<check_box label="Autoriser l&apos;accès public [MATURITY]" name="public_access"/>
+			<check_box label="Autoriser l&apos;accès public (des lignes d&apos;interdiction seront créées si cette case n&apos;est pas cochée)" name="public_access"/>
 			<text name="Only Allow">
-				Limiter l&apos;accès aux résidents vérifiés par :
+				Conditions d&apos;accès des résidents :
 			</text>
-			<check_box label="Informations de paiement enregistrées [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Bannir les résidents non identifiés."/>
-			<check_box label="Vérification de l&apos;âge [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Bannir les résidents qui n&apos;ont pas vérifié leur âge. Consultez la page [SUPPORT_SITE] pour plus d&apos;informations."/>
+			<check_box label="Informations de paiement enregistrées [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Pour pouvoir accéder à cette parcelle, les résidents doivent avoir enregistré des informations de paiement. Consultez le [SUPPORT_SITE] pour plus d&apos;informations."/>
+			<check_box label="Âge vérifié [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Pour que les résidents puissent accéder à cette parcelle, leur âge doit avoir fait l&apos;objet d&apos;une vérification. Consultez le [SUPPORT_SITE] pour plus d&apos;informations."/>
 			<check_box label="Autoriser l&apos;accès au groupe : [GROUP]" name="GroupCheck" tool_tip="Définir le groupe à l&apos;onglet Général."/>
 			<check_box label="Vendre des pass à :" name="PassCheck" tool_tip="Autoriser un accès temporaire à cette parcelle"/>
 			<combo_box name="pass_combo" width="110">
diff --git a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
index c7d27c05895..890411d0918 100644
--- a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="chat_bar" title="CHAT PRÈS DE MOI">
 	<panel name="bottom_panel">
-		<line_editor label="Cliquer ici pour chatter." name="chat_box" tool_tip="Appuyer sur Entrée pour dire, Ctrl-Entrée pour crier"/>
-		<button name="show_nearby_chat" tool_tip="Affiche/Masque le journal de chats près de vous"/>
+		<line_editor label="Cliquer ici pour chatter." name="chat_box" tool_tip="Appuyer sur Entrée pour dire, Ctrl+Entrée pour crier"/>
+		<button name="show_nearby_chat" tool_tip="Afficher/masquer le journal de chat près de vous."/>
 	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/fr/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..b491dd6aed3
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="BOÃŽTE D&apos;ENVOI VENDEUR">
+	<string name="OutboxFolderCount1">
+		1 dossier
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] dossiers
+	</string>
+	<string name="OutboxImporting">
+		Envoi de dossiers...
+	</string>
+	<string name="OutboxInitializing">
+		Initialisation...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Chargement...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="Envoyer vers la Place du marché" name="outbox_import_btn" tool_tip="Vers ma vitrine de la Place du marché"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_model_wizard.xml b/indra/newview/skins/default/xui/fr/floater_model_wizard.xml
index 63feb1d4037..128b9d6fa40 100644
--- a/indra/newview/skins/default/xui/fr/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/fr/floater_model_wizard.xml
@@ -6,12 +6,12 @@
 	<button label="2. Optimisation" name="optimize_btn"/>
 	<button label="1. Sélection du fichier" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Choisir un fichier de modèle
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
 				Utilisateurs expérimentés : si vous êtes habitué à utiliser des outils de création de contenu en 3D, l&apos;outil de chargement avancé est mis à votre disposition.
 			</text>
@@ -30,20 +30,20 @@
 				AVERTISSEMENT :
 			</text>
 			<text name="warning_text">
-				Vous ne pourrez pas effectuer l&apos;étape de chargement finale du modèle sur les serveurs Second Life. [secondlife:///app/floater/learn_more Découvrez comment] configurer votre compte pour les chargements de modèle de maillage.
+				Vous ne pourrez pas effectuer l&apos;étape de chargement finale du modèle sur les serveurs Second Life. [secondlife:///app/floater/learn_more Découvrez comment] configurer votre compte pour le chargement de modèles de maillage.
 			</text>
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Optimiser le modèle
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			Le modèle a été optimisé en termes de performances. Vous pouvez l&apos;ajuster si vous le souhaitez.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
 				Générer le niveau de détail : Élevé
 			</text>
@@ -79,15 +79,15 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				Ajuster les propriétés physiques
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Une forme va être créée pour l&apos;enveloppe externe du modèle. Ajustez le niveau de détail de la forme en fonction de l&apos;objectif souhaité pour votre modèle.
 		</text>
-		<panel name="content">
+		<panel name="physics_content">
 			<button label="Recalcul physique" name="recalculate_physics_btn"/>
 			<button label="Recalcul en cours..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Vérification
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Impact sur la parcelle/région : équivalent à [EQUIV] prims
 			</text>
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Chargement terminé
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/fr/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/fr/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..b479d5f6d6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK TESTS"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/fr/menu_inspect_object_gear.xml
index 074bb54cdc5..f3b974aba58 100644
--- a/indra/newview/skins/default/xui/fr/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inspect_object_gear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu name="Gear Menu">
+<toggleable_menu name="Gear Menu">
 	<menu_item_call label="Toucher" name="touch"/>
 	<menu_item_call label="M&apos;asseoir" name="sit"/>
 	<menu_item_call label="Payer" name="pay"/>
@@ -12,7 +12,8 @@
 	<menu_item_call label="Ajouter" name="add"/>
 	<menu_item_call label="Signaler" name="report"/>
 	<menu_item_call label="Ignorer" name="block"/>
+	<menu_item_call label="Ne plus ignorer" name="unblock"/>
 	<menu_item_call label="Zoomer en avant" name="zoom_in"/>
 	<menu_item_call label="Supprimer" name="remove"/>
 	<menu_item_call label="En savoir plus" name="more_info"/>
-</menu>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml
index 403111c4ded..4abc74880f1 100644
--- a/indra/newview/skins/default/xui/fr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Ajouter" name="Wearable Add"/>
 	<menu_item_call label="Enlever" name="Take Off"/>
 	<menu_item_call label="Copier vers la boîte d&apos;envoi vendeur" name="Merchant Copy"/>
-	<menu_item_call label="Déplacer vers la boîte d&apos;envoi vendeur" name="Merchant Move"/>
+	<menu_item_call label="Envoyer vers la Place du marché" name="Marketplace Send"/>
 	<menu_item_call label="--aucune option--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_login.xml b/indra/newview/skins/default/xui/fr/menu_login.xml
index 8210c1be514..dc6b2793cae 100644
--- a/indra/newview/skins/default/xui/fr/menu_login.xml
+++ b/indra/newview/skins/default/xui/fr/menu_login.xml
@@ -17,8 +17,8 @@
 		<menu_item_call label="Définir la taille de la fenêtre..." name="Set Window Size..."/>
 		<menu_item_call label="Afficher les conditions d&apos;utilisation" name="TOS"/>
 		<menu_item_call label="Afficher le message critique" name="Critical"/>
-		<menu_item_call label="Test du navigateur de médias" name="Web Browser Test"/>
 		<menu_item_call label="Test de débogage de la fenêtre flottante du contenu Web" name="Web Content Floater Debug Test"/>
+		<menu label="Définir le niveau de connexion" name="Set Logging Level"/>
 		<menu_item_check label="Afficher le sélecteur de grille" name="Show Grid Picker"/>
 		<menu_item_call label="Afficher la console des notifications" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 9303815c301..3ea863131a7 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Voler" name="Fly"/>
 			<menu_item_check label="Toujours courir" name="Always Run"/>
 			<menu_item_call label="Arrêter mon animation" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Marcher / Courir / Voler..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Statut" name="Status">
 			<menu_item_call label="Absent" name="Set Away"/>
 			<menu_item_call label="Occupé" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Demander le statut Admin" name="Request Admin Options"/>
-		<menu_item_call label="Quitter le statut Admin" name="Leave Admin Options"/>
-		<menu_item_call label="Acheter des L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Acheter des L$..." name="Buy and Sell L$"/>
 		<menu_item_call label="Page d&apos;accueil du compte..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=fr"/>
 		</menu_item_call>
@@ -63,7 +62,7 @@
 			<menu_item_check label="Propriétés de la parcelle" name="Parcel Properties"/>
 			<menu_item_check label="Menu Avancé" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Luminosité" name="Environment Settings">
+		<menu label="Luminosité" name="Sun">
 			<menu_item_call label="Aube" name="Sunrise"/>
 			<menu_item_call label="Milieu de journée" name="Noon"/>
 			<menu_item_call label="Coucher de soleil" name="Sunset"/>
@@ -178,22 +177,22 @@
 			<menu_item_check label="Afficher le réticule de la vue subjective" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Types de rendu" name="Rendering Types">
-			<menu_item_check label="Simple" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Arbre" name="Tree"/>
-			<menu_item_check label="Avatars" name="Character"/>
-			<menu_item_check label="Patch de surface" name="Surface Patch"/>
-			<menu_item_check label="Ciel" name="Sky"/>
-			<menu_item_check label="Eau" name="Water"/>
-			<menu_item_check label="Sol" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Herbe" name="Grass"/>
-			<menu_item_check label="Nuages" name="Clouds"/>
-			<menu_item_check label="Particules" name="Particles"/>
-			<menu_item_check label="Placage de relief" name="Bump"/>
+			<menu_item_check label="Simple" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Arbre" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatars" name="Rendering Type Character"/>
+			<menu_item_check label="Patch de surface" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Ciel" name="Rendering Type Sky"/>
+			<menu_item_check label="Eau" name="Rendering Type Water"/>
+			<menu_item_check label="Sol" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Herbe" name="Rendering Type Grass"/>
+			<menu_item_check label="Nuages" name="Rendering Type Clouds"/>
+			<menu_item_check label="Particules" name="Rendering Type Particles"/>
+			<menu_item_check label="Placage de relief" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Fonctionnalités de rendu" name="Rendering Features">
-			<menu_item_check label="Interface" name="UI"/>
+			<menu_item_check label="Interface" name="ToggleUI"/>
 			<menu_item_check label="Sélection" name="Selected"/>
 			<menu_item_check label="En surbrillance" name="Highlighted"/>
 			<menu_item_check label="Textures dynamiques" name="Dynamic Textures"/>
@@ -207,8 +206,6 @@
 		<menu_item_check label="Effet de lissage de la souris" name="Mouse Smoothing"/>
 		<menu_item_call label="Libérer les touches" name="Release Keys"/>
 		<menu label="Raccourcis" name="Shortcuts">
-			<menu_item_call label="Image ([COST] L$)..." name="Upload Image"/>
-			<menu_item_check label="Rechercher" name="Search"/>
 			<menu_item_check label="Afficher le menu Avancé - raccourci existant" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fermer la fenêtre" name="Close Window"/>
 			<menu_item_call label="Fermer toutes les fenêtres" name="Close All Windows"/>
@@ -217,13 +214,6 @@
 			<menu_item_check label="Joystick Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Réinitialiser la vue" name="Reset View"/>
 			<menu_item_call label="Regarder la dernière conversation" name="Look at Last Chatter"/>
-			<menu label="Sélectionner un outil de construction" name="Select Tool">
-				<menu_item_call label="Outil de mise au point" name="Focus"/>
-				<menu_item_call label="Outil de déplacement" name="Move"/>
-				<menu_item_call label="Outil de modification" name="Edit"/>
-				<menu_item_call label="Outil de création" name="Create"/>
-				<menu_item_call label="Outil Terrain" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoomer en avant" name="Zoom In"/>
 			<menu_item_call label="Zoom par défaut" name="Zoom Default"/>
 			<menu_item_call label="Zoomer en arrière" name="Zoom Out"/>
@@ -296,6 +286,7 @@
 			<menu_item_check label="Rayons" name="Raycast"/>
 			<menu_item_check label="Vecteurs de vent" name="Wind Vectors"/>
 			<menu_item_check label="Complexité du rendu" name="rendercomplexity"/>
+			<menu_item_check label="Octets d&apos;éléments attachés" name="attachment bytes"/>
 			<menu_item_check label="Sculpture" name="Sculpt"/>
 		</menu>
 		<menu label="Rendu" name="Rendering">
@@ -337,9 +328,8 @@
 			<menu_item_call label="Commencer l&apos;enregistrement" name="Start Record"/>
 			<menu_item_call label="Arrêter l&apos;enregistrement" name="Stop Record"/>
 		</menu>
-		<menu label="Monde" name="World">
+		<menu label="Monde" name="DevelopWorld">
 			<menu_item_check label="Ignorer les paramètres du soleil de la sim" name="Sim Sun Override"/>
-			<menu_item_check label="Balise animée" name="Cheesy Beacon"/>
 			<menu_item_check label="Météo fixe" name="Fixed Weather"/>
 			<menu_item_call label="Vidage de cache d&apos;objet de la région" name="Dump Region Object Cache"/>
 		</menu>
@@ -371,11 +361,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Récupérer la texture fixée" name="Grab Baked Texture">
-				<menu_item_call label="Iris" name="Iris"/>
-				<menu_item_call label="Tête" name="Head"/>
-				<menu_item_call label="Haut du corps" name="Upper Body"/>
-				<menu_item_call label="Bas du corps" name="Lower Body"/>
-				<menu_item_call label="Jupe" name="Skirt"/>
+				<menu_item_call label="Iris" name="Grab Iris"/>
+				<menu_item_call label="Tête" name="Grab Head"/>
+				<menu_item_call label="Haut du corps" name="Grab Upper Body"/>
+				<menu_item_call label="Bas du corps" name="Grab Lower Body"/>
+				<menu_item_call label="Jupe" name="Grab Skirt"/>
 			</menu>
 			<menu label="Tests personnages" name="Character Tests">
 				<menu_item_call label="Apparence dans XML" name="Appearance To XML"/>
@@ -405,18 +395,19 @@
 		<menu_item_call label="Compresser les images" name="Compress Images"/>
 		<menu_item_check label="Output Debug Minidump" name="Output Debug Minidump"/>
 		<menu_item_check label="Console Window on next Run" name="Console Window"/>
+		<menu label="Définir le niveau de connexion" name="Set Logging Level"/>
 		<menu_item_call label="Demander le statut Admin" name="Request Admin Options"/>
 		<menu_item_call label="Quitter le statut Admin" name="Leave Admin Options"/>
 		<menu_item_check label="Afficher le menu Admin" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Prendre une copie" name="Take Copy"/>
-			<menu_item_call label="Téléporter le propriétaire" name="Force Owner To Me"/>
+		<menu label="Objet" name="AdminObject">
+			<menu_item_call label="Prendre une copie" name="Admin Take Copy"/>
+			<menu_item_call label="Me faire devenir propriétaire" name="Force Owner To Me"/>
 			<menu_item_call label="Forcer la permission du propriétaire" name="Force Owner Permissive"/>
 			<menu_item_call label="Supprimer" name="Delete"/>
 			<menu_item_call label="Verrouiller" name="Lock"/>
-			<menu_item_call label="Obtenir les ID d&apos;actifs" name="Get Assets IDs"/>
+			<menu_item_call label="Obtenir les ID des actifs" name="Get Assets IDs"/>
 		</menu>
 		<menu label="Parcelle" name="Parcel">
 			<menu_item_call label="Téléporter le propriétaire" name="Owner To Me"/>
@@ -447,10 +438,10 @@
 			<menu_item_call label="Propriétés physiques" name="Physics"/>
 			<menu_item_call label="Tous les habits" name="All Clothes"/>
 		</menu>
-		<menu label="Aide" name="Help">
+		<menu label="Aide" name="DeprecatedHelp">
 			<menu_item_call label="Blog officiel des Linden" name="Official Linden Blog"/>
 			<menu_item_call label="Portail d&apos;écriture de scripts" name="Scripting Portal"/>
-			<menu label="Signaler des bugs" name="Bug Reporting">
+			<menu label="Signaler un bug" name="Bug Reporting">
 				<menu_item_call label="JIRA" name="Public Issue Tracker"/>
 				<menu_item_call label="Aide du JIRA" name="Publc Issue Tracker Help"/>
 				<menu_item_call label="Comment signaler des bugs" name="Bug Reporing 101"/>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index 2f9bf23bc42..f2dd02a495d 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -86,16 +86,37 @@ Veuillez vérifier votre connexion Internet.
 		<usetemplate canceltext="Cancel" name="yesnocancelbuttons" notext="Ne pas enregistrer" yestext="Enregistrer"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		Vous n&apos;êtes pas autorisé à copier cet article dans la boîte d&apos;envoi vers la Place du marché. Voulez-vous vraiment déplacer l&apos;article suivant ?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="Non" yestext="Oui"/>
+		Vous n&apos;êtes pas autorisé à copier un ou plusieurs de ces articles dans la boîte d&apos;envoi vendeur. Vous pouvez les déplacer ou les laisser.
+		<usetemplate name="okcancelbuttons" notext="Ne pas déplacer les articles" yestext="Déplacer les articles"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		Un nouveau dossier a été créé pour chaque article que vous avez transféré vers le niveau supérieur de votre boîte d&apos;envoi vendeur.
+		<usetemplate ignoretext="Un nouveau dossier a été créé dans la boîte d&apos;envoi vendeur." name="okignore" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Chargement sur la Place du marché terminé.
-		<usetemplate name="okbutton" yestext="Hourra !"/>
+	<notification name="OutboxImportComplete">
+		Transfert réussi
+
+Tous les dossiers ont été envoyés vers la Place du marché.
+		<usetemplate ignoretext="Tous les dossiers envoyés vers la Place du marché" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		Impossible de transférer certains dossiers
+
+Des erreurs se sont produites lors de l&apos;envoi de certains dossiers vers la Place du marché. Ces dossiers sont toujours disponibles dans votre boîte d&apos;envoi vendeur.
+
+Pour plus d&apos;informations, consultez le [[MARKETPLACE_IMPORTS_URL] journal des erreurs].
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		Chargement sur la Place du marché effectué avec des erreurs ! Corrigez les problèmes dans votre boîte d&apos;envoi et réessayez. Merci !
+	<notification name="OutboxImportFailed">
+		Échec de transfert
+
+Aucun dossier n&apos;a été envoyé vers la Place du marché en raison d&apos;une erreur système ou réseau. Veuillez réessayer ultérieurement.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxInitFailed">
+		Échec d&apos;initialisation de la Place du marché
+
+L&apos;initialisation de la Place du marché a échoué en raison d&apos;une erreur système ou réseau. Veuillez réessayer ultérieurement.
 		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
@@ -1434,7 +1455,7 @@ Version [VERSION]
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
 		Vous êtes actuellement membre du groupe &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
-Quitter le groupe ?
+Quitter le groupe ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmKick">
@@ -2816,6 +2837,18 @@ avec les résidents suivants :
 [RESIDENTS] ?
 		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
 	</notification>
+	<notification name="ShareFolderConfirmation">
+		Vous ne pouvez partager qu&apos;un dossier à la fois.
+
+Voulez-vous vraiment partager les articles suivants :
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+avec les résidents suivants :
+
+[RESIDENTS] ?
+		<usetemplate name="okcancelbuttons" notext="Annuler" yestext="Ok"/>
+	</notification>
 	<notification name="ItemsShared">
 		Articles partagés.
 	</notification>
diff --git a/indra/newview/skins/default/xui/fr/panel_region_estate.xml b/indra/newview/skins/default/xui/fr/panel_region_estate.xml
index fb650ff6462..9d97d1bf298 100644
--- a/indra/newview/skins/default/xui/fr/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/fr/panel_region_estate.xml
@@ -18,10 +18,10 @@ domaine.
 		(inconnu)
 	</text>
 	<text name="Only Allow">
-		Limiter l&apos;accès aux comptes vérifiés par :
+		Conditions d&apos;accès des résidents :
 	</text>
-	<check_box label="Infos de paiement enregistrées" name="limit_payment" tool_tip="Bannir les résidents non identifiés"/>
-	<check_box label="Vérification de l&apos;âge" name="limit_age_verified" tool_tip="Bannir les résidents qui n&apos;ont pas vérifié leur âge. Consultez la page [SUPPORT_SITE] pour plus d&apos;informations."/>
+	<check_box label="Informations de paiement enregistrées" name="limit_payment" tool_tip="Pour pouvoir accéder à ce domaine, les résidents doivent avoir enregistré des informations de paiement. Consultez le [SUPPORT_SITE] pour plus d&apos;informations."/>
+	<check_box label="Âge vérifié" name="limit_age_verified" tool_tip="Pour que les résidents puissent accéder à ce domaine, leur âge doit avoir fait l&apos;objet d&apos;une vérification. Consultez le [SUPPORT_SITE] pour plus d&apos;informations."/>
 	<check_box label="Autoriser les chats vocaux" name="voice_chat_check"/>
 	<button label="?" name="voice_chat_help"/>
 	<text name="abuse_email_text">
diff --git a/indra/newview/skins/default/xui/fr/panel_script_ed.xml b/indra/newview/skins/default/xui/fr/panel_script_ed.xml
index 2b08ae56c55..29fbe3c7e7d 100644
--- a/indra/newview/skins/default/xui/fr/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/fr/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="Fichier" name="File">
 			<menu_item_call label="Enregistrer" name="Save"/>
 			<menu_item_call label="Annuler tous les changements" name="Revert All Changes"/>
+			<menu_item_call label="Charger depuis un fichier..." name="LoadFromFile"/>
+			<menu_item_call label="Enregistrer sous..." name="SaveToFile"/>
 		</menu>
 		<menu label="Modifier" name="Edit">
 			<menu_item_call label="Annuler" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
index 969bd1ac447..cdb15a632df 100644
--- a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="Choses" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Articles reçus ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Articles reçus
-							</string>
-							<button label="Articles reçus" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] nouv.
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Ici seront livrés les achats effectués sur la Place du marché.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Boîte d&apos;envoi vendeur ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Boîte d&apos;envoi vendeur
-							</string>
-							<button label="Boîte d&apos;envoi vendeur" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="Vers ma vitrine de la Place du marché"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Chargement...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Articles reçus ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Articles reçus
+					</string>
+					<button label="Articles reçus" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] nouv.
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Ici seront livrés les achats effectués sur la Place du marché.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index d959a965650..a0c542d5249 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -181,8 +181,8 @@ Consultez la page www.secondlife.com/status pour plus d&apos;informations.
 	</string>
 	<string name="LoginFailedPremiumOnly">
 		Les connexions à Second Life sont temporairement limitées afin de s&apos;assurer que l&apos;expérience des utilisateurs présents dans le monde virtuel soit optimale.
-	 	
-Les personnes disposant de comptes gratuits ne pourront pas accéder à Second Life pendant ce temps afin de permettre à celles qui ont payé pour pouvoir utiliser Second Life puissent le faire.
+
+Les personnes disposant de comptes gratuits ne pourront pas accéder à Second Life pendant ce temps afin de permettre à celles qui ont payé pour pouvoir utiliser Second Life de le faire.
 	</string>
 	<string name="LoginFailedComputerProhibited">
 		Impossible d&apos;accéder à Second Life depuis cet ordinateur.
@@ -339,17 +339,35 @@ Veuillez réessayer de vous connecter dans une minute.
 		Impossible de faire glisser plus d&apos;un objet ici
 	</string>
 	<string name="TooltipPrice" value="[AMOUNT] L$ :"/>
+	<string name="TooltipOutboxDragToWorld">
+		Impossible de rezzer des articles dans la boîte d&apos;envoi vendeur
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Impossible de vendre ou de transférer un ou plusieurs de ces objets à un autre utilisateur.
+		Impossible de vendre ou de transférer un ou plusieurs de ces objets.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		La boîte d&apos;envoi vendeur n&apos;accepte que les articles directement issus de votre inventaire.
 	</string>
 	<string name="TooltipOutboxWorn">
-		Vous portez un ou plusieurs de ces objets. Retirez-les de votre avatar, puis réessayez de les déplacer.
+		Impossible de placer des articles que vous portez dans votre boîte d&apos;envoi vendeur
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		Impossible de placer des cartes de visite dans votre boîte d&apos;envoi vendeur
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		Trop de niveaux de sous-dossiers dans ce dossier. Réorganisez-le de sorte qu&apos;un maximum de 4 niveaux soit utilisé (dossier racine contenant A contenant B contenant C).
+		Il existe plus de 3 niveaux de dossiers imbriqués.
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		Le dossier de niveau supérieur contient plus de 20 sous-dossiers.
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Ce dossier contient plus de 200 objets. Regroupez une partie des articles dans un paquet afin de réduire le nombre d&apos;objets.
+		Le dossier de niveau supérieur contient plus de 200 articles.
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		Impossible de déplacer un dossier vers son enfant
+	</string>
+	<string name="TooltipDragOntoSelf">
+		Impossible de déplacer un dossier vers lui-même
 	</string>
 	<string name="TooltipHttpUrl">
 		Cliquez pour afficher cette page web
@@ -976,6 +994,9 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="choose_the_directory">
 		Choisir le répertoire
 	</string>
+	<string name="script_files">
+		Scripts
+	</string>
 	<string name="AvatarSetNotAway">
 		Présent
 	</string>
@@ -1214,43 +1235,36 @@ Veuillez réessayer de vous connecter dans une minute.
 		Vous n&apos;avez pas de copie de cette texture dans votre inventaire
 	</string>
 	<string name="InventoryInboxNoItems">
-		Lorsque vous achetez ou recevez un article, il s&apos;affiche ici. Vous pouvez alors le faire glisser vers un dossier de votre inventaire ou le supprimer si vous ne souhaitez pas le conserver.
+		Certains articles reçus, tels que les cadeaux Premium, s&apos;afficheront ici. Vous pourrez alors les faire glisser vers votre inventaire.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		Configuration incorrecte de votre boîte d&apos;envoi vendeur
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Erreur de configuration de la boîte d&apos;envoi vendeur
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Veuillez contacter le service clientèle pour résoudre le problème.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Tout le monde peut vendre des articles sur la Place du marché
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		Devenez vendeur !
+		Tout le monde peut vendre des articles sur la Place du marché.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] La Place du marché Second Life] comprend plus d&apos;un million de produits virtuels à vendre, tous créés par des résidents. Vous aussi pouvez vendre les articles que vous créez, ainsi que certains articles que vous avez achetés. Le processus est simple et la configuration gratuite. [[LEARN_MORE_URL] En savoir plus] ou [[CREATE_STORE_URL] créer une boutique] sur la Place du marché pour démarrer
+		Pour devenir vendeur, vous devez [[MARKETPLACE_CREATE_STORE_URL] créer une boutique sur la Place du marché].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Un nouveau moyen d&apos;envoyer des articles sur la Place du marché
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Glisser-déposer des articles ici afin de les préparer à la vente sur la Place du marché.
+		Votre boîte d&apos;envoi est vide.
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Faites glisser les articles ou dossiers d&apos;articles à vendre dans cette zone. Une copie de l&apos;article s&apos;affiche, sans que votre inventaire ne soit modifié, sauf si vous avez fait glisser un article pour lequel la copie est interdite. Une fois prêt à envoyer les articles vers la Place du marché, cliquez sur le bouton Charger. Les articles disparaissent de ce dossier lorsqu&apos;ils ont été déplacés vers l&apos;inventaire de la Place du marché.
+		Pour mettre des dossiers en vente sur la [[MARKETPLACE_DASHBOARD_URL] Place du marché], faites-les glisser vers cette zone et cliquez sur &quot;Envoyer vers la Place du marché&quot;.
 	</string>
 	<string name="Marketplace Error None">
 		Aucune erreur
@@ -4103,9 +4117,9 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		En ligne
 	</string>
 	<string name="uploading_abuse_report">
-		Chargement en cours... 
+		Chargement...
 
-de l&apos;infraction signalée
+du rapport d&apos;infraction
 	</string>
 	<string name="New Shape">
 		Nouvelle silhouette
@@ -4372,7 +4386,7 @@ de l&apos;infraction signalée
 	<string name="server_is_down">
 		Malgré nos efforts, une erreur inattendue s&apos;est produite.
 
-	Veuillez vous reporter à status.secondlifegrid.net afin de déterminer si un problème connu existe avec ce service.  
+	Veuillez vous reporter à status.secondlifegrid.net afin de déterminer si un problème connu existe avec ce service.
         Si le problème persiste, vérifiez la configuration de votre réseau et de votre pare-feu.
 	</string>
 	<string name="dateTimeWeekdaysNames">
@@ -4839,6 +4853,9 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 	<string name="Command_Move_Label">
 		Marcher / Courir / Voler
 	</string>
+	<string name="Command_Outbox_Label">
+		Boîte d&apos;envoi vendeur
+	</string>
 	<string name="Command_People_Label">
 		Personnes
 	</string>
@@ -4911,6 +4928,9 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
 	<string name="Command_Move_Tooltip">
 		Faire bouger votre avatar
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Transférer des articles vers votre place de marché afin de les vendre.
+	</string>
 	<string name="Command_People_Tooltip">
 		Amis, groupes et personnes près de vous
 	</string>
diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml
index 528cf185fcf..cfc3ad8fdb5 100644
--- a/indra/newview/skins/default/xui/it/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/it/floater_about_land.xml
@@ -378,7 +378,7 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Clicca per scegliere una immagine"/>
 			<text name="allow_label5">
-				e chattare con avatar in questo lotto
+				Gli avatar su altri lotti possono vedere gli avatar su questo lotto e chattare con loro
 			</text>
 			<check_box label="Vedi avatar" name="SeeAvatarsCheck" tool_tip="Consente ad avatar in altri lotti di vedere e chattare con avatar in questo lotto e viceversa."/>
 			<text name="landing_point">
@@ -465,12 +465,12 @@ Media:
 			<text name="Limit access to this parcel to:">
 				Accesso a questo terreno
 			</text>
-			<check_box label="Consenti l&apos;accesso pubblico [MATURITY]" name="public_access"/>
+			<check_box label="Consenti l&apos;accesso pubblico (se si rimuove la selezione vengono create linee di espulsione)" name="public_access"/>
 			<text name="Only Allow">
-				Consenti l&apos;accesso soltanto ai residenti verificati tramite:
+				Consenti l&apos;accesso solo ai Residenti che:
 			</text>
-			<check_box label="Informazioni di pagamento in archivio [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Espelli i residenti non identificati."/>
-			<check_box label="Verifica dell&apos;età [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Espelli i residenti che non hanno la loro età verificata. Vedi [SUPPORT_SITE] per maggiori informazioni."/>
+			<check_box label="Hanno informazioni di pagamento in archivio [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Per poter visitare questo lotto i Residenti devono aver fornito informazioni di pagamento a Linden Lab.  Vedi [SUPPORT_SITE] per maggiori informazioni."/>
+			<check_box label="Hanno verificato l&apos;età [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Per poter visitare questo lotto i Residenti devono aver verificato la propria età. Vedi [SUPPORT_SITE] per maggiori informazioni."/>
 			<check_box label="Permetti accesso al gruppo: [GROUP]" name="GroupCheck" tool_tip="Imposta il gruppo nel pannello generale."/>
 			<check_box label="Vendi pass a:" name="PassCheck" tool_tip="Permetti in questo terreno l&apos;accesso temporaneo"/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/it/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/it/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..02f257d4664
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="CASELLA IN USCITA DEL RIVENDITORE">
+	<string name="OutboxFolderCount1">
+		1 cartella
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] cartelle
+	</string>
+	<string name="OutboxImporting">
+		Invio cartelle...
+	</string>
+	<string name="OutboxInitializing">
+		Inizializzazione...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Caricamento...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="Invia a Marketplace" name="outbox_import_btn" tool_tip="Push su negozio Marketplace"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_model_wizard.xml b/indra/newview/skins/default/xui/it/floater_model_wizard.xml
index 7c1b13c18fb..ab5fdb29e4a 100644
--- a/indra/newview/skins/default/xui/it/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/it/floater_model_wizard.xml
@@ -6,12 +6,12 @@
 	<button label="2. Ottimizza" name="optimize_btn"/>
 	<button label="1. Seleziona file" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Seleziona file modello
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
 				Utenti avanzati: Gli utenti che hanno dimestichezza con gli strumenti di creazione 3D possono usare le opzioni di caricamento avanzate.
 			</text>
@@ -35,15 +35,15 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Ottimizza modello
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			Abbiamo ottimizzato il modello per migliorare le prestazioni. Se necessario, può essere regolato ulteriormente.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
 				Genera livello di dettaglio: Alto
 			</text>
@@ -79,15 +79,15 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				Modifica fisica
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Verrà creata una forma per lo scafo esterno del modello. Regola il livello di dettaglio della forma in base al fine desiderato del modello.
 		</text>
-		<panel name="content">
+		<panel name="physics_content">
 			<button label="Ricalcola fisica" name="recalculate_physics_btn"/>
 			<button label="Ricalcolo in corso..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Rivedi
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Impatto sul lotto o sulla regione: [EQUIV] prim equivalenti
 			</text>
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Caricamento completato
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/it/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/it/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..b479d5f6d6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK TESTS"/>
diff --git a/indra/newview/skins/default/xui/it/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/it/menu_inspect_object_gear.xml
index ede4a507c02..4740c9bf670 100644
--- a/indra/newview/skins/default/xui/it/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/it/menu_inspect_object_gear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu name="Gear Menu">
+<toggleable_menu name="Gear Menu">
 	<menu_item_call label="Tocca" name="touch"/>
 	<menu_item_call label="Siediti" name="sit"/>
 	<menu_item_call label="Paga" name="pay"/>
@@ -12,7 +12,8 @@
 	<menu_item_call label="Aggiungi" name="add"/>
 	<menu_item_call label="Segnala" name="report"/>
 	<menu_item_call label="Blocca" name="block"/>
+	<menu_item_call label="Sblocca" name="unblock"/>
 	<menu_item_call label="Zoom avanti" name="zoom_in"/>
 	<menu_item_call label="Rimuovi" name="remove"/>
 	<menu_item_call label="Maggiori informazioni" name="more_info"/>
-</menu>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/it/menu_inventory.xml b/indra/newview/skins/default/xui/it/menu_inventory.xml
index 57aa4dc97dc..fc3a82a959f 100644
--- a/indra/newview/skins/default/xui/it/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/it/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Aggiungi" name="Wearable Add"/>
 	<menu_item_call label="Togli" name="Take Off"/>
 	<menu_item_call label="Copia nella casella venditore in uscita" name="Merchant Copy"/>
-	<menu_item_call label="Passa alla casella venditore in uscita" name="Merchant Move"/>
+	<menu_item_call label="Invia a Marketplace" name="Marketplace Send"/>
 	<menu_item_call label="--nessuna opzione--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/it/menu_login.xml b/indra/newview/skins/default/xui/it/menu_login.xml
index 834db974daf..7b060e65654 100644
--- a/indra/newview/skins/default/xui/it/menu_login.xml
+++ b/indra/newview/skins/default/xui/it/menu_login.xml
@@ -16,8 +16,8 @@
 		<menu_item_call label="Imposta dimensioni della finestra..." name="Set Window Size..."/>
 		<menu_item_call label="Mostra i Termini del servizio (TOS)" name="TOS"/>
 		<menu_item_call label="Mostra messaggio critico" name="Critical"/>
-		<menu_item_call label="Test browser multimedia" name="Web Browser Test"/>
 		<menu_item_call label="Test debug finestra contenuti Web" name="Web Content Floater Debug Test"/>
+		<menu label="Imposta livello di registrazione" name="Set Logging Level"/>
 		<menu_item_check label="Mostra selettore griglia" name="Show Grid Picker"/>
 		<menu_item_call label="Mostra Console notifiche" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index 5140d2b1ec1..dee1634a1b9 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Vola" name="Fly"/>
 			<menu_item_check label="Corri sempre" name="Always Run"/>
 			<menu_item_call label="Ferma animazione" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Cammina / corri / vola..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Stato" name="Status">
 			<menu_item_call label="Assente" name="Set Away"/>
 			<menu_item_call label="Non disponibile" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Richiedi diritti Admin" name="Request Admin Options"/>
-		<menu_item_call label="Lascia stato Admin" name="Leave Admin Options"/>
-		<menu_item_call label="Compra L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Acquista L$..." name="Buy and Sell L$"/>
 		<menu_item_call label="Dashboard dell&apos;account..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=it"/>
 		</menu_item_call>
@@ -63,7 +62,7 @@
 			<menu_item_check label="Proprietà del lotto" name="Parcel Properties"/>
 			<menu_item_check label="Menu Avanzato" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Sole" name="Environment Settings">
+		<menu label="Sole" name="Sun">
 			<menu_item_call label="Alba" name="Sunrise"/>
 			<menu_item_call label="Mezzogiorno" name="Noon"/>
 			<menu_item_call label="Tramonto" name="Sunset"/>
@@ -178,22 +177,22 @@
 			<menu_item_check label="Mostra mirino visuale soggettiva" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Modalità di rendering" name="Rendering Types">
-			<menu_item_check label="Semplice" name="Simple"/>
-			<menu_item_check label="Alpha (Trasparenza)" name="Alpha"/>
-			<menu_item_check label="Albero" name="Tree"/>
-			<menu_item_check label="Avatar" name="Character"/>
-			<menu_item_check label="Superficie chiusa" name="Surface Patch"/>
-			<menu_item_check label="Cielo" name="Sky"/>
-			<menu_item_check label="Acqua" name="Water"/>
-			<menu_item_check label="Suolo" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Erba" name="Grass"/>
-			<menu_item_check label="Nuvole" name="Clouds"/>
-			<menu_item_check label="Particelle" name="Particles"/>
-			<menu_item_check label="Urti" name="Bump"/>
+			<menu_item_check label="Semplice" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha (Trasparenza)" name="Rendering Type Alpha"/>
+			<menu_item_check label="Albero" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatar" name="Rendering Type Character"/>
+			<menu_item_check label="Toppa superficie" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Cielo" name="Rendering Type Sky"/>
+			<menu_item_check label="Acqua" name="Rendering Type Water"/>
+			<menu_item_check label="Suolo" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Erba" name="Rendering Type Grass"/>
+			<menu_item_check label="Nuvole" name="Rendering Type Clouds"/>
+			<menu_item_check label="Particelle" name="Rendering Type Particles"/>
+			<menu_item_check label="Urto" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Caratteristiche di rendering" name="Rendering Features">
-			<menu_item_check label="Interfaccia utente" name="UI"/>
+			<menu_item_check label="Interfaccia utente" name="ToggleUI"/>
 			<menu_item_check label="Selezionati" name="Selected"/>
 			<menu_item_check label="Evidenziato" name="Highlighted"/>
 			<menu_item_check label="Texture dinamiche" name="Dynamic Textures"/>
@@ -206,8 +205,6 @@
 		<menu_item_check label="Fluidità mouse" name="Mouse Smoothing"/>
 		<menu_item_call label="Rilascia tasti" name="Release Keys"/>
 		<menu label="Scorciatoie" name="Shortcuts">
-			<menu_item_call label="Immagine ([COST]L$)..." name="Upload Image"/>
-			<menu_item_check label="Cerca" name="Search"/>
 			<menu_item_check label="Mostra menu Avanzato - tasti di scelta rapida esistenti" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Chiudi finestra" name="Close Window"/>
 			<menu_item_call label="Chiudi tutte le finestre" name="Close All Windows"/>
@@ -216,13 +213,6 @@
 			<menu_item_check label="Joystick Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Reimposta vista" name="Reset View"/>
 			<menu_item_call label="Guarda l&apos;ultima conversazione" name="Look at Last Chatter"/>
-			<menu label="Seleziona strumento di costruzione" name="Select Tool">
-				<menu_item_call label="Strumento Ingrandisci" name="Focus"/>
-				<menu_item_call label="Strumento Movimento" name="Move"/>
-				<menu_item_call label="Strumento Modifica" name="Edit"/>
-				<menu_item_call label="Strumento Crea" name="Create"/>
-				<menu_item_call label="Strumento Terreno" name="Land"/>
-			</menu>
 			<menu_item_call label="Zoom avanti" name="Zoom In"/>
 			<menu_item_call label="Zoom predefinito" name="Zoom Default"/>
 			<menu_item_call label="Zoom indietro" name="Zoom Out"/>
@@ -278,6 +268,7 @@
 			<menu_item_check label="Crea coda" name="Build Queue"/>
 			<menu_item_check label="Vettori vento" name="Wind Vectors"/>
 			<menu_item_check label="Complessità rendering" name="rendercomplexity"/>
+			<menu_item_check label="Byte collegamento" name="attachment bytes"/>
 			<menu_item_check label="Scolpisci" name="Sculpt"/>
 		</menu>
 		<menu label="Rendering" name="Rendering">
@@ -300,9 +291,8 @@
 			<menu_item_call label="Lascia un pacchetto" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Urti, spinte e contatti" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Mondo" name="World">
-			<menu_item_check label="Esclusione al sole della regione" name="Sim Sun Override"/>
-			<menu_item_check label="Effetto marcatore lampeggiante" name="Cheesy Beacon"/>
+		<menu label="Mondo" name="DevelopWorld">
+			<menu_item_check label="Esclusione al sole della simulazione" name="Sim Sun Override"/>
 			<menu_item_check label="Clima fisso" name="Fixed Weather"/>
 			<menu_item_call label="Dump della cache oggetti regione" name="Dump Region Object Cache"/>
 		</menu>
@@ -324,11 +314,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Iride" name="Iris"/>
-				<menu_item_call label="Testa" name="Head"/>
-				<menu_item_call label="Parte superiore del corpo" name="Upper Body"/>
-				<menu_item_call label="Parte inferiore del corpo" name="Lower Body"/>
-				<menu_item_call label="Gonna" name="Skirt"/>
+				<menu_item_call label="Iride" name="Grab Iris"/>
+				<menu_item_call label="Testa" name="Grab Head"/>
+				<menu_item_call label="Parte superiore del corpo" name="Grab Upper Body"/>
+				<menu_item_call label="Parte inferiore del corpo" name="Grab Lower Body"/>
+				<menu_item_call label="Gonna" name="Grab Skirt"/>
 			</menu>
 			<menu label="Test personaggio" name="Character Tests">
 				<menu_item_call label="Alterna la geometria dei personaggi" name="Toggle Character Geometry"/>
@@ -345,17 +335,19 @@
 		<menu_item_check label="Texture HTTP" name="HTTP Textures"/>
 		<menu_item_check label="Inventario HTTP" name="HTTP Inventory"/>
 		<menu_item_check label="Finestra Console al prossimo lancio" name="Console Window"/>
+		<menu label="Imposta livello di registrazione" name="Set Logging Level"/>
 		<menu_item_call label="Richiedi diritti Admin" name="Request Admin Options"/>
 		<menu_item_call label="Lascia stato Admin" name="Leave Admin Options"/>
 		<menu_item_check label="Mostra menu Admin" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Prendi copia" name="Take Copy"/>
+		<menu label="Oggetto" name="AdminObject">
+			<menu_item_call label="Prendi copia" name="Admin Take Copy"/>
 			<menu_item_call label="Rendimi proprietario" name="Force Owner To Me"/>
 			<menu_item_call label="Forza permesso proprietario" name="Force Owner Permissive"/>
 			<menu_item_call label="Elimina" name="Delete"/>
 			<menu_item_call label="Blocca" name="Lock"/>
+			<menu_item_call label="Ottieni ID asset" name="Get Assets IDs"/>
 		</menu>
 		<menu label="Lotto" name="Parcel">
 			<menu_item_call label="Rendimi proprietario" name="Owner To Me"/>
@@ -372,5 +364,16 @@
 		<menu label="Take Off Clothing" name="Take Off Clothing">
 			<menu_item_call label="Fisica" name="Physics"/>
 		</menu>
+		<menu label="Guida" name="DeprecatedHelp">
+			<menu_item_call label="Blog ufficiale Linden" name="Official Linden Blog"/>
+			<menu_item_call label="Portale script" name="Scripting Portal"/>
+			<menu label="Segnalazione bug" name="Bug Reporting">
+				<menu_item_call label="Monitoraggio problemi pubblici" name="Public Issue Tracker"/>
+				<menu_item_call label="Guida Monitoraggio problemi pubblici" name="Publc Issue Tracker Help"/>
+				<menu_item_call label="Guida alla segnalazione di bug" name="Bug Reporing 101"/>
+				<menu_item_call label="Problemi sicurezza" name="Security Issues"/>
+				<menu_item_call label="Wiki domande e risposte" name="QA Wiki"/>
+			</menu>
+		</menu>
 	</menu>
 </menu_bar>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index fcc515186df..24e8fd6274e 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -86,17 +86,38 @@ Accertati che la tua connessione Internet stia funzionando correttamente.
 		<usetemplate canceltext="Annulla" name="yesnocancelbuttons" notext="Non salvare" yestext="Salva"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		Non hai l&apos;autorizzazione necessaria per copiare questo oggetto nella casella in uscita di Marketplace. Sei sicuro di volere spostare gli oggetti seguenti?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="No" yestext="Sì"/>
+		Non hai l&apos;autorizzazione necessaria per copiare almeno uno di questi elementi nella casella in uscita del rivenditore.  Puoi spostarli o lasciarli indietro.
+		<usetemplate name="okcancelbuttons" notext="Non spostare gli oggetti" yestext="Sposta oggetti"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Caricamento di Marketplace completato.
-		<usetemplate name="okbutton" yestext="Ottimo!"/>
+	<notification name="OutboxFolderCreated">
+		Una nuova cartella è stata creata per ciascun elemento trasferito nel livello superiore della casella in uscita del rivenditore.
+		<usetemplate ignoretext="Una nuova cartella è stata creata nella casella in uscita del rivenditore" name="okignore" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		Caricamento di Marketplace completato senza errori.  Correggi i problemi nella casella in uscita e riprova. Grazie.
-		<usetemplate name="okbutton" yestext="Riprova"/>
+	<notification name="OutboxImportComplete">
+		Successo
+
+Tutte le cartelle sono state inviate a Marketplace correttamente.
+		<usetemplate ignoretext="Tutte le cartelle inviate a Marketplace" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		Alcune cartelle non sono state trasferite
+
+Si sono verificati degli errori durante l&apos;invio di alcune cartelle a Marketplace.  Tali cartelle sono ancora nella casella in uscita del rivenditore.
+
+Per ulteriori informazioni consulta il [[MARKETPLACE_IMPORTS_URL] registro errori].
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportFailed">
+		Trasferimento non riuscito
+
+Nessuna cartella è stata inviata a Marketplace, a causa di un errore di sistema o di rete.  Riprova più tardi.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxInitFailed">
+		Inizializzazione Marketplace non riuscita
+
+L&apos;inizializzazione con il Marketplace non ha avuto successo a causa di un errore di sistema o di rete.  Riprova più tardi.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		C&apos;è stato un problema importando il testo di uno script per la seguente ragione: [REASON]. Riprova più tardi.
@@ -1437,8 +1458,8 @@ Per installare l&apos;aggiornamento è necessario riavviare [APP_NAME].
 		<usetemplate ignoretext="Conferma prima di restituire gli oggetti ai relativi proprietari" name="okcancelignore" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Sei attualmente un membro del gruppo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
-Vuoi lasciare il gruppo?
+		Attualmente sei un membro del gruppo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
+Lasciare il gruppo?
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmKick">
@@ -2818,6 +2839,18 @@ Con i seguenti residenti?
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
 	</notification>
+	<notification name="ShareFolderConfirmation">
+		Si può condividere solo una cartella alla volta.
+
+Sei sicuro di volere condividere gli oggetti seguenti:
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+Con i seguenti residenti:
+
+[RESIDENTS]
+		<usetemplate name="okcancelbuttons" notext="Annulla" yestext="Ok"/>
+	</notification>
 	<notification name="ItemsShared">
 		Gli oggetti sono stati condivisi.
 	</notification>
diff --git a/indra/newview/skins/default/xui/it/panel_region_estate.xml b/indra/newview/skins/default/xui/it/panel_region_estate.xml
index 61e3f310243..da6b6b277f5 100644
--- a/indra/newview/skins/default/xui/it/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_estate.xml
@@ -23,10 +23,10 @@
 	<check_box label="Permetti accesso pubblico" name="externally_visible_check"/>
 	<button label="?" name="externally_visible_help"/>
 	<text name="Only Allow">
-		Limita l&apos;accesso agli account verificati con:
+		Consenti l&apos;accesso solo ai Residenti che:
 	</text>
-	<check_box label="Informazioni di pagamento in archivio" name="limit_payment" tool_tip="Espelli i residenti non identificati"/>
-	<check_box label="Verifica età" name="limit_age_verified" tool_tip="Espelli i residenti che non hanno la loro età verificata. Vedi [SUPPORT_SITE] per maggiori informazioni."/>
+	<check_box label="Hanno memorizzato le informazioni per l&apos;addebito" name="limit_payment" tool_tip="Per poter visitare questa proprietà immobiliare i Residenti devono aver fornito informazioni di pagamento a Linden Lab.  Vedi [SUPPORT_SITE] per maggiori informazioni."/>
+	<check_box label="Hanno verificato l&apos;età" name="limit_age_verified" tool_tip="Per poter visitare questa proprietà immobiliare i Residenti devono aver verificato la propria età. Vedi [SUPPORT_SITE] per maggiori informazioni."/>
 	<check_box label="Permetti la chat voice" name="voice_chat_check"/>
 	<button label="?" name="voice_chat_help"/>
 	<check_box label="Permetti teleport diretto" name="allow_direct_teleport"/>
diff --git a/indra/newview/skins/default/xui/it/panel_script_ed.xml b/indra/newview/skins/default/xui/it/panel_script_ed.xml
index 950dfacf3a4..d7ee8230b35 100644
--- a/indra/newview/skins/default/xui/it/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/it/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="File" name="File">
 			<menu_item_call label="Salva" name="Save"/>
 			<menu_item_call label="Annulla tutte le modifiche" name="Revert All Changes"/>
+			<menu_item_call label="Carica da file..." name="LoadFromFile"/>
+			<menu_item_call label="Salva su file..." name="SaveToFile"/>
 		</menu>
 		<menu label="Modifica" name="Edit">
 			<menu_item_call label="Annulla" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
index 5d6c7681f9a..f5c00f432b5 100644
--- a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="Cose" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Oggetti ricevuti ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Oggetti ricevuti
-							</string>
-							<button label="Oggetti ricevuti" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] nuovi
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Gli acquisti dal mercato verranno consegnati qui.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Casella venditore in uscita ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Casella venditore in uscita
-							</string>
-							<button label="Casella venditore in uscita" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="Push su negozio Marketplace"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Caricamento in corso...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Oggetti ricevuti ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Oggetti ricevuti
+					</string>
+					<button label="Oggetti ricevuti" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] nuovi
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Gli acquisti dal mercato verranno consegnati qui.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index c81dd0f55d5..29bfab5f0d7 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -178,8 +178,8 @@ Visita www.secondlife.com/status per aggiornamenti.
 	</string>
 	<string name="LoginFailedPremiumOnly">
 		L&apos;accesso a Second Life è temporaneamente limitato per garantire che chi è nel mondo virtuale abbia la migliore esperienza possibile.
-	 	
-Le persona con account gratuiti non potrenno accedere a Second Life durante questo periodo, per lasciare spazio alle persone che hanno pagato per Second Life.
+
+Le persone con account gratuiti non potranno accedere a Second Life durante questo periodo, per lasciare spazio alle persone che hanno pagato per Second Life.
 	</string>
 	<string name="LoginFailedComputerProhibited">
 		Non si può accedere a Second Life da questo computer.
@@ -336,17 +336,35 @@ Prova ad accedere nuovamente tra un minuto.
 		Solo un singolo oggetto può essere creato qui
 	</string>
 	<string name="TooltipPrice" value="L$ [AMOUNT]:"/>
+	<string name="TooltipOutboxDragToWorld">
+		Non puoi rezzare elementi nella tua casella in uscita del rivenditore
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Almeno un oggetto non può essere venduto o trasferito a un altro utente.
+		Almeno uno di questi oggetti non può essere venduto o trasferito.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		La tua casella in uscita del rivenditore può accettare solo elementi provenienti dal tuo inventario
 	</string>
 	<string name="TooltipOutboxWorn">
-		Stai indossando almeno uno degli oggetti. Rimuovili dall&apos;avatar e prova nuovamente a spostarli.
+		Non puoi mettere gli elementi che indossi nella casella in uscita del rivenditore
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		Non puoi inserire il tuo biglietto da visita nella tua casella in uscita del rivenditore
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		Questa cartella contiene troppi livelli di cartelle nidificate. Riordina le cartelle interne in modo che non ci siano più di 4 livelli (cartella principale che contiene la cartella A, che contiene la cartella B, che contiene la cartella C).
+		La profondità delle caselle nidificate è maggiore di 3
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		Il numero di sottocartelle nella cartella al livello più alto è maggiore di 20
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Questa cartella contiene più di 200 oggetti. Inserisci alcuni oggetti in scatole per ridurne il numero.
+		Il numero di elementi nella cartella al livello più alto è maggiore di 200
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		Non puoi spostare una cartella nella relativa cartella secondaria
+	</string>
+	<string name="TooltipDragOntoSelf">
+		Non puoi spostare una cartella in se stessa
 	</string>
 	<string name="TooltipHttpUrl">
 		Clicca per visitare questa pagina web
@@ -967,6 +985,9 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="choose_the_directory">
 		Scegli la cartella
 	</string>
+	<string name="script_files">
+		Script
+	</string>
 	<string name="AvatarSetNotAway">
 		Imposta come non assente
 	</string>
@@ -1205,43 +1226,36 @@ Prova ad accedere nuovamente tra un minuto.
 		Non hai una copia di questa texture nel tuo inventario
 	</string>
 	<string name="InventoryInboxNoItems">
-		Quando acquisti o ricevi un oggetto, verrà visualizzato qui per permetterti di trascinarlo in una cartella dell&apos;inventario o di cancellarlo se non desideri mantenerlo.
+		Alcuni elementi che riceverai, come ad esempio gli omaggi per l&apos;abbonamento Premium, verranno mostrati qui.  Potrai quindi trascinarli nel tuo inventario.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]/learn_more
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		La casella in uscita del rivenditore non è configurata correttamente
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Errore di configurazione della casella in uscita del rivenditore
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Contatta l&apos;Assistenza clienti per correggere il problema.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Chiunque può vendere oggetti nel Marketplace
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		Diventa un rivenditore!
+		Chiunque può vendere oggetti nel Marketplace.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] Second Life Marketplace] offre in vendita più di un milione di prodotti virtuali, tutti creati da Residenti. Anche tu puoi vendere gli oggetti che crei, oltre ad alcuni degli oggetti che hai acquistato. È facile da usare e l&apos;impostazione è gratuita. [[LEARN_MORE_URL] Leggi ulteriori informazioni] oppure [[CREATE_STORE_URL] crea un negozio] sul Marketplace per cominciare.
+		Per diventare un venditore, devi [[MARKETPLACE_CREATE_STORE_URL] creare un negozio nel Marketplace].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Un nuovo modo di inviare oggetti al Marketplace
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Trascina gli oggetti qui per prepararli per la vendita nel Marketplace
+		La tua casella in uscita è vuota.
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Trascina elementi o cartelle che desideri vendere in quest&apos;area. Verrà visualizzata una copia dell&apos;elemento, senza che venga modificato l&apos;inventario, tranne nel caso in cui venga trascinato un oggetto per cui non è permessa la copia. Clicca sul pulsante Carica per caricare gli elementi su Marketplace. Dopo aver spostato gli elementi nell&apos;inventario di Marketplace, non saranno più visibili in questa cartella.
+		Trascina le cartelle in questa area e clicca su &quot;Invia a Marketplace&quot; per metterle in vendita su [[MARKETPLACE_DASHBOARD_URL] Marketplace].
 	</string>
 	<string name="Marketplace Error None">
 		Nessun errore
@@ -1253,7 +1267,7 @@ Prova ad accedere nuovamente tra un minuto.
 		Errore: questa cartella non include alcun contenuto.
 	</string>
 	<string name="Marketplace Error Unassociated Products">
-		Errore: Oggetto non caricato perché il tuo account venditore ha troppi oggetti che non sono associati con dei prodotti. Per risolvere questo errore, esegui l&apos;accesso al sito di Marketplace e riduci il numero di oggetti non associati.
+		Errore: Oggetto non caricato perché il tuo account venditore ha troppi oggetti che non sono associati con dei prodotti.  Per risolvere questo errore, esegui l&apos;accesso al sito di Marketplace e riduci il numero di oggetti non associati.
 	</string>
 	<string name="Marketplace Error Object Limit">
 		Errore: questo elemento contiene troppi oggetti. Per risolvere questo problema, inserisci più oggetti insieme in una scatola per ridurre a meno di 200 il numero totale di oggetti.
@@ -4014,7 +4028,7 @@ Se il messaggio persiste, contatta [SUPPORT_SITE].
 	</string>
 	<string name="uploading_abuse_report">
 		Caricamento in corso...
-  
+
 Segnala abuso
 	</string>
 	<string name="New Shape">
@@ -4282,7 +4296,7 @@ Segnala abuso
 	<string name="server_is_down">
 		Nonostante i nostri tentativi, si è verificato un errore imprevisto.
 
-	Consulta la pagina status.secondlifegrid.net per determinare se si sia verificato un problema noto con il servizio.  
+	Consulta la pagina status.secondlifegrid.net per determinare se si sia verificato un problema noto con il servizio.
         Se il problema continua, ti consigliamo di controllare le tue impostazioni di rete e della firewall.
 	</string>
 	<string name="dateTimeWeekdaysNames">
@@ -4749,6 +4763,9 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 	<string name="Command_Move_Label">
 		Cammina / corri / vola
 	</string>
+	<string name="Command_Outbox_Label">
+		Casella in uscita del rivenditore
+	</string>
 	<string name="Command_People_Label">
 		Persone
 	</string>
@@ -4821,6 +4838,9 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
 	<string name="Command_Move_Tooltip">
 		Movimento avatar
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Trasferisci elementi al tuo mercato per la vendita
+	</string>
 	<string name="Command_People_Tooltip">
 		Amici, gruppi e persone vicine
 	</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml
index 816a6ff203e..7c87bad5a34 100644
--- a/indra/newview/skins/default/xui/ja/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml
@@ -375,7 +375,7 @@
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="写真をクリックして選択"/>
 			<text name="allow_label5">
-				この区画にいるアバターに会ってチャットできます
+				他の区画にいるアバターがこの区画にいるアバターに会ってチャットできる
 			</text>
 			<check_box label="アバターを表示" name="SeeAvatarsCheck" tool_tip="他の区画のアバターが、この区画にいるアバターに会ってチャットすることを許可し、あなたもそれらアバターに会ってチャットできるようにします。"/>
 			<text name="landing_point">
@@ -459,12 +459,12 @@
 			<text name="Limit access to this parcel to:">
 				この区画へのアクセス
 			</text>
-			<check_box label="パブリックアクセスを許可する [MATURITY]" name="public_access"/>
+			<check_box label="パブリックアクセスを許可(このオプションをオフにすると立入禁止ラインが作成されます)" name="public_access"/>
 			<text name="Only Allow">
-				次の住人のアクセスを許可:
+				次の住人にのみアクセスを許可:
 			</text>
-			<check_box label="支払情報登録済 [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="未確認の住人の立入を禁止します。"/>
-			<check_box label="年齢確認 [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="年齢確認を済ませていない住人の立入を禁止します。 詳しい情報は [SUPPORT_SITE] をご覧下さい。"/>
+			<check_box label="支払情情報が登録されている [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="支払情報が登録されていないと、この区画にアクセスすることはできません。詳細については、[SUPPORT_SITE] をご覧ください。"/>
+			<check_box label="年齢確認が済んでいる [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="この区画にアクセスするには、年齢確認を済ませる必要があります。詳細については、[SUPPORT_SITE] をご覧ください。"/>
 			<check_box label="グループのアクセスを許可:[GROUP]" name="GroupCheck" tool_tip="「一般」タブで、グループを選択してください。"/>
 			<check_box label="入場許可を販売:" name="PassCheck" tool_tip="この区画への一時的なアクセスを許可します。"/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
index 504cea5931b..11f223ade63 100644
--- a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
@@ -2,6 +2,6 @@
 <floater name="chat_bar" title="近くのチャット">
 	<panel name="bottom_panel">
 		<line_editor label="ここをクリックしてチャットを開始します。" name="chat_box" tool_tip="Enter キーを押して話し、Ctrl + Enter キーで叫びます。"/>
-		<button name="show_nearby_chat" tool_tip="近くのチャットログを表示・非表示"/>
+		<button name="show_nearby_chat" tool_tip="近くのチャットログを表示/非表示"/>
 	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/ja/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..c59a3dc0ab7
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="マーチャントアウトボックス">
+	<string name="OutboxFolderCount1">
+		1 個のフォルダ
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] 個のフォルダ
+	</string>
+	<string name="OutboxImporting">
+		フォルダを送信中...
+	</string>
+	<string name="OutboxInitializing">
+		初期化中...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					ロード中...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="マーケットプレイスに送信" name="outbox_import_btn" tool_tip="自分のマーケットプレイス店頭に移動"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
index 6aaa9a42a5d..270031a33ee 100644
--- a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
@@ -6,20 +6,20 @@
 	<button label="2. 最適化" name="optimize_btn"/>
 	<button label="1. ファイルを選択" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				モデルファイルを選択
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
-				上級ユーザーの場合:3D コンテンツの制作ツールを使い慣れた方は、高度なアップローダーもお試しください。
+				上級ユーザーの場合:3D コンテンツ制作ツールの使用に慣れている方は、高度なアップローダーもお試しください。
 			</text>
 			<button label="アドバンスモードに切り替える" name="switch_to_advanced"/>
 			<text name="Cache location">
-				アップロードするモデルファイルの選択
+				アップロードするモデルファイルを選択
 			</text>
-			<button label="参照" label_selected="参照" name="browse"/>
+			<button label="参照..." label_selected="参照..." name="browse"/>
 			<text name="Model types">
 				Second Life は COLLADA (.dae) ファイルをサポートします。
 			</text>
@@ -35,15 +35,15 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				モデルを最適化
 			</text>
 		</panel>
-		<text name="description">
-			パフォーマンスを重視してモデルを最適化しました。必要に応じて調整してください。
+		<text name="optimize_description">
+			モデルはパフォーマンスを重視して最適化されています。必要に応じて調整してください。
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
 				次の描画詳細度を作成:高
 			</text>
@@ -79,16 +79,16 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				物理作用の調整
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			モデルの外殻構造のシェイプは弊社が作成します。モデルの目的に応じてシェイプの詳細度を調整してください。
 		</text>
-		<panel name="content">
-			<button label="物理演算ウェイトを再計算" name="recalculate_physics_btn"/>
+		<panel name="physics_content">
+			<button label="物理作用を再計算" name="recalculate_physics_btn"/>
 			<button label="再計算中..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
 				物理作用のプレビュー
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				確認
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				区画/リージョンへの負荷:[EQUIV] プリム換算値
 			</text>
@@ -123,13 +123,13 @@
 				L$ [FEE] のアップロード料金があなたのアカウントに請求されます。
 			</text>
 			<text name="review_confirmation">
-				アップロードボタンをクリックすると、モデルに含まれるマテリアルの所有権や使用許可を所持することを認めたことになります。
+				アップロードボタンをクリックすることにより、モデルに含まれるマテリアルの所有権や使用許可の所持を認めたことになります。
 			</text>
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				アップロード完了
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/ja/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/ja/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..31b5bbd3bff
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="レイアウトスタックテスト"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/ja/menu_inspect_object_gear.xml
index 2edade70bfc..5a0519ba192 100644
--- a/indra/newview/skins/default/xui/ja/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/ja/menu_inspect_object_gear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu name="Gear Menu">
+<toggleable_menu name="Gear Menu">
 	<menu_item_call label="触る" name="touch"/>
 	<menu_item_call label="座る" name="sit"/>
 	<menu_item_call label="支払う" name="pay"/>
@@ -12,7 +12,8 @@
 	<menu_item_call label="追加" name="add"/>
 	<menu_item_call label="報告" name="report"/>
 	<menu_item_call label="ブロック" name="block"/>
+	<menu_item_call label="ブロック解除" name="unblock"/>
 	<menu_item_call label="ズームイン" name="zoom_in"/>
 	<menu_item_call label="削除" name="remove"/>
 	<menu_item_call label="詳細" name="more_info"/>
-</menu>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_inventory.xml b/indra/newview/skins/default/xui/ja/menu_inventory.xml
index 9449e612740..a59f5659c45 100644
--- a/indra/newview/skins/default/xui/ja/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="追加" name="Wearable Add"/>
 	<menu_item_call label="取り外す" name="Take Off"/>
 	<menu_item_call label="マーチャントのアウトボックスにコピー" name="Merchant Copy"/>
-	<menu_item_call label="マーチャントのアウトボックスに移動" name="Merchant Move"/>
+	<menu_item_call label="マーケットプレイスに送信" name="Marketplace Send"/>
 	<menu_item_call label="--オプションなし--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_login.xml b/indra/newview/skins/default/xui/ja/menu_login.xml
index 4c88f17f3db..ab6d9e3546d 100644
--- a/indra/newview/skins/default/xui/ja/menu_login.xml
+++ b/indra/newview/skins/default/xui/ja/menu_login.xml
@@ -17,8 +17,8 @@
 		<menu_item_call label="ウィンドウのサイズを設定..." name="Set Window Size..."/>
 		<menu_item_call label="利用規約を表示" name="TOS"/>
 		<menu_item_call label="クリティカルメッセージを表示" name="Critical"/>
-		<menu_item_call label="メディアブラウザのテスト" name="Web Browser Test"/>
 		<menu_item_call label="Web コンテンツフローターのデバッグテスト" name="Web Content Floater Debug Test"/>
+		<menu label="ログレベルを設定" name="Set Logging Level"/>
 		<menu_item_check label="グリッドピッカーを表示する" name="Show Grid Picker"/>
 		<menu_item_call label="通知コンソールを表示する" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index ef3261f1d43..4430ec054c3 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="飛ぶ" name="Fly"/>
 			<menu_item_check label="常に走る" name="Always Run"/>
 			<menu_item_call label="私のアニメーションを停止する" name="Stop Animating My Avatar"/>
+			<menu_item_call label="歩行/走行/飛行..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="ログイン" name="Status">
 			<menu_item_call label="一時退席中" name="Set Away"/>
 			<menu_item_call label="取り込み中" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="管理者権限のリクエスト" name="Request Admin Options"/>
-		<menu_item_call label="管理者ステータス解除" name="Leave Admin Options"/>
-		<menu_item_call label="L$ の購入" name="Buy and Sell L$"/>
+		<menu_item_call label="L$ の購入..." name="Buy and Sell L$"/>
 		<menu_item_call label="マイアカウント..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=ja"/>
 		</menu_item_call>
@@ -63,11 +62,11 @@
 			<menu_item_check label="区画プロパティ" name="Parcel Properties"/>
 			<menu_item_check label="アドバンスメニュー" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="太陽" name="Environment Settings">
+		<menu label="太陽" name="Sun">
 			<menu_item_call label="日の出" name="Sunrise"/>
 			<menu_item_call label="正午" name="Noon"/>
 			<menu_item_call label="日没" name="Sunset"/>
-			<menu_item_call label="深夜" name="Midnight"/>
+			<menu_item_call label="真夜中" name="Midnight"/>
 			<menu_item_call label="リージョンの設定を使用" name="Use Region Settings"/>
 		</menu>
 		<menu label="自然環境エディター" name="Environment Editor">
@@ -178,22 +177,22 @@
 			<menu_item_check label="一人称視点のときに十字線を表示する" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="レンダリング(種類)" name="Rendering Types">
-			<menu_item_check label="シンプル" name="Simple"/>
-			<menu_item_check label="アルファ" name="Alpha"/>
-			<menu_item_check label="木" name="Tree"/>
-			<menu_item_check label="アバター" name="Character"/>
-			<menu_item_check label="サーフェスパッチ" name="Surface Patch"/>
-			<menu_item_check label="空" name="Sky"/>
-			<menu_item_check label="æ°´" name="Water"/>
-			<menu_item_check label="地面" name="Ground"/>
-			<menu_item_check label="ボリューム" name="Volume"/>
-			<menu_item_check label="草" name="Grass"/>
-			<menu_item_check label="雲" name="Clouds"/>
-			<menu_item_check label="パーティクル" name="Particles"/>
-			<menu_item_check label="衝突" name="Bump"/>
+			<menu_item_check label="シンプル" name="Rendering Type Simple"/>
+			<menu_item_check label="アルファ" name="Rendering Type Alpha"/>
+			<menu_item_check label="木" name="Rendering Type Tree"/>
+			<menu_item_check label="アバター" name="Rendering Type Character"/>
+			<menu_item_check label="サーフェスパッチ" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="空" name="Rendering Type Sky"/>
+			<menu_item_check label="æ°´" name="Rendering Type Water"/>
+			<menu_item_check label="地面" name="Rendering Type Ground"/>
+			<menu_item_check label="取引高" name="Rendering Type Volume"/>
+			<menu_item_check label="草" name="Rendering Type Grass"/>
+			<menu_item_check label="雲" name="Rendering Type Clouds"/>
+			<menu_item_check label="パーティクル" name="Rendering Type Particles"/>
+			<menu_item_check label="衝突" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="レンダリング(機能)" name="Rendering Features">
-			<menu_item_check label="UI" name="UI"/>
+			<menu_item_check label="UI" name="ToggleUI"/>
 			<menu_item_check label="選択済" name="Selected"/>
 			<menu_item_check label="ハイライト" name="Highlighted"/>
 			<menu_item_check label="ダイナミックテクスチャ" name="Dynamic Textures"/>
@@ -207,8 +206,6 @@
 		<menu_item_check label="マウスの平滑化" name="Mouse Smoothing"/>
 		<menu_item_call label="リリースキー" name="Release Keys"/>
 		<menu label="ショートカット" name="Shortcuts">
-			<menu_item_call label="画像 (L$ [COST] )..." name="Upload Image"/>
-			<menu_item_check label="検索" name="Search"/>
 			<menu_item_check label="アドバンスメニューを表示 - レガシーのショートカット" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="ウィンドウを閉じる" name="Close Window"/>
 			<menu_item_call label="全てのウィンドウを閉じる" name="Close All Windows"/>
@@ -217,13 +214,6 @@
 			<menu_item_check label="ジョイスティックフライカム" name="Joystick Flycam"/>
 			<menu_item_call label="表示をリセットする" name="Reset View"/>
 			<menu_item_call label="最後の発言者を見る" name="Look at Last Chatter"/>
-			<menu label="制作ツールを選択する" name="Select Tool">
-				<menu_item_call label="焦点ツール" name="Focus"/>
-				<menu_item_call label="移動ツール" name="Move"/>
-				<menu_item_call label="編集ツール" name="Edit"/>
-				<menu_item_call label="作成ツール" name="Create"/>
-				<menu_item_call label="土地ツール" name="Land"/>
-			</menu>
 			<menu_item_call label="ズームイン" name="Zoom In"/>
 			<menu_item_call label="ズーム(デフォルト)" name="Zoom Default"/>
 			<menu_item_call label="ズームアウト" name="Zoom Out"/>
@@ -296,6 +286,7 @@
 			<menu_item_check label="レイキャスト" name="Raycast"/>
 			<menu_item_check label="風のベクトル" name="Wind Vectors"/>
 			<menu_item_check label="描画の詳細度" name="rendercomplexity"/>
+			<menu_item_check label="添付アイテムのバイト数" name="attachment bytes"/>
 			<menu_item_check label="スカルプト" name="Sculpt"/>
 		</menu>
 		<menu label="レンダリング" name="Rendering">
@@ -337,11 +328,10 @@
 			<menu_item_call label="記録開始" name="Start Record"/>
 			<menu_item_call label="記録停止" name="Stop Record"/>
 		</menu>
-		<menu label="世界" name="World">
+		<menu label="世界" name="DevelopWorld">
 			<menu_item_check label="シムの太陽の設定を無視する" name="Sim Sun Override"/>
-			<menu_item_check label="ビーコンを強調表示する" name="Cheesy Beacon"/>
 			<menu_item_check label="固定された天気" name="Fixed Weather"/>
-			<menu_item_call label="リージョンオブジェクトのキャッシュをダンプする" name="Dump Region Object Cache"/>
+			<menu_item_call label="リージョンオブジェクトのキャッシュをダンプ" name="Dump Region Object Cache"/>
 		</menu>
 		<menu label="UI" name="UI">
 			<menu_item_call label="メディアブラウザのテスト" name="Web Browser Test"/>
@@ -371,11 +361,11 @@
 		</menu>
 		<menu label="アバター" name="Character">
 			<menu label="ベークドテクスチャを取得する" name="Grab Baked Texture">
-				<menu_item_call label="çž³" name="Iris"/>
-				<menu_item_call label="é ­" name="Head"/>
-				<menu_item_call label="上半身" name="Upper Body"/>
-				<menu_item_call label="下半身" name="Lower Body"/>
-				<menu_item_call label="スカート" name="Skirt"/>
+				<menu_item_call label="çž³" name="Grab Iris"/>
+				<menu_item_call label="é ­" name="Grab Head"/>
+				<menu_item_call label="上半身" name="Grab Upper Body"/>
+				<menu_item_call label="下半身" name="Grab Lower Body"/>
+				<menu_item_call label="スカート" name="Grab Skirt"/>
 			</menu>
 			<menu label="キャラクターテスト" name="Character Tests">
 				<menu_item_call label="容姿を XML に保存する" name="Appearance To XML"/>
@@ -405,18 +395,19 @@
 		<menu_item_call label="圧縮画像" name="Compress Images"/>
 		<menu_item_check label="デバッグ用のミニダンプを出力する" name="Output Debug Minidump"/>
 		<menu_item_check label="次回の起動時にコンソールウィンドウを表示する" name="Console Window"/>
+		<menu label="ログレベルを設定" name="Set Logging Level"/>
 		<menu_item_call label="管理者ステータスの呼び出し" name="Request Admin Options"/>
 		<menu_item_call label="管理者ステータス解除" name="Leave Admin Options"/>
 		<menu_item_check label="管理者メニューを表示する" name="View Admin Options"/>
 	</menu>
 	<menu label="管理者" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="コピーを取る" name="Take Copy"/>
+		<menu label="オブジェクト" name="AdminObject">
+			<menu_item_call label="コピーを取る" name="Admin Take Copy"/>
 			<menu_item_call label="私を所有者にする" name="Force Owner To Me"/>
-			<menu_item_call label="所有者権限を実行する" name="Force Owner Permissive"/>
+			<menu_item_call label="所有者権限の実行" name="Force Owner Permissive"/>
 			<menu_item_call label="削除" name="Delete"/>
 			<menu_item_call label="ロック" name="Lock"/>
-			<menu_item_call label="アセット ID を取得する" name="Get Assets IDs"/>
+			<menu_item_call label="アセット ID を取得" name="Get Assets IDs"/>
 		</menu>
 		<menu label="区画" name="Parcel">
 			<menu_item_call label="私を所有者にする" name="Owner To Me"/>
@@ -447,7 +438,7 @@
 			<menu_item_call label="物理作用" name="Physics"/>
 			<menu_item_call label="すべての衣類" name="All Clothes"/>
 		</menu>
-		<menu label="ヘルプ" name="Help">
+		<menu label="ヘルプ" name="DeprecatedHelp">
 			<menu_item_call label="リンデン公式ブログ" name="Official Linden Blog"/>
 			<menu_item_call label="スクリプトポータル" name="Scripting Portal"/>
 			<menu label="バグの報告" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 20468c8c2af..c8e8dbb0f13 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -85,17 +85,38 @@
 		<usetemplate canceltext="キャンセル" name="yesnocancelbuttons" notext="保存しない" yestext="保存"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		マーチャントのアウトボックスにこれをコピーする権限があります。次のアイテムを移動しますか?
-[ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="いいえ" yestext="はい"/>
+		これらのアイテムの 1 つまたは複数をマーチャントアウトボックスにコピーする許可がありません。移動するか、置き去りにすることはできます。
+		<usetemplate name="okcancelbuttons" notext="アイテムを移動しない" yestext="アイテムを移動"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		マーチャントアウトボックスの最上位に転送した各アイテムにつき、それぞれ 1 つの新しいフォルダが作成されました。
+		<usetemplate ignoretext="新しいフォルダがマーチャントアウトボックス内に作成されました" name="okignore" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		マーケットプレイスへのアップロードが完了しました。
-		<usetemplate name="okbutton" yestext="やったあ!"/>
+	<notification name="OutboxImportComplete">
+		成功
+
+マーケットプレイスに正常に送信されたすべてのフォルダ
+		<usetemplate ignoretext="マーケットプレイスに送信されたすべてのフォルダ" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		一部のフォルダは転送されませんでした
+
+一部のフォルダがマーケットプレイスに送信されたときにエラーが発生しました。これらのフォルダはまだマーチャントアウトボックス内にあります。
+
+詳細については、[[MARKETPLACE_IMPORTS_URL] エラーログ]をご覧ください。
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		マーケットプレイスへのアップロードの完了時にエラーが発生しました。アウトボックスの問題を解決して、もう一度お試しください。ありがとうございます。
-		<usetemplate name="okbutton" yestext="再トライ!"/>
+	<notification name="OutboxImportFailed">
+		転送に失敗
+
+システムまたはネットワークのエラーのため、フォルダはマーケットプレイスに送信されませんでした。後でもう一度お試しください。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxInitFailed">
+		マーケットプレイスの初期化に失敗
+
+システムまたはネットワークのエラーのため、マーケットプレイスの初期化に失敗しました。後でもう一度お試しください。
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		次の理由で、スクリプト用テキストのアップロード時に問題が起こりました。
@@ -1472,8 +1493,8 @@ http://secondlife.com/download から最新バージョンをダウンロード
 		<usetemplate ignoretext="オブジェクトを所有者に返却する前の確認" name="okcancelignore" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		現在あなたは &lt;nolink&gt;[GROUP]&lt;/nolink&gt; のメンバーです。
-このグループを抜けますか?
+		現在、あなたは &lt;nolink&gt;[GROUP]&lt;/nolink&gt; グループのメンバーです。
+グループから脱退しますか?
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmKick">
@@ -2862,6 +2883,18 @@ M キーを押して変更します。
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
+	<notification name="ShareFolderConfirmation">
+		フォルダは一度に 1 つしか共有できません。
+
+次のアイテムを共有しますか?
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+次の住人と共有:
+
+[RESIDENTS]
+		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="Ok"/>
+	</notification>
 	<notification name="ItemsShared">
 		アイテムが共有されました。
 	</notification>
diff --git a/indra/newview/skins/default/xui/ja/panel_region_estate.xml b/indra/newview/skins/default/xui/ja/panel_region_estate.xml
index 5b2ef360453..2e58c5a8f1d 100644
--- a/indra/newview/skins/default/xui/ja/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/ja/panel_region_estate.xml
@@ -16,10 +16,10 @@
 		(不明)
 	</text>
 	<text name="Only Allow">
-		次のアカウントのみアクセスを許可:
+		次の住人にのみアクセスを許可:
 	</text>
-	<check_box label="支払情報登録済" name="limit_payment" tool_tip="未確認の住人の立入を禁止します"/>
-	<check_box label="年齢確認済" name="limit_age_verified" tool_tip="年齢確認を済ませていない住人の立入を禁止します。 詳しい情報は [SUPPORT_SITE] をご覧下さい。"/>
+	<check_box label="支払情情報が登録されている" name="limit_payment" tool_tip="支払情報が登録されていないと、この不動産にアクセスすることはできません。詳細については、[SUPPORT_SITE] をご覧ください。"/>
+	<check_box label="年齢確認が済んでいる" name="limit_age_verified" tool_tip="この不動産にアクセスするには、年齢確認を済ませる必要があります。詳細については、[SUPPORT_SITE] をご覧ください。"/>
 	<check_box label="ボイスチャットを許可" name="voice_chat_check"/>
 	<button label="?" name="voice_chat_help"/>
 	<text name="abuse_email_text">
diff --git a/indra/newview/skins/default/xui/ja/panel_script_ed.xml b/indra/newview/skins/default/xui/ja/panel_script_ed.xml
index 9fdd16d567c..14d55002a38 100644
--- a/indra/newview/skins/default/xui/ja/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/ja/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="ファイル" name="File">
 			<menu_item_call label="保存" name="Save"/>
 			<menu_item_call label="変更を元に戻す" name="Revert All Changes"/>
+			<menu_item_call label="ファイルからロード..." name="LoadFromFile"/>
+			<menu_item_call label="ファイルに保存..." name="SaveToFile"/>
 		</menu>
 		<menu label="編集" name="Edit">
 			<menu_item_call label="元に戻す" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
index fc0293307bf..a450d9b3c35 100644
--- a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="もの" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								受け取った商品([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								受け取った商品
-							</string>
-							<button label="受け取った商品" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] 個の新商品
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									マーケットプレイスから購入した商品はここに配達されます。
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								マーチャントのアウトボックス ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								マーチャントのアウトボックス
-							</string>
-							<button label="マーチャントのアウトボックス" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="自分のマーケットプレイス店頭に移動"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										ローディング...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						受け取ったアイテム([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						受け取ったアイテム
+					</string>
+					<button label="受け取ったアイテム" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] 個の新アイテム
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							マーケットプレイスから購入した商品はここに配達されます。
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index c6b033ed950..a1279510c77 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -181,8 +181,8 @@ http://secondlife.com/viewer-access-faq
 	</string>
 	<string name="LoginFailedPremiumOnly">
 		既にログインしているユーザーに最上のインワールド体験を提供するため、Second Life へのログインは一時的に制限されています。
-	 	
-申し訳ございませんが、有料アカウントのユーザーを優先するために、現時点のところ無料アカウントのユーザーには Second Life へのアクセスをご遠慮いただいています。
+
+申し訳ございませんが、有料アカウントのユーザーを優先するため、現在のところ無料アカウントのユーザーには Second Life へのアクセスをご遠慮いただいています。
 	</string>
 	<string name="LoginFailedComputerProhibited">
 		このパソコンからは Second Life にアクセスできません。
@@ -339,17 +339,35 @@ support@secondlife.com にお問い合わせください。
 		アイテムは 1 つだけここにドラッグできます
 	</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]:"/>
+	<string name="TooltipOutboxDragToWorld">
+		マーチャントボックス内のアイテムを Rez することはできません
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		これらオブジェクトの 1 つまたは複数は、別のユーザーに売り渡したり譲渡できないものです。
+		これらオブジェクトの 1 つまたは複数は売り渡したり譲渡したりできないものです。
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		マーチャントアウトボックスでは、ご自分の持ち物からのアイテムしか受け入れることができません
 	</string>
 	<string name="TooltipOutboxWorn">
-		あなたはこれらオブジェクトの 1 つまたは複数を装着しています。アバターからそれらを取り外し、再び移動してみてください。
+		着用しているアイテムをマーチャントアウトボックスに入れることはできません
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		コーリングカードをマーチャントアウトボックスに入れることはできません
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		このフォルダにあるサブフォルダの階層が多すぎます。サブフォルダは4階層以内(ルートフォルダの下にA、その下にB、その下にCという風に)にまとめ直してください。
+		ネスト入りフォルダの深さが 3 を超えています
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		最上位フォルダ内のサブフォルダ数が 20 を超えています
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		このフォルダには 200 個以上のオブジェクトが含まれます。商品のいつかをボックスに入れ、オブジェクト数を減らしてください。
+		最上位フォルダ内のアイテム数が 200 を超えています
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		フォルダをその子フォルダに移動することはできません
+	</string>
+	<string name="TooltipDragOntoSelf">
+		フォルダをそのフォルダ自身に移動することはできません
 	</string>
 	<string name="TooltipHttpUrl">
 		クリックしてこの Web ページを見ます
@@ -976,6 +994,9 @@ support@secondlife.com にお問い合わせください。
 	<string name="choose_the_directory">
 		参照
 	</string>
+	<string name="script_files">
+		スクリプト
+	</string>
 	<string name="AvatarSetNotAway">
 		一時退席中解除
 	</string>
@@ -1214,43 +1235,36 @@ support@secondlife.com にお問い合わせください。
 		「持ち物」内にこのテクスチャのコピーがありません
 	</string>
 	<string name="InventoryInboxNoItems">
-		購入するなどして取得したアイテムや商品はここに表示され、持ち物のフォルダにドラッグして移動することもできれば、要らなくなった場合には削除することができます。
+		プレミアムギフトなど、受け取る特定のアイテムはここに表示されます。その後、それらのアイテムを自分の持ち物の中にドラッグできます。
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		マーチャントアウトボックスが正しく設定されていません
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		マーチャントアウトボックスの設定エラー
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		問題を解決するにはカスタマーサービスにお問い合わせください。
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		マーケットプレイスは皆の売り場です
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		あなたもマーチャントに!
+		マーケットプレイスでは誰でもアイテムを売ることができます。
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] Second Life マーケットプレイス] では、SL 住人が制作した商品 100 万点以上が販売されています。あなたもご自分の自信作や、あなたが購入したアイテムを商品として売ってみませんか。その手順は簡単で、セットアップは無料です。[[LEARN_MORE_URL] こちらで詳細を確かめ]、マーケットプレイスに[[CREATE_STORE_URL] ストアを作成] しましょう。
+		マーチャントになりたい方は、[[MARKETPLACE_CREATE_STORE_URL] マーケットプレイスストアを作成]する必要があります。
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		マーケットプレイスへの新しい出荷方法
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		商品をここにドラッグアンドドロップするだけで、マーケットプレイスの売り物となります
+		アウトボックスは空です。
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		販売する商品またはフォルダをこのエリアにドラッグします。コピー不可のアイテムでない限り、ドラッグした商品のコピーが表示されるだけで、あなたの持ち物から商品が実際に移動するわけではありません。マーケットプレイスに商品を送る準備が整ったら、「アップロード」ボタンをクリックします。商品はマーケットプレイスインベントリに移動した時点でこのフォルダから削除されます。
+		[[MARKETPLACE_DASHBOARD_URL] マーケットプレイス]に販売するアイテムを一覧するには、フォルダをこのエリアにドラッグし、「マーケットプレイスに送信」をクリックします。
 	</string>
 	<string name="Marketplace Error None">
 		エラーなし
@@ -1262,7 +1276,7 @@ support@secondlife.com にお問い合わせください。
 		エラー:このフォルダは空です。
 	</string>
 	<string name="Marketplace Error Unassociated Products">
-		エラー:あなたのマーチャントアカウントには、商品と無関係のアイテムが多すぎるため、このアイテムをアップロードできませんでした。このエラーを解消するには、マーケットプレイスのウェブサイトにログインし、商品に関係のないアイテム数を減らしてください。
+		エラー:あなたのマーチャントアカウントには、商品と無関係のアイテムが多すぎるため、このアイテムをアップロードできませんでした。このエラーを解消するには、マーケットプレイスのウェブサイトにログインし、商品に関係のないアイテムの数を減らしてください。
 	</string>
 	<string name="Marketplace Error Object Limit">
 		エラー:この商品に含まれるオブジェクトが多すぎます。オブジェクトをいくつかボックスにまとめ、オブジェクト数を200以下に減らしてください。
@@ -4104,7 +4118,7 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	</string>
 	<string name="uploading_abuse_report">
 		アップロード中...
-  
+
 嫌がらせの報告
 	</string>
 	<string name="New Shape">
@@ -4370,10 +4384,10 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	</string>
 	<string name="words_separator" value=","/>
 	<string name="server_is_down">
-		大変申し訳ございませんが、予期せぬ問題が発生しました。
+		大変申し訳ございませんが、予期しない問題が発生しました。
 
-	status.secondlifegrid.netで、サービスに関する既知の問題についてお調べください。
-        問題が引き続き発生する場合は、お使いのネットワークやファイアウォールの設定を確認してください。
+	サービスに関する既知の問題については、status.secondlifegrid.net をご覧ください。
+問題が引き続き発生する場合は、お使いのネットワークやファイアウォールの設定を調べてください。
 	</string>
 	<string name="dateTimeWeekdaysNames">
 		日曜日:月曜日:火曜日:水曜日:木曜日:金曜日:土曜日
@@ -4839,6 +4853,9 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="Command_Move_Label">
 		歩行 / 走行 / 飛行
 	</string>
+	<string name="Command_Outbox_Label">
+		マーチャントアウトボックス
+	</string>
 	<string name="Command_People_Label">
 		人
 	</string>
@@ -4911,6 +4928,9 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="Command_Move_Tooltip">
 		アバターの移動
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		販売用にアイテムをマーケットプレイスに転送
+	</string>
 	<string name="Command_People_Tooltip">
 		フレンド、グループ、近くの人
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_about_land.xml b/indra/newview/skins/default/xui/pt/floater_about_land.xml
index 30d4b0290c0..cd0fb4c41bf 100644
--- a/indra/newview/skins/default/xui/pt/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about_land.xml
@@ -373,7 +373,7 @@ Apenas lotes maiores podem ser listados na busca.
 			</text>
 			<texture_picker label="" name="snapshot_ctrl" tool_tip="Clique para escolher uma imagem"/>
 			<text name="allow_label5">
-				e bater papo com avatares neste lote
+				Avatares em outros lotes podem ver e conversar com avatares neste lote
 			</text>
 			<check_box label="Ver avatares" name="SeeAvatarsCheck" tool_tip="Permite que os avatares em outros lotes vejam e batam papo com avatares neste lote. Você poderá vê-los e conversar com eles."/>
 			<text name="landing_point">
@@ -460,12 +460,12 @@ Mídia:
 			<text name="Limit access to this parcel to:">
 				Acesso a este lote
 			</text>
-			<check_box label="Acesso para público categoria [MATURITY]" name="public_access"/>
+			<check_box label="Permitir acesso público (Desmarcar esse item cria limites)" name="public_access"/>
 			<text name="Only Allow">
-				Restringir acesso a contas confirmardas por:
+				Permitir acesso apenas para residentes que:
 			</text>
-			<check_box label="Dados de pagamento fornecidos [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Banir residentes sem identificação."/>
-			<check_box label="Idade comprovada: [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Banir residentes que não comprovaram a idade. Consulte o [SUPPORT_SITE] para saber mais."/>
+			<check_box label="Possuam Dados de pagamento fornecidos [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Os residentes devem ter seus dados de pagamento cadastrados para acessar este lote.  Consulte o [SUPPORT_SITE] para saber mais."/>
+			<check_box label="Tiveram sua idade verificada [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Os residentes devem ter a idade verificada para acessar este lote. Consulte o [SUPPORT_SITE] para saber mais."/>
 			<check_box label="Permitir acesso do grupo: [GROUP]" name="GroupCheck" tool_tip="Definir grupo na aba Geral."/>
 			<check_box label="Vender passes para:" name="PassCheck" tool_tip="Permite acesso temporário a este terreno"/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/pt/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/pt/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..bb6113671be
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="CAIXA DE SAÍDA DO LOJISTA">
+	<string name="OutboxFolderCount1">
+		1 pasta
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] pasta(s)
+	</string>
+	<string name="OutboxImporting">
+		Enviando pastas...
+	</string>
+	<string name="OutboxInitializing">
+		Iniciando...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Carregando...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="Enviar para Mercado" name="outbox_import_btn" tool_tip="Enviar para a Frente da loja do meu Mercado"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_model_wizard.xml b/indra/newview/skins/default/xui/pt/floater_model_wizard.xml
index 498058f9337..0d07303c910 100644
--- a/indra/newview/skins/default/xui/pt/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/pt/floater_model_wizard.xml
@@ -6,12 +6,12 @@
 	<button label="2. Otimizar" name="optimize_btn"/>
 	<button label="1. Selecionra arquivo" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Escolher arquivo de modelo
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
 				Usuários avançados: se você estiver familiarizado com ferramentas de criação de conteúdo 3D, use o Advanced Uploader.
 			</text>
@@ -35,15 +35,15 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Otimizar modelo
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			O modelo foi ajustado para desempenho. Faça novos ajustes, se desejar.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
 				Gerar nível de detalhes: Alto
 			</text>
@@ -54,7 +54,7 @@
 				Gerar nível de detalhes: Baixo
 			</text>
 			<text name="lowest_detail_text">
-				Gerar nível de detalhes: mais baixo
+				Gerar nível de detalhes: Mais baixo
 			</text>
 		</panel>
 		<panel name="content2">
@@ -79,15 +79,15 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				Ajustar físico
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Criaremos uma forma para o corpo externo do modelo. Ajuste o nível de detalhes como necessário para a finalidade desejada de seu modelo.
 		</text>
-		<panel name="content">
+		<panel name="physics_content">
 			<button label="Recalcular físico" name="recalculate_physics_btn"/>
 			<button label="Recalculando..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Revisar
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Impacto no lote/região: [EQUIV] equivalentes de prim
 			</text>
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Upload concluído
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/pt/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/pt/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..b479d5f6d6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK TESTS"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/pt/menu_inspect_object_gear.xml
index 184db26538d..7e271904e9c 100644
--- a/indra/newview/skins/default/xui/pt/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/pt/menu_inspect_object_gear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu name="Gear Menu">
+<toggleable_menu name="Gear Menu">
 	<menu_item_call label="Tocar" name="touch"/>
 	<menu_item_call label="Sentar" name="sit"/>
 	<menu_item_call label="Pagar" name="pay"/>
@@ -12,7 +12,8 @@
 	<menu_item_call label="Adicionar" name="add"/>
 	<menu_item_call label="Denunciar" name="report"/>
 	<menu_item_call label="Bloquear" name="block"/>
+	<menu_item_call label="Desbloquear" name="unblock"/>
 	<menu_item_call label="Mais zoom" name="zoom_in"/>
 	<menu_item_call label="Tirar" name="remove"/>
 	<menu_item_call label="Mais informações" name="more_info"/>
-</menu>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_inventory.xml b/indra/newview/skins/default/xui/pt/menu_inventory.xml
index ba3879b5a16..24a2f713fdf 100644
--- a/indra/newview/skins/default/xui/pt/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Adicionar" name="Wearable Add"/>
 	<menu_item_call label="Tirar" name="Take Off"/>
 	<menu_item_call label="Copiar para Caixa de saída do lojista" name="Merchant Copy"/>
-	<menu_item_call label="Mover para Caixa de saída do lojista" name="Merchant Move"/>
+	<menu_item_call label="Enviar para Mercado" name="Marketplace Send"/>
 	<menu_item_call label="--Sem opções--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_login.xml b/indra/newview/skins/default/xui/pt/menu_login.xml
index 94195f1b8c5..be94ad49dbe 100644
--- a/indra/newview/skins/default/xui/pt/menu_login.xml
+++ b/indra/newview/skins/default/xui/pt/menu_login.xml
@@ -16,8 +16,8 @@
 		<menu_item_call label="Definir tamanho da janela:" name="Set Window Size..."/>
 		<menu_item_call label="Mostrar TOS" name="TOS"/>
 		<menu_item_call label="Mostrar mensagem crítica" name="Critical"/>
-		<menu_item_call label="Teste de mídia do navegador" name="Web Browser Test"/>
 		<menu_item_call label="Test de Bugs de Conteúdo Web" name="Web Content Floater Debug Test"/>
+		<menu label="Configurar nível de registro em log" name="Set Logging Level"/>
 		<menu_item_check label="Exibir seletor da grade" name="Show Grid Picker"/>
 		<menu_item_call label="Exibir painel de notificações" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index 119a3bdcfe7..8960ffec813 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Voar" name="Fly"/>
 			<menu_item_check label="Correr sempre" name="Always Run"/>
 			<menu_item_call label="Parar minha animação" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Andar/correr/voar..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Status" name="Status">
 			<menu_item_call label="Ausente" name="Set Away"/>
 			<menu_item_call label="Ocupado" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Request Admin Status" name="Request Admin Options"/>
-		<menu_item_call label="Sair do modo admin" name="Leave Admin Options"/>
-		<menu_item_call label="Comprar L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Comprar L$..." name="Buy and Sell L$"/>
 		<menu_item_call label="Painel da conta..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=pt"/>
 		</menu_item_call>
@@ -63,10 +62,10 @@
 			<menu_item_check label="Propriedades do lote" name="Parcel Properties"/>
 			<menu_item_check label="Menu avançado" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Sol" name="Environment Settings">
+		<menu label="Sol" name="Sun">
 			<menu_item_call label="Amanhecer" name="Sunrise"/>
 			<menu_item_call label="Meio-dia" name="Noon"/>
-			<menu_item_call label="Pôr-do-Sol" name="Sunset"/>
+			<menu_item_call label="Pôr-do-sol" name="Sunset"/>
 			<menu_item_call label="Meia-noite" name="Midnight"/>
 			<menu_item_call label="Usar configurações da região" name="Use Region Settings"/>
 		</menu>
@@ -178,22 +177,22 @@
 			<menu_item_check label="Mostrar retículo na vista subjetiva" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Tipos de renderização" name="Rendering Types">
-			<menu_item_check label="Simples" name="Simple"/>
-			<menu_item_check label="Alpha" name="Alpha"/>
-			<menu_item_check label="Árvore" name="Tree"/>
-			<menu_item_check label="Avatares" name="Character"/>
-			<menu_item_check label="Patch de superfície" name="Surface Patch"/>
-			<menu_item_check label="Céu" name="Sky"/>
-			<menu_item_check label="Água" name="Water"/>
-			<menu_item_check label="Chão" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Grama" name="Grass"/>
-			<menu_item_check label="Nuvens" name="Clouds"/>
-			<menu_item_check label="Partículas" name="Particles"/>
-			<menu_item_check label="Elevação" name="Bump"/>
+			<menu_item_check label="Simples" name="Rendering Type Simple"/>
+			<menu_item_check label="Alpha" name="Rendering Type Alpha"/>
+			<menu_item_check label="Árvore" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatares" name="Rendering Type Character"/>
+			<menu_item_check label="Patch de superfície" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Céu" name="Rendering Type Sky"/>
+			<menu_item_check label="Água" name="Rendering Type Water"/>
+			<menu_item_check label="Chão" name="Rendering Type Ground"/>
+			<menu_item_check label="Volume" name="Rendering Type Volume"/>
+			<menu_item_check label="Grama" name="Rendering Type Grass"/>
+			<menu_item_check label="Nuvens" name="Rendering Type Clouds"/>
+			<menu_item_check label="Partículas" name="Rendering Type Particles"/>
+			<menu_item_check label="Elevação" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Recursos de renderização" name="Rendering Features">
-			<menu_item_check label="Interface" name="UI"/>
+			<menu_item_check label="Interface" name="ToggleUI"/>
 			<menu_item_check label="Selecionado" name="Selected"/>
 			<menu_item_check label="Realçado" name="Highlighted"/>
 			<menu_item_check label="Texturas dinâmicas" name="Dynamic Textures"/>
@@ -206,8 +205,6 @@
 		<menu_item_check label="Smoothing de mouse" name="Mouse Smoothing"/>
 		<menu_item_call label="Liberar teclas" name="Release Keys"/>
 		<menu label="Atalhos" name="Shortcuts">
-			<menu_item_call label="Imagem (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Busca" name="Search"/>
 			<menu_item_check label="Mostrar menu avançado - atalho antigo" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Fechar janela" name="Close Window"/>
 			<menu_item_call label="Fechar todas as janelas" name="Close All Windows"/>
@@ -216,13 +213,6 @@
 			<menu_item_check label="Flycam Joystick" name="Joystick Flycam"/>
 			<menu_item_call label="Visão padrão" name="Reset View"/>
 			<menu_item_call label="Olhar para quem fala por último" name="Look at Last Chatter"/>
-			<menu label="Selecionar ferramenta de construção" name="Select Tool">
-				<menu_item_call label="Ferramenta enfoque" name="Focus"/>
-				<menu_item_call label="Ferramenta de movimentação" name="Move"/>
-				<menu_item_call label="Ferramenta de edição" name="Edit"/>
-				<menu_item_call label="Ferramenta criar" name="Create"/>
-				<menu_item_call label="Ferramenta de terrenos" name="Land"/>
-			</menu>
 			<menu_item_call label="Mais zoom" name="Zoom In"/>
 			<menu_item_call label="Zoom padrão" name="Zoom Default"/>
 			<menu_item_call label="Menos zoom" name="Zoom Out"/>
@@ -278,6 +268,7 @@
 			<menu_item_check label="Fila de construção" name="Build Queue"/>
 			<menu_item_check label="Vetores de vento" name="Wind Vectors"/>
 			<menu_item_check label="Renderizar complexidade" name="rendercomplexity"/>
+			<menu_item_check label="Bytes do anexo" name="attachment bytes"/>
 			<menu_item_check label="Esculpir" name="Sculpt"/>
 		</menu>
 		<menu label="Rendering" name="Rendering">
@@ -300,11 +291,10 @@
 			<menu_item_call label="Drop a Packet" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Empurrões, trombadas e tapas" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Mundo" name="World">
-			<menu_item_check label="Impor sobre sol regional" name="Sim Sun Override"/>
-			<menu_item_check label="Efeito baliza piscando" name="Cheesy Beacon"/>
-			<menu_item_check label="Fixed Weather" name="Fixed Weather"/>
-			<menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/>
+		<menu label="Mundo" name="DevelopWorld">
+			<menu_item_check label="Impor sobre sol de simulação" name="Sim Sun Override"/>
+			<menu_item_check label="Clima fixo" name="Fixed Weather"/>
+			<menu_item_call label="Descartar cache do objeto de região" name="Dump Region Object Cache"/>
 		</menu>
 		<menu label="Interface" name="UI">
 			<menu_item_call label="Teste de mídia do navegador" name="Web Browser Test"/>
@@ -324,11 +314,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="Grab Baked Texture" name="Grab Baked Texture">
-				<menu_item_call label="Íris" name="Iris"/>
-				<menu_item_call label="Cabeça" name="Head"/>
-				<menu_item_call label="Cintura acima" name="Upper Body"/>
-				<menu_item_call label="Cintura para baixo" name="Lower Body"/>
-				<menu_item_call label="Saia" name="Skirt"/>
+				<menu_item_call label="Íris" name="Grab Iris"/>
+				<menu_item_call label="Cabeça" name="Grab Head"/>
+				<menu_item_call label="Cintura acima" name="Grab Upper Body"/>
+				<menu_item_call label="Cintura para baixo" name="Grab Lower Body"/>
+				<menu_item_call label="Saia" name="Grab Skirt"/>
 			</menu>
 			<menu label="Testes de personagem" name="Character Tests">
 				<menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/>
@@ -345,17 +335,19 @@
 		<menu_item_check label="Texturas HTTP" name="HTTP Textures"/>
 		<menu_item_check label="Inventário HTTP" name="HTTP Inventory"/>
 		<menu_item_check label="Console Window on next Run" name="Console Window"/>
+		<menu label="Configurar nível de registro em log" name="Set Logging Level"/>
 		<menu_item_call label="Request Admin Status" name="Request Admin Options"/>
 		<menu_item_call label="Sair do modo admin" name="Leave Admin Options"/>
 		<menu_item_check label="Mostrar menu admin" name="View Admin Options"/>
 	</menu>
 	<menu label="Admin" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Pegar uma cópia" name="Take Copy"/>
-			<menu_item_call label="Force Owner To Me" name="Force Owner To Me"/>
-			<menu_item_call label="Force Owner Permissive" name="Force Owner Permissive"/>
+		<menu label="Objeto" name="AdminObject">
+			<menu_item_call label="Pegar uma cópia" name="Admin Take Copy"/>
+			<menu_item_call label="Forçar propriedade para mim" name="Force Owner To Me"/>
+			<menu_item_call label="Forçar permissão de proprietário" name="Force Owner Permissive"/>
 			<menu_item_call label="Excluir" name="Delete"/>
 			<menu_item_call label="Bloquear" name="Lock"/>
+			<menu_item_call label="Obter IDs dos bens" name="Get Assets IDs"/>
 		</menu>
 		<menu label="Lote" name="Parcel">
 			<menu_item_call label="Force Owner To Me" name="Owner To Me"/>
@@ -372,5 +364,16 @@
 		<menu label="Take Off Clothing" name="Take Off Clothing">
 			<menu_item_call label="Físico" name="Physics"/>
 		</menu>
+		<menu label="Ajuda" name="DeprecatedHelp">
+			<menu_item_call label="Blog oficial da Linden" name="Official Linden Blog"/>
+			<menu_item_call label="Portal de scripts" name="Scripting Portal"/>
+			<menu label="Relatar bugs" name="Bug Reporting">
+				<menu_item_call label="Monitor de problemas" name="Public Issue Tracker"/>
+				<menu_item_call label="Ajuda do monitor de problemas" name="Publc Issue Tracker Help"/>
+				<menu_item_call label="Relatório de bugs 101" name="Bug Reporing 101"/>
+				<menu_item_call label="Problemas de segurança" name="Security Issues"/>
+				<menu_item_call label="Página Wiki" name="QA Wiki"/>
+			</menu>
+		</menu>
 	</menu>
 </menu_bar>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 2c5ccd6e191..20d59aa0f85 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -85,17 +85,38 @@ Verifique se a conexão à internet está funcionando.
 		<usetemplate canceltext="Cancelar" name="yesnocancelbuttons" notext="Não salvar" yestext="Salvar"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		Você não tem permissão para copiar este item para a Caixa de saída do lojista. Tem certeza de que deseja mover o itens a seguir?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/>
+		Você não possui permissão para copiar um ou mais destes itens para a Caixa de saída do lojista.  Você pode movê-los ou abandoná-los.
+		<usetemplate name="okcancelbuttons" notext="Não mover item(ns)" yestext="Mover item(ns)"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		Uma nova pasta foi criada para cada item transferido para o nível superior de sua Caixa de saída do lojista.
+		<usetemplate ignoretext="Uma nova pasta foi criada na Caixa de saída do lojista" name="okignore" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Envio para Mercado concluído.
-		<usetemplate name="okbutton" yestext="Viva!"/>
+	<notification name="OutboxImportComplete">
+		Êxito
+
+Todas as pastas foram enviadas para o Mercado com êxito.
+		<usetemplate ignoretext="Todas as pastas enviadas para o Mercado" name="okignore" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		Envio para Mercado concluído com erros!  Corrija os problemas em sua caixa de saída e tente novamente. Obrigado.
-		<usetemplate name="okbutton" yestext="Tudo bem!"/>
+	<notification name="OutboxImportHadErrors">
+		Algumas pastas não foram transferidas
+
+Erro ao enviar algumas pastas para o Mercado.  Estas pastas ainda estão na sua Caixa de saída do lojista.
+
+Consulte o [[MARKETPLACE_IMPORTS_URL] log de erros] para mais informações.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportFailed">
+		Falha de transferência
+
+Nenhuma pasta enviada para o Mercado devido a um erro do sistema ou da rede.  Tente novamente mais tarde.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="OutboxInitFailed">
+		Falha na inicialização do Mercado
+
+Falha na inicialização do mercado devido a um erro do sistema ou da rede.  Tente novamente mais tarde.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		Houve um problema com o carregamento do texto para um script devido à seguinte razão: [REASON]. Por favor, tente novamente mais tarde.
@@ -1424,8 +1445,7 @@ Para instalar a atualização, será preciso reiniciar o [APP_NAME].
 		<usetemplate ignoretext="Confirmar antes de devolver objetos a seus donos" name="okcancelignore" notext="Cancelar" yestext="Retornar"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Você é atualmente um membro do grupo &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
-Sair do grupo?
+		Você é atualmente um membro do grupo
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Sair"/>
 	</notification>
 	<notification name="ConfirmKick">
@@ -2799,6 +2819,12 @@ Com os seguintes residentes:
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
 	</notification>
+	<notification name="ShareFolderConfirmation">
+		Apenas uma pasta pode ser compartilhada por vez.
+
+Tem certeza de que quer compartilhar os itens abaixo?
+		<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
+	</notification>
 	<notification name="ItemsShared">
 		Itens compartilhados.
 	</notification>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_estate.xml b/indra/newview/skins/default/xui/pt/panel_region_estate.xml
index e5d394865cf..6c5945aa15e 100644
--- a/indra/newview/skins/default/xui/pt/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_estate.xml
@@ -23,10 +23,10 @@
 	<check_box label="Permitir acesso público" name="externally_visible_check"/>
 	<button label="?" name="externally_visible_help"/>
 	<text name="Only Allow">
-		Restringir acesso a contas confirmardas por:
+		Permitir acesso apenas para residentes que:
 	</text>
-	<check_box label="Dados de pagamento fornecidos" name="limit_payment" tool_tip="Banir residentes sem identificação."/>
-	<check_box label="Verificação de idade" name="limit_age_verified" tool_tip="Banir residentes que não comprovaram a idade. Consulte o [SUPPORT_SITE] para saber mais."/>
+	<check_box label="Dados de pagamento constam no registro." name="limit_payment" tool_tip="Propriedade de acesso restrito a residentes que já cadastraram seus dados de pagamento  Consulte o [SUPPORT_SITE] para saber mais."/>
+	<check_box label="A idade foi verificada" name="limit_age_verified" tool_tip="Residentes devem ter a idade verificada para acessar esta propriedade. Consulte o [SUPPORT_SITE] para saber mais."/>
 	<check_box label="Permitir conversa de voz" name="voice_chat_check"/>
 	<button label="?" name="voice_chat_help"/>
 	<check_box label="Permitir Tele-transporte direto" name="allow_direct_teleport"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_script_ed.xml b/indra/newview/skins/default/xui/pt/panel_script_ed.xml
index a1acb18cb41..de02aafe2fd 100644
--- a/indra/newview/skins/default/xui/pt/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/pt/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="Arquivo" name="File">
 			<menu_item_call label="Salvar" name="Save"/>
 			<menu_item_call label="Reverter todas as alterações" name="Revert All Changes"/>
+			<menu_item_call label="Carregar do arquivo..." name="LoadFromFile"/>
+			<menu_item_call label="Salvar para o arquivo..." name="SaveToFile"/>
 		</menu>
 		<menu label="Editar" name="Edit">
 			<menu_item_call label="desfazer" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
index 77c552a852d..72baf3a5c34 100644
--- a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="Coisas" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Itens recebidos ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Itens recebidos
-							</string>
-							<button label="Itens recebidos" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] novo(s)
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Compras do marketplace serão entregues aqui.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Caixa de saída do lojista ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Caixa de saída do lojista
-							</string>
-							<button label="Caixa de saída do lojista" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="Enviar para a frente do meu mercado"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Carregando...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Itens recebidos ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Itens recebidos
+					</string>
+					<button label="Itens recebidos" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] novo(s)
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Compras do marketplace serão entregues aqui.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 4babd9cc43e..7fb3b3e6ee5 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -157,9 +157,9 @@ Para saber mais, visite as perguntas frequentes abaixo: http://secondlife.com/vi
 		O Second Life está fechado para manutenção no momento.  Somente funcionários podem acessá-lo.  Consulte www.secondlife.com/status para as últimas atualizações.
 	</string>
 	<string name="LoginFailedPremiumOnly">
-		O acesso ao Second Life está sendo restrito por alguns instantes para que todos tenham a melhor experiência possível. 
-	 	
-Titulares de contas gratuitas não poderão acessar o Second Life para acomodar os assinantes do Second Life.
+		Logons do Second Life estão temporariamente restritos para garantir a melhor experiência possível para os usuários no mundo virtual.
+
+Pessoas com contas gratuitas não poderão acessar o Second Life no momento para dar espaço para aquelas que pagaram pelo Second Life.
 	</string>
 	<string name="LoginFailedComputerProhibited">
 		O Second Life não pode ser acessado deste computador.  Se você acredita que houve algum equívoco, contate support@secondlife.com.
@@ -291,17 +291,35 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 		Apenas um item único pode ser arrastado para este local
 	</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]"/>
+	<string name="TooltipOutboxDragToWorld">
+		Não é possível fazer rez do itens em sua caixa de saída do lojista
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Um ou mais objetos não podem ser vendidos ou transferidos para outros usuário.
+		Um ou mais destes objetos não podem ser vendidos ou transferidos.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		Sua caixa de saída do lojista aceita apenas itens direto do seu inventário
 	</string>
 	<string name="TooltipOutboxWorn">
-		Você está usando um ou mais desses objetos. Remova-os de seu avatar e tente movê-los novamente.
+		Você não pode colocar os itens que está vestindo na sua caixa de saída do lojista
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		Não é possível colocar cartões de visita em sua caixa de saída do lojista
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		Esta pasta tem muitos níveis de subpastas. Reorganize as pastas internas em até 4 níveis no máximo (Pasta raiz contém A que contém B que contém C).
+		A profundidade das pastas aninhadas excede 3
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		A contagem de subpastas na pasta de nível superior excede 20
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Esta pasta contém mais de 200 objetos. Embale alguns dos itens para reduzir a contagem de objetos.
+		A contagem de itens na pasta de nível superior excede 200
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		Não é possível mover uma pasta para seu filho
+	</string>
+	<string name="TooltipDragOntoSelf">
+		Não é possível mover uma pasta para dentro dela mesma
 	</string>
 	<string name="TooltipHttpUrl">
 		Clique para ver a página web
@@ -922,6 +940,9 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 	<string name="choose_the_directory">
 		Selecionar pasta
 	</string>
+	<string name="script_files">
+		Scripts
+	</string>
 	<string name="AvatarSetNotAway">
 		deixar como ausente
 	</string>
@@ -1160,43 +1181,36 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 		Você não possui uma cópia desta textura no seu inventário
 	</string>
 	<string name="InventoryInboxNoItems">
-		Quando você comprar ou receber um item, ele aparecerá aqui para que você possa arrastá-lo para uma pasta em seu inventário ou excluí-lo caso não queira mantê-lo.
+		Alguns itens recebidos, como os brindes premium, aparecerão aqui.  Você pode arrastá-los para o seu inventário.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		Sua Caixa de saída do lojista não está configurada corretamente
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Erro de configuração na Caixa de saída do lojista
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Entre em contato com o Atendimento para corrigir o problema.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Qualquer um pode vender itens no Mercado
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		Torne-se um lojista!
+		Qualquer um pode vender itens no Mercado.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] O Mercado do Second Life] oferece mais de um milhão de produtos virtuais para venda, todos criados pelos residentes. Você também pode vender os itens que você cria, além de alguns itens que comprou. É fácil e a configuração é gratuita. [[LEARN_MORE_URL] Saiba mais] ou [[CREATE_STORE_URL] crie uma loja] no Mercado para começar.
+		Se você deseja se tornar um lojista, precisará [[MARKETPLACE_CREATE_STORE_URL] criar uma loja no Mercado].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Uma nova maneira de vender os itens no Mercado
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Arraste e solte os itens aqui para prepará-los para venda no Mercado
+		Sua caixa de saída está vazia
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Arraste os itens ou pastas que deseja vender para esta área. Será exibida uma cópia deles, deixando seu inventário inalterado, a menos que você arraste um item que não permita cópia. Quando estiver pronto para enviar os itens para o Mercado, clique no botão Enviar. Quando os itens tiverem sido movidos para seu Inventário de mercado, eles desaparecerão desta pasta.
+		Arraste as pastas para estas áreas e então clique em &quot;Enviar para Mercado&quot; para listar os itens para venda no [[MARKETPLACE_DASHBOARD_URL] Mercado].
 	</string>
 	<string name="Marketplace Error None">
 		Sem erros
@@ -1208,7 +1222,7 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 		Erro: esta pasta está vazia.
 	</string>
 	<string name="Marketplace Error Unassociated Products">
-		Erro: ocorreu uma falha ao enviar este item, pois sua conta de lojista tem muitos itens não associados a produtos. Para corrigir esse erro, faça o login no site do mercado e reduza a contagem de itens não associados.
+		Erro: ocorreu uma falha ao enviar este item, pois sua conta de lojista tem muitos itens não associados a produtos.  Para corrigir esse erro, faça o login no site do mercado e reduza a contagem de itens não associados.
 	</string>
 	<string name="Marketplace Error Object Limit">
 		Erro: este item contém muitos objetos. Corrija esse erro unindo os objetos em caixa para reduzir a contagem total a menos de 200.
@@ -3971,7 +3985,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	</string>
 	<string name="uploading_abuse_report">
 		Carregando...
-  
+
 Denunciar abuso
 	</string>
 	<string name="New Shape">
@@ -4237,10 +4251,10 @@ Denunciar abuso
 	</string>
 	<string name="words_separator" value=","/>
 	<string name="server_is_down">
-		Aconteceu algo inesperado, apesar de termos tentador impedir isso.
+		Aconteceu algo inesperado, apesar de termos tentado impedir isso.
 
-	Cheque secondlifegrid.net para saber se foi detectado um problema com o serviço.   
-        Se o problema persisitr, cheque a configuração da sua rede e firewall.
+	Cheque secondlifegrid.net para saber se foi detectado um problema com o serviço.
+        Se o problema persistir, cheque a configuração da sua rede e firewall.
 	</string>
 	<string name="dateTimeWeekdaysNames">
 		Domingo:Segunda:Terça:Quarta:Quinta:Sexta:Sábado
@@ -4706,6 +4720,9 @@ Tente colocar o caminho do editor entre aspas.
 	<string name="Command_Move_Label">
 		Andar/correr/voar
 	</string>
+	<string name="Command_Outbox_Label">
+		Caixa de saída do lojista
+	</string>
 	<string name="Command_People_Label">
 		Pessoas
 	</string>
@@ -4778,6 +4795,9 @@ Tente colocar o caminho do editor entre aspas.
 	<string name="Command_Move_Tooltip">
 		Movendo seu avatar
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Transferir itens para o seu mercado para venda
+	</string>
 	<string name="Command_People_Tooltip">
 		Amigos, grupos e pessoas próximas
 	</string>
diff --git a/indra/newview/skins/default/xui/ru/floater_about_land.xml b/indra/newview/skins/default/xui/ru/floater_about_land.xml
index 46414a530aa..ee74aad5ccc 100644
--- a/indra/newview/skins/default/xui/ru/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ru/floater_about_land.xml
@@ -306,9 +306,6 @@
 			<panel.string name="push_restrict_region_text">
 				Не толкать (настройки региона)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				Аватары с других участков могут видеть
-			</panel.string>
 			<text name="allow_label">
 				Позволить другим жителям:
 			</text>
@@ -371,7 +368,7 @@
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Щелкните для выбора изображения"/>
 			<text name="allow_label5">
-				аватары на этом участке и общаться с ними
+				Аватары с других участков могут видеть аватары на этом участке и общаться с ними
 			</text>
 			<check_box label="Видны аватары" name="SeeAvatarsCheck" tool_tip="Аватары с других участков смогут видеть аватары на этом участке и общаться с ними в чате, а вы также сможете видеть их и общаться с ними."/>
 			<text name="landing_point">
@@ -446,20 +443,15 @@
 			<panel.string name="access_estate_defined">
 				(Определено на землевладении)
 			</panel.string>
-			<panel.string name="allow_public_access">
-				Разрешить общий доступ ([MATURITY]) (Снятие приведет к созданию линий запрета)
-			</panel.string>
 			<panel.string name="estate_override">
 				Часть этих параметров установлена на уровне землевладения
 			</panel.string>
-			<text name="Limit access to this parcel to:">
-				Доступ на этот участок
-			</text>
+			<check_box label="Разрешить публичный доступ (снятие флажка приведет к созданию линий запрета)" name="public_access"/>
 			<text name="Only Allow">
-				Разрешить доступ только жителям, у которых:
+				Разрешить доступ только таким жителям:
 			</text>
-			<check_box label="Записана информация об оплате [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Банить нераспознанных жителей."/>
-			<check_box label="Проверка возраста [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Банить жителей, не прошедших проверку возраста. Более подробная информация находится здесь: [SUPPORT_SITE]."/>
+			<check_box label="Зарегистрирована информация об оплате [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Для доступа к этому участку у жителя должна быть зарегистрирована информация об оплате.  Более подробная информация находится здесь: [SUPPORT_SITE]."/>
+			<check_box label="Подтвержден возраст [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Для доступа к этому участку житель должен подтвердить свой возраст. Более подробная информация находится здесь: [SUPPORT_SITE]."/>
 			<check_box label="Разрешить доступ группе: [GROUP]" name="GroupCheck" tool_tip="Группа устанавливается на основной вкладке."/>
 			<check_box label="Продать доступ:" name="PassCheck" tool_tip="Разрешить временный доступ к участку."/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/ru/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/ru/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..332fa3b82fc
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="ТОРГОВЫЕ ИСХОДЯЩИЕ">
+	<string name="OutboxFolderCount1">
+		1 папка
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] папки
+	</string>
+	<string name="OutboxImporting">
+		Отправка папок....
+	</string>
+	<string name="OutboxInitializing">
+		Инициализация...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Загрузка...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="Отправить в торговый центр" name="outbox_import_btn" tool_tip="Выставить на витрину моего магазина"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_model_wizard.xml b/indra/newview/skins/default/xui/ru/floater_model_wizard.xml
index 5b03dd2c731..c1a63bf7da6 100644
--- a/indra/newview/skins/default/xui/ru/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/ru/floater_model_wizard.xml
@@ -6,14 +6,14 @@
 	<button label="2. Оптимизировать" name="optimize_btn"/>
 	<button label="1. Выбрать файл" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Выберите файл модели
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
-				Пользователям в расширенном режиме: если вы умеете создавать трехмерные графические объекты, то, возможно, захотите воспользоваться средством Advanced Uploader, которое предоставляет расширенные возможности передачи объектов.
+				Пользователям, работающим в расширенном режиме: если вы умеете создавать трехмерные графические объекты, то, возможно, захотите воспользоваться средством Advanced Uploader, которое предоставляет расширенные возможности передачи объектов.
 			</text>
 			<button label="Перейти в расширенный режим" name="switch_to_advanced"/>
 			<text name="Cache location">
@@ -35,26 +35,26 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Оптимизировать модель
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			Мы оптимизировали модель для повышения быстродействия. По желанию можно выполнить дополнительную настройку.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
-				Создать уровень детализации: высокий
+				Создать уровень детализации: Высокий
 			</text>
 			<text name="medium_detail_text">
-				Создать уровень детализации: средний
+				Создать уровень детализации: Средний
 			</text>
 			<text name="low_detail_text">
-				Создать уровень детализации: низкий
+				Создать уровень детализации: Низкий
 			</text>
 			<text name="lowest_detail_text">
-				Создать уровень детализации: самый низкий
+				Создать уровень детализации: Самый низкий
 			</text>
 		</panel>
 		<panel name="content2">
@@ -79,19 +79,19 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
-				Настроить физику
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
+				Настроить физические параметры
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Мы создадим форму для внешнего каркаса модели. Настройте уровень детализации формы в соответствии с целями, для которых предназначена модель.
 		</text>
-		<panel name="content">
-			<button label="Пересчитать физику" name="recalculate_physics_btn"/>
+		<panel name="physics_content">
+			<button label="Пересчитать физические данные" name="recalculate_physics_btn"/>
 			<button label="Пересчет..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
-				Просмотр физики
+				Просмотр физических данных
 			</text>
 			<combo_box name="preview_lod_combo2" tool_tip="Уровень детализации при предварительном просмотре">
 				<combo_item name="high">
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Просмотр
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Воздействие на участок/регион: эквивалент в примитивах: [EQUIV]
 			</text>
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Передача завершена
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/ru/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/ru/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..b479d5f6d6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK TESTS"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/ru/menu_inspect_object_gear.xml
index a72b2bef239..30953e830bc 100644
--- a/indra/newview/skins/default/xui/ru/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/ru/menu_inspect_object_gear.xml
@@ -12,6 +12,7 @@
 	<menu_item_call label="Добавить" name="add"/>
 	<menu_item_call label="Пожаловаться" name="report"/>
 	<menu_item_call label="Заблокировать" name="block"/>
+	<menu_item_call label="Разблокировать" name="unblock"/>
 	<menu_item_call label="Приблизить" name="zoom_in"/>
 	<menu_item_call label="Удалить" name="remove"/>
 	<menu_item_call label="Дополнительная информация" name="more_info"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_inventory.xml b/indra/newview/skins/default/xui/ru/menu_inventory.xml
index 4eeb1e46c2f..df5e5329a3e 100644
--- a/indra/newview/skins/default/xui/ru/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Добавить" name="Wearable Add"/>
 	<menu_item_call label="Снять" name="Take Off"/>
 	<menu_item_call label="Копировать в «Торговые исходящие»" name="Merchant Copy"/>
-	<menu_item_call label="Переместить в «Торговые исходящие»" name="Merchant Move"/>
+	<menu_item_call label="Отправить в торговый центр" name="Marketplace Send"/>
 	<menu_item_call label="- нет действий -" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/ru/menu_login.xml b/indra/newview/skins/default/xui/ru/menu_login.xml
index aa3570f1765..93a5ffbb25f 100644
--- a/indra/newview/skins/default/xui/ru/menu_login.xml
+++ b/indra/newview/skins/default/xui/ru/menu_login.xml
@@ -17,8 +17,8 @@
 		<menu_item_call label="Задать размер окна..." name="Set Window Size..."/>
 		<menu_item_call label="Показать лицензионное соглашение" name="TOS"/>
 		<menu_item_call label="Показать сообщение об ошибке" name="Critical"/>
-		<menu_item_call label="Проверка медиабраузера" name="Web Browser Test"/>
 		<menu_item_call label="Тест отладки плавающего окна с веб-контентом" name="Web Content Floater Debug Test"/>
+		<menu label="Уровень журнала" name="Set Logging Level"/>
 		<menu_item_check label="Выбор сетки" name="Show Grid Picker"/>
 		<menu_item_call label="Консоль уведомлений" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml
index 93d0166568d..7698614751e 100644
--- a/indra/newview/skins/default/xui/ru/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Полет" name="Fly"/>
 			<menu_item_check label="Всегда бегать" name="Always Run"/>
 			<menu_item_call label="Остановить анимацию" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Ходьба / бег / полет..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Статус" name="Status">
 			<menu_item_call label="Нет на месте" name="Set Away"/>
 			<menu_item_call label="Не беспокоить" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Запрос статуса администратора" name="Request Admin Options"/>
-		<menu_item_call label="Выход из статуса администратора" name="Leave Admin Options"/>
-		<menu_item_call label="Купить L$" name="Buy and Sell L$"/>
+		<menu_item_call label="Купить L$..." name="Buy and Sell L$"/>
 		<menu_item_call label="Информационная панель аккаунта..." name="Manage My Account"/>
 		<menu_item_call label="Настройки..." name="Preferences"/>
 		<menu_item_call label="Кнопки панели инструментов..." name="Toolbars"/>
@@ -61,7 +60,7 @@
 			<menu_item_check label="Свойства участка" name="Parcel Properties"/>
 			<menu_item_check label="Меню «Дополнительно»" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Солнце" name="Environment Settings">
+		<menu label="Солнце" name="Sun">
 			<menu_item_call label="Восход" name="Sunrise"/>
 			<menu_item_call label="Полдень" name="Noon"/>
 			<menu_item_call label="Закат" name="Sunset"/>
@@ -176,22 +175,22 @@
 			<menu_item_check label="Показывать прицел при обзоре мышью" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Типы визуализации" name="Rendering Types">
-			<menu_item_check label="Обычная" name="Simple"/>
-			<menu_item_check label="Альфа" name="Alpha"/>
-			<menu_item_check label="Дерево" name="Tree"/>
-			<menu_item_check label="Аватары" name="Character"/>
-			<menu_item_check label="Исправление поверхности" name="Surface Patch"/>
-			<menu_item_check label="Небо" name="Sky"/>
-			<menu_item_check label="Вода" name="Water"/>
-			<menu_item_check label="Земля" name="Ground"/>
-			<menu_item_check label="Объем" name="Volume"/>
-			<menu_item_check label="Трава" name="Grass"/>
-			<menu_item_check label="Облака" name="Clouds"/>
-			<menu_item_check label="Частицы" name="Particles"/>
-			<menu_item_check label="Рельефное" name="Bump"/>
+			<menu_item_check label="Простой" name="Rendering Type Simple"/>
+			<menu_item_check label="Альфа" name="Rendering Type Alpha"/>
+			<menu_item_check label="Дерево" name="Rendering Type Tree"/>
+			<menu_item_check label="Аватары" name="Rendering Type Character"/>
+			<menu_item_check label="Исправление поверхности" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Небо" name="Rendering Type Sky"/>
+			<menu_item_check label="Вода" name="Rendering Type Water"/>
+			<menu_item_check label="Земля" name="Rendering Type Ground"/>
+			<menu_item_check label="Объем" name="Rendering Type Volume"/>
+			<menu_item_check label="Трава" name="Rendering Type Grass"/>
+			<menu_item_check label="Облака" name="Rendering Type Clouds"/>
+			<menu_item_check label="Частицы" name="Rendering Type Particles"/>
+			<menu_item_check label="Рельефное" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="Функции визуализации" name="Rendering Features">
-			<menu_item_check label="Интерфейс пользователя" name="UI"/>
+			<menu_item_check label="Интерфейс пользователя" name="ToggleUI"/>
 			<menu_item_check label="Выбрано" name="Selected"/>
 			<menu_item_check label="Выделено" name="Highlighted"/>
 			<menu_item_check label="Динамические текстуры" name="Dynamic Textures"/>
@@ -205,8 +204,6 @@
 		<menu_item_check label="Сглаживание мышью" name="Mouse Smoothing"/>
 		<menu_item_call label="Освободить клавиши" name="Release Keys"/>
 		<menu label="Горячие клавиши" name="Shortcuts">
-			<menu_item_call label="Изображение (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Поиск" name="Search"/>
 			<menu_item_check label="Показать меню «Дополнительно» - старое сочетание клавиш" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Закрыть окно" name="Close Window"/>
 			<menu_item_call label="Закрыть все окна" name="Close All Windows"/>
@@ -215,13 +212,6 @@
 			<menu_item_check label="Обзор джойстиком" name="Joystick Flycam"/>
 			<menu_item_call label="Сброс обзора" name="Reset View"/>
 			<menu_item_call label="Смотреть на последнего говорившего" name="Look at Last Chatter"/>
-			<menu label="Выбрать инструменты" name="Select Tool">
-				<menu_item_call label="Фокус" name="Focus"/>
-				<menu_item_call label="Перемещение" name="Move"/>
-				<menu_item_call label="Редактирование" name="Edit"/>
-				<menu_item_call label="Создание" name="Create"/>
-				<menu_item_call label="Земля" name="Land"/>
-			</menu>
 			<menu_item_call label="Приблизить" name="Zoom In"/>
 			<menu_item_call label="Стандартный масштаб" name="Zoom Default"/>
 			<menu_item_call label="Отодвинуть" name="Zoom Out"/>
@@ -294,6 +284,7 @@
 			<menu_item_check label="Лучи" name="Raycast"/>
 			<menu_item_check label="Направления ветра" name="Wind Vectors"/>
 			<menu_item_check label="Сложность визуализации" name="rendercomplexity"/>
+			<menu_item_check label="Байты присоединения" name="attachment bytes"/>
 			<menu_item_check label="Лепка" name="Sculpt"/>
 		</menu>
 		<menu label="Визуализация" name="Rendering">
@@ -335,9 +326,8 @@
 			<menu_item_call label="Начать запись" name="Start Record"/>
 			<menu_item_call label="Остановить запись" name="Stop Record"/>
 		</menu>
-		<menu label="Мир" name="World">
+		<menu label="Мир" name="DevelopWorld">
 			<menu_item_check label="Перекрытие солнца в симуляторе" name="Sim Sun Override"/>
-			<menu_item_check label="Мигающий маяк" name="Cheesy Beacon"/>
 			<menu_item_check label="Неизменная погода" name="Fixed Weather"/>
 			<menu_item_call label="Вывод кэша региональных объектов" name="Dump Region Object Cache"/>
 		</menu>
@@ -369,11 +359,11 @@
 		</menu>
 		<menu label="Аватар" name="Character">
 			<menu label="Захват запеченных текстур" name="Grab Baked Texture">
-				<menu_item_call label="Радужка" name="Iris"/>
-				<menu_item_call label="Голова" name="Head"/>
-				<menu_item_call label="Верхняя часть тела" name="Upper Body"/>
-				<menu_item_call label="Нижняя часть тела" name="Lower Body"/>
-				<menu_item_call label="Юбка" name="Skirt"/>
+				<menu_item_call label="Радужка" name="Grab Iris"/>
+				<menu_item_call label="Голова" name="Grab Head"/>
+				<menu_item_call label="Верхняя часть тела" name="Grab Upper Body"/>
+				<menu_item_call label="Нижняя часть тела" name="Grab Lower Body"/>
+				<menu_item_call label="Юбка" name="Grab Skirt"/>
 			</menu>
 			<menu label="Проверка персонажа" name="Character Tests">
 				<menu_item_call label="Внешний вид в XML" name="Appearance To XML"/>
@@ -403,14 +393,15 @@
 		<menu_item_call label="Сжатие изображений" name="Compress Images"/>
 		<menu_item_check label="Вывод минидампа при отладке" name="Output Debug Minidump"/>
 		<menu_item_check label="Окно консоли при следующем запуске" name="Console Window"/>
+		<menu label="Уровень журнала" name="Set Logging Level"/>
 		<menu_item_call label="Запрос статуса администратора" name="Request Admin Options"/>
 		<menu_item_call label="Выход из статуса администратора" name="Leave Admin Options"/>
 		<menu_item_check label="Показать меню администратора" name="View Admin Options"/>
 	</menu>
 	<menu label="Администратор" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Взять копию" name="Take Copy"/>
-			<menu_item_call label="Назначить себя владельцем" name="Force Owner To Me"/>
+		<menu label="Объект" name="AdminObject">
+			<menu_item_call label="Сделать копию" name="Admin Take Copy"/>
+			<menu_item_call label="Назначить меня владельцем" name="Force Owner To Me"/>
 			<menu_item_call label="Назначить полноправным владельцем" name="Force Owner Permissive"/>
 			<menu_item_call label="Удалить" name="Delete"/>
 			<menu_item_call label="На месте" name="Lock"/>
@@ -445,7 +436,7 @@
 			<menu_item_call label="Физика" name="Physics"/>
 			<menu_item_call label="Вся одежда" name="All Clothes"/>
 		</menu>
-		<menu label="Справка" name="Help">
+		<menu label="Справка" name="DeprecatedHelp">
 			<menu_item_call label="Официальный блог Linden" name="Official Linden Blog"/>
 			<menu_item_call label="Портал скриптов" name="Scripting Portal"/>
 			<menu label="Сообщение об ошибке" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index 04f2f6b486b..1854d43e0a7 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -86,17 +86,38 @@
 		<usetemplate canceltext="Отмена" name="yesnocancelbuttons" notext="Не сохранять" yestext="Сохранить"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		У вас нет прав для копирования этого элемента в исходящую папку магазина. Вы действительно хотите переместить следующий элемент?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="Нет" yestext="Да"/>
+		У вас нет прав на копирование этих предметов в папку «Торговые исходящие».  Переместите их или оставьте здесь.
+		<usetemplate name="okcancelbuttons" notext="Не перемещать предмет(ы)" yestext="Переместить предмет(ы)"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		Для каждого предмета, перенесенного на верхний уровень папки «Торговые исходящие», создана новая папка.
+		<usetemplate ignoretext="В папке «Торговые исходящие» создана новая папка" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportComplete">
+		Успешно
+
+Все папки успешно отправлены в торговый центр.
+		<usetemplate ignoretext="Все папки отправлены в торговый центр" name="okignore" yestext="OK"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		Некоторые папки не перенесены
+
+Ошибки при отправке некоторых папок в торговый центр.  Эти папки остались в вашей папке «Торговые исходящие».
+
+Подробнее см. в [[MARKETPLACE_IMPORTS_URL] журнале ошибок].
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Передача магазина завершена.
-		<usetemplate name="okbutton" yestext="Ура!"/>
+	<notification name="OutboxImportFailed">
+		Ошибка при передаче
+
+Папки не отправлены в торговый центр из-за ошибки системы или сети.  Повторите попытку позже.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		Передача магазина выполнена с ошибками!  Устраните проблемы в исходящей папке и повторите передачу.  Спасибо!
-		<usetemplate name="okbutton" yestext="Бу-у-у!"/>
+	<notification name="OutboxInitFailed">
+		Ошибка инициализации торгового центра
+
+Не удалось инициализировать торговый центр из-за ошибки системы или сети.  Повторите попытку позже.
+		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		Ошибка при передаче текста скрипта по следующей причине: [REASON]. Повторите попытку позже.
@@ -1436,7 +1457,7 @@ http://secondlife.com/download.
 		<usetemplate ignoretext="Подтверждать перед возвратом объектов владельцам" name="okcancelignore" notext="Отмена" yestext="OK"/>
 	</notification>
 	<notification name="GroupLeaveConfirmMember">
-		Вы являетесь участником группы &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
+		Вы сейчас входите в группу &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
 Хотите покинуть группу?
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
@@ -2816,6 +2837,18 @@ http://secondlife.com/download.
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
 	</notification>
+	<notification name="ShareFolderConfirmation">
+		Раздать можно только одну папку за раз.
+
+Вы действительно хотите поделиться предметами:
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+Со следующими жителями:
+
+[RESIDENTS]
+		<usetemplate name="okcancelbuttons" notext="Отмена" yestext="ОК"/>
+	</notification>
 	<notification name="ItemsShared">
 		Предметы успешно розданы.
 	</notification>
diff --git a/indra/newview/skins/default/xui/ru/panel_region_estate.xml b/indra/newview/skins/default/xui/ru/panel_region_estate.xml
index 27ec10b323e..93b21704bcd 100644
--- a/indra/newview/skins/default/xui/ru/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/ru/panel_region_estate.xml
@@ -20,10 +20,10 @@
 	<slider label="Фаза" name="sun_hour_slider"/>
 	<check_box label="Разрешить общий доступ" name="externally_visible_check"/>
 	<text name="Only Allow">
-		Разрешить доступ только аккаунтам с подтверждением:
+		Разрешить доступ только таким жителям:
 	</text>
-	<check_box label="Информации об оплате в файле" name="limit_payment" tool_tip="Банить нераспознанных жителей"/>
-	<check_box label="Проверка возраста" name="limit_age_verified" tool_tip="Банить жителей, не прошедших проверку возраста. Более подробная информация находится здесь: [SUPPORT_SITE]."/>
+	<check_box label="Зарегистрирована информация об оплате" name="limit_payment" tool_tip="Для доступа к этому землевладению у жителя должна быть зарегистрирована информация об оплате.  Более подробная информация находится здесь: [SUPPORT_SITE]."/>
+	<check_box label="Подтвержден возраст" name="limit_age_verified" tool_tip="Для доступа к этому землевладению житель должен подтвердить свой возраст. Более подробная информация находится здесь: [SUPPORT_SITE]."/>
 	<check_box label="Разрешить голосовое общение" name="voice_chat_check"/>
 	<check_box label="Разрешить прямой телепорт" name="allow_direct_teleport"/>
 	<button label="Применить" name="apply_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_script_ed.xml b/indra/newview/skins/default/xui/ru/panel_script_ed.xml
index 1a9c5121479..05ccaeb54b3 100644
--- a/indra/newview/skins/default/xui/ru/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/ru/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="Файл" name="File">
 			<menu_item_call label="Сохранить" name="Save"/>
 			<menu_item_call label="Отменить все изменения" name="Revert All Changes"/>
+			<menu_item_call label="Загрузить из файла..." name="LoadFromFile"/>
+			<menu_item_call label="Сохранить в файл..." name="SaveToFile"/>
 		</menu>
 		<menu label="Изменить" name="Edit">
 			<menu_item_call label="Отменить" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
index a4150f6e2fd..b3d3ed9aad5 100644
--- a/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="Вещи" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Полученные вещи ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Полученные вещи
-							</string>
-							<button label="Полученные вещи" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								Новых: [NUM]
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Покупки из торгового центра будут доставлены сюда.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Торговые исходящие ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Торговые исходящие
-							</string>
-							<button label="Торговые исходящие" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="Выставить на витрину моего магазина"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Загрузка...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Полученные вещи ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Полученные вещи
+					</string>
+					<button label="Полученные вещи" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						Новых: [NUM]
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Покупки из торгового центра будут доставлены сюда.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 6d954139ffa..4240514621d 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -180,8 +180,8 @@ http://secondlife.com/viewer-access-faq
 Обновление состояния см. на веб-странице www.secondlife.com/status.
 	</string>
 	<string name="LoginFailedPremiumOnly">
-		Вход в Second Life временно ограничен, чтобы обеспечить наилучшее времяпровождение в игровом мире.
-	 	
+		Вход в Second Life временно ограничен, чтобы сохранить наивысшее качество игрового мира для текущих пользователей.
+
 В это время у пользователей с бесплатными аккаунтами не будет доступа к Second Life, чтобы у тех, кто заплатил, было больше места.
 	</string>
 	<string name="LoginFailedComputerProhibited">
@@ -339,17 +339,35 @@ support@secondlife.com.
 		Сюда можно перетащить только одну вещь
 	</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]:"/>
+	<string name="TooltipOutboxDragToWorld">
+		Нельзя выложить предметы из папке «Торговые исходящие»
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Часть этих объектов нельзя продать, или они переданы другому пользователю.
+		Часть этих объектов нельзя продать или передать.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		Ваша папка «Торговые исходящие» может получать вещи только непосредственно из вашего инвентаря
 	</string>
 	<string name="TooltipOutboxWorn">
-		Часть этих объектов на вас. Снимите их со своего аватара и попробуйте переместить их еще раз.
+		Носимые предметы нельзя поместить в папку «Торговые исходящие»
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		Визитки нельзя поместить в папку «Торговые исходящие»
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		В этой папке слишком много уровней вложенных папок. Измените структуру вложенных папок, ограничив ее глубину 4 уровнями (корневая папка, вложенные папки уровня А, вложенные в них папки уровня Б, вложенные в них папки уровня В).
+		Глубина вложения папок превышает 3
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		В папке верхнего уровня более 20 подпапок
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Эта папка содержит более 200 объектов. Сложите некоторые вещи в коробки, чтобы уменьшить число объектов.
+		В папке верхнего уровня более 200 предметов
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		Папку нельзя переместить в ее подпапку
+	</string>
+	<string name="TooltipDragOntoSelf">
+		Папку нельзя переместить саму в себя
 	</string>
 	<string name="TooltipHttpUrl">
 		Щелкните, чтобы просмотреть эту веб-страницу
@@ -973,6 +991,9 @@ support@secondlife.com.
 	<string name="choose_the_directory">
 		Выбрать каталог
 	</string>
+	<string name="script_files">
+		Скрипты
+	</string>
 	<string name="AvatarSetNotAway">
 		На месте
 	</string>
@@ -1211,43 +1232,36 @@ support@secondlife.com.
 		В вашем инвентаре нет копии этой текстуры
 	</string>
 	<string name="InventoryInboxNoItems">
-		Если вы купите или как-то иначе получите предмет, он появится здесь. Его можно будет перетащить в папку вашего инвентаря или удалить, если он больше не нужен.
+		Здесь будут появляться полученные вами предметы, например подарки.  Их можно будет перетащить в ваш инвентарь.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
-	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		Папка «Торговые исходящие» настроена неправильно
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Ошибка конфигурации папки «Торговые исходящие»
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Чтобы исправить эту проблему, обратитесь в службу поддержки.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Продавать вещи в торговом центре может кто угодно
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		Станьте торговцем!
+		Продавать вещи в торговом центре может кто угодно.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] Торговый центр Second Life] предлагает на продажу более миллиона виртуальных продуктов, и все они созданы жителями Second Life. Вы тоже можете продавать созданные вами вещи, а также некоторые из вещей, купленных вами. Это совсем несложно. Настройка выполняется бесплатно.  [[LEARN_MORE_URL] Узнайте подробности] или [[CREATE_STORE_URL] создайте магазин] в торговом центре, чтобы начать торговлю.
+		Если вы хотите стать торговцем, [[MARKETPLACE_CREATE_STORE_URL] создайте магазин].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Новый способ отправки вещей в торговый центр
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Перетащите вещи сюда, чтобы подготовить их для продажи в торговом центре
+		Ваша папка «Исходящие» пуста.
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Перетаскивайте в эту область вещи и папки, которые хотите продать.  При перетаскивании создается копия вещи (за исключением вещей, недоступных для копирования), поэтому инвентарь не изменяется.  Когда все готово для отправки вещей в торговый центр, нажмите кнопку «Передать». Вещи, перемещенные в инвентарь магазина, исчезают из этой папки.
+		Перетащите папки в эту область и щелкните «Отправить в торговый центр», чтобы выставить их на продажу в [[MARKETPLACE_DASHBOARD_URL] Торговом центре].
 	</string>
 	<string name="Marketplace Error None">
 		Ошибок нет
@@ -4098,7 +4112,7 @@ support@secondlife.com.
 	</string>
 	<string name="uploading_abuse_report">
 		Загружается...
-  
+
 Жалоба
 	</string>
 	<string name="New Shape">
@@ -4365,7 +4379,8 @@ support@secondlife.com.
 	<string name="words_separator" value=","/>
 	<string name="server_is_down">
 		Несмотря на наши усилия, что-то неожиданно пошло не так.
-	Ознакомьтесь с описанием известных проблем в работе этой службы на сайте status.secondlifegrid.net.  
+
+	Ознакомьтесь с описанием известных проблем в работе этой службы на сайте status.secondlifegrid.net.
         Если проблемы продолжаются, то проверьте подключение к сети и настройки брандмауэра.
 	</string>
 	<string name="dateTimeWeekdaysNames">
@@ -4844,6 +4859,9 @@ support@secondlife.com.
 	<string name="Command_Move_Label">
 		Ходьба / бег / полет
 	</string>
+	<string name="Command_Outbox_Label">
+		Торговые исходящие
+	</string>
 	<string name="Command_People_Label">
 		Люди
 	</string>
@@ -4916,6 +4934,9 @@ support@secondlife.com.
 	<string name="Command_Move_Tooltip">
 		Перемещение аватара
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Перенести предметы в торговый центр для продажи
+	</string>
 	<string name="Command_People_Tooltip">
 		Друзья, группы и люди поблизости
 	</string>
diff --git a/indra/newview/skins/default/xui/tr/floater_about_land.xml b/indra/newview/skins/default/xui/tr/floater_about_land.xml
index dde658d64d6..a478d347a8b 100644
--- a/indra/newview/skins/default/xui/tr/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about_land.xml
@@ -306,9 +306,6 @@ Sadece büyük parseller aramada görünür.
 			<panel.string name="push_restrict_region_text">
 				İtme Yok (Bölge Geçersiz Kılma)
 			</panel.string>
-			<panel.string name="see_avs_text">
-				DiÄŸer parsellerdeki avatarlar bu
-			</panel.string>
 			<text name="allow_label">
 				Sakinlere şunun için izin ver:
 			</text>
@@ -371,7 +368,7 @@ Sadece büyük parseller aramada görünür.
 			</text>
 			<texture_picker name="snapshot_ctrl" tool_tip="Bir resim seçmek için tıklayın"/>
 			<text name="allow_label5">
-				bu parseldeki avatarları görebilir ve onlarla sohbet edebilir
+				Başka parsellerdeki avatarlar bu parseldeki avatarları görebilir ve onlarla sohbet edebilir
 			</text>
 			<check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki avatarların bu parseldeki avatarları görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/>
 			<text name="landing_point">
@@ -446,20 +443,15 @@ Sadece büyük parseller aramada görünür.
 			<panel.string name="access_estate_defined">
 				(Gayrimenkul tarafından tanımlanır)
 			</panel.string>
-			<panel.string name="allow_public_access">
-				Kamusal Erişime İzin Ver ([MATURITY]) (Not: İşaret kaldırılırsa yasaklama çizgileri oluşur)
-			</panel.string>
 			<panel.string name="estate_override">
 				Bu seçeneklerden biri veya daha fazlası gayrimenkul düzeyinde ayarlanır
 			</panel.string>
-			<text name="Limit access to this parcel to:">
-				Bu Parsele EriÅŸim
-			</text>
+			<check_box label="Kamusal Erişime İzin Ver (Bunun işaretinin kaldırılması yasaklama çizgileri oluşturacaktır)" name="public_access"/>
 			<text name="Only Allow">
-				Erişimi şununla doğrulanan Sakinlerle Sınırla:
+				Sadece ÅŸu Sakinlere eriÅŸim izni verin:
 			</text>
-			<check_box label="Dosyadaki ödeme bilgileri [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Tanınmayan Sakinleri Yasakla."/>
-			<check_box label="Yaş doğrulama [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Yaşını doğrulamayan Sakinleri yasakla Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
+			<check_box label="Ödeme bilgileri kayıtlı [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Sakinlerin bu parsele erişebilmesi için ödeme bilgilerinin kayıtlı olması gerekir.  Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
+			<check_box label="Yaş doğrulaması yapılmış [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Sakinlerin bu parsele erişebilmesi için yaş doğrulamalarının yapılmış olması gerekir. Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
 			<check_box label="Grup EriÅŸimine Ä°zin Ver: [GROUP]" name="GroupCheck" tool_tip="Genel sekmesinde grup ayarla."/>
 			<check_box label="Geçiş haklr. şuna sat:" name="PassCheck" tool_tip="Bu parsele geçici erişim verir"/>
 			<combo_box name="pass_combo">
diff --git a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
index dee17b7bc4c..988c845982f 100644
--- a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
@@ -2,6 +2,6 @@
 <floater name="chat_bar" title="YAKINDAKÄ° SOHBET">
 	<panel name="bottom_panel">
 		<line_editor label="Sohbet etmek için buraya tıklayın." name="chat_box" tool_tip="Söylemek için Enter, bağırmak için Ctrl+Enter yapın"/>
-		<button name="show_nearby_chat" tool_tip="yakın sohbet günlüğünü gösterir/gizler"/>
+		<button name="show_nearby_chat" tool_tip="Yakın sohbet günlüğünü gösterir/gizler"/>
 	</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/tr/floater_merchant_outbox.xml
new file mode 100644
index 00000000000..325d1d9ed97
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_merchant_outbox.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_merchant_outbox" title="SATICI GÄ°DEN KUTUSU">
+	<string name="OutboxFolderCount1">
+		1 klasör
+	</string>
+	<string name="OutboxFolderCountN">
+		[NUM] klasör
+	</string>
+	<string name="OutboxImporting">
+		Klasörler gönderiliyor...
+	</string>
+	<string name="OutboxInitializing">
+		Başlatılıyor...
+	</string>
+	<panel label="">
+		<panel>
+			<panel name="outbox_inventory_placeholder_panel">
+				<text name="outbox_inventory_placeholder_title">
+					Yükleniyor...
+				</text>
+			</panel>
+		</panel>
+		<panel>
+			<button label="Pazaryerine Gönder" name="outbox_import_btn" tool_tip="Pazaryeri Vitrinime Gönder"/>
+		</panel>
+	</panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_model_wizard.xml b/indra/newview/skins/default/xui/tr/floater_model_wizard.xml
index b3c72ba2da4..9d8b982c249 100644
--- a/indra/newview/skins/default/xui/tr/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/tr/floater_model_wizard.xml
@@ -6,12 +6,12 @@
 	<button label="2. Optimize et" name="optimize_btn"/>
 	<button label="1. Dosya Seç" name="choose_file_btn"/>
 	<panel name="choose_file_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="choose_file_header_panel">
+			<text name="choose_file_header_text">
 				Model dosyasını seçin
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="choose_file_content">
 			<text name="advanced_users_text">
 				Gelişmiş kullanıcılar: Eğer 3B içerik oluşturma araçlarını kullanmayı biliyorsanız, Gelişmiş Karşıya Yükleyiciyi kullanmak isteyebilirsiniz.
 			</text>
@@ -35,15 +35,15 @@
 		</panel>
 	</panel>
 	<panel name="optimize_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="optimize_header_panel">
+			<text name="optimize_header_text">
 				Modeli optimize et
 			</text>
 		</panel>
-		<text name="description">
+		<text name="optimize_description">
 			Modeli performans için optimize ettik. İstiyorsanız daha da ayarlayabilirsiniz.
 		</text>
-		<panel name="content">
+		<panel name="optimize_content">
 			<text name="high_detail_text">
 				Ayrıntı Seviyesi Oluştur: Yüksek
 			</text>
@@ -79,15 +79,15 @@
 		</panel>
 	</panel>
 	<panel name="physics_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="physics_header_panel">
+			<text name="physics_header_text">
 				Fizik ayarlarını yap
 			</text>
 		</panel>
-		<text name="description">
+		<text name="physics_description">
 			Modelin dış gövdesi için bir şekil oluşturacağız. Modelinizin amacına uygun olarak şeklin ayrıntı seviyesini belirleyin.
 		</text>
-		<panel name="content">
+		<panel name="physics_content">
 			<button label="Fizik hesaplarını tekrar yap" name="recalculate_physics_btn"/>
 			<button label="Tekrar hesaplanıyor..." name="recalculating_physics_btn"/>
 			<text name="lod_label">
@@ -110,12 +110,12 @@
 		</panel>
 	</panel>
 	<panel name="review_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="review_header_panel">
+			<text name="review_header_text">
 				Ä°ncele
 			</text>
 		</panel>
-		<panel name="content">
+		<panel name="review_content">
 			<text name="review_prim_equiv">
 				Parsele/bölgeye etkisi: [EQUIV] prim eşdeğerleri
 			</text>
@@ -128,8 +128,8 @@
 		</panel>
 	</panel>
 	<panel name="upload_panel">
-		<panel name="header_panel">
-			<text name="header_text">
+		<panel name="upload_header_panel">
+			<text name="upload_header_text">
 				Karşıya yükleme bitti
 			</text>
 		</panel>
diff --git a/indra/newview/skins/default/xui/tr/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/tr/floater_test_layout_stacks.xml
new file mode 100644
index 00000000000..b479d5f6d6b
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_test_layout_stacks.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="LAYOUTSTACK TESTS"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/tr/menu_inspect_object_gear.xml
index 02e54155980..d1d3f9ac8dd 100644
--- a/indra/newview/skins/default/xui/tr/menu_inspect_object_gear.xml
+++ b/indra/newview/skins/default/xui/tr/menu_inspect_object_gear.xml
@@ -12,6 +12,7 @@
 	<menu_item_call label="Ekle" name="add"/>
 	<menu_item_call label="Raporla" name="report"/>
 	<menu_item_call label="Engelle" name="block"/>
+	<menu_item_call label="Engellemeyi Kaldır" name="unblock"/>
 	<menu_item_call label="Yakınlaştır" name="zoom_in"/>
 	<menu_item_call label="Kaldır" name="remove"/>
 	<menu_item_call label="Ek Bilgi" name="more_info"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_inventory.xml b/indra/newview/skins/default/xui/tr/menu_inventory.xml
index f14066fd7b5..6aaaab9c79f 100644
--- a/indra/newview/skins/default/xui/tr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/menu_inventory.xml
@@ -84,6 +84,6 @@
 	<menu_item_call label="Ekle" name="Wearable Add"/>
 	<menu_item_call label="Çıkar" name="Take Off"/>
 	<menu_item_call label="Satıcı Giden Kutusuna Kopyala" name="Merchant Copy"/>
-	<menu_item_call label="Satıcı Giden Kutusuna Taşı" name="Merchant Move"/>
+	<menu_item_call label="Pazaryerine Gönder" name="Marketplace Send"/>
 	<menu_item_call label="--seçenek yok--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/tr/menu_login.xml b/indra/newview/skins/default/xui/tr/menu_login.xml
index 4c3539b38b8..f27908bf7ae 100644
--- a/indra/newview/skins/default/xui/tr/menu_login.xml
+++ b/indra/newview/skins/default/xui/tr/menu_login.xml
@@ -17,8 +17,8 @@
 		<menu_item_call label="Pencere Büyüklüğünü Ayarla..." name="Set Window Size..."/>
 		<menu_item_call label="Hizmet Şartlarını Göster" name="TOS"/>
 		<menu_item_call label="Kritik İletiyi Göster" name="Critical"/>
-		<menu_item_call label="Ortam Tarayıcı Testi" name="Web Browser Test"/>
 		<menu_item_call label="Web İçeriği Gezdiricisi Hata Ayıklama Testi" name="Web Content Floater Debug Test"/>
+		<menu label="Günlük Tutma Seviyesini Seç" name="Set Logging Level"/>
 		<menu_item_check label="Izgara Seçiciyi Göster" name="Show Grid Picker"/>
 		<menu_item_call label="Bildirimler Konsolunu Göster" name="Show Notifications Console"/>
 	</menu>
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index ef10d639d77..d24757bb799 100644
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -14,14 +14,13 @@
 			<menu_item_check label="Uç" name="Fly"/>
 			<menu_item_check label="Daima KoÅŸ" name="Always Run"/>
 			<menu_item_call label="Beni Anime Etmeyi Durdur" name="Stop Animating My Avatar"/>
+			<menu_item_call label="Yürü / koş / uç..." name="Walk / run / fly"/>
 		</menu>
 		<menu label="Durum" name="Status">
 			<menu_item_call label="Uzakta" name="Set Away"/>
 			<menu_item_call label="MeÅŸgul" name="Set Busy"/>
 		</menu>
-		<menu_item_call label="Yönetici Durumu Talep Et" name="Request Admin Options"/>
-		<menu_item_call label="Yönetici Durumundan Ayrıl" name="Leave Admin Options"/>
-		<menu_item_call label="L$ Satın Al" name="Buy and Sell L$"/>
+		<menu_item_call label="L$ Satın Al..." name="Buy and Sell L$"/>
 		<menu_item_call label="Hesap kontrol paneli..." name="Manage My Account"/>
 		<menu_item_call label="Tercihler..." name="Preferences"/>
 		<menu_item_call label="Araç çubuğu düğmeleri..." name="Toolbars"/>
@@ -61,12 +60,12 @@
 			<menu_item_check label="Parsel Özellikleri" name="Parcel Properties"/>
 			<menu_item_check label="Gelişmiş Menü" name="Show Advanced Menu"/>
 		</menu>
-		<menu label="Güneş" name="Environment Settings">
+		<menu label="Güneş" name="Sun">
 			<menu_item_call label="Gün Doğumu" name="Sunrise"/>
 			<menu_item_call label="Gün Ortası" name="Noon"/>
 			<menu_item_call label="Gün Batımı" name="Sunset"/>
 			<menu_item_call label="Gece Yarısı" name="Midnight"/>
-			<menu_item_call label="Bölge Ayarlarını Kullanın" name="Use Region Settings"/>
+			<menu_item_call label="Bölge Ayarlarını Kullan" name="Use Region Settings"/>
 		</menu>
 		<menu label="Ortam Düzenleyici" name="Environment Editor">
 			<menu_item_call label="Ortam Ayarları..." name="Environment Settings"/>
@@ -176,22 +175,22 @@
 			<menu_item_check label="Fare Üzerinden Görünüm Artı İşaretini Göster" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="İşleme Türleri" name="Rendering Types">
-			<menu_item_check label="Basit" name="Simple"/>
-			<menu_item_check label="Alfa" name="Alpha"/>
-			<menu_item_check label="Ağaç" name="Tree"/>
-			<menu_item_check label="Avatarlar" name="Character"/>
-			<menu_item_check label="Yüzey Yaması" name="Surface Patch"/>
-			<menu_item_check label="Gökyüzü" name="Sky"/>
-			<menu_item_check label="Su" name="Water"/>
-			<menu_item_check label="Toprak" name="Ground"/>
-			<menu_item_check label="Hacim" name="Volume"/>
-			<menu_item_check label="Çimen" name="Grass"/>
-			<menu_item_check label="Bulutlar" name="Clouds"/>
-			<menu_item_check label="Parçacıklar" name="Particles"/>
-			<menu_item_check label="Tümsek" name="Bump"/>
+			<menu_item_check label="Basit" name="Rendering Type Simple"/>
+			<menu_item_check label="Alfa" name="Rendering Type Alpha"/>
+			<menu_item_check label="Ağaç" name="Rendering Type Tree"/>
+			<menu_item_check label="Avatarlar" name="Rendering Type Character"/>
+			<menu_item_check label="Yüzey Yaması" name="Rendering Type Surface Patch"/>
+			<menu_item_check label="Gökyüzü" name="Rendering Type Sky"/>
+			<menu_item_check label="Su" name="Rendering Type Water"/>
+			<menu_item_check label="Toprak" name="Rendering Type Ground"/>
+			<menu_item_check label="Hacim" name="Rendering Type Volume"/>
+			<menu_item_check label="Çimen" name="Rendering Type Grass"/>
+			<menu_item_check label="Bulutlar" name="Rendering Type Clouds"/>
+			<menu_item_check label="Parçacıklar" name="Rendering Type Particles"/>
+			<menu_item_check label="Tümsek" name="Rendering Type Bump"/>
 		</menu>
 		<menu label="İşleme Özellikleri" name="Rendering Features">
-			<menu_item_check label="KA" name="UI"/>
+			<menu_item_check label="KA" name="ToggleUI"/>
 			<menu_item_check label="Seçili" name="Selected"/>
 			<menu_item_check label="Vurgulanmış" name="Highlighted"/>
 			<menu_item_check label="Dinamik Dokular" name="Dynamic Textures"/>
@@ -205,8 +204,6 @@
 		<menu_item_check label="Fare Düzleştirme" name="Mouse Smoothing"/>
 		<menu_item_call label="Bırakma Anahtarları" name="Release Keys"/>
 		<menu label="Kısa Yollar" name="Shortcuts">
-			<menu_item_call label="Görüntü (L$[COST])..." name="Upload Image"/>
-			<menu_item_check label="Ara" name="Search"/>
 			<menu_item_check label="Gelişmiş Menüyü Göster - eski kısayol" name="Show Advanced Menu - legacy shortcut"/>
 			<menu_item_call label="Pencereyi Kapat" name="Close Window"/>
 			<menu_item_call label="Tüm Pencereleri Kapat" name="Close All Windows"/>
@@ -215,13 +212,6 @@
 			<menu_item_check label="Oyun Çubuğu Flycam" name="Joystick Flycam"/>
 			<menu_item_call label="Görünümü Sıfırla" name="Reset View"/>
 			<menu_item_call label="Son Sohbet Edene Bak" name="Look at Last Chatter"/>
-			<menu label="İnşa Et Aracını Seç" name="Select Tool">
-				<menu_item_call label="Odaklanma Aracı" name="Focus"/>
-				<menu_item_call label="Hareket Ettirme Aracı" name="Move"/>
-				<menu_item_call label="Düzenleme Aracı" name="Edit"/>
-				<menu_item_call label="Oluşturma Aracı" name="Create"/>
-				<menu_item_call label="Arazi Aracı" name="Land"/>
-			</menu>
 			<menu_item_call label="Yakınlaştır" name="Zoom In"/>
 			<menu_item_call label="Varsayılan Yakınlaştırma" name="Zoom Default"/>
 			<menu_item_call label="Uzaklaştırma" name="Zoom Out"/>
@@ -294,6 +284,7 @@
 			<menu_item_check label="Işın Yayını" name="Raycast"/>
 			<menu_item_check label="Rüzgar Vektörleri" name="Wind Vectors"/>
 			<menu_item_check label="İşleme Karmaşıklığı" name="rendercomplexity"/>
+			<menu_item_check label="Aksesuar Bayt Büyüklüğü" name="attachment bytes"/>
 			<menu_item_check label="Åžekillendir" name="Sculpt"/>
 		</menu>
 		<menu label="Ä°ÅŸleme" name="Rendering">
@@ -335,9 +326,8 @@
 			<menu_item_call label="Kaydı Başlat" name="Start Record"/>
 			<menu_item_call label="Kaydı Durdur" name="Stop Record"/>
 		</menu>
-		<menu label="Dünya" name="World">
+		<menu label="Dünya" name="DevelopWorld">
 			<menu_item_check label="Sim Güneşi Geçersiz Kıl" name="Sim Sun Override"/>
-			<menu_item_check label="Yanıp Sönen İşaret" name="Cheesy Beacon"/>
 			<menu_item_check label="Sabit Hava Durumu" name="Fixed Weather"/>
 			<menu_item_call label="Bölge Nesne Önbelleğinin Dökümünü Al" name="Dump Region Object Cache"/>
 		</menu>
@@ -369,11 +359,11 @@
 		</menu>
 		<menu label="Avatar" name="Character">
 			<menu label="KaydedilmiÅŸ Dokuyu Al" name="Grab Baked Texture">
-				<menu_item_call label="Ä°ris" name="Iris"/>
-				<menu_item_call label="BaÅŸ" name="Head"/>
-				<menu_item_call label="Üst Gövde" name="Upper Body"/>
-				<menu_item_call label="Alt Gövde" name="Lower Body"/>
-				<menu_item_call label="Etek" name="Skirt"/>
+				<menu_item_call label="Ä°ris" name="Grab Iris"/>
+				<menu_item_call label="BaÅŸ" name="Grab Head"/>
+				<menu_item_call label="Üst Gövde" name="Grab Upper Body"/>
+				<menu_item_call label="Alt Gövde" name="Grab Lower Body"/>
+				<menu_item_call label="Etek" name="Grab Skirt"/>
 			</menu>
 			<menu label="Karakter Testleri" name="Character Tests">
 				<menu_item_call label="XML&apos;de Görünüm" name="Appearance To XML"/>
@@ -403,15 +393,16 @@
 		<menu_item_call label="Görüntüleri Sıkıştır" name="Compress Images"/>
 		<menu_item_check label="Mini Döküm Dosyası Hata Ayıklama Çıktısı" name="Output Debug Minidump"/>
 		<menu_item_check label="Sonraki Çalışmada Konsol Penceresi" name="Console Window"/>
+		<menu label="Günlük Tutma Seviyesini Seç" name="Set Logging Level"/>
 		<menu_item_call label="Yönetici Durumu Talep Et" name="Request Admin Options"/>
 		<menu_item_call label="Yönetici Durumundan Ayrıl" name="Leave Admin Options"/>
 		<menu_item_check label="Yönetici Menüsünü Göster" name="View Admin Options"/>
 	</menu>
 	<menu label="Yönetici" name="Admin">
-		<menu label="Object">
-			<menu_item_call label="Kopya Al" name="Take Copy"/>
-			<menu_item_call label="Mülkiyetime Geçir" name="Force Owner To Me"/>
-			<menu_item_call label="İzinlerle Birlikte Mülkiyetime Geçir" name="Force Owner Permissive"/>
+		<menu label="Nesne" name="AdminObject">
+			<menu_item_call label="Kopya Al" name="Admin Take Copy"/>
+			<menu_item_call label="Zorunlu Olarak Mülkiyetime Geçir" name="Force Owner To Me"/>
+			<menu_item_call label="Sahibin İzinlerini Zorunlu Kıl" name="Force Owner Permissive"/>
 			<menu_item_call label="Sil" name="Delete"/>
 			<menu_item_call label="Kilitle" name="Lock"/>
 			<menu_item_call label="Varlık Kimliklerini Al" name="Get Assets IDs"/>
@@ -445,7 +436,7 @@
 			<menu_item_call label="Fizik" name="Physics"/>
 			<menu_item_call label="Tüm Giysiler" name="All Clothes"/>
 		</menu>
-		<menu label="Yardım" name="Help">
+		<menu label="Yardım" name="DeprecatedHelp">
 			<menu_item_call label="Resmi Linden Blog&apos;u" name="Official Linden Blog"/>
 			<menu_item_call label="Komut Dosyası Portalı" name="Scripting Portal"/>
 			<menu label="Hata Raporlama" name="Bug Reporting">
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index 631634aa7d1..719dbb8781a 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -86,17 +86,38 @@ Hata ayrıntıları: &apos;[_NAME]&apos; adlı bildirim notifications.xml içind
 		<usetemplate canceltext="Ä°ptal" name="yesnocancelbuttons" notext="Kaydetme" yestext="Kaydet"/>
 	</notification>
 	<notification name="ConfirmNoCopyToOutbox">
-		Bu öğeyi Pazaryeri Giden Kutunuza kopyalama izniniz yok. Aşağıdaki öğeyi taşımak istediğinize emin misiniz?
-        [ITEM_NAME]
-		<usetemplate name="okcancelbuttons" notext="Hayır" yestext="Evet"/>
+		Bu öğelerden bir veya daha fazlasını Satıcı Giden Kutusuna kopyalama izniniz yok.  Bunları taşıyabilir veya bırakabilirsiniz.
+		<usetemplate name="okcancelbuttons" notext="Öğeleri taşıma" yestext="Öğeleri taşı"/>
+	</notification>
+	<notification name="OutboxFolderCreated">
+		Satıcı Giden Kutunuzun üst seviyesine aktardığınız her bir öğe için yeni bir klasör oluşturuldu.
+		<usetemplate ignoretext="Satıcı Giden Kutusunda yeni bir klasör oluşturuldu" name="okignore" yestext="Tamam"/>
+	</notification>
+	<notification name="OutboxImportComplete">
+		Başarılı oldu
+
+Tüm klasörler başarıyla Pazaryerine gönderildi.
+		<usetemplate ignoretext="Tüm klasörler Pazaryerine gönderildi" name="okignore" yestext="Tamam"/>
+	</notification>
+	<notification name="OutboxImportHadErrors">
+		Bazı klasörler aktarılmadı
+
+Bazı klasörler Pazaryerine gönderildiğinde hatalar meydana geldi.  Bu klasörler hala Satıcı Giden Kutunuzda.
+
+Daha fazla bilgi için bkz. [[MARKETPLACE_IMPORTS_URL] hata günlüğü].
+		<usetemplate name="okbutton" yestext="Tamam"/>
 	</notification>
-	<notification name="OutboxUploadComplete">
-		Pazaryerinin karşıya yüklenmesi tamamlandı.
-		<usetemplate name="okbutton" yestext="Yaşasın!"/>
+	<notification name="OutboxImportFailed">
+		Aktarım başarılamadı
+
+Bir sistem veya ağ hatası nedeniyle Pazaryerine hiçbir klasör gönderilemedi.  Daha sonra tekrar deneyin.
+		<usetemplate name="okbutton" yestext="Tamam"/>
 	</notification>
-	<notification name="OutboxUploadHadErrors">
-		Pazaryerinin karşıya yüklenmesi hatalarla tamamlandı!  Lütfen giden kutunuzdaki sorunları düzeltin ve tekrar deneyin.  Teşekkürler.
-		<usetemplate name="okbutton" yestext="Yuh!"/>
+	<notification name="OutboxInitFailed">
+		Pazaryeri başlatılamadı.
+
+Bir sistem veya ağ hatası nedeniyle Pazaryeri başlatılamadı.  Daha sonra tekrar deneyin.
+		<usetemplate name="okbutton" yestext="Tamam"/>
 	</notification>
 	<notification name="CompileQueueSaveText">
 		Aşağıdaki nedenden dolayı, bir komut dosyası için metin karşıya yüklenirken bir sorun oluştu: [REASON]. Lütfen daha sonra tekrar deneyin.
@@ -2813,6 +2834,18 @@ Ayrıntılar için günlük dosyasına bakın.
 
 Paylaşmanın yapılacağı Sakinler:
 
+[RESIDENTS]
+		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
+	</notification>
+	<notification name="ShareFolderConfirmation">
+		Bir defada sadece bir klasör paylaşılabilir.
+
+Aşağıdaki öğeleri paylaşmak istediğinize emin misiniz?
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+Paylaşmanın yapılacağı Second Life Sakinleri:
+
 [RESIDENTS]
 		<usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/>
 	</notification>
diff --git a/indra/newview/skins/default/xui/tr/panel_region_estate.xml b/indra/newview/skins/default/xui/tr/panel_region_estate.xml
index 4ba55cafb6e..f1df13df612 100644
--- a/indra/newview/skins/default/xui/tr/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/tr/panel_region_estate.xml
@@ -20,10 +20,10 @@
 	<slider label="Faz" name="sun_hour_slider"/>
 	<check_box label="Kamusal EriÅŸime Ä°zin Ver" name="externally_visible_check"/>
 	<text name="Only Allow">
-		Erişimi şununla doğrulanan hesaplarla sınırla:
+		Sadece ÅŸu Sakinlere eriÅŸim izni verin:
 	</text>
-	<check_box label="Dosyadaki Ödeme Bilgileri" name="limit_payment" tool_tip="Tanınmayan Sakinleri Yasakla"/>
-	<check_box label="Yaş Doğrulama" name="limit_age_verified" tool_tip="Yaşını doğrulamayan Sakinleri yasakla Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
+	<check_box label="Ödeme bilgileri kayıtlı" name="limit_payment" tool_tip="Sakinlerin bu gayrimenkule erişebilmesi için ödeme bilgilerinin kayıtlı olması gerekir.  Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
+	<check_box label="Yaş doğrulaması yapılmış" name="limit_age_verified" tool_tip="Sakinlerin bu gayrimenkule erişebilmesi için yaş doğrulamalarının yapılmış olması gerekir. Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/>
 	<check_box label="Sesli Sohbete Ä°zin Ver" name="voice_chat_check"/>
 	<check_box label="Doğrudan Işınlamaya İzin Ver" name="allow_direct_teleport"/>
 	<button label="Uygula" name="apply_btn"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_script_ed.xml b/indra/newview/skins/default/xui/tr/panel_script_ed.xml
index bc30320fa51..7aa1da6fb2c 100644
--- a/indra/newview/skins/default/xui/tr/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/tr/panel_script_ed.xml
@@ -22,6 +22,8 @@
 		<menu label="Dosya" name="File">
 			<menu_item_call label="Kaydet" name="Save"/>
 			<menu_item_call label="Tüm Değişiklikleri Geri Çevir" name="Revert All Changes"/>
+			<menu_item_call label="Dosyadan yükle..." name="LoadFromFile"/>
+			<menu_item_call label="Dosyaya kaydet..." name="SaveToFile"/>
 		</menu>
 		<menu label="Düzenle" name="Edit">
 			<menu_item_call label="Geri Al" name="Undo"/>
diff --git a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
index 70c449b4024..f801cc5968b 100644
--- a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
@@ -2,47 +2,24 @@
 <panel label="EÅŸyalar" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_outbox_layout_panel">
-				<layout_stack name="inbox_outbox_layout_stack">
-					<layout_panel name="inbox_layout_panel">
-						<panel label="" name="marketplace_inbox">
-							<string name="InboxLabelWithArg">
-								Alınan öğeler ([NUM])
-							</string>
-							<string name="InboxLabelNoArg">
-								Alınan öğeler
-							</string>
-							<button label="Alınan öğeler" name="inbox_btn"/>
-							<text name="inbox_fresh_new_count">
-								[NUM] yeni
-							</text>
-							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-								<text name="inbox_inventory_placeholder">
-									Pazaryerinden satın alınan öğeler buraya teslim edilir.
-								</text>
-							</panel>
-						</panel>
-					</layout_panel>
-					<layout_panel name="outbox_layout_panel">
-						<panel label="" name="marketplace_outbox">
-							<string name="OutboxLabelWithArg">
-								Satıcı giden kutusu ([NUM])
-							</string>
-							<string name="OutboxLabelNoArg">
-								Satıcı giden kutusu
-							</string>
-							<button label="Satıcı giden kutusu" name="outbox_btn"/>
-							<button label="" name="outbox_sync_btn" tool_tip="Pazaryeri Vitrinime Gönder"/>
-							<panel>
-								<panel name="outbox_inventory_placeholder_panel">
-									<text name="outbox_inventory_placeholder_title">
-										Yükleniyor...
-									</text>
-								</panel>
-							</panel>
-						</panel>
-					</layout_panel>
-				</layout_stack>
+			<layout_panel name="inbox_layout_panel">
+				<panel label="" name="marketplace_inbox">
+					<string name="InboxLabelWithArg">
+						Alınan öğeler ([NUM])
+					</string>
+					<string name="InboxLabelNoArg">
+						Alınan öğeler
+					</string>
+					<button label="Alınan öğeler" name="inbox_btn"/>
+					<text name="inbox_fresh_new_count">
+						[NUM] yeni
+					</text>
+					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+						<text name="inbox_inventory_placeholder">
+							Pazaryerinden satın alınan öğeler buraya teslim edilir.
+						</text>
+					</panel>
+				</panel>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index 0dbc9b0a0ee..199fa06d4fc 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -181,7 +181,7 @@ Güncelleştirmeler için www.secondlife.com/status adresini kontrol edin.
 	</string>
 	<string name="LoginFailedPremiumOnly">
 		Second Life üzerindeki aktif kullanıcıların olası en iyi deneyimi yaşamasını sağlamak için, oturum açılması geçici olarak kısıtlanmıştır.
-	 	
+
 Second Life için ödeme yapmış olan kişilere öncelik tanımak amacıyla, ücretsiz hesaplara sahip kişiler bu süre içerisinde Second Life&apos;a erişemeyecekler.
 	</string>
 	<string name="LoginFailedComputerProhibited">
@@ -339,17 +339,35 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		Buraya sadece bir öğe sürüklenebilir.
 	</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]:"/>
+	<string name="TooltipOutboxDragToWorld">
+		Satıcı giden kutunuzda öğeler oluşturamazsınız
+	</string>
 	<string name="TooltipOutboxNoTransfer">
-		Bu nesnelerden bir veya daha fazlası başka bir kullanıcıya satılamaz veya aktarılamaz.
+		Bu nesnelerden bir veya daha fazlası satılamaz veya aktarılamaz.
+	</string>
+	<string name="TooltipOutboxNotInInventory">
+		Satıcı giden kutunuza sadece doğrudan kendi envanterinizden öğeler koyabilirsiniz
 	</string>
 	<string name="TooltipOutboxWorn">
-		Bu nesnelerden bir veya daha fazlasını giyiyorsunuz. Bunları avatarınızdan kaldırın ve tekrar taşımayı deneyin.
+		Giymekte olduğunuz öğeleri Satıcı giden kutunuza koyamazsınız.
+	</string>
+	<string name="TooltipOutboxCallingCard">
+		Satıcı giden kutunuza arama kartları koyamazsınız
 	</string>
 	<string name="TooltipOutboxFolderLevels">
-		Bu klasörde çok fazla alt klasör seviyesi var. Dahili klasörleri tekrar düzenleyerek maksimum 4 seviye derinliğe azaltın (Kök Klasör içinde A içinde B içinde C şeklinde).
+		İç içe geçmiş klasörlerin derinliği üçü geçiyor
+	</string>
+	<string name="TooltipOutboxTooManyFolders">
+		Üst seviyedeki klasördeki alt klasör sayısı 20&apos;yi geçiyor
 	</string>
 	<string name="TooltipOutboxTooManyObjects">
-		Bu klasörde 200&apos;den fazla nesne var. Nesne sayısını azaltmak için öğelerden bazılarını kutuya koyun.
+		Üst seviyedeki klasördeki öğe sayısı 200&apos;ü geçiyor
+	</string>
+	<string name="TooltipDragOntoOwnChild">
+		Bir klasörü alt klasörüne taşıyamazsınız
+	</string>
+	<string name="TooltipDragOntoSelf">
+		Bir klasörü kendi içine taşıyamazsınız
 	</string>
 	<string name="TooltipHttpUrl">
 		Bu web sayfasını görmek için tıklayın
@@ -973,6 +991,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 	<string name="choose_the_directory">
 		Dizin Seç
 	</string>
+	<string name="script_files">
+		Komut Dosyaları
+	</string>
 	<string name="AvatarSetNotAway">
 		Uzakta DeÄŸil
 	</string>
@@ -1211,43 +1232,36 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		Envanterinizde bu dokunun kopyası yok
 	</string>
 	<string name="InventoryInboxNoItems">
-		Bir öğeyi satın aldığınızda veya başka bir şekilde edindiğinizde burada görünür; bunu envanterinizdeki bir klasöre sürükleyebilir veya tutmak istemiyorsanız silebilirsiniz.
+		Özel hediyeler gibi aldığınız belirli öğeler burada görünecektir.  Daha sonra bunları envanterinize sürükleyebilirsiniz.
 	</string>
 	<string name="MarketplaceURL">
-		http://marketplace.[DOMAIN_NAME]
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://marketplace.[DOMAIN_NAME]/create_store
-	</string>
-	<string name="MarketplaceURL_LearnMore">
-		http://marketplace.[DOMAIN_NAME]/learn_more
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
 	</string>
-	<string name="InventoryOutboxCreationErrorTitle">
-		Satıcı Giden Kutunuz düzgün yapılandırılmamıştır
+	<string name="MarketplaceURL_Dashboard">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
 	</string>
-	<string name="InventoryOutboxCreationErrorTooltip">
-		Satıcı Giden Kutusu yapılandırma hatası
+	<string name="MarketplaceURL_Imports">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports
 	</string>
-	<string name="InventoryOutboxCreationError">
-		Sorunu düzeltmek için lütfen Müşteri Hizmetlerine başvurun.
+	<string name="MarketplaceURL_LearnMore">
+		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more
 	</string>
 	<string name="InventoryOutboxNotMerchantTitle">
-		Pazaryerinde herkes öğe satabilir
-	</string>
-	<string name="InventoryOutboxNotMerchantTooltip">
-		Bir satıcı olun!
+		Pazaryerinde herkes öğe satabilir.
 	</string>
+	<string name="InventoryOutboxNotMerchantTooltip"/>
 	<string name="InventoryOutboxNotMerchant">
-		[[MARKETPLACE_URL] Second Life Pazaryeri] içerisinde bir milyondan fazla sanal ürün satışa sunulmuştur, bunların tümü Sakinler tarafından oluşturulmuştur. Siz de oluşturduğunuz öğeleri ve satın aldığınız öğelerin bazılarını satabilirsiniz. Bunu yapmak kolaydır, kurulum da ücretsizdir.  [[LEARN_MORE_URL] Daha fazla bilgi edinin] veya başlamak için Pazaryerinde [[CREATE_STORE_URL] bir mağaza açın].
+		Eğer bir satıcı olmak istiyorsanız, [Pazaryerinde [MARKETPLACE_CREATE_STORE_URL] bir mağaza açmanız gerekir].
 	</string>
 	<string name="InventoryOutboxNoItemsTitle">
-		Pazaryerine öğe göndermek için yeni bir yol
-	</string>
-	<string name="InventoryOutboxNoItemsTooltip">
-		Öğeleri Pazaryerinde satışa hazırlamak için sürükleyip buraya bırakın
+		Giden kutunuz boÅŸ.
 	</string>
+	<string name="InventoryOutboxNoItemsTooltip"/>
 	<string name="InventoryOutboxNoItems">
-		Satmak istediğiniz öğeleri veya klasörleri bu alana sürükleyin.  Öğenin bir kopyası burada görünür ve kopyalanamaz bir öğeyi sürüklemediyseniz, envanteriniz aynı kalır.  Öğeleri Pazaryerine göndermeye hazır olduğunuzda Karşıya Yükle düğmesine tıklayın. Öğeleriniz Pazaryeri Envanterinize taşındığında bu klasörden kaybolurlar.
+		Bu alana klasörleri sürükleyin ve bunları [[MARKETPLACE_DASHBOARD_URL] Pazaryerinde] satılık olarak duyurmak için &quot;Pazaryerine Gönder&quot; üzerine tıklayın.
 	</string>
 	<string name="Marketplace Error None">
 		Hata yok
@@ -4100,9 +4114,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 		Çevrimiçi
 	</string>
 	<string name="uploading_abuse_report">
-		Karşıya Yükleniyor...
-  
-Kötüye Kullanımı Bildirme
+		Kötüye Kullanım Bildirimi Karşıya Yükleniyor...
 	</string>
 	<string name="New Shape">
 		Yeni Åžekil
@@ -4369,7 +4381,7 @@ Kötüye Kullanımı Bildirme
 	<string name="server_is_down">
 		Tüm çabalarımıza rağmen beklenmeyen bir hata meydana geldi.
 
-	Hizmetle ilişkili bilinen bir sorun olup olmadığını görmek için lütfen status.secondlifegrid.net adresine bakın.  
+	Hizmetle ilişkili bilinen bir sorun olup olmadığını görmek için lütfen status.secondlifegrid.net adresine bakın.
         Sorun yaşamaya devam ederseniz lütfen ağınızın ve güvenlik duvarınızın ayarlarına bakın.
 	</string>
 	<string name="dateTimeWeekdaysNames">
@@ -4848,6 +4860,9 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 	<string name="Command_Move_Label">
 		Yürü / koş / uç
 	</string>
+	<string name="Command_Outbox_Label">
+		Satıcı giden kutusu
+	</string>
 	<string name="Command_People_Label">
 		KiÅŸiler
 	</string>
@@ -4920,6 +4935,9 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
 	<string name="Command_Move_Tooltip">
 		Avatarınızı hareket ettirmek
 	</string>
+	<string name="Command_Outbox_Tooltip">
+		Satmak amacıyla Pazaryerinize öğeler taşıyın
+	</string>
 	<string name="Command_People_Tooltip">
 		Arkadaşlar, gruplar ve yakındaki kişiler
 	</string>
-- 
GitLab


From 11c53b444d77788044fe0e164fde4364b8206564 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 15 Feb 2012 18:12:26 -0800
Subject: [PATCH 793/933] EXP-1884 FIX Errors in navigating text when editing
 Landmarks and picks once a vertical scrollbar is shown fixed horizontal
 scrollbar showing up in local chat

---
 indra/llui/lltextbase.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 15c2d4946c8..7aeeae298f7 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1192,7 +1192,10 @@ void LLTextBase::reflow()
 
 		// shrink document to minimum size (visible portion of text widget)
 		// to force inlined widgets with follows set to shrink
-		//mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight());
+		if (mWordWrap)
+		{
+			mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight());
+		}
 
 		S32 cur_top = 0;
 
-- 
GitLab


From 155a171180be2df4500e7c6d03df3f99bf4231e7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 16 Feb 2012 14:57:30 -0800
Subject: [PATCH 794/933] EXP-1896 : Prevent recursively copying of folders
 onto themselves

---
 indra/newview/llinventoryfunctions.cpp | 11 +++++++++--
 indra/newview/llinventoryfunctions.h   |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 4fb06f82c1e..236c997ef61 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -240,11 +240,15 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
 
 void copy_inventory_category(LLInventoryModel* model,
 							 LLViewerInventoryCategory* cat,
-							 const LLUUID& parent_id)
+							 const LLUUID& parent_id,
+							 const LLUUID& root_copy_id)
 {
 	// Create the initial folder
 	LLUUID new_cat_uuid = gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName());
 	model->notifyObservers();
+	
+	// We need to exclude the initial root of the copy to avoid recursively copying the copy, etc...
+	LLUUID root_id = (root_copy_id.isNull() ? new_cat_uuid : root_copy_id);
 
 	// Get the content of the folder
 	LLInventoryModel::cat_array_t* cat_array;
@@ -270,7 +274,10 @@ void copy_inventory_category(LLInventoryModel* model,
 	for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
 	{
 		LLViewerInventoryCategory* category = *iter;
-		copy_inventory_category(model, category, new_cat_uuid);
+		if (category->getUUID() != root_id)
+		{
+			copy_inventory_category(model, category, new_cat_uuid, root_id);
+		}
 	}
 }
 
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 72c48c64f2e..b3d9f4b966a 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -73,7 +73,7 @@ void remove_category(LLInventoryModel* model, const LLUUID& cat_id);
 
 void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
 
-void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id);
+void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null);
 
 // Generates a string containing the path to the item specified by item_id.
 void append_path(const LLUUID& id, std::string& path);
-- 
GitLab


From 4c333d64ca7ac516dc0d3c5830b4488e30db6d27 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 16 Feb 2012 15:45:43 -0800
Subject: [PATCH 795/933] EXP-1832 FIX Viewer Size not persistent across logins
 Save *window* width and height, not client area

---
 indra/llwindow/llwindowwin32.cpp        |  9 +++++----
 indra/newview/app_settings/settings.xml |  4 ++--
 indra/newview/llviewerwindow.cpp        | 10 +++++++---
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 3a3e4a90dd6..bcf08572588 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -891,7 +891,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 	S32 height = size.mY;
 	BOOL auto_show = FALSE;
 
-	if (mhRC)
+	if (mhRC)	
 	{
 		auto_show = TRUE;
 		resetDisplayResolution();
@@ -985,6 +985,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 			window_rect.bottom = (long) height;
 			dw_ex_style = WS_EX_APPWINDOW;
 			dw_style = WS_POPUP;
+
+			// Move window borders out not to cover window contents.
+			// This converts client rect to window rect, i.e. expands it by the window border size.
+			AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
 		}
 		// If it failed, we don't want to run fullscreen
 		else
@@ -1011,9 +1015,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 		dw_style = WS_OVERLAPPEDWINDOW;
 	}
 
-	// Move window borders out not to cover window contents.
-	// This converts client rect to window rect, i.e. expands it by the window border size.
-	AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
 
 	// don't post quit messages when destroying old windows
 	mPostQuit = FALSE;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index caeaf714845..b7e2f636d4c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12777,7 +12777,7 @@
     <key>WindowX</key>
     <map>
       <key>Comment</key>
-      <string>X coordinate of lower left corner of SL viewer window, relative to primary display (pixels)</string>
+      <string>X coordinate of upper left corner of SL viewer window, relative to upper left corner of primary display (pixels)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
@@ -12788,7 +12788,7 @@
     <key>WindowY</key>
     <map>
       <key>Comment</key>
-      <string>Y coordinate of lower left corner of SL viewer window, relative to primary display (pixels)</string>
+      <string>Y coordinate of upper left corner of SL viewer window, relative to upper left corner of primary display (pixels)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f5a226b781e..ab20ff1d424 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2159,9 +2159,13 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 			// tell the OS specific window code about min window size
 			mWindow->setMinSize(min_window_width, min_window_height);
 
-			// Only save size if not maximized
-			gSavedSettings.setU32("WindowWidth", mWindowRectRaw.getWidth());
-			gSavedSettings.setU32("WindowHeight", mWindowRectRaw.getHeight());
+			LLCoordScreen window_rect;
+			if (mWindow->getSize(&window_rect))
+			{
+				// Only save size if not maximized
+				gSavedSettings.setU32("WindowWidth", window_rect.mX);
+				gSavedSettings.setU32("WindowHeight", window_rect.mY);
+			}
 		}
 
 		LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width);
-- 
GitLab


From 6363145f4556f3213f943637866445fae407593a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 16 Feb 2012 17:19:53 -0800
Subject: [PATCH 796/933] EXP-1900 : Fix crash in filtering

---
 indra/newview/llinventoryfilter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index f3d4667034e..7b803888e2d 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -317,7 +317,7 @@ bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const
 	{
 		LLUUID current_id = object_id;
 		LLInventoryObject *current_object = gInventory.getObject(object_id);
-		while (current_id.notNull())
+		while (current_id.notNull() && current_object)
 		{
 			if (LLClipboard::getInstance()->isOnClipboard(current_id))
 			{
-- 
GitLab


From 04a8a9755b43678f2be9f950cf129c33d9526520 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 17 Feb 2012 09:33:29 -0800
Subject: [PATCH 797/933] made avatar rotation threshold configurable via a
 setting

---
 indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++
 indra/newview/llvoavatar.cpp            | 10 +++++-----
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index b7e2f636d4c..ee659ee39ee 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -621,6 +621,28 @@
       <key>Value</key>
       <string>http://lecs-viewer-web-components.s3.amazonaws.com/v3.0/[GRID_LOWERCASE]/avatars.html</string>
     </map>
+    <key>AvatarRotateThresholdSlow</key>
+    <map>
+      <key>Comment</key>
+      <string>Angle between avatar facing and camera facing at which avatar turns to face same direction as camera, when moving slowly (degrees)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <integer>60</integer>
+    </map>  
+    <key>AvatarRotateThresholdFast</key>
+    <map>
+      <key>Comment</key>
+      <string>Angle between avatar facing and camera facing at which avatar turns to face same direction as camera, when moving fast (degrees)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <integer>2</integer>
+    </map>  
     <key>AvatarBakedTextureUploadTimeout</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index bc7f5a9744a..a3a40de5ebb 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -149,10 +149,6 @@ const F32 PELVIS_LAG_WALKING	= 0.4f;	// ...while walking
 const F32 PELVIS_LAG_MOUSELOOK = 0.15f;
 const F32 MOUSELOOK_PELVIS_FOLLOW_FACTOR = 0.5f;
 const F32 PELVIS_LAG_WHEN_FOLLOW_CAM_IS_ON = 0.0001f; // not zero! - something gets divided by this!
-
-const F32 PELVIS_ROT_THRESHOLD_SLOW = 60.0f;	// amount of deviation allowed between
-const F32 PELVIS_ROT_THRESHOLD_FAST = 2.0f;	// the pelvis and the view direction
-											// when moving fast & slow
 const F32 TORSO_NOISE_AMOUNT = 1.0f;	// Amount of deviation from up-axis, in degrees
 const F32 TORSO_NOISE_SPEED = 0.2f;	// Time scale factor on torso noise.
 
@@ -3652,7 +3648,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 			BOOL self_in_mouselook = isSelf() && gAgentCamera.cameraMouselook();
 
 			LLVector3 pelvisDir( mRoot.getWorldMatrix().getFwdRow4().mV );
-			F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, PELVIS_ROT_THRESHOLD_SLOW, PELVIS_ROT_THRESHOLD_FAST);
+
+			static LLCachedControl<F32> s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow");
+			static LLCachedControl<F32> s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast");
+
+			F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, s_pelvis_rot_threshold_slow, s_pelvis_rot_threshold_fast);
 						
 			if (self_in_mouselook)
 			{
-- 
GitLab


From 8d12038ef674dca701f313431b1089458816f638 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 17 Feb 2012 15:06:48 -0600
Subject: [PATCH 798/933] SH-2908 Potential fix for precision complaints from
 some AMD OpenGL 3.1 implementations.

---
 indra/llrender/llshadermgr.cpp      | 5 ++++-
 indra/newview/llviewershadermgr.cpp | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 269f78c8cd2..9aeb1a99f81 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -611,6 +611,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		{
 			//set version to 1.30
 			text[count++] = strdup("#version 130\n");
+
+			//some implementations of GLSL 1.30 require integer precision be explicitly declared
+			text[count++] = strdup("precision mediump int;\n");
 		}
 		else
 		{ //set version to 400
@@ -663,7 +666,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		.
 		uniform sampler2D texN;
 		
-		VARYING ivec4 vary_texture_index;
+		VARYING_FLAT ivec4 vary_texture_index;
 
 		vec4 diffuseLookup(vec2 texcoord)
 		{
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index c84fb8facb8..06db644851f 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -413,6 +413,8 @@ void LLViewerShaderMgr::setShaders()
 
 	// Shaders
 	LL_INFOS("ShaderLoading") << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << LL_ENDL;
+	LL_INFOS("ShaderLoading") << llformat("Using GLSL %d.%d", gGLManager.mGLSLVersionMajor, gGLManager.mGLSLVersionMinor) << llendl;
+
 	for (S32 i = 0; i < SHADER_COUNT; i++)
 	{
 		mVertexShaderLevel[i] = 0;
-- 
GitLab


From 6ecae04d358cc27bc4890778a1493b3818236fb9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 17 Feb 2012 15:33:09 -0600
Subject: [PATCH 799/933] SH-2941 Fix for crash on shutdown due to race
 condition between LLCurl and LLMeshRepository

---
 indra/newview/llmeshrepository.cpp | 288 ++++++++++++-----------------
 1 file changed, 118 insertions(+), 170 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index bd202101909..f461c7e46fb 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -508,6 +508,7 @@ void LLMeshRepoThread::run()
 			
 			while (!mLODReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveLODRequests < sMaxConcurrentRequests)
 			{
+				if (mMutex)
 				{
 					mMutex->lock();
 					LODRequest req = mLODReqQ.front();
@@ -525,6 +526,7 @@ void LLMeshRepoThread::run()
 
 			while (!mHeaderReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveHeaderRequests < sMaxConcurrentRequests)
 			{
+				if (mMutex)
 				{
 					mMutex->lock();
 					HeaderRequest req = mHeaderReqQ.front();
@@ -671,6 +673,12 @@ std::string LLMeshRepoThread::constructUrl(LLUUID mesh_id)
 
 bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 { //protected by mMutex
+	
+	if (!mHeaderMutex)
+	{
+		return false;
+	}
+
 	mHeaderMutex->lock();
 
 	if (mMeshHeader.find(mesh_id) == mMeshHeader.end())
@@ -747,6 +755,11 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 
 bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 { //protected by mMutex
+	if (!mHeaderMutex)
+	{
+		return false;
+	}
+
 	mHeaderMutex->lock();
 
 	if (mMeshHeader.find(mesh_id) == mMeshHeader.end())
@@ -824,6 +837,11 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 
 bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 { //protected by mMutex
+	if (!mHeaderMutex)
+	{
+		return false;
+	}
+
 	mHeaderMutex->lock();
 
 	if (mMeshHeader.find(mesh_id) == mMeshHeader.end())
@@ -950,6 +968,11 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c
 //return false if failed to get mesh lod.
 bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count)
 { //protected by mMutex
+	if (!mHeaderMutex)
+	{
+		return false;
+	}
+
 	mHeaderMutex->lock();
 
 	bool retval = true;
@@ -1068,10 +1091,11 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
 	{
 		LLUUID mesh_id = mesh_params.getSculptID();
 		
-		mHeaderMutex->lock();
-		mMeshHeaderSize[mesh_id] = header_size;
-		mMeshHeader[mesh_id] = header;
-		mHeaderMutex->unlock();
+		{
+			LLMutexLock lock(mHeaderMutex);
+			mMeshHeaderSize[mesh_id] = header_size;
+			mMeshHeader[mesh_id] = header;
+			}
 
 		//check for pending requests
 		pending_lod_map::iterator iter = mPendingLOD.find(mesh_params);
@@ -1646,6 +1670,11 @@ void LLMeshUploadThread::requestWholeModelFee()
 
 void LLMeshRepoThread::notifyLoadedMeshes()
 {
+	if (!mMutex)
+	{
+		return;
+	}
+
 	while (!mLoadedQ.empty())
 	{
 		mMutex->lock();
@@ -2357,93 +2386,92 @@ void LLMeshRepository::notifyLoadedMeshes()
 		}
 	}
 
-	mMeshMutex->lock();	
-	mThread->mMutex->lock();
-		
-	//popup queued error messages from background threads
-	while (!mUploadErrorQ.empty())
 	{
-		LLNotificationsUtil::add("MeshUploadError", mUploadErrorQ.front());
-		mUploadErrorQ.pop();
-	}
+		LLMutexLock lock1(mMeshMutex);
+		LLMutexLock lock2(mThread->mMutex);
+		
+		//popup queued error messages from background threads
+		while (!mUploadErrorQ.empty())
+		{
+			LLNotificationsUtil::add("MeshUploadError", mUploadErrorQ.front());
+			mUploadErrorQ.pop();
+		}
 
-	S32 push_count = LLMeshRepoThread::sMaxConcurrentRequests-(LLMeshRepoThread::sActiveHeaderRequests+LLMeshRepoThread::sActiveLODRequests);
+		S32 push_count = LLMeshRepoThread::sMaxConcurrentRequests-(LLMeshRepoThread::sActiveHeaderRequests+LLMeshRepoThread::sActiveLODRequests);
 
-	if (push_count > 0)
-	{
-		//calculate "score" for pending requests
+		if (push_count > 0)
+		{
+			//calculate "score" for pending requests
 
-		//create score map
-		std::map<LLUUID, F32> score_map;
+			//create score map
+			std::map<LLUUID, F32> score_map;
 
-		for (U32 i = 0; i < 4; ++i)
-		{
-			for (mesh_load_map::iterator iter = mLoadingMeshes[i].begin();  iter != mLoadingMeshes[i].end(); ++iter)
+			for (U32 i = 0; i < 4; ++i)
 			{
-				F32 max_score = 0.f;
-				for (std::set<LLUUID>::iterator obj_iter = iter->second.begin(); obj_iter != iter->second.end(); ++obj_iter)
+				for (mesh_load_map::iterator iter = mLoadingMeshes[i].begin();  iter != mLoadingMeshes[i].end(); ++iter)
 				{
-					LLViewerObject* object = gObjectList.findObject(*obj_iter);
-
-					if (object)
+					F32 max_score = 0.f;
+					for (std::set<LLUUID>::iterator obj_iter = iter->second.begin(); obj_iter != iter->second.end(); ++obj_iter)
 					{
-						LLDrawable* drawable = object->mDrawable;
-						if (drawable)
+						LLViewerObject* object = gObjectList.findObject(*obj_iter);
+
+						if (object)
 						{
-							F32 cur_score = drawable->getRadius()/llmax(drawable->mDistanceWRTCamera, 1.f);
-							max_score = llmax(max_score, cur_score);
+							LLDrawable* drawable = object->mDrawable;
+							if (drawable)
+							{
+								F32 cur_score = drawable->getRadius()/llmax(drawable->mDistanceWRTCamera, 1.f);
+								max_score = llmax(max_score, cur_score);
+							}
 						}
 					}
-				}
 				
-				score_map[iter->first.getSculptID()] = max_score;
+					score_map[iter->first.getSculptID()] = max_score;
+				}
+			}
+
+			//set "score" for pending requests
+			for (std::vector<LLMeshRepoThread::LODRequest>::iterator iter = mPendingRequests.begin(); iter != mPendingRequests.end(); ++iter)
+			{
+				iter->mScore = score_map[iter->mMeshParams.getSculptID()];
+			}
+
+			//sort by "score"
+			std::sort(mPendingRequests.begin(), mPendingRequests.end(), LLMeshRepoThread::CompareScoreGreater());
+
+			while (!mPendingRequests.empty() && push_count > 0)
+			{
+				LLMeshRepoThread::LODRequest& request = mPendingRequests.front();
+				mThread->loadMeshLOD(request.mMeshParams, request.mLOD);
+				mPendingRequests.erase(mPendingRequests.begin());
+				LLMeshRepository::sLODPending--;
+				push_count--;
 			}
 		}
 
-		//set "score" for pending requests
-		for (std::vector<LLMeshRepoThread::LODRequest>::iterator iter = mPendingRequests.begin(); iter != mPendingRequests.end(); ++iter)
+		//send skin info requests
+		while (!mPendingSkinRequests.empty())
 		{
-			iter->mScore = score_map[iter->mMeshParams.getSculptID()];
+			mThread->loadMeshSkinInfo(mPendingSkinRequests.front());
+			mPendingSkinRequests.pop();
 		}
-
-		//sort by "score"
-		std::sort(mPendingRequests.begin(), mPendingRequests.end(), LLMeshRepoThread::CompareScoreGreater());
-
-		while (!mPendingRequests.empty() && push_count > 0)
+	
+		//send decomposition requests
+		while (!mPendingDecompositionRequests.empty())
 		{
-			LLMeshRepoThread::LODRequest& request = mPendingRequests.front();
-			mThread->loadMeshLOD(request.mMeshParams, request.mLOD);
-			mPendingRequests.erase(mPendingRequests.begin());
-			LLMeshRepository::sLODPending--;
-			push_count--;
+			mThread->loadMeshDecomposition(mPendingDecompositionRequests.front());
+			mPendingDecompositionRequests.pop();
 		}
-	}
-
-	//send skin info requests
-	while (!mPendingSkinRequests.empty())
-	{
-		mThread->loadMeshSkinInfo(mPendingSkinRequests.front());
-		mPendingSkinRequests.pop();
-	}
 	
-	//send decomposition requests
-	while (!mPendingDecompositionRequests.empty())
-	{
-		mThread->loadMeshDecomposition(mPendingDecompositionRequests.front());
-		mPendingDecompositionRequests.pop();
-	}
+		//send physics shapes decomposition requests
+		while (!mPendingPhysicsShapeRequests.empty())
+		{
+			mThread->loadMeshPhysicsShape(mPendingPhysicsShapeRequests.front());
+			mPendingPhysicsShapeRequests.pop();
+		}
 	
-	//send physics shapes decomposition requests
-	while (!mPendingPhysicsShapeRequests.empty())
-	{
-		mThread->loadMeshPhysicsShape(mPendingPhysicsShapeRequests.front());
-		mPendingPhysicsShapeRequests.pop();
+		mThread->notifyLoadedMeshes();
 	}
-	
-	mThread->notifyLoadedMeshes();
-
-	mThread->mMutex->unlock();
-	mMeshMutex->unlock();
 
 	mThread->mSignal->signal();
 }
@@ -3091,13 +3119,14 @@ void LLPhysicsDecomp::doDecomposition()
 			num_hulls = LLConvexDecomposition::getInstance()->getNumHullsFromStage(stage);
 		}
 		
-		mMutex->lock();
-		mCurRequest->mHull.clear();
-		mCurRequest->mHull.resize(num_hulls);
+		{
+			LLMutexLock lock(mMutex);
+			mCurRequest->mHull.clear();
+			mCurRequest->mHull.resize(num_hulls);
 
-		mCurRequest->mHullMesh.clear();
-		mCurRequest->mHullMesh.resize(num_hulls);
-		mMutex->unlock();
+			mCurRequest->mHullMesh.clear();
+			mCurRequest->mHullMesh.resize(num_hulls);
+		}
 
 		for (S32 i = 0; i < num_hulls; ++i)
 		{
@@ -3121,14 +3150,14 @@ void LLPhysicsDecomp::doDecomposition()
 
 			get_vertex_buffer_from_mesh(mesh, mCurRequest->mHullMesh[i]);
 			
-			mMutex->lock();
-			mCurRequest->mHull[i] = p;
-			mMutex->unlock();
+			{
+				LLMutexLock lock(mMutex);
+				mCurRequest->mHull[i] = p;
+			}
 		}
 	
 		{
 			LLMutexLock lock(mMutex);
-
 			mCurRequest->setStatusMessage("FAIL");
 			completeCurrent();						
 		}
@@ -3196,7 +3225,6 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
 	
 	LLCDMeshData mesh;	
 
-#if 1
 	setMeshData(mesh, true);
 
 	LLCDResult ret = decomp->buildSingleHull() ;
@@ -3207,11 +3235,12 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
 	}
 	else
 	{
-		mMutex->lock();
-		mCurRequest->mHull.clear();
-		mCurRequest->mHull.resize(1);
-		mCurRequest->mHullMesh.clear();
-		mMutex->unlock();
+		{
+			LLMutexLock lock(mMutex);
+			mCurRequest->mHull.clear();
+			mCurRequest->mHull.resize(1);
+			mCurRequest->mHullMesh.clear();
+		}
 
 		std::vector<LLVector3> p;
 		LLCDHull hull;
@@ -3227,93 +3256,12 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
 			p.push_back(vert);
 			v = (F32*) (((U8*) v) + hull.mVertexStrideBytes);
 		}
-						
-		mMutex->lock();
-		mCurRequest->mHull[0] = p;
-		mMutex->unlock();	
-	}		
-#else
-	setMeshData(mesh, false);
-
-	//set all parameters to default
-	std::map<std::string, const LLCDParam*> param_map;
-
-	static const LLCDParam* params = NULL;
-	static S32 param_count = 0;
-
-	if (!params)
-	{
-		param_count = decomp->getParameters(&params);
-	}
-	
-	for (S32 i = 0; i < param_count; ++i)
-	{
-		decomp->setParam(params[i].mName, params[i].mDefault.mIntOrEnumValue);
-	}
-
-	const S32 STAGE_DECOMPOSE = mStageID["Decompose"];	
-	const S32 STAGE_SIMPLIFY = mStageID["Simplify"];
-	const S32 DECOMP_PREVIEW = 0;
-	const S32 SIMPLIFY_RETAIN = 0;
-	
-	decomp->setParam("Decompose Quality", DECOMP_PREVIEW);
-	decomp->setParam("Simplify Method", SIMPLIFY_RETAIN);
-	decomp->setParam("Retain%", 0.f);
-
-	LLCDResult ret = LLCD_OK;
-	ret = decomp->executeStage(STAGE_DECOMPOSE);
-	
-	if (ret)
-	{
-		llwarns << "Could not execute decomposition stage when attempting to create single hull." << llendl;
-		make_box(mCurRequest);
-	}
-	else
-	{
-		ret = decomp->executeStage(STAGE_SIMPLIFY);
-
-		if (ret)
-		{
-			llwarns << "Could not execute simiplification stage when attempting to create single hull." << llendl;
-			make_box(mCurRequest);
-		}
-		else
+					
 		{
-			S32 num_hulls =0;
-			if (LLConvexDecomposition::getInstance() != NULL)
-			{
-				num_hulls = LLConvexDecomposition::getInstance()->getNumHullsFromStage(STAGE_SIMPLIFY);
-			}
-			
-			mMutex->lock();
-			mCurRequest->mHull.clear();
-			mCurRequest->mHull.resize(num_hulls);
-			mCurRequest->mHullMesh.clear();
-			mMutex->unlock();
-
-			for (S32 i = 0; i < num_hulls; ++i)
-			{
-				std::vector<LLVector3> p;
-				LLCDHull hull;
-				// if LLConvexDecomposition is a stub, num_hulls should have been set to 0 above, and we should not reach this code
-				LLConvexDecomposition::getInstance()->getHullFromStage(STAGE_SIMPLIFY, i, &hull);
-
-				const F32* v = hull.mVertexBase;
-
-				for (S32 j = 0; j < hull.mNumVertices; ++j)
-				{
-					LLVector3 vert(v[0], v[1], v[2]); 
-					p.push_back(vert);
-					v = (F32*) (((U8*) v) + hull.mVertexStrideBytes);
-				}
-						
-				mMutex->lock();
-				mCurRequest->mHull[i] = p;
-				mMutex->unlock();
-			}
+			LLMutexLock lock(mMutex);
+			mCurRequest->mHull[0] = p;
 		}
-	}
-#endif
+	}		
 
 	{
 		completeCurrent();
-- 
GitLab


From bb6ace0672fa5e1c47c534ba74396ef04daa408b Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 17 Feb 2012 14:42:12 -0800
Subject: [PATCH 800/933] EXP-1902, EXP-1903 : Move items cut to the trash when
 clipboard reset.

---
 indra/llui/llclipboard.cpp          | 8 ++++++++
 indra/llui/llclipboard.h            | 9 +++++++--
 indra/newview/llfolderview.cpp      | 5 +----
 indra/newview/llfolderview.h        | 2 +-
 indra/newview/llinventorybridge.cpp | 2 +-
 5 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index ee1f1aa816f..e0729366cc6 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -47,9 +47,17 @@ LLClipboard::~LLClipboard()
 
 void LLClipboard::reset()
 {
+	// Increment the clipboard state
 	mState++;
+	// Call the cleanup function (if any) before releasing the object list
+	if (mCutMode && mCleanupCallback)
+	{
+		mCleanupCallback();
+	}
+	// Clear the clipboard
 	mObjects.reset();
 	mCutMode = false;
+	mCleanupCallback = NULL;
 	mString = LLWString();
 }
 
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 0231169748c..3947fa02296 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -27,6 +27,7 @@
 #ifndef LL_LLCLIPBOARD_H
 #define LL_LLCLIPBOARD_H
 
+#include <boost/function.hpp>
 
 #include "llstring.h"
 #include "lluuid.h"
@@ -35,6 +36,8 @@
 #include "llassettype.h"
 #include "llinventory.h"
 
+typedef boost::function<void ()> cleanup_callback_t;
+
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLClipboard
 //
@@ -77,13 +80,15 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard
 
 	bool isCutMode() const { return mCutMode; }
-	void setCutMode(bool mode) { mCutMode = mode; mState++; }
+	void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mState++; }
 
 private:
 	LLDynamicArray<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
 	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).
-	bool mCutMode;						// This is a convenience flag for the viewer. It has no influence on the cliboard management.
+	bool mCutMode;						// This is a convenience flag for the viewer. Will determine if mCleanupCallback() needs to be called.
+	cleanup_callback_t mCleanupCallback;// Function to call when the cut clipboard is being wiped out. Can be set to NULL (nothing done then).
 	int mState;							// Incremented when the clipboard change so that interested parties can check its state.
+	
 };
 
 #endif  // LL_LLCLIPBOARD_H
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 0abfa9db8e9..52cc70aee77 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1014,6 +1014,7 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector<LLFol
 	return false;
 }
 
+// static
 void LLFolderView::removeCutItems()
 {
 	// There's no item in "cut" mode on the clipboard -> exit
@@ -2139,10 +2140,6 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
 	}
 	if (("copy" == action) || ("cut" == action))
 	{
-		// If there are things on the clipboard that have not been pasted but 
-		// already disappeared from view, we need to move them to the trash
-		removeCutItems();
-		
 		// Clear the clipboard before we start adding things on it
 		LLClipboard::getInstance()->reset();
 	}
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 2f148d4e257..9a1df5a1427 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -159,7 +159,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 
 	// deletion functionality
  	void removeSelectedItems();
- 	void removeCutItems();
+ 	static void removeCutItems();
 
 	// open the selected item.
 	void openSelectedItems( void );
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index eb0f9803b0b..54d195a2e6d 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -213,7 +213,7 @@ BOOL LLInvFVBridge::cutToClipboard() const
 	const LLInventoryObject* obj = gInventory.getObject(mUUID);
 	if (obj && isItemMovable() && isItemRemovable())
 	{
-		LLClipboard::getInstance()->setCutMode(true);
+		LLClipboard::getInstance()->setCutMode(true, boost::bind(LLFolderView::removeCutItems));
 		return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType());
 	}
 	return FALSE;
-- 
GitLab


From 39e9a17c11d84d65645f2664b077438e9be1d449 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 17 Feb 2012 16:57:29 -0800
Subject: [PATCH 801/933] EXP-1894 : Fix the handling of no-copy items on the
 clipboard (can cut, can paste once but not twice and cannot copy). Also work
 on folders with no-copy items.

---
 indra/newview/llinventorybridge.cpp | 54 +++++++++++++++++++++--------
 1 file changed, 40 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 54d195a2e6d..9fcad8093c1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -421,8 +421,6 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 		return FALSE;
 	}
 
-	const LLUUID &agent_id = gAgent.getID();
-
 	LLDynamicArray<LLUUID> objects;
 	LLClipboard::getInstance()->pasteFromClipboard(objects);
 	S32 count = objects.count();
@@ -430,18 +428,21 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 	{
 		const LLUUID &item_id = objects.get(i);
 
-		// Always paste folders
+		// Folders are pastable if all items in there are copyable
 		const LLInventoryCategory *cat = model->getCategory(item_id);
-		if (cat) continue;
-
-		const LLInventoryItem *item = model->getItem(item_id);
-		if (item)
+		if (cat) 
 		{
-			if (!item->getPermissions().allowCopyBy(agent_id))
-			{
+			LLFolderBridge cat_br(mInventoryPanel.get(), mRoot, item_id);
+			if (!cat_br.isItemCopyable())
 				return FALSE;
-			}
+			// Skip to the next item in the clipboard
+			continue;
 		}
+
+		// Each item must be copyable to be pastable
+		LLItemBridge item_br(mInventoryPanel.get(), mRoot, item_id);
+		if (!item_br.isItemCopyable())
+			return FALSE;
 	}
 	return TRUE;
 }
@@ -634,7 +635,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 	{
 		items.push_back(std::string("Paste"));
 	}
-	if (!isClipboardPasteable() || ((flags & FIRST_SELECTED_ITEM) == 0))
+	if ((!LLClipboard::getInstance()->isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
 	{
 		disabled_items.push_back(std::string("Paste"));
 	}
@@ -1778,8 +1779,33 @@ BOOL LLFolderBridge::isUpToDate() const
 
 BOOL LLFolderBridge::isItemCopyable() const
 {
-	// Folders are always copyable as they have no permissions attached to them as items.
-	// The story is different of course for items within folders.
+	// Folders are copyable if items in them are, recursively, copyable.
+
+	// Get the content of the folder
+	LLInventoryModel::cat_array_t* cat_array;
+	LLInventoryModel::item_array_t* item_array;
+	gInventory.getDirectDescendentsOf(mUUID,cat_array,item_array);
+
+	// Check the items
+	LLInventoryModel::item_array_t item_array_copy = *item_array;
+	for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
+	{
+		LLInventoryItem* item = *iter;
+		LLItemBridge item_br(mInventoryPanel.get(), mRoot, item->getUUID());
+		if (!item_br.isItemCopyable())
+			return FALSE;
+	}
+	
+	// Check the folders
+	LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
+	for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
+	{
+		LLViewerInventoryCategory* category = *iter;
+		LLFolderBridge cat_br(mInventoryPanel.get(), mRoot, category->getUUID());
+		if (!cat_br.isItemCopyable())
+			return FALSE;
+	}
+	
 	return TRUE;
 }
 
@@ -2823,7 +2849,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
 void LLFolderBridge::pasteFromClipboard()
 {
 	LLInventoryModel* model = getInventoryModel();
-	if (model && isClipboardPasteable())
+	if (model && (isClipboardPasteable() || LLClipboard::getInstance()->isCutMode()))
 	{
 		const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
 		const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
-- 
GitLab


From 48f5b69c43d4d4a2b6e272f7ac8d706ccc0c0601 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 17 Feb 2012 19:40:48 -0600
Subject: [PATCH 802/933] SH-2915 Smoother transition between sun shadow
 splits.

---
 .../shaders/class1/deferred/alphaF.glsl       |  2 -
 .../class1/deferred/alphaNonIndexedF.glsl     |  2 -
 .../deferred/alphaNonIndexedNoColorF.glsl     |  2 -
 .../class1/deferred/sunLightSSAOF.glsl        |  5 --
 .../shaders/class2/deferred/alphaF.glsl       | 52 +++++++++++++++---
 .../class2/deferred/alphaNonIndexedF.glsl     | 55 +++++++++++++++----
 .../deferred/alphaNonIndexedNoColorF.glsl     | 52 +++++++++++++++---
 .../shaders/class2/deferred/sunLightF.glsl    | 48 +++++++++++++---
 .../class2/deferred/sunLightSSAOF.glsl        | 50 +++++++++++++----
 indra/newview/pipeline.cpp                    | 10 ++--
 10 files changed, 215 insertions(+), 63 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 73f05a5dd4b..dd87ddb330e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -35,8 +35,6 @@ uniform sampler2DRect depthMap;
 
 vec4 diffuseLookup(vec2 texcoord);
 
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
 uniform vec2 screen_res;
 
 vec3 atmosLighting(vec3 light);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index bfbd30a4553..beb32901872 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -35,8 +35,6 @@ uniform sampler2DRect depthMap;
 uniform sampler2D diffuseMap;
 
 
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
 uniform vec2 screen_res;
 
 vec3 atmosLighting(vec3 light);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index dae1131bbb2..cb87b754b42 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -34,8 +34,6 @@ out vec4 frag_color;
 uniform sampler2DRect depthMap;
 uniform sampler2D diffuseMap;
 
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
 uniform vec2 screen_res;
 
 vec3 atmosLighting(vec3 light);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 7fa666a739b..2422d73a3ea 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -39,8 +39,6 @@ uniform sampler2D noiseMap;
 
 
 // Inputs
-uniform mat4 shadow_matrix[6];
-uniform vec4 shadow_clip;
 uniform float ssao_radius;
 uniform float ssao_max_radius;
 uniform float ssao_factor;
@@ -51,9 +49,6 @@ VARYING vec2 vary_fragcoord;
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
 
-uniform float shadow_bias;
-uniform float shadow_offset;
-
 vec4 getPosition(vec2 pos_screen)
 {
 	float depth = texture2DRect(depthMap, pos_screen.xy).r;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index e5edb482a93..08f6ec63fe2 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -80,7 +80,7 @@ void main()
 	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
 	frag *= screen_res;
 	
-	float shadow = 1.0;
+	float shadow = 0.0;
 	vec4 pos = vec4(vary_position, 1.0);
 	
 	vec4 spos = pos;
@@ -89,31 +89,65 @@ void main()
 	{	
 		vec4 lpos;
 		
-		if (spos.z < -shadow_clip.z)
+		vec4 near_split = shadow_clip*-0.75;
+		vec4 far_split = shadow_clip*-1.25;
+		vec4 transition_domain = near_split-far_split;
+		float weight = 0.0;
+
+		if (spos.z < near_split.z)
 		{
 			lpos = shadow_matrix[3]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap3, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
+			shadow += pcfShadow(shadowMap3, lpos, 0.25)*w;
+			weight += w;
 			shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
 		}
-		else if (spos.z < -shadow_clip.y)
+
+		if (spos.z < near_split.y && spos.z > far_split.z)
 		{
 			lpos = shadow_matrix[2]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap2, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
+			w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
+			shadow += pcfShadow(shadowMap2, lpos, 0.75)*w;
+			weight += w;
 		}
-		else if (spos.z < -shadow_clip.x)
+
+		if (spos.z < near_split.x && spos.z > far_split.y)
 		{
 			lpos = shadow_matrix[1]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap1, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
+			w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
+			shadow += pcfShadow(shadowMap1, lpos, 0.75)*w;
+			weight += w;
 		}
-		else
+
+		if (spos.z > far_split.x)
 		{
 			lpos = shadow_matrix[0]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap0, lpos, 1.5);
+				
+			float w = 1.0;
+			w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
+				
+			shadow += pcfShadow(shadowMap0, lpos, 1.0)*w;
+			weight += w;
 		}
+		
+
+		shadow /= weight;
+	}
+	else
+	{
+		shadow = 1.0;
 	}
 	
 	vec4 diff = diffuseLookup(vary_texcoord0.xy);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index c467e6c5cbd..aae6a070e29 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -93,7 +93,7 @@ void main()
 	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
 	frag *= screen_res;
 	
-	float shadow = 1.0;
+	float shadow = 0.0;
 	vec4 pos = vec4(vary_position, 1.0);
 	
 	vec4 spos = pos;
@@ -102,33 +102,68 @@ void main()
 	{	
 		vec4 lpos;
 		
-		if (spos.z < -shadow_clip.z)
+		vec4 near_split = shadow_clip*-0.75;
+		vec4 far_split = shadow_clip*-1.25;
+		vec4 transition_domain = near_split-far_split;
+		float weight = 0.0;
+
+		if (spos.z < near_split.z)
 		{
 			lpos = shadow_matrix[3]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap3, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
+			shadow += pcfShadow(shadowMap3, lpos, 0.25)*w;
+			weight += w;
 			shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
 		}
-		else if (spos.z < -shadow_clip.y)
+
+		if (spos.z < near_split.y && spos.z > far_split.z)
 		{
 			lpos = shadow_matrix[2]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap2, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
+			w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
+			shadow += pcfShadow(shadowMap2, lpos, 0.75)*w;
+			weight += w;
 		}
-		else if (spos.z < -shadow_clip.x)
+
+		if (spos.z < near_split.x && spos.z > far_split.y)
 		{
 			lpos = shadow_matrix[1]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap1, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
+			w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
+			shadow += pcfShadow(shadowMap1, lpos, 0.75)*w;
+			weight += w;
 		}
-		else
+
+		if (spos.z > far_split.x)
 		{
 			lpos = shadow_matrix[0]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap0, lpos, 1.5);
+				
+			float w = 1.0;
+			w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
+				
+			shadow += pcfShadow(shadowMap0, lpos, 1.0)*w;
+			weight += w;
 		}
+		
+
+		shadow /= weight;
+
 	}
-	
+	else
+	{
+		shadow = 1.0;
+	}
+
 	vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
 
 	vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 8aaf87a1b5a..931577359e5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -92,7 +92,7 @@ void main()
 	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
 	frag *= screen_res;
 	
-	float shadow = 1.0;
+	float shadow = 0.0;
 	vec4 pos = vec4(vary_position, 1.0);
 	
 	vec4 spos = pos;
@@ -101,31 +101,65 @@ void main()
 	{	
 		vec4 lpos;
 		
-		if (spos.z < -shadow_clip.z)
+		vec4 near_split = shadow_clip*-0.75;
+		vec4 far_split = shadow_clip*-1.25;
+		vec4 transition_domain = near_split-far_split;
+		float weight = 0.0;
+
+		if (spos.z < near_split.z)
 		{
 			lpos = shadow_matrix[3]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap3, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
+			shadow += pcfShadow(shadowMap3, lpos, 0.25)*w;
+			weight += w;
 			shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
 		}
-		else if (spos.z < -shadow_clip.y)
+
+		if (spos.z < near_split.y && spos.z > far_split.z)
 		{
 			lpos = shadow_matrix[2]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap2, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
+			w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
+			shadow += pcfShadow(shadowMap2, lpos, 0.75)*w;
+			weight += w;
 		}
-		else if (spos.z < -shadow_clip.x)
+
+		if (spos.z < near_split.x && spos.z > far_split.y)
 		{
 			lpos = shadow_matrix[1]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap1, lpos, 1.5);
+
+			float w = 1.0;
+			w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
+			w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
+			shadow += pcfShadow(shadowMap1, lpos, 0.75)*w;
+			weight += w;
 		}
-		else
+
+		if (spos.z > far_split.x)
 		{
 			lpos = shadow_matrix[0]*spos;
 			lpos.xy *= shadow_res;
-			shadow = pcfShadow(shadowMap0, lpos, 1.5);
+				
+			float w = 1.0;
+			w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
+				
+			shadow += pcfShadow(shadowMap0, lpos, 1.0)*w;
+			weight += w;
 		}
+		
+
+		shadow /= weight;
+	}
+	else
+	{
+		shadow = 1.0;
 	}
 	
 	vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index a40b29d2c46..8c4ccf9cb37 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -135,7 +135,7 @@ void main()
 		return;
 	}*/
 	
-	float shadow = 1.0;
+	float shadow = 0.0;
 	float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
 
 	vec3 shadow_pos = pos.xyz + displace*norm;
@@ -154,32 +154,62 @@ void main()
 		{
 			vec4 lpos;
 			
-			if (spos.z < -shadow_clip.z)
+			vec4 near_split = shadow_clip*-0.75;
+			vec4 far_split = shadow_clip*-1.25;
+			vec4 transition_domain = near_split-far_split;
+			float weight = 0.0;
+
+			if (spos.z < near_split.z)
 			{
 				lpos = shadow_matrix[3]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap3, lpos, 0.25);
+
+				float w = 1.0;
+				w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
+				shadow += pcfShadow(shadowMap3, lpos, 0.25)*w;
+				weight += w;
 				shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
 			}
-			else if (spos.z < -shadow_clip.y)
+
+			if (spos.z < near_split.y && spos.z > far_split.z)
 			{
 				lpos = shadow_matrix[2]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap2, lpos, 0.5);
+
+				float w = 1.0;
+				w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
+				w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
+				shadow += pcfShadow(shadowMap2, lpos, 0.75)*w;
+				weight += w;
 			}
-			else if (spos.z < -shadow_clip.x)
+
+			if (spos.z < near_split.x && spos.z > far_split.y)
 			{
 				lpos = shadow_matrix[1]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap1, lpos, 0.75);
+
+				float w = 1.0;
+				w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
+				w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
+				shadow += pcfShadow(shadowMap1, lpos, 0.75)*w;
+				weight += w;
 			}
-			else
+
+			if (spos.z > far_split.x)
 			{
 				lpos = shadow_matrix[0]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap0, lpos, 1.0);
+				
+				float w = 1.0;
+				w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
+				
+				shadow += pcfShadow(shadowMap0, lpos, 1.0)*w;
+				weight += w;
 			}
 		
+
+			shadow /= weight;
+
 			// take the most-shadowed value out of these two:
 			//  * the blurred sun shadow in the light (shadow) map
 			//  * an unblurred dot product between the sun and this norm
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 774f70262af..02075a76877 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -196,7 +196,7 @@ void main()
 		return;
 	}*/
 	
-	float shadow = 1.0;
+	float shadow = 0.0;
 	float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
 
 	vec3 shadow_pos = pos.xyz + displace*norm;
@@ -214,33 +214,63 @@ void main()
 		else
 		{
 			vec4 lpos;
-			
-			if (spos.z < -shadow_clip.z)
+
+			vec4 near_split = shadow_clip*-0.75;
+			vec4 far_split = shadow_clip*-1.25;
+			vec4 transition_domain = near_split-far_split;
+			float weight = 0.0;
+
+			if (spos.z < near_split.z)
 			{
 				lpos = shadow_matrix[3]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap3, lpos, 0.25);
+
+				float w = 1.0;
+				w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
+				shadow += pcfShadow(shadowMap3, lpos, 0.25)*w;
+				weight += w;
 				shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0);
 			}
-			else if (spos.z < -shadow_clip.y)
+
+			if (spos.z < near_split.y && spos.z > far_split.z)
 			{
 				lpos = shadow_matrix[2]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap2, lpos, 0.5);
+
+				float w = 1.0;
+				w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
+				w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
+				shadow += pcfShadow(shadowMap2, lpos, 0.75)*w;
+				weight += w;
 			}
-			else if (spos.z < -shadow_clip.x)
+
+			if (spos.z < near_split.x && spos.z > far_split.y)
 			{
 				lpos = shadow_matrix[1]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap1, lpos, 0.75);
+
+				float w = 1.0;
+				w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
+				w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
+				shadow += pcfShadow(shadowMap1, lpos, 0.75)*w;
+				weight += w;
 			}
-			else
+
+			if (spos.z > far_split.x)
 			{
 				lpos = shadow_matrix[0]*spos;
 				lpos.xy *= shadow_res;
-				shadow = pcfShadow(shadowMap0, lpos, 1.0);
+				
+				float w = 1.0;
+				w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
+				
+				shadow += pcfShadow(shadowMap0, lpos, 1.0)*w;
+				weight += w;
 			}
 		
+
+			shadow /= weight;
+
 			// take the most-shadowed value out of these two:
 			//  * the blurred sun shadow in the light (shadow) map
 			//  * an unblurred dot product between the sun and this norm
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index ce3a4893bf0..d5bcfe12abe 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8817,16 +8817,16 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 		
 		da = powf(da, split_exp.mV[2]);
 
-
 		F32 sxp = split_exp.mV[1] + (split_exp.mV[0]-split_exp.mV[1])*da;
-
-
+		
 		for (U32 i = 0; i < 4; ++i)
 		{
 			F32 x = (F32)(i+1)/4.f;
 			x = powf(x, sxp);
 			mSunClipPlanes.mV[i] = near_clip+range*x;
 		}
+
+		mSunClipPlanes.mV[0] *= 1.25f; //bump back first split for transition padding
 	}
 
 	// convenience array of 4 near clip plane distances
@@ -8883,8 +8883,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 				delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f;
 				delta.normVec();
 				F32 dp = delta*pn;
-				frust[i] = eye + (delta*dist[j]*0.95f)/dp;
-				frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp;
+				frust[i] = eye + (delta*dist[j]*0.75f)/dp;
+				frust[i+4] = eye + (delta*dist[j+1]*1.25f)/dp;
 			}
 						
 			shadow_cam.calcAgentFrustumPlanes(frust);
-- 
GitLab


From 2fdb18971b01bb9026e2918b79993f0a2629994b Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 17 Feb 2012 17:43:54 -0800
Subject: [PATCH 803/933] EXP-1897 : Suppress the copy of UUID on text
 clipboard when copy/cut items (back to old behavior).

---
 indra/newview/llinventorybridge.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9fcad8093c1..cac1dbfe4a5 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -214,7 +214,7 @@ BOOL LLInvFVBridge::cutToClipboard() const
 	if (obj && isItemMovable() && isItemRemovable())
 	{
 		LLClipboard::getInstance()->setCutMode(true, boost::bind(LLFolderView::removeCutItems));
-		return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType());
+		return LLClipboard::getInstance()->addToClipboard(mUUID);
 	}
 	return FALSE;
 }
@@ -224,7 +224,7 @@ BOOL LLInvFVBridge::copyToClipboard() const
 	const LLInventoryObject* obj = gInventory.getObject(mUUID);
 	if (obj && isItemCopyable())
 	{
-		return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType());
+		return LLClipboard::getInstance()->addToClipboard(mUUID);
 	}
 	return FALSE;
 }
-- 
GitLab


From b14e34444b1f08c4a3df5abbe2ebd5880cc41ce7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 17 Feb 2012 18:45:38 -0800
Subject: [PATCH 804/933] EXP-1906 : Allow cut of folders in place panel.

---
 indra/newview/llpanellandmarks.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index c7454e85a91..68a3b6d1cdd 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -1149,7 +1149,7 @@ Processes such actions: cut/rename/delete/paste actions
 	- cut/rename/delete in any other accordions
 	- paste - only in Favorites, Landmarks accordions
  3. For Folders we can: perform any action in Landmarks accordion, except Received folder
- 4. We can not paste folders from Clipboard (processed by LLFolderView::canPaste())
+ 4. We can paste folders from Clipboard (processed by LLFolderView::canPaste())
  5. Check LLFolderView/Inventory Bridges rules
  */
 bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFolderViewItem* item) const
@@ -1206,8 +1206,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
 
 		if ("cut" == command_name)
 		{
-			// "Cut" disabled for folders. See EXT-8697.
-			can_be_modified = root_folder->canCut() && listenerp->getInventoryType() != LLInventoryType::IT_CATEGORY;
+			can_be_modified = root_folder->canCut();
 		}
 		else if ("rename" == command_name)
 		{
-- 
GitLab


From 092c0eda65eedd606ae7cbacd74445dcff496998 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sat, 18 Feb 2012 08:22:59 -0500
Subject: [PATCH 805/933] STORM-1807 Fix possible Linux compiling issue

---
 indra/newview/llpreviewanim.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index dcb8bca5126..35ac0537a3d 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -103,8 +103,14 @@ void LLPreviewAnim::play(const LLSD& param)
 		
 		if (getChild<LLUICtrl>(btn_name)->getValue().asBoolean() ) 
 		{
-			"Inworld" == btn_name ? gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START) :
-									gAgentAvatarp->startMotion(item->getAssetUUID());
+			if("Inworld" == btn_name)
+			{
+				gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START);
+			}
+			else
+			{
+				gAgentAvatarp->startMotion(item->getAssetUUID());
+			}
 
 			LLMotion* motion = gAgentAvatarp->findMotion(itemID);
 			if (motion)
-- 
GitLab


From 566bbe7e09bf9cd9939cfae40773d86993803d1b Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sun, 19 Feb 2012 14:06:32 -0500
Subject: [PATCH 806/933] STORM-1808 Recode so build button is not clickable
 when grayed out

---
 indra/newview/app_settings/commands.xml |  4 ++--
 indra/newview/llagent.cpp               |  6 +-----
 indra/newview/lltoolmgr.cpp             | 11 +++++++++--
 indra/newview/lltoolmgr.h               |  2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 16a7e0b3149..12ce45717b5 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -37,10 +37,10 @@
            tooltip_ref="Command_Build_Tooltip"
            execute_function="Build.Toggle"
            execute_parameters="build"
-           is_enabled_function="Agent.IsActionAllowed"
+           is_enabled_function="Build.Enabled"
            is_enabled_parameters="build"
            is_running_function="Floater.IsOpen"
-           is_running_parameters="build"
+           is_running_parameters="toolbox floater"
            />
   <command name="chat"
            available_in_toybox="true"
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f0add8ddc44..3870a3be2ec 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -169,11 +169,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
 
 	const std::string& param = sdname.asString();
 
-	if (param == "build")
-	{
-		retval = LLViewerParcelMgr::getInstance()->allowAgentBuild();
-	}
-	else if (param == "speak")
+	if (param == "speak")
 	{
 		if ( gAgent.isVoiceConnected() && 
 			LLViewerParcelMgr::getInstance()->allowAgentVoice() &&
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 6bc7c6de11b..ac01316462c 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -81,7 +81,7 @@ LLToolMgr::LLToolMgr()
 	// Not a panel, register these callbacks globally.
 	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this));
 	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this));
-	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this));
+	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2));
 	
 	gToolNull = new LLTool(LLStringUtil::null);  // Does nothing
 	setCurrentTool(gToolNull);
@@ -245,8 +245,15 @@ bool LLToolMgr::canEdit()
 	return LLViewerParcelMgr::getInstance()->allowAgentBuild();
 }
 
-void LLToolMgr::toggleBuildMode()
+void LLToolMgr::toggleBuildMode(const LLSD& sdname)
 {
+	const std::string& param = sdname.asString();
+
+	if (param == "build" && !canEdit())
+	{
+		return;
+	}
+
 	LLFloaterReg::toggleInstanceOrBringToFront("build");
 
 	bool build_visible = LLFloaterReg::instanceVisible("build");
diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h
index d489c4c829f..12649cfba2d 100644
--- a/indra/newview/lltoolmgr.h
+++ b/indra/newview/lltoolmgr.h
@@ -54,7 +54,7 @@ class LLToolMgr : public LLSingleton<LLToolMgr>
 
 	bool			inEdit();
 	bool			canEdit();
-	void			toggleBuildMode();
+	void			toggleBuildMode(const LLSD& sdname);
 	
 	/* Determines if we are in Build mode or not. */
 	bool			inBuildMode();
-- 
GitLab


From 065edd19d60737ee330b0f64defb301995fdb5fd Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sun, 19 Feb 2012 16:20:47 -0500
Subject: [PATCH 807/933] STORM-1808 Fix wrong name in xml file

---
 indra/newview/app_settings/commands.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 12ce45717b5..73df064ab29 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -40,7 +40,7 @@
            is_enabled_function="Build.Enabled"
            is_enabled_parameters="build"
            is_running_function="Floater.IsOpen"
-           is_running_parameters="toolbox floater"
+           is_running_parameters="build"
            />
   <command name="chat"
            available_in_toybox="true"
-- 
GitLab


From 67ccb0670f35a35d7de204d239e17ffa56cc94b3 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Mon, 20 Feb 2012 20:11:08 +0200
Subject: [PATCH 808/933] EXP-1904 FIXED (Estate tab in Region/Estate floater
 does not display estate name or owner name)

- Added updating for Estate name and Estate owner name
---
 indra/newview/llfloaterregioninfo.cpp | 20 ++++++++++++++++++++
 indra/newview/llfloaterregioninfo.h   |  3 +++
 indra/newview/llviewermessage.cpp     |  2 ++
 3 files changed, 25 insertions(+)

diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 1f746ed31ab..17850ff35d3 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1897,6 +1897,26 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_
 	gAgent.sendReliableMessage();
 }
 
+// static
+void LLPanelEstateInfo::updateEstateOwnerName(const std::string& name)
+{
+	LLPanelEstateInfo* panelp = LLFloaterRegionInfo::getPanelEstate();
+	if (panelp)
+	{
+		panelp->setOwnerName(name);
+	}
+}
+
+// static
+void LLPanelEstateInfo::updateEstateName(const std::string& name)
+{
+	LLPanelEstateInfo* panelp = LLFloaterRegionInfo::getPanelEstate();
+	if (panelp)
+	{
+		panelp->getChildRef<LLTextBox>("estate_name").setText(name);
+	}
+}
+
 void LLPanelEstateInfo::updateControls(LLViewerRegion* region)
 {
 	BOOL god = gAgent.isGodlike();
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index ae45949b4a4..e36ef4604b2 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -294,6 +294,9 @@ class LLPanelEstateInfo : public LLPanelRegionInfo
 	
 	void updateControls(LLViewerRegion* region);
 	
+	static void updateEstateName(const std::string& name);
+	static void updateEstateOwnerName(const std::string& name);
+
 	virtual bool refreshFromRegion(LLViewerRegion* region);
 	virtual bool estateUpdate(LLMessageSystem* msg);
 	
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 716f47150e3..17c7644ec4a 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6843,12 +6843,14 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
 
 	LLPanelEstateCovenant::updateEstateName(estate_name);
 	LLPanelLandCovenant::updateEstateName(estate_name);
+	LLPanelEstateInfo::updateEstateName(estate_name);
 	LLFloaterBuyLand::updateEstateName(estate_name);
 
 	std::string owner_name =
 		LLSLURL("agent", estate_owner_id, "inspect").getSLURLString();
 	LLPanelEstateCovenant::updateEstateOwnerName(owner_name);
 	LLPanelLandCovenant::updateEstateOwnerName(owner_name);
+	LLPanelEstateInfo::updateEstateOwnerName(owner_name);
 	LLFloaterBuyLand::updateEstateOwnerName(owner_name);
 
 	LLPanelPlaceProfile* panel = LLFloaterSidePanelContainer::getPanel<LLPanelPlaceProfile>("places", "panel_place_profile");
-- 
GitLab


From e1a71a97cd00d70fedeb6191b6ebb10361019ee1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 21 Feb 2012 14:02:09 -0600
Subject: [PATCH 809/933] SH-2908 Potential fix for pink textures on some
 OpenGL 3.1 implementations.

---
 indra/llrender/llshadermgr.cpp | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 9aeb1a99f81..e1cd8fa62d5 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -614,6 +614,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 
 			//some implementations of GLSL 1.30 require integer precision be explicitly declared
 			text[count++] = strdup("precision mediump int;\n");
+			text[count++] = strdup("precision highp float;\n");
 		}
 		else
 		{ //set version to 400
@@ -668,20 +669,22 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		
 		VARYING_FLAT ivec4 vary_texture_index;
 
+		vec4 ret = vec4(1,0,1,1);
+
 		vec4 diffuseLookup(vec2 texcoord)
 		{
 			switch (vary_texture_index.r))
 			{
-				case 0: return texture2D(tex0, texcoord);
-				case 1: return texture2D(tex1, texcoord);
-				case 2: return texture2D(tex2, texcoord);
+				case 0: ret = texture2D(tex0, texcoord); break;
+				case 1: ret = texture2D(tex1, texcoord); break;
+				case 2: ret = texture2D(tex2, texcoord); break;
 				.
 				.
 				.
-				case N: return texture2D(texN, texcoord);
+				case N: return texture2D(texN, texcoord); break;
 			}
 
-			return vec4(0,0,0,0);
+			return ret;
 		}
 		*/
 
@@ -708,18 +711,19 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		}
 		else if (major_version > 1 || minor_version >= 30)
 		{  //switches are supported in GLSL 1.30 and later
+			text[count++] = strdup("\tvec4 ret = vec4(1,0,1,1);\n");
 			text[count++] = strdup("\tswitch (vary_texture_index.r)\n");
 			text[count++] = strdup("\t{\n");
 		
 			//switch body
 			for (S32 i = 0; i < texture_index_channels; ++i)
 			{
-				std::string case_str = llformat("\t\tcase %d: return texture2D(tex%d, texcoord);\n", i, i);
+				std::string case_str = llformat("\t\tcase %d: ret = texture2D(tex%d, texcoord); break;\n", i, i);
 				text[count++] = strdup(case_str.c_str());
 			}
 
 			text[count++] = strdup("\t}\n");
-			text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
+			text[count++] = strdup("\treturn ret;\n");
 			text[count++] = strdup("}\n");
 		}
 		else
-- 
GitLab


From 14687b1c37555946f46dc4c7d83554f917ffe066 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Wed, 22 Feb 2012 14:04:12 -0500
Subject: [PATCH 810/933] Added tag DRTVWR-118_3.2.9-beta2, 3.2.9-beta2 for
 changeset a01ef9bed286

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index d4bf3a81f80..8c9f92ad8f1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -266,3 +266,5 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 37dd400ad721e2a89ee820ffc1e7e433c68f3ca2 3.2.9-start
 e9c82fca5ae6fb8a8af29012d78fb194a29323f3 DRTVWR-117_3.2.9-beta1
 e9c82fca5ae6fb8a8af29012d78fb194a29323f3 3.2.9-beta1
+a01ef9bed28627f4ca543fbc1d70c79cc297a90f DRTVWR-118_3.2.9-beta2
+a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
-- 
GitLab


From 8f261582b80d7d4a61cf8bb42c0429fa58f0c186 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 22 Feb 2012 14:30:24 -0600
Subject: [PATCH 811/933] SH-2908 Fix for crash when enabling Lighting and
 Shadows on some AMD GPUs

---
 indra/llrender/llshadermgr.cpp                |   1 +
 .../class1/deferred/attachmentShadowF.glsl    |   2 -
 .../class1/deferred/attachmentShadowV.glsl    |   5 -
 .../class1/deferred/avatarAlphaNoColorV.glsl  | 148 ++++++++++++++++++
 .../class1/deferred/postDeferredNoTCV.glsl    |  40 +++++
 .../shaders/class1/deferred/skyV.glsl         |   5 +-
 indra/newview/llviewershadermgr.cpp           |  10 +-
 7 files changed, 195 insertions(+), 16 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index e1cd8fa62d5..b28a97adaa3 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -644,6 +644,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 		text[count++] = strdup("#define textureCube texture\n");
 		text[count++] = strdup("#define texture2DLod textureLod\n");
 		text[count++] = strdup("#define	shadow2D(a,b) vec2(texture(a,b))\n");
+		text[count++] = strdup("#define shadow2DRect(a,b) vec2(texture(a,b))\n");
 	}
 
 	//copy preprocessor definitions into buffer
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index 92e3f7f3886..22c9a4d14e3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -30,12 +30,10 @@ out vec4 frag_color;
 
 uniform sampler2D diffuseMap;
 
-VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
 void main() 
 {
-	//frag_color = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
 	frag_color = vec4(1,1,1,1);
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index ded6cced27f..81961d77460 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -27,11 +27,8 @@ uniform mat4 modelview_matrix;
 uniform mat4 texture_matrix0;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
 ATTRIBUTE vec2 texcoord0;
 
-VARYING vec4 vertex_color;
-
 mat4 getObjectSkinnedTransform();
 
 void main()
@@ -42,8 +39,6 @@ void main()
 	mat = modelview_matrix * mat;
 	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
 	
-	vertex_color = diffuse_color;
-	
 	vec4 p = projection_matrix * vec4(pos, 1.0);
 	p.z = max(p.z, -p.w+0.01);
 	gl_Position = p;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl
new file mode 100644
index 00000000000..5f395801e51
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl
@@ -0,0 +1,148 @@
+/** 
+ * @file avatarAlphaNoColorV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+uniform mat4 projection_matrix;
+
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
+mat4 getSkinnedTransform();
+void calcAtmospherics(vec3 inPositionEye);
+
+float calcDirectionalLight(vec3 n, vec3 l);
+float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
+
+vec3 atmosAmbient(vec3 light);
+vec3 atmosAffectDirectionalLight(float lightIntensity);
+vec3 scaleDownLight(vec3 light);
+vec3 scaleUpLight(vec3 light);
+
+VARYING vec3 vary_position;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
+
+
+uniform float near_clip;
+
+uniform vec4 color;
+
+uniform vec4 light_position[8];
+uniform vec3 light_direction[8];
+uniform vec3 light_attenuation[8]; 
+uniform vec3 light_diffuse[8];
+
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+        float a = max(dot(n,l),0.0);
+        return a;
+}
+
+float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
+{
+	//get light vector
+	vec3 lv = lp.xyz-v;
+	
+	//get distance
+	float d = dot(lv,lv);
+	
+	float da = 0.0;
+
+	if (d > 0.0 && la > 0.0 && fa > 0.0)
+	{
+		//normalize light vector
+		lv = normalize(lv);
+	
+		//distance attenuation
+		float dist2 = d/la;
+		da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
+
+		// spotlight coefficient.
+		float spot = max(dot(-ln, lv), is_pointlight);
+		da *= spot*spot; // GL_SPOT_EXPONENT=2
+
+		//angular attenuation
+		da *= max(dot(n, lv), 0.0);		
+	}
+
+	return da;	
+}
+
+void main()
+{
+	vary_texcoord0 = texcoord0;
+				
+	vec4 pos;
+	vec3 norm;
+	
+	mat4 trans = getSkinnedTransform();
+	vec4 pos_in = vec4(position.xyz, 1.0);
+	pos.x = dot(trans[0], pos_in);
+	pos.y = dot(trans[1], pos_in);
+	pos.z = dot(trans[2], pos_in);
+	pos.w = 1.0;
+	
+	norm.x = dot(trans[0].xyz, normal);
+	norm.y = dot(trans[1].xyz, normal);
+	norm.z = dot(trans[2].xyz, normal);
+	norm = normalize(norm);
+		
+	vec4 frag_pos = projection_matrix * pos;
+	gl_Position = frag_pos;
+	
+	vary_position = pos.xyz;
+	
+	calcAtmospherics(pos.xyz);
+
+	vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
+
+	// Collect normal lights
+	col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
+	col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
+	col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
+	col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
+	col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
+	col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
+	
+	vary_pointlight_col = col.rgb*color.rgb;
+
+	col.rgb = vec3(0,0,0);
+
+	// Add windlight lights
+	col.rgb = atmosAmbient(vec3(0.));
+	
+	vary_ambient = col.rgb*color.rgb;
+	vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
+	
+	col.rgb = col.rgb * color.rgb;
+	
+	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
+}
+
+
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl
new file mode 100644
index 00000000000..bd0cb504646
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl
@@ -0,0 +1,40 @@
+/** 
+ * @file postDeferredV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+uniform mat4 modelview_projection_matrix;
+
+ATTRIBUTE vec3 position;
+
+VARYING vec2 vary_fragcoord;
+
+uniform vec2 screen_res;
+
+void main()
+{
+	//transform vertex
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_Position = pos;	
+	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index cb7603f4fd3..7c02d31d436 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -26,7 +26,6 @@
 uniform mat4 modelview_projection_matrix;
 
 ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
 
 // SKY ////////////////////////////////////////////////////////////////////////
 // The vertex shader for creating the atmospheric sky
@@ -34,7 +33,6 @@ ATTRIBUTE vec2 texcoord0;
 
 // Output parameters
 VARYING vec4 vary_HazeColor;
-VARYING vec2 vary_texcoord0;
 
 // Inputs
 uniform vec3 camPosLocal;
@@ -60,8 +58,7 @@ void main()
 
 	// World / view / projection
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-	vary_texcoord0 = texcoord0;
-
+	
 	// Get relative position
 	vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
 	//vec3 P = position.xyz + vec3(0,50,0);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 06db644851f..a5984973929 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1428,7 +1428,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true;
 		gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true;
 		gDeferredAvatarAlphaProgram.mShaderFiles.clear();
-		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaNoColorV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 
@@ -1452,7 +1452,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	{
 		gDeferredPostProgram.mName = "Deferred Post Shader";
 		gDeferredPostProgram.mShaderFiles.clear();
-		gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredPostProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredPostProgram.createShader(NULL, NULL);
@@ -1462,7 +1462,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	{
 		gDeferredCoFProgram.mName = "Deferred CoF Shader";
 		gDeferredCoFProgram.mShaderFiles.clear();
-		gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredCoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredCoFProgram.createShader(NULL, NULL);
@@ -1472,7 +1472,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	{
 		gDeferredDoFCombineProgram.mName = "Deferred DoFCombine Shader";
 		gDeferredDoFCombineProgram.mShaderFiles.clear();
-		gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredDoFCombineProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredDoFCombineProgram.createShader(NULL, NULL);
@@ -1482,7 +1482,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	{
 		gDeferredPostNoDoFProgram.mName = "Deferred Post Shader";
 		gDeferredPostNoDoFProgram.mShaderFiles.clear();
-		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB));
 		gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredPostNoDoFProgram.createShader(NULL, NULL);
-- 
GitLab


From 26d33527a345ad6fe4b6deba8c120fe435e95f77 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 22 Feb 2012 22:33:57 +0200
Subject: [PATCH 812/933] EXP-1335 FIXED Dragging folders into Recent Items
 disabled. - Dragging folder into Recent Items disabled, but allowed within
 Recent Items. - Dragging Contents folder from task inventory disabled. -
 Filtering folder contents upon dragging to any inventory panel added, to make
 the behavior consistent with items filtering during DnD.

---
 indra/newview/llinventorybridge.cpp | 145 +++++++++++++++++++++++++---
 indra/newview/llinventorybridge.h   |   4 +-
 indra/newview/llinventoryfilter.cpp |  27 +++++-
 indra/newview/llinventoryfilter.h   |   3 +-
 4 files changed, 161 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index daebfb5c86c..416261780ee 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -113,6 +113,13 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response
 bool confirm_attachment_rez(const LLSD& notification, const LLSD& response);
 void teleport_via_landmark(const LLUUID& asset_id);
 static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
+static bool check_category(LLInventoryModel* model,
+						   const LLUUID& cat_id,
+						   LLFolderView* active_folder_view,
+						   LLInventoryFilter* filter);
+static bool check_item(const LLUUID& item_id,
+					   LLFolderView* active_folder_view,
+					   LLInventoryFilter* filter);
 
 // Helper functions
 
@@ -1959,6 +1966,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	if (!isAgentAvatarValid()) return FALSE;
 	if (!isAgentInventory()) return FALSE; // cannot drag categories into library
 
+	LLInventoryPanel* destination_panel = mInventoryPanel.get();
+	if (!destination_panel) return false;
+
+	LLInventoryFilter* filter = destination_panel->getFilter();
+	if (!filter) return false;
+
 	const LLUUID &cat_id = inv_cat->getUUID();
 	const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
 	const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
@@ -2146,6 +2159,39 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 		}
 
+		if (is_movable)
+		{
+			LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
+			is_movable = active_panel != NULL;
+
+			// For a folder to pass the filter all its descendants are required to pass.
+			// We make this exception to allow reordering folders within an inventory panel,
+			// which has a filter applied, like Recent tab for example.
+			// There may be folders which are displayed because some of their descendants pass
+			// the filter, but other don't, and thus remain hidden. Without this check,
+			// such folders would not be allowed to be moved within a panel.
+			if (destination_panel == active_panel)
+			{
+				is_movable = true;
+			}
+			else
+			{
+				LLFolderView* active_folder_view;
+
+				if (is_movable)
+				{
+					active_folder_view = active_panel->getRootFolder();
+					is_movable = active_folder_view != NULL;
+				}
+
+				if (is_movable)
+				{
+					// Check whether the folder being dragged from active inventory panel
+					// passes the filter of the destination panel.
+					is_movable = check_category(model, cat_id, active_folder_view, filter);
+				}
+			}
+		}
 		// 
 		//--------------------------------------------------------------------------------
 
@@ -2240,7 +2286,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 		}
 		else
 		{
-			accept = move_inv_category_world_to_agent(cat_id, mUUID, drop);
+			accept = move_inv_category_world_to_agent(cat_id, mUUID, drop, NULL, NULL, filter);
 		}
 	}
 	else if (LLToolDragAndDrop::SOURCE_LIBRARY == source)
@@ -2285,7 +2331,8 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 									  const LLUUID& category_id,
 									  BOOL drop,
 									  void (*callback)(S32, void*),
-									  void* user_data)
+									  void* user_data,
+									  LLInventoryFilter* filter)
 {
 	// Make sure the object exists. If we allowed dragging from
 	// anonymous objects, it would be possible to bypass
@@ -2309,7 +2356,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 		return FALSE;
 	}
 
-	BOOL accept = TRUE;
+	BOOL accept = FALSE;
 	BOOL is_move = FALSE;
 
 	// coming from a task. Need to figure out if the person can
@@ -2318,9 +2365,16 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 	LLInventoryObject::object_list_t::iterator end = inventory_objects.end();
 	for ( ; it != end; ++it)
 	{
+		LLInventoryItem* item = dynamic_cast<LLInventoryItem*>(it->get());
+		if (!item)
+		{
+			llwarns << "Invalid inventory item for drop" << llendl;
+			continue;
+		}
+
 		// coming from a task. Need to figure out if the person can
 		// move/copy this item.
-		LLPermissions perm(((LLInventoryItem*)((LLInventoryObject*)(*it)))->getPermissions());
+		LLPermissions perm(item->getPermissions());
 		if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
 			&& perm.allowTransferTo(gAgent.getID())))
 //			|| gAgent.isGodlike())
@@ -2335,9 +2389,14 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 			is_move = TRUE;
 			accept = TRUE;
 		}
-		else
+
+		if (filter && accept)
+		{
+			accept = filter->check(item);
+		}
+
+		if (!accept)
 		{
-			accept = FALSE;
 			break;
 		}
 	}
@@ -3693,10 +3752,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		// passes the filter of the destination panel.
 		if (accept && active_panel)
 		{
-			LLFolderView* active_folder_viev = active_panel->getRootFolder();
-			if (!active_folder_viev) return false;
+			LLFolderView* active_folder_view = active_panel->getRootFolder();
+			if (!active_folder_view) return false;
 
-			LLFolderViewItem* fv_item = active_folder_viev->getItemByID(inv_item->getUUID());
+			LLFolderViewItem* fv_item = active_folder_view->getItemByID(inv_item->getUUID());
 			if (!fv_item) return false;
 
 			accept = filter->check(fv_item);
@@ -3916,10 +3975,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			// passes the filter of the destination panel.
 			if (accept && active_panel)
 			{
-				LLFolderView* active_folder_viev = active_panel->getRootFolder();
-				if (!active_folder_viev) return false;
+				LLFolderView* active_folder_view = active_panel->getRootFolder();
+				if (!active_folder_view) return false;
 
-				LLFolderViewItem* fv_item = active_folder_viev->getItemByID(inv_item->getUUID());
+				LLFolderViewItem* fv_item = active_folder_view->getItemByID(inv_item->getUUID());
 				if (!fv_item) return false;
 
 				accept = filter->check(fv_item);
@@ -3959,6 +4018,68 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 	return accept;
 }
 
+// static
+bool check_category(LLInventoryModel* model,
+					const LLUUID& cat_id,
+					LLFolderView* active_folder_view,
+					LLInventoryFilter* filter)
+{
+	if (!model || !active_folder_view || !filter)
+		return false;
+
+	if (!filter->checkFolder(cat_id))
+	{
+		return false;
+	}
+
+	LLInventoryModel::cat_array_t descendent_categories;
+	LLInventoryModel::item_array_t descendent_items;
+	model->collectDescendents(cat_id, descendent_categories, descendent_items, TRUE);
+
+	S32 num_descendent_categories = descendent_categories.count();
+	S32 num_descendent_items = descendent_items.count();
+
+	if (num_descendent_categories + num_descendent_items == 0
+		&& filter->getShowFolderState() != LLInventoryFilter::SHOW_ALL_FOLDERS)
+	{
+		// Empty folders are not allowed if we are not showing all folders
+		return false;
+	}
+
+	for (S32 i = 0; i < num_descendent_categories; ++i)
+	{
+		LLInventoryCategory* category = descendent_categories[i];
+		if(!check_category(model, category->getUUID(), active_folder_view, filter))
+		{
+			return false;
+		}
+	}
+
+	for (S32 i = 0; i < num_descendent_items; ++i)
+	{
+		LLViewerInventoryItem* item = descendent_items[i];
+		if(!check_item(item->getUUID(), active_folder_view, filter))
+		{
+			return false;
+		}
+	}
+
+	return true;
+}
+
+// static
+bool check_item(const LLUUID& item_id,
+				LLFolderView* active_folder_view,
+				LLInventoryFilter* filter)
+{
+	if (!active_folder_view || !filter) return false;
+
+	LLFolderViewItem* fv_item = active_folder_view->getItemByID(item_id);
+	if (!fv_item) return false;
+
+	return filter->check(fv_item);
+}
+
 // +=================================================+
 // |        LLTextureBridge                          |
 // +=================================================+
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 3bcd71557c0..3b4f845f54b 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -35,6 +35,7 @@
 #include "llviewercontrol.h"
 #include "llwearable.h"
 
+class LLInventoryFilter;
 class LLInventoryPanel;
 class LLInventoryModel;
 class LLMenuGL;
@@ -645,7 +646,8 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 									  const LLUUID& category_id,
 									  BOOL drop,
 									  void (*callback)(S32, void*) = NULL,
-									  void* user_data = NULL);
+									  void* user_data = NULL,
+									  LLInventoryFilter* filter = NULL);
 
 // Utility function to hide all entries except those in the list
 // Can be called multiple times on the same menu (e.g. if multiple items
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 4971ded6345..5496c273f2d 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -121,16 +121,35 @@ bool LLInventoryFilter::check(const LLInventoryItem* item)
 	return passed;
 }
 
-bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
+bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const
 {
-	// we're showing all folders, overriding filter
-	if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
+	if (!folder)
 	{
-		return true;
+		llwarns << "The filter can not be checked on an invalid folder." << llendl;
+		llassert(false); // crash in development builds
+		return false;
 	}
 
 	const LLFolderViewEventListener* listener = folder->getListener();
+	if (!listener)
+	{
+		llwarns << "Folder view event listener not found." << llendl;
+		llassert(false); // crash in development builds
+		return false;
+	}
+
 	const LLUUID folder_id = listener->getUUID();
+
+	return checkFolder(folder_id);
+}
+
+bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
+{
+	// we're showing all folders, overriding filter
+	if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
+	{
+		return true;
+	}
 	
 	if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
 	{
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 8635d5d5b38..6be2acfaa34 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -117,7 +117,8 @@ class LLInventoryFilter
 	// +-------------------------------------------------------------------+
 	BOOL 				check(const LLFolderViewItem* item);
 	bool				check(const LLInventoryItem* item);
-	bool				checkFolder(const LLFolderViewFolder* folder);
+	bool				checkFolder(const LLFolderViewFolder* folder) const;
+	bool				checkFolder(const LLUUID& folder_id) const;
 	BOOL 				checkAgainstFilterType(const LLFolderViewItem* item) const;
 	bool 				checkAgainstFilterType(const LLInventoryItem* item) const;
 	BOOL 				checkAgainstPermissions(const LLFolderViewItem* item) const;
-- 
GitLab


From d5d2147a97953434f2baddf9d3f7c9d1be7f7b3e Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 22 Feb 2012 23:11:29 +0200
Subject: [PATCH 813/933] Windows build fix.

---
 indra/newview/llinventorybridge.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 416261780ee..dcdc1391ebd 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2176,7 +2176,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else
 			{
-				LLFolderView* active_folder_view;
+				LLFolderView* active_folder_view = NULL;
 
 				if (is_movable)
 				{
-- 
GitLab


From c2922a402d2e45284e2cd829175b958e081b264d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 22 Feb 2012 16:55:46 -0800
Subject: [PATCH 814/933] EXP-1905, EXP-1911: Be a bit less forcefull when
 updating the filter after a change on the clipboard

---
 indra/newview/llinventorypanel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 4508e7e083d..d569d819dde 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -286,7 +286,7 @@ void LLInventoryPanel::draw()
 	if (mClipboardState != LLClipboard::getInstance()->getState())
 	{
 		mClipboardState = LLClipboard::getInstance()->getState();
-		getFilter()->setModified(LLInventoryFilter::FILTER_RESTART);
+		getFilter()->setModified(LLClipboard::getInstance()->isCutMode() ? LLInventoryFilter::FILTER_MORE_RESTRICTIVE : LLInventoryFilter::FILTER_LESS_RESTRICTIVE);
 	}
 	
 	LLPanel::draw();
-- 
GitLab


From bab8b9d75ad72c338e3228019825a739b41eb677 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 22 Feb 2012 19:41:47 -0600
Subject: [PATCH 815/933] SH-2908 Another for crash when enabling Lighting and
 Shadows on some AMD GPUs

---
 .../class1/deferred/alphaSkinnedV.glsl        |  4 +-
 .../shaders/class1/deferred/alphaV.glsl       |  3 --
 .../class1/deferred/sunLightNoFragCoordV.glsl | 37 +++++++++++++++++++
 indra/newview/llviewershadermgr.cpp           |  7 +++-
 4 files changed, 44 insertions(+), 7 deletions(-)
 create mode 100644 indra/newview/app_settings/shaders/class1/deferred/sunLightNoFragCoordV.glsl

diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index eada38eaaa0..5a0e8ff6849 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -41,7 +41,6 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 VARYING vec3 vary_position;
 VARYING vec3 vary_ambient;
 VARYING vec3 vary_directional;
-VARYING vec3 vary_normal;
 VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_pointlight_col;
 VARYING vec4 vertex_color;
@@ -110,8 +109,7 @@ void main()
 	gl_Position = frag_pos;
 	
 	vary_position = pos.xyz;
-	vary_normal = norm;	
-	
+		
 	calcAtmospherics(pos.xyz);
 
 	vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 5c36118a50a..cf38a2f4f79 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -48,7 +48,6 @@ VARYING vec3 vary_ambient;
 VARYING vec3 vary_directional;
 VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_position;
-VARYING vec3 vary_light;
 VARYING vec3 vary_pointlight_col;
 
 VARYING vec4 vertex_color;
@@ -134,8 +133,6 @@ void main()
 	// Add windlight lights
 	col.rgb = atmosAmbient(vec3(0.));
 	
-	vary_light = light_position[0].xyz;
-	
 	vary_ambient = col.rgb*diffuse_color.rgb;
 	vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
 	
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightNoFragCoordV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightNoFragCoordV.glsl
new file mode 100644
index 00000000000..47e9d15fbcf
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightNoFragCoordV.glsl
@@ -0,0 +1,37 @@
+/** 
+ * @file sunLightF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+uniform mat4 modelview_projection_matrix;
+ 
+ATTRIBUTE vec3 position;
+
+uniform vec2 screen_res;
+
+void main()
+{
+	//transform vertex
+	vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
+	gl_Position = pos; 
+}
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index a5984973929..10c61c01d5c 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1218,6 +1218,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 	if (success)
 	{
 		std::string fragment;
+		std::string vertex = "deferred/sunLightV.glsl";
 
 		if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
 		{
@@ -1226,11 +1227,15 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		else
 		{
 			fragment = "deferred/sunLightF.glsl";
+			if (mVertexShaderLevel[SHADER_DEFERRED] == 1)
+			{ //no shadows, no SSAO, no frag coord
+				vertex = "deferred/sunLightNoFragCoordV.glsl";
+			}
 		}
 
 		gDeferredSunProgram.mName = "Deferred Sun Shader";
 		gDeferredSunProgram.mShaderFiles.clear();
-		gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB));
+		gDeferredSunProgram.mShaderFiles.push_back(make_pair(vertex, GL_VERTEX_SHADER_ARB));
 		gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
 		gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 		success = gDeferredSunProgram.createShader(NULL, NULL);
-- 
GitLab


From af83268a7b45ed6f5ee785e1671b0212d20ef47a Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Thu, 23 Feb 2012 19:51:43 +0200
Subject: [PATCH 816/933] EXP-1908 FIXED (Gesture floater is not refreshed when
 deleting more then one gesture from Inventory)

- Updating moved items, to update model's modify mask.
---
 indra/newview/llinventorybridge.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index daebfb5c86c..724c9133a77 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -389,6 +389,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
 	for(; it != end; ++it)
 	{
 		gInventory.moveObject((*it), trash_id);
+		model->updateItem(gInventory.getItem(*it));
 	}
 
 	// notify inventory observers.
-- 
GitLab


From a7499dc4abfa5fa7582dc7ebb535a07ed94d0c4f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 23 Feb 2012 09:57:05 -0800
Subject: [PATCH 817/933] EXP-1895 : Fix the evaluation of visible children in
 folders

---
 indra/newview/llfolderviewitem.cpp | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 884cddfe7f9..0b4baf52f9c 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -1159,7 +1159,36 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
 		mNeedsSort = false;
 	}
 
+	// evaluate mHasVisibleChildren
 	mHasVisibleChildren = hasFilteredDescendants(filter_generation);
+	if (mHasVisibleChildren)
+	{
+		// We have to verify that there's at least one child that's not filtered out
+		bool found = false;
+		// Try the items first
+		for (items_t::iterator iit = mItems.begin(); iit != mItems.end(); ++iit)
+		{
+			LLFolderViewItem* itemp = (*iit);
+			found = (itemp->getFiltered(filter_generation));
+			if (found)
+				break;
+		}
+		if (!found)
+		{
+			// If no item found, try the folders
+			for (folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit)
+			{
+				LLFolderViewFolder* folderp = (*fit);
+				found = ( folderp->getListener()
+								&&	(folderp->getFiltered(filter_generation)
+									 ||	(folderp->getFilteredFolder(filter_generation) 
+										 && folderp->hasFilteredDescendants(filter_generation))));
+				if (found)
+					break;
+			}
+		}
+		mHasVisibleChildren = found;
+	}
 
 	// calculate height as a single item (without any children), and reshapes rectangle to match
 	LLFolderViewItem::arrange( width, height, filter_generation );
-- 
GitLab


From d60ef2f3352404ce37d22ca346af47f8e4c93d79 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Thu, 23 Feb 2012 20:07:44 +0200
Subject: [PATCH 818/933] EXP-1909 FIXED (Pasted gesture displayed twice)

- Refreshing gesture list after an item was copied
---
 indra/newview/llfloatergesture.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index d495f20a9a8..9ed9d10c75d 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -90,6 +90,12 @@ class GestureCopiedCallback : public LLInventoryCallback
 		if(mFloater)
 		{
 			mFloater->addGesture(inv_item,NULL,mFloater->getChild<LLScrollListCtrl>("gesture_list"));
+
+			// EXP-1909 (Pasted gesture displayed twice)
+			// The problem is that addGesture is called here for the second time for the same item (which is copied)
+			// First time addGesture is called from LLFloaterGestureObserver::changed(), which is a callback for inventory
+			// change. So we need to refresh the gesture list to avoid duplicates.
+			mFloater->refreshAll();
 		}
 	}
 };
-- 
GitLab


From c37b3dde541805afe29ce3297ec5416ba3609127 Mon Sep 17 00:00:00 2001
From: paulgproductengine <none@none>
Date: Thu, 23 Feb 2012 20:09:44 +0200
Subject: [PATCH 819/933] EXP-1910 FIXED (Viewer usually crashes whith empty
 list of voice morphs )

- Added missed strings to the XML
- Just adding unlocalized name to the effects list if localized string was not found in XML. I think it's a better than throwing an error.
---
 indra/newview/llfloatervoiceeffect.cpp                   | 4 +++-
 .../skins/default/xui/en/floater_voice_effect.xml        | 9 ++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp
index 030fed0575d..227720bee34 100644
--- a/indra/newview/llfloatervoiceeffect.cpp
+++ b/indra/newview/llfloatervoiceeffect.cpp
@@ -145,7 +145,9 @@ void LLFloaterVoiceEffect::refreshEffectList()
 		for (voice_effect_list_t::const_iterator it = template_list.begin(); it != template_list.end(); ++it)
 		{
 			const LLUUID& effect_id = it->second;
-			std::string effect_name = getString("effect_" + it->first); // will throw an error if the effect is not listed in the XML
+
+			std::string localized_effect = "effect_" + it->first;
+			std::string effect_name = hasString(localized_effect) ? getString(localized_effect) : it->first;  // XML contains localized effects names
 
 			LLSD effect_properties = effect_interface->getVoiceEffectProperties(effect_id);
 
diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
index 77fb21e27c5..35cb2670d09 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
@@ -36,15 +36,20 @@
   <string name="effect_Cyber">Cyber</string>
   <string name="effect_DeepBot">DeepBot</string>
   <string name="effect_Demon">Demon</string>
+  <string name="effect_Female Elf">Female Elf</string>
   <string name="effect_Flirty">Flirty</string>
   <string name="effect_Foxy">Foxy</string>
-  <string name="effect_Halloween_2010_Bonus">Halloween_2010_Bonus</string>
+  <string name="effect_Halloween 2010 Bonus">Halloween_2010_Bonus</string>
   <string name="effect_Helium">Helium</string>
   <string name="effect_Husky">Husky</string>
+  <string name="effect_Husky Whisper">Husky Whisper</string>
   <string name="effect_Intercom">Intercom</string>
+  <string name="effect_Julia">Julia</string>
+  <string name="effect_Lo Lilt">Lo Lilt</string>
   <string name="effect_Macho">Macho</string>
   <string name="effect_Micro">Micro</string>
   <string name="effect_Mini">Mini</string>
+  <string name="effect_Model">Model</string>
   <string name="effect_Nano">Nano</string>
   <string name="effect_Nightmare">Nightmare</string>
   <string name="effect_PopBot">PopBot</string>
@@ -52,10 +57,12 @@
   <string name="effect_Radio">Radio</string>
   <string name="effect_Robot">Robot</string>
   <string name="effect_Roxanne">Roxanne</string>
+  <string name="effect_Rumble">Rumble</string>
   <string name="effect_Sabrina">Sabrina</string>
   <string name="effect_Samantha">Samantha</string>
   <string name="effect_Sexy">Sexy</string>
   <string name="effect_Shorty">Shorty</string>
+  <string name="effect_Smaller">Smaller</string>
   <string name="effect_Sneaky">Sneaky</string>
   <string name="effect_Stallion">Stallion</string>
   <string name="effect_Sultry">Sultry</string>
-- 
GitLab


From a5e4b15b7d29a64781eb32ef71e557a5bb8dc870 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 23 Feb 2012 21:02:46 +0200
Subject: [PATCH 820/933] Linux build fix. Moved type casts from protected base
 classes to derived LLCoord.

---
 indra/llmath/llcoord.h      | 19 +++++++++++++------
 indra/llui/llfloater.cpp    |  4 ++--
 indra/llwindow/llwindow.cpp |  8 ++++----
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h
index 756e23dbdf4..9b76268afde 100644
--- a/indra/llmath/llcoord.h
+++ b/indra/llmath/llcoord.h
@@ -26,6 +26,15 @@
 #ifndef LL_LLCOORD_H
 #define LL_LLCOORD_H
 
+template<typename> class LLCoord;
+struct LL_COORD_TYPE_GL;
+struct LL_COORD_TYPE_WINDOW;
+struct LL_COORD_TYPE_SCREEN;
+
+typedef LLCoord<LL_COORD_TYPE_GL> LLCoordGL;
+typedef LLCoord<LL_COORD_TYPE_WINDOW> LLCoordWindow;
+typedef LLCoord<LL_COORD_TYPE_SCREEN> LLCoordScreen;
+
 struct LLCoordCommon
 {
 	LLCoordCommon(S32 x, S32 y) : mX(x), mY(y) {}
@@ -62,6 +71,8 @@ class LLCoord : protected COORD_FRAME
 	bool operator==(const self_t& other) const { return mX == other.mX && mY == other.mY; }
 	bool operator!=(const self_t& other) const { return !(*this == other); }
 
+	static const self_t& getTypedCoords(const COORD_FRAME& self) { return static_cast<const self_t&>(self); }
+	static self_t& getTypedCoords(COORD_FRAME& self) { return static_cast<self_t&>(self); }
 };
 
 struct LL_COORD_TYPE_GL 
@@ -70,13 +81,13 @@ struct LL_COORD_TYPE_GL
 
 	LLCoordCommon convertToCommon() const
 	{
-		const LLCoord<LL_COORD_TYPE_GL>& self = static_cast<const LLCoord<LL_COORD_TYPE_GL>&>(*this);
+		const LLCoordGL& self = LLCoordGL::getTypedCoords(*this);
 		return LLCoordCommon(self.mX, self.mY);
 	}
 
 	void convertFromCommon(const LLCoordCommon& from)
 	{
-		LLCoord<LL_COORD_TYPE_GL>& self = static_cast<LLCoord<LL_COORD_TYPE_GL>&>(*this);
+		LLCoordGL& self = LLCoordGL::getTypedCoords(*this);
 		self.mX = from.mX;
 		self.mY = from.mY;
 	}
@@ -98,8 +109,4 @@ struct LL_COORD_TYPE_SCREEN
 	void convertFromCommon(const LLCoordCommon& from);
 };
 
-typedef LLCoord<LL_COORD_TYPE_GL> LLCoordGL;
-typedef LLCoord<LL_COORD_TYPE_WINDOW> LLCoordWindow;
-typedef LLCoord<LL_COORD_TYPE_SCREEN> LLCoordScreen;
-
 #endif
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 3afa1b8e3ad..2a40bbf33cf 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -3306,7 +3306,7 @@ bool LLCoordFloater::operator==(const LLCoordFloater& other) const
 
 LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
 {
-	const LLCoordFloater& self = static_cast<const LLCoordFloater&>(*this);
+	const LLCoordFloater& self = static_cast<const LLCoordFloater&>(LLCoordFloater::getTypedCoords(*this));
 
 	LLRect snap_rect = gFloaterView->getSnapRect();
 	LLFloater* floaterp = mFloater.get();
@@ -3348,7 +3348,7 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
 
 void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from)
 {
-	LLCoordFloater& self = static_cast<LLCoordFloater&>(*this);
+	LLCoordFloater& self = static_cast<LLCoordFloater&>(LLCoordFloater::getTypedCoords(*this));
 	LLRect snap_rect = gFloaterView->getSnapRect();
 	LLFloater* floaterp = mFloater.get();
 	S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 6834b34387c..4e91271d833 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -440,7 +440,7 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window)
 //coordinate conversion utility funcs that forward to llwindow
 LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
 {
-	const LLCoordWindow& self = static_cast<const LLCoordWindow&>(*this);
+	const LLCoordWindow& self = LLCoordWindow::getTypedCoords(*this);
 
 	LLWindow* windowp = &(*LLWindow::beginInstances());
 	LLCoordGL out;
@@ -450,7 +450,7 @@ LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
 
 void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
 {
-	LLCoordWindow& self = static_cast<LLCoordWindow&>(*this);
+	LLCoordWindow& self = LLCoordWindow::getTypedCoords(*this);
 
 	LLWindow* windowp = &(*LLWindow::beginInstances());
 	LLCoordGL from_gl(from);
@@ -459,7 +459,7 @@ void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
 
 LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
 {
-	const LLCoordScreen& self = static_cast<const LLCoordScreen&>(*this);
+	const LLCoordScreen& self = LLCoordScreen::getTypedCoords(*this);
 
 	LLWindow* windowp = &(*LLWindow::beginInstances());
 	LLCoordGL out;
@@ -469,7 +469,7 @@ LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
 
 void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from)
 {
-	LLCoordScreen& self = static_cast<LLCoordScreen&>(*this);
+	LLCoordScreen& self = LLCoordScreen::getTypedCoords(*this);
 
 	LLWindow* windowp = &(*LLWindow::beginInstances());
 	LLCoordGL from_gl(from);
-- 
GitLab


From a128836dedf25dc56807cced9316fbaa09a7f019 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 23 Feb 2012 13:41:19 -0600
Subject: [PATCH 821/933] SH-2908 Fix for linux build.

---
 indra/llrender/llvertexbuffer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index a7f01706584..8b5503229f2 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1262,7 +1262,7 @@ void LLVertexBuffer::setupVertexArray()
 		{
 			glEnableVertexAttribArrayARB(i);
 
-			if (attrib_integer)
+			if (attrib_integer[i])
 			{
 #if !LL_DARWIN
 				//glVertexattribIPointer requires GLSL 1.30 or later
-- 
GitLab


From 11d29660aa84a1a8a61e427698715497a57243c2 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 23 Feb 2012 21:47:03 +0200
Subject: [PATCH 822/933] EXP-1335 FIXED empty folders not draggable between
 Inventory windows. Added filtering empty folders as any other folder view
 item. This enables dragging empty folders between Inventory floaters when
 they pass the filter.

---
 indra/newview/llinventorybridge.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index dcdc1391ebd..6a20120808d 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4039,11 +4039,12 @@ bool check_category(LLInventoryModel* model,
 	S32 num_descendent_categories = descendent_categories.count();
 	S32 num_descendent_items = descendent_items.count();
 
-	if (num_descendent_categories + num_descendent_items == 0
-		&& filter->getShowFolderState() != LLInventoryFilter::SHOW_ALL_FOLDERS)
+	if (num_descendent_categories + num_descendent_items == 0)
 	{
-		// Empty folders are not allowed if we are not showing all folders
-		return false;
+		// Empty folder should be checked as any other folder view item.
+		// If we are filtering by date the folder should not pass because
+		// it doesn't have its own creation date. See LLInvFVBridge::getCreationDate().
+		return check_item(cat_id, active_folder_view, filter);
 	}
 
 	for (S32 i = 0; i < num_descendent_categories; ++i)
-- 
GitLab


From 9da67fff0a21ae7af2f99c90be267b089eaafeb6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 23 Feb 2012 12:39:32 -0800
Subject: [PATCH 823/933] EXP-1832 FIX Viewer Size not persistent across logins
 made Set Window Size correctly set interior window rect, preserving measured
 dimensions

---
 indra/llwindow/llwindow.cpp       | 15 +++++++++++++++
 indra/llwindow/llwindow.h         |  2 ++
 indra/llwindow/llwindowheadless.h |  1 +
 indra/llwindow/llwindowmacosx.cpp | 13 +++++++++++++
 indra/llwindow/llwindowmacosx.h   |  1 +
 indra/llwindow/llwindowsdl.cpp    | 19 +++++++++++++++++++
 indra/llwindow/llwindowsdl.h      |  1 +
 indra/llwindow/llwindowwin32.cpp  | 11 +++++++++++
 indra/llwindow/llwindowwin32.h    |  1 +
 indra/newview/llviewerwindow.cpp  |  2 +-
 10 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 6834b34387c..dd56b6e99b8 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -192,6 +192,21 @@ BOOL LLWindow::setSize(LLCoordScreen size)
 	return setSizeImpl(size);
 }
 
+BOOL LLWindow::setSize(LLCoordWindow size)
+{
+	//HACK: we are inconsistently using minimum window dimensions
+	// in this case, we are constraining the inner "client" rect and other times
+	// we constrain the outer "window" rect
+	// There doesn't seem to be a good way to do this consistently without a bunch of platform
+	// specific code
+	if (!getMaximized())
+	{
+		size.mX = llmax(size.mX, mMinWindowWidth);
+		size.mY = llmax(size.mY, mMinWindowHeight);
+	}
+	return setSizeImpl(size);
+}
+
 
 // virtual
 void LLWindow::setMinSize(U32 min_width, U32 min_height, bool enforce_immediately)
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index d2971581d2f..4da87f4e068 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -73,6 +73,7 @@ class LLWindow : public LLInstanceTracker<LLWindow>
 	virtual BOOL getSize(LLCoordWindow *size) = 0;
 	virtual BOOL setPosition(LLCoordScreen position) = 0;
 	BOOL setSize(LLCoordScreen size);
+	BOOL setSize(LLCoordWindow size);
 	virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true);
 	virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0;
 	virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
@@ -172,6 +173,7 @@ class LLWindow : public LLInstanceTracker<LLWindow>
 	virtual BOOL canDelete();
 
 	virtual BOOL setSizeImpl(LLCoordScreen size) = 0;
+	virtual BOOL setSizeImpl(LLCoordWindow size) = 0;
 
 protected:
 	LLWindowCallbacks*	mCallbacks;
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index d4a778cb85b..1f767f4c97d 100644
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -47,6 +47,7 @@ class LLWindowHeadless : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
 	/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
 	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
+	/*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;};
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index c952f8bbcf5..a998d1f877b 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1266,6 +1266,19 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordScreen size)
 	return TRUE;
 }
 
+BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size)
+{
+	Rect client_rect;
+	if (mWindow && GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr)
+	{
+		client_rect.right = client_rect.left + size.mX;
+		client_rect.bottom = client_rect.top + size.mY;
+		OSStatus err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect);
+		return err == noErr;
+	}
+	return FALSE;
+}
+
 void LLWindowMacOSX::swapBuffers()
 {
 	aglSwapBuffers(mContext);
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 073f294b543..52ba8b3bf3e 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -59,6 +59,7 @@ class LLWindowMacOSX : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordWindow *size);
 	/*virtual*/ BOOL setPosition(LLCoordScreen position);
 	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
+	/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 5f5baceef83..3d33af9d9bc 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -981,6 +981,25 @@ BOOL LLWindowSDL::setSizeImpl(const LLCoordScreen size)
 	return FALSE;
 }
 
+BOOL LLWindowSDL::setSizeImpl(const LLCoordWindow size)
+{
+	if(mWindow)
+	{
+		// Push a resize event onto SDL's queue - we'll handle it
+		// when it comes out again.
+		SDL_Event event;
+		event.type = SDL_VIDEORESIZE;
+		event.resize.w = size.mX;
+		event.resize.h = size.mY;
+		SDL_PushEvent(&event); // copied into queue
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+
 void LLWindowSDL::swapBuffers()
 {
 	if (mWindow)
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index 59719e40462..4e2a269ea33 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -64,6 +64,7 @@ class LLWindowSDL : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordWindow *size);
 	/*virtual*/ BOOL setPosition(LLCoordScreen position);
 	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
+	/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index bcf08572588..2910c3995a1 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -876,6 +876,17 @@ BOOL LLWindowWin32::setSizeImpl(const LLCoordScreen size)
 	return TRUE;
 }
 
+BOOL LLWindowWin32::setSizeImpl(const LLCoordWindow size)
+{
+	RECT window_rect = {0, 0, size.mX, size.mY };
+	DWORD dw_ex_style = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
+	DWORD dw_style = WS_OVERLAPPEDWINDOW;
+
+	AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
+
+	return setSizeImpl(LLCoordScreen(window_rect.right - window_rect.left, window_rect.bottom - window_rect.top));
+}
+
 // changing fullscreen resolution
 BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
 {
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index b3602be8b7b..54c9ac4d4d1 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -58,6 +58,7 @@ class LLWindowWin32 : public LLWindow
 	/*virtual*/ BOOL getSize(LLCoordWindow *size);
 	/*virtual*/ BOOL setPosition(LLCoordScreen position);
 	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
+	/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
 	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
 	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
 	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ab20ff1d424..b1b6abe723e 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4102,7 +4102,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	gViewerWindow->getWindow()->getSize(&size);
 	if ( size != new_size )
 	{
-		gViewerWindow->getWindow()->setSize(new_size.convert());
+		gViewerWindow->getWindow()->setSize(new_size);
 	}
 }
 
-- 
GitLab


From d356e2be0ffbc64b5df28b49d8bc3e043957fa21 Mon Sep 17 00:00:00 2001
From: paul_productengine <none@none>
Date: Fri, 24 Feb 2012 21:29:59 +0200
Subject: [PATCH 824/933] MAINT-387 FIXED [PUBLIC]Possible crash in
 llviewermenufile/upload_done_callback

- Just moved the deletion to the inspected block
---
 indra/newview/llviewermenufile.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 7e830e14bf2..cacb8a87663 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -949,11 +949,12 @@ void upload_done_callback(
 			args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
 			LLNotificationsUtil::add("CannotUploadReason", args);
 		}
+
+		delete data;
+		data = NULL;
 	}
 
 	LLUploadDialog::modalUploadFinished();
-	delete data;
-	data = NULL;
 
 	// *NOTE: This is a pretty big hack. What this does is check the
 	// file picker if there are any more pending uploads. If so,
-- 
GitLab


From 1b624f5ea686292652978c72d39e5546efe23d0f Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 24 Feb 2012 11:43:44 -0800
Subject: [PATCH 825/933] potential fix for linux build

---
 indra/llui/llfloater.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 3afa1b8e3ad..22b20969fc5 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -3275,7 +3275,7 @@ void LLFloater::stackWith(LLFloater& other)
 }
 
 LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater)
-:	coord_t(x, y)
+:	coord_t((S32)x, (S32)y)
 {
 	mFloater = floater.getHandle();
 }
-- 
GitLab


From 0fc6c5df969681659b1cc20bf06e9b1f8708d7a4 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 24 Feb 2012 16:54:54 -0800
Subject: [PATCH 826/933] EXP-1181 FIX As a designer, I would like to specify
 default floater positions using relative coordinates floaters given specified
 positions will stay in that location floaters that stack will treat that as a
 specified position moving any floater will switch to relative positioning
 mode cleaned up some XUI where widgets were relying on a default height of 10
 pixels

---
 indra/llui/llfloater.cpp                      | 120 +++++-----
 indra/llui/llfloater.h                        |  13 +-
 indra/llui/llview.cpp                         | 220 ++++++++++--------
 indra/llui/llview.h                           |   2 +-
 .../skins/default/xui/en/floater_about.xml    |   2 +-
 .../default/xui/en/floater_about_land.xml     |   2 +-
 .../skins/default/xui/en/floater_avatar.xml   |   2 +-
 .../default/xui/en/floater_avatar_picker.xml  |   2 +-
 .../skins/default/xui/en/floater_camera.xml   |   7 +-
 .../skins/default/xui/en/floater_chat_bar.xml |   6 +-
 .../skins/default/xui/en/floater_critical.xml |   2 +-
 .../default/xui/en/floater_destinations.xml   |   2 +-
 .../skins/default/xui/en/floater_gesture.xml  |   2 +-
 .../default/xui/en/floater_help_browser.xml   |   2 +-
 .../skins/default/xui/en/floater_joystick.xml |  50 ++++
 .../default/xui/en/floater_land_holdings.xml  |   2 +-
 .../skins/default/xui/en/floater_map.xml      |   2 +-
 .../xui/en/floater_merchant_outbox.xml        |   2 +-
 .../skins/default/xui/en/floater_moveview.xml |   6 +-
 .../default/xui/en/floater_my_appearance.xml  |   2 +-
 .../default/xui/en/floater_my_inventory.xml   |   2 +-
 .../skins/default/xui/en/floater_people.xml   |   2 +-
 .../skins/default/xui/en/floater_picks.xml    |   2 +-
 .../skins/default/xui/en/floater_places.xml   |   2 +-
 .../default/xui/en/floater_preferences.xml    |   2 +-
 .../skins/default/xui/en/floater_search.xml   |   2 +-
 .../skins/default/xui/en/floater_snapshot.xml |   2 +-
 .../xui/en/floater_test_text_editor.xml       |   1 +
 .../default/xui/en/floater_test_widgets.xml   |   2 +
 .../skins/default/xui/en/floater_tools.xml    |   3 +-
 .../skins/default/xui/en/floater_toybox.xml   |   2 +-
 .../default/xui/en/floater_voice_controls.xml |   2 +-
 .../default/xui/en/floater_world_map.xml      |   2 +-
 .../xui/en/panel_postcard_settings.xml        |   1 +
 .../xui/en/panel_snapshot_inventory.xml       |   1 +
 .../default/xui/en/panel_snapshot_local.xml   |   1 +
 .../default/xui/en/panel_snapshot_profile.xml |   1 +
 .../skins/default/xui/en/panel_toast.xml      |   1 -
 .../skins/default/xui/en/widgets/floater.xml  |   2 +-
 39 files changed, 284 insertions(+), 197 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 2a40bbf33cf..992f7e1602b 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -68,7 +68,7 @@ namespace LLInitParam
 {
 	void TypeValues<LLFloaterEnums::EOpenPositioning>::declareValues()
 	{
-		declare("none",       LLFloaterEnums::OPEN_POSITIONING_NONE);
+		declare("relative",   LLFloaterEnums::OPEN_POSITIONING_RELATIVE);
 		declare("cascading",  LLFloaterEnums::OPEN_POSITIONING_CASCADING);
 		declare("centered",   LLFloaterEnums::OPEN_POSITIONING_CENTERED);
 		declare("specified",  LLFloaterEnums::OPEN_POSITIONING_SPECIFIED);
@@ -177,9 +177,7 @@ LLFloater::Params::Params()
 	save_visibility("save_visibility", false),
 	can_dock("can_dock", false),
 	show_title("show_title", true),
-	open_positioning("open_positioning", LLFloaterEnums::OPEN_POSITIONING_NONE),
-	specified_left("specified_left"),
-	specified_bottom("specified_bottom"),
+	positioning("positioning", LLFloaterEnums::OPEN_POSITIONING_RELATIVE),
 	header_height("header_height", 0),
 	legacy_header_height("legacy_header_height", 0),
 	close_image("close_image"),
@@ -249,9 +247,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 	mCanClose(p.can_close),
 	mDragOnLeft(p.can_drag_on_left),
 	mResizable(p.can_resize),
-	mOpenPositioning(p.open_positioning),
-	mSpecifiedLeft(p.specified_left),
-	mSpecifiedBottom(p.specified_bottom),
+	mPositioning(p.positioning),
 	mMinWidth(p.min_width),
 	mMinHeight(p.min_height),
 	mHeaderHeight(p.header_height),
@@ -877,7 +873,7 @@ bool LLFloater::applyRectControl()
 	{
 		// other floaters in our group, position ourselves relative to them and don't save the rect
 		mRectControl.clear();
-		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP;
+		mPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP;
 	}
 	else if (mRectControl.size() > 1)
 	{
@@ -914,20 +910,14 @@ bool LLFloater::applyDockState()
 void LLFloater::applyPositioning(LLFloater* other)
 {
 	// Otherwise position according to the positioning code
-	switch (mOpenPositioning)
+	switch (mPositioning)
 	{
 	case LLFloaterEnums::OPEN_POSITIONING_CENTERED:
 		center();
 		break;
 
 	case LLFloaterEnums::OPEN_POSITIONING_SPECIFIED:
-		{
-			// Translate relative to snap rect
-			setOrigin(mSpecifiedLeft, mSpecifiedBottom);
-			const LLRect& snap_rect = gFloaterView->getSnapRect();
-			translate(snap_rect.mLeft, snap_rect.mBottom);
-			translateIntoRect(snap_rect);
-		}
+		//translateIntoRect(gFloaterView->getSnapRect());
 		break;
 
 	case LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP:
@@ -950,11 +940,25 @@ void LLFloater::applyPositioning(LLFloater* other)
 			setOrigin(horizontal_offset, vertical_offset - rect_height);
 
 			translate(snap_rect.mLeft, snap_rect.mBottom);
-			translateIntoRect(snap_rect);
+			//translateIntoRect(snap_rect);
 		}
+		mPositioning = LLFloaterEnums::OPEN_POSITIONING_SPECIFIED;
+		setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
+
 		break;
 
-	case LLFloaterEnums::OPEN_POSITIONING_NONE:
+	case LLFloaterEnums::OPEN_POSITIONING_RELATIVE:
+		{
+			LLRect snap_rect = gFloaterView->getSnapRect();
+			LLRect floater_view_screen_rect = gFloaterView->calcScreenRect();
+			snap_rect.translate(floater_view_screen_rect.mLeft, floater_view_screen_rect.mBottom);
+			LLRect floater_screen_rect = calcScreenRect();
+
+			LLCoordGL new_center = mPosition.convert();
+			LLCoordGL cur_center(floater_screen_rect.getCenterX(), floater_screen_rect.getCenterY());
+			translate(new_center.mX - cur_center.mX, new_center.mY - cur_center.mY);
+			break;
+		}
 	default:
 		// Do nothing
 		break;
@@ -1072,7 +1076,9 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
 	if (by_user && !isMinimized())
 	{
 		storeRectControl();
-		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;
+		mPositioning = LLFloaterEnums::OPEN_POSITIONING_RELATIVE;
+		LLRect screen_rect = calcScreenRect();
+		mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
 	}
 
 	// if not minimized, adjust all snapped dependents to new shape
@@ -1590,7 +1596,7 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock)
 		if (mDocked)
 		{
 			setMinimized(FALSE);
-			mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;
+			mPositioning = LLFloaterEnums::OPEN_POSITIONING_RELATIVE;
 		}
 
 		updateTitleButtons();
@@ -2164,19 +2170,14 @@ LLFloaterView::LLFloaterView (const Params& p)
 	mSnapOffsetBottom(0),
 	mSnapOffsetRight(0)
 {
+	mSnapView = getHandle();
 }
 
 // By default, adjust vertical.
 void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 {
-	S32 old_right = mLastSnapRect.mRight;
-	S32 old_top = mLastSnapRect.mTop;
-
 	LLView::reshape(width, height, called_from_parent);
 
-	S32 new_right = getSnapRect().mRight;
-	S32 new_top = getSnapRect().mTop;
-
 	mLastSnapRect = getSnapRect();
 
 	for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
@@ -2189,35 +2190,39 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 			continue;
 		}
 
-		if (!floaterp->isMinimized())
+		if (!floaterp->isMinimized() && floaterp->getCanDrag())
 		{
-			LLRect r = floaterp->getRect();
+			LLRect old_rect = floaterp->getRect();
+			floaterp->applyPositioning(NULL);
+			LLRect new_rect = floaterp->getRect();
 
-			// Compute absolute distance from each edge of screen
-			S32 left_offset = llabs(r.mLeft - 0);
-			S32 right_offset = llabs(old_right - r.mRight);
+			//LLRect r = floaterp->getRect();
 
-			S32 top_offset = llabs(old_top - r.mTop);
-			S32 bottom_offset = llabs(r.mBottom - 0);
+			//// Compute absolute distance from each edge of screen
+			//S32 left_offset = llabs(r.mLeft - 0);
+			//S32 right_offset = llabs(old_right - r.mRight);
 
-			S32 translate_x = 0;
-			S32 translate_y = 0;
+			//S32 top_offset = llabs(old_top - r.mTop);
+			//S32 bottom_offset = llabs(r.mBottom - 0);
 
-			if (left_offset > right_offset)
-			{
-				translate_x = new_right - old_right;
-			}
+			S32 translate_x = new_rect.mLeft - old_rect.mLeft;
+			S32 translate_y = new_rect.mBottom - old_rect.mBottom;
 
-			if (top_offset < bottom_offset)
-			{
-				translate_y = new_top - old_top;
-			}
+			//if (left_offset > right_offset)
+			//{
+			//	translate_x = new_right - old_right;
+			//}
+
+			//if (top_offset < bottom_offset)
+			//{
+			//	translate_y = new_top - old_top;
+			//}
 
 			// don't reposition immovable floaters
-			if (floaterp->getCanDrag())
-			{
-				floaterp->translate(translate_x, translate_y);
-			}
+			//if (floaterp->getCanDrag())
+			//{
+			//	floaterp->translate(translate_x, translate_y);
+			//}
 			BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents)
 			{
 				if (dependent_floater.get())
@@ -2972,7 +2977,10 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
 	LLPanel::initFromParams(p);
 
 	// override any follows flags
-	setFollows(FOLLOWS_NONE);
+	if (mPositioning != LLFloaterEnums::OPEN_POSITIONING_SPECIFIED)
+	{
+		setFollows(FOLLOWS_NONE);
+	}
 
 	mTitle = p.title;
 	mShortTitle = p.short_title;
@@ -2991,9 +2999,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
 	mSingleInstance = p.single_instance;
 	mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance;
 
-	mOpenPositioning = p.open_positioning;
-	mSpecifiedLeft = p.specified_left;
-	mSpecifiedBottom = p.specified_bottom;
+	mPositioning = p.positioning;
 
 	if (p.save_rect && mRectControl.empty())
 	{
@@ -3113,7 +3119,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
 		params.rect.left.set(0);
 	}
 	params.from_xui = true;
-	applyXUILayout(params, parent);
+	applyXUILayout(params, parent, parent == gFloaterView ? gFloaterView->getSnapRect() : parent->getLocalRect());
  	initFromParams(params);
 
 	initFloater(params);
@@ -3272,6 +3278,9 @@ void LLFloater::stackWith(LLFloater& other)
 	next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight());
 	
 	setShape(next_rect);
+
+	other.mPositioning = LLFloaterEnums::OPEN_POSITIONING_SPECIFIED;
+	other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
 }
 
 LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater)
@@ -3309,6 +3318,9 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
 	const LLCoordFloater& self = static_cast<const LLCoordFloater&>(LLCoordFloater::getTypedCoords(*this));
 
 	LLRect snap_rect = gFloaterView->getSnapRect();
+	LLRect floater_view_screen_rect = gFloaterView->calcScreenRect();
+	snap_rect.translate(floater_view_screen_rect.mLeft, floater_view_screen_rect.mBottom);
+
 	LLFloater* floaterp = mFloater.get();
 	S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
 	S32 floater_height = floaterp ? floaterp->getRect().getHeight() : 0;
@@ -3350,6 +3362,10 @@ void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from)
 {
 	LLCoordFloater& self = static_cast<LLCoordFloater&>(LLCoordFloater::getTypedCoords(*this));
 	LLRect snap_rect = gFloaterView->getSnapRect();
+	LLRect floater_view_screen_rect = gFloaterView->calcScreenRect();
+	snap_rect.translate(floater_view_screen_rect.mLeft, floater_view_screen_rect.mBottom);
+
+
 	LLFloater* floaterp = mFloater.get();
 	S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
 	S32 floater_height = floaterp ? floaterp->getRect().getHeight() : 0;
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index a7cc9ae9617..9b26adde406 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -64,7 +64,7 @@ namespace LLFloaterEnums
 {
 	enum EOpenPositioning
 	{
-		OPEN_POSITIONING_NONE,
+		OPEN_POSITIONING_RELATIVE,
 		OPEN_POSITIONING_CASCADING,
 		OPEN_POSITIONING_CASCADE_GROUP,
 		OPEN_POSITIONING_CENTERED,
@@ -163,10 +163,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 								can_dock,
 								show_title;
 		
-		Optional<LLFloaterEnums::EOpenPositioning>	open_positioning;
-		Optional<S32>								specified_left;
-		Optional<S32>								specified_bottom;
-
+		Optional<LLFloaterEnums::EOpenPositioning>	positioning;
 		
 		Optional<S32>			header_height,
 								legacy_header_height; // HACK see initFromXML()
@@ -355,7 +352,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 		
 	void			enableResizeCtrls(bool enable, bool width = true, bool height = true);
 
-	bool			isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mOpenPositioning); }
+	bool			isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mPositioning); }
 protected:
 	void			applyControlsAndPosition(LLFloater* other);
 
@@ -453,9 +450,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	BOOL			mDragOnLeft;
 	BOOL			mResizable;
 
-	LLFloaterEnums::EOpenPositioning	mOpenPositioning;
-	S32									mSpecifiedLeft;
-	S32									mSpecifiedBottom;
+	LLFloaterEnums::EOpenPositioning	mPositioning;
 	LLCoordFloater	mPosition;
 	
 	S32				mMinWidth;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 421166dcd4d..356d5c31d1b 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2225,145 +2225,163 @@ static bool get_last_child_rect(LLView* parent, LLRect *rect)
 }
 
 //static
-void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
+void LLView::applyXUILayout(LLView::Params& p, LLView* parent, LLRect layout_rect)
 {
+	if (!parent) return;
+
 	const S32 VPAD = 4;
 	const S32 MIN_WIDGET_HEIGHT = 10;
 	
 	// *NOTE:  This will confuse export of floater/panel coordinates unless
 	// the default is also "topleft".  JC
-	if (p.layout().empty() && parent)
+	if (p.layout().empty())
 	{
 		p.layout = parent->getLayout();
 	}
 
-	if (parent)
+	if (layout_rect.isEmpty())
 	{
-		LLRect parent_rect = parent->getLocalRect();
-		// overwrite uninitialized rect params, using context
-		LLRect default_rect = parent->getLocalRect();
+		layout_rect = parent->getLocalRect();
+	}
 
-		bool layout_topleft = (p.layout() == "topleft");
+	// overwrite uninitialized rect params, using context
+	LLRect default_rect = parent->getLocalRect();
 
-		// convert negative or centered coordinates to parent relative values
-		// Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock()
-		if (p.rect.left.isProvided() && p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth();
-		if (p.rect.right.isProvided() && p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth();
-		if (p.rect.bottom.isProvided() && p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight();
-		if (p.rect.top.isProvided() && p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight();
+	bool layout_topleft = (p.layout() == "topleft");
 
+	// convert negative or centered coordinates to parent relative values
+	// Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock()
+	if (p.rect.left.isProvided()) 
+	{
+		p.rect.left = p.rect.left + ((p.rect.left >= 0) ? layout_rect.mLeft : layout_rect.mRight);
+	}
+	if (p.rect.right.isProvided())
+	{
+		p.rect.right = p.rect.right + ((p.rect.right >= 0) ? layout_rect.mLeft : layout_rect.mRight);
+	}
+	if (p.rect.bottom.isProvided()) 
+	{
+		p.rect.bottom = p.rect.bottom + ((p.rect.bottom >= 0) ? layout_rect.mBottom : layout_rect.mTop);
 		if (layout_topleft)
 		{
 			//invert top to bottom
-			if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top;
-			if (p.rect.bottom.isProvided()) p.rect.bottom = parent_rect.getHeight() - p.rect.bottom;
+			p.rect.bottom = layout_rect.mBottom + layout_rect.mTop - p.rect.bottom;
 		}
-
-		// DEPRECATE: automatically fall back to height of MIN_WIDGET_HEIGHT pixels
-		if (!p.rect.height.isProvided() && !p.rect.top.isProvided() && p.rect.height == 0)
+	}
+	if (p.rect.top.isProvided())
+	{
+		p.rect.top = p.rect.top + ((p.rect.top >= 0) ? layout_rect.mBottom : layout_rect.mTop);
+		if (layout_topleft)
 		{
-			p.rect.height = MIN_WIDGET_HEIGHT;
+			//invert top to bottom
+			p.rect.top = layout_rect.mBottom + layout_rect.mTop - p.rect.top;
 		}
+	}
 
-		default_rect.translate(0, default_rect.getHeight());
+	// DEPRECATE: automatically fall back to height of MIN_WIDGET_HEIGHT pixels
+	if (!p.rect.height.isProvided() && !p.rect.top.isProvided() && p.rect.height == 0)
+	{
+		p.rect.height = MIN_WIDGET_HEIGHT;
+	}
 
-		// If there was a recently constructed child, use its rectangle
-		get_last_child_rect(parent, &default_rect);
+	default_rect.translate(0, default_rect.getHeight());
 
-		if (layout_topleft)
+	// If there was a recently constructed child, use its rectangle
+	get_last_child_rect(parent, &default_rect);
+
+	if (layout_topleft)
+	{
+		// Invert the sense of bottom_delta for topleft layout
+		if (p.bottom_delta.isProvided())
 		{
-			// Invert the sense of bottom_delta for topleft layout
-			if (p.bottom_delta.isProvided())
-			{
-				p.bottom_delta = -p.bottom_delta;
-			}
-			else if (p.top_pad.isProvided()) 
-			{
-				p.bottom_delta = -(p.rect.height + p.top_pad);
-			}
-			else if (p.top_delta.isProvided())
-			{
-				p.bottom_delta =
-					-(p.top_delta + p.rect.height - default_rect.getHeight());
-			}
-			else if (!p.left_delta.isProvided()
-					 && !p.left_pad.isProvided())
-			{
-				// set default position is just below last rect
-				p.bottom_delta.set(-(p.rect.height + VPAD), false);
-			}
-			else
-			{
-				p.bottom_delta.set(0, false);
-			}
-	
-			// default to same left edge
-			if (!p.left_delta.isProvided())
-			{
-				p.left_delta.set(0, false);
-			}
-			if (p.left_pad.isProvided())
-			{
-				// left_pad is based on prior widget's right edge
-				p.left_delta.set(p.left_pad + default_rect.getWidth(), false);
-			}
-			
-			default_rect.translate(p.left_delta, p.bottom_delta);				
+			p.bottom_delta = -p.bottom_delta;
 		}
-		else
-		{	
-			// set default position is just below last rect
-			if (!p.bottom_delta.isProvided())
-			{
-				p.bottom_delta.set(-(p.rect.height + VPAD), false);
-			}
-			if (!p.left_delta.isProvided())
-			{
-				p.left_delta.set(0, false);
-			}
-			default_rect.translate(p.left_delta, p.bottom_delta);
+		else if (p.top_pad.isProvided()) 
+		{
+			p.bottom_delta = -(p.rect.height + p.top_pad);
 		}
-
-		// this handles case where *both* x and x_delta are provided
-		// ignore x in favor of default x + x_delta
-		if (p.bottom_delta.isProvided()) p.rect.bottom.set(0, false);
-		if (p.left_delta.isProvided()) p.rect.left.set(0, false);
-
-		// selectively apply rectangle defaults, making sure that
-		// params are not flagged as having been "provided"
-		// as rect params are overconstrained and rely on provided flags
-		if (!p.rect.left.isProvided())
+		else if (p.top_delta.isProvided())
+		{
+			p.bottom_delta =
+				-(p.top_delta + p.rect.height - default_rect.getHeight());
+		}
+		else if (!p.left_delta.isProvided()
+					&& !p.left_pad.isProvided())
 		{
-			p.rect.left.set(default_rect.mLeft, false);
-			//HACK: get around the fact that setting a rect param component value won't invalidate the existing rect object value
-			p.rect.paramChanged(p.rect.left, true);
+			// set default position is just below last rect
+			p.bottom_delta.set(-(p.rect.height + VPAD), false);
 		}
-		if (!p.rect.bottom.isProvided())
+		else
 		{
-			p.rect.bottom.set(default_rect.mBottom, false);
-			p.rect.paramChanged(p.rect.bottom, true);
+			p.bottom_delta.set(0, false);
 		}
-		if (!p.rect.top.isProvided())
+	
+		// default to same left edge
+		if (!p.left_delta.isProvided())
 		{
-			p.rect.top.set(default_rect.mTop, false);
-			p.rect.paramChanged(p.rect.top, true);
+			p.left_delta.set(0, false);
 		}
-		if (!p.rect.right.isProvided())
+		if (p.left_pad.isProvided())
 		{
-			p.rect.right.set(default_rect.mRight, false);
-			p.rect.paramChanged(p.rect.right, true);
-
+			// left_pad is based on prior widget's right edge
+			p.left_delta.set(p.left_pad + default_rect.getWidth(), false);
 		}
-		if (!p.rect.width.isProvided())
+			
+		default_rect.translate(p.left_delta, p.bottom_delta);				
+	}
+	else
+	{	
+		// set default position is just below last rect
+		if (!p.bottom_delta.isProvided())
 		{
-			p.rect.width.set(default_rect.getWidth(), false);
-			p.rect.paramChanged(p.rect.width, true);
+			p.bottom_delta.set(-(p.rect.height + VPAD), false);
 		}
-		if (!p.rect.height.isProvided())
+		if (!p.left_delta.isProvided())
 		{
-			p.rect.height.set(default_rect.getHeight(), false);
-			p.rect.paramChanged(p.rect.height, true);
+			p.left_delta.set(0, false);
 		}
+		default_rect.translate(p.left_delta, p.bottom_delta);
+	}
+
+	// this handles case where *both* x and x_delta are provided
+	// ignore x in favor of default x + x_delta
+	if (p.bottom_delta.isProvided()) p.rect.bottom.set(0, false);
+	if (p.left_delta.isProvided()) p.rect.left.set(0, false);
+
+	// selectively apply rectangle defaults, making sure that
+	// params are not flagged as having been "provided"
+	// as rect params are overconstrained and rely on provided flags
+	if (!p.rect.left.isProvided())
+	{
+		p.rect.left.set(default_rect.mLeft, false);
+		//HACK: get around the fact that setting a rect param component value won't invalidate the existing rect object value
+		p.rect.paramChanged(p.rect.left, true);
+	}
+	if (!p.rect.bottom.isProvided())
+	{
+		p.rect.bottom.set(default_rect.mBottom, false);
+		p.rect.paramChanged(p.rect.bottom, true);
+	}
+	if (!p.rect.top.isProvided())
+	{
+		p.rect.top.set(default_rect.mTop, false);
+		p.rect.paramChanged(p.rect.top, true);
+	}
+	if (!p.rect.right.isProvided())
+	{
+		p.rect.right.set(default_rect.mRight, false);
+		p.rect.paramChanged(p.rect.right, true);
+
+	}
+	if (!p.rect.width.isProvided())
+	{
+		p.rect.width.set(default_rect.getWidth(), false);
+		p.rect.paramChanged(p.rect.width, true);
+	}
+	if (!p.rect.height.isProvided())
+	{
+		p.rect.height.set(default_rect.getHeight(), false);
+		p.rect.paramChanged(p.rect.height, true);
 	}
 }
 
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index fd19309a56e..1c353495107 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -505,7 +505,7 @@ class LLView
 
 	// Set up params after XML load before calling new(),
 	// usually to adjust layout.
-	static void applyXUILayout(Params& p, LLView* parent);
+	static void applyXUILayout(Params& p, LLView* parent, LLRect layout_rect = LLRect());
 
 	// For re-export of floaters and panels, convert the coordinate system
 	// to be top-left based.
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index c7e9ec781da..060d8890032 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="centered"
+ positioning="centered"
  legacy_header_height="18"
  height="440"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index a737c123c66..aa7c6e5ed7d 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_tear_off="false"
  height="420"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml
index defb8e2d1f0..cd5cca02bdb 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  ignore_ui_scale="false"
  legacy_header_height="225"
  can_minimize="true"
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 cbbbeb60948..1a55dc2e2ce 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  can_resize="true"
  height="350"
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index 4673c6def59..22bc488a925 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="specified"
- specified_left="458"
- specified_bottom="80"
+ positioning="specified"
+ left="458"
+ bottom="-80"
+ follows="left|bottom"
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 63992462b34..688a01ce7bc 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="specified"
- specified_left="10"
- specified_bottom="10"
+ positioning="specified"
+ left="10"
+ bottom="-10"
  height="60"
  layout="topleft"
  legacy_header_height="25"
diff --git a/indra/newview/skins/default/xui/en/floater_critical.xml b/indra/newview/skins/default/xui/en/floater_critical.xml
index 13b15bf7240..143bcb44300 100644
--- a/indra/newview/skins/default/xui/en/floater_critical.xml
+++ b/indra/newview/skins/default/xui/en/floater_critical.xml
@@ -6,7 +6,7 @@
  height="500"
  layout="topleft"
  name="modal container"
- open_positioning="centered"
+ positioning="centered"
  width="600">
     <button
      height="20"
diff --git a/indra/newview/skins/default/xui/en/floater_destinations.xml b/indra/newview/skins/default/xui/en/floater_destinations.xml
index 373114a1eb8..39aa8e07bb6 100644
--- a/indra/newview/skins/default/xui/en/floater_destinations.xml
+++ b/indra/newview/skins/default/xui/en/floater_destinations.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  ignore_ui_scale="false"
  legacy_header_height="225"
  can_minimize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml
index b96a94a849b..200e9b9537c 100644
--- a/indra/newview/skins/default/xui/en/floater_gesture.xml
+++ b/indra/newview/skins/default/xui/en/floater_gesture.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  save_rect="true"
  legacy_header_height="18"
  can_resize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml
index cd075abc415..c06cb63f8ac 100644
--- a/indra/newview/skins/default/xui/en/floater_help_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  can_resize="true"
  height="600"
diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml
index 6e1bb8fcd02..59f6a9434c4 100644
--- a/indra/newview/skins/default/xui/en/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/en/floater_joystick.xml
@@ -13,6 +13,7 @@
     </floater.string>
     <check_box
      bottom="38"
+     height="10"
      control_name="JoystickEnabled"
      halign="left"
      label="Enable Joystick:"
@@ -28,6 +29,7 @@
      width="380" />
     <spinner
      bottom="48"
+     height="10"
      control_name="JoystickAxis1"
      decimal_digits="0"
      increment="1"
@@ -41,6 +43,7 @@
      width="140" />
     <spinner
      bottom="48"
+     height="10"     
      control_name="JoystickAxis2"
      decimal_digits="0"
      increment="1"
@@ -54,6 +57,7 @@
      width="140" />
     <spinner
      bottom="48"
+     height="10"     
      control_name="JoystickAxis0"
      decimal_digits="0"
      increment="1"
@@ -67,6 +71,7 @@
      width="140" />
     <spinner
      bottom="68"
+     height="10"     
      control_name="JoystickAxis4"
      decimal_digits="0"
      increment="1"
@@ -80,6 +85,7 @@
      width="140" />
     <spinner
      bottom="68"
+     height="10"     
      control_name="JoystickAxis5"
      decimal_digits="0"
      increment="1"
@@ -93,6 +99,7 @@
      width="140" />
     <spinner
      bottom="68"
+     height="10"     
      control_name="JoystickAxis3"
      decimal_digits="0"
      increment="1"
@@ -106,6 +113,7 @@
      width="140" />
     <spinner
      bottom="88"
+     height="10"     
      control_name="JoystickAxis6"
      decimal_digits="0"
      increment="1"
@@ -119,6 +127,7 @@
      width="140" />
     <check_box
      bottom_delta="18"
+     height="10"
      control_name="ZoomDirect"
      label="Direct Zoom"
      layout="topleft"
@@ -127,6 +136,7 @@
      width="60" />
     <check_box
      bottom_delta="0"
+     height="10"     
      control_name="Cursor3D"
      label="3D Cursor"
      layout="topleft"
@@ -135,6 +145,7 @@
      width="60" />
     <check_box
      bottom_delta="0"
+     height="10"     
      control_name="AutoLeveling"
      label="Auto Level"
      layout="topleft"
@@ -157,6 +168,7 @@
     </text>
     <check_box
      bottom="127"
+     height="10"     
      control_name="JoystickAvatarEnabled"
      halign="center"
      label="Avatar"
@@ -166,6 +178,7 @@
      width="60" />
     <check_box
      bottom="127"
+     height="10"     
      control_name="JoystickBuildEnabled"
      halign="center"
      label="Build"
@@ -175,6 +188,7 @@
      width="60" />
     <check_box
      bottom="127"
+     height="10"     
      control_name="JoystickFlycamEnabled"
      halign="center"
      label="Flycam"
@@ -257,6 +271,7 @@
     </text>
     <spinner
      bottom="144"
+     height="10"     
      control_name="AvatarAxisScale1"
      decimal_digits="2"
      label_width="0"
@@ -268,6 +283,7 @@
      width="56" />
     <spinner
      bottom="144"
+     height="10"     
      control_name="BuildAxisScale1"
      decimal_digits="2"
      label_width="0"
@@ -279,6 +295,7 @@
      width="56" />
     <spinner
      bottom="144"
+     height="10"     
      control_name="FlycamAxisScale1"
      decimal_digits="2"
      label_width="0"
@@ -301,6 +318,7 @@
     </text>
     <spinner
      bottom="164"
+     height="10"     
      control_name="AvatarAxisScale2"
      decimal_digits="2"
      label_width="0"
@@ -312,6 +330,7 @@
      width="56" />
     <spinner
      bottom="164"
+     height="10"     
      control_name="BuildAxisScale2"
      decimal_digits="2"
      label_width="0"
@@ -323,6 +342,7 @@
      width="56" />
     <spinner
      bottom="164"
+     height="10"     
      control_name="FlycamAxisScale2"
      decimal_digits="2"
      label_width="0"
@@ -345,6 +365,7 @@
     </text>
     <spinner
      bottom="184"
+     height="10"     
      control_name="AvatarAxisScale0"
      decimal_digits="2"
      label_width="0"
@@ -356,6 +377,7 @@
      width="56" />
     <spinner
      bottom="184"
+     height="10"     
      control_name="BuildAxisScale0"
      decimal_digits="2"
      label_width="0"
@@ -367,6 +389,7 @@
      width="56" />
     <spinner
      bottom="184"
+     height="10"     
      control_name="FlycamAxisScale0"
      decimal_digits="2"
      label_width="0"
@@ -389,6 +412,7 @@
     </text>
     <spinner
      bottom="204"
+     height="10"     
      control_name="AvatarAxisScale4"
      decimal_digits="2"
      label_width="0"
@@ -400,6 +424,7 @@
      width="56" />
     <spinner
      bottom="204"
+     height="10"     
      control_name="BuildAxisScale4"
      decimal_digits="2"
      label_width="0"
@@ -411,6 +436,7 @@
      width="56" />
     <spinner
      bottom="204"
+     height="10"     
      control_name="FlycamAxisScale4"
      decimal_digits="2"
      label_width="0"
@@ -433,6 +459,7 @@
     </text>
     <spinner
      bottom="224"
+     height="10"
      control_name="AvatarAxisScale5"
      decimal_digits="2"
      label_width="0"
@@ -444,6 +471,7 @@
      width="56" />
     <spinner
      bottom="224"
+     height="10"
      control_name="BuildAxisScale5"
      decimal_digits="2"
      label_width="0"
@@ -455,6 +483,7 @@
      width="56" />
     <spinner
      bottom="224"
+     height="10"
      control_name="FlycamAxisScale5"
      decimal_digits="2"
      label_width="0"
@@ -477,6 +506,7 @@
     </text>
     <spinner
      bottom="244"
+     height="10"
      control_name="BuildAxisScale3"
      decimal_digits="2"
      label_width="0"
@@ -488,6 +518,7 @@
      width="56" />
     <spinner
      bottom="244"
+     height="10"
      control_name="FlycamAxisScale3"
      decimal_digits="2"
      label_width="0"
@@ -510,6 +541,7 @@
     </text>
     <spinner
      bottom="274"
+     height="10"
      control_name="AvatarAxisDeadZone1"
      decimal_digits="2"
      increment="0.01"
@@ -520,6 +552,7 @@
      width="56" />
     <spinner
      bottom="274"
+     height="10"
      control_name="BuildAxisDeadZone1"
      decimal_digits="2"
      increment="0.01"
@@ -530,6 +563,7 @@
      width="56" />
     <spinner
      bottom="274"
+     height="10"
      control_name="FlycamAxisDeadZone1"
      decimal_digits="2"
      increment="0.01"
@@ -551,6 +585,7 @@
     </text>
     <spinner
      bottom="294"
+     height="10"     
      control_name="AvatarAxisDeadZone2"
      decimal_digits="2"
      increment="0.01"
@@ -561,6 +596,7 @@
      width="56" />
     <spinner
      bottom="294"
+     height="10"
      control_name="BuildAxisDeadZone2"
      decimal_digits="2"
      increment="0.01"
@@ -571,6 +607,7 @@
      width="56" />
     <spinner
      bottom="294"
+     height="10"
      control_name="FlycamAxisDeadZone2"
      decimal_digits="2"
      increment="0.01"
@@ -592,6 +629,7 @@
     </text>
     <spinner
      bottom="314"
+     height="10"
      control_name="AvatarAxisDeadZone0"
      decimal_digits="2"
      increment="0.01"
@@ -602,6 +640,7 @@
      width="56" />
     <spinner
      bottom="314"
+     height="10"
      control_name="BuildAxisDeadZone0"
      decimal_digits="2"
      increment="0.01"
@@ -612,6 +651,7 @@
      width="56" />
     <spinner
      bottom="314"
+     height="10"
      control_name="FlycamAxisDeadZone0"
      decimal_digits="2"
      increment="0.01"
@@ -633,6 +673,7 @@
     </text>
     <spinner
      bottom="334"
+     height="10"
      control_name="AvatarAxisDeadZone4"
      decimal_digits="2"
      increment="0.01"
@@ -643,6 +684,7 @@
      width="56" />
     <spinner
      bottom="334"
+     height="10"
      control_name="BuildAxisDeadZone4"
      decimal_digits="2"
      increment="0.01"
@@ -653,6 +695,7 @@
      width="56" />
     <spinner
      bottom="334"
+     height="10"
      control_name="FlycamAxisDeadZone4"
      decimal_digits="2"
      increment="0.01"
@@ -674,6 +717,7 @@
     </text>
     <spinner
      bottom="354"
+     height="10"
      control_name="AvatarAxisDeadZone5"
      decimal_digits="2"
      increment="0.01"
@@ -684,6 +728,7 @@
      width="56" />
     <spinner
      bottom="354"
+     height="10"
      control_name="BuildAxisDeadZone5"
      decimal_digits="2"
      increment="0.01"
@@ -694,6 +739,7 @@
      width="56" />
     <spinner
      bottom="354"
+     height="10"
      control_name="FlycamAxisDeadZone5"
      decimal_digits="2"
      increment="0.01"
@@ -715,6 +761,7 @@
     </text>
     <spinner
      bottom="374"
+     height="10"
      control_name="BuildAxisDeadZone3"
      decimal_digits="2"
      increment="0.01"
@@ -725,6 +772,7 @@
      width="56" />
     <spinner
      bottom="374"
+     height="10"
      control_name="FlycamAxisDeadZone3"
      decimal_digits="2"
      increment="0.01"
@@ -802,6 +850,7 @@
     </text>
     <spinner
      bottom="430"
+     height="10"
      control_name="FlycamAxisScale6"
      decimal_digits="2"
      label_width="0"
@@ -824,6 +873,7 @@
     </text>
     <spinner
      bottom="450"
+     height="10"
      control_name="FlycamAxisDeadZone6"
      decimal_digits="2"
      increment="0.01"
diff --git a/indra/newview/skins/default/xui/en/floater_land_holdings.xml b/indra/newview/skins/default/xui/en/floater_land_holdings.xml
index 3737294ebe6..390ec9ab7d4 100644
--- a/indra/newview/skins/default/xui/en/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/en/floater_land_holdings.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="centered"
+ positioning="centered"
  legacy_header_height="18"
  height="430"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml
index 3eeebcf1206..b8893e11d90 100644
--- a/indra/newview/skins/default/xui/en/floater_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_map.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_minimize="true" 
  can_resize="true"
  chrome="true"
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index b01e5852dcf..90bd64a6752 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
-    open_positioning="cascading"
+    positioning="cascading"
     can_close="true"
     can_resize="true"
     height="440"
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index 065dab04131..4e7ee7913fb 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="specified"
- specified_left="320"
- specified_bottom="80"
+ positioning="specified"
+ left="320"
+ bottom="-80"
  legacy_header_height="18"
  can_dock="false"
  can_minimize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
index 1c4b25a7b02..fdea7a821ab 100644
--- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   legacy_header_height="18"
   can_resize="true"
   height="588"
diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
index cd0b59dc513..184f2962559 100644
--- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_close="true"
  can_resize="true"
  height="570"
diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml
index d6d8431150a..08d0b00a835 100644
--- a/indra/newview/skins/default/xui/en/floater_people.xml
+++ b/indra/newview/skins/default/xui/en/floater_people.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
 
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   can_close="true"
   can_resize="true"
   height="570"
diff --git a/indra/newview/skins/default/xui/en/floater_picks.xml b/indra/newview/skins/default/xui/en/floater_picks.xml
index 78821166624..984894b0165 100644
--- a/indra/newview/skins/default/xui/en/floater_picks.xml
+++ b/indra/newview/skins/default/xui/en/floater_picks.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_close="true"
  can_resize="true"
  height="572"
diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml
index ccceac0a7b2..b241e265a9a 100644
--- a/indra/newview/skins/default/xui/en/floater_places.xml
+++ b/indra/newview/skins/default/xui/en/floater_places.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   legacy_header_height="18"
   can_resize="true"
   height="588"
diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index b2662331b05..bd6faf4ed8f 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- open_positioning="centered"
+ positioning="centered"
  default_tab_group="1"
  height="460"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml
index dd818e2e065..c3e7028dc5b 100644
--- a/indra/newview/skins/default/xui/en/floater_search.xml
+++ b/indra/newview/skins/default/xui/en/floater_search.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   legacy_header_height="18"
   can_resize="true"
   height="775"
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 0c38283d597..49d64767cc7 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
diff --git a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
index 548e24efba3..e1fefc36313 100644
--- a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
@@ -3,6 +3,7 @@
  legacy_header_height="18"
  can_resize="true"
  height="600"
+ single_instance="false"
  layout="topleft"
  name="floater_test_text_editor"
  translate="false"
diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml
index 13c850c86c0..10854f5a499 100644
--- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml
@@ -115,6 +115,7 @@
   </flyout_button>
   <check_box
    bottom_delta="35"
+   height="10"
    label="Checkbox"
    layout="topleft"
    tool_tip="checkbox"
@@ -275,6 +276,7 @@
   <!-- "spinner" is a numerical input widget with an up and down arrow to
        change the value. -->
   <spinner
+    height="10"
    bottom_delta="35"
    follows="top|left"
    label="Spinner"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 2d63c94fe11..e37740d20cd 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  height="580"
  layout="topleft"
@@ -1206,6 +1206,7 @@ even though the user gets a free copy.
              label="Modify"
              layout="topleft"
              left="10"
+             height="10"
              name="checkbox next owner can modify"
              width="85" />
             <check_box
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index fcaae9d172a..d8211c24a72 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -10,7 +10,7 @@
   layout="topleft"
   legacy_header_height="18"
   name="Toybox"
-  open_positioning="centered"
+  positioning="centered"
   save_rect="true"
   single_instance="true"
   title="TOOLBAR BUTTONS"
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index cea19ec75c7..2afc7fd3d16 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_resize="true"
  can_minimize="true"
  can_close="true"
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index 56d79f62c7b..83407069d2e 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -2,7 +2,7 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- open_positioning="centered"
+ positioning="centered"
  height="600"
  layout="topleft"
  min_height="520"
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index e9427a23882..3f67a48b14f 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -85,6 +85,7 @@
              top_delta="0"
              width="95" />
             <check_box
+              height="10"
              bottom_delta="20"
              follows="left|top"
              label="Constrain proportions"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index 9057ebb65eb..71d808fa4b2 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -114,6 +114,7 @@
      width="95" />
     <check_box
      bottom_delta="20"
+     height="10"
      follows="left|top"
      label="Constrain proportions"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index b966358f18d..781ab174031 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -132,6 +132,7 @@
              width="95" />
             <check_box
              bottom_delta="20"
+             height="10"
              follows="left|top"
              label="Constrain proportions"
              layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 5bd383b81e8..0dd357aa1a7 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -119,6 +119,7 @@
              top_delta="0"
              width="95" />
             <check_box
+              height="10"
              bottom_delta="20"
              label="Constrain proportions"
              layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index 062c403a26b..66c4b170b6a 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -10,7 +10,6 @@
 -->
 
 <floater
- open_positioning="none"
  legacy_header_height="0"
  header_height="0"
  name="toast"
diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml
index adbb1833178..97a5ae7d4e5 100644
--- a/indra/newview/skins/default/xui/en/widgets/floater.xml
+++ b/indra/newview/skins/default/xui/en/widgets/floater.xml
@@ -2,7 +2,7 @@
 <!-- See also settings.xml UIFloater* settings for configuration -->
 <floater
  name="floater"
- open_positioning="none"
+ positioning="none"
  layout="topleft"
  bg_opaque_color="FloaterFocusBackgroundColor"
  bg_alpha_color="FloaterDefaultBackgroundColor"
-- 
GitLab


From 0c7e91205f9b2fc8fe55e5a65f4bfa908d105c37 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 24 Feb 2012 16:57:12 -0800
Subject: [PATCH 827/933] EXP-1181 FIX As a designer, I would like to specify
 default floater positions using relative coordinates fixed bug where resizing
 window would cause stacked floaters to move relative to each other renamed
 positioning enums to reflect the fact that they apply all the time now, not
 just when opening floaters

---
 indra/llui/llfloater.cpp         | 32 ++++++++++++++++----------------
 indra/llui/llfloater.h           | 12 ++++++------
 indra/llui/llfloaterreg.cpp      |  2 +-
 indra/newview/llviewerwindow.cpp |  2 ++
 4 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 992f7e1602b..65bd63a187e 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -68,10 +68,10 @@ namespace LLInitParam
 {
 	void TypeValues<LLFloaterEnums::EOpenPositioning>::declareValues()
 	{
-		declare("relative",   LLFloaterEnums::OPEN_POSITIONING_RELATIVE);
-		declare("cascading",  LLFloaterEnums::OPEN_POSITIONING_CASCADING);
-		declare("centered",   LLFloaterEnums::OPEN_POSITIONING_CENTERED);
-		declare("specified",  LLFloaterEnums::OPEN_POSITIONING_SPECIFIED);
+		declare("relative",   LLFloaterEnums::POSITIONING_RELATIVE);
+		declare("cascading",  LLFloaterEnums::POSITIONING_CASCADING);
+		declare("centered",   LLFloaterEnums::POSITIONING_CENTERED);
+		declare("specified",  LLFloaterEnums::POSITIONING_SPECIFIED);
 	}
 }
 
@@ -177,7 +177,7 @@ LLFloater::Params::Params()
 	save_visibility("save_visibility", false),
 	can_dock("can_dock", false),
 	show_title("show_title", true),
-	positioning("positioning", LLFloaterEnums::OPEN_POSITIONING_RELATIVE),
+	positioning("positioning", LLFloaterEnums::POSITIONING_RELATIVE),
 	header_height("header_height", 0),
 	legacy_header_height("legacy_header_height", 0),
 	close_image("close_image"),
@@ -873,7 +873,7 @@ bool LLFloater::applyRectControl()
 	{
 		// other floaters in our group, position ourselves relative to them and don't save the rect
 		mRectControl.clear();
-		mPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP;
+		mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP;
 	}
 	else if (mRectControl.size() > 1)
 	{
@@ -912,16 +912,16 @@ void LLFloater::applyPositioning(LLFloater* other)
 	// Otherwise position according to the positioning code
 	switch (mPositioning)
 	{
-	case LLFloaterEnums::OPEN_POSITIONING_CENTERED:
+	case LLFloaterEnums::POSITIONING_CENTERED:
 		center();
 		break;
 
-	case LLFloaterEnums::OPEN_POSITIONING_SPECIFIED:
+	case LLFloaterEnums::POSITIONING_SPECIFIED:
 		//translateIntoRect(gFloaterView->getSnapRect());
 		break;
 
-	case LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP:
-	case LLFloaterEnums::OPEN_POSITIONING_CASCADING:
+	case LLFloaterEnums::POSITIONING_CASCADE_GROUP:
+	case LLFloaterEnums::POSITIONING_CASCADING:
 		if (other != NULL && other != this)
 		{
 			stackWith(*other);
@@ -942,12 +942,12 @@ void LLFloater::applyPositioning(LLFloater* other)
 			translate(snap_rect.mLeft, snap_rect.mBottom);
 			//translateIntoRect(snap_rect);
 		}
-		mPositioning = LLFloaterEnums::OPEN_POSITIONING_SPECIFIED;
+		mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
 		setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
 
 		break;
 
-	case LLFloaterEnums::OPEN_POSITIONING_RELATIVE:
+	case LLFloaterEnums::POSITIONING_RELATIVE:
 		{
 			LLRect snap_rect = gFloaterView->getSnapRect();
 			LLRect floater_view_screen_rect = gFloaterView->calcScreenRect();
@@ -1076,7 +1076,7 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
 	if (by_user && !isMinimized())
 	{
 		storeRectControl();
-		mPositioning = LLFloaterEnums::OPEN_POSITIONING_RELATIVE;
+		mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
 		LLRect screen_rect = calcScreenRect();
 		mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
 	}
@@ -1596,7 +1596,7 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock)
 		if (mDocked)
 		{
 			setMinimized(FALSE);
-			mPositioning = LLFloaterEnums::OPEN_POSITIONING_RELATIVE;
+			mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
 		}
 
 		updateTitleButtons();
@@ -2977,7 +2977,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
 	LLPanel::initFromParams(p);
 
 	// override any follows flags
-	if (mPositioning != LLFloaterEnums::OPEN_POSITIONING_SPECIFIED)
+	if (mPositioning != LLFloaterEnums::POSITIONING_SPECIFIED)
 	{
 		setFollows(FOLLOWS_NONE);
 	}
@@ -3279,7 +3279,7 @@ void LLFloater::stackWith(LLFloater& other)
 	
 	setShape(next_rect);
 
-	other.mPositioning = LLFloaterEnums::OPEN_POSITIONING_SPECIFIED;
+	other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
 	other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
 }
 
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 9b26adde406..48dc290a930 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -64,12 +64,12 @@ namespace LLFloaterEnums
 {
 	enum EOpenPositioning
 	{
-		OPEN_POSITIONING_RELATIVE,
-		OPEN_POSITIONING_CASCADING,
-		OPEN_POSITIONING_CASCADE_GROUP,
-		OPEN_POSITIONING_CENTERED,
-		OPEN_POSITIONING_SPECIFIED,
-		OPEN_POSITIONING_COUNT
+		POSITIONING_RELATIVE,
+		POSITIONING_CASCADING,
+		POSITIONING_CASCADE_GROUP,
+		POSITIONING_CENTERED,
+		POSITIONING_SPECIFIED,
+		POSITIONING_COUNT
 	};
 }
 
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index e144b68f5eb..7729e855ba5 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -96,7 +96,7 @@ LLFloater* LLFloaterReg::getLastFloaterCascading()
 		{
 			LLFloater* inst = *iter;
 
-			if (inst->getVisible() && inst->isPositioning(LLFloaterEnums::OPEN_POSITIONING_CASCADING))
+			if (inst->getVisible() && inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING))
 			{
 				if (candidate_rect.mTop > inst->getRect().mTop)
 				{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b1b6abe723e..9a9f8fd0132 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2170,6 +2170,8 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 
 		LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width);
 		LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height);
+
+		LLLayoutStack::updateClass();
 	}
 }
 
-- 
GitLab


From 6113f7fb9798b4ba74f6448234bfdb73a2e30719 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 24 Feb 2012 16:59:28 -0800
Subject: [PATCH 828/933] ignore *.rej files generated by patch

---
 .hgignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgignore b/.hgignore
index 403b73df6d2..bc3020eee47 100644
--- a/.hgignore
+++ b/.hgignore
@@ -67,3 +67,4 @@ glob:indra/newview/filters.xml
 glob:indra/newview/avatar_icons_cache.txt
 glob:indra/newview/avatar_lad.log
 glob:*.diff
+*.rej
-- 
GitLab


From 4e24022b8c4d080602014b1ebd8260f0cea527c5 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 27 Feb 2012 15:54:41 +0200
Subject: [PATCH 829/933] EXP-1305 FIXED Prevent avatar from walking after
 double-clicking the title bar.

---
 indra/llwindow/llwindowwin32.cpp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 2910c3995a1..9aef25491b1 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1811,6 +1811,10 @@ static LLFastTimer::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse");
 
 LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param)
 {
+	// Ignore clicks not originated in the client area, i.e. mouse-up events not preceded with a WM_LBUTTONDOWN.
+	// This helps prevent avatar walking after maximizing the window by double-clicking the title bar.
+	static bool sHandleLeftMouseUp = true;
+
 	LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA);
 
 
@@ -2157,10 +2161,20 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			window_imp->handleUnicodeUTF16((U16)w_param, gKeyboard->currentMask(FALSE));
 			return 0;
 
+		case WM_NCLBUTTONDOWN:
+			{
+				window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_NCLBUTTONDOWN");
+				// A click in a non-client area, e.g. title bar or window border.
+				sHandleLeftMouseUp = false;
+			}
+			break;
+
 		case WM_LBUTTONDOWN:
 			{
 				window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDOWN");
 				LLFastTimer t2(FTM_MOUSEHANDLER);
+				sHandleLeftMouseUp = true;
+
 				if (LLWinImm::isAvailable() && window_imp->mPreeditor)
 				{
 					window_imp->interruptLanguageTextInput();
@@ -2225,6 +2239,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			{
 				window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONUP");
 				LLFastTimer t2(FTM_MOUSEHANDLER);
+
+				if (!sHandleLeftMouseUp)
+				{
+					sHandleLeftMouseUp = true;
+					break;
+				}
+
 				//if (gDebugClicks)
 				//{
 				//	LL_INFOS("Window") << "WndProc left button up" << LL_ENDL;
-- 
GitLab


From 8024727d4546c07b723d1129651c189f7d2f28e3 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 27 Feb 2012 11:26:08 -0800
Subject: [PATCH 830/933] EXP-1832 WIP Viewer Size not persistent across logins
 fixed not unmaximizing properly on Windows put in error logging on Mac

---
 indra/llwindow/llwindowmacosx.cpp | 20 ++++++++++++++++----
 indra/llwindow/llwindowwin32.cpp  |  9 +++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index a998d1f877b..fef5f4da3b3 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1271,10 +1271,22 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size)
 	Rect client_rect;
 	if (mWindow && GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr)
 	{
-		client_rect.right = client_rect.left + size.mX;
-		client_rect.bottom = client_rect.top + size.mY;
-		OSStatus err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect);
-		return err == noErr;
+		OSStatus err = getWindowBounds(mWindow, kWindowContentRgn, &client_rect);
+		if (err == noErr)
+		{
+			client_rect.right = client_rect.left + size.mX;
+			client_rect.bottom = client_rect.top + size.mY;
+			err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect);
+		}
+		if (err == noErr)
+		{
+			return TRUE;
+		}
+		else
+		{
+			llinfos << "Error setting size" << err << llendl;
+			return FALSE;
+		}
 	}
 	return FALSE;
 }
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 9aef25491b1..bc85acbf459 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -872,6 +872,15 @@ BOOL LLWindowWin32::setSizeImpl(const LLCoordScreen size)
 		return FALSE;
 	}
 
+	WINDOWPLACEMENT placement;
+	placement.length = sizeof(WINDOWPLACEMENT);
+
+	if (!GetWindowPlacement(mWindowHandle, &placement)) return FALSE;
+
+	placement.showCmd = SW_RESTORE;
+
+	if (!SetWindowPlacement(mWindowHandle, &placement)) return FALSE;
+
 	moveWindow(position, size);
 	return TRUE;
 }
-- 
GitLab


From fbfad41587a8ba723348eb848a7366f02da87052 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 27 Feb 2012 13:06:10 -0800
Subject: [PATCH 831/933] EXP-1181 FIX As a designer, I would like to specify
 default floater positions using relative coordinates store and load floater
 relative positions

---
 indra/llui/llfloater.cpp    | 96 ++++++++++++++++++++++---------------
 indra/llui/llfloater.h      |  7 ++-
 indra/llui/llfloaterreg.cpp | 37 ++++++++++++--
 indra/llui/llfloaterreg.h   |  4 +-
 4 files changed, 97 insertions(+), 47 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 65bd63a187e..b23230bdd43 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -543,10 +543,18 @@ LLFloater::~LLFloater()
 
 void LLFloater::storeRectControl()
 {
-	if( mRectControl.size() > 1 )
+	if (!mRectControl.empty())
 	{
 		getControlGroup()->setRect( mRectControl, getRect() );
 	}
+	if (!mPosXControl.empty() && mPositioning == LLFloaterEnums::POSITIONING_RELATIVE)
+	{
+		getControlGroup()->setF32( mPosXControl, mPosition.mX );
+	}
+	if (!mPosYControl.empty() && mPositioning == LLFloaterEnums::POSITIONING_RELATIVE)
+	{
+		getControlGroup()->setF32( mPosYControl, mPosition.mY );
+	}
 }
 
 void LLFloater::storeVisibilityControl()
@@ -565,23 +573,6 @@ void LLFloater::storeDockStateControl()
 	}
 }
 
-LLRect LLFloater::getSavedRect() const
-{
-	LLRect rect;
-
-	if (mRectControl.size() > 1)
-	{
-		rect = getControlGroup()->getRect(mRectControl);
-	}
-
-	return rect;
-}
-
-bool LLFloater::hasSavedRect() const
-{
-	return !getSavedRect().isEmpty();
-}
-
 // static
 std::string LLFloater::getControlName(const std::string& name, const LLSD& key)
 {
@@ -875,18 +866,39 @@ bool LLFloater::applyRectControl()
 		mRectControl.clear();
 		mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP;
 	}
-	else if (mRectControl.size() > 1)
+	else
 	{
-		// If we have a saved rect, use it
-		const LLRect& rect = getControlGroup()->getRect(mRectControl);
-		saved_rect = rect.notEmpty();
-		if (saved_rect)
+		if (!mRectControl.empty())
 		{
-			setOrigin(rect.mLeft, rect.mBottom);
+			// If we have a saved rect, use it
+			const LLRect& rect = getControlGroup()->getRect(mRectControl);
+			if (rect.notEmpty()) saved_rect = true;
+			if (saved_rect)
+			{
+				setOrigin(rect.mLeft, rect.mBottom);
 
-			if (mResizable)
+				if (mResizable)
+				{
+					reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight()));
+				}
+			}
+		}
+
+		if (!mPosXControl.empty() && !mPosYControl.empty())
+		{
+			LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
+			LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl);
+			if (x_control.notNull() 
+				&& y_control.notNull()
+				&& !x_control->isDefault()
+				&& !y_control->isDefault())
 			{
-				reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight()));
+				mPosition.mX = x_control->getValue().asReal();
+				mPosition.mY = y_control->getValue().asReal();
+				mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
+				applyRelativePosition();
+
+				saved_rect = true;
 			}
 		}
 	}
@@ -949,14 +961,8 @@ void LLFloater::applyPositioning(LLFloater* other)
 
 	case LLFloaterEnums::POSITIONING_RELATIVE:
 		{
-			LLRect snap_rect = gFloaterView->getSnapRect();
-			LLRect floater_view_screen_rect = gFloaterView->calcScreenRect();
-			snap_rect.translate(floater_view_screen_rect.mLeft, floater_view_screen_rect.mBottom);
-			LLRect floater_screen_rect = calcScreenRect();
+			applyRelativePosition();
 
-			LLCoordGL new_center = mPosition.convert();
-			LLCoordGL cur_center(floater_screen_rect.getCenterX(), floater_screen_rect.getCenterY());
-			translate(new_center.mX - cur_center.mX, new_center.mY - cur_center.mY);
 			break;
 		}
 	default:
@@ -1630,7 +1636,7 @@ void LLFloater::onClickTearOff(LLFloater* self)
 		self->openFloater(self->getKey());
 		
 		// only force position for floaters that don't have that data saved
-		if (self->mRectControl.size() <= 1)
+		if (self->mRectControl.empty())
 		{
 			new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - floater_header_size - 5, self->getRect().getWidth(), self->getRect().getHeight());
 			self->setRect(new_rect);
@@ -2918,9 +2924,11 @@ void LLFloater::setInstanceName(const std::string& name)
 		std::string ctrl_name = getControlName(mInstanceName, mKey);
 
 		// save_rect and save_visibility only apply to registered floaters
-		if (!mRectControl.empty())
+		if (mSaveRect)
 		{
 			mRectControl = LLFloaterReg::declareRectControl(ctrl_name);
+			mPosXControl = LLFloaterReg::declarePosXControl(ctrl_name);
+			mPosYControl = LLFloaterReg::declarePosYControl(ctrl_name);
 		}
 		if (!mVisibilityControl.empty())
 		{
@@ -3001,10 +3009,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
 
 	mPositioning = p.positioning;
 
-	if (p.save_rect && mRectControl.empty())
-	{
-		mRectControl = "t"; // flag to build mRectControl name once mInstanceName is set
-	}
+	mSaveRect = p.save_rect;
 	if (p.save_visibility)
 	{
 		mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set
@@ -3283,6 +3288,19 @@ void LLFloater::stackWith(LLFloater& other)
 	other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
 }
 
+void LLFloater::applyRelativePosition()
+{
+	LLRect snap_rect = gFloaterView->getSnapRect();
+	LLRect floater_view_screen_rect = gFloaterView->calcScreenRect();
+	snap_rect.translate(floater_view_screen_rect.mLeft, floater_view_screen_rect.mBottom);
+	LLRect floater_screen_rect = calcScreenRect();
+
+	LLCoordGL new_center = mPosition.convert();
+	LLCoordGL cur_center(floater_screen_rect.getCenterX(), floater_screen_rect.getCenterY());
+	translate(new_center.mX - cur_center.mX, new_center.mY - cur_center.mY);
+}
+
+
 LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater)
 :	coord_t(x, y)
 {
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 48dc290a930..4aa663d57e3 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -269,8 +269,6 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	BOOL			isResizable() const				{ return mResizable; }
 	void			setResizeLimits( S32 min_width, S32 min_height );
 	void			getResizeLimits( S32* min_width, S32* min_height ) { *min_width = mMinWidth; *min_height = mMinHeight; }
-	LLRect			getSavedRect() const;
-	bool			hasSavedRect() const;
 
 	static std::string		getControlName(const std::string& name, const LLSD& key);
 	static LLControlGroup*	getControlGroup();
@@ -361,6 +359,8 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	virtual bool	applyRectControl();
 	bool			applyDockState();
 	void			applyPositioning(LLFloater* other);
+	void			applyRelativePosition();
+
 	void			storeRectControl();
 	void			storeVisibilityControl();
 	void			storeDockStateControl();
@@ -424,7 +424,10 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	commit_signal_t* mMinimizeSignal;
 
 protected:
+	bool			mSaveRect;
 	std::string		mRectControl;
+	std::string		mPosXControl;
+	std::string		mPosYControl;
 	std::string		mVisibilityControl;
 	std::string		mDocStateControl;
 	LLSD			mKey;				// Key used for retrieving instances; set (for now) by LLFLoaterReg
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index 7729e855ba5..ef55e741660 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -358,9 +358,7 @@ void LLFloaterReg::restoreVisibleInstances()
 //static
 std::string LLFloaterReg::getRectControlName(const std::string& name)
 {
-	std::string res = std::string("floater_rect_") + name;
-	LLStringUtil::replaceChar( res, ' ', '_' );
-	return res;
+	return std::string("floater_rect_") + getBaseControlName(name);
 }
 
 //static
@@ -368,19 +366,48 @@ std::string LLFloaterReg::declareRectControl(const std::string& name)
 {
 	std::string controlname = getRectControlName(name);
 	LLFloater::getControlGroup()->declareRect(controlname, LLRect(),
-												 llformat("Window Position and Size for %s", name.c_str()),
+												 llformat("Window Size for %s", name.c_str()),
 												 TRUE);
 	return controlname;
 }
 
+std::string LLFloaterReg::declarePosXControl(const std::string& name)
+{
+	std::string controlname = std::string("floater_pos_x_") + getBaseControlName(name);
+	LLFloater::getControlGroup()->declareF32(controlname, 
+											10.f,
+											llformat("Window X Position for %s", name.c_str()),
+											TRUE);
+	return controlname;
+}
+
+std::string LLFloaterReg::declarePosYControl(const std::string& name)
+{
+	std::string controlname = std::string("floater_pos_y_") + getBaseControlName(name);
+	LLFloater::getControlGroup()->declareF32(controlname,
+											10.f,
+											llformat("Window Y Position for %s", name.c_str()),
+											TRUE);
+
+	return controlname;
+}
+
+
 //static
 std::string LLFloaterReg::getVisibilityControlName(const std::string& name)
 {
-	std::string res = std::string("floater_vis_") + name;
+	return std::string("floater_vis_") + getBaseControlName(name);
+}
+
+//static 
+std::string LLFloaterReg::getBaseControlName(const std::string& name)
+{
+	std::string res(name);
 	LLStringUtil::replaceChar( res, ' ', '_' );
 	return res;
 }
 
+
 //static
 std::string LLFloaterReg::declareVisibilityControl(const std::string& name)
 {
diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h
index 534cf8b40ab..a1e1f8a9883 100644
--- a/indra/llui/llfloaterreg.h
+++ b/indra/llui/llfloaterreg.h
@@ -115,9 +115,11 @@ class LLFloaterReg
 	// Control Variables
 	static std::string getRectControlName(const std::string& name);
 	static std::string declareRectControl(const std::string& name);
+	static std::string declarePosXControl(const std::string& name);
+	static std::string declarePosYControl(const std::string& name);
 	static std::string getVisibilityControlName(const std::string& name);
 	static std::string declareVisibilityControl(const std::string& name);
-
+	static std::string getBaseControlName(const std::string& name);
 	static std::string declareDockStateControl(const std::string& name);
 	static std::string getDockStateControlName(const std::string& name);
 
-- 
GitLab


From 874a67776bb2e0ec3f0d5c79cae570830da91d56 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 27 Feb 2012 14:02:09 -0800
Subject: [PATCH 832/933] fix for mac build

---
 indra/llwindow/llwindowmacosx.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index fef5f4da3b3..32bb84cba59 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1269,9 +1269,9 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordScreen size)
 BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size)
 {
 	Rect client_rect;
-	if (mWindow && GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr)
+	if (mWindow)
 	{
-		OSStatus err = getWindowBounds(mWindow, kWindowContentRgn, &client_rect);
+		OSStatus err = GetWindowBounds(mWindow, kWindowContentRgn, &client_rect);
 		if (err == noErr)
 		{
 			client_rect.right = client_rect.left + size.mX;
-- 
GitLab


From 523f94cca97c9345277c33b030160adc19539ba3 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 27 Feb 2012 17:15:35 -0600
Subject: [PATCH 833/933] SH-2889 Fix for crash when encountering certain
 attachments.

---
 indra/llcharacter/llcharacter.h    |  2 +-
 indra/newview/lldrawpoolavatar.cpp |  2 ++
 indra/newview/llvoavatar.cpp       | 13 +++++++++----
 indra/newview/llvoavatar.h         |  4 ++--
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index e81a27c2bc1..3ebb2bffb04 100644
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -126,7 +126,7 @@ class LLCharacter
 
 	virtual void addDebugText( const std::string& text ) = 0;
 
-	virtual const LLUUID&	getID() = 0;
+	virtual const LLUUID&	getID() const = 0;
 	//-------------------------------------------------------------------------
 	// End Interface
 	//-------------------------------------------------------------------------
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index b002c11af52..0103373fd21 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1138,6 +1138,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 		return;
 	}
 
+	llassert(LLPipeline::sImpostorRender || !avatarp->isVisuallyMuted());
+
 	/*if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview,  3=morph view
 	{
 		gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f));
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index bc7f5a9744a..7cbb47100d5 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3365,7 +3365,7 @@ void LLVOAvatar::slamPosition()
 	mRoot.updateWorldMatrixChildren();
 }
 
-bool LLVOAvatar::isVisuallyMuted()
+bool LLVOAvatar::isVisuallyMuted() const
 {
 	static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit");
 	static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit");
@@ -3434,7 +3434,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 	// the rest should only be done occasionally for far away avatars
 	//--------------------------------------------------------------------
 
-	if (visible && !isSelf() && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter)
+	if (visible && (!isSelf() || isVisuallyMuted()) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter)
 	{
 		const LLVector4a* ext = mDrawable->getSpatialExtents();
 		LLVector4a size;
@@ -3474,6 +3474,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 
 		visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE;
 	}
+	else
+	{
+		mUpdatePeriod = 1;
+	}
+
 
 	// don't early out for your own avatar, as we rely on your animations playing reliably
 	// for example, the "turn around" animation when entering customize avatar needs to trigger
@@ -5029,7 +5034,7 @@ void LLVOAvatar::addDebugText(const std::string& text)
 //-----------------------------------------------------------------------------
 // getID()
 //-----------------------------------------------------------------------------
-const LLUUID& LLVOAvatar::getID()
+const LLUUID& LLVOAvatar::getID() const
 {
 	return mID;
 }
@@ -8296,7 +8301,7 @@ void LLVOAvatar::updateImpostors()
 
 BOOL LLVOAvatar::isImpostor() const
 {
-	return (sUseImpostors && mUpdatePeriod >= IMPOSTOR_PERIOD) ? TRUE : FALSE;
+	return (isVisuallyMuted() || (sUseImpostors && mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE;
 }
 
 
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index dd0317f555d..6a4e09593c1 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -185,7 +185,7 @@ class LLVOAvatar :
 	void					resetSpecificJointPosition( const std::string& name );
 	
 	virtual const char*		getAnimationPrefix() { return "avatar"; }
-	virtual const LLUUID&   getID();
+	virtual const LLUUID&   getID() const;
 	virtual LLVector3		getVolumePos(S32 joint_index, LLVector3& volume_offset);
 	virtual LLJoint*		findCollisionVolume(U32 volume_id);
 	virtual S32				getCollisionVolumeID(std::string &name);
@@ -382,7 +382,7 @@ class LLVOAvatar :
 
 public:
 	U32 		renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
-	bool		isVisuallyMuted();
+	bool		isVisuallyMuted() const;
 
 	U32 		renderRigid();
 	U32 		renderSkinned(EAvatarRenderPass pass);
-- 
GitLab


From ddbac6dbe42b02775d57bd7a9ac82f9b7920559b Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 28 Feb 2012 17:21:52 +0200
Subject: [PATCH 834/933] EXP-1633 FIXED Updated llqtwebkit package for Linux
 and WebKitLibPlugin build configuration.

---
 autobuild.xml                     | 4 ++--
 indra/cmake/WebKitLibPlugin.cmake | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 9914be68678..91bc46267b9 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1218,9 +1218,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c05a33ee8b6f253b5a744596dfc3707d</string>
+              <string>f50e5f0cc880c55b3f0f7e67dc8f7221</string>
               <key>url</key>
-              <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-qt4.6-20101013.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Linux/installer/llqtwebkit-4.7.1-linux-20120228.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
diff --git a/indra/cmake/WebKitLibPlugin.cmake b/indra/cmake/WebKitLibPlugin.cmake
index 91b49e75d73..d9df78bfc8f 100644
--- a/indra/cmake/WebKitLibPlugin.cmake
+++ b/indra/cmake/WebKitLibPlugin.cmake
@@ -70,9 +70,10 @@ elseif (LINUX)
         QtNetwork
         QtGui
         QtCore
-        qgif
-        qjpeg
-        jpeg
+        jscore
+#        qgif
+#        qjpeg
+#        jpeg
         fontconfig
         X11
         Xrender
-- 
GitLab


From 229c00ab2a6e1708db10e893b8c2241a0b3e178a Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 28 Feb 2012 22:46:48 +0200
Subject: [PATCH 835/933] Updated llqtwebkit install URLs for Mac and Win.

---
 autobuild.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 91bc46267b9..0e4b81324a8 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1206,9 +1206,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>26aa7c367ffadd573f61a6a96f820f80</string>
+              <string>4a98d727561cd1f4ac5ee02907411df1</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245988/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111201.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20120228.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1230,9 +1230,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>270db8568a0c4bab266d98e1a820aec4</string>
+              <string>5e3cd6af397e853a963a6de40d440ff4</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/245988/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111201.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20120228.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
GitLab


From 1effb12705d9e85c8fbea45177b2cdb9be1f9bed Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 28 Feb 2012 12:50:10 -0800
Subject: [PATCH 836/933] EXP-1888 FIX Update text for emtpy Received Items
 folder in the Viewer

---
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c82f99ffe6e..4bc72be49b9 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2037,7 +2037,7 @@ Returns a string with the requested data about the region
 	<string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string>
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
-	<string name="InventoryInboxNoItems">Certain items you receive, such as Marketplace purchases and objects shared with you in world, will appear here. You may then drag them into your inventory to use them.</string>
+	<string name="InventoryInboxNoItems">Your Marketplace purchases will appear here. You may then drag them into your inventory to use them.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
 	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
-- 
GitLab


From 80f2548371328f6fa1936ecc03a85a09f1b19508 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 28 Feb 2012 13:45:36 -0800
Subject: [PATCH 837/933] EXP-1918 FIX Floaters that are stacked are not offset
 EXP-1919 FIX Resizing viewer window with minimized floaters can result in
 floaters appearing off screen when un-minimized

---
 indra/llui/llfloater.cpp | 44 +++++++++++++++++++++-------------------
 indra/llui/llfloater.h   |  2 +-
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index b23230bdd43..f49b4edb981 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -850,7 +850,7 @@ void LLFloater::applyControlsAndPosition(LLFloater* other)
 	{
 		if (!applyRectControl())
 		{
-			applyPositioning(other);
+			applyPositioning(other, true);
 		}
 	}
 }
@@ -919,7 +919,7 @@ bool LLFloater::applyDockState()
 	return docked;
 }
 
-void LLFloater::applyPositioning(LLFloater* other)
+void LLFloater::applyPositioning(LLFloater* other, bool on_open)
 {
 	// Otherwise position according to the positioning code
 	switch (mPositioning)
@@ -934,29 +934,30 @@ void LLFloater::applyPositioning(LLFloater* other)
 
 	case LLFloaterEnums::POSITIONING_CASCADE_GROUP:
 	case LLFloaterEnums::POSITIONING_CASCADING:
-		if (other != NULL && other != this)
+		if (on_open)
 		{
-			stackWith(*other);
-		}
-		else
-		{
-			static const U32 CASCADING_FLOATER_HOFFSET = 0;
-			static const U32 CASCADING_FLOATER_VOFFSET = 0;
+			if (other != NULL && other != this)
+			{
+				stackWith(*other);
+			}
+			else
+			{
+				static const U32 CASCADING_FLOATER_HOFFSET = 0;
+				static const U32 CASCADING_FLOATER_VOFFSET = 0;
 			
-			const LLRect& snap_rect = gFloaterView->getSnapRect();
+				const LLRect& snap_rect = gFloaterView->getSnapRect();
 
-			const S32 horizontal_offset = CASCADING_FLOATER_HOFFSET;
-			const S32 vertical_offset = snap_rect.getHeight() - CASCADING_FLOATER_VOFFSET;
+				const S32 horizontal_offset = CASCADING_FLOATER_HOFFSET;
+				const S32 vertical_offset = snap_rect.getHeight() - CASCADING_FLOATER_VOFFSET;
 
-			S32 rect_height = getRect().getHeight();
-			setOrigin(horizontal_offset, vertical_offset - rect_height);
+				S32 rect_height = getRect().getHeight();
+				setOrigin(horizontal_offset, vertical_offset - rect_height);
 
-			translate(snap_rect.mLeft, snap_rect.mBottom);
-			//translateIntoRect(snap_rect);
+				translate(snap_rect.mLeft, snap_rect.mBottom);
+			}
+			//mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
+			setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
 		}
-		mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
-		setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
-
 		break;
 
 	case LLFloaterEnums::POSITIONING_RELATIVE:
@@ -1262,6 +1263,7 @@ void LLFloater::setMinimized(BOOL minimize)
 
 		// Reshape *after* setting mMinimized
 		reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
+		applyPositioning(NULL, false);
 	}
 
 	make_ui_sound("UISndWindowClose");
@@ -2199,7 +2201,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		if (!floaterp->isMinimized() && floaterp->getCanDrag())
 		{
 			LLRect old_rect = floaterp->getRect();
-			floaterp->applyPositioning(NULL);
+			floaterp->applyPositioning(NULL, false);
 			LLRect new_rect = floaterp->getRect();
 
 			//LLRect r = floaterp->getRect();
@@ -3284,7 +3286,7 @@ void LLFloater::stackWith(LLFloater& other)
 	
 	setShape(next_rect);
 
-	other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
+	//other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
 	other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
 }
 
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 4aa663d57e3..64d6dcea044 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -358,7 +358,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 
 	virtual bool	applyRectControl();
 	bool			applyDockState();
-	void			applyPositioning(LLFloater* other);
+	void			applyPositioning(LLFloater* other, bool on_open);
 	void			applyRelativePosition();
 
 	void			storeRectControl();
-- 
GitLab


From 353907bac61e6db0aca16e7e43f13f627b414dca Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 28 Feb 2012 16:10:04 -0600
Subject: [PATCH 838/933] SH-2908 Fix for incompatibility issue with GLSL 1.30

---
 indra/llrender/llshadermgr.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index b28a97adaa3..7d384450e67 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -640,11 +640,15 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 
 		//backwards compatibility with legacy texture lookup syntax
 		text[count++] = strdup("#define texture2D texture\n");
-		text[count++] = strdup("#define texture2DRect texture\n");
 		text[count++] = strdup("#define textureCube texture\n");
 		text[count++] = strdup("#define texture2DLod textureLod\n");
 		text[count++] = strdup("#define	shadow2D(a,b) vec2(texture(a,b))\n");
-		text[count++] = strdup("#define shadow2DRect(a,b) vec2(texture(a,b))\n");
+
+		if (major_version > 1 || minor_version >= 40)
+		{ //GLSL 1.40 replaces texture2DRect et al with texture
+			text[count++] = strdup("#define texture2DRect texture\n");
+			text[count++] = strdup("#define shadow2DRect(a,b) vec2(texture(a,b))\n");
+		}
 	}
 
 	//copy preprocessor definitions into buffer
-- 
GitLab


From 302f4085a5f9fd7b5267fd573a8e15f890cfe573 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 28 Feb 2012 16:35:50 -0600
Subject: [PATCH 839/933] SH-2908 Reset graphics drivers to "low" if viewer
 crashes when allocating deferred rendering targets.

---
 indra/newview/pipeline.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d5bcfe12abe..e2cb22e3075 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -811,6 +811,10 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 
 	if (LLPipeline::sRenderDeferred)
 	{
+		// Set this flag in case we crash while resizing window or allocating space for deferred rendering targets
+		gSavedSettings.setBOOL("RenderInitError", TRUE);
+		gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
+
 		S32 shadow_detail = RenderShadowDetail;
 		BOOL ssao = RenderDeferredSSAO;
 		
@@ -872,6 +876,10 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
 				mShadow[i].release();
 			}
 		}
+
+		// don't disable shaders on next session
+		gSavedSettings.setBOOL("RenderInitError", FALSE);
+		gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
 	}
 	else
 	{
-- 
GitLab


From 66f101bac591d82b71ab7dc976b6fed0ed451909 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 29 Feb 2012 13:46:39 -0800
Subject: [PATCH 840/933] added dummy file to assist in forcing tc builds

---
 indra/edit-me-to-trigger-new-build.txt | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 indra/edit-me-to-trigger-new-build.txt

diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt
new file mode 100644
index 00000000000..e69de29bb2d
-- 
GitLab


From bc7771a415ee6d8e10b529a3ea535b00d5666b75 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 29 Feb 2012 15:08:06 -0800
Subject: [PATCH 841/933] Added tag 3.3.0-start for changeset d5f263687f43

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5b9726b47cd..e994e188e7d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -269,3 +269,4 @@ e9c82fca5ae6fb8a8af29012d78fb194a29323f3 3.2.9-beta1
 a01ef9bed28627f4ca543fbc1d70c79cc297a90f DRTVWR-118_3.2.9-beta2
 a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
+d5f263687f43f278107363365938f0a214920a4b 3.3.0-start
-- 
GitLab


From ca36a06d2e994178cecfae249f7f1cc3af3554a0 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 29 Feb 2012 15:08:57 -0800
Subject: [PATCH 842/933] increment viewer version to 3.3.1

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index a869c74189b..26ff1b5c553 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 3;
-const S32 LL_VERSION_PATCH = 0;
+const S32 LL_VERSION_PATCH = 1;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From 739532ee4ffdd58f9d0999901340d5476533fec2 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 1 Mar 2012 12:41:27 -0800
Subject: [PATCH 843/933] Added tag DRTVWR-113_3.2.8-release, 3.2.8-release for
 changeset 51b2fd52e36a

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 8b381a88a50..77446bee307 100644
--- a/.hgtags
+++ b/.hgtags
@@ -263,3 +263,5 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release
 16f8e2915f3f2e4d732fb3125daf229cb0fd1875 3.2.8-beta1
 987425b1acf4752379b2e1eb20944b4b35d67a85 DRTVWR-115_3.2.8-beta2
 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
+51b2fd52e36aab8f670e0874e7e1472434ec4b4a DRTVWR-113_3.2.8-release
+51b2fd52e36aab8f670e0874e7e1472434ec4b4a 3.2.8-release
-- 
GitLab


From 6b0f0a89fd6a8285f91c13699327182f513efbd5 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 1 Mar 2012 13:23:01 -0800
Subject: [PATCH 844/933] CHUI-55 FIX Floaters that have set positions from old
 viewer versions can appear off screen until user repositions the floaters
 manually

---
 indra/llui/llfloater.cpp | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index f49b4edb981..d058b4ae446 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -884,22 +884,24 @@ bool LLFloater::applyRectControl()
 			}
 		}
 
-		if (!mPosXControl.empty() && !mPosYControl.empty())
-		{
-			LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
-			LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl);
-			if (x_control.notNull() 
-				&& y_control.notNull()
-				&& !x_control->isDefault()
-				&& !y_control->isDefault())
-			{
-				mPosition.mX = x_control->getValue().asReal();
-				mPosition.mY = y_control->getValue().asReal();
-				mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
-				applyRelativePosition();
+		LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
+		LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl);
+		if (x_control.notNull() 
+			&& y_control.notNull()
+			&& !x_control->isDefault()
+			&& !y_control->isDefault())
+		{
+			mPosition.mX = x_control->getValue().asReal();
+			mPosition.mY = y_control->getValue().asReal();
+			mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
+			applyRelativePosition();
 
-				saved_rect = true;
-			}
+			saved_rect = true;
+		}
+		else
+		{
+			LLRect screen_rect = calcScreenRect();
+			mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
 		}
 	}
 
@@ -929,7 +931,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open)
 		break;
 
 	case LLFloaterEnums::POSITIONING_SPECIFIED:
-		//translateIntoRect(gFloaterView->getSnapRect());
 		break;
 
 	case LLFloaterEnums::POSITIONING_CASCADE_GROUP:
@@ -955,7 +956,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open)
 
 				translate(snap_rect.mLeft, snap_rect.mBottom);
 			}
-			//mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
 			setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
 		}
 		break;
-- 
GitLab


From 1d200c56e151eb8fc384693175d1b9318ff0f919 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 1 Mar 2012 14:21:57 -0800
Subject: [PATCH 845/933] sync with viewer-development

---
 .../skins/default/xui/en/floater_merchant_outbox.xml   | 10 +++++-----
 indra/newview/skins/default/xui/en/menu_viewer.xml     |  7 +++++++
 .../skins/default/xui/en/sidepanel_inventory.xml       |  2 +-
 indra/newview/skins/default/xui/en/strings.xml         |  2 +-
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 498a9b6ce09..6f387f4800b 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -132,16 +132,16 @@
     </panel>
     <layout_stack name="import_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false">
       <layout_panel />
-      <layout_panel height="45" auto_resize="false">
-        <layout_stack orientation="horizontal" left="0" height="45" top="0" width="333" follows="all">
+      <layout_panel height="24" auto_resize="false">
+        <layout_stack orientation="horizontal" left="0" height="24" top="0" width="333" follows="all">
           <layout_panel width="0" />
-          <layout_panel width="45" auto_resize="false">
+          <layout_panel width="24" auto_resize="false">
             <loading_indicator
-                height="45"
+                height="24"
                 layout="topleft"
                 left="0"
                 top="0"
-                width="45" />
+                width="24" />
           </layout_panel>
           <layout_panel width="0" />
         </layout_stack>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index cd8550b00db..1d11abcf73e 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -152,6 +152,13 @@
         <menu_item_call.on_click
          function="BuyCurrency" />
       </menu_item_call>
+      <menu_item_call
+         label="Merchant Outbox..."
+         name="MerchantOutbox">
+        <menu_item_call.on_click
+         function="Floater.ToggleOrBringToFront"
+         parameter="outbox" />
+      </menu_item_call>
       <menu_item_call
            label="Account dashboard..."
            name="Manage My Account">
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index fcba937bdbb..29aa6d10395 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -112,7 +112,7 @@
                         bg_opaque_color="InventoryBackgroundColor"
                         background_visible="true"
                         background_opaque="true"
-                        tool_tip="Drag and drop items to your inventory to manage and use them"
+                        tool_tip="Drag and drop items to your inventory to use them"
                         >
                         <text
 							name="inbox_inventory_placeholder"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3351ffe00fb..4bc72be49b9 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2037,7 +2037,7 @@ Returns a string with the requested data about the region
 	<string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string>
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
-	<string name="InventoryInboxNoItems">Certain items you receive, such as premium gifts, will appear here.  You may then drag them into your inventory.</string>
+	<string name="InventoryInboxNoItems">Your Marketplace purchases will appear here. You may then drag them into your inventory to use them.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
 	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
-- 
GitLab


From f0a1b43f2270cb8424409babf5ae88233cdd8f6c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 1 Mar 2012 21:35:05 -0800
Subject: [PATCH 846/933] EXP-1841 : Use instance instead of getInstance on
 LLClipboard singleton.

---
 indra/llui/llclipboard.h                 |  2 +-
 indra/llui/lllineeditor.cpp              | 12 ++++-----
 indra/llui/llscrolllistctrl.cpp          |  2 +-
 indra/llui/lltexteditor.cpp              | 12 ++++-----
 indra/newview/llfavoritesbar.cpp         | 10 ++++----
 indra/newview/llfloatergesture.cpp       | 14 +++++------
 indra/newview/llfolderview.cpp           | 10 ++++----
 indra/newview/llinventorybridge.cpp      | 32 ++++++++++++------------
 indra/newview/llinventoryfilter.cpp      |  4 +--
 indra/newview/llinventorypanel.cpp       |  8 +++---
 indra/newview/llpanelteleporthistory.cpp |  2 +-
 indra/newview/llpaneltopinfobar.cpp      |  2 +-
 indra/newview/llpanelwearing.cpp         |  2 +-
 indra/newview/llurllineeditorctrl.cpp    |  2 +-
 14 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 3947fa02296..e8a4f64035b 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -42,7 +42,7 @@ typedef boost::function<void ()> cleanup_callback_t;
 // Class LLClipboard
 //
 // This class is used to cut/copy/paste text strings and inventory items around 
-// the world. Use LLClipboard::getInstance()->method() to use its methods.
+// the world. Use LLClipboard::instance().method() to use its methods.
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 class LLClipboard : public LLSingleton<LLClipboard>
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index ff85afdf252..d0fbf4b9137 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1047,7 +1047,7 @@ void LLLineEditor::cut()
 		// Prepare for possible rollback
 		LLLineEditorRollback rollback( this );
 
-		LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length );
+		LLClipboard::instance().copyToClipboard( mText.getWString(), left_pos, length );
 		deleteSelection();
 
 		// Validate new string and rollback the if needed.
@@ -1078,13 +1078,13 @@ void LLLineEditor::copy()
 	{
 		S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 		S32 length = llabs( mSelectionStart - mSelectionEnd );
-		LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length );
+		LLClipboard::instance().copyToClipboard( mText.getWString(), left_pos, length );
 	}
 }
 
 BOOL LLLineEditor::canPaste() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(); 
+	return !mReadOnly && LLClipboard::instance().isTextAvailable(); 
 }
 
 void LLLineEditor::paste()
@@ -1115,7 +1115,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
 	if (can_paste_it)
 	{
 		LLWString paste;
-		LLClipboard::getInstance()->pasteFromClipboard(paste, is_primary);
+		LLClipboard::instance().pasteFromClipboard(paste, is_primary);
 
 		if (!paste.empty())
 		{
@@ -1202,13 +1202,13 @@ void LLLineEditor::copyPrimary()
 	{
 		S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 		S32 length = llabs( mSelectionStart - mSelectionEnd );
-		LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length, true);
+		LLClipboard::instance().copyToClipboard( mText.getWString(), left_pos, length, true);
 	}
 }
 
 BOOL LLLineEditor::canPastePrimary() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(true); 
+	return !mReadOnly && LLClipboard::instance().isTextAvailable(true); 
 }
 
 void LLLineEditor::updatePrimary()
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 0a9d862b66c..b3e1b63db58 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -2504,7 +2504,7 @@ void	LLScrollListCtrl::copy()
 	{
 		buffer += (*itor)->getContentsCSV() + "\n";
 	}
-	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(buffer), 0, buffer.length());
+	LLClipboard::instance().copyToClipboard(utf8str_to_wstring(buffer), 0, buffer.length());
 }
 
 // virtual
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 141602ad2e4..9720dded6c6 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1332,7 +1332,7 @@ void LLTextEditor::cut()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	LLClipboard::getInstance()->copyToClipboard( getWText(), left_pos, length);
+	LLClipboard::instance().copyToClipboard( getWText(), left_pos, length);
 	deleteSelection( FALSE );
 
 	onKeyStroke();
@@ -1352,12 +1352,12 @@ void LLTextEditor::copy()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	LLClipboard::getInstance()->copyToClipboard(getWText(), left_pos, length);
+	LLClipboard::instance().copyToClipboard(getWText(), left_pos, length);
 }
 
 BOOL LLTextEditor::canPaste() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable();
+	return !mReadOnly && LLClipboard::instance().isTextAvailable();
 }
 
 // paste from clipboard
@@ -1394,7 +1394,7 @@ void LLTextEditor::pasteHelper(bool is_primary)
 	}
 
 	LLWString paste;
-	LLClipboard::getInstance()->pasteFromClipboard(paste, is_primary);
+	LLClipboard::instance().pasteFromClipboard(paste, is_primary);
 
 	if (paste.empty())
 	{
@@ -1467,12 +1467,12 @@ void LLTextEditor::copyPrimary()
 	}
 	S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
 	S32 length = llabs( mSelectionStart - mSelectionEnd );
-	LLClipboard::getInstance()->copyToClipboard(getWText(), left_pos, length, true);
+	LLClipboard::instance().copyToClipboard(getWText(), left_pos, length, true);
 }
 
 BOOL LLTextEditor::canPastePrimary() const
 {
-	return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(true);
+	return !mReadOnly && LLClipboard::instance().isTextAvailable(true);
 }
 
 void LLTextEditor::updatePrimary()
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index d4bce1e3a16..575b613ccfc 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1118,7 +1118,7 @@ BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
 }
 void copy_slurl_to_clipboard_cb(std::string& slurl)
 {
-	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
+	LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
 
 	LLSD args;
 	args["SLURL"] = slurl;
@@ -1187,7 +1187,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
 	}
 	else if (action == "copy")
 	{
-		LLClipboard::getInstance()->copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK);
+		LLClipboard::instance().copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK);
 	}
 	else if (action == "paste")
 	{
@@ -1211,13 +1211,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
 
 BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
 {
-	if (!LLClipboard::getInstance()->hasContents())
+	if (!LLClipboard::instance().hasContents())
 	{
 		return FALSE;
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->pasteFromClipboard(objects);
+	LLClipboard::instance().pasteFromClipboard(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -1246,7 +1246,7 @@ void LLFavoritesBarCtrl::pastFromClipboard() const
 	{
 		LLInventoryItem* item = NULL;
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->pasteFromClipboard(objects);
+		LLClipboard::instance().pasteFromClipboard(objects);
 		S32 count = objects.count();
 		LLUUID parent_id(mFavoriteFolderId);
 		for(S32 i = 0; i < count; i++)
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 7791d4688bd..56051ff6845 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -397,11 +397,11 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command)
 	std::string command_name = command.asString();
 	if("paste" == command_name)
 	{
-		if(!LLClipboard::getInstance()->hasContents())
+		if(!LLClipboard::instance().hasContents())
 			return false;
 
 		LLDynamicArray<LLUUID> ids;
-		LLClipboard::getInstance()->pasteFromClipboard(ids);
+		LLClipboard::instance().pasteFromClipboard(ids);
 		for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
 		{
 			LLInventoryItem* item = gInventory.getItem(*it);
@@ -502,20 +502,20 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 		uuid_vec_t ids;
 		getSelectedIds(ids);
 		// Make sure the clipboard is empty
-		LLClipboard::getInstance()->reset();
+		LLClipboard::instance().reset();
 		for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
 		{
 			LLInventoryItem* item = gInventory.getItem(*it);
 			if(item  && item->getInventoryType() == LLInventoryType::IT_GESTURE)
 			{
-				LLClipboard::getInstance()->addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
+				LLClipboard::instance().addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
 			}
 		}
 	}
 	else if ("paste" == command_name)
 	{
 		LLDynamicArray<LLUUID> ids;
-		LLClipboard::getInstance()->pasteFromClipboard(ids);
+		LLClipboard::instance().pasteFromClipboard(ids);
 		if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
 			return;
 		LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
@@ -535,11 +535,11 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
 						gesture_dir->getUUID(), getString("copy_name", string_args), cb);
 			}
 		}
-		LLClipboard::getInstance()->reset();
+		LLClipboard::instance().reset();
 	}
 	else if ("copy_uuid" == command_name)
 	{
-		LLClipboard::getInstance()->copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
+		LLClipboard::instance().copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
 	}
 }
 
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index c0db2e366c8..d9c6f4d9ceb 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1018,12 +1018,12 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector<LLFol
 void LLFolderView::removeCutItems()
 {
 	// There's no item in "cut" mode on the clipboard -> exit
-	if (!LLClipboard::getInstance()->isCutMode())
+	if (!LLClipboard::instance().isCutMode())
 		return;
 
 	// Get the list of clipboard item uuids and iterate through them
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->pasteFromClipboard(objects);
+	LLClipboard::instance().pasteFromClipboard(objects);
 	for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 		 iter != objects.end();
 		 ++iter)
@@ -1323,7 +1323,7 @@ BOOL LLFolderView::canCopy() const
 void LLFolderView::copy()
 {
 	// *NOTE: total hack to clear the inventory clipboard
-	LLClipboard::getInstance()->reset();
+	LLClipboard::instance().reset();
 	S32 count = mSelectedItems.size();
 	if(getVisible() && getEnabled() && (count > 0))
 	{
@@ -1364,7 +1364,7 @@ BOOL LLFolderView::canCut() const
 void LLFolderView::cut()
 {
 	// clear the inventory clipboard
-	LLClipboard::getInstance()->reset();
+	LLClipboard::instance().reset();
 	S32 count = mSelectedItems.size();
 	if(getVisible() && getEnabled() && (count > 0))
 	{
@@ -2141,7 +2141,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata)
 	if (("copy" == action) || ("cut" == action))
 	{
 		// Clear the clipboard before we start adding things on it
-		LLClipboard::getInstance()->reset();
+		LLClipboard::instance().reset();
 	}
 
 	static const std::string change_folder_string = "change_folder_type_";
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d55fb6a089e..3001a998aac 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -220,8 +220,8 @@ BOOL LLInvFVBridge::cutToClipboard() const
 	const LLInventoryObject* obj = gInventory.getObject(mUUID);
 	if (obj && isItemMovable() && isItemRemovable())
 	{
-		LLClipboard::getInstance()->setCutMode(true, boost::bind(LLFolderView::removeCutItems));
-		return LLClipboard::getInstance()->addToClipboard(mUUID);
+		LLClipboard::instance().setCutMode(true, boost::bind(LLFolderView::removeCutItems));
+		return LLClipboard::instance().addToClipboard(mUUID);
 	}
 	return FALSE;
 }
@@ -231,7 +231,7 @@ BOOL LLInvFVBridge::copyToClipboard() const
 	const LLInventoryObject* obj = gInventory.getObject(mUUID);
 	if (obj && isItemCopyable())
 	{
-		return LLClipboard::getInstance()->addToClipboard(mUUID);
+		return LLClipboard::instance().addToClipboard(mUUID);
 	}
 	return FALSE;
 }
@@ -419,7 +419,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
 
 BOOL LLInvFVBridge::isClipboardPasteable() const
 {
-	if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory())
+	if (!LLClipboard::instance().hasContents() || !isAgentInventory())
 	{
 		return FALSE;
 	}
@@ -430,7 +430,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->pasteFromClipboard(objects);
+	LLClipboard::instance().pasteFromClipboard(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -457,7 +457,7 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 
 BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 {
-	if (!LLClipboard::getInstance()->hasContents() || !isAgentInventory())
+	if (!LLClipboard::instance().hasContents() || !isAgentInventory())
 	{
 		return FALSE;
 	}
@@ -468,7 +468,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
 	}
 
 	LLDynamicArray<LLUUID> objects;
-	LLClipboard::getInstance()->pasteFromClipboard(objects);
+	LLClipboard::instance().pasteFromClipboard(objects);
 	S32 count = objects.count();
 	for(S32 i = 0; i < count; i++)
 	{
@@ -643,7 +643,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 	{
 		items.push_back(std::string("Paste"));
 	}
-	if ((!LLClipboard::getInstance()->isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
+	if ((!LLClipboard::instance().isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
 	{
 		disabled_items.push_back(std::string("Paste"));
 	}
@@ -1833,7 +1833,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const
 		}
 
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->pasteFromClipboard(objects);
+		LLClipboard::instance().pasteFromClipboard(objects);
 		const LLViewerInventoryCategory *current_cat = getCategory();
 
 		// Search for the direct descendent of current Friends subfolder among all pasted items,
@@ -1871,7 +1871,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
 		const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat );
 		const LLUUID &current_cat_id = current_cat->getUUID();
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->pasteFromClipboard(objects);
+		LLClipboard::instance().pasteFromClipboard(objects);
 		S32 count = objects.count();
 		for(S32 i = 0; i < count; i++)
 		{
@@ -2910,7 +2910,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
 void LLFolderBridge::pasteFromClipboard()
 {
 	LLInventoryModel* model = getInventoryModel();
-	if (model && (isClipboardPasteable() || LLClipboard::getInstance()->isCutMode()))
+	if (model && (isClipboardPasteable() || LLClipboard::instance().isCutMode()))
 	{
 		const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
 		const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
@@ -2920,7 +2920,7 @@ void LLFolderBridge::pasteFromClipboard()
 		const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
 
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->pasteFromClipboard(objects);
+		LLClipboard::instance().pasteFromClipboard(objects);
 
 		if (move_is_into_outbox)
 		{
@@ -2980,7 +2980,7 @@ void LLFolderBridge::pasteFromClipboard()
 						dropToOutfit(item, move_is_into_current_outfit);
 					}
 				}
-				else if (LLClipboard::getInstance()->isCutMode())
+				else if (LLClipboard::instance().isCutMode())
 				{
 					// Do a move to "paste" a "cut"
 					// move_inventory_item() is not enough, as we have to update inventory locally too
@@ -3029,7 +3029,7 @@ void LLFolderBridge::pasteFromClipboard()
 			}
 		}
 		// Change mode to paste for next paste
-		LLClipboard::getInstance()->setCutMode(false);
+		LLClipboard::instance().setCutMode(false);
 	}
 }
 
@@ -3054,7 +3054,7 @@ void LLFolderBridge::pasteLinkFromClipboard()
 		const LLUUID parent_id(mUUID);
 
 		LLDynamicArray<LLUUID> objects;
-		LLClipboard::getInstance()->pasteFromClipboard(objects);
+		LLClipboard::instance().pasteFromClipboard(objects);
 		for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
 			 iter != objects.end();
 			 ++iter)
@@ -3093,7 +3093,7 @@ void LLFolderBridge::pasteLinkFromClipboard()
 			}
 		}
 		// Change mode to paste for next paste
-		LLClipboard::getInstance()->setCutMode(false);
+		LLClipboard::instance().setCutMode(false);
 	}
 }
 
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index c127d7ac88f..ccb9e74a8ef 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -322,13 +322,13 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
 // is on the clipboard must be filtered out if the clipboard is in the "cut" mode.
 bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const
 {
-	if (LLClipboard::getInstance()->isCutMode())
+	if (LLClipboard::instance().isCutMode())
 	{
 		LLUUID current_id = object_id;
 		LLInventoryObject *current_object = gInventory.getObject(object_id);
 		while (current_id.notNull() && current_object)
 		{
-			if (LLClipboard::getInstance()->isOnClipboard(current_id))
+			if (LLClipboard::instance().isOnClipboard(current_id))
 			{
 				return false;
 			}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index a1e17ffbf22..b7e2e8c67c7 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -249,7 +249,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 	}
 	
 	// keep track of the clipboard state so that we avoid filtering too much
-	mClipboardState = LLClipboard::getInstance()->getState();
+	mClipboardState = LLClipboard::instance().getState();
 	
 	// Initialize base class params.
 	LLPanel::initFromParams(params);
@@ -283,10 +283,10 @@ void LLInventoryPanel::draw()
 	mFolderRoot->updateSelection();
 	
 	// Nudge the filter if the clipboard state changed
-	if (mClipboardState != LLClipboard::getInstance()->getState())
+	if (mClipboardState != LLClipboard::instance().getState())
 	{
-		mClipboardState = LLClipboard::getInstance()->getState();
-		getFilter()->setModified(LLClipboard::getInstance()->isCutMode() ? LLInventoryFilter::FILTER_MORE_RESTRICTIVE : LLInventoryFilter::FILTER_LESS_RESTRICTIVE);
+		mClipboardState = LLClipboard::instance().getState();
+		getFilter()->setModified(LLClipboard::instance().isCutMode() ? LLInventoryFilter::FILTER_MORE_RESTRICTIVE : LLInventoryFilter::FILTER_LESS_RESTRICTIVE);
 	}
 	
 	LLPanel::draw();
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index f92fbf32205..c63d89fc981 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -358,7 +358,7 @@ void LLTeleportHistoryPanel::ContextMenu::onInfo()
 //static
 void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl)
 {
-	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
+	LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size());
 }
 
 void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 0ad207ef00a..280cc111796 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -467,7 +467,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
 		LLAgentUI::buildSLURL(slurl, false);
 		LLUIString location_str(slurl.getSLURLString());
 
-		LLClipboard::getInstance()->copyToClipboard(location_str,0,location_str.length());
+		LLClipboard::instance().copyToClipboard(location_str,0,location_str.length());
 	}
 }
 
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 5199bcb6b17..3b9934d4be3 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -302,6 +302,6 @@ void LLPanelWearing::copyToClipboard()
 		}
 	}
 
-	LLClipboard::getInstance()->copyToClipboard(utf8str_to_wstring(text),0,text.size());
+	LLClipboard::instance().copyToClipboard(utf8str_to_wstring(text),0,text.size());
 }
 // EOF
diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp
index 3efebcade97..cad57690421 100644
--- a/indra/newview/llurllineeditorctrl.cpp
+++ b/indra/newview/llurllineeditorctrl.cpp
@@ -89,5 +89,5 @@ void LLURLLineEditor::copyEscapedURLToClipboard()
 	else // human-readable location
 		text_to_copy = utf8str_to_wstring(unescaped_text);
 		
-	LLClipboard::getInstance()->copyToClipboard(text_to_copy, 0, text_to_copy.size());
+	LLClipboard::instance().copyToClipboard(text_to_copy, 0, text_to_copy.size());
 }
-- 
GitLab


From 44c66e11ccee4f8370dc9cf2a87c44e323c9c68d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 1 Mar 2012 21:57:16 -0800
Subject: [PATCH 847/933] EXP-1841 : Use std::vector instead of LLDynamicArray
 in LLClipboard.

---
 indra/llui/llclipboard.cpp | 17 +++++++++--------
 indra/llui/llclipboard.h   |  4 ++--
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index e0729366cc6..037b9cb2547 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -55,7 +55,7 @@ void LLClipboard::reset()
 		mCleanupCallback();
 	}
 	// Clear the clipboard
-	mObjects.reset();
+	mObjects.clear();
 	mCutMode = false;
 	mCleanupCallback = NULL;
 	mString = LLWString();
@@ -83,24 +83,24 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
 		}
 		if (res)
 		{
-			mObjects.put(src);
+			mObjects.push_back(src);
 			mState++;
 		}
 	}
 	return res;
 }
 
-bool LLClipboard::pasteFromClipboard(LLDynamicArray<LLUUID>& inv_objects) const
+bool LLClipboard::pasteFromClipboard(std::vector<LLUUID>& inv_objects) const
 {
 	bool res = false;
-	S32 count = mObjects.count();
+	S32 count = mObjects.size();
 	if (count > 0)
 	{
 		res = true;
-		inv_objects.reset();
+		inv_objects.clear();
 		for (S32 i = 0; i < count; i++)
 		{
-			inv_objects.put(mObjects[i]);
+			inv_objects.push_back(mObjects[i]);
 		}
 	}
 	return res;
@@ -109,13 +109,14 @@ bool LLClipboard::pasteFromClipboard(LLDynamicArray<LLUUID>& inv_objects) const
 // Returns true if the LL Clipboard has pasteable items in it
 bool LLClipboard::hasContents() const
 {
-	return (mObjects.count() > 0);
+	return (mObjects.size() > 0);
 }
 
 // Returns true if the input uuid is in the list of clipboard objects
 bool LLClipboard::isOnClipboard(const LLUUID& object) const
 {
-	return (mObjects.find(object) != LLDynamicArray<LLUUID>::FAIL);
+	std::vector<LLUUID>::const_iterator iter = std::find(mObjects.begin(), mObjects.end(), object);
+	return (iter != mObjects.end());
 }
 
 // Copy the input string to the LL and the system clipboard
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index e8a4f64035b..50b4c7cd773 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -74,7 +74,7 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	// Adds one object to the current list of objects on the clipboard
 	bool addToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);
 	// Gets a copy of the objects on the clipboard
-	bool pasteFromClipboard(LLDynamicArray<LLUUID>& inventory_objects) const;
+	bool pasteFromClipboard(std::vector<LLUUID>& inventory_objects) const;
 	
 	bool hasContents() const;										// True if the clipboard has pasteable objects
 	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard
@@ -83,7 +83,7 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mState++; }
 
 private:
-	LLDynamicArray<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
+	std::vector<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
 	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).
 	bool mCutMode;						// This is a convenience flag for the viewer. Will determine if mCleanupCallback() needs to be called.
 	cleanup_callback_t mCleanupCallback;// Function to call when the cut clipboard is being wiped out. Can be set to NULL (nothing done then).
-- 
GitLab


From a41507eef0a79731d1894ccf3179da6165f310ab Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 1 Mar 2012 23:10:06 -0800
Subject: [PATCH 848/933] EXP-1841 : change mState to mGeneration in
 LLClipboard.

---
 indra/llui/llclipboard.cpp         | 10 +++++-----
 indra/llui/llclipboard.h           |  9 ++++-----
 indra/newview/llinventorypanel.cpp |  6 +++---
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 037b9cb2547..75c197463c3 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -35,7 +35,7 @@
 #include "llwindow.h"
 
 LLClipboard::LLClipboard() :
-	mState(0)
+	mGeneration(0)
 {
 	reset();
 }
@@ -47,8 +47,8 @@ LLClipboard::~LLClipboard()
 
 void LLClipboard::reset()
 {
-	// Increment the clipboard state
-	mState++;
+	// Increment the clipboard count
+	mGeneration++;
 	// Call the cleanup function (if any) before releasing the object list
 	if (mCutMode && mCleanupCallback)
 	{
@@ -84,7 +84,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ
 		if (res)
 		{
 			mObjects.push_back(src);
-			mState++;
+			mGeneration++;
 		}
 	}
 	return res;
@@ -138,7 +138,7 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us
 	{
 		mString = mString + sep + src.substr(pos, len);
 	}
-	mState++;
+	mGeneration++;
 	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
 }
 
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 50b4c7cd773..8b5a2260aed 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -54,7 +54,7 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	// Clears the clipboard
 	void reset();
 	// Returns the state of the clipboard so client can know if it has been modified (comparing with tracked state)
-	int	getState() const { return mState; }
+	int	getGeneration() const { return mGeneration; }
 
 	// Text strings management:
 	// ------------------------
@@ -80,15 +80,14 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard
 
 	bool isCutMode() const { return mCutMode; }
-	void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mState++; }
+	void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mGeneration++; }
 
 private:
-	std::vector<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
+	std::vector<LLUUID> mObjects;		// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
 	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).
 	bool mCutMode;						// This is a convenience flag for the viewer. Will determine if mCleanupCallback() needs to be called.
 	cleanup_callback_t mCleanupCallback;// Function to call when the cut clipboard is being wiped out. Can be set to NULL (nothing done then).
-	int mState;							// Incremented when the clipboard change so that interested parties can check its state.
-	
+	int mGeneration;					// Incremented when the clipboard changes so that interested parties can check for changes on the clipboard.	
 };
 
 #endif  // LL_LLCLIPBOARD_H
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index b7e2e8c67c7..b4176898583 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -249,7 +249,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 	}
 	
 	// keep track of the clipboard state so that we avoid filtering too much
-	mClipboardState = LLClipboard::instance().getState();
+	mClipboardState = LLClipboard::instance().getGeneration();
 	
 	// Initialize base class params.
 	LLPanel::initFromParams(params);
@@ -283,9 +283,9 @@ void LLInventoryPanel::draw()
 	mFolderRoot->updateSelection();
 	
 	// Nudge the filter if the clipboard state changed
-	if (mClipboardState != LLClipboard::instance().getState())
+	if (mClipboardState != LLClipboard::instance().getGeneration())
 	{
-		mClipboardState = LLClipboard::instance().getState();
+		mClipboardState = LLClipboard::instance().getGeneration();
 		getFilter()->setModified(LLClipboard::instance().isCutMode() ? LLInventoryFilter::FILTER_MORE_RESTRICTIVE : LLInventoryFilter::FILTER_LESS_RESTRICTIVE);
 	}
 	
-- 
GitLab


From 652c67c2bcf077e580d734f68f5d9c374ed91b5d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 2 Mar 2012 17:36:59 -0800
Subject: [PATCH 849/933] EXP-1911 : Fix the filter resetting, using U64 values
 where needed.

---
 indra/newview/llinventoryfilter.cpp    | 7 +++++--
 indra/newview/llpanelmaininventory.cpp | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index ccb9e74a8ef..b5062e65b52 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -42,6 +42,8 @@
 #include "llclipboard.h"
 #include "lltrans.h"
 
+LLFastTimer::DeclareTimer FT_FILTER_CLIPBOARD("Filter Clipboard");
+
 LLInventoryFilter::FilterOps::FilterOps() :
 	mFilterObjectTypes(0xffffffffffffffffULL),
 	mFilterCategoryTypes(0xffffffffffffffffULL),
@@ -324,6 +326,7 @@ bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const
 {
 	if (LLClipboard::instance().isCutMode())
 	{
+		LLFastTimer ft(FT_FILTER_CLIPBOARD);
 		LLUUID current_id = object_id;
 		LLInventoryObject *current_object = gInventory.getObject(object_id);
 		while (current_id.notNull() && current_object)
@@ -412,7 +415,7 @@ BOOL LLInventoryFilter::isNotDefault() const
 	not_default |= (mFilterOps.mMinDate != mDefaultFilterOps.mMinDate);
 	not_default |= (mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate);
 	not_default |= (mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo);
-
+	
 	return not_default;
 }
 
@@ -998,7 +1001,7 @@ void LLInventoryFilter::fromLLSD(LLSD& data)
 {
 	if(data.has("filter_types"))
 	{
-		setFilterObjectTypes((U32)data["filter_types"].asInteger());
+		setFilterObjectTypes((U64)data["filter_types"].asInteger());
 	}
 
 	if(data.has("min_date") && data.has("max_date"))
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index c3c62920d33..c11597f5323 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -375,7 +375,7 @@ void LLPanelMainInventory::onClearSearch()
 	if (mActivePanel)
 	{
 		mActivePanel->setFilterSubString(LLStringUtil::null);
-		mActivePanel->setFilterTypes(0xffffffff);
+		mActivePanel->setFilterTypes(0xffffffffffffffffULL);
 		mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
 	}
 
@@ -726,7 +726,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
 void LLFloaterInventoryFinder::draw()
 {
 	LLMemType mt(LLMemType::MTYPE_INVENTORY_DRAW);
-	U32 filter = 0xffffffff;
+	U64 filter = 0xffffffffffffffffULL;
 	BOOL filtered_by_all_types = TRUE;
 
 	if (!getChild<LLUICtrl>("check_animation")->getValue())
-- 
GitLab


From a56290f408cbae4c947a0e2f6ec1ad0e6baff60a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 5 Mar 2012 17:32:20 -0800
Subject: [PATCH 850/933] EXP-1912 : Fix filtering of folders when those are
 being cut.

---
 indra/newview/llfolderview.cpp      |  9 +++++++--
 indra/newview/llinventoryfilter.cpp | 18 ++++++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index d9c6f4d9ceb..ec954ac881d 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -429,8 +429,13 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen
 		}
 		else
 		{
-			folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders?
-									(folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter
+			bool visible = (show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders?
+						(folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation)));
+			if (getFilter())
+			{
+				visible &= getFilter()->check(folderp);
+			}
+			folderp->setVisible(visible);
 		}
 
 		if (folderp->getVisible())
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index b5062e65b52..e859535d18d 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -91,20 +91,22 @@ LLInventoryFilter::~LLInventoryFilter()
 
 BOOL LLInventoryFilter::check(const LLFolderViewItem* item) 
 {
-	// If it's a folder and we're showing all folders, return TRUE automatically.
+	// Clipboard cut items are *always* filtered so we need this value upfront
+	const LLFolderViewEventListener* listener = item->getListener();
+	const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE);
+
+	// If it's a folder and we're showing all folders, return automatically.
 	const BOOL is_folder = (dynamic_cast<const LLFolderViewFolder*>(item) != NULL);
 	if (is_folder && (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS))
 	{
-		return TRUE;
+		return passed_clipboard;
 	}
 
 	mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos;
-	const LLFolderViewEventListener* listener = item->getListener();
 
 	const BOOL passed_filtertype = checkAgainstFilterType(item);
 	const BOOL passed_permissions = checkAgainstPermissions(item);
 	const BOOL passed_filterlink = checkAgainstFilterLinks(item);
-	const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE);
 	const BOOL passed = (passed_filtertype &&
 						 passed_permissions &&
 						 passed_filterlink &&
@@ -153,10 +155,13 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const
 
 bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
 {
+	// Always check against the clipboard
+	const BOOL passed_clipboard = checkAgainstClipboard(folder_id);
+	
 	// we're showing all folders, overriding filter
 	if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
 	{
-		return true;
+		return passed_clipboard;
 	}
 
 	if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
@@ -171,9 +176,6 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
 			return false;
 	}
 
-	// Always check against the clipboard
-	const BOOL passed_clipboard = checkAgainstClipboard(folder_id);
-
 	return passed_clipboard;
 }
 
-- 
GitLab


From 85d380b210ebb609f6fc273918e06007c9da1950 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 5 Mar 2012 20:03:21 -0800
Subject: [PATCH 851/933] EXP-1917 : Fix items coming back in folders when quit
 after cut.

---
 indra/newview/llfolderview.cpp      | 1 +
 indra/newview/llinventorybridge.cpp | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index ec954ac881d..99a3d65c6ff 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1383,6 +1383,7 @@ void LLFolderView::cut()
 				listener->cutToClipboard();
 			}
 		}
+		LLFolderView::removeCutItems();
 	}
 	mSearchString.clear();
 }
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3001a998aac..49eb8db5be0 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -220,7 +220,7 @@ BOOL LLInvFVBridge::cutToClipboard() const
 	const LLInventoryObject* obj = gInventory.getObject(mUUID);
 	if (obj && isItemMovable() && isItemRemovable())
 	{
-		LLClipboard::instance().setCutMode(true, boost::bind(LLFolderView::removeCutItems));
+		LLClipboard::instance().setCutMode(true);
 		return LLClipboard::instance().addToClipboard(mUUID);
 	}
 	return FALSE;
@@ -1307,6 +1307,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
 	else if ("cut" == action)
 	{
 		cutToClipboard();
+		LLFolderView::removeCutItems();
 		return;
 	}
 	else if ("copy" == action)
@@ -2697,6 +2698,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
 	else if ("cut" == action)
 	{
 		cutToClipboard();
+		LLFolderView::removeCutItems();
 		return;
 	}
 	else if ("copy" == action)
-- 
GitLab


From 6c60f214fd4959c9cd71df566edbfe0dc902496f Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 5 Mar 2012 20:10:17 -0800
Subject: [PATCH 852/933] CHUI-55 FIX Floaters that have set positions from old
 viewer versions can appear off screen until user repositions the floaters
 manually

---
 indra/llui/llfloater.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index d058b4ae446..b091a4a1f70 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -933,8 +933,13 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open)
 	case LLFloaterEnums::POSITIONING_SPECIFIED:
 		break;
 
-	case LLFloaterEnums::POSITIONING_CASCADE_GROUP:
 	case LLFloaterEnums::POSITIONING_CASCADING:
+		if (!on_open)
+		{
+			applyRelativePosition();
+		}
+		// fall through
+	case LLFloaterEnums::POSITIONING_CASCADE_GROUP:
 		if (on_open)
 		{
 			if (other != NULL && other != this)
@@ -3286,7 +3291,7 @@ void LLFloater::stackWith(LLFloater& other)
 	
 	setShape(next_rect);
 
-	//other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED;
+	other.mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP;
 	other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
 }
 
-- 
GitLab


From d3f1c6d77f0415d40a2eed6b62c98dbdb930689d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 6 Mar 2012 10:04:23 -0800
Subject: [PATCH 853/933] fixed some log warnings resulting from missing "name"
 attributes in menu_viewer.xml

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 6443e432fe6..9ff2e233afe 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3295,6 +3295,7 @@
          name="Set Logging Level"
          tear_off="true">
           <menu_item_check
+            name="Debug"
             label="Debug">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3304,6 +3305,7 @@
              parameter="0" />
           </menu_item_check>
           <menu_item_check
+            name="Info"
             label="Info">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3313,6 +3315,7 @@
              parameter="1" />
           </menu_item_check>
           <menu_item_check
+            name="Warning"
             label="Warning">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3322,6 +3325,7 @@
              parameter="2" />
           </menu_item_check>
           <menu_item_check
+            name="Error"
             label="Error">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3331,6 +3335,7 @@
              parameter="3" />
           </menu_item_check>
           <menu_item_check
+            name="None"
             label="None">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
-- 
GitLab


From 93aa231a18b9b5c9b3ab2ff162fa4928ac60d62b Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 6 Mar 2012 16:49:58 -0800
Subject: [PATCH 854/933] EXP-1767 WIP Received Items panel state does not
 persist between sessions ensure that layout stack has updated its layout
 before manually resizing one of its elements (which was causing the manual
 resize to be stomped on by the newly triggered layout update) made layout
 stack animation occur even when layout stack not visible (inventory will
 appear in proper open/closed state) LLView::setShape() now only calls
 handleReshape() when dimensions change removed extraneous calls to
 LLLayoutStack::updateClass() so that it should be called only once per frame
 now, allowing it to limit animation updates to layout stacks to one per
 frame. fixed rendering glitches arising from reshaping LLFolderView while in
 the middle of its draw() method

---
 indra/llui/lllayoutstack.cpp          | 52 +++++++++++++++++----------
 indra/llui/llview.cpp                 |  5 ++-
 indra/newview/llfloaterwebcontent.cpp |  4 +--
 indra/newview/llfolderview.cpp        |  3 ++
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index ae262f794ea..988595f72a6 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -172,12 +172,15 @@ void LLLayoutPanel::handleReshape(const LLRect& new_rect, bool by_user)
 	LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent());
 	if (stackp)
 	{
-		stackp->mNeedsLayout = true;
 		if (by_user)
-		{
-			// tell layout stack to account for new shape
+		{	// tell layout stack to account for new shape
+			
+			// make sure that panels have already been auto resized
+			stackp->updateLayout();
+			// now apply requested size to panel
 			stackp->updatePanelRect(this, new_rect);
 		}
+		stackp->mNeedsLayout = true;
 	}
 	LLPanel::handleReshape(new_rect, by_user);
 }
@@ -241,7 +244,6 @@ void LLLayoutStack::draw()
 			drawChild(panelp, 0, 0, !clip_rect.isEmpty());
 		}
 	}
-	mAnimatedThisFrame = false;
 }
 
 void LLLayoutStack::removeChild(LLView* view)
@@ -310,7 +312,7 @@ void LLLayoutStack::updateLayout()
 
 	if (!mNeedsLayout) return;
 
-	bool animation_in_progress = animatePanels();
+	bool continue_animating = animatePanels();
 	F32 total_visible_fraction = 0.f;
 	S32 space_to_distribute = (mOrientation == HORIZONTAL)
 							? getRect().getWidth()
@@ -415,7 +417,7 @@ void LLLayoutStack::updateLayout()
 
 	// clear animation flag at end, since panel resizes will set it
 	// and leave it set if there is any animation in progress
-	mNeedsLayout = animation_in_progress;
+	mNeedsLayout = continue_animating;
 } // end LLLayoutStack::updateLayout
 
 LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
@@ -488,6 +490,7 @@ void LLLayoutStack::updateClass()
 	for (instance_iter it = beginInstances(); it != endInstances(); ++it)
 	{
 		it->updateLayout();
+		it->mAnimatedThisFrame = false;
 	}
 }
 
@@ -557,7 +560,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 
 bool LLLayoutStack::animatePanels()
 {
-	bool animation_in_progress = false;
+	bool continue_animating = false;
 	
 	//
 	// animate visibility
@@ -577,14 +580,15 @@ bool LLLayoutStack::animatePanels()
 					}
 				}
 				
-				animation_in_progress = true;
+				mAnimatedThisFrame = true;
+				continue_animating = true;
 			}
 			else
 			{
 				if (panelp->mVisibleAmt != 1.f)
 				{
 					panelp->mVisibleAmt = 1.f;
-					animation_in_progress = true;
+					mAnimatedThisFrame = true;
 				}
 			}
 		}
@@ -601,14 +605,15 @@ bool LLLayoutStack::animatePanels()
 					}
 				}
 
-				animation_in_progress = true;
+				continue_animating = true;
+				mAnimatedThisFrame = true;
 			}
 			else
 			{
 				if (panelp->mVisibleAmt != 0.f)
 				{
 					panelp->mVisibleAmt = 0.f;
-					animation_in_progress = true;
+					mAnimatedThisFrame = true;
 				}
 			}
 		}
@@ -616,22 +621,31 @@ bool LLLayoutStack::animatePanels()
 		F32 collapse_state = panelp->mCollapsed ? 1.f : 0.f;
 		if (panelp->mCollapseAmt != collapse_state)
 		{
-			if (!mAnimatedThisFrame)
+			if (mAnimate)
 			{
-				panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
-			}
-			animation_in_progress = true;
+				if (!mAnimatedThisFrame)
+				{
+					panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
+				}
 			
-			if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f)
+				if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f)
+				{
+					panelp->mCollapseAmt = collapse_state;
+				}
+
+				mAnimatedThisFrame = true;
+				continue_animating = true;
+			}
+			else
 			{
 				panelp->mCollapseAmt = collapse_state;
+				mAnimatedThisFrame = true;
 			}
 		}
 	}
 
-	mAnimatedThisFrame = true;
-
-	return animation_in_progress;
+	if (mAnimatedThisFrame) mNeedsLayout = true;
+	return continue_animating;
 }
 
 void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& new_rect )
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 356d5c31d1b..54843227b74 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1835,7 +1835,10 @@ const LLCtrlQuery & LLView::getFocusRootsQuery()
 
 void	LLView::setShape(const LLRect& new_rect, bool by_user)
 {
-	handleReshape(new_rect, by_user);
+	if (new_rect != getRect())
+	{
+		handleReshape(new_rect, by_user);
+	}
 }
 
 void LLView::handleReshape(const LLRect& new_rect, bool by_user)
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 3b5c3663fbc..3fe2518de67 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -169,7 +169,7 @@ void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y,
 void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
 {
 	// Make sure the layout of the browser control is updated, so this calculation is correct.
-	LLLayoutStack::updateClass();
+	getChild<LLLayoutStack>("stack1")->updateLayout();
 
 	// TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc.
 	LLCoordWindow window_size;
@@ -258,7 +258,7 @@ void LLFloaterWebContent::open_media(const Params& p)
 
 	if (!p.preferred_media_size().isEmpty())
 	{
-		LLLayoutStack::updateClass();
+		getChild<LLLayoutStack>("stack1")->updateLayout();
 		LLRect browser_rect = mWebBrowser->calcScreenRect();
 		LLCoordWindow window_size;
 		getWindow()->getSize(&window_size);
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 86001e41461..4a42bb2c247 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -943,6 +943,9 @@ void LLFolderView::draw()
 			// We should call this method to also notify parent about required rect.
 			// See EXT-7564, EXT-7047.
 			arrangeFromRoot();
+			LLUI::popMatrix();
+			LLUI::pushMatrix();
+			LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
 		}
 	}
 
-- 
GitLab


From bea2dfbc22bb2d80755dcf9daf810e1ea0329c2d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 6 Mar 2012 16:59:11 -0800
Subject: [PATCH 855/933] EXP-1767 WIP Received Items panel state does not
 persist between sessions added get/setTargetDim() for managing layout_panel
 size even if its collapsed/invisible/etc

---
 indra/llui/lllayoutstack.cpp | 21 ++++++++++++++++++++-
 indra/llui/lllayoutstack.h   |  2 ++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 988595f72a6..4c730286da8 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -113,7 +113,26 @@ S32 LLLayoutPanel::getLayoutDim() const
 					? getRect().getWidth()
 					: getRect().getHeight()));
 }
- 
+
+S32 LLLayoutPanel::getTargetDim() const
+{
+	return mTargetDim;
+}
+
+void LLLayoutPanel::setTargetDim(S32 value)
+{
+	LLRect new_rect(getRect());
+	if (mOrientation == LLLayoutStack::HORIZONTAL)
+	{
+		new_rect.mRight = new_rect.mLeft + value;
+	}
+	else
+	{
+		new_rect.mTop = new_rect.mBottom + value;
+	}
+	setShape(new_rect, true);
+}
+
 S32 LLLayoutPanel::getVisibleDim() const
 {
 	F32 min_dim = getRelevantMinDim();
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index d32caec5f92..648cd5fdce2 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -155,6 +155,8 @@ friend class LLUICtrlFactory;
 	void setVisible(BOOL visible);
 
 	S32 getLayoutDim() const;
+	S32 getTargetDim() const;
+	void setTargetDim(S32 value);
 	S32 getMinDim() const { return llmax(0, mMinDim); }
 	void setMinDim(S32 value) { mMinDim = value; }
 
-- 
GitLab


From a0fda9b816a65761b2521ab48e4b926d2e4b2165 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 7 Mar 2012 14:17:09 -0500
Subject: [PATCH 856/933] first test using viewer-beta-candidate tag

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e994e188e7d..e268067b8d4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -270,3 +270,4 @@ a01ef9bed28627f4ca543fbc1d70c79cc297a90f DRTVWR-118_3.2.9-beta2
 a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
 d5f263687f43f278107363365938f0a214920a4b 3.3.0-start
+dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
-- 
GitLab


From 45f5a027f64ca1e16059757353d9d206160ed66f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 7 Mar 2012 15:37:52 -0800
Subject: [PATCH 857/933] EXP-1912 : Fix the substring filtering I broke while
 trying to fix 1912 the first time around.

---
 indra/newview/llfolderview.cpp | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 99a3d65c6ff..3103267b356 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -429,13 +429,8 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen
 		}
 		else
 		{
-			bool visible = (show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders?
-						(folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation)));
-			if (getFilter())
-			{
-				visible &= getFilter()->check(folderp);
-			}
-			folderp->setVisible(visible);
+			folderp->setVisible((show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders?
+								 (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))));
 		}
 
 		if (folderp->getVisible())
-- 
GitLab


From f712614d7bfb132cf0d4bc5ff5e2e02ea73a9bda Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 8 Mar 2012 21:07:59 -0500
Subject: [PATCH 858/933] update build params for viewer release management
 builds

---
 BuildParams | 45 +++++++++++++--------------------------------
 1 file changed, 13 insertions(+), 32 deletions(-)

diff --git a/BuildParams b/BuildParams
index c0513978537..1c39dd7cc75 100644
--- a/BuildParams
+++ b/BuildParams
@@ -36,50 +36,25 @@ viewer-development.build_debug_release_separately = true
 # <username>_<reponame>.email = <email-address>
 
 # =================================================================
-# Viewer Development (snowstorm canonical build owned by Oz Linden)
+# Canonical viewer integration builds - Oz Linden
 # =================================================================
-snowstorm_viewer-development.viewer_channel = "Second Life Development"
-snowstorm_viewer-development.login_channel = "Second Life Development"
-snowstorm_viewer-development.build_viewer_update_version_manager = false
-snowstorm_viewer-development.email = viewer-development-builds@lists.secondlife.com
-snowstorm_viewer-development.build_enforce_coding_policy = true
-snowstorm_viewer-development.codeticket_add_context = true
+integration_viewer-development.viewer_channel = "Second Life Development"
+integration_viewer-development.login_channel = "Second Life Development"
+integration_viewer-development.build_viewer_update_version_manager = false
+integration_viewer-development.email = viewer-development-builds@lists.secondlife.com
+integration_viewer-development.build_enforce_coding_policy = true
+integration_viewer-development.codeticket_add_context = true
 
-Snowstorm_viewer-project-review.build_debug_release_separately = true
-Snowstorm_viewer-project-review.codeticket_add_context = true
-Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
-Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
-Snowstorm_viewer-project-review.codeticket_add_context = true
-
-# ========================================
-# Viewer Beta (Owner: Dessie Linden)
-# ========================================
 viewer-beta.viewer_channel = "Second Life Beta Viewer"
 viewer-beta.login_channel = "Second Life Beta Viewer"
 viewer-beta.build_debug_release_separately = true
 viewer-beta.build_viewer_update_version_manager = true
 
-viewer-pre-beta.viewer_channel = "Second Life Beta Viewer"
-viewer-pre-beta.login_channel = "Second Life Beta Viewer"
-viewer-pre-beta.build_debug_release_separately = true
-viewer-pre-beta.build_viewer_update_version_manager = true
-
-
-# ========================================
-# Viewer Release (Owner: Dessie Linden)
-# ========================================
 viewer-release.viewer_channel = "Second Life Release"
 viewer-release.login_channel = "Second Life Release"
 viewer-release.build_debug_release_separately = true
 viewer-release.build_viewer_update_version_manager = true
 
-viewer-pre-release.viewer_channel = "Second Life Release"
-viewer-pre-release.login_channel = "Second Life Release"
-viewer-pre-release.build_debug_release_separately = true
-viewer-pre-release.build_viewer_update_version_manager = true
-#viewer-pre-release.release-viewer.jira = DRTVWR-92
-
-
 # ========================================
 # mesh-development
 # ========================================
@@ -140,6 +115,12 @@ viewer-mesh.email = shining@lists.lindenlab.com
 # oz
 # ================
 
+Snowstorm_viewer-project-review.build_debug_release_separately = true
+Snowstorm_viewer-project-review.codeticket_add_context = true
+Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
+Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
+Snowstorm_viewer-project-review.codeticket_add_context = true
+
 oz_viewer-devreview.build_debug_release_separately = true
 oz_viewer-devreview.codeticket_add_context = false
 oz_viewer-devreview.build_enforce_coding_policy = true
-- 
GitLab


From 5170f18d3cecc757cae2779d9e271272e24d160b Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 8 Mar 2012 21:06:00 -0800
Subject: [PATCH 859/933] EXP-1917 : Suppress clean up callback now that we
 move things to the trash immediately

---
 indra/llui/llclipboard.cpp | 6 ------
 indra/llui/llclipboard.h   | 7 ++-----
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 75c197463c3..cc5b219e6f3 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -49,15 +49,9 @@ void LLClipboard::reset()
 {
 	// Increment the clipboard count
 	mGeneration++;
-	// Call the cleanup function (if any) before releasing the object list
-	if (mCutMode && mCleanupCallback)
-	{
-		mCleanupCallback();
-	}
 	// Clear the clipboard
 	mObjects.clear();
 	mCutMode = false;
-	mCleanupCallback = NULL;
 	mString = LLWString();
 }
 
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 8b5a2260aed..7f31f66bbe4 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -36,8 +36,6 @@
 #include "llassettype.h"
 #include "llinventory.h"
 
-typedef boost::function<void ()> cleanup_callback_t;
-
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLClipboard
 //
@@ -80,13 +78,12 @@ class LLClipboard : public LLSingleton<LLClipboard>
 	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard
 
 	bool isCutMode() const { return mCutMode; }
-	void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mGeneration++; }
+	void setCutMode(bool mode) { mCutMode = mode; mGeneration++; }
 
 private:
 	std::vector<LLUUID> mObjects;		// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
 	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).
-	bool mCutMode;						// This is a convenience flag for the viewer. Will determine if mCleanupCallback() needs to be called.
-	cleanup_callback_t mCleanupCallback;// Function to call when the cut clipboard is being wiped out. Can be set to NULL (nothing done then).
+	bool mCutMode;						// This is a convenience flag for the viewer.
 	int mGeneration;					// Incremented when the clipboard changes so that interested parties can check for changes on the clipboard.	
 };
 
-- 
GitLab


From 5cf3f8e3c813d978f318fd59ad422c75b3e171cd Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 9 Mar 2012 14:20:31 -0800
Subject: [PATCH 860/933] EXP-1913 : Prevent text clipboard to zap inventory
 clipboard

---
 indra/llui/llclipboard.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index cc5b219e6f3..53b1b855de3 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -116,7 +116,6 @@ bool LLClipboard::isOnClipboard(const LLUUID& object) const
 // Copy the input string to the LL and the system clipboard
 bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
 {
-	reset();
 	return addToClipboard(src, pos, len, use_primary);
 }
 
@@ -132,7 +131,6 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us
 	{
 		mString = mString + sep + src.substr(pos, len);
 	}
-	mGeneration++;
 	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
 }
 
-- 
GitLab


From 4ffad9495cdf6f5d6577c4829628fc78bb32b817 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 9 Mar 2012 17:15:48 -0800
Subject: [PATCH 861/933] EXP-1915 : Disable copy/cut options for folders as
 long as all items in them are not present.

---
 indra/newview/llinventorybridge.cpp | 51 +++++++++++++++++++----------
 1 file changed, 33 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 49eb8db5be0..96785eb312a 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -143,6 +143,21 @@ bool isMarketplaceSendAction(const std::string& action)
 	return ("send_to_marketplace" == action);
 }
 
+//Used by LLFolderBridge as callback for directory recursion.
+class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver
+{
+public:
+	LLRightClickInventoryFetchDescendentsObserver(const uuid_vec_t& ids,
+												  bool copy_items) : 
+	LLInventoryFetchDescendentsObserver(ids),
+	mCopyItems(copy_items) 
+	{}
+	~LLRightClickInventoryFetchDescendentsObserver() {}
+	virtual void done();
+protected:
+	bool mCopyItems;
+};
+
 // +=================================================+
 // |        LLInvFVBridge                            |
 // +=================================================+
@@ -1722,9 +1737,15 @@ LLHandle<LLFolderBridge> LLFolderBridge::sSelf;
 BOOL LLFolderBridge::isItemMovable() const
 {
 	LLInventoryObject* obj = getInventoryObject();
-	if(obj)
+	if (obj)
 	{
-		return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType()));
+		// If it's a protected type folder, we can't move it
+		if (LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType()))
+			return FALSE;
+		// If the folder is not there yet, it's too early to decide if it's movable
+		if (!isUpToDate())
+			return FALSE;
+		return TRUE;
 	}
 	return FALSE;
 }
@@ -1759,6 +1780,10 @@ BOOL LLFolderBridge::isItemRemovable() const
 		return FALSE;
 	}
 
+	// If the folder is not there yet, we shouldn't try to remove it yet
+	if (!isUpToDate())
+		return FALSE;
+	
 	LLInventoryPanel* panel = mInventoryPanel.get();
 	LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL);
 	if (folderp)
@@ -1790,7 +1815,11 @@ BOOL LLFolderBridge::isUpToDate() const
 BOOL LLFolderBridge::isItemCopyable() const
 {
 	// Folders are copyable if items in them are, recursively, copyable.
-
+	
+	// If the folder is not there yet, it's not copyable
+	if (!isUpToDate())
+		return FALSE;
+		
 	// Get the content of the folder
 	LLInventoryModel::cat_array_t* cat_array;
 	LLInventoryModel::item_array_t* item_array;
@@ -2492,21 +2521,6 @@ class LLRightClickInventoryFetchObserver : public LLInventoryFetchItemsObserver
 
 };
 
-//Used by LLFolderBridge as callback for directory recursion.
-class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver
-{
-public:
-	LLRightClickInventoryFetchDescendentsObserver(const uuid_vec_t& ids,
-												  bool copy_items) : 
-		LLInventoryFetchDescendentsObserver(ids),
-		mCopyItems(copy_items) 
-	{}
-	~LLRightClickInventoryFetchDescendentsObserver() {}
-	virtual void done();
-protected:
-	bool mCopyItems;
-};
-
 void LLRightClickInventoryFetchDescendentsObserver::done()
 {
 	// Avoid passing a NULL-ref as mCompleteFolders.front() down to
@@ -3358,6 +3372,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		inc_busy_count();
 		if (fetch->isFinished())
 		{
+			delete fetch;
 			buildContextMenuFolderOptions(flags);
 		}
 		else
-- 
GitLab


From 8a792a86fad7c610651b964d164b8f099c790562 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 9 Mar 2012 17:34:30 -0800
Subject: [PATCH 862/933] EXP-1913 : Suppress the text concatenation on
 clipboard, unused and confusing.

---
 indra/llui/llclipboard.cpp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 53b1b855de3..7bf62b5bfcd 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -122,15 +122,7 @@ bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool u
 // Concatenate the input string to the LL and the system clipboard
 bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary)
 {
-	const LLWString sep(utf8str_to_wstring(std::string(", ")));
-	if (mString.length() == 0)
-	{
-		mString = src.substr(pos, len);
-	}
-	else
-	{
-		mString = mString + sep + src.substr(pos, len);
-	}
+	mString = src.substr(pos, len);
 	return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
 }
 
-- 
GitLab


From 9ce394a484579a1a408e954d6f3817b23afc273e Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Sun, 11 Mar 2012 08:06:37 -0400
Subject: [PATCH 863/933] Added tag DRTVWR-119, 3.3.0-beta1 for changeset
 d5f263687f43

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 577201a72da..0630018dc70 100644
--- a/.hgtags
+++ b/.hgtags
@@ -271,3 +271,5 @@ e9c82fca5ae6fb8a8af29012d78fb194a29323f3 3.2.9-beta1
 a01ef9bed28627f4ca543fbc1d70c79cc297a90f DRTVWR-118_3.2.9-beta2
 a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
+d5f263687f43f278107363365938f0a214920a4b DRTVWR-119
+d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
-- 
GitLab


From ade89007a89575ca0d3563a1aa08c7d20e30fcce Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 12 Mar 2012 13:27:01 -0700
Subject: [PATCH 864/933] sync with viewer-development

---
 .../skins/default/xui/en/floater_aaa.xml      | 158 +++++++++++-------
 .../default/xui/en/floater_about_land.xml     |  22 +--
 .../xui/en/floater_animation_anim_preview.xml |  76 +++++++++
 ....xml => floater_animation_bvh_preview.xml} |   0
 .../default/xui/en/floater_build_options.xml  |  61 +------
 .../default/xui/en/floater_buy_contents.xml   |   2 +-
 .../default/xui/en/floater_buy_currency.xml   |   8 +-
 .../default/xui/en/floater_buy_object.xml     |   4 +-
 .../default/xui/en/floater_choose_group.xml   |   2 +-
 .../default/xui/en/floater_fast_timers.xml    |   1 -
 .../xui/en/floater_merchant_outbox.xml        |   6 +-
 .../default/xui/en/floater_model_preview.xml  |  86 +++++-----
 .../default/xui/en/floater_preferences.xml    |   2 +-
 .../xui/en/floater_preview_animation.xml      |  16 +-
 .../xui/en/floater_test_layout_stacks.xml     |  20 +++
 .../floater_test_text_vertical_aligment.xml   | 112 +++++++++++++
 .../default/xui/en/floater_test_textbox.xml   |  16 +-
 .../skins/default/xui/en/floater_tools.xml    |  62 ++++++-
 .../skins/default/xui/en/floater_toybox.xml   |   4 +-
 .../default/xui/en/floater_voice_controls.xml |   2 +-
 .../skins/default/xui/en/inspect_object.xml   |   3 +-
 .../skins/default/xui/en/notifications.xml    |  10 +-
 .../xui/en/panel_block_list_sidetray.xml      |   2 +-
 .../default/xui/en/panel_chat_header.xml      |   6 +-
 .../skins/default/xui/en/panel_chat_item.xml  |   4 +-
 .../xui/en/panel_dummy_clothing_list_item.xml |   2 +-
 .../default/xui/en/panel_edit_wearable.xml    |   6 +-
 .../default/xui/en/panel_group_roles.xml      |   2 +-
 .../default/xui/en/panel_inbox_inventory.xml  |   1 +
 .../default/xui/en/panel_instant_message.xml  |   6 +-
 .../default/xui/en/panel_landmark_info.xml    |   4 +-
 .../default/xui/en/panel_main_inventory.xml   |   1 -
 .../default/xui/en/panel_navigation_bar.xml   |  15 +-
 .../default/xui/en/panel_nearby_chat.xml      |  84 ++++++----
 .../default/xui/en/panel_notification.xml     |  18 +-
 .../xui/en/panel_online_status_toast.xml      |   2 +-
 .../xui/en/panel_preferences_general.xml      |   6 +-
 .../xui/en/panel_preferences_sound.xml        |   2 +-
 .../skins/default/xui/en/panel_status_bar.xml |   2 -
 .../default/xui/en/panel_sys_well_item.xml    |   4 +-
 .../xui/en/panel_teleport_history_item.xml    |   2 +-
 .../skins/default/xui/en/panel_toast.xml      |   2 +-
 .../default/xui/en/sidepanel_inventory.xml    |   3 +-
 .../newview/skins/default/xui/en/strings.xml  |   4 +
 .../xui/en/widgets/avatar_list_item.xml       |   8 +-
 .../xui/en/widgets/bodyparts_list_item.xml    |   2 +-
 .../skins/default/xui/en/widgets/button.xml   |   2 +-
 .../default/xui/en/widgets/check_box.xml      |   2 +-
 .../xui/en/widgets/clothing_list_item.xml     |   2 +-
 .../en/widgets/dummy_clothing_list_item.xml   |   2 +-
 .../default/xui/en/widgets/tab_container.xml  |   2 +-
 51 files changed, 563 insertions(+), 308 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
 rename indra/newview/skins/default/xui/en/{floater_animation_preview.xml => floater_animation_bvh_preview.xml} (100%)
 create mode 100644 indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml

diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml
index 930bbaa8cb1..d11373ce1d5 100644
--- a/indra/newview/skins/default/xui/en/floater_aaa.xml
+++ b/indra/newview/skins/default/xui/en/floater_aaa.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- legacy_header_height="18"
  can_minimize="false"
  can_tear_off="false"
  can_resize="true"
@@ -16,67 +15,98 @@
  save_dock_state="true"
  save_visibility="true"
  single_instance="true" 
- width="320">
-  <string name="nudge_parabuild" translate="false">Nudge 1</string>
-  <string name="test_the_vlt">This string CHANGE2 is extracted.</string>
-  <string name="testing_eli">Just a test. changes.</string>
-  <text_editor
-   parse_urls="true"
-   bg_readonly_color="ChatHistoryBgColor"
-   bg_writeable_color="ChatHistoryBgColor" 
-   border_visible="false"
-   follows="all"
-   font="SansSerif" 
-	 left="1"
-   top="20"
-   layout="topleft"
-	 height="260"
-   name="chat_history"
-   max_length="200000" 
-   parse_highlights="true"
-   text_color="ChatHistoryTextColor"
-   text_readonly_color="ChatHistoryTextColor"
-   translate="false"
-   track_end="true" 
-   wrap="true" 
-   width="320">
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    Really long line that is long enough to wrap once with jyg descenders.
-    </text_editor>
+ width="650">
+  <text left="0"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned</text>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned
+  </text_editor>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 1d5a6740b74..3a6c2678c1a 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -192,12 +192,12 @@
              type="string"
              length="1"
              follows="left|top"
-             height="20"
+             height="18"
              layout="topleft"
              left_pad="2"
              valign="center" 
              name="ContentRatingText"
-             top_delta="0"
+             top_delta="-2"
              width="250">
                 Adult
             </text>
@@ -209,7 +209,7 @@
              layout="topleft"
              left="10"
              name="Owner:"
-             top_pad="1"
+             top_pad="3"
              width="100">
                 Owner:
             </text>
@@ -736,7 +736,7 @@
              height="16"
              layout="topleft"
              left_pad="10"
-             top_delta="-3" 
+             top_delta="-1" 
              mouse_opaque="false"
              name="region_maturity_text"
              valign="center" 
@@ -1210,7 +1210,7 @@ Only large parcels can be listed in search.
              type="string"
              length="1"
              follows="left|top"
-             text_color="white"
+             text_color="White"
              height="16"
              layout="topleft"
              left="10"
@@ -1500,7 +1500,7 @@ Only large parcels can be listed in search.
              layout="topleft"
              left="20"
              name="Snapshot:"
-             text_color="white"
+             text_color="White"
              top="225"
              width="200">
                 Snapshot:
@@ -1546,7 +1546,7 @@ Only large parcels can be listed in search.
              layout="topleft"
              left="255"
              top="282"
-             text_color="white"
+             text_color="White"
              name="landing_point"
              word_wrap="true"
              width="200">
@@ -1576,7 +1576,7 @@ Only large parcels can be listed in search.
             <text
              type="string"
              length="1"
-             text_color="white"
+             text_color="White"
              follows="left|top"
              height="16"
              layout="topleft"
@@ -1951,7 +1951,7 @@ Only large parcels can be listed in search.
 			 name="access_estate_defined">
 				(Defined by the Estate)
 			</panel.string>
-            <panel.string
+      <panel.string
              name="estate_override">
                 One or more of these options is set at the estate level
             </panel.string>
@@ -2085,7 +2085,7 @@ Only large parcels can be listed in search.
              column_padding="0"
              follows="top|bottom"
              heading_height="14"
-             height="120"
+             height="125"
              layout="topleft"
              left="0"
              multi_select="true"
@@ -2134,7 +2134,7 @@ Only large parcels can be listed in search.
              column_padding="0"
              follows="top|bottom"
              heading_height="14"
-             height="120"
+             height="125"
              layout="topleft"
              left="0"
              multi_select="true"
diff --git a/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..b5538a511c1
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="190"
+ layout="topleft"
+ name="Anim Preview"
+ help_topic="animation_anim_preview"
+ title="ANIMATION.ANIM"
+ width="300">
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="15"
+     layout="topleft"
+     left="10"
+     mouse_opaque="false"
+     name="name_label"
+     top="20"
+     width="275">
+        Name:
+    </text>
+    <line_editor
+     border_style="line"
+     border_thickness="1"
+     follows="left|top|right"
+     height="19"
+     layout="topleft"
+     left_delta="0"
+     max_length_bytes="63"
+     name="name_form"
+     top_pad="0"
+     width="280" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="15"
+     layout="topleft"
+     left_delta="0"
+     mouse_opaque="false"
+     name="description_label"
+     top_pad="10"
+     width="270">
+        Description:
+    </text>
+    <line_editor
+     border_style="line"
+     border_thickness="1"
+     follows="left|top|right"
+     height="19"
+     layout="topleft"
+     left_delta="0"
+     max_length_bytes="127"
+     name="description_form"
+     top_pad="0"
+     width="280" />
+    <button
+     follows="left|bottom"
+     height="22"
+     label="Upload (L$[AMOUNT])"
+     layout="topleft"
+     left="45"
+     name="ok_btn"
+     top_pad="60"
+     width="150" />
+    <button
+     follows="right|bottom"
+     height="22"
+     label="Cancel"
+     label_selected="Cancel"
+     layout="topleft"
+     name="cancel_btn"
+     left_pad="5"
+     width="90" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_animation_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
similarity index 100%
rename from indra/newview/skins/default/xui/en/floater_animation_preview.xml
rename to indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml
index 35918e9705d..38428b36fc6 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -1,70 +1,13 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- height="198"
+ height="170"
  layout="topleft"
  name="build options floater"
  help_topic="build_options_floater"
  save_rect="true"
  title="GRID OPTIONS"
  width="264">
- 	<floater.string
-     name="grid_screen_text">
-        Screen
-    </floater.string>
-    <floater.string
-     name="grid_local_text">
-        Local
-    </floater.string>
-    <floater.string
-     name="grid_world_text">
-        World
-    </floater.string>
-    <floater.string
-     name="grid_reference_text">
-        Reference
-    </floater.string>
-    <floater.string
-     name="grid_attachment_text">
-        Attachment
-    </floater.string>
-    <text
-     type="string"
-     length="1"
-     follows="left|top"
-     height="16"
-     layout="topleft"
-     left="10"
-     tool_tip="Grid opacity"
-     name="grid_mode_label"
-     top_pad="30"
-     width="123">
-        Mode
-    </text>
-    <combo_box
-     height="23"
-     layout="topleft"
-     left_pad="9"
-     follows="left|top"
-     name="combobox grid mode"
-     tool_tip="Choose the type of grid ruler for positioning the object"
-     top_delta="-3"
-     width="108">
-      <combo_box.item
-       label="World grid"
-       name="World"
-       value="World" />
-      <combo_box.item
-       label="Local grid"
-       name="Local"
-       value="Local" />
-      <combo_box.item
-       label="Reference grid"
-       name="Reference"
-       value="Reference" />
-       <combo_box.commit_callback
-      function="GridOptions.gridMode"/>
-    </combo_box>
     <spinner
      control_name="GridResolution"
      follows="left|top"
@@ -77,7 +20,7 @@
      max_val="5"
      min_val="0.01"
      name="GridResolution"
-     top_pad="4"
+     top_pad="30"
      width="200" />
     <spinner
      control_name="GridDrawSize"
diff --git a/indra/newview/skins/default/xui/en/floater_buy_contents.xml b/indra/newview/skins/default/xui/en/floater_buy_contents.xml
index 92001534e7e..ac96a708057 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_contents.xml
@@ -62,7 +62,7 @@
      layout="topleft"
      left="10"
      name="buy_text"
-     text_color="white"
+     text_color="White"
      top="220"
      use_ellipses="true" 
      width="260">
diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
index 6afa24d04af..553c5d51d01 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
@@ -215,7 +215,7 @@
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
@@ -229,7 +229,7 @@
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
@@ -243,7 +243,7 @@ Re-enter amount to see the latest exchange rate.
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
@@ -257,7 +257,7 @@ Re-enter amount to see the latest exchange rate.
     <text
      type="string"
      length="1"
-     text_color="0.7 0.7 0.7 0.5"
+     text_color="LtGray_50"
      follows="top|left"
      layout="topleft"
      halign="right"
diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml
index 8dfb6ba00c0..5fdd4aa49d9 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_object.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml
@@ -89,7 +89,7 @@
      left_delta="0"
 	 line_spacing.pixels="7"
      name="buy_text"
-     text_color="white"
+     text_color="White"
      top_pad="5"
      use_ellipses="true"
      width="260"
@@ -106,7 +106,7 @@ Buy for L$[AMOUNT] from:
      left_delta="0"
 	 line_spacing.pixels="7"
      name="buy_name_text"
-     text_color="white"
+     text_color="White"
      top_pad="5"
      use_ellipses="true"
      width="260">
diff --git a/indra/newview/skins/default/xui/en/floater_choose_group.xml b/indra/newview/skins/default/xui/en/floater_choose_group.xml
index dc1ee5f24e2..2cf6e682fde 100644
--- a/indra/newview/skins/default/xui/en/floater_choose_group.xml
+++ b/indra/newview/skins/default/xui/en/floater_choose_group.xml
@@ -20,7 +20,7 @@
         Choose a group:
     </text>
     <scroll_list
-     height="160"
+     height="165"
      layout="topleft"
      left_delta="0"
      name="group list"
diff --git a/indra/newview/skins/default/xui/en/floater_fast_timers.xml b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
index 49aa8f38400..77adb5524e7 100644
--- a/indra/newview/skins/default/xui/en/floater_fast_timers.xml
+++ b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
@@ -22,7 +22,6 @@
           top="5"
           width="180"
           height="40"
-          pad_bottom="-5"
           label="Pause"
           font="SansSerifHuge"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 6f387f4800b..3d33d19de58 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -99,7 +99,7 @@
             halign="center"
             font="SansSerifMedium"
             font_shadow="hard"
-            valign="bottom">
+            valign="top">
           Drag items here to create folders
         </text>
       </panel>
@@ -114,8 +114,8 @@
           height="20"
           wrap="true"
           halign="left"
-          valign="bottom"
-          font="SansSerif" />
+          valign="center"
+          font="SansSerif"/>
       <button
           label="Send to Marketplace"
           tool_tip="Push to my Marketplace Storefront"
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index eebc5ddc72a..0e211551e67 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -117,18 +117,18 @@
              name="lod_tab_border"
              top_pad="0"
              width="619" />
-            <text
-             follows="left|top"
-             height="18"
-             initial_value="Source"
-             layout="topleft"
-             left="75"
-             name="source"
-             text_color="ModelUploaderLabels"
-             top="15"
-             valign="center"
-             value="Source"
-             width="335" />
+          <text
+           follows="left|top"
+           height="18"
+           initial_value="Source"
+           layout="topleft"
+           left="75"
+           name="source"
+           text_color="ModelUploaderLabels"
+           top="15"
+           valign="center"
+           value="Source"
+           width="335"/>
             <text
              follows="left|top"
              halign="right"
@@ -163,7 +163,7 @@
              name="high_label"
              text_color="ModelUploaderLabels"
              top_pad="10"
-             valign="center"
+             valign="top"
              value="High"
              width="65" />
             <combo_box
@@ -240,34 +240,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="high_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="high_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="high_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
@@ -277,7 +277,7 @@
              left_delta="20"
              mouse_opaque="true"
              name="status_icon_high"
-             top_delta="0"
+             top_delta="-2"
              width="16" />
             <text
              follows="left|top"
@@ -288,7 +288,7 @@
              name="medium_label"
              text_color="ModelUploaderLabels"
              top_pad="15"
-             valign="center"
+             valign="top"
              value="Medium"
              width="65" />
             <combo_box
@@ -368,34 +368,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="medium_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="medium_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="medium_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
@@ -405,7 +405,7 @@
              left_delta="20"
              mouse_opaque="true"
              name="status_icon_medium"
-             top_delta="0"
+             top_delta="-2"
              width="16" />
             <text
              follows="left|top"
@@ -416,7 +416,7 @@
              name="low_label"
              text_color="ModelUploaderLabels"
              top_pad="15"
-             valign="center"
+             valign="top"
              value="Low"
              width="65" />
             <combo_box
@@ -496,34 +496,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="low_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="low_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="low_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
@@ -533,7 +533,7 @@
              left_delta="20"
              mouse_opaque="true"
              name="status_icon_low"
-             top_delta="0"
+             top_delta="-2"
              width="16" />
             <text
              follows="left|top"
@@ -544,7 +544,7 @@
              name="lowest_label"
              text_color="ModelUploaderLabels"
              top_pad="15"
-             valign="center"
+             valign="top"
              value="Lowest"
              width="65" />
             <combo_box
@@ -624,34 +624,34 @@
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="lowest_triangles"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="right"
-             height="18"
+             height="15"
              initial_value="0"
              layout="topleft"
              left_pad="0"
              name="lowest_vertices"
-             valign="center"
+             valign="top"
              value="0"
              width="65" />
             <text
              follows="left|top"
              halign="center"
-             height="18"
+             height="15"
              initial_value=""
              layout="topleft"
              left_pad="0"
              name="lowest_status"
-             valign="center"
+             valign="top"
              value=""
              width="65" />
             <icon
diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index 402868bb977..b2662331b05 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -100,7 +100,7 @@
          help_topic="preferences_colors_tab"
          name="colors" />
         <panel
-		 class="panel_preference"
+         class="panel_preference_privacy"
          filename="panel_preferences_privacy.xml"
          label="Privacy"
          layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_preview_animation.xml b/indra/newview/skins/default/xui/en/floater_preview_animation.xml
index 8427c7b06f2..3ea5f54f2cb 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_animation.xml
@@ -41,18 +41,26 @@
      label_selected="Stop"
      layout="topleft"
      left="10"
-     name="Anim play btn"
+     name="Inworld"
      tool_tip="Play this animation so that others can see it"
      top="47"
-     width="125" />
+     width="125">
+       <button.commit_callback
+        function="PreviewAnim.Play"
+        parameter="Inworld" /> 
+    </button>
     <button
      height="20"
      label="Play Locally"
      label_selected="Stop"
      layout="topleft"
      left_pad="5"
-     name="Anim audition btn"
+     name="Locally"
      tool_tip="Play this animation so that only you can see it"
      top_delta="0"
-     width="125" />
+     width="125">
+       <button.commit_callback
+        function="PreviewAnim.Play"
+        parameter="Locally" /> 
+    </button>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
index f95f21e63a7..a04050e7eb7 100644
--- a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml
@@ -26,6 +26,26 @@
                   background_visible="true">
       <text follows="top|left|right" halign="center" text_color="white">flex</text>
     </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  visible="false"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
+    <layout_panel name="flex"
+                  auto_resize="true"
+                  user_resize="true"
+                  bg_alpha_color="blue"
+                  height="11"
+                  min_height="0"
+                  visible="true"
+                  background_visible="true">
+      <text follows="top|left|right" halign="center" text_color="white">flex</text>
+    </layout_panel>
     <layout_panel name="flex"
                   auto_resize="true"
                   user_resize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..d11373ce1d5
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_minimize="false"
+ can_tear_off="false"
+ can_resize="true"
+ can_drag_on_left="false"
+ can_close="true"
+ can_dock="true"
+ bevel_style="in"
+ height="300"
+ layout="topleft"
+ name="Test Floater"
+ save_rect="true"
+ title="TEST FLOATER"
+ save_dock_state="true"
+ save_visibility="true"
+ single_instance="true" 
+ width="650">
+  <text left="0"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned</text>
+  <text left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"        
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned</text>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="top">
+this
+is
+some
+text
+that
+is
+top
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        bottom="-5"
+        clip_partial="true"
+        width="100"
+        valign="center">
+this
+is
+some
+text
+that
+is
+center
+aligned
+  </text_editor>
+  <text_editor left_pad="5"
+        follows="left|top|bottom"
+        top="5"
+        clip_partial="true"
+        bottom="-5"
+        width="100"
+        valign="bottom">
+this
+is
+some
+text
+that
+is
+bottom
+aligned
+  </text_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml
index 2df9bb35fe8..1d31fbd6dc0 100644
--- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml
@@ -8,21 +8,7 @@
  help_topic="floater_test_textbox"
  translate="false"
  width="800">
-    <text
-     type="string"
-     length="1"
-     height="90"
-     layout="topleft"
-     left="10"
-     top_pad="30"
-     width="300">
-        First line of multiple lines
-Second line of multiple lines
-Third line of multiple lines
-Fourth line of multiple lines
-Fifth line of multiple lines
-    </text>
-  <text
+ <text
     clip_partial="true"
     top_pad="10"
     left="10"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index f9147ea650c..2d63c94fe11 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -14,7 +14,27 @@
  save_visibility="true"
  sound_flags="0"
  width="295">
-    <floater.string
+  <floater.string
+     name="grid_screen_text">
+    Screen
+  </floater.string>
+  <floater.string
+   name="grid_local_text">
+    Local
+  </floater.string>
+  <floater.string
+   name="grid_world_text">
+    World
+  </floater.string>
+  <floater.string
+   name="grid_reference_text">
+    Reference
+  </floater.string>
+  <floater.string
+   name="grid_attachment_text">
+    Attachment
+  </floater.string>
+  <floater.string
      name="status_rotate">
         Drag colored bands to rotate object
     </floater.string>
@@ -312,20 +332,48 @@
      top_pad="0"
      name="checkbox snap to grid"
      width="134" />
-    <button
-     left_pad="0"
-     label="Options..."
+    <combo_box
+      height="20"
+      layout="topleft"
+      follows="left|top"
+      name="combobox grid mode"
+      tool_tip="Choose the type of grid ruler for positioning the object"
+      top="83"
+      left="195"
+      top_pad="0"
+      width="60">
+      <combo_box.item
+      label="World"
+      name="World"
+      value="World" />
+      <combo_box.item
+      label="Local"
+      name="Local"
+      value="Local" />
+      <combo_box.item
+      label="Reference"
+      name="Reference"
+      value="Reference" />
+      <combo_box.commit_callback
+      function="BuildTool.gridMode"/>
+    </combo_box>  
+  
+  <button
+     left="259"
+     label=""
+     image_selected="ForwardArrow_Press"
+     image_unselected="ForwardArrow_Off"
      layout="topleft"
      follows="top|left"
      name="Options..."
      tool_tip="See more grid options"
      top="83"
-     right="-35"
-     width="65"
-     height="21" >
+     width="25"
+     height="20" >
 	 <button.commit_callback
 	     function="BuildTool.gridOptions"/>
 	</button>
+  
    <button
      follows="left|top"
      height="20"
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index 72e6187a14d..fcaae9d172a 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -18,7 +18,7 @@
   <text
     follows="left|top"
     font="SansSerifMedium"
-    valign="bottom"
+    valign="top"
     halign="left"
     height="20"
     layout="topleft"
@@ -33,7 +33,7 @@
   <text
     follows="left|top"
     font="SansSerifMedium"
-    valign="bottom"
+    valign="top"
     halign="left"
     height="20"
     layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index cea19ec75c7..d99b29f3247 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -71,7 +71,7 @@
              layout="topleft"
              left_pad="10"
              name="user_text"
-             text_color="white"
+             text_color="White"
              top="4"
              use_ellipses="true"
              value="My Avatar:"
diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml
index 8d14c974b43..bfeb8fc4701 100644
--- a/indra/newview/skins/default/xui/en/inspect_object.xml
+++ b/indra/newview/skins/default/xui/en/inspect_object.xml
@@ -56,7 +56,7 @@ owner secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
    halign="right"
    right="-5"
    name="price_text"
-   text_color="white"
+   text_color="White"
    top="60"
    font_shadow="none"
    width="60">
@@ -90,6 +90,7 @@ L$30,000
    follows="all"
    font="SansSerifSmall"
    height="13"
+   clip="false"
    name="object_media_url"
    width="207"
    left_pad="2"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index af75d493532..59dd17ea9d3 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1667,7 +1667,7 @@ Unable to create output file: [FILE]
    icon="alertmodal.tga"
    name="DoNotSupportBulkAnimationUpload"
    type="alertmodal">
-[APP_NAME] does not currently support bulk upload of animation files.
+[APP_NAME] does not currently support bulk upload of BVH format animation files.
   <tag>fail</tag>
   </notification>
 
@@ -6409,11 +6409,11 @@ Grant this request?
     <form name="form">
       <button
        index="-2"
-       name="Mute"
+       name="Client_Side_Mute"
        text="Block"/>
       <button
        index="-1"
-       name="Ignore"
+       name="Client_Side_Ignore"
        text="Ignore"/>
     </form>
   </notification>
@@ -6428,11 +6428,11 @@ Grant this request?
     <form name="form">
       <button
        index="-2"
-       name="Mute"
+       name="Client_Side_Mute"
        text="Block"/>
       <button
        index="-1"
-       name="Ignore"
+       name="Client_Side_Ignore"
        text="Ignore"/>
     </form>
   </notification>
diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml
index 1e6a31d3883..7c67fd7f835 100644
--- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml
+++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml
@@ -28,7 +28,7 @@
      layout="topleft"
      left_pad="10"
      name="title_text"
-     text_color="white"
+     text_color="White"
      top="5"
      width="250">
         Block List
diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml
index 2645d472f98..5c5c718bdf9 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_header.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml
@@ -23,7 +23,7 @@
     <text
       parse_urls="false"
       allow_scroll="false"
-      v_pad = "7"
+      v_pad = "6"
       read_only = "true"
       follows="left|right"
       font.style="BOLD"
@@ -37,7 +37,7 @@
       top="0"
       translate="false"
       use_ellipses="true"
-      valign="bottom" 
+      valign="top" 
       value="TestString PleaseIgnore" />
   <text
     allow_scroll="false"
@@ -49,7 +49,7 @@
     left_pad="5"
     name="time_box"
     right="-5"
-    top="8"
+    top="7"
     value="23:30"
     width="110" />
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml
index 6af11054007..1b97de2b05e 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml
@@ -16,13 +16,13 @@
         top="3"
         width="18" />
 	<text_chat
-      top="5"
+      top="3"
       left="30"
       height="120"
       text_color="white"
       word_wrap="true"
       mouse_opaque="true"
-      valign="bottom"
+      valign="top"
       name="msg_text">
 	</text_chat>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml
index df459b40836..4b05ab27e46 100644
--- a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml
@@ -29,7 +29,7 @@
      width="380" />
     <icon
      height="16"
-     color="0.75 0.75 0.75 1"
+     color="LtGray"
      follows="top|left"
      image_name="Inv_Object"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
index 69a692e2c4c..f34b9132189 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml
@@ -164,7 +164,7 @@
      layout="topleft"
      left_pad="8"
      name="edit_wearable_title"
-     text_color="white"
+     text_color="White"
      top="3"
      value="Editing Shape"
      use_ellipses="true"
@@ -190,7 +190,7 @@
          layout="topleft"
          left="10"
          name="description_text"
-         text_color="white"
+         text_color="White"
          top="10"
          value="Shape:"
          width="150" />
@@ -254,7 +254,7 @@
          name="description"
          prevalidate_callback="ascii"
          select_on_focus="true"
-         text_color="black"
+         text_color="Black"
          top_pad="3"
          width="290" />
     </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml
index a7178dc2886..eea26061256 100644
--- a/indra/newview/skins/default/xui/en/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml
@@ -172,7 +172,7 @@ including the Everyone and Owner Roles.
              draw_heading="true"
              draw_stripes="false"
              heading_height="23"
-             height="130"
+             height="132"
              layout="topleft"
              search_column="1"
              left="0"
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index 383e637ace1..413e22e4449 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <inbox_inventory_panel
+    accepts_drag_and_drop="false"
     name="inventory_inbox"
     start_folder="Received Items"
     follows="all" layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml
index 4251128714f..2e5d6509022 100644
--- a/indra/newview/skins/default/xui/en/panel_instant_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml
@@ -15,7 +15,7 @@
     <panel
      background_visible="true"
      bevel_style="in"
-     bg_alpha_color="black"
+     bg_alpha_color="Black"
      follows="top"
      height="24"
      label="im_header"
@@ -64,7 +64,7 @@
          left_pad="5"
          name="user_name"
          parse_urls="false"
-         text_color="white"
+         text_color="White"
          top="8"
          translate="false"
          use_ellipses="true"
@@ -90,7 +90,7 @@
      layout="topleft"
      left="10"
      name="message"
-     text_color="white"
+     text_color="White"
      top="33"
      use_ellipses="true"
      value=""
diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
index d2088594dd9..fd6e96b9a7e 100644
--- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
@@ -271,7 +271,7 @@
                 <text_editor
                  bg_readonly_color="DkGray2"
                  follows="all"
-                 height="70"
+                 height="75"
                  layout="topleft"
                  left="0"
                  max_length="127"
@@ -288,7 +288,7 @@
                  layout="topleft"
                  left="0"
                  name="folder_label"
-                 top_pad="15"
+                 top_pad="10"
                  value="Landmark location:"
                  width="290" />
                 <combo_box
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index d6d8b2a83e1..1c882bb099a 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -80,7 +80,6 @@
      top="16"
      width="288" />
     <recent_inventory_panel
-     accepts_drag_and_drop="false"
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 4bf420b79f9..3edeb9aa367 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -70,7 +70,7 @@
            layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="480"
+           min_width="410"
            name="navigation_layout_panel"
            width="480">
 	        <panel
@@ -148,15 +148,15 @@
 	         layout="topleft"
            auto_resize="true"
            user_resize="true"
-           min_width="315"
+           min_width="185"
            name="favorites_layout_panel"
-           width="315">
+           width="320">
            <icon
              follows="top|left"
              height="25"
              image_name="ChatBarHandle"
              layout="topleft"
-             left="-318"
+             left="-323"
              name="resize_handle"
              top="4"
              width="5" />
@@ -171,16 +171,17 @@
              name="favorite"
              image_drag_indication="Accordion_ArrowOpened_Off"
              tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-             width="311">
+             width="320">
             <label
              follows="left|top"
-             height="15"
+             height="13"
              layout="topleft"
              left="10"
              name="favorites_bar_label"
              text_color="LtGray"
              tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!"
-             top="12"
+             top="13"
+	     valign="bottom"
              width="102">
               Favorites Bar
             </label>
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
index d492f9bd68b..d683116eb8b 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml
@@ -1,35 +1,63 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel
- height="300"
  follows="all"
+ height="300"
+ help_topic="nearby_chat"
  layout="topleft"
  name="nearby_chat"
- help_topic="nearby_chat"
  width="320">
-            <check_box
-             bottom_delta="36"
-             control_name="TranslateChat"
-             enabled="true"
-             height="16"
-             label="Translate chat"
-             layout="topleft"
-             left="5"
-             name="translate_chat_checkbox"
-             width="230" />
-  <chat_history
-    parse_urls="true"
-    bg_readonly_color="ChatHistoryBgColor"
-    bg_writeable_color="ChatHistoryBgColor"
-    follows="all"
-    left="5"
-    top_delta="17"
-    layout="topleft"
-    height="260"
-    name="chat_history"
-    parse_highlights="true"
-    text_color="ChatHistoryTextColor"
-    text_readonly_color="ChatHistoryTextColor"
-    right_widget_pad="5"
-    left_widget_pad="0"
-    width="315" />
+  <layout_stack
+   follows="all"
+   height="295"
+   layout="topleft"
+   left="0"
+   name="stack"
+   top="5"
+   orientation="vertical"
+   width="320">
+    <layout_panel
+     auto_resize="false"
+     height="26"
+     layout="topleft"
+     left_delta="0"
+     name="translate_chat_checkbox_lp"
+     top_delta="0"
+     visible="true"
+     width="313">
+      <check_box
+       top="10"
+       control_name="TranslateChat"
+       enabled="true"
+       height="16"
+       label="Translate chat"
+       layout="topleft"
+       left="5"
+       name="translate_chat_checkbox"
+       width="300" />
+    </layout_panel>
+    <layout_panel
+     auto_resize="true"
+     height="277"
+     left_delta="0"
+     layout="topleft"
+     name="chat_history_lp"
+     width="318">
+      <chat_history
+       bg_readonly_color="ChatHistoryBgColor"
+       bg_writeable_color="ChatHistoryBgColor"
+       follows="all"
+       layout="topleft"
+       left="5"
+       left_widget_pad="0"
+       height="272"
+       name="chat_history"
+       parse_highlights="true"
+       parse_urls="true"
+       right_widget_pad="5"
+       text_color="ChatHistoryTextColor"
+       text_readonly_color="ChatHistoryTextColor"
+       top="0"
+       width="313" />
+    </layout_panel>
+  </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index f6f62ac54eb..94c468e1bb0 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -3,8 +3,8 @@
   background_opaque="false"
       border_visible="false"
   background_visible="true"
-  bg_alpha_color="1 0.3 0.3 0"
-  bg_opaque_color="1 0.3 0.3 0"
+  bg_alpha_color="PanelNotificationBackground"
+  bg_opaque_color="PanelNotificationBackground"
   label="notification_panel"
   layout="topleft"
   left="0"
@@ -20,8 +20,8 @@
       border_visible="false"
  bevel_style="none"
     background_visible="true"
-  bg_alpha_color="0.3 0.3 0.3 0"
-  bg_opaque_color="0.3 0.3 0.3 0"
+  bg_alpha_color="ToastBackground"
+  bg_opaque_color="ToastBackground"
     follows="left|right|top"
     height="100"
     label="info_panel"
@@ -39,7 +39,7 @@
       left="10"
       name="text_box"
       read_only="true"
-      text_color="white"
+      text_color="White"
       top="10"
       visible="false" 
       width="285"
@@ -52,7 +52,7 @@
       layout="topleft"
       left="10"
       name="caution_text_box"
-      text_color="1 0.82 0.46 1"
+      text_color="NotifyCautionBoxColor"
       top="10"
       visible="false"
       width="285"
@@ -60,7 +60,7 @@
     <text_editor
     	h_pad="0"
 	v_pad="0"
-      bg_readonly_color="0.0 0.0 0.0 0"
+      bg_readonly_color="Transparent"
       border_visible="false"
       embedded_items="false"
       enabled="false"
@@ -73,8 +73,8 @@
       name="text_editor_box"
       read_only="true"
       tab_stop="false"
-      text_color="white"
-      text_readonly_color="white"
+      text_color="White"
+      text_readonly_color="White"
       top="10"
       visible="false"
       width="285"
diff --git a/indra/newview/skins/default/xui/en/panel_online_status_toast.xml b/indra/newview/skins/default/xui/en/panel_online_status_toast.xml
index b1a7697e833..dadbd9c9abc 100644
--- a/indra/newview/skins/default/xui/en/panel_online_status_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_online_status_toast.xml
@@ -25,7 +25,7 @@
      layout="topleft"
      left_pad="5"
      name="message"
-     text_color="white"
+     text_color="White"
      top="15"
      use_ellipses="true"
      value=""
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
index 9827180aa72..24882988b06 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
@@ -331,7 +331,7 @@
    </text>
    <radio_group
      control_name="LetterKeysFocusChatBar" 
-     height="20"
+     height="34"
      layout="topleft"
      left="35"
      top_pad="0" 
@@ -339,7 +339,7 @@
         <radio_item
          label="Starts local chat"
          name="radio_start_chat"
-         top_delta="20" 
+         top="0" 
          layout="topleft"
          height="16" 
          left="0" 
@@ -364,7 +364,7 @@
      layout="topleft"
      left="30"
      name="title_afk_text"
-     top_pad="15" 
+     top_pad="5" 
      width="190">
     	Away timeout:
     </text>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
index 1f92244eb97..b71586aab16 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
@@ -63,7 +63,7 @@
       layout="topleft"
       left_pad="0"
       name="mute_chb_label"
-      top_delta="0"
+      top_delta="-1"
       width="150"
       wrap="true">
       Mute when minimized
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index d453a970e75..22c1139cdb5 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -67,7 +67,6 @@
      label_shadow="true"
      name="buyL"
      pad_right="0"
-     pad_bottom="2"
      tool_tip="Click to buy more L$"
      top="0"
      width="80" />
@@ -87,7 +86,6 @@
      left_pad="0"
      label_shadow="true"
      name="goShop"
-     pad_bottom="2"
      tool_tip="Open Second Life Marketplace"
      top="0"
      width="65" />
diff --git a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml
index 5e74689c5a2..007b73a4bc0 100644
--- a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml
@@ -13,7 +13,7 @@
   follows="left|right"
   background_opaque="false"
   background_visible="true"
-  bg_alpha_color="0.0 0.0 0.0 0.0" >
+  bg_alpha_color="SysWellItemUnselected" >
   <text
     clip_partial="true" 
     top="2"
@@ -22,7 +22,7 @@
     height="28"
     layout="topleft"
     follows="right|left"
-    text_color="white"
+    text_color="White"
     use_ellipses="true"
     word_wrap="true"
     mouse_opaque="false"
diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
index c89e1dc215f..c5b0be0616f 100644
--- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
@@ -44,7 +44,7 @@
      parse_urls="false"
      use_ellipses="true"
      name="region"
-     text_color="white"
+     text_color="White"
      top="4"
      value="..."
      width="330" />
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index 062c403a26b..0b5aff54ca8 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -59,7 +59,7 @@
    left="20"
    name="toast_text"
    word_wrap="true"
-   text_color="white"
+   text_color="White"
    top="5"
    translate="false"
    use_ellipses="true"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 29aa6d10395..ee790e8dd4c 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -48,7 +48,7 @@
                       height="300"
                       width="330" />
              </layout_panel>
-			 <layout_panel
+			    <layout_panel
                  width="330"
                  layout="topleft"
                  auto_resize="true"
@@ -73,6 +73,7 @@
                      <string name="InboxLabelWithArg">Received items ([NUM])</string>
                      <string name="InboxLabelNoArg">Received items</string>
                      <button
+                        control_name="InventoryInboxToggleState"
                         label="Received items"
 						font="SansSerifMedium"
                         name="inbox_btn"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 4bc72be49b9..97526526794 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -369,6 +369,9 @@ Please try logging in again in a minute.</string>
 	<string name="anim_yes_happy">Yes (Happy)</string>
 	<string name="anim_yes_head">Yes</string>
 
+	<!-- build floater -->
+	<string name="multiple_textures">Multiple</string>
+
 	<!-- world map -->
 	<string name="texture_loading">Loading...</string>
 	<string name="worldmap_offline">Offline</string>
@@ -3238,6 +3241,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	<string name="IM_to_label">To</string>
 	<string name="IM_moderator_label">(Moderator)</string>
 	<string name="Saved_message">(Saved [LONG_TIMESTAMP])</string>
+	<string name="IM_unblock_only_groups_friends">To see this message, you must uncheck &apos;Only friends and groups can call or IM me&apos; in Preferences/Privacy.</string>
 
 	<!-- voice calls -->
 	<string name="answered_call">Your call has been answered</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml
index 1bb3188cc8a..8a4ccb19f9d 100644
--- a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml
@@ -17,13 +17,13 @@
   <voice_call_invited_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="0.5 0.5 0.5 0.5"/>
+   color="AvatarListItemIconVoiceInvitedColor"/>
 
   <!-- styles for avatar item JOINED to voice call -->
   <voice_call_joined_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="white"/>
+   color="White"/>
 
   <!-- styles for avatar item which HAS LEFT voice call -->
   <voice_call_left_style
@@ -35,11 +35,11 @@
   <online_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="white"/>
+   color="White"/>
 
   <!-- styles for OFFLINE avatar item -->
   <offline_style
    font="SansSerifSmall"
    font.style="NORMAL"
-   color="0.5 0.5 0.5 1.0"/>
+   color="Gray"/>
 </avatar_list_item>
diff --git a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml
index 0eec002006d..0016a8cf53c 100644
--- a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml
@@ -24,7 +24,7 @@
    parse_urls="false"
    use_ellipses="true"
    name="item_name"
-   text_color="white"
+   text_color="White"
    top="5"
    value="..."
    width="359" />
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index e2baba92a3a..2b2c3faf917 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -21,7 +21,7 @@
         font="SansSerifSmall"
         hover_glow_amount="0.15"
         halign="center"
-        pad_bottom="3" 
+        pad_bottom="1"
         height="23"
         scale_image="true"
         handle_right_mouse="true"
diff --git a/indra/newview/skins/default/xui/en/widgets/check_box.xml b/indra/newview/skins/default/xui/en/widgets/check_box.xml
index cca64fad2a7..8947024e458 100644
--- a/indra/newview/skins/default/xui/en/widgets/check_box.xml
+++ b/indra/newview/skins/default/xui/en/widgets/check_box.xml
@@ -10,7 +10,7 @@
                         text_readonly_color="LabelDisabledColor"/>
   <check_box.check_button name="CheckboxCtrl Button"
                           left="2"
-                          bottom="2"
+                          bottom="1"
                           width="13"
                           height="13" 
                           commit_on_return="false"
diff --git a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml
index 96d72c78a65..d83f44737ec 100644
--- a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml
@@ -24,7 +24,7 @@
    parse_urls="false"
    use_ellipses="true"
    name="item_name"
-   text_color="white"
+   text_color="White"
    top="5"
    value="..."
    width="359" />
diff --git a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml
index 6c606248050..8c805da0482 100644
--- a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml
@@ -9,7 +9,7 @@
  width="380">
   <item_icon
     height="16"
-    color="0.75 0.75 0.75 1"
+    color="LtGray"
     follows="top|left"
     image_name="Inv_Object"
     layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
index 3e2202b20fc..0586119681a 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -11,7 +11,7 @@ label_pad_left - padding to the left of tab button labels
                halign="center"
                font="SansSerifSmall" 
                tab_height="21"
-               label_pad_bottom="2"
+               label_pad_bottom="1"
                label_pad_left="4">
   <!--
   Possible additional attributes for tabs:
-- 
GitLab


From 7b866448dbeeeb04b074df493369927afcf9971a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 12 Mar 2012 13:59:25 -0700
Subject: [PATCH 865/933] EXP-1922 : Skip the clipboard elements when purging
 the trash when in cut mode

---
 indra/newview/llinventorymodel.cpp | 114 ++++++++++++++++++-----------
 1 file changed, 73 insertions(+), 41 deletions(-)

diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index a71b699fdd7..06e780508b6 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -30,6 +30,7 @@
 #include "llagent.h"
 #include "llagentwearables.h"
 #include "llappearancemgr.h"
+#include "llclipboard.h"
 #include "llinventorypanel.h"
 #include "llinventorybridge.h"
 #include "llinventoryfunctions.h"
@@ -1110,50 +1111,81 @@ void LLInventoryModel::purgeDescendentsOf(const LLUUID& id)
 		return;
 	}
 	LLPointer<LLViewerInventoryCategory> cat = getCategory(id);
-	if(cat.notNull())
-	{
-		// do the cache accounting
-		llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName()
-				<< llendl;
-		S32 descendents = cat->getDescendentCount();
-		if(descendents > 0)
-		{
-			LLCategoryUpdate up(id, -descendents);
-			accountForUpdate(up);
+	if (cat.notNull())
+	{
+		if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode())
+		{
+			// Something on the clipboard is in "cut mode" and needs to be preserved
+			llinfos << "Merov debug : purging through iteration" << llendl;
+			cat_array_t* categories;
+			item_array_t* items;
+			// Get the list of direct descendants in tha categoy passed as argument
+			getDirectDescendentsOf(id, categories, items);
+			std::vector<LLUUID> list_uuids;
+			// Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently)
+			// Note: we need to do that shallow copy as purging things will invalidate the categories or items lists
+			for (cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it)
+			{
+				list_uuids.push_back((*it)->getUUID());
+			}
+			for (item_array_t::const_iterator it = items->begin(); it != items->end(); ++it)
+			{
+				list_uuids.push_back((*it)->getUUID());
+			}
+			// Iterate through the list and only purge the UUIDs that are not on the clipboard
+			for (std::vector<LLUUID>::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it)
+			{
+				if (!LLClipboard::instance().isOnClipboard(*it))
+				{
+					purgeObject(*it);
+				}
+			}
 		}
+		else
+		{
+			// Fast purge
+			// do the cache accounting
+			llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName()
+				<< llendl;
+			S32 descendents = cat->getDescendentCount();
+			if(descendents > 0)
+			{
+				LLCategoryUpdate up(id, -descendents);
+				accountForUpdate(up);
+			}
 
-		// we know that descendent count is 0, aide since the
-		// accounting may actually not do an update, we should force
-		// it here.
-		cat->setDescendentCount(0);
+			// we know that descendent count is 0, however since the
+			// accounting may actually not do an update, we should force
+			// it here.
+			cat->setDescendentCount(0);
+
+			// send it upstream
+			LLMessageSystem* msg = gMessageSystem;
+			msg->newMessage("PurgeInventoryDescendents");
+			msg->nextBlock("AgentData");
+			msg->addUUID("AgentID", gAgent.getID());
+			msg->addUUID("SessionID", gAgent.getSessionID());
+			msg->nextBlock("InventoryData");
+			msg->addUUID("FolderID", id);
+			gAgent.sendReliableMessage();
 
-		// send it upstream
-		LLMessageSystem* msg = gMessageSystem;
-		msg->newMessage("PurgeInventoryDescendents");
-		msg->nextBlock("AgentData");
-		msg->addUUID("AgentID", gAgent.getID());
-		msg->addUUID("SessionID", gAgent.getSessionID());
-		msg->nextBlock("InventoryData");
-		msg->addUUID("FolderID", id);
-		gAgent.sendReliableMessage();
-
-		// unceremoniously remove anything we have locally stored.
-		cat_array_t categories;
-		item_array_t items;
-		collectDescendents(id,
-						   categories,
-						   items,
-						   INCLUDE_TRASH);
-		S32 count = items.count();
-		S32 i;
-		for(i = 0; i < count; ++i)
-		{
-			deleteObject(items.get(i)->getUUID());
-		}
-		count = categories.count();
-		for(i = 0; i < count; ++i)
-		{
-			deleteObject(categories.get(i)->getUUID());
+			// unceremoniously remove anything we have locally stored.
+			cat_array_t categories;
+			item_array_t items;
+			collectDescendents(id,
+							   categories,
+							   items,
+							   INCLUDE_TRASH);
+			S32 count = items.count();
+			for(S32 i = 0; i < count; ++i)
+			{
+				deleteObject(items.get(i)->getUUID());
+			}
+			count = categories.count();
+			for(S32 i = 0; i < count; ++i)
+			{
+				deleteObject(categories.get(i)->getUUID());
+			}
 		}
 	}
 }
-- 
GitLab


From 0df0218329ce894afe3a27980a2862ac4a584be7 Mon Sep 17 00:00:00 2001
From: merov <none@none>
Date: Mon, 12 Mar 2012 17:21:32 -0700
Subject: [PATCH 866/933] EXP-1914 : Fix the evaluation of
 isClipboardPasteable() when the clipboard is in cut mode.

---
 indra/newview/llinventorybridge.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 96785eb312a..060250cc07f 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -434,6 +434,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
 
 BOOL LLInvFVBridge::isClipboardPasteable() const
 {
+	// Return FALSE on degenerated cases: empty clipboard, no inventory, no agent
 	if (!LLClipboard::instance().hasContents() || !isAgentInventory())
 	{
 		return FALSE;
@@ -444,6 +445,13 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
 		return FALSE;
 	}
 
+	// In cut mode, whatever is on the clipboard is always pastable
+	if (LLClipboard::instance().isCutMode())
+	{
+		return TRUE;
+	}
+
+	// In normal mode, we need to check each element of the clipboard to know if we can paste or not
 	LLDynamicArray<LLUUID> objects;
 	LLClipboard::instance().pasteFromClipboard(objects);
 	S32 count = objects.count();
@@ -658,7 +666,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
 	{
 		items.push_back(std::string("Paste"));
 	}
-	if ((!LLClipboard::instance().isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
+	if (!isClipboardPasteable() || ((flags & FIRST_SELECTED_ITEM) == 0))
 	{
 		disabled_items.push_back(std::string("Paste"));
 	}
@@ -2926,7 +2934,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
 void LLFolderBridge::pasteFromClipboard()
 {
 	LLInventoryModel* model = getInventoryModel();
-	if (model && (isClipboardPasteable() || LLClipboard::instance().isCutMode()))
+	if (model && isClipboardPasteable())
 	{
 		const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
 		const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
-- 
GitLab


From 1c51271d56c0332394fb23dc843aecf812f6f901 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 13 Mar 2012 15:05:51 +0200
Subject: [PATCH 867/933] CHUI-56 FIXED Fixed a crash when deleting multiple
 inventory folders.

---
 indra/newview/llinventorybridge.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index ef58e4fa212..da85c81cf20 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -396,7 +396,11 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
 	for(; it != end; ++it)
 	{
 		gInventory.moveObject((*it), trash_id);
-		model->updateItem(gInventory.getItem(*it));
+		LLViewerInventoryItem* item = gInventory.getItem(*it);
+		if (item)
+		{
+			model->updateItem(item);
+		}
 	}
 
 	// notify inventory observers.
-- 
GitLab


From 77df887b657f2a38474b3e3699d54d2e020e88ba Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 13 Mar 2012 16:04:27 -0400
Subject: [PATCH 868/933] Added tag viewer-release-candidate for changeset
 5e8d2662f38a

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0630018dc70..0702c4ee14c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -273,3 +273,4 @@ a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
 d5f263687f43f278107363365938f0a214920a4b DRTVWR-119
 d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
+5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
-- 
GitLab


From 82700548058527001657758888cf79df099064b3 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 13 Mar 2012 21:08:10 -0700
Subject: [PATCH 869/933] EXP-1915 : Rewrote the fetching mechanism for folders
 making it truly recursive.

---
 indra/newview/llinventorybridge.cpp | 221 ++++++++++++++++------------
 indra/newview/llinventorymodel.cpp  |   3 +-
 2 files changed, 128 insertions(+), 96 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 060250cc07f..03f6a31c6d9 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -143,19 +143,40 @@ bool isMarketplaceSendAction(const std::string& action)
 	return ("send_to_marketplace" == action);
 }
 
-//Used by LLFolderBridge as callback for directory recursion.
+// Used by LLFolderBridge as callback for directory fetching recursion
 class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver
 {
 public:
-	LLRightClickInventoryFetchDescendentsObserver(const uuid_vec_t& ids,
-												  bool copy_items) : 
-	LLInventoryFetchDescendentsObserver(ids),
-	mCopyItems(copy_items) 
-	{}
+	LLRightClickInventoryFetchDescendentsObserver(const uuid_vec_t& ids) : LLInventoryFetchDescendentsObserver(ids) {}
 	~LLRightClickInventoryFetchDescendentsObserver() {}
-	virtual void done();
-protected:
-	bool mCopyItems;
+	virtual void execute(bool clear_observer = false);
+	virtual void done()
+	{
+		execute(true);
+	}
+};
+
+// Used by LLFolderBridge as callback for directory content items fetching
+class LLRightClickInventoryFetchObserver : public LLInventoryFetchItemsObserver
+{
+public:
+	LLRightClickInventoryFetchObserver(const uuid_vec_t& ids) : LLInventoryFetchItemsObserver(ids) { };
+	~LLRightClickInventoryFetchObserver() {}
+	void execute(bool clear_observer = false)
+	{
+		if (clear_observer)
+		{
+			dec_busy_count();
+			gInventory.removeObserver(this);
+			delete this;
+		}
+		// we've downloaded all the items, so repaint the dialog
+		LLFolderBridge::staticFolderOptionsMenu();
+	}
+	virtual void done()
+	{
+		execute(true);
+	}
 };
 
 // +=================================================+
@@ -2499,106 +2520,114 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 	return accept;
 }
 
-//Used by LLFolderBridge as callback for directory recursion.
-class LLRightClickInventoryFetchObserver : public LLInventoryFetchItemsObserver
+void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
 {
-public:
-	LLRightClickInventoryFetchObserver(const uuid_vec_t& ids) :
-		LLInventoryFetchItemsObserver(ids),
-		mCopyItems(false)
-	{ };
-	LLRightClickInventoryFetchObserver(const uuid_vec_t& ids,
-									   const LLUUID& cat_id, 
-									   bool copy_items) :
-		LLInventoryFetchItemsObserver(ids),
-		mCatID(cat_id),
-		mCopyItems(copy_items)
-	{ };
-	virtual void done()
-	{
-		// we've downloaded all the items, so repaint the dialog
-		LLFolderBridge::staticFolderOptionsMenu();
-
-		gInventory.removeObserver(this);
-		delete this;
-	}
-
-protected:
-	LLUUID mCatID;
-	bool mCopyItems;
-
-};
-
-void LLRightClickInventoryFetchDescendentsObserver::done()
-{
-	// Avoid passing a NULL-ref as mCompleteFolders.front() down to
-	// gInventory.collectDescendents()
+	// Bail out immediately if no descendents
 	if( mComplete.empty() )
 	{
 		llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl;
-		dec_busy_count();
-		gInventory.removeObserver(this);
-		delete this;
+		if (clear_observer)
+		{
+			dec_busy_count();
+			gInventory.removeObserver(this);
+			delete this;
+		}
 		return;
 	}
-
-	// What we do here is get the complete information on the items in
-	// the library, and set up an observer that will wait for that to
-	// happen.
-	LLInventoryModel::cat_array_t cat_array;
-	LLInventoryModel::item_array_t item_array;
-	gInventory.collectDescendents(mComplete.front(),
-								  cat_array,
-								  item_array,
-								  LLInventoryModel::EXCLUDE_TRASH);
-	S32 count = item_array.count();
-#if 0 // HACK/TODO: Why?
-	// This early causes a giant menu to get produced, and doesn't seem to be needed.
-	if(!count)
-	{
-		llwarns << "Nothing fetched in category " << mCompleteFolders.front()
-				<< llendl;
+	
+	// Copy the list of complete fetched folders while "this" is still valid
+	uuid_vec_t completed_folder = mComplete;
+	
+	// Clean up, and remove this as an observer now since recursive calls
+	// could notify observers and throw us into an infinite loop.
+	if (clear_observer)
+	{
 		dec_busy_count();
 		gInventory.removeObserver(this);
 		delete this;
-		return;
 	}
-#endif
-
-	uuid_vec_t ids;
-	for(S32 i = 0; i < count; ++i)
+	
+	for (uuid_vec_t::iterator current_folder = completed_folder.begin(); current_folder != completed_folder.end(); ++current_folder)
 	{
-		ids.push_back(item_array.get(i)->getUUID());
-	}
+		// Get the information on the fetched folder items and subfolders and fetch those 
+		LLInventoryModel::cat_array_t* cat_array;
+		LLInventoryModel::item_array_t* item_array;
+		gInventory.getDirectDescendentsOf(*current_folder, cat_array, item_array);
 
-	LLRightClickInventoryFetchObserver* outfit = new LLRightClickInventoryFetchObserver(ids, mComplete.front(), mCopyItems);
+		S32 item_count = item_array->count();
+		S32 cat_count = cat_array->count();
+	
+		// Move to next if current folder empty
+		if ((item_count == 0) && (cat_count == 0))
+		{
+			continue;
+		}
 
-	// clean up, and remove this as an observer since the call to the
-	// outfit could notify observers and throw us into an infinite
-	// loop.
-	dec_busy_count();
-	gInventory.removeObserver(this);
-	delete this;
+		uuid_vec_t ids;
+		LLRightClickInventoryFetchObserver* outfit = NULL;
+		LLRightClickInventoryFetchDescendentsObserver* categories = NULL;
 
-	// increment busy count and either tell the inventory to check &
-	// call done, or add this object to the inventory for observation.
-	inc_busy_count();
+		// Fetch the items
+		if (item_count)
+		{
+			for (S32 i = 0; i < item_count; ++i)
+			{
+				ids.push_back(item_array->get(i)->getUUID());
+			}
+			outfit = new LLRightClickInventoryFetchObserver(ids);
+		}
+		// Fetch the subfolders
+		if (cat_count)
+		{
+			for (S32 i = 0; i < cat_count; ++i)
+			{
+				ids.push_back(cat_array->get(i)->getUUID());
+			}
+			categories = new LLRightClickInventoryFetchDescendentsObserver(ids);
+		}
 
-	// do the fetch
-	outfit->startFetch();
-	outfit->done();				//Not interested in waiting and this will be right 99% of the time.
-//Uncomment the following code for laggy Inventory UI.
-/*	if(outfit->isFinished())
-	{
-	// everything is already here - call done.
-	outfit->done();
+		// Perform the item fetch
+		if (outfit)
+		{
+			outfit->startFetch();
+			outfit->execute();				// Not interested in waiting and this will be right 99% of the time.
+			delete outfit;
+			// Uncomment the following code for laggy Inventory UI.
+			/*
+			 if (outfit->isFinished())
+			 {
+				// everything is already here - call done.
+				outfit->execute();
+				delete outfit;
+			 }
+			 else
+			 {
+				// it's all on its way - add an observer, and the inventory
+				// will call done for us when everything is here.
+				inc_busy_count();
+				gInventory.addObserver(outfit);
+			}
+			*/
+		}
+		// Perform the subfolders fetch : this is where we truly recurse down the folder hierarchy
+		if (categories)
+		{
+			categories->startFetch();
+			if (categories->isFinished())
+			{
+				// everything is already here - call done.
+				categories->execute();
+				delete categories;
+			}
+			else
+			{
+				// it's all on its way - add an observer, and the inventory
+				// will call done for us when everything is here.
+				inc_busy_count();
+				gInventory.addObserver(categories);
+			}
+		}
 	}
-	else
-	{
-	// it's all on it's way - add an observer, and the inventory
-	// will call done for us when everything is here.
-	gInventory.addObserver(outfit);
-	}*/
 }
 
 
@@ -3375,17 +3404,19 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		folders.push_back(category->getUUID());
 
 		sSelf = getHandle();
-		LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE);
+		LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders);
 		fetch->startFetch();
-		inc_busy_count();
 		if (fetch->isFinished())
 		{
+			// Do not call execute() or done() here as if the folder is here, there's likely no point drilling down 
+			// This saves lots of time as buildContextMenu() is called a lot
 			delete fetch;
 			buildContextMenuFolderOptions(flags);
 		}
 		else
 		{
 			// it's all on its way - add an observer, and the inventory will call done for us when everything is here.
+			inc_busy_count();
 			gInventory.addObserver(fetch);
 		}
 	}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 06e780508b6..0eba8bd0f1a 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1116,7 +1116,8 @@ void LLInventoryModel::purgeDescendentsOf(const LLUUID& id)
 		if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode())
 		{
 			// Something on the clipboard is in "cut mode" and needs to be preserved
-			llinfos << "Merov debug : purging through iteration" << llendl;
+			llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName()
+			<< " iterate and purge non hidden items" << llendl;
 			cat_array_t* categories;
 			item_array_t* items;
 			// Get the list of direct descendants in tha categoy passed as argument
-- 
GitLab


From 9dfb6284df315588b0a387725965e3626d63784c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 13 Mar 2012 21:37:54 -0700
Subject: [PATCH 870/933] EXP-1924 : Relax the cconsistency policy between text
 and UUID on the clipboard.

---
 indra/llui/llclipboard.cpp | 5 -----
 indra/llui/llclipboard.h   | 6 +++++-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 7bf62b5bfcd..14173fdbb0a 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -133,11 +133,6 @@ bool LLClipboard::pasteFromClipboard(LLWString &dst, bool use_primary)
 	bool res = (use_primary ? LLView::getWindow()->pasteTextFromPrimary(dst) : LLView::getWindow()->pasteTextFromClipboard(dst));
 	if (res)
 	{
-		if (dst != mString)
-		{
-			// Invalidate the LL clipboard if the System had a different string in it (i.e. some copy/cut was done in some other app)
-			reset();
-		}
 		mString = dst;
 	}
 	return res;
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index 7f31f66bbe4..fd2e7610df4 100644
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -41,6 +41,10 @@
 //
 // This class is used to cut/copy/paste text strings and inventory items around 
 // the world. Use LLClipboard::instance().method() to use its methods.
+// Note that the text and UUIDs are loosely coupled only. There are few cases
+// where the viewer does offer a serialized version of the UUID on the clipboard.
+// In those case, the text is overridden when copying/cutting the item. 
+// In all other cases, the text and the UUIDs are very much independent.
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 class LLClipboard : public LLSingleton<LLClipboard>
@@ -82,7 +86,7 @@ class LLClipboard : public LLSingleton<LLClipboard>
 
 private:
 	std::vector<LLUUID> mObjects;		// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)
-	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).
+	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment) if the asset type is knowable.
 	bool mCutMode;						// This is a convenience flag for the viewer.
 	int mGeneration;					// Incremented when the clipboard changes so that interested parties can check for changes on the clipboard.	
 };
-- 
GitLab


From 3fc4f469edc6b9ce944204d77a97c78f68a4a135 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 14 Mar 2012 13:59:18 -0700
Subject: [PATCH 871/933] CHUI-60 FIX Initial chat bubble from object is
 incorrectly sized on login bad XUI

---
 indra/newview/skins/default/xui/en/panel_chat_item.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml
index 1b97de2b05e..1ef99649e67 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml
@@ -18,6 +18,7 @@
 	<text_chat
       top="3"
       left="30"
+      right="-10"
       height="120"
       text_color="white"
       word_wrap="true"
-- 
GitLab


From b9521a38f11dd9f44f216adb7d02263d25272572 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 14 Mar 2012 15:00:48 -0700
Subject: [PATCH 872/933] CHUI-59 FIX Floater stacking offset only occurs first
 time a floater is opened changed stacking logic to attempt to stack against
 any floater that is cascade head *or* in a cascade group

---
 indra/llui/llfloaterreg.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index ef55e741660..3d124cf8857 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -96,7 +96,9 @@ LLFloater* LLFloaterReg::getLastFloaterCascading()
 		{
 			LLFloater* inst = *iter;
 
-			if (inst->getVisible() && inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING))
+			if (inst->getVisible() 
+				&& (inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING)
+					|| inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADE_GROUP)))
 			{
 				if (candidate_rect.mTop > inst->getRect().mTop)
 				{
-- 
GitLab


From f4722686d4bd125ebbecac5da511390252a7084e Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 14 Mar 2012 15:36:23 -0700
Subject: [PATCH 873/933] EXP-1841 : Comments clean up

---
 indra/newview/llfolderview.h | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 9a1df5a1427..5705846c0e9 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -61,8 +61,8 @@ class LLTextBox;
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLFolderView
 //
-// Th LLFolderView represents the root level folder view object. It
-// manages the screen region of the folder view.
+// The LLFolderView represents the root level folder view object. 
+// It manages the screen region of the folder view.
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
@@ -88,7 +88,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 
 	virtual LLFolderView*	getRoot() { return this; }
 
-	// FolderViews default to sort by name.  This will change that,
+	// FolderViews default to sort by name. This will change that,
 	// and resort the items if necessary.
 	void setSortOrder(U32 order);
 	void setFilterPermMask(PermissionMask filter_perm_mask);
@@ -117,20 +117,20 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse);
 	virtual BOOL addFolder( LLFolderViewFolder* folder);
 
-	// Finds width and height of this object and it's children.  Also
-	// makes sure that this view and it's children are the right size.
+	// Find width and height of this object and its children. Also
+	// makes sure that this view and its children are the right size.
 	virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
 
 	void arrangeAll() { mArrangeGeneration++; }
 	S32 getArrangeGeneration() { return mArrangeGeneration; }
 
-	// applies filters to control visibility of inventory items
+	// Apply filters to control visibility of inventory items
 	virtual void filter( LLInventoryFilter& filter);
 
-	// get the last selected item
+	// Get the last selected item
 	virtual LLFolderViewItem* getCurSelectedItem( void );
 
-	// Record the selected item and pass it down the hierachy.
+	// Record the selected item and pass it down the hierarchy.
 	virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
 		BOOL take_keyboard_focus);
 
@@ -140,13 +140,13 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	// Called once a frame to update the selection if mSelectThisID has been set
 	void updateSelection();
 
-	// This method is used to toggle the selection of an item. Walks
-	// children, and keeps track of selected objects.
+	// This method is used to toggle the selection of an item. 
+	// Walks children and keeps track of selected objects.
 	virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
 
 	virtual std::set<LLUUID> getSelectionList() const;
 
-	// make sure if ancestor is selected, descendents are not
+	// Make sure if ancestor is selected, descendents are not
 	void sanitizeSelection();
 	void clearSelection();
 	void addToSelectionList(LLFolderViewItem* item);
@@ -157,22 +157,22 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	void setDraggingOverItem(LLFolderViewItem* item) { mDraggingOverItem = item; }
 	LLFolderViewItem* getDraggingOverItem() { return mDraggingOverItem; }
 
-	// deletion functionality
+	// Deletion functionality
  	void removeSelectedItems();
  	static void removeCutItems();
 
-	// open the selected item.
+	// Open the selected item
 	void openSelectedItems( void );
 	void propertiesSelectedItems( void );
 
-	// change the folder type
+	// Change the folder type
 	void changeType(LLInventoryModel *model, LLFolderType::EType new_folder_type);
 
 	void autoOpenItem(LLFolderViewFolder* item);
 	void closeAutoOpenedFolders();
 	BOOL autoOpenTest(LLFolderViewFolder* item);
 
-	// copy & paste
+	// Copy & paste
 	virtual void	copy();
 	virtual BOOL	canCopy() const;
 
@@ -185,7 +185,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	virtual void	doDelete();
 	virtual BOOL	canDoDelete() const;
 
-	// public rename functionality - can only start the process
+	// Public rename functionality - can only start the process
 	void startRenamingSelectedItem( void );
 
 	// These functions were used when there was only one folderview,
@@ -326,7 +326,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 
 	/**
 	 * Is used to determine if we need to cut text In LLFolderViewItem to avoid horizontal scroll.
-	 * NOTE: For now it uses only to cut LLFolderViewItem::mLabel text to be used for Landmarks in Places Panel.
+	 * NOTE: For now it's used only to cut LLFolderViewItem::mLabel text for Landmarks in Places Panel.
 	 */
 	bool							mUseEllipses; // See EXT-719
 
-- 
GitLab


From 34c599858bd64b7fbda767ff9c9f7d8bcd2c2c25 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 16 Mar 2012 01:08:20 +0200
Subject: [PATCH 874/933] CHUI-53 FIXED vertical scroll bar in inventory
 floater to appear when horizontal scroll bar hides last item in folder view.
 Added a scroll container which provides the information about the height of
 currently displayed folder view contents. It is used for updating vertical
 scroll bar visibility in inventory panel.

---
 indra/llui/llscrollcontainer.cpp         | 15 +++++++++----
 indra/llui/llscrollcontainer.h           |  6 +++--
 indra/newview/llfolderview.cpp           | 28 ++++++++++++++++++++++++
 indra/newview/llfolderview.h             | 24 +++++++++++++++++++-
 indra/newview/llinventorypanel.cpp       |  3 ++-
 indra/newview/llpanelobjectinventory.cpp |  2 +-
 6 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 20bed050ada..9b7e30bb048 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -389,10 +389,17 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height
 		{
 			*show_h_scrollbar = TRUE;
 			*visible_height -= scrollbar_size;
-			// Note: Do *not* recompute *show_v_scrollbar here because with
-			// the (- scrollbar_size) we just did we will always add a vertical scrollbar
-			// even if the height of the items is actually less than the visible size.
-			// Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later.
+
+			// The view inside the scroll container should not be extended
+			// to container's full height to ensure the correct computation
+			// of *show_v_scrollbar after subtracting horizontal scrollbar_size.
+
+			// Must retest now that visible_height has changed
+			if( !*show_v_scrollbar && ((doc_height - *visible_height) > 1) )
+			{
+				*show_v_scrollbar = TRUE;
+				*visible_width -= scrollbar_size;
+			}
 		}
 	}
 }
diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h
index 3aa79cc255b..d87c95b3d75 100644
--- a/indra/llui/llscrollcontainer.h
+++ b/indra/llui/llscrollcontainer.h
@@ -91,7 +91,7 @@ class LLScrollContainer : public LLUICtrl
 	void			setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; }
 	LLRect			getVisibleContentRect();
 	LLRect			getContentWindowRect();
-	const LLRect&	getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; }
+	virtual const LLRect	getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; }
 	void			pageUp(S32 overlap = 0);
 	void			pageDown(S32 overlap = 0);
 	void			goToTop();
@@ -116,6 +116,9 @@ class LLScrollContainer : public LLUICtrl
 	
 	bool autoScroll(S32 x, S32 y);
 
+protected:
+	LLView*		mScrolledView;
+
 private:
 	// internal scrollbar handlers
 	virtual void scrollHorizontal( S32 new_pos );
@@ -124,7 +127,6 @@ class LLScrollContainer : public LLUICtrl
 	void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
 
 	LLScrollbar* mScrollbar[SCROLLBAR_COUNT];
-	LLView*		mScrolledView;
 	S32			mSize;
 	BOOL		mIsOpaque;
 	LLUIColor	mBackgroundColor;
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 4a42bb2c247..6c4b7811225 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -164,6 +164,33 @@ void LLCloseAllFoldersFunctor::doFolder(LLFolderViewFolder* folder)
 void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item)
 { }
 
+///----------------------------------------------------------------------------
+/// Class LLFolderViewScrollContainer
+///----------------------------------------------------------------------------
+
+// virtual
+const LLRect LLFolderViewScrollContainer::getScrolledViewRect() const
+{
+	LLRect rect = LLRect::null;
+	if (mScrolledView)
+	{
+		LLFolderView* folder_view = dynamic_cast<LLFolderView*>(mScrolledView);
+		if (folder_view)
+		{
+			S32 height = folder_view->mRunningHeight;
+
+			rect = mScrolledView->getRect();
+			rect.setLeftTopAndSize(rect.mLeft, rect.mTop, rect.getWidth(), height);
+		}
+	}
+
+	return rect;
+}
+
+LLFolderViewScrollContainer::LLFolderViewScrollContainer(const LLScrollContainer::Params& p)
+:	LLScrollContainer(p)
+{}
+
 ///----------------------------------------------------------------------------
 /// Class LLFolderView
 ///----------------------------------------------------------------------------
@@ -535,6 +562,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
 	{
 		width = scroll_rect.getWidth();
 	}
+
 	LLView::reshape(width, height, called_from_parent);
 	mReshapeSignal(mSelectedItems, FALSE);
 }
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 1d018b5e6a7..5c5a3a894fe 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -44,6 +44,7 @@
 #include "lldepthstack.h"
 #include "lleditmenuhandler.h"
 #include "llfontgl.h"
+#include "llscrollcontainer.h"
 #include "lltooldraganddrop.h"
 #include "llviewertexture.h"
 
@@ -54,10 +55,28 @@ class LLInventoryModel;
 class LLPanel;
 class LLLineEditor;
 class LLMenuGL;
-class LLScrollContainer;
 class LLUICtrl;
 class LLTextBox;
 
+/**
+ * Class LLFolderViewScrollContainer
+ *
+ * A scroll container which provides the information about the height
+ * of currently displayed folder view contents.
+ * Used for updating vertical scroll bar visibility in inventory panel.
+ * See LLScrollContainer::calcVisibleSize().
+ */
+class LLFolderViewScrollContainer : public LLScrollContainer
+{
+public:
+	/*virtual*/ ~LLFolderViewScrollContainer() {};
+	/*virtual*/ const LLRect getScrolledViewRect() const;
+
+protected:
+	LLFolderViewScrollContainer(const LLScrollContainer::Params& p);
+	friend class LLUICtrlFactory;
+};
+
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLFolderView
 //
@@ -81,6 +100,9 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 
 		Params();
 	};
+
+	friend class LLFolderViewScrollContainer;
+
 	LLFolderView(const Params&);
 	virtual ~LLFolderView( void );
 
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 01a8ecfb5d8..c47b74815f6 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -206,10 +206,11 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 		scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
 		LLScrollContainer::Params scroller_params(params.scroll());
 		scroller_params.rect(scroller_view_rect);
-		mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroller_params);
+		mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
 		addChild(mScroller);
 		mScroller->addChild(mFolderRoot);
 		mFolderRoot->setScrollContainer(mScroller);
+		mFolderRoot->setFollowsAll();
 		mFolderRoot->addChild(mFolderRoot->mStatusTextBox);
 	}
 
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 98ea6805043..f3ecba71852 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1568,7 +1568,7 @@ void LLPanelObjectInventory::reset()
 	scroll_p.rect(scroller_rect);
 	scroll_p.tab_stop(true);
 	scroll_p.follows.flags(FOLLOWS_ALL);
-	mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroll_p);
+	mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroll_p);
 	addChild(mScroller);
 	mScroller->addChild(mFolders);
 	
-- 
GitLab


From 86c572ad63f0cf222050e807899e80ea5802e1d7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 16 Mar 2012 15:58:05 -0700
Subject: [PATCH 875/933] EXP-1915 : Fetch recursively folders when selected

---
 indra/newview/llinventorybridge.cpp | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9b8c311d16e..8d3ac3e7238 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1775,9 +1775,6 @@ BOOL LLFolderBridge::isItemMovable() const
 		// If it's a protected type folder, we can't move it
 		if (LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType()))
 			return FALSE;
-		// If the folder is not there yet, it's too early to decide if it's movable
-		if (!isUpToDate())
-			return FALSE;
 		return TRUE;
 	}
 	return FALSE;
@@ -1785,9 +1782,10 @@ BOOL LLFolderBridge::isItemMovable() const
 
 void LLFolderBridge::selectItem()
 {
+	// Have no fear: the first thing start() does is to test if everything for that folder has been fetched...
+	LLInventoryModelBackgroundFetch::instance().start(getUUID(), true);
 }
 
-
 // Iterate through a folder's children to determine if
 // all the children are removable.
 class LLIsItemRemovable : public LLFolderViewFunctor
@@ -1813,10 +1811,6 @@ BOOL LLFolderBridge::isItemRemovable() const
 		return FALSE;
 	}
 
-	// If the folder is not there yet, we shouldn't try to remove it yet
-	if (!isUpToDate())
-		return FALSE;
-	
 	LLInventoryPanel* panel = mInventoryPanel.get();
 	LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL);
 	if (folderp)
@@ -1849,10 +1843,6 @@ BOOL LLFolderBridge::isItemCopyable() const
 {
 	// Folders are copyable if items in them are, recursively, copyable.
 	
-	// If the folder is not there yet, it's not copyable
-	if (!isUpToDate())
-		return FALSE;
-		
 	// Get the content of the folder
 	LLInventoryModel::cat_array_t* cat_array;
 	LLInventoryModel::item_array_t* item_array;
-- 
GitLab


From 5e9286f523fe704e6d37c460a6a7ff5b74f9cc6d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 16 Mar 2012 16:34:20 -0700
Subject: [PATCH 876/933] EXP-1767 FIX (Received Items panel state does not
 persist between sessions) made received items not auto resizable save/restore
 received items height on collapse/expand

---
 indra/newview/app_settings/settings.xml       | 11 --------
 .../app_settings/settings_per_account.xml     | 22 ++++++++++++++++
 indra/newview/llsidepanelinventory.cpp        | 26 ++++++++++++++++---
 .../default/xui/en/sidepanel_inventory.xml    |  3 ++-
 4 files changed, 46 insertions(+), 16 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ee659ee39ee..15da381e2f4 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4303,17 +4303,6 @@
         <string>Boolean</string>
         <key>Value</key>
         <integer>0</integer>
-    </map>
-    <key>InventoryInboxToggleState</key>
-    <map>
-        <key>Comment</key>
-        <string>Stores the open/closed state of inventory Received items panel</string>
-        <key>Persist</key>
-        <integer>1</integer>
-        <key>Type</key>
-        <string>Boolean</string>
-        <key>Value</key>
-        <integer>0</integer>
     </map>
 	<key>InventoryLinking</key>
 	<map>
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index 8cdd8ed8380..143126b3345 100644
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -33,6 +33,28 @@
         <key>Value</key>
             <string />
         </map>
+    <key>InventoryInboxHeight</key>
+    <map>
+        <key>Comment</key>
+            <string>Inventory inbox panel height in Inventory floater.</string>
+        <key>Persist</key>
+            <integer>1</integer>
+        <key>Type</key>
+            <string>S32</string>
+        <key>Value</key>
+            <integer>200</integer>
+    </map>
+    <key>InventoryInboxToggleState</key>
+    <map>
+        <key>Comment</key>
+            <string>Stores the open/closed state of inventory Received Items panel.</string>
+        <key>Persist</key>
+            <integer>1</integer>
+        <key>Type</key>
+            <string>Boolean</string>
+        <key>Value</key>
+            <integer>0</integer>
+    </map>
     <key>DisplayDestinationsOnInitialRun</key>
         <map>
         <key>Comment</key>
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index c8b67cc9ecf..4f9ab318a56 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -78,7 +78,6 @@ static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
 //
 // Helpers
 //
-
 class LLInboxAddedObserver : public LLInventoryCategoryAddedObserver
 {
 public:
@@ -130,6 +129,11 @@ LLSidepanelInventory::LLSidepanelInventory()
 
 LLSidepanelInventory::~LLSidepanelInventory()
 {
+	LLLayoutPanel* inbox_layout_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
+
+	// Save the InventoryMainPanelHeight in settings per account
+	gSavedPerAccountSettings.setS32("InventoryInboxHeight", inbox_layout_panel->getTargetDim());
+
 	if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver))
 	{
 		gInventory.removeObserver(mCategoriesObserver);
@@ -226,7 +230,12 @@ BOOL LLSidepanelInventory::postBuild()
 		bool is_inbox_collapsed = !inbox_button->getToggleState();
 
 		// Restore the collapsed inbox panel state
-		inv_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), is_inbox_collapsed);
+		LLLayoutPanel* inbox_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
+		inv_stack->collapsePanel(inbox_panel, is_inbox_collapsed);
+		if (!is_inbox_collapsed)
+		{
+			inbox_panel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight"));
+		}
 
 		// Set the inbox visible based on debug settings (final setting comes from http request below)
 		enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
@@ -370,10 +379,19 @@ void LLSidepanelInventory::onToggleInboxBtn()
 	// Expand/collapse the indicated panel
 	inv_stack->collapsePanel(inboxPanel, !inbox_expanded);
 
-	if (inbox_expanded && inboxPanel->isInVisibleChain())
+	if (inbox_expanded)
 	{
-		gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
+		inboxPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight"));
+		if (inboxPanel->isInVisibleChain())
+		{
+			gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
+		}
 	}
+	else
+	{
+		gSavedPerAccountSettings.setS32("InventoryInboxHeight", inboxPanel->getTargetDim());
+	}
+
 }
 
 void LLSidepanelInventory::onOpen(const LLSD& key)
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 29e27cb1460..bd6e9347039 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -51,7 +51,7 @@
 			    <layout_panel
                  width="330"
                  layout="topleft"
-                 auto_resize="true"
+                 auto_resize="false"
                  user_resize="true"
                  follows="left|right|top"
                  name="inbox_layout_panel"
@@ -105,6 +105,7 @@
                         [NUM] new
                      </text>
                      <panel
+                        name="inbox_inventory_placeholder_panel"
                         follows="all"
                         left="10"
                         bottom="235"
-- 
GitLab


From 7893cc2ed9815f675b760aacc9f3bf38cec9df1a Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 16 Mar 2012 17:36:05 -0700
Subject: [PATCH 877/933] CHUI-61 FIX Relative floater positions not written to
 settings file if previous settings exist from old viewer apply relative
 positioning to floaters that are loaded with rects specified from earlier
 viewer

---
 indra/llui/llfloater.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index b091a4a1f70..9c4bf0a5c2a 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -882,6 +882,10 @@ bool LLFloater::applyRectControl()
 					reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight()));
 				}
 			}
+			mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
+			LLRect screen_rect = calcScreenRect();
+			mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
+			storeRectControl();
 		}
 
 		LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
@@ -898,11 +902,6 @@ bool LLFloater::applyRectControl()
 
 			saved_rect = true;
 		}
-		else
-		{
-			LLRect screen_rect = calcScreenRect();
-			mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
-		}
 	}
 
 	return saved_rect;
-- 
GitLab


From 5f90875a9e92c7c92f92a32e64908a776fce64c6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 16 Mar 2012 17:52:28 -0700
Subject: [PATCH 878/933] EXP-1181 FIX as a designer I would like to specify
 default floater positions using realtive coordinates changed settings naming
 scheme for floater positioning so that related settings appear together in
 file

---
 indra/llui/llfloaterreg.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index 3d124cf8857..9115eb71740 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -375,7 +375,7 @@ std::string LLFloaterReg::declareRectControl(const std::string& name)
 
 std::string LLFloaterReg::declarePosXControl(const std::string& name)
 {
-	std::string controlname = std::string("floater_pos_x_") + getBaseControlName(name);
+	std::string controlname = std::string("floater_pos_") + getBaseControlName(name) + "_x";
 	LLFloater::getControlGroup()->declareF32(controlname, 
 											10.f,
 											llformat("Window X Position for %s", name.c_str()),
@@ -385,7 +385,7 @@ std::string LLFloaterReg::declarePosXControl(const std::string& name)
 
 std::string LLFloaterReg::declarePosYControl(const std::string& name)
 {
-	std::string controlname = std::string("floater_pos_y_") + getBaseControlName(name);
+	std::string controlname = std::string("floater_pos_") + getBaseControlName(name) + "_y";
 	LLFloater::getControlGroup()->declareF32(controlname,
 											10.f,
 											llformat("Window Y Position for %s", name.c_str()),
-- 
GitLab


From 3033ca84745f67169caf518ee97d0aab519897fe Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 20 Mar 2012 10:52:41 -0700
Subject: [PATCH 879/933] CHUI-61 FIX Relative floater positions not written to
 settings file if previous settings exist from old viewer only write back
 floater positioning information generated from legacy saved rect after
 reading any new floater positioning info

---
 indra/llui/llfloater.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 9c4bf0a5c2a..84754d9c4d4 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -885,7 +885,6 @@ bool LLFloater::applyRectControl()
 			mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
 			LLRect screen_rect = calcScreenRect();
 			mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
-			storeRectControl();
 		}
 
 		LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
@@ -904,6 +903,13 @@ bool LLFloater::applyRectControl()
 		}
 	}
 
+	if (saved_rect)
+	{
+		// propagate any derived positioning data back to settings file
+		storeRectControl();
+	}
+
+
 	return saved_rect;
 }
 
-- 
GitLab


From b187aeb8f177bd76e792652e773617beff18b47b Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Mar 2012 12:14:36 -0400
Subject: [PATCH 880/933] Added tag 3.3.0-release for changeset 5e8d2662f38a

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0702c4ee14c..af25a371910 100644
--- a/.hgtags
+++ b/.hgtags
@@ -274,3 +274,4 @@ a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
 d5f263687f43f278107363365938f0a214920a4b DRTVWR-119
 d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
 5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
+5e8d2662f38a66eca6c591295f5880d47afc73f7 3.3.0-release
-- 
GitLab


From 2fe364dfafe0b68fec4f664312cd943beab1d110 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 21 Mar 2012 11:08:04 -0700
Subject: [PATCH 881/933] CHUI-61 FIX Relative floater positions not written to
 settings file if previous settings exist from old viewer

---
 indra/llui/llfloater.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 9c4bf0a5c2a..1fb10faf1e2 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -885,7 +885,6 @@ bool LLFloater::applyRectControl()
 			mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
 			LLRect screen_rect = calcScreenRect();
 			mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
-			storeRectControl();
 		}
 
 		LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
@@ -902,6 +901,12 @@ bool LLFloater::applyRectControl()
 
 			saved_rect = true;
 		}
+
+		// remember updated position
+		if (mPositioning == LLFloaterEnums::POSITIONING_RELATIVE)
+		{
+			storeRectControl();
+		}
 	}
 
 	return saved_rect;
-- 
GitLab


From 71db6d1b91cb8a62959a63ae36d3727e48439245 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 21 Mar 2012 14:01:54 -0700
Subject: [PATCH 882/933] CHUI-61 FIX Relative floater positions not written to
 settings file if previous settings exist from old viewer

---
 indra/llui/llfloater.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 1fb10faf1e2..f6d4daba4ec 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -868,6 +868,7 @@ bool LLFloater::applyRectControl()
 	}
 	else
 	{
+		bool rect_specified = false;
 		if (!mRectControl.empty())
 		{
 			// If we have a saved rect, use it
@@ -881,10 +882,11 @@ bool LLFloater::applyRectControl()
 				{
 					reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight()));
 				}
+				mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
+				LLRect screen_rect = calcScreenRect();
+				mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
+				rect_specified = true;
 			}
-			mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
-			LLRect screen_rect = calcScreenRect();
-			mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
 		}
 
 		LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl);
@@ -903,7 +905,7 @@ bool LLFloater::applyRectControl()
 		}
 
 		// remember updated position
-		if (mPositioning == LLFloaterEnums::POSITIONING_RELATIVE)
+		if (rect_specified)
 		{
 			storeRectControl();
 		}
-- 
GitLab


From 877160479bc706310c2839849cff57961ebd4709 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Mar 2012 20:02:19 -0400
Subject: [PATCH 883/933] Added tag viewer-beta-candidate for changeset
 3e2fca4ed1a0

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index c6e3a150eb5..261b3ef140f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -277,3 +277,5 @@ d5f263687f43f278107363365938f0a214920a4b DRTVWR-119
 d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
 5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
 5e8d2662f38a66eca6c591295f5880d47afc73f7 3.3.0-release
+dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
+3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
-- 
GitLab


From 2ee198af7f7d9a87645ba03a28a9dffaaadcb0f4 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Mar 2012 20:04:20 -0400
Subject: [PATCH 884/933] increment viewer version to 3.3.2

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 26ff1b5c553..fafc7506907 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 3;
-const S32 LL_VERSION_PATCH = 1;
+const S32 LL_VERSION_PATCH = 2;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
GitLab


From 0c99e85d4eb44c3e9a7c7dbf852267cc4dc3e250 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Mar 2012 20:19:34 -0400
Subject: [PATCH 885/933] Added tag 3.3.1-start for changeset b43cd25be49e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 261b3ef140f..e7d520a28b3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -279,3 +279,4 @@ d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
 5e8d2662f38a66eca6c591295f5880d47afc73f7 3.3.0-release
 dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
 3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
+b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
-- 
GitLab


From 7cf82d2ae7667e2f9415e04207b2d93696dc4712 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Mar 2012 20:22:19 -0400
Subject: [PATCH 886/933] Added tag DRTVWR-125, 3.3.1-start for changeset
 3e2fca4ed1a0

---
 .hgtags | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.hgtags b/.hgtags
index e7d520a28b3..aee437e0c4a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -280,3 +280,6 @@ d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
 dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
 3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
 b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
+3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 DRTVWR-125
+b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
+3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 3.3.1-start
-- 
GitLab


From 129a522235e0be1d22d94abec43ba1ca3cfe8b0b Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 22 Mar 2012 12:29:03 -0400
Subject: [PATCH 887/933] STORM-1822 Change size of Block button in dialog
 boxes to help prevent accidental clicks

---
 doc/contributions.txt                | 1 +
 indra/newview/lltoastnotifypanel.cpp | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..9216e48b854 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -610,6 +610,7 @@ Jonathan Yap
 	STORM-1788
 	STORM-1799
 	STORM-1796
+	STORM-1822
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index de305bf3d9d..a8060649ba6 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -243,8 +243,8 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
 	mBtnCallbackData.push_back(userdata);
 
 	LLButton::Params p;
-	bool is_ignore_btn = form_element["index"].asInteger() == -1;
-	const LLFontGL* font = is_ignore_btn ? sFontSmall: sFont; // for ignore button in script dialog
+	bool make_small_btn = form_element["index"].asInteger() == -1 || form_element["index"].asInteger() == -2;
+	const LLFontGL* font = make_small_btn ? sFontSmall: sFont; // for block and ignore buttons in script dialog
 	p.name(form_element["name"].asString());
 	p.label(form_element["text"].asString());
 	p.font(font);
@@ -264,7 +264,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
 		p.rect.width = 1;
 		p.auto_resize = true;
 	}
-	else if (mIsScriptDialog && is_ignore_btn)
+	else if (mIsScriptDialog && make_small_btn)
 	{
 		// this is ignore button, make it smaller
 		p.rect.height = BTN_HEIGHT_SMALL;
-- 
GitLab


From b2085efa8bad3da7442f35f92c8fe7c65019e182 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 22 Mar 2012 12:27:55 -0700
Subject: [PATCH 888/933] CHUI-68 FIX Using arrow keys to scroll through
 inventory folders does not scroll content in view as a side effect, "My
 Inventory" is not selected by default auto selection of filtered items now
 reliably turns itself off as soon as user scrolls or moves keyboard focus to
 inventory

---
 indra/newview/llfolderview.cpp         | 50 +++++++++++++-------------
 indra/newview/llfolderviewitem.cpp     |  8 ++++-
 indra/newview/llfolderviewitem.h       |  3 +-
 indra/newview/llinventoryfilter.cpp    |  5 +++
 indra/newview/llinventoryfilter.h      |  1 +
 indra/newview/llinventoryfunctions.cpp | 16 ++++-----
 6 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 068a6407f74..70899014cb4 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -797,7 +797,7 @@ void LLFolderView::sanitizeSelection()
 	// if nothing selected after prior constraints...
 	if (mSelectedItems.empty())
 	{
-		// ...select first available parent of original selection, or "My Inventory" otherwise
+		// ...select first available parent of original selection
 		LLFolderViewItem* new_selection = NULL;
 		if (original_selected_item)
 		{
@@ -2023,19 +2023,13 @@ void LLFolderView::deleteAllChildren()
 
 void LLFolderView::scrollToShowSelection()
 {
-	// If items are filtered while background fetch is in progress
-	// scrollbar resets to the first filtered item. See EXT-3981.
-	// However we allow scrolling for folder views with mAutoSelectOverride
-	// (used in Places SP) as an exception because the selection in them
-	// is not reset during items filtering. See STORM-133.
-	if ( (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() || mAutoSelectOverride)
-			&& mSelectedItems.size() )
+	if ( mSelectedItems.size() )
 	{
 		mNeedsScroll = TRUE;
 	}
 }
 
-// If the parent is scroll containter, scroll it to make the selection
+// If the parent is scroll container, scroll it to make the selection
 // is maximally visible.
 void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constraint_rect)
 {
@@ -2254,46 +2248,50 @@ void LLFolderView::doIdle()
 		arrangeAll();
 	}
 
+	if (mFilter->isModified() && mFilter->isNotDefault())
+	{
+		mNeedsAutoSelect = TRUE;
+	}
 	mFilter->clearModified();
-	BOOL filter_modified_and_active = mCompletedFilterGeneration < mFilter->getCurrentGeneration() && 
-										mFilter->isNotDefault();
-	mNeedsAutoSelect = filter_modified_and_active &&
-							!(gFocusMgr.childHasKeyboardFocus(this) || gFocusMgr.getMouseCapture());
 
-	// filter to determine visiblity before arranging
+	// filter to determine visibility before arranging
 	filterFromRoot();
 
 	// automatically show matching items, and select first one if we had a selection
-	// do this every frame until user puts keyboard focus into the inventory window
-	// signaling the end of the automatic update
-	// only do this when mNeedsFilter is set, meaning filtered items have
-	// potentially changed
 	if (mNeedsAutoSelect)
 	{
 		LLFastTimer t3(FTM_AUTO_SELECT);
 		// select new item only if a filtered item not currently selected
 		LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back();
-		if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride)
+		if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->potentiallyFiltered()))
 		{
-			// select first filtered item
-			LLSelectFirstFilteredItem filter;
-			applyFunctorRecursively(filter);
+			applyFunctorRecursively(LLSelectFirstFilteredItem());
 		}
 
 		// Open filtered folders for folder views with mAutoSelectOverride=TRUE.
 		// Used by LLPlacesFolderView.
 		if (mAutoSelectOverride && !mFilter->getFilterSubString().empty())
 		{
-			LLOpenFilteredFolders filter;
-			applyFunctorRecursively(filter);
+			applyFunctorRecursively(LLOpenFilteredFolders());
 		}
 
 		scrollToShowSelection();
 	}
 
+	BOOL filter_finished = mCompletedFilterGeneration >= mFilter->getCurrentGeneration() 
+						&& !LLInventoryModelBackgroundFetch::instance().folderFetchActive();
+	if (filter_finished 
+		|| gFocusMgr.childHasKeyboardFocus(inventory_panel) 
+		|| gFocusMgr.childHasMouseCapture(inventory_panel))
+	{
+		// finishing the filter process, giving focus to the folder view, or dragging the scrollbar all stop the auto select process
+		mNeedsAutoSelect = FALSE;
+	}
+
+
 	// during filtering process, try to pin selected item's location on screen
 	// this will happen when searching your inventory and when new items arrive
-	if (filter_modified_and_active)
+	if (!filter_finished)
 	{
 		// calculate rectangle to pin item to at start of animated rearrange
 		if (!mPinningSelectedItem && !mSelectedItems.empty())
@@ -2359,7 +2357,7 @@ void LLFolderView::doIdle()
 	{
 		scrollToShowItem(mSelectedItems.back(), constraint_rect);
 		// continue scrolling until animated layout change is done
-		if (!filter_modified_and_active 
+		if (filter_finished
 			&& (!needsArrange() || !is_visible))
 		{
 			mNeedsScroll = FALSE;
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 712d3e4583e..dce0981a3e7 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -221,6 +221,11 @@ BOOL LLFolderViewItem::potentiallyVisible()
 {
 	// we haven't been checked against min required filter
 	// or we have and we passed
+	return potentiallyFiltered();
+}
+
+BOOL LLFolderViewItem::potentiallyFiltered()
+{
 	return getLastFilterGeneration() < getRoot()->getFilter()->getMinRequiredGeneration() || getFiltered();
 }
 
@@ -1375,7 +1380,8 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
 			&& !mPassedFilter)									// and did not pass the filter
 		{
 			// go ahead and flag this folder as done
-			mLastFilterGeneration = filter_generation;			
+			mLastFilterGeneration = filter_generation;
+			mStringMatchOffset = std::string::npos;
 		}
 		else // filter self only on first pass through
 		{
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 4e8dc2da167..3c7592046a1 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -304,7 +304,8 @@ class LLFolderViewItem : public LLView
 	BOOL			isDescendantOf( const LLFolderViewFolder* potential_ancestor );
 	S32				getIndentation() { return mIndentation; }
 
-	virtual BOOL	potentiallyVisible(); // do we know for a fact that this item has been filtered out?
+	virtual BOOL	potentiallyVisible(); // do we know for a fact that this item won't be displayed?
+	virtual BOOL	potentiallyFiltered(); // do we know for a fact that this item has been filtered out?
 
 	virtual BOOL	getFiltered();
 	virtual BOOL	getFiltered(S32 filter_generation);
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index e859535d18d..4d0af94f9f6 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -402,6 +402,11 @@ std::string::size_type LLInventoryFilter::getStringMatchOffset() const
 	return mSubStringMatchOffset;
 }
 
+BOOL LLInventoryFilter::isDefault() const
+{
+	return !isNotDefault();
+}
+
 // has user modified default filter params?
 BOOL LLInventoryFilter::isNotDefault() const
 {
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 1804637a040..9e600c036f0 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -163,6 +163,7 @@ class LLInventoryFilter
 	// +-------------------------------------------------------------------+
 	// + Default
 	// +-------------------------------------------------------------------+
+	BOOL 				isDefault() const;
 	BOOL 				isNotDefault() const;
 	void 				markDefault();
 	void 				resetDefault();
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 236c997ef61..f74a239fd33 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1059,20 +1059,24 @@ void LLSaveFolderState::setApply(BOOL apply)
 void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
 {
 	LLMemType mt(LLMemType::MTYPE_INVENTORY_DO_FOLDER);
+	LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
+	if(!bridge) return;
+	
 	if(mApply)
 	{
 		// we're applying the open state
-		LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
-		if(!bridge) return;
 		LLUUID id(bridge->getUUID());
 		if(mOpenFolders.find(id) != mOpenFolders.end())
 		{
-			folder->setOpen(TRUE);
+			if (!folder->isOpen())
+			{
+				folder->setOpen(TRUE);
+			}
 		}
 		else
 		{
 			// keep selected filter in its current state, this is less jarring to user
-			if (!folder->isSelected())
+			if (!folder->isSelected() && folder->isOpen())
 			{
 				folder->setOpen(FALSE);
 			}
@@ -1083,8 +1087,6 @@ void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
 		// we're recording state at this point
 		if(folder->isOpen())
 		{
-			LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
-			if(!bridge) return;
 			mOpenFolders.insert(bridge->getUUID());
 		}
 	}
@@ -1120,7 +1122,6 @@ void LLSelectFirstFilteredItem::doItem(LLFolderViewItem *item)
 		{
 			item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
 		}
-		item->getRoot()->scrollToShowSelection();
 		mItemSelected = TRUE;
 	}
 }
@@ -1134,7 +1135,6 @@ void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
 		{
 			folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
 		}
-		folder->getRoot()->scrollToShowSelection();
 		mItemSelected = TRUE;
 	}
 }
-- 
GitLab


From 8ff4c75637ce2b9a55a65ba1fc1db3a23e7b88ec Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 23 Mar 2012 12:03:06 -0700
Subject: [PATCH 889/933] CHUI-70 FIX Build floater and other floaters opened
 in default position become centered in viewer when object is built or viewer
 resized always initialize mPosition

---
 indra/llui/llfloater.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 3f8116d8d63..2cbc12defc7 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -859,6 +859,9 @@ bool LLFloater::applyRectControl()
 {
 	bool saved_rect = false;
 
+	LLRect screen_rect = calcScreenRect();
+	mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
+	
 	LLFloater* last_in_group = LLFloaterReg::getLastFloaterInGroup(mInstanceName);
 	if (last_in_group && last_in_group != this)
 	{
-- 
GitLab


From aa5bd09f1ce5406f0d1d7ac36d2fb7cb30b29fd2 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 23 Mar 2012 13:41:19 -0700
Subject: [PATCH 890/933] fix for gcc

---
 indra/newview/llfolderview.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 70899014cb4..bad0d8cd8f5 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -2265,14 +2265,20 @@ void LLFolderView::doIdle()
 		LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back();
 		if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->potentiallyFiltered()))
 		{
-			applyFunctorRecursively(LLSelectFirstFilteredItem());
+			// these are named variables to get around gcc not binding non-const references to rvalues
+			// and functor application is inherently non-const to allow for stateful functors
+			LLSelectFirstFilteredItem functor;
+			applyFunctorRecursively(functor);
 		}
 
 		// Open filtered folders for folder views with mAutoSelectOverride=TRUE.
 		// Used by LLPlacesFolderView.
 		if (mAutoSelectOverride && !mFilter->getFilterSubString().empty())
 		{
-			applyFunctorRecursively(LLOpenFilteredFolders());
+			// these are named variables to get around gcc not binding non-const references to rvalues
+			// and functor application is inherently non-const to allow for stateful functors
+			LLOpenFilteredFolders functor;
+			applyFunctorRecursively(functor);
 		}
 
 		scrollToShowSelection();
-- 
GitLab


From 6e4e971fd27826f90c1728c7fd17242083e230fc Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 23 Mar 2012 18:31:09 -0700
Subject: [PATCH 891/933] EXP-1925 WIP Inventory folders being pasted to are
 hidden during a paste operation potential fix by not changing
 mostfiltereddescendant flag when dirtying folder as new contents arrive

---
 indra/newview/llfolderviewitem.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index dce0981a3e7..d2b4866987e 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -1165,8 +1165,8 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
 	}
 
 	// evaluate mHasVisibleChildren
-	mHasVisibleChildren = hasFilteredDescendants(filter_generation);
-	if (mHasVisibleChildren)
+	mHasVisibleChildren = false;
+	if (hasFilteredDescendants(filter_generation))
 	{
 		// We have to verify that there's at least one child that's not filtered out
 		bool found = false;
@@ -1192,6 +1192,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
 					break;
 			}
 		}
+
 		mHasVisibleChildren = found;
 	}
 
@@ -1346,7 +1347,7 @@ void LLFolderViewFolder::requestSort()
 
 void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recurse_up)
 {
-	mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation);
+	//mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation);
 	mCompletedFilterGeneration = generation;
 	// only aggregate up if we are a lower (older) value
 	if (recurse_up
-- 
GitLab


From c7106a02b9d16256f2677778074322707faf4d83 Mon Sep 17 00:00:00 2001
From: Jonathan Goodman <geenz@geenzo.com>
Date: Mon, 26 Mar 2012 13:44:28 -0400
Subject: [PATCH 892/933] Merging latest changes for normalized blinn-phong.

---
 doc/contributions.txt                         |  2 +
 indra/newview/app_settings/settings.xml       |  4 +-
 .../class1/deferred/multiPointLightF.glsl     |  2 +-
 .../shaders/class1/deferred/pointLightF.glsl  |  2 +-
 .../shaders/class1/deferred/softenLightF.glsl |  2 +-
 .../shaders/class2/deferred/softenLightF.glsl |  2 +-
 indra/newview/llviewercontrol.cpp             | 16 +++-
 indra/newview/pipeline.cpp                    | 82 ++++++++++++-------
 indra/newview/pipeline.h                      |  2 +
 9 files changed, 76 insertions(+), 38 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..354c1fb2740 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -395,6 +395,8 @@ Frontera Thor
 Fury Rosewood
 Gaberoonie Zanzibar
 Ganymedes Costagravas
+Geenz Spad
+	STORM-1823
 Gene Frostbite
 GeneJ Composer
 Geneko Nemeth
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0e26013152c..c2416ba9708 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8217,7 +8217,7 @@
     <key>Type</key>
     <string>U32</string>
     <key>Value</key>
-    <real>128</real>
+    <real>512</real>
   </map>
 
   <key>RenderSpecularResY</key>
@@ -8241,7 +8241,7 @@
     <key>Type</key>
     <string>F32</string>
     <key>Value</key>
-    <real>8</real>
+    <real>384</real>
   </map>
 
   <key>RenderDeferred</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 179c721a2fa..ef2d70ca589 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -126,7 +126,7 @@ void main()
 				
 				if (sa > 0.0)
 				{
-					sa = texture2D(lightFunc,vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
+					sa = 6 * texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
 					sa *= noise;
 					col += da*sa*light_col[i].rgb*spec.rgb;
 				}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index b673d00d6e2..f5a577c04a2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -107,7 +107,7 @@ void main()
 		float sa = dot(normalize(lv-normalize(pos)),norm);
 		if (sa > 0.0)
 		{
-			sa = texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
+			sa = 6 * texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0);
 			sa *= noise;
 			col += da*sa*color.rgb*spec.rgb;
 		}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 51110ae4df7..2b0671b47fb 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -299,7 +299,7 @@ void main()
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
 			float sa = dot(refnormpersp, sun_dir.xyz);
-			vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).r;
+			vec3 dumbshiny = vary_SunlitColor*(6 * texture2D(lightFunc, vec2(sa, spec.a)).r);
 			
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 97f3063a9e1..471a4e02360 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -307,7 +307,7 @@ void main()
 			//
 			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
 			float sa = dot(refnormpersp, sun_dir.xyz);
-			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r;
+			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*(6 * texture2D(lightFunc, vec2(sa, spec.a)).r);
 
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 093b84413a0..ab45aae5cc9 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -181,6 +181,16 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue)
 	return true;
 }
 
+static bool handleLUTBufferChanged(const LLSD& newvalue)
+{
+	if (gPipeline.isInit())
+	{
+		gPipeline.releaseLUTBuffers();
+		gPipeline.createLUTBuffers();
+	}
+	return true;
+}
+
 static bool handleAnisotropicChanged(const LLSD& newvalue)
 {
 	LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean();
@@ -569,9 +579,9 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderDepthOfField")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
-	gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
-	gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
-	gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
+	gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleLUTBufferChanged, _2));
+	gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleLUTBufferChanged, _2));
+	gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleLUTBufferChanged, _2));
 	gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2));
 	gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
 	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c523a78b221..b7417549ab8 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1032,11 +1032,7 @@ void LLPipeline::releaseGLBuffers()
 		mTrueNoiseMap = 0;
 	}
 
-	if (mLightFunc)
-	{
-		LLImageGL::deleteTextures(1, &mLightFunc);
-		mLightFunc = 0;
-	}
+	releaseLUTBuffers();
 
 	mWaterRef.release();
 	mWaterDis.release();
@@ -1052,6 +1048,15 @@ void LLPipeline::releaseGLBuffers()
 	LLVOAvatar::resetImpostors();
 }
 
+void LLPipeline::releaseLUTBuffers()
+{
+	if (mLightFunc)
+	{
+		LLImageGL::deleteTextures(1, &mLightFunc);
+		mLightFunc = 0;
+	}
+}
+
 void LLPipeline::releaseScreenBuffers()
 {
 	mUIScreen.release();
@@ -1146,50 +1151,69 @@ void LLPipeline::createGLBuffers()
 			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
 		}
 
+		createLUTBuffers();
+	}
+
+	gBumpImageList.restoreGL();
+}
+
+void LLPipeline::createLUTBuffers()
+{
+	if (sRenderDeferred)
+	{
 		if (!mLightFunc)
 		{
 			U32 lightResX = gSavedSettings.getU32("RenderSpecularResX");
 			U32 lightResY = gSavedSettings.getU32("RenderSpecularResY");
-			U8* lg = new U8[lightResX*lightResY];
-
+			U8* ls = new U8[lightResX*lightResY];
+			F32 specExp = gSavedSettings.getF32("RenderSpecularExponent");
+            // Calculate the (normalized) Blinn-Phong specular lookup texture.
 			for (U32 y = 0; y < lightResY; ++y)
 			{
 				for (U32 x = 0; x < lightResX; ++x)
 				{
-					//spec func
+					ls[y*lightResX+x] = 0;
 					F32 sa = (F32) x/(lightResX-1);
 					F32 spec = (F32) y/(lightResY-1);
-					//lg[y*lightResX+x] = (U8) (powf(sa, 128.f*spec*spec)*255);
-
-					//F32 sp = acosf(sa)/(1.f-spec);
-
-					sa = powf(sa, gSavedSettings.getF32("RenderSpecularExponent"));
-					F32 a = acosf(sa*0.25f+0.75f);
-					F32 m = llmax(0.5f-spec*0.5f, 0.001f);
-					F32 t2 = tanf(a)/m;
-					t2 *= t2;
-
-					F32 c4a = (3.f+4.f*cosf(2.f*a)+cosf(4.f*a))/8.f;
-					F32 bd = 1.f/(4.f*m*m*c4a)*powf(F_E, -t2);
-
-					lg[y*lightResX+x] = (U8) (llclamp(bd, 0.f, 1.f)*255);
+					F32 n = spec * spec * specExp;
+					
+					// Nothing special here.  Just your typical blinn-phong term.
+					spec = powf(sa, n);
+					
+					// Apply our normalization function.
+					// Note: This is the full equation that applies the full normalization curve, not an approximation.
+					// This is fine, given we only need to create our LUT once per buffer initialization.
+					// The only trade off is we have a really low dynamic range.
+					// This means we have to account for things not being able to exceed 0 to 1 in our shaders.
+					spec *= (((n + 2) * (n + 4)) / (8 * F_PI * (powf(2, -n/2) + n)));
+					
+					// Always sample at a 1.0/2.2 curve.
+					// This "Gamma corrects" our specular term, boosting our lower exponent reflections.
+					spec = powf(spec, 1.f/2.2f);
+					
+					// Easy fix for our dynamic range problem: divide by 6 here, multiply by 6 in our shaders.
+					// This allows for our specular term to exceed a value of 1 in our shaders.
+					// This is something that can be important for energy conserving specular models where higher exponents can result in highlights that exceed a range of 0 to 1.
+					// Technically, we could just use an R16F texture, but driver support for R16F textures can be somewhat spotty at times.
+					// This works remarkably well for higher specular exponents, though banding can sometimes be seen on lower exponents.
+					// Combined with a bit of noise and trilinear filtering, the banding is hardly noticable.
+					ls[y*lightResX+x] = (U8)(llclamp(spec * (1.f / 6), 0.f, 1.f) * 255);
 				}
 			}
-
+			
 			LLImageGL::generateTextures(1, &mLightFunc);
 			gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc);
-			LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R8, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, lg);
+			LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R8, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, ls);
 			gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
 			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR);
-
-			delete [] lg;
+			
+			delete [] ls;
 		}
 	}
-
-	gBumpImageList.restoreGL();
 }
 
-void LLPipeline::restoreGL() 
+
+void LLPipeline::restoreGL()
 {
 	LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_RESTORE_GL);
 	assertInitialized();
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 9c78048c46a..8db27dd0f79 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -113,8 +113,10 @@ class LLPipeline
 	void resetVertexBuffers();
 	void resizeScreenTexture();
 	void releaseGLBuffers();
+	void releaseLUTBuffers();
 	void releaseScreenBuffers();
 	void createGLBuffers();
+	void createLUTBuffers();
 
 	void allocateScreenBuffer(U32 resX, U32 resY);
 	bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples);
-- 
GitLab


From f71ca079982e67713772b0500bbed876efb0c3e9 Mon Sep 17 00:00:00 2001
From: Vaalith Jinn <none@none>
Date: Mon, 2 Apr 2012 09:34:14 -0400
Subject: [PATCH 893/933] storm-64: Local Textures

---
 doc/contributions.txt                         |   2 +
 indra/newview/CMakeLists.txt                  |   2 +
 indra/newview/lllocalbitmaps.cpp              | 925 ++++++++++++++++++
 indra/newview/lllocalbitmaps.h                | 130 +++
 indra/newview/lltexturectrl.cpp               | 172 +++-
 indra/newview/lltexturectrl.h                 |   2 +-
 indra/newview/llviewertexturelist.h           |   1 +
 indra/newview/llwearable.cpp                  |  14 +
 indra/newview/llwearable.h                    |   1 +
 .../default/xui/en/floater_texture_ctrl.xml   | 192 +++-
 10 files changed, 1381 insertions(+), 60 deletions(-)
 create mode 100644 indra/newview/lllocalbitmaps.cpp
 create mode 100644 indra/newview/lllocalbitmaps.h

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c5db396c972..a024815b8e3 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1171,6 +1171,8 @@ Unlikely Quintessa
 UsikuFarasi Kanarik
 Vadim Bigbear
 	VWR-2681
+Vaalith Jinn
+    STORM-64
 Vector Hastings
 	VWR-8726
 Veritas Raymaker
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f85b943c70d..54134fb6104 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -303,6 +303,7 @@ set(viewer_SOURCE_FILES
     lllistbrowser.cpp
     lllistcontextmenu.cpp
     lllistview.cpp
+    lllocalbitmaps.cpp
     lllocaltextureobject.cpp
     lllocationhistory.cpp
     lllocationinputctrl.cpp
@@ -859,6 +860,7 @@ set(viewer_HEADER_FILES
     lllistbrowser.h
     lllistcontextmenu.h
     lllistview.h
+    lllocalbitmaps.h
     lllocaltextureobject.h
     lllocationhistory.h
     lllocationinputctrl.h
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
new file mode 100644
index 00000000000..b96fc062261
--- /dev/null
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -0,0 +1,925 @@
+/** 
+ * @file lllocalbitmaps.cpp
+ * @author Vaalith Jinn
+ * @brief Local Bitmaps source
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+/* precompiled headers */
+#include "llviewerprecompiledheaders.h"
+
+/* own header */
+#include "lllocalbitmaps.h"
+
+/* boost: will not compile unless equivalent is undef'd, beware. */
+#ifdef equivalent
+#undef equivalent
+#endif 
+#include <boost/filesystem.hpp>
+
+/* image compression headers. */
+#include "llimagebmp.h"
+#include "llimagetga.h"
+#include "llimagejpeg.h"
+#include "llimagepng.h"
+
+/* time headers */
+#include <time.h>
+#include <ctime>
+
+/* misc headers */
+#include "llscrolllistctrl.h"
+#include "llfilepicker.h"
+#include "llviewertexturelist.h"
+#include "llviewerobjectlist.h"
+#include "llviewerobject.h"
+#include "llface.h"
+#include "llvoavatarself.h"
+#include "llwearable.h"
+#include "llagentwearables.h"
+#include "lltexlayerparams.h"
+#include "llvovolume.h"
+
+/*=======================================*/
+/*  Formal declarations, constants, etc. */
+/*=======================================*/ 
+std::list<LLLocalBitmap*>   LLLocalBitmapMgr::sBitmapList;
+LLLocalBitmapTimer          LLLocalBitmapMgr::sTimer;
+bool                        LLLocalBitmapMgr::sNeedsRebake;
+
+static const F32 LL_LOCAL_TIMER_HEARTBEAT   = 3.0;
+static const BOOL LL_LOCAL_USE_MIPMAPS      = true;
+static const S32 LL_LOCAL_DISCARD_LEVEL     = 0;
+static const U32 LL_LOCAL_TEXLAYER_FOR_IDX  = 0;
+static const bool LL_LOCAL_SLAM_FOR_DEBUG   = true;
+static const bool LL_LOCAL_REPLACE_ON_DEL   = true;
+static const S32 LL_LOCAL_UPDATE_RETRIES    = 5;
+
+/*=======================================*/
+/*  LLLocalBitmap: unit class            */
+/*=======================================*/ 
+LLLocalBitmap::LLLocalBitmap(std::string filename)
+	: mFilename(filename)
+	, mShortName(gDirUtilp->getBaseFileName(filename, true))
+	, mValid(false)
+	, mLastModified()
+	, mLinkStatus(LS_ON)
+	, mUpdateRetries(LL_LOCAL_UPDATE_RETRIES)
+{
+	mTrackingID.generate();
+
+	/* extension */
+	std::string temp_exten = gDirUtilp->getExtension(mFilename);
+
+	if (temp_exten == "bmp")
+	{ 
+		mExtension = ET_IMG_BMP;
+	}
+	else if (temp_exten == "tga")
+	{
+		mExtension = ET_IMG_TGA;
+	}
+	else if (temp_exten == "jpg" || temp_exten == "jpeg")
+	{
+		mExtension = ET_IMG_JPG;
+	}
+	else if (temp_exten == "png")
+	{
+		mExtension = ET_IMG_PNG;
+	}
+	else
+	{
+		llwarns << "File of no valid extension given, local bitmap creation aborted." << "\n"
+			    << "Filename: " << mFilename << llendl;
+		return; // no valid extension.
+	}
+
+	/* next phase of unit creation is nearly the same as an update cycle.
+	   true means the unit's update is running for the first time so it will not check 
+	   for current usage nor will it attempt to replace the old, non existent image */
+	mValid = updateSelf(true);
+}
+
+LLLocalBitmap::~LLLocalBitmap()
+{
+	// replace IDs with defaults, if set to do so.
+	if(LL_LOCAL_REPLACE_ON_DEL)
+	{
+		replaceIDs(mWorldID, IMG_DEFAULT);
+		LLLocalBitmapMgr::doRebake();
+	}
+
+	// delete self from gimagelist
+	LLViewerFetchedTexture* image = gTextureList.findImage(mWorldID);
+	gTextureList.deleteImage(image);
+
+	if (image)
+	{
+		image->unref();
+	}
+}
+
+/* accessors */
+std::string LLLocalBitmap::getFilename()
+{
+	return mFilename;
+}
+
+std::string LLLocalBitmap::getShortName()
+{
+	return mShortName;
+}
+
+LLUUID LLLocalBitmap::getTrackingID()
+{
+	return mTrackingID;
+}
+
+LLUUID LLLocalBitmap::getWorldID()
+{
+	return mWorldID;
+}
+
+bool LLLocalBitmap::getValid()
+{
+	return mValid;
+}
+
+/* update functions */
+bool LLLocalBitmap::updateSelf(bool first_update)
+{
+	bool updated = false;
+	
+	if (mLinkStatus == LS_ON)
+	{
+		// verifying that the file exists
+		if (gDirUtilp->fileExists(mFilename))
+		{
+			// verifying that the file has indeed been modified
+			const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(mFilename));
+			LLSD new_last_modified = asctime(localtime(&temp_time));
+
+			if (mLastModified.asString() != new_last_modified.asString())
+			{
+				/* loading the image file and decoding it, here is a critical point which,
+				   if fails, invalidates the whole update (or unit creation) process. */
+				LLPointer<LLImageRaw> raw_image = new LLImageRaw();
+				if (decodeBitmap(raw_image))
+				{
+					// decode is successful, we can safely proceed.
+					LLUUID old_id = LLUUID::null;
+					if (!first_update && !mWorldID.isNull())
+					{
+						old_id = mWorldID;
+					}
+					mWorldID.generate();
+					mLastModified = new_last_modified;
+
+					LLPointer<LLViewerFetchedTexture> texture = new LLViewerFetchedTexture
+						("file://"+mFilename, mWorldID, LL_LOCAL_USE_MIPMAPS);
+
+					texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image);
+					texture->setCachedRawImage(LL_LOCAL_DISCARD_LEVEL, raw_image);
+					texture->ref(); 
+
+					gTextureList.addImage(texture);
+			
+					if (!first_update)
+					{
+						// seek out everything old_id uses and replace it with mWorldID
+						replaceIDs(old_id, mWorldID);
+
+						// remove old_id from gimagelist
+						LLViewerFetchedTexture* image = gTextureList.findImage(old_id);
+						gTextureList.deleteImage(image);
+						image->unref();
+					}
+
+					mUpdateRetries = LL_LOCAL_UPDATE_RETRIES;
+					updated = true;
+				}
+
+				// if decoding failed, we get here and it will attempt to decode it in the next cycles
+				// until mUpdateRetries runs out. this is done because some software lock the bitmap while writing to it
+				else
+				{
+					if (mUpdateRetries)
+					{
+						mUpdateRetries--;
+					}
+					else
+					{
+						llwarns << "During the update process the following file was found" << "\n"
+							    << "but could not be opened or decoded for " << LL_LOCAL_UPDATE_RETRIES << " attempts." << "\n"
+								<< "Filename: " << mFilename << "\n"
+								<< "Disabling further update attempts for this file." << llendl;
+
+						mLinkStatus = LS_BROKEN;
+					}
+				}		
+			}
+			
+		} // end if file exists
+
+		else
+		{
+			llwarns << "During the update process, the following file was not found." << "\n" 
+			        << "Filename: " << mFilename << "\n"
+				    << "Disabling further update attempts for this file." << llendl;
+
+			mLinkStatus = LS_BROKEN;
+		}
+	}
+
+	return updated;
+}
+
+bool LLLocalBitmap::decodeBitmap(LLPointer<LLImageRaw> rawimg)
+{
+	bool decode_successful = false;
+
+	switch (mExtension)
+	{
+		case ET_IMG_BMP:
+		{
+			LLPointer<LLImageBMP> bmp_image = new LLImageBMP;
+			if (bmp_image->load(mFilename) && bmp_image->decode(rawimg, 0.0f))
+			{
+				rawimg->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+				decode_successful = true;
+			}
+			break;
+		}
+
+		case ET_IMG_TGA:
+		{
+			LLPointer<LLImageTGA> tga_image = new LLImageTGA;
+			if ((tga_image->load(mFilename) && tga_image->decode(rawimg))
+			&& ((tga_image->getComponents() == 3) || (tga_image->getComponents() == 4)))
+			{
+				rawimg->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+				decode_successful = true;
+			}
+			break;
+		}
+
+		case ET_IMG_JPG:
+		{
+			LLPointer<LLImageJPEG> jpeg_image = new LLImageJPEG;
+			if (jpeg_image->load(mFilename) && jpeg_image->decode(rawimg, 0.0f))
+			{
+				rawimg->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+				decode_successful = true;
+			}
+			break;
+		}
+
+		case ET_IMG_PNG:
+		{
+			LLPointer<LLImagePNG> png_image = new LLImagePNG;
+			if (png_image->load(mFilename) && png_image->decode(rawimg, 0.0f))
+			{
+				rawimg->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
+				decode_successful = true;
+			}
+			break;
+		}
+
+		default:
+		{
+			// separating this into -several- llwarns calls because in the extremely unlikely case that this happens
+			// accessing mFilename and any other object properties might very well crash the viewer.
+			// getting here should be impossible, or there's been a pretty serious bug.
+
+			llwarns << "During a decode attempt, the following local bitmap had no properly assigned extension." << llendl;
+			llwarns << "Filename: " << mFilename << llendl;
+		    llwarns << "Disabling further update attempts for this file." << llendl;
+			mLinkStatus = LS_BROKEN;
+		}
+	}
+
+	return decode_successful;
+}
+
+void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id)
+{
+	// checking for misuse.
+	if (old_id == new_id)
+	{
+		llinfos << "An attempt was made to replace a texture with itself. (matching UUIDs)" << "\n"
+			    << "Texture UUID: " << old_id.asString() << llendl;
+		return;
+	}
+
+	updateUserPrims(old_id, new_id);
+	updateUserSculpts(old_id, new_id); // isn't there supposed to be an IMG_DEFAULT_SCULPT or something?
+	
+	// default safeguard image for layers
+	if( new_id == IMG_DEFAULT )
+	{
+		new_id = IMG_DEFAULT_AVATAR;
+	}
+
+	/* It doesn't actually update all of those, it merely checks if any of them
+		contain the referenced ID and if so, updates. */
+	updateUserLayers(old_id, new_id, LLWearableType::WT_ALPHA);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_EYES);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_GLOVES);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_JACKET);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_PANTS);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_SHIRT);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_SHOES);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_SKIN);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_SKIRT);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_SOCKS);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_TATTOO);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_UNDERPANTS);
+	updateUserLayers(old_id, new_id, LLWearableType::WT_UNDERSHIRT);
+}
+
+// this function sorts the faces from a getFaceList[getNumFaces] into a list of objects
+// in order to prevent multiple sendTEUpdate calls per object during updateUserPrims
+std::vector<LLViewerObject*> LLLocalBitmap::prepUpdateObjects(LLUUID old_id)
+{
+	std::vector<LLViewerObject*> obj_list;
+	LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id);
+
+	for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(); face_iterator++)
+	{
+		// getting an object from a face
+		LLFace* face_to_object = (*old_texture->getFaceList())[face_iterator];
+
+		if(face_to_object)
+		{
+			LLViewerObject* affected_object = face_to_object->getViewerObject();
+
+			if(affected_object)
+			{
+
+				// we have an object, we'll take it's UUID and compare it to
+				// whatever we already have in the returnable object list.
+				// if there is a match - we do not add (to prevent duplicates)
+				LLUUID mainlist_obj_id = affected_object->getID();
+				bool add_object = true;
+
+				// begin looking for duplicates
+				std::vector<LLViewerObject*>::iterator objlist_iter = obj_list.begin();
+				for(; (objlist_iter != obj_list.end()) && add_object; objlist_iter++)
+				{
+					LLViewerObject* obj = *objlist_iter;
+					if (obj->getID() == mainlist_obj_id)
+					{
+						add_object = false; // duplicate found.
+					}
+				}
+				// end looking for duplicates
+
+				if(add_object)
+				{
+					obj_list.push_back(affected_object);
+				}
+
+			}
+
+		}
+		
+	} // end of face-iterating for()
+
+	return obj_list;
+}
+
+void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id)
+{
+	std::vector<LLViewerObject*> objectlist = prepUpdateObjects(old_id);
+
+	for(std::vector<LLViewerObject*>::iterator object_iterator = objectlist.begin();
+		object_iterator != objectlist.end(); object_iterator++)
+	{
+		LLViewerObject* object = *object_iterator;
+
+		if(object)
+		{
+			bool update_obj = false;
+			S32 num_faces = object->getNumFaces();
+
+			for (U8 face_iter = 0; face_iter < num_faces; face_iter++)
+			{
+				if (object->mDrawable)
+				{
+					LLFace* face = object->mDrawable->getFace(face_iter);
+					if (face && face->getTexture() && face->getTexture()->getID() == old_id)
+					{
+						object->setTEImage(face_iter, LLViewerTextureManager::getFetchedTexture
+							(new_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
+
+						update_obj = true;
+					}
+				}
+			}
+			
+			if (update_obj)
+			{
+				object->sendTEUpdate();
+			}
+		}
+	}
+	
+}
+
+void LLLocalBitmap::updateUserSculpts(LLUUID old_id, LLUUID new_id)
+{
+	LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id);
+	for(U32 volume_iter = 0; volume_iter < old_texture->getNumVolumes(); volume_iter++)
+	{
+		LLVOVolume* volume_to_object = (*old_texture->getVolumeList())[volume_iter];
+		LLViewerObject* object = (LLViewerObject*)volume_to_object;
+	
+		if(object)
+		{
+			if (object->isSculpted() && object->getVolume() &&
+				object->getVolume()->getParams().getSculptID() == old_id)
+			{
+				LLSculptParams* old_params = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+				LLSculptParams new_params(*old_params);
+				new_params.setSculptTexture(new_id);
+				object->setParameterEntry(LLNetworkData::PARAMS_SCULPT, new_params, TRUE);
+			}
+		}
+	}
+}
+
+void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableType::EType type)
+{
+	U32 count = gAgentWearables.getWearableCount(type);
+	for(U32 wearable_iter = 0; wearable_iter < count; wearable_iter++)
+	{
+		LLWearable* wearable = gAgentWearables.getWearable(type, wearable_iter);
+		if (wearable)
+		{
+			std::vector<LLLocalTextureObject*> texture_list = wearable->getLocalTextureListSeq();
+			for(std::vector<LLLocalTextureObject*>::iterator texture_iter = texture_list.begin();
+				texture_iter != texture_list.end(); texture_iter++)
+			{
+				LLLocalTextureObject* lto = *texture_iter;
+
+				if (lto && lto->getID() == old_id)
+				{
+					U32 local_texlayer_index = 0; /* can't keep that as static const, gives errors, so i'm leaving this var here */
+					LLVOAvatarDefines::EBakedTextureIndex baked_texind =
+						lto->getTexLayer(local_texlayer_index)->getTexLayerSet()->getBakedTexIndex();
+				
+					LLVOAvatarDefines::ETextureIndex reg_texind = getTexIndex(type, baked_texind);
+					if (reg_texind != LLVOAvatarDefines::TEX_NUM_INDICES)
+					{
+						U32 index = gAgentWearables.getWearableIndex(wearable);
+						gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index);
+						gAgentAvatarp->wearableUpdated(type, FALSE);
+
+						/* telling the manager to rebake once update cycle is fully done */
+						LLLocalBitmapMgr::setNeedsRebake();
+					}
+
+				}
+			}
+		}
+	}
+}
+
+LLVOAvatarDefines::ETextureIndex LLLocalBitmap::getTexIndex(
+	LLWearableType::EType type, LLVOAvatarDefines::EBakedTextureIndex baked_texind)
+{
+	LLVOAvatarDefines::ETextureIndex result = LLVOAvatarDefines::TEX_NUM_INDICES; // using as a default/fail return.
+
+	switch(type)
+	{
+		case LLWearableType::WT_ALPHA:
+		{
+			switch(baked_texind)
+			{
+				case LLVOAvatarDefines::BAKED_EYES:
+				{
+					result = LLVOAvatarDefines::TEX_EYES_ALPHA;
+					break;
+				}
+
+				case LLVOAvatarDefines::BAKED_HAIR:
+				{
+					result = LLVOAvatarDefines::TEX_HAIR_ALPHA;
+					break;
+				}
+
+				case LLVOAvatarDefines::BAKED_HEAD:
+				{
+					result = LLVOAvatarDefines::TEX_HEAD_ALPHA;
+					break;
+				}
+
+				case LLVOAvatarDefines::BAKED_LOWER:
+				{
+					result = LLVOAvatarDefines::TEX_LOWER_ALPHA;
+					break;
+				}
+				case LLVOAvatarDefines::BAKED_UPPER:
+				{
+					result = LLVOAvatarDefines::TEX_UPPER_ALPHA;
+					break;
+				}
+
+				default:
+				{
+					break;
+				}
+
+			}
+			break;
+
+		}
+
+		case LLWearableType::WT_EYES:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_EYES)
+			{
+				result = LLVOAvatarDefines::TEX_EYES_IRIS;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_GLOVES:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_UPPER)
+			{
+				result = LLVOAvatarDefines::TEX_UPPER_GLOVES;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_JACKET:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_LOWER)
+			{
+				result = LLVOAvatarDefines::TEX_LOWER_JACKET;
+			}
+			else if (baked_texind == LLVOAvatarDefines::BAKED_UPPER)
+			{
+				result = LLVOAvatarDefines::TEX_UPPER_JACKET;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_PANTS:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_LOWER)
+			{
+				result = LLVOAvatarDefines::TEX_LOWER_PANTS;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_SHIRT:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_UPPER)
+			{
+				result = LLVOAvatarDefines::TEX_UPPER_SHIRT;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_SHOES:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_LOWER)
+			{
+				result = LLVOAvatarDefines::TEX_LOWER_SHOES;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_SKIN:
+		{
+			switch(baked_texind)
+			{
+				case LLVOAvatarDefines::BAKED_HEAD:
+				{
+					result = LLVOAvatarDefines::TEX_HEAD_BODYPAINT;
+					break;
+				}
+
+				case LLVOAvatarDefines::BAKED_LOWER:
+				{
+					result = LLVOAvatarDefines::TEX_LOWER_BODYPAINT;
+					break;
+				}
+				case LLVOAvatarDefines::BAKED_UPPER:
+				{
+					result = LLVOAvatarDefines::TEX_UPPER_BODYPAINT;
+					break;
+				}
+
+				default:
+				{
+					break;
+				}
+
+			}
+			break;
+		}
+
+		case LLWearableType::WT_SKIRT:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_SKIRT)
+			{
+				result = LLVOAvatarDefines::TEX_SKIRT;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_SOCKS:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_LOWER)
+			{
+				result = LLVOAvatarDefines::TEX_LOWER_SOCKS;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_TATTOO:
+		{
+			switch(baked_texind)
+			{
+				case LLVOAvatarDefines::BAKED_HEAD:
+				{
+					result = LLVOAvatarDefines::TEX_HEAD_TATTOO;
+					break;
+				}
+
+				case LLVOAvatarDefines::BAKED_LOWER:
+				{
+					result = LLVOAvatarDefines::TEX_LOWER_TATTOO;
+					break;
+				}
+				case LLVOAvatarDefines::BAKED_UPPER:
+				{
+					result = LLVOAvatarDefines::TEX_UPPER_TATTOO;
+					break;
+				}
+
+				default:
+				{
+					break;
+				}
+
+			}
+			break;
+		}
+
+		case LLWearableType::WT_UNDERPANTS:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_LOWER)
+			{
+				result = LLVOAvatarDefines::TEX_LOWER_UNDERPANTS;
+			}
+
+			break;
+		}
+
+		case LLWearableType::WT_UNDERSHIRT:
+		{
+			if (baked_texind == LLVOAvatarDefines::BAKED_UPPER)
+			{
+				result = LLVOAvatarDefines::TEX_UPPER_UNDERSHIRT;
+			}
+
+			break;
+		}
+
+		default:
+		{
+			llwarns << "Unknown wearable type: " << (int)type << "\n"
+				    << "Baked Texture Index: " << (int)baked_texind << "\n"
+					<< "Filename: " << mFilename << "\n"
+					<< "TrackingID: " << mTrackingID << "\n"
+					<< "InworldID: " << mWorldID << llendl;
+		}
+
+	}
+	return result;
+}
+
+/*=======================================*/
+/*  LLLocalBitmapTimer: timer class      */
+/*=======================================*/ 
+LLLocalBitmapTimer::LLLocalBitmapTimer() : LLEventTimer(LL_LOCAL_TIMER_HEARTBEAT)
+{
+}
+
+LLLocalBitmapTimer::~LLLocalBitmapTimer()
+{
+}
+
+void LLLocalBitmapTimer::startTimer()
+{
+	mEventTimer.start();
+}
+
+void LLLocalBitmapTimer::stopTimer()
+{
+	mEventTimer.stop();
+}
+
+bool LLLocalBitmapTimer::isRunning()
+{
+	return mEventTimer.getStarted();
+}
+
+BOOL LLLocalBitmapTimer::tick()
+{
+	LLLocalBitmapMgr::doUpdates();
+	return FALSE;
+}
+
+/*=======================================*/
+/*  LLLocalBitmapMgr: manager class      */
+/*=======================================*/ 
+LLLocalBitmapMgr::LLLocalBitmapMgr()
+{
+	// The class is all made of static members, should i even bother instantiating?
+}
+
+LLLocalBitmapMgr::~LLLocalBitmapMgr()
+{
+}
+
+bool LLLocalBitmapMgr::addUnit()
+{
+	bool add_successful = false;
+
+	LLFilePicker& picker = LLFilePicker::instance();
+	if (picker.getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE))
+	{
+		sTimer.stopTimer();
+
+		std::string filename = picker.getFirstFile();
+		while(!filename.empty())
+		{
+			LLLocalBitmap* unit = new LLLocalBitmap(filename);
+
+			if (unit->getValid())
+			{
+				sBitmapList.push_back(unit);
+				add_successful = true;
+			}
+			else
+			{
+				delete unit;
+				unit = NULL;
+			}
+
+			filename = picker.getNextFile();
+		}
+		
+		sTimer.startTimer();
+	}
+
+	return add_successful;
+}
+
+void LLLocalBitmapMgr::delUnit(LLUUID tracking_id)
+{
+	if (!sBitmapList.empty())
+	{	
+		std::vector<LLLocalBitmap*> to_delete;
+		for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++)
+		{   /* finding which ones we want deleted and making a separate list */
+			LLLocalBitmap* unit = *iter;
+			if (unit->getTrackingID() == tracking_id)
+			{
+				to_delete.push_back(unit);
+			}
+		}
+
+		for(std::vector<LLLocalBitmap*>::iterator del_iter = to_delete.begin();
+			del_iter != to_delete.end(); del_iter++)
+		{   /* iterating over a temporary list, hence preserving the iterator validity while deleting. */
+			LLLocalBitmap* unit = *del_iter;
+			sBitmapList.remove(unit);
+			delete unit;
+			unit = NULL;
+		}
+	}
+}
+
+LLUUID LLLocalBitmapMgr::getWorldID(LLUUID tracking_id)
+{
+	LLUUID world_id = LLUUID::null;
+
+	for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++)
+	{
+		LLLocalBitmap* unit = *iter;
+		if (unit->getTrackingID() == tracking_id)
+		{
+			world_id = unit->getWorldID();
+		}
+	}
+
+	return world_id;
+}
+
+std::string LLLocalBitmapMgr::getFilename(LLUUID tracking_id)
+{
+	std::string filename = "";
+
+	for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++)
+	{
+		LLLocalBitmap* unit = *iter;
+		if (unit->getTrackingID() == tracking_id)
+		{
+			filename = unit->getFilename();
+		}
+	}
+
+	return filename;
+}
+
+void LLLocalBitmapMgr::feedScrollList(LLScrollListCtrl* ctrl)
+{
+	if (ctrl)
+	{
+		ctrl->clearRows();
+
+		if (!sBitmapList.empty())
+		{
+			for (local_list_iter iter = sBitmapList.begin();
+				 iter != sBitmapList.end(); iter++)
+			{
+				LLSD element;
+				element["columns"][0]["column"] = "unit_name";
+				element["columns"][0]["type"]   = "text";
+				element["columns"][0]["value"]  = (*iter)->getShortName();
+
+				element["columns"][1]["column"] = "unit_id_HIDDEN";
+				element["columns"][1]["type"]   = "text";
+				element["columns"][1]["value"]  = (*iter)->getTrackingID();
+
+				ctrl->addElement(element);
+			}
+		}
+	}
+
+}
+
+void LLLocalBitmapMgr::doUpdates()
+{
+	// preventing theoretical overlap in cases with huge number of loaded images.
+	sTimer.stopTimer();
+	sNeedsRebake = false;
+
+	for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++)
+	{
+		(*iter)->updateSelf();
+	}
+
+	doRebake();
+	sTimer.startTimer();
+}
+
+void LLLocalBitmapMgr::setNeedsRebake()
+{
+	sNeedsRebake = true;
+}
+
+void LLLocalBitmapMgr::doRebake()
+{ /* separated that from doUpdates to insure a rebake can be called separately during deletion */
+	if (sNeedsRebake)
+	{
+		gAgentAvatarp->forceBakeAllTextures(LL_LOCAL_SLAM_FOR_DEBUG);
+		sNeedsRebake = false;
+	}
+}
+
diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h
new file mode 100644
index 00000000000..c6d05c17631
--- /dev/null
+++ b/indra/newview/lllocalbitmaps.h
@@ -0,0 +1,130 @@
+/** 
+ * @file lllocalbitmaps.h
+ * @author Vaalith Jinn
+ * @brief Local Bitmaps header
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LOCALBITMAPS_H
+#define LL_LOCALBITMAPS_H
+
+#include "lleventtimer.h"
+#include "llwearabletype.h"
+#include "llvoavatardefines.h"
+
+class LLScrollListCtrl;
+
+class LLLocalBitmap
+{
+	public: /* main */
+		LLLocalBitmap(std::string filename);
+		~LLLocalBitmap();
+		bool updateSelf(bool first_update = false);
+
+	public: /* accessors */
+		std::string	getFilename();
+		std::string	getShortName();
+		LLUUID		getTrackingID();
+		LLUUID		getWorldID();
+		bool		getValid();
+
+	private: /* maintenance */
+		bool decodeBitmap(LLPointer<LLImageRaw> raw);
+		void replaceIDs(LLUUID old_id, LLUUID new_id);
+
+	private: /* id replacement */
+		std::vector<LLViewerObject*> prepUpdateObjects(LLUUID old_id);
+		void updateUserPrims(LLUUID old_id, LLUUID new_id);
+		void updateUserSculpts(LLUUID old_id, LLUUID new_id);
+		void updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableType::EType type);
+		LLVOAvatarDefines::ETextureIndex getTexIndex(LLWearableType::EType type, LLVOAvatarDefines::EBakedTextureIndex baked_texind);
+
+	private: /* enums */
+		enum ELinkStatus
+		{
+			LS_ON,
+			LS_BROKEN,
+		};
+
+		enum EExtension
+		{
+			ET_IMG_BMP,
+			ET_IMG_TGA,
+			ET_IMG_JPG,
+			ET_IMG_PNG
+		};
+
+	private: /* members */
+		std::string mFilename;
+		std::string mShortName;
+		LLUUID      mTrackingID;
+		LLUUID      mWorldID;
+		bool        mValid;
+		LLSD        mLastModified;
+		EExtension  mExtension;
+		ELinkStatus mLinkStatus;
+		S32         mUpdateRetries;
+
+};
+
+class LLLocalBitmapTimer : public LLEventTimer
+{
+	public:
+		LLLocalBitmapTimer();
+		~LLLocalBitmapTimer();
+
+	public:
+		void startTimer();
+		void stopTimer();
+		bool isRunning();
+		BOOL tick();
+
+};
+
+class LLLocalBitmapMgr
+{
+	public:
+		LLLocalBitmapMgr();
+		~LLLocalBitmapMgr();
+
+	public:
+		static bool         addUnit();
+		static void         delUnit(LLUUID tracking_id);
+
+		static LLUUID       getWorldID(LLUUID tracking_id);
+		static std::string  getFilename(LLUUID tracking_id);
+		
+		static void         feedScrollList(LLScrollListCtrl* ctrl);
+		static void         doUpdates();
+		static void         setNeedsRebake();
+		static void         doRebake();
+		
+	private:
+		static std::list<LLLocalBitmap*>    sBitmapList;
+		static LLLocalBitmapTimer           sTimer;
+		static bool                         sNeedsRebake;
+		typedef std::list<LLLocalBitmap*>::iterator local_list_iter;
+};
+
+#endif
+
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index de22f2ae6b7..6a64e6d76a4 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -67,6 +67,9 @@
 #include "lluictrlfactory.h"
 #include "lltrans.h"
 
+#include "llradiogroup.h"
+#include "llfloaterreg.h"
+#include "lllocalbitmaps.h"
 
 static const S32 HPAD = 4;
 static const S32 VPAD = 4;
@@ -78,6 +81,8 @@ static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f;
 static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
 static const F32 CONTEXT_FADE_TIME = 0.08f;
 
+static const S32 LOCAL_TRACKING_ID_COLUMN = 1;
+
 //static const char CURRENT_IMAGE_NAME[] = "Current Texture";
 //static const char WHITE_IMAGE_NAME[] = "Blank Texture";
 //static const char NO_IMAGE_NAME[] = "None";
@@ -142,6 +147,12 @@ class LLFloaterTexturePicker : public LLFloater
 	static void		onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata);
 		   void		onTextureSelect( const LLTextureEntry& te );
 
+	static void		onModeSelect(LLUICtrl* ctrl, void *userdata);
+	static void		onBtnAdd(void* userdata);
+	static void		onBtnRemove(void* userdata);
+	static void		onBtnUpload(void* userdata);
+	static void		onLocalScrollCommit(LLUICtrl* ctrl, void* userdata);
+
 protected:
 	LLPointer<LLViewerTexture> mTexturep;
 	LLTextureCtrl*		mOwner;
@@ -169,8 +180,10 @@ class LLFloaterTexturePicker : public LLFloater
 	BOOL				mNoCopyTextureSelected;
 	F32					mContextConeOpacity;
 	LLSaveFolderState	mSavedFolderState;
-
 	BOOL				mSelectedItemPinned;
+	
+	LLRadioGroup*		mModeSelector;
+	LLScrollListCtrl*	mLocalScrollCtrl;
 };
 
 LLFloaterTexturePicker::LLFloaterTexturePicker(	
@@ -437,6 +450,17 @@ BOOL LLFloaterTexturePicker::postBuild()
 		mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
 	}
 
+	mModeSelector = getChild<LLRadioGroup>("mode_selection");
+	mModeSelector->setCommitCallback(onModeSelect, this);
+	mModeSelector->setSelectedIndex(0, 0);
+
+	childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this);
+	childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this);
+	childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this);
+
+	mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list");
+	mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this);
+	LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl);
 
 	mNoCopyTextureSelected = FALSE;
 
@@ -464,7 +488,6 @@ BOOL LLFloaterTexturePicker::postBuild()
 // virtual
 void LLFloaterTexturePicker::draw()
 {
-	S32 floater_header_size = getHeaderHeight();
 	if (mOwner)
 	{
 		// draw cone of context pointing back to texture swatch	
@@ -554,10 +577,7 @@ void LLFloaterTexturePicker::draw()
 		}
 
 		// Border
-		LLRect border( BORDER_PAD, 
-					   getRect().getHeight() - floater_header_size - BORDER_PAD, 
-					   ((getMinWidth() / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD,
-					   BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - getMinHeight()));
+		LLRect border = getChildView("preview_widget")->getRect();
 		gl_rect_2d( border, LLColor4::black, FALSE );
 
 
@@ -748,7 +768,15 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata)
 	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
 	if (self->mOwner)
 	{
-		self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_SELECT);
+		LLUUID local_id = LLUUID::null;
+
+		if (self->mLocalScrollCtrl->getVisible() && !self->mLocalScrollCtrl->getAllSelected().empty())
+		{
+			LLUUID temp_id = self->mLocalScrollCtrl->getFirstSelected()->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID();
+			local_id = LLLocalBitmapMgr::getWorldID(temp_id);
+		}
+
+		self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_SELECT, local_id);
 	}
 	self->closeFloater();
 }
@@ -791,6 +819,112 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem
 	}
 }
 
+// static
+void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata)
+{
+	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+	bool mode = (self->mModeSelector->getSelectedIndex() == 0);
+
+	self->getChild<LLButton>("Default")->setVisible(mode);
+	self->getChild<LLButton>("Blank")->setVisible(mode);
+	self->getChild<LLButton>("None")->setVisible(mode);
+	self->getChild<LLButton>("Pipette")->setVisible(mode);
+	self->getChild<LLFilterEditor>("inventory search editor")->setVisible(mode);
+	self->getChild<LLInventoryPanel>("inventory panel")->setVisible(mode);
+
+	/*self->getChild<LLCheckBox>("show_folders_check")->setVisible(mode);
+	  no idea under which conditions the above is even shown, needs testing. */
+
+	self->getChild<LLButton>("l_add_btn")->setVisible(!mode);
+	self->getChild<LLButton>("l_rem_btn")->setVisible(!mode);
+	self->getChild<LLButton>("l_upl_btn")->setVisible(!mode);
+	self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode);
+}
+
+// static
+void LLFloaterTexturePicker::onBtnAdd(void* userdata)
+{
+	if (LLLocalBitmapMgr::addUnit() == true)
+	{
+		LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+		LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl);
+	}
+}
+
+// static
+void LLFloaterTexturePicker::onBtnRemove(void* userdata)
+{
+	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+	std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
+
+	if (!selected_items.empty())
+	{
+		for(std::vector<LLScrollListItem*>::iterator iter = selected_items.begin();
+			iter != selected_items.end(); iter++)
+		{
+			LLScrollListItem* list_item = *iter;
+			if (list_item)
+			{
+				LLUUID tracking_id = list_item->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID();
+				LLLocalBitmapMgr::delUnit(tracking_id);
+			}
+		}
+
+		self->getChild<LLButton>("l_rem_btn")->setEnabled(false);
+		self->getChild<LLButton>("l_upl_btn")->setEnabled(false);
+		LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl);
+	}
+
+}
+
+// static
+void LLFloaterTexturePicker::onBtnUpload(void* userdata)
+{
+	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+	std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
+
+	if (selected_items.empty())
+	{
+		return;
+	}
+
+	/* currently only allows uploading one by one, picks the first item from the selection list.  (not the vector!)
+	   in the future, it might be a good idea to check the vector size and if more than one units is selected - opt for multi-image upload. */
+	
+	LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN);
+	std::string filename = LLLocalBitmapMgr::getFilename(tracking_id);
+
+	if (!filename.empty())
+	{
+		LLFloaterReg::showInstance("upload_image", LLSD(filename));
+	}
+
+}
+
+//static
+void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata)
+{
+	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+	std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
+	bool has_selection = !selected_items.empty();
+
+	self->getChild<LLButton>("l_rem_btn")->setEnabled(has_selection);
+	self->getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2));
+	/* since multiple-localbitmap upload is not implemented, upl button gets disabled if more than one is selected. */
+
+	if (has_selection)
+	{
+		LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN); 
+		LLUUID inworld_id = LLLocalBitmapMgr::getWorldID(tracking_id);
+		self->mOwner->setImageAssetID(inworld_id);
+
+		if (self->childGetValue("apply_immediate_check").asBoolean())
+		{
+			self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, inworld_id);
+		}
+	}
+}
+
 // static
 void LLFloaterTexturePicker::onShowFolders(LLUICtrl* ctrl, void *user_data)
 {
@@ -1126,7 +1260,7 @@ void LLTextureCtrl::onFloaterClose()
 	mFloaterHandle.markDead();
 }
 
-void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
+void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLUUID id)
 {
 	LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
 
@@ -1139,14 +1273,24 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
 		// (i.e. op == TEXTURE_SELECT) or texture changes via DnD.
 		else if (mCommitOnSelection || op == TEXTURE_SELECT)
 			mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
-			
-		if( floaterp->isDirty() )
+
+		if(floaterp->isDirty() || id.notNull()) // mModelView->setDirty does not work.
 		{
 			setTentative( FALSE );
-			mImageItemID = floaterp->findItemID(floaterp->getAssetID(), FALSE);
-			lldebugs << "mImageItemID: " << mImageItemID << llendl;
-			mImageAssetID = floaterp->getAssetID();
-			lldebugs << "mImageAssetID: " << mImageAssetID << llendl;
+
+			if (id.notNull())
+			{
+				mImageItemID = id;
+				mImageAssetID = id;
+			}
+			else
+			{
+				mImageItemID = floaterp->findItemID(floaterp->getAssetID(), FALSE);
+				lldebugs << "mImageItemID: " << mImageItemID << llendl;
+				mImageAssetID = floaterp->getAssetID();
+				lldebugs << "mImageAssetID: " << mImageAssetID << llendl;
+			}
+
 			if (op == TEXTURE_SELECT && mOnSelectCallback)
 			{
 				mOnSelectCallback( this, LLSD() );
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index b1312d641f6..3abe84dcc31 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -157,7 +157,7 @@ class LLTextureCtrl
 	void			closeDependentFloater();
 
 	void			onFloaterClose();
-	void			onFloaterCommit(ETexturePickOp op);
+	void			onFloaterCommit(ETexturePickOp op, LLUUID id = LLUUID::null);
 
 	// This call is returned when a drag is detected. Your callback
 	// should return TRUE if the drag is acceptable.
diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h
index e0a362596d1..b386c73d2a5 100644
--- a/indra/newview/llviewertexturelist.h
+++ b/indra/newview/llviewertexturelist.h
@@ -65,6 +65,7 @@ class LLViewerTextureList
 
 	friend class LLTextureView;
 	friend class LLViewerTextureManager;
+	friend class LLLocalBitmap;
 	
 public:
 	static BOOL createUploadFile(const std::string& filename, const std::string& out_filename, const U8 codec);
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index 0f7f63061be..402504933cd 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -810,6 +810,20 @@ const LLLocalTextureObject* LLWearable::getLocalTextureObject(S32 index) const
 	return NULL;
 }
 
+std::vector<LLLocalTextureObject*> LLWearable::getLocalTextureListSeq()
+{
+	std::vector<LLLocalTextureObject*> result;
+
+	for(te_map_t::const_iterator iter = mTEMap.begin();
+		iter != mTEMap.end(); iter++)
+	{
+		LLLocalTextureObject* lto = iter->second;
+		result.push_back(lto);
+	}
+
+	return result;
+}
+
 void LLWearable::setLocalTextureObject(S32 index, LLLocalTextureObject &lto)
 {
 	if( mTEMap.find(index) != mTEMap.end() )
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index fd614ade64b..3d8c53a755c 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -106,6 +106,7 @@ class LLWearable
 
 	LLLocalTextureObject* getLocalTextureObject(S32 index);
 	const LLLocalTextureObject* getLocalTextureObject(S32 index) const;
+	std::vector<LLLocalTextureObject*> getLocalTextureListSeq();
 
 	void				setLocalTextureObject(S32 index, LLLocalTextureObject &lto);
 	void				addVisualParam(LLVisualParam *param);
diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
index cad7d72ed7f..ffb8b842f0c 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
@@ -3,15 +3,17 @@
  legacy_header_height="18"
  can_minimize="false"
  can_resize="true"
- height="290"
+ height="330"
  layout="topleft"
- min_height="290"
+ min_height="330"
  min_width="410"
  name="texture picker"
  help_topic="texture_picker"
  title="PICK: TEXTURE"
  width="410">
-    <floater.string
+ 
+<!--  top static -->
+ <floater.string
      name="choose_picture">
         Click to choose a picture
     </floater.string>
@@ -19,6 +21,16 @@
      name="pick title">
         Pick:
     </floater.string>
+
+    <view
+     left="4"
+     top="20"
+     name="preview_widget"
+     height="165"
+     width="165"
+     follows="left|top"
+    />
+  
     <text
      type="string"
      length="1"
@@ -34,70 +46,94 @@
      width="163">
         Multiple textures
     </text>
+	
+	<!-- mode selector -->
+	   <radio_group
+     control_name="mode_selection"
+     height="20"
+     layout="topleft"
+     left="18"
+     top_pad="80"
+     name="mode_selection"
+     follows="left|top">
+        <radio_item
+         label="Inventory"
+         name="inventory"
+         top_delta="20" 
+         layout="topleft"
+         height="16" 
+         left="0" 
+         value="0"
+         width="80" />
+        <radio_item
+         label="Local"
+         left_pad="0"
+         layout="topleft"
+         top_delta="0" 
+         height="16" 
+         name="local"
+         value="1"
+         width="75" />
+    </radio_group>
+	<!-- -->
+	
     <text
      type="string"
      length="1"
      follows="left|top"
      height="14"
      layout="topleft"
-     left_delta="0"
+     left_delta="-12"
      name="unknown"
-     top_pad="80"
-     width="163">
+     top_pad="4"
+     width="">
         Size: [DIMENSIONS]
     </text>
+    
+<!--  middle: inventory mode -->
+
     <button
      enabled="false"
-     follows="left|bottom"
-     height="20"
+     follows="left|top"
+     height="18"
      label="Default"
      label_selected="Default"
      layout="topleft"
-     left_delta="0"
      name="Default"
-     top_pad="4"
-     width="80" />
+     width="73"
+	 left="94"
+     top="215"/>
     <button
+     follows="left|top"
+     height="20"
+     label="Blank"
+     label_selected="Blank"
+     layout="topleft"
+     left_delta="0"
+     name="Blank"
+     top_pad="5"
+     width="73" />
+     <button
      enabled="false"
-     follows="left|bottom"
+     follows="left|top"
      height="20"
      label="None"
      label_selected="None"
      layout="topleft"
-     left_pad="4"
+     left_delta="0"
      name="None"
-     top_delta="0"
-     width="80" />
-    <button
-     follows="left|bottom"
-     height="20"
-     label="Blank"
-     label_selected="Blank"
-     layout="topleft"
-     left="4"
-     name="Blank"
      top_pad="5"
-     width="80" />
-         <button
-     follows="left|bottom"
+     width="73" />
+    <button
+     follows="left|top"
      height="28"
      image_selected="eye_button_active.tga"
      image_unselected="eye_button_inactive.tga"
      layout="topleft"
-     left_pad="50"
-     top_delta="3"
+     left_delta="-80"
+     top_delta="-25"
      name="Pipette"
      width="28" />
-   <check_box
-     follows="left|bottom"
-     height="20"
-     initial_value="true"
-     label="Apply now"
-     layout="topleft"
-     left="4"
-     name="apply_immediate_check"
-     top="262"
-     width="120" />
     <filter_editor
      follows="left|top|right"
      height="23"
@@ -113,7 +149,7 @@
      bg_alpha_color="DkGray2"
      border="false"
      follows="all"
-     height="200"
+     height="233"
      layout="topleft"
      left_delta="0"
      name="inventory panel"
@@ -128,23 +164,89 @@
      top_pad="0"
      left_delta="-3"
      width="200" />
-         <button
-     follows="right|bottom"
+
+<!--  middle: local mode -->
+    <button
+     follows="left|top"
+     height="18"
+     label="Add"
+     label_selected="Add"
+     layout="topleft"
+     left="94"
+     top="215"
+     name="l_add_btn"
+     width="73"
+     visible="false"/>
+    <button
+     enabled="false"
+     follows="left|top"
+     height="20"
+     label="Remove"
+     label_selected="Remove"
+     layout="topleft"
+     left_delta="0"
+     name="l_rem_btn"
+     top_pad="5"
+     width="73"
+     visible="false"/>
+    <button
+     enabled="false"
+     follows="left|top"
+     height="20"
+     label="Upload"
+     label_selected="Upload"
+     layout="topleft"
+     left_delta="0"
+     name="l_upl_btn"
+     top_pad="5"
+     width="73"
+     visible="false"/>
+    <scroll_list
+     name="l_name_list"
+     left="170"
+     top="22"
+     width="235"
+     height="260"
+     follows="left|top|right|bottom"
+     column_padding="0"
+     can_resize="false"
+     draw_heading="true"
+     multi_select="true"
+     search_column="1"
+     visible="false">
+        <column name="unit_name" label="Name" dynamicwidth="true" />
+        <column name="unit_id_HIDDEN" label="ID" width="0" />
+    </scroll_list>
+     
+<!-- bottom static -->
+    <button
+     follows="bottom"
      height="20"
      label="OK"
      label_selected="OK"
      layout="topleft"
-     right="-120"
+     left="95"
+     top="-30"
      name="Select"
      width="100" />
     <button
-     follows="right|bottom"
+     follows="bottom"
      height="20"
      label="Cancel"
      label_selected="Cancel"
      layout="topleft"
-     right="-10"
-     left_pad="5"
+     left_delta="120"
+     top_delta="0"
      name="Cancel"
      width="100" />
+    <check_box
+     follows="left|bottom"
+     height="20"
+     initial_value="true"
+     label="Apply now"
+     layout="topleft"
+     left="6"
+     name="apply_immediate_check"
+     top_delta="0"
+     width="120" />
 </floater>
-- 
GitLab


From 15d7da90c0d5868d8aa3732c704a41cc488c2791 Mon Sep 17 00:00:00 2001
From: Nicky Perian <nickyperian@yahoo.com>
Date: Mon, 26 Mar 2012 21:29:01 -0500
Subject: [PATCH 894/933] OPEN-138 Intermittent write to character/new
 archetype.xml from Develop->Avatar-> Character Tests->Apperance To XML. Add
 explicit outfile.close() method before returning to caller. Add llinfos for
 file location as a troubleshooting aid.

---
 doc/contributions.txt        |  1 +
 indra/newview/llvoavatar.cpp | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index a024815b8e3..ed13204b00c 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -850,6 +850,7 @@ Nicholaz Beresford
 Nick Rhodes
 Nicky Perian
 	OPEN-1
+	OPEN-138
 	STORM-1087
 	STORM-1090
 Nicoladie Gymnast
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index bc7f5a9744a..f46cedfc4be 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7533,11 +7533,15 @@ void LLVOAvatar::dumpArchetypeXML( void* )
 {
 	LLAPRFile outfile;
 	outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB );
-	apr_file_t* file = outfile.getFileHandle() ;
+	apr_file_t* file = outfile.getFileHandle();
 	if (!file)
 	{
 		return;
 	}
+	else
+	{
+		llinfos << "xmlfile write handle obtained : " << gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml") << llendl;
+	}
 
 	apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" );
 	apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" );
@@ -7577,6 +7581,11 @@ void LLVOAvatar::dumpArchetypeXML( void* )
 	}
 	apr_file_printf( file, "\t</archetype>\n" );
 	apr_file_printf( file, "\n</linden_genepool>\n" );
+	//explictly close the file if it is still open which it should be
+	if (file)
+	{
+		outfile.close();
+	}
 }
 
 
-- 
GitLab


From 5f417f6a431970a971abf601fb9f4b82b731abf6 Mon Sep 17 00:00:00 2001
From: Jonathan Goodman <geenz@geenzo.com>
Date: Tue, 27 Mar 2012 09:26:20 -0400
Subject: [PATCH 895/933] Tweaked the sun's glow to be less powerful.

---
 .../app_settings/shaders/class1/deferred/softenLightF.glsl      | 2 +-
 .../app_settings/shaders/class2/deferred/softenLightF.glsl      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 2b0671b47fb..94669fa5d3e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -303,7 +303,7 @@ void main()
 			
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
-			bloom = dot(spec_contrib, spec_contrib);
+			bloom = dot(spec_contrib, spec_contrib) / 4;
 			col += spec_contrib;
 
 			//add environmentmap
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 471a4e02360..ecadafbb8f8 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -311,7 +311,7 @@ void main()
 
 			// add the two types of shiny together
 			vec3 spec_contrib = dumbshiny * spec.rgb;
-			bloom = dot(spec_contrib, spec_contrib);
+			bloom = dot(spec_contrib, spec_contrib) / 4;
 			col += spec_contrib;
 
 			//add environmentmap
-- 
GitLab


From 38ad8611c988e6ca0caae95d397e3ce67f1ceb36 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 27 Mar 2012 10:55:15 -0400
Subject: [PATCH 896/933] MAINT-710: Fix for VertexBufferStrider could not find
 valid vertex data. (from Firestorm)

---
 indra/newview/llface.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index cd33a19a2a8..cfb4147e719 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1838,7 +1838,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		}
 	}
 
-	if (rebuild_color)
+	if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
 	{
 		LLFastTimer t(FTM_FACE_GEOM_COLOR);
 		mVertexBuffer->getColorStrider(colors, mGeomIndex, mGeomCount, map_range);
-- 
GitLab


From e741d17469068e848fd88c3cd4c5a824c7f648b7 Mon Sep 17 00:00:00 2001
From: Nicky Perian <nickyperian@yahoo.com>
Date: Tue, 27 Mar 2012 13:46:22 -0500
Subject: [PATCH 897/933] STORM-1828  Set to proper jira issue. Intermittent
 write to character/new archetype.xml from Develop->Avatar-> Character
 Tests->Apperance To XML. Add explicit outfile.close() method before returning
 to caller. Add llinfos for file location as a troubleshooting aid.

---
 doc/contributions.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index ed13204b00c..c6775bb09ca 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -850,9 +850,9 @@ Nicholaz Beresford
 Nick Rhodes
 Nicky Perian
 	OPEN-1
-	OPEN-138
 	STORM-1087
 	STORM-1090
+	STORM-1828
 Nicoladie Gymnast
 Nounouch Hapmouche
 	VWR-238
-- 
GitLab


From e516b16be7c05f8509c860a63d56ade070b02ccb Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 27 Mar 2012 15:35:55 -0400
Subject: [PATCH 898/933] Added tag viewer-beta-candidate for changeset
 28b95a6a28dc

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 261b3ef140f..d073d97888b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -279,3 +279,5 @@ d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
 5e8d2662f38a66eca6c591295f5880d47afc73f7 3.3.0-release
 dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
 3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
+3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
+28b95a6a28dca3338d9a1f4f204b96678df9f6a5 viewer-beta-candidate
-- 
GitLab


From fdd018783a0cc06a467443ca7c9ea0876a87ef49 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 27 Mar 2012 18:40:17 -0400
Subject: [PATCH 899/933] CHOP-854: move change_(item|category)_parent() into
 LLInventoryModel. It's not really clear why they're in
 llinventoryfunctions.{h,cpp} instead of LLInventoryModel, and in fact
 LLInventoryModel::removeItem() already contains code essentially cloned from
 change_item_parent() -- or perhaps vice-versa. This changeset addresses only
 migrating the functions, and fixing up existing references, to simplify code
 review.

---
 indra/newview/llinventorybridge.cpp    |  4 +-
 indra/newview/llinventoryfunctions.cpp | 59 ++------------------------
 indra/newview/llinventoryfunctions.h   | 10 -----
 indra/newview/llinventorymodel.cpp     | 52 +++++++++++++++++++++++
 indra/newview/llinventorymodel.h       | 10 +++++
 indra/newview/llpreviewnotecard.cpp    |  3 +-
 6 files changed, 68 insertions(+), 70 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c0065a94e66..21f03e3d667 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -910,7 +910,7 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model,
 									 const LLUUID& new_parent_id,
 									 BOOL restamp)
 {
-	change_item_parent(model, item, new_parent_id, restamp);
+	model->changeItemParent(item, new_parent_id, restamp);
 }
 
 // static
@@ -919,7 +919,7 @@ void LLInvFVBridge::changeCategoryParent(LLInventoryModel* model,
 										 const LLUUID& new_parent_id,
 										 BOOL restamp)
 {
-	change_category_parent(model, cat, new_parent_id, restamp);
+	model->changeCategoryParent(cat, new_parent_id, restamp);
 }
 
 LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index dd92188e9d2..ae8d11c3f7d 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -109,58 +109,6 @@ void append_path(const LLUUID& id, std::string& path)
 	path.append(temp);
 }
 
-void change_item_parent(LLInventoryModel* model,
-						LLViewerInventoryItem* item,
-						const LLUUID& new_parent_id,
-						BOOL restamp)
-{
-	if (item->getParentUUID() != new_parent_id)
-	{
-		LLInventoryModel::update_list_t update;
-		LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
-		update.push_back(old_folder);
-		LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
-		update.push_back(new_folder);
-		gInventory.accountForUpdate(update);
-
-		LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
-		new_item->setParent(new_parent_id);
-		new_item->updateParentOnServer(restamp);
-		model->updateItem(new_item);
-		model->notifyObservers();
-	}
-}
-
-void change_category_parent(LLInventoryModel* model,
-	LLViewerInventoryCategory* cat,
-	const LLUUID& new_parent_id,
-	BOOL restamp)
-{
-	if (!model || !cat)
-	{
-		return;
-	}
-
-	// Can't move a folder into a child of itself.
-	if (model->isObjectDescendentOf(new_parent_id, cat->getUUID()))
-	{
-		return;
-	}
-
-	LLInventoryModel::update_list_t update;
-	LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1);
-	update.push_back(old_folder);
-	LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
-	update.push_back(new_folder);
-	model->accountForUpdate(update);
-
-	LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
-	new_cat->setParent(new_parent_id);
-	new_cat->updateParentOnServer(restamp);
-	model->updateCategory(new_cat);
-	model->notifyObservers();
-}
-
 void remove_category(LLInventoryModel* model, const LLUUID& cat_id)
 {
 	if (!model || !get_is_category_removable(model, cat_id))
@@ -190,7 +138,7 @@ void remove_category(LLInventoryModel* model, const LLUUID& cat_id)
 	if (cat)
 	{
 		const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
-		change_category_parent(model, cat, trash_id, TRUE);
+		model->changeCategoryParent(cat, trash_id, TRUE);
 	}
 }
 
@@ -568,8 +516,7 @@ void move_to_outbox_cb_action(const LLSD& payload)
 
 		LLUUID parent = viitem->getParentUUID();
 
-		change_item_parent(
-			&gInventory,
+		gInventory.changeItemParent(
 			viitem,
 			dest_folder_id,
 			false);
@@ -670,7 +617,7 @@ void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32
 	
 	LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
 
-	change_item_parent(&gInventory,
+	gInventory.changeItemParent(
 					   viewer_inv_item,
 					   dest_folder,
 					   false);
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index ce2b89b22e6..602c411104d 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -57,16 +57,6 @@ void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id);
 
 void show_item_original(const LLUUID& item_uuid);
 
-void change_item_parent(LLInventoryModel* model,
-									 LLViewerInventoryItem* item,
-									 const LLUUID& new_parent_id,
-									 BOOL restamp);
-
-void change_category_parent(LLInventoryModel* model,
-	LLViewerInventoryCategory* cat,
-	const LLUUID& new_parent_id,
-	BOOL restamp);
-
 void remove_category(LLInventoryModel* model, const LLUUID& cat_id);
 
 void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index a71b699fdd7..6cc0d6768ee 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1017,6 +1017,58 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id)
 	}
 }
 
+// Migrated from llinventoryfunctions
+void LLInventoryModel::changeItemParent(LLViewerInventoryItem* item,
+										const LLUUID& new_parent_id,
+										BOOL restamp)
+{
+	if (item->getParentUUID() != new_parent_id)
+	{
+		LLInventoryModel::update_list_t update;
+		LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
+		update.push_back(old_folder);
+		LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
+		update.push_back(new_folder);
+		accountForUpdate(update);
+
+		LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
+		new_item->setParent(new_parent_id);
+		new_item->updateParentOnServer(restamp);
+		updateItem(new_item);
+		notifyObservers();
+	}
+}
+
+// Migrated from llinventoryfunctions
+void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat,
+											const LLUUID& new_parent_id,
+											BOOL restamp)
+{
+	if (!cat)
+	{
+		return;
+	}
+
+	// Can't move a folder into a child of itself.
+	if (isObjectDescendentOf(new_parent_id, cat->getUUID()))
+	{
+		return;
+	}
+
+	LLInventoryModel::update_list_t update;
+	LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1);
+	update.push_back(old_folder);
+	LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
+	update.push_back(new_folder);
+	accountForUpdate(update);
+
+	LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
+	new_cat->setParent(new_parent_id);
+	new_cat->updateParentOnServer(restamp);
+	updateCategory(new_cat);
+	notifyObservers();
+}
+
 // Delete a particular inventory object by ID.
 void LLInventoryModel::deleteObject(const LLUUID& id)
 {
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 7cd85c4ab7b..f4602ce922e 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -306,6 +306,16 @@ class LLInventoryModel
 	// observer notification, or server update is performed.
 	void moveObject(const LLUUID& object_id, const LLUUID& cat_id);
 
+	// Migrated from llinventoryfunctions
+	void changeItemParent(LLViewerInventoryItem* item,
+						  const LLUUID& new_parent_id,
+						  BOOL restamp);
+
+	// Migrated from llinventoryfunctions
+	void changeCategoryParent(LLViewerInventoryCategory* cat,
+							  const LLUUID& new_parent_id,
+							  BOOL restamp);
+
 	//--------------------------------------------------------------------
 	// Delete
 	//--------------------------------------------------------------------
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 4974dde282c..3a9360fd23d 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -29,7 +29,6 @@
 #include "llpreviewnotecard.h"
 
 #include "llinventory.h"
-#include "llinventoryfunctions.h" // for change_item_parent()
 
 #include "llagent.h"
 #include "llassetuploadresponders.h"
@@ -494,7 +493,7 @@ void LLPreviewNotecard::deleteNotecard()
 	if (item != NULL)
 	{
 		const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
-		change_item_parent(&gInventory, item, trash_id, FALSE);
+		gInventory.changeItemParent(item, trash_id, FALSE);
 	}
 
 	closeFloater();
-- 
GitLab


From b8561da34d5d733670b6b1eabf483871ec6c18b0 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 27 Mar 2012 19:06:33 -0400
Subject: [PATCH 900/933] CHOP-854: Make LLInventoryModel::removeItem() call
 changeItemParent(). The body of removeItem() was already nearly identical to
 the body of changeItemParent(); this eliminates the redundancy. Improve
 logging for changeItemParent().

---
 indra/newview/llinventorymodel.cpp | 32 ++++++++++++++++--------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 6cc0d6768ee..de52f3a18d0 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1022,8 +1022,16 @@ void LLInventoryModel::changeItemParent(LLViewerInventoryItem* item,
 										const LLUUID& new_parent_id,
 										BOOL restamp)
 {
-	if (item->getParentUUID() != new_parent_id)
+	if (item->getParentUUID() == new_parent_id)
 	{
+		LL_DEBUGS("Inventory") << "'" << item->getName() << "' (" << item->getUUID()
+							   << ") is already in folder " << new_parent_id << LL_ENDL;
+	}
+	else
+	{
+		LL_INFOS("Inventory") << "Moving '" << item->getName() << "' (" << item->getUUID()
+							  << ") from " << item->getParentUUID() << " to folder "
+							  << new_parent_id << LL_ENDL;
 		LLInventoryModel::update_list_t update;
 		LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
 		update.push_back(old_folder);
@@ -2983,21 +2991,15 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT
 void LLInventoryModel::removeItem(const LLUUID& item_id)
 {
 	LLViewerInventoryItem* item = getItem(item_id);
-	const LLUUID new_parent = findCategoryUUIDForType(LLFolderType::FT_TRASH);
-	if (item && item->getParentUUID() != new_parent)
+	if (! item)
 	{
-		LLInventoryModel::update_list_t update;
-		LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
-		update.push_back(old_folder);
-		LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1);
-		update.push_back(new_folder);
-		accountForUpdate(update);
-
-		LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
-		new_item->setParent(new_parent);
-		new_item->updateParentOnServer(TRUE);
-		updateItem(new_item);
-		notifyObservers();
+		LL_WARNS("Inventory") << "couldn't find inventory item " << item_id << LL_ENDL;
+	}
+	else
+	{
+		const LLUUID new_parent = findCategoryUUIDForType(LLFolderType::FT_TRASH);
+		LL_INFOS("Inventory") << "Moving to Trash (" << new_parent << "):" << LL_ENDL;
+		changeItemParent(item, new_parent, TRUE);
 	}
 }
 
-- 
GitLab


From b7e0e44e3246299b639f787e3ab9b8e59cdc05c3 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 27 Mar 2012 22:39:31 -0400
Subject: [PATCH 901/933] CHOP-854: Use new LLInventoryModel::removeObject() to
 discard offer. Introduce new LLInventoryModel::removeCategory() method
 comparable to removeItem(), but for folder objects (using
 changeCategoryParent() rather than changeItemParent()). Introduce
 removeObject() method that calls one of the above, depending on runtime
 object type.

---
 indra/newview/llinventorymodel.cpp | 39 ++++++++++++++++++++++++++++++
 indra/newview/llinventorymodel.h   |  7 +++++-
 indra/newview/llviewermessage.cpp  |  4 ++-
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index de52f3a18d0..1ede6bc1c91 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -46,6 +46,7 @@
 #include "llviewerregion.h"
 #include "llcallbacklist.h"
 #include "llvoavatarself.h"
+#include <typeinfo>
 
 //#define DIFF_INVENTORY_FILES
 #ifdef DIFF_INVENTORY_FILES
@@ -3003,6 +3004,44 @@ void LLInventoryModel::removeItem(const LLUUID& item_id)
 	}
 }
 
+void LLInventoryModel::removeCategory(const LLUUID& category_id)
+{
+	LLViewerInventoryCategory* cat = getCategory(category_id);
+	if (! cat)
+	{
+		LL_WARNS("Inventory") << "couldn't find inventory folder " << category_id << LL_ENDL;
+	}
+	else
+	{
+		const LLUUID new_parent = findCategoryUUIDForType(LLFolderType::FT_TRASH);
+		LL_INFOS("Inventory") << "Moving to Trash (" << new_parent << "):" << LL_ENDL;
+		changeCategoryParent(cat, new_parent, TRUE);
+	}
+}
+
+void LLInventoryModel::removeObject(const LLUUID& object_id)
+{
+	LLInventoryObject* obj = getObject(object_id);
+	if (dynamic_cast<LLViewerInventoryItem*>(obj))
+	{
+		removeItem(object_id);
+	}
+	else if (dynamic_cast<LLViewerInventoryCategory*>(obj))
+	{
+		removeCategory(object_id);
+	}
+	else if (obj)
+	{
+		LL_WARNS("Inventory") << "object ID " << object_id
+							  << " is an object of unrecognized class "
+							  << typeid(*obj).name() << LL_ENDL;
+	}
+	else
+	{
+		LL_WARNS("Inventory") << "object ID " << object_id << " not found" << LL_ENDL;
+	}
+}
+
 const LLUUID &LLInventoryModel::getRootFolderID() const
 {
 	return mRootFolderID;
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index f4602ce922e..8382e875b48 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -325,8 +325,13 @@ class LLInventoryModel
 	// consistent internal state. No cache accounting, observer
 	// notification, or server update is performed.
 	void deleteObject(const LLUUID& id);
+	/// move Item item_id to Trash
 	void removeItem(const LLUUID& item_id);
-	
+	/// move Category category_id to Trash
+	void removeCategory(const LLUUID& category_id);
+	/// removeItem() or removeCategory(), whichever is appropriate
+	void removeObject(const LLUUID& object_id);
+
 	// Delete a particular inventory object by ID, and delete it from
 	// the server. Also updates linked items.
 	void purgeObject(const LLUUID& id);
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3c6770df43f..ed5dd845862 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1064,7 +1064,9 @@ class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver
 		// If we now try to remove the inventory item, it will cause a nested
 		// notifyObservers() call, which won't work.
 		// So defer moving the item to trash until viewer gets idle (in a moment).
-		LLAppViewer::instance()->addOnIdleCallback(boost::bind(&LLInventoryModel::removeItem, &gInventory, mObjectID));
+		// Use removeObject() rather than removeItem() because at this level,
+		// the object could be either an item or a folder.
+		LLAppViewer::instance()->addOnIdleCallback(boost::bind(&LLInventoryModel::removeObject, &gInventory, mObjectID));
 		gInventory.removeObserver(this);
 		delete this;
 	}
-- 
GitLab


From 3c3ee709677a0c60420eae84a55a7b61113b4949 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 28 Mar 2012 20:09:54 -0400
Subject: [PATCH 902/933] Added tag 3.3.1-beta1 for changeset 28b95a6a28dc

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index eb4a47e2cd0..1ae758e8eac 100644
--- a/.hgtags
+++ b/.hgtags
@@ -282,3 +282,4 @@ b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
 3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 DRTVWR-125
 b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
 3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 3.3.1-start
+28b95a6a28dca3338d9a1f4f204b96678df9f6a5 3.3.1-beta1
-- 
GitLab


From a5ef634b06a87f3738e14f5a375e19c0c5ac38f3 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 30 Mar 2012 15:45:54 +0300
Subject: [PATCH 903/933] MAINT-813 FIXED Potential fix for a crash at
 LLViewerRegion::getPosGlobalFromRegion.

As far as I can tell, if login fails with the "Region has begun the logout process" message, gAgentAvatarp gets destroyed, which leads to the crash.
Adding a check that should prevent it (could not reproduce to make sure).
---
 indra/newview/llviewerobject.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 37fb77a10ac..e590f29a9a3 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -143,7 +143,10 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
 			}
 			else 
 			{
-				gAgentAvatarp->updateRegion(regionp);
+				if (isAgentAvatarValid())
+				{
+					gAgentAvatarp->updateRegion(regionp);
+				}
 			}
 			res = gAgentAvatarp;
 		}
-- 
GitLab


From 0ff9310d128f4137a3bb5085f2562a258e689c9a Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 2 Apr 2012 13:04:02 -0700
Subject: [PATCH 904/933] sync with viewer-development

---
 .../skins/default/xui/de/panel_status_bar.xml |  2 +-
 .../skins/default/xui/en/floater_about.xml    |  2 +-
 .../default/xui/en/floater_about_land.xml     |  2 +-
 .../skins/default/xui/en/floater_avatar.xml   |  4 +-
 .../default/xui/en/floater_avatar_picker.xml  |  2 +-
 .../skins/default/xui/en/floater_camera.xml   |  7 +--
 .../skins/default/xui/en/floater_chat_bar.xml |  6 +--
 .../skins/default/xui/en/floater_critical.xml |  2 +-
 .../default/xui/en/floater_destinations.xml   |  2 +-
 .../skins/default/xui/en/floater_gesture.xml  |  2 +-
 .../default/xui/en/floater_help_browser.xml   |  2 +-
 .../skins/default/xui/en/floater_joystick.xml | 50 +++++++++++++++++++
 .../default/xui/en/floater_land_holdings.xml  |  2 +-
 .../skins/default/xui/en/floater_map.xml      |  2 +-
 .../xui/en/floater_merchant_outbox.xml        |  2 +-
 .../skins/default/xui/en/floater_moveview.xml |  6 +--
 .../default/xui/en/floater_my_appearance.xml  |  2 +-
 .../default/xui/en/floater_my_inventory.xml   |  2 +-
 .../skins/default/xui/en/floater_people.xml   |  2 +-
 .../skins/default/xui/en/floater_picks.xml    |  2 +-
 .../skins/default/xui/en/floater_places.xml   |  2 +-
 .../default/xui/en/floater_preferences.xml    |  2 +-
 .../skins/default/xui/en/floater_search.xml   |  2 +-
 .../skins/default/xui/en/floater_snapshot.xml |  2 +-
 .../xui/en/floater_test_text_editor.xml       |  1 +
 .../default/xui/en/floater_test_widgets.xml   |  2 +
 .../skins/default/xui/en/floater_tools.xml    |  3 +-
 .../skins/default/xui/en/floater_toybox.xml   |  2 +-
 .../default/xui/en/floater_voice_controls.xml |  2 +-
 .../default/xui/en/floater_voice_effect.xml   |  9 +++-
 .../default/xui/en/floater_world_map.xml      |  2 +-
 .../skins/default/xui/en/menu_inventory.xml   |  8 +++
 .../skins/default/xui/en/menu_viewer.xml      | 13 +++++
 .../skins/default/xui/en/panel_chat_item.xml  |  1 +
 .../xui/en/panel_postcard_settings.xml        |  1 +
 .../xui/en/panel_snapshot_inventory.xml       |  1 +
 .../default/xui/en/panel_snapshot_local.xml   |  1 +
 .../default/xui/en/panel_snapshot_profile.xml |  1 +
 .../skins/default/xui/en/panel_status_bar.xml |  4 +-
 .../skins/default/xui/en/panel_toast.xml      |  1 -
 .../default/xui/en/sidepanel_inventory.xml    |  5 +-
 .../skins/default/xui/en/widgets/floater.xml  |  2 +-
 .../skins/default/xui/es/panel_status_bar.xml |  2 +-
 .../skins/default/xui/fr/panel_status_bar.xml |  2 +-
 .../skins/default/xui/it/panel_status_bar.xml |  2 +-
 .../skins/default/xui/ja/panel_status_bar.xml |  2 +-
 .../skins/default/xui/pt/panel_status_bar.xml |  2 +-
 .../skins/default/xui/ru/panel_status_bar.xml |  2 +-
 .../skins/default/xui/tr/panel_status_bar.xml |  2 +-
 49 files changed, 136 insertions(+), 48 deletions(-)

diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml
index 2493d60df66..14ace0ac3af 100644
--- a/indra/newview/skins/default/xui/de/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-415" name="balance_bg" width="205">
 		<text name="balance" tool_tip="Klicken, um L$-Guthaben zu aktualisieren" value="20 L$"/>
 		<button label="L$ kaufen" name="buyL" tool_tip="Hier klicken, um mehr L$ zu kaufen"/>
 		<button label="Einkaufen" name="goShop" tool_tip="Second Life-Marktplatz öffnen" width="85"/>
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index c7e9ec781da..060d8890032 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="centered"
+ positioning="centered"
  legacy_header_height="18"
  height="440"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 3a6c2678c1a..fb123ec4d1d 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_tear_off="false"
  height="420"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml
index 82c34030082..cd5cca02bdb 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  ignore_ui_scale="false"
  legacy_header_height="225"
  can_minimize="true"
  can_close="true"
  can_resize="true"
  min_height="230"
- min_width="450"
+ min_width="515"
  height="230"
  layout="topleft"
  name="Avatar"
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 cbbbeb60948..1a55dc2e2ce 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  can_resize="true"
  height="350"
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index 4673c6def59..22bc488a925 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="specified"
- specified_left="458"
- specified_bottom="80"
+ positioning="specified"
+ left="458"
+ bottom="-80"
+ follows="left|bottom"
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 63992462b34..688a01ce7bc 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="specified"
- specified_left="10"
- specified_bottom="10"
+ positioning="specified"
+ left="10"
+ bottom="-10"
  height="60"
  layout="topleft"
  legacy_header_height="25"
diff --git a/indra/newview/skins/default/xui/en/floater_critical.xml b/indra/newview/skins/default/xui/en/floater_critical.xml
index 13b15bf7240..143bcb44300 100644
--- a/indra/newview/skins/default/xui/en/floater_critical.xml
+++ b/indra/newview/skins/default/xui/en/floater_critical.xml
@@ -6,7 +6,7 @@
  height="500"
  layout="topleft"
  name="modal container"
- open_positioning="centered"
+ positioning="centered"
  width="600">
     <button
      height="20"
diff --git a/indra/newview/skins/default/xui/en/floater_destinations.xml b/indra/newview/skins/default/xui/en/floater_destinations.xml
index 373114a1eb8..39aa8e07bb6 100644
--- a/indra/newview/skins/default/xui/en/floater_destinations.xml
+++ b/indra/newview/skins/default/xui/en/floater_destinations.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  ignore_ui_scale="false"
  legacy_header_height="225"
  can_minimize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml
index b96a94a849b..200e9b9537c 100644
--- a/indra/newview/skins/default/xui/en/floater_gesture.xml
+++ b/indra/newview/skins/default/xui/en/floater_gesture.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  save_rect="true"
  legacy_header_height="18"
  can_resize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml
index cd075abc415..c06cb63f8ac 100644
--- a/indra/newview/skins/default/xui/en/floater_help_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  can_resize="true"
  height="600"
diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml
index 6e1bb8fcd02..59f6a9434c4 100644
--- a/indra/newview/skins/default/xui/en/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/en/floater_joystick.xml
@@ -13,6 +13,7 @@
     </floater.string>
     <check_box
      bottom="38"
+     height="10"
      control_name="JoystickEnabled"
      halign="left"
      label="Enable Joystick:"
@@ -28,6 +29,7 @@
      width="380" />
     <spinner
      bottom="48"
+     height="10"
      control_name="JoystickAxis1"
      decimal_digits="0"
      increment="1"
@@ -41,6 +43,7 @@
      width="140" />
     <spinner
      bottom="48"
+     height="10"     
      control_name="JoystickAxis2"
      decimal_digits="0"
      increment="1"
@@ -54,6 +57,7 @@
      width="140" />
     <spinner
      bottom="48"
+     height="10"     
      control_name="JoystickAxis0"
      decimal_digits="0"
      increment="1"
@@ -67,6 +71,7 @@
      width="140" />
     <spinner
      bottom="68"
+     height="10"     
      control_name="JoystickAxis4"
      decimal_digits="0"
      increment="1"
@@ -80,6 +85,7 @@
      width="140" />
     <spinner
      bottom="68"
+     height="10"     
      control_name="JoystickAxis5"
      decimal_digits="0"
      increment="1"
@@ -93,6 +99,7 @@
      width="140" />
     <spinner
      bottom="68"
+     height="10"     
      control_name="JoystickAxis3"
      decimal_digits="0"
      increment="1"
@@ -106,6 +113,7 @@
      width="140" />
     <spinner
      bottom="88"
+     height="10"     
      control_name="JoystickAxis6"
      decimal_digits="0"
      increment="1"
@@ -119,6 +127,7 @@
      width="140" />
     <check_box
      bottom_delta="18"
+     height="10"
      control_name="ZoomDirect"
      label="Direct Zoom"
      layout="topleft"
@@ -127,6 +136,7 @@
      width="60" />
     <check_box
      bottom_delta="0"
+     height="10"     
      control_name="Cursor3D"
      label="3D Cursor"
      layout="topleft"
@@ -135,6 +145,7 @@
      width="60" />
     <check_box
      bottom_delta="0"
+     height="10"     
      control_name="AutoLeveling"
      label="Auto Level"
      layout="topleft"
@@ -157,6 +168,7 @@
     </text>
     <check_box
      bottom="127"
+     height="10"     
      control_name="JoystickAvatarEnabled"
      halign="center"
      label="Avatar"
@@ -166,6 +178,7 @@
      width="60" />
     <check_box
      bottom="127"
+     height="10"     
      control_name="JoystickBuildEnabled"
      halign="center"
      label="Build"
@@ -175,6 +188,7 @@
      width="60" />
     <check_box
      bottom="127"
+     height="10"     
      control_name="JoystickFlycamEnabled"
      halign="center"
      label="Flycam"
@@ -257,6 +271,7 @@
     </text>
     <spinner
      bottom="144"
+     height="10"     
      control_name="AvatarAxisScale1"
      decimal_digits="2"
      label_width="0"
@@ -268,6 +283,7 @@
      width="56" />
     <spinner
      bottom="144"
+     height="10"     
      control_name="BuildAxisScale1"
      decimal_digits="2"
      label_width="0"
@@ -279,6 +295,7 @@
      width="56" />
     <spinner
      bottom="144"
+     height="10"     
      control_name="FlycamAxisScale1"
      decimal_digits="2"
      label_width="0"
@@ -301,6 +318,7 @@
     </text>
     <spinner
      bottom="164"
+     height="10"     
      control_name="AvatarAxisScale2"
      decimal_digits="2"
      label_width="0"
@@ -312,6 +330,7 @@
      width="56" />
     <spinner
      bottom="164"
+     height="10"     
      control_name="BuildAxisScale2"
      decimal_digits="2"
      label_width="0"
@@ -323,6 +342,7 @@
      width="56" />
     <spinner
      bottom="164"
+     height="10"     
      control_name="FlycamAxisScale2"
      decimal_digits="2"
      label_width="0"
@@ -345,6 +365,7 @@
     </text>
     <spinner
      bottom="184"
+     height="10"     
      control_name="AvatarAxisScale0"
      decimal_digits="2"
      label_width="0"
@@ -356,6 +377,7 @@
      width="56" />
     <spinner
      bottom="184"
+     height="10"     
      control_name="BuildAxisScale0"
      decimal_digits="2"
      label_width="0"
@@ -367,6 +389,7 @@
      width="56" />
     <spinner
      bottom="184"
+     height="10"     
      control_name="FlycamAxisScale0"
      decimal_digits="2"
      label_width="0"
@@ -389,6 +412,7 @@
     </text>
     <spinner
      bottom="204"
+     height="10"     
      control_name="AvatarAxisScale4"
      decimal_digits="2"
      label_width="0"
@@ -400,6 +424,7 @@
      width="56" />
     <spinner
      bottom="204"
+     height="10"     
      control_name="BuildAxisScale4"
      decimal_digits="2"
      label_width="0"
@@ -411,6 +436,7 @@
      width="56" />
     <spinner
      bottom="204"
+     height="10"     
      control_name="FlycamAxisScale4"
      decimal_digits="2"
      label_width="0"
@@ -433,6 +459,7 @@
     </text>
     <spinner
      bottom="224"
+     height="10"
      control_name="AvatarAxisScale5"
      decimal_digits="2"
      label_width="0"
@@ -444,6 +471,7 @@
      width="56" />
     <spinner
      bottom="224"
+     height="10"
      control_name="BuildAxisScale5"
      decimal_digits="2"
      label_width="0"
@@ -455,6 +483,7 @@
      width="56" />
     <spinner
      bottom="224"
+     height="10"
      control_name="FlycamAxisScale5"
      decimal_digits="2"
      label_width="0"
@@ -477,6 +506,7 @@
     </text>
     <spinner
      bottom="244"
+     height="10"
      control_name="BuildAxisScale3"
      decimal_digits="2"
      label_width="0"
@@ -488,6 +518,7 @@
      width="56" />
     <spinner
      bottom="244"
+     height="10"
      control_name="FlycamAxisScale3"
      decimal_digits="2"
      label_width="0"
@@ -510,6 +541,7 @@
     </text>
     <spinner
      bottom="274"
+     height="10"
      control_name="AvatarAxisDeadZone1"
      decimal_digits="2"
      increment="0.01"
@@ -520,6 +552,7 @@
      width="56" />
     <spinner
      bottom="274"
+     height="10"
      control_name="BuildAxisDeadZone1"
      decimal_digits="2"
      increment="0.01"
@@ -530,6 +563,7 @@
      width="56" />
     <spinner
      bottom="274"
+     height="10"
      control_name="FlycamAxisDeadZone1"
      decimal_digits="2"
      increment="0.01"
@@ -551,6 +585,7 @@
     </text>
     <spinner
      bottom="294"
+     height="10"     
      control_name="AvatarAxisDeadZone2"
      decimal_digits="2"
      increment="0.01"
@@ -561,6 +596,7 @@
      width="56" />
     <spinner
      bottom="294"
+     height="10"
      control_name="BuildAxisDeadZone2"
      decimal_digits="2"
      increment="0.01"
@@ -571,6 +607,7 @@
      width="56" />
     <spinner
      bottom="294"
+     height="10"
      control_name="FlycamAxisDeadZone2"
      decimal_digits="2"
      increment="0.01"
@@ -592,6 +629,7 @@
     </text>
     <spinner
      bottom="314"
+     height="10"
      control_name="AvatarAxisDeadZone0"
      decimal_digits="2"
      increment="0.01"
@@ -602,6 +640,7 @@
      width="56" />
     <spinner
      bottom="314"
+     height="10"
      control_name="BuildAxisDeadZone0"
      decimal_digits="2"
      increment="0.01"
@@ -612,6 +651,7 @@
      width="56" />
     <spinner
      bottom="314"
+     height="10"
      control_name="FlycamAxisDeadZone0"
      decimal_digits="2"
      increment="0.01"
@@ -633,6 +673,7 @@
     </text>
     <spinner
      bottom="334"
+     height="10"
      control_name="AvatarAxisDeadZone4"
      decimal_digits="2"
      increment="0.01"
@@ -643,6 +684,7 @@
      width="56" />
     <spinner
      bottom="334"
+     height="10"
      control_name="BuildAxisDeadZone4"
      decimal_digits="2"
      increment="0.01"
@@ -653,6 +695,7 @@
      width="56" />
     <spinner
      bottom="334"
+     height="10"
      control_name="FlycamAxisDeadZone4"
      decimal_digits="2"
      increment="0.01"
@@ -674,6 +717,7 @@
     </text>
     <spinner
      bottom="354"
+     height="10"
      control_name="AvatarAxisDeadZone5"
      decimal_digits="2"
      increment="0.01"
@@ -684,6 +728,7 @@
      width="56" />
     <spinner
      bottom="354"
+     height="10"
      control_name="BuildAxisDeadZone5"
      decimal_digits="2"
      increment="0.01"
@@ -694,6 +739,7 @@
      width="56" />
     <spinner
      bottom="354"
+     height="10"
      control_name="FlycamAxisDeadZone5"
      decimal_digits="2"
      increment="0.01"
@@ -715,6 +761,7 @@
     </text>
     <spinner
      bottom="374"
+     height="10"
      control_name="BuildAxisDeadZone3"
      decimal_digits="2"
      increment="0.01"
@@ -725,6 +772,7 @@
      width="56" />
     <spinner
      bottom="374"
+     height="10"
      control_name="FlycamAxisDeadZone3"
      decimal_digits="2"
      increment="0.01"
@@ -802,6 +850,7 @@
     </text>
     <spinner
      bottom="430"
+     height="10"
      control_name="FlycamAxisScale6"
      decimal_digits="2"
      label_width="0"
@@ -824,6 +873,7 @@
     </text>
     <spinner
      bottom="450"
+     height="10"
      control_name="FlycamAxisDeadZone6"
      decimal_digits="2"
      increment="0.01"
diff --git a/indra/newview/skins/default/xui/en/floater_land_holdings.xml b/indra/newview/skins/default/xui/en/floater_land_holdings.xml
index 3737294ebe6..390ec9ab7d4 100644
--- a/indra/newview/skins/default/xui/en/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/en/floater_land_holdings.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="centered"
+ positioning="centered"
  legacy_header_height="18"
  height="430"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml
index 3eeebcf1206..b8893e11d90 100644
--- a/indra/newview/skins/default/xui/en/floater_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_map.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_minimize="true" 
  can_resize="true"
  chrome="true"
diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
index 3d33d19de58..b98f280b562 100644
--- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
+++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
-    open_positioning="cascading"
+    positioning="cascading"
     can_close="true"
     can_resize="true"
     height="440"
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index 065dab04131..4e7ee7913fb 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="specified"
- specified_left="320"
- specified_bottom="80"
+ positioning="specified"
+ left="320"
+ bottom="-80"
  legacy_header_height="18"
  can_dock="false"
  can_minimize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
index 1c4b25a7b02..fdea7a821ab 100644
--- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   legacy_header_height="18"
   can_resize="true"
   height="588"
diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
index cd0b59dc513..184f2962559 100644
--- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_close="true"
  can_resize="true"
  height="570"
diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml
index d6d8431150a..08d0b00a835 100644
--- a/indra/newview/skins/default/xui/en/floater_people.xml
+++ b/indra/newview/skins/default/xui/en/floater_people.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
 
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   can_close="true"
   can_resize="true"
   height="570"
diff --git a/indra/newview/skins/default/xui/en/floater_picks.xml b/indra/newview/skins/default/xui/en/floater_picks.xml
index 78821166624..984894b0165 100644
--- a/indra/newview/skins/default/xui/en/floater_picks.xml
+++ b/indra/newview/skins/default/xui/en/floater_picks.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_close="true"
  can_resize="true"
  height="572"
diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml
index ccceac0a7b2..b241e265a9a 100644
--- a/indra/newview/skins/default/xui/en/floater_places.xml
+++ b/indra/newview/skins/default/xui/en/floater_places.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   legacy_header_height="18"
   can_resize="true"
   height="588"
diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index b2662331b05..bd6faf4ed8f 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- open_positioning="centered"
+ positioning="centered"
  default_tab_group="1"
  height="460"
  layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml
index dd818e2e065..c3e7028dc5b 100644
--- a/indra/newview/skins/default/xui/en/floater_search.xml
+++ b/indra/newview/skins/default/xui/en/floater_search.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
-  open_positioning="cascading"
+  positioning="cascading"
   legacy_header_height="18"
   can_resize="true"
   height="775"
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 0c38283d597..49d64767cc7 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  can_minimize="true"
  can_close="true"
diff --git a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
index 548e24efba3..e1fefc36313 100644
--- a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
@@ -3,6 +3,7 @@
  legacy_header_height="18"
  can_resize="true"
  height="600"
+ single_instance="false"
  layout="topleft"
  name="floater_test_text_editor"
  translate="false"
diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml
index 13c850c86c0..10854f5a499 100644
--- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml
@@ -115,6 +115,7 @@
   </flyout_button>
   <check_box
    bottom_delta="35"
+   height="10"
    label="Checkbox"
    layout="topleft"
    tool_tip="checkbox"
@@ -275,6 +276,7 @@
   <!-- "spinner" is a numerical input widget with an up and down arrow to
        change the value. -->
   <spinner
+    height="10"
    bottom_delta="35"
    follows="top|left"
    label="Spinner"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 2d63c94fe11..e37740d20cd 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  legacy_header_height="18"
  height="580"
  layout="topleft"
@@ -1206,6 +1206,7 @@ even though the user gets a free copy.
              label="Modify"
              layout="topleft"
              left="10"
+             height="10"
              name="checkbox next owner can modify"
              width="85" />
             <check_box
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index fcaae9d172a..d8211c24a72 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -10,7 +10,7 @@
   layout="topleft"
   legacy_header_height="18"
   name="Toybox"
-  open_positioning="centered"
+  positioning="centered"
   save_rect="true"
   single_instance="true"
   title="TOOLBAR BUTTONS"
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index d99b29f3247..dce2720cf8c 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
- open_positioning="cascading"
+ positioning="cascading"
  can_resize="true"
  can_minimize="true"
  can_close="true"
diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
index 77fb21e27c5..35cb2670d09 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml
@@ -36,15 +36,20 @@
   <string name="effect_Cyber">Cyber</string>
   <string name="effect_DeepBot">DeepBot</string>
   <string name="effect_Demon">Demon</string>
+  <string name="effect_Female Elf">Female Elf</string>
   <string name="effect_Flirty">Flirty</string>
   <string name="effect_Foxy">Foxy</string>
-  <string name="effect_Halloween_2010_Bonus">Halloween_2010_Bonus</string>
+  <string name="effect_Halloween 2010 Bonus">Halloween_2010_Bonus</string>
   <string name="effect_Helium">Helium</string>
   <string name="effect_Husky">Husky</string>
+  <string name="effect_Husky Whisper">Husky Whisper</string>
   <string name="effect_Intercom">Intercom</string>
+  <string name="effect_Julia">Julia</string>
+  <string name="effect_Lo Lilt">Lo Lilt</string>
   <string name="effect_Macho">Macho</string>
   <string name="effect_Micro">Micro</string>
   <string name="effect_Mini">Mini</string>
+  <string name="effect_Model">Model</string>
   <string name="effect_Nano">Nano</string>
   <string name="effect_Nightmare">Nightmare</string>
   <string name="effect_PopBot">PopBot</string>
@@ -52,10 +57,12 @@
   <string name="effect_Radio">Radio</string>
   <string name="effect_Robot">Robot</string>
   <string name="effect_Roxanne">Roxanne</string>
+  <string name="effect_Rumble">Rumble</string>
   <string name="effect_Sabrina">Sabrina</string>
   <string name="effect_Samantha">Samantha</string>
   <string name="effect_Sexy">Sexy</string>
   <string name="effect_Shorty">Shorty</string>
+  <string name="effect_Smaller">Smaller</string>
   <string name="effect_Sneaky">Sneaky</string>
   <string name="effect_Stallion">Stallion</string>
   <string name="effect_Sultry">Sultry</string>
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index 56d79f62c7b..83407069d2e 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -2,7 +2,7 @@
 <floater
  legacy_header_height="18"
  can_resize="true"
- open_positioning="centered"
+ positioning="centered"
  height="600"
  layout="topleft"
  min_height="520"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index ef4a1bc0618..b13bf5b5086 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -452,6 +452,14 @@
     <menu_item_separator
      layout="topleft" 
      name="Copy Separator" />
+    <menu_item_call
+     label="Cut"
+     layout="topleft"
+     name="Cut">
+        <menu_item_call.on_click
+         function="Inventory.DoToSelected"
+         parameter="cut" />
+    </menu_item_call>
     <menu_item_call
      label="Copy"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1d11abcf73e..5ba566b175e 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3268,6 +3268,14 @@
             <menu_item_call.on_click
              function="Advanced.CompressImage" />
         </menu_item_call>
+
+      <menu_item_call
+         label="Enable Visual Leak Detector"
+         name="Enable Visual Leak Detector">
+        <menu_item_call.on_click
+           function="Advanced.ToggleVisualLeakDetector" />
+        </menu_item_call>
+      
         <menu_item_check
          label="Output Debug Minidump"
          name="Output Debug Minidump">
@@ -3294,6 +3302,7 @@
          name="Set Logging Level"
          tear_off="true">
           <menu_item_check
+            name="Debug"
             label="Debug">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3303,6 +3312,7 @@
              parameter="0" />
           </menu_item_check>
           <menu_item_check
+            name="Info"
             label="Info">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3312,6 +3322,7 @@
              parameter="1" />
           </menu_item_check>
           <menu_item_check
+            name="Warning"
             label="Warning">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3321,6 +3332,7 @@
              parameter="2" />
           </menu_item_check>
           <menu_item_check
+            name="Error"
             label="Error">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
@@ -3330,6 +3342,7 @@
              parameter="3" />
           </menu_item_check>
           <menu_item_check
+            name="None"
             label="None">
             <menu_item_check.on_check
               function="Develop.CheckLoggingLevel"
diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml
index 1b97de2b05e..1ef99649e67 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml
@@ -18,6 +18,7 @@
 	<text_chat
       top="3"
       left="30"
+      right="-10"
       height="120"
       text_color="white"
       word_wrap="true"
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index e9427a23882..3f67a48b14f 100644
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -85,6 +85,7 @@
              top_delta="0"
              width="95" />
             <check_box
+              height="10"
              bottom_delta="20"
              follows="left|top"
              label="Constrain proportions"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index 9057ebb65eb..71d808fa4b2 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -114,6 +114,7 @@
      width="95" />
     <check_box
      bottom_delta="20"
+     height="10"
      follows="left|top"
      label="Constrain proportions"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index b966358f18d..781ab174031 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -132,6 +132,7 @@
              width="95" />
             <check_box
              bottom_delta="20"
+             height="10"
              follows="left|top"
              label="Constrain proportions"
              layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 5bd383b81e8..0dd357aa1a7 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -119,6 +119,7 @@
              top_delta="0"
              width="95" />
             <check_box
+              height="10"
              bottom_delta="20"
              label="Constrain proportions"
              layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index 22c1139cdb5..3aa34439f13 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -35,8 +35,8 @@
     </panel.string>
   <panel
     height="18"
-    left="-370"
-    width="160"
+    left="-395"
+    width="185"
     top="1"
     follows="right|top" 
     name="balance_bg">
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index 0b5aff54ca8..37a904bca81 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -10,7 +10,6 @@
 -->
 
 <floater
- open_positioning="none"
  legacy_header_height="0"
  header_height="0"
  name="toast"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index ee790e8dd4c..6ecb57b41d8 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -48,10 +48,10 @@
                       height="300"
                       width="330" />
              </layout_panel>
-			    <layout_panel
+			 <layout_panel
                  width="330"
                  layout="topleft"
-                 auto_resize="true"
+                 auto_resize="false"
                  user_resize="true"
                  follows="left|right|top"
                  name="inbox_layout_panel"
@@ -105,6 +105,7 @@
                         [NUM] new
                      </text>
                      <panel
+                        name="inbox_inventory_placeholder_panel"
                         follows="all"
                         left="10"
                         bottom="235"
diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml
index adbb1833178..97a5ae7d4e5 100644
--- a/indra/newview/skins/default/xui/en/widgets/floater.xml
+++ b/indra/newview/skins/default/xui/en/widgets/floater.xml
@@ -2,7 +2,7 @@
 <!-- See also settings.xml UIFloater* settings for configuration -->
 <floater
  name="floater"
- open_positioning="none"
+ positioning="none"
  layout="topleft"
  bg_opaque_color="FloaterFocusBackgroundColor"
  bg_alpha_color="FloaterDefaultBackgroundColor"
diff --git a/indra/newview/skins/default/xui/es/panel_status_bar.xml b/indra/newview/skins/default/xui/es/panel_status_bar.xml
index 79b2c32b236..7eead3bc184 100644
--- a/indra/newview/skins/default/xui/es/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-410" name="balance_bg" width="200">
 		<text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Pulsa para comprar más L$"/>
 		<button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life" width="80"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
index c0d59a3182d..ba36a7d2991 100644
--- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-405" name="balance_bg" width="195">
 		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
 		<button label="Acheter L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$."/>
 		<button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life." width="75"/>
diff --git a/indra/newview/skins/default/xui/it/panel_status_bar.xml b/indra/newview/skins/default/xui/it/panel_status_bar.xml
index 4abc90113f4..0aaf89d8c89 100644
--- a/indra/newview/skins/default/xui/it/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/it/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-405" name="balance_bg" width="195">
 		<text name="balance" tool_tip="Clicca per aggiornare il tuo saldo in L$" value="L$ 20"/>
 		<button label="Acquista L$" name="buyL" tool_tip="Clicca per acquistare più L$"/>
 		<button label="Acquisti" name="goShop" tool_tip="Apri Mercato Second Life" width="75"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_status_bar.xml b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
index 4fb876f690b..f09643d5622 100644
--- a/indra/newview/skins/default/xui/ja/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-370" name="balance_bg" width="160">
 		<text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/>
 		<button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/>
 		<button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"  width="40"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_status_bar.xml b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
index 22853f0643c..cb9a6eb7576 100644
--- a/indra/newview/skins/default/xui/pt/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-410" name="balance_bg" width="200">
 		<text name="balance" tool_tip="Atualizar saldo de L$" value="L$20"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Comprar mais L$"/>
 		<button label="Comprar" name="goShop" tool_tip="Abrir Mercado do Second Life" width="80"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_status_bar.xml b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
index babe5811ace..9c84ff1fd89 100644
--- a/indra/newview/skins/default/xui/ru/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ru/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-450" name="balance_bg" width="240">
 		<text name="balance" tool_tip="Щелкните для обновления вашего баланса L$" value="L$20"/>
 		<button label="Купить L$" name="buyL" tool_tip="Щелкните для покупки L$"/>
 		<button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life" width="121"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_status_bar.xml b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
index 81c304a5d80..178cbda4a2e 100644
--- a/indra/newview/skins/default/xui/tr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/tr/panel_status_bar.xml
@@ -15,7 +15,7 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
+	<panel left="-425" name="balance_bg" width="215">
 		<text name="balance" tool_tip="L$ bakiyenizi yenilemek için buraya tıklayın" value="L$20"/>
 		<button label="L$ Satın Al" name="buyL" tool_tip="Daha fazla L$ satın almak için tıklayın"/>
 		<button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç" width="95"/>
-- 
GitLab


From e4782045260259b59c3f91a2c5132fc6cf429622 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 6 Apr 2012 09:04:51 -0400
Subject: [PATCH 905/933] STORM-1833 Square char is presented in list of
 recompilation for script with error Subtask of STORM-637

---
 indra/newview/llassetuploadqueue.cpp | 4 +++-
 indra/newview/llcompilequeue.cpp     | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llassetuploadqueue.cpp b/indra/newview/llassetuploadqueue.cpp
index 7e50098a173..f943759bb89 100644
--- a/indra/newview/llassetuploadqueue.cpp
+++ b/indra/newview/llassetuploadqueue.cpp
@@ -123,7 +123,9 @@ class LLAssetUploadChainResponder : public LLUpdateTaskInventoryResponder
 			for(LLSD::array_const_iterator line	= compile_errors.beginArray();
 				line < compile_errors.endArray(); line++)
 			{
-				mSupplier->log(line->asString());
+				std::string str = line->asString();
+				str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());
+				mSupplier->log(str);
 				llinfos << content["errors"] << llendl;
 			}
 		}
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index 91cf6309323..4f5f9e22b69 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -159,7 +159,6 @@ void LLFloaterScriptQueue::addObject(const LLUUID& id)
 
 BOOL LLFloaterScriptQueue::start()
 {
-	//llinfos << "LLFloaterCompileQueue::start()" << llendl;
 	std::string buffer;
 
 	LLSelectMgr *mgr = LLSelectMgr::getInstance();
-- 
GitLab


From 973bc1d1745d8315fd63f537871b2afde8bc0994 Mon Sep 17 00:00:00 2001
From: Nicky Perian <nickyperian@yahoo.com>
Date: Tue, 3 Apr 2012 20:25:49 -0500
Subject: [PATCH 906/933] STORM-1828 Change write to location from
 LL_PATH_CHARACTER to LL_PATH_USER_SETTINGS. This will allow a common write
 location for development and installed configurations. Should correct
 installed configuration from permission failures on windows systems where
 writing to the install directory requires elevation of rights to
 administrator.

---
 indra/newview/llvoavatar.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f46cedfc4be..7d6923cbc51 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7532,7 +7532,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
 void LLVOAvatar::dumpArchetypeXML( void* )
 {
 	LLAPRFile outfile;
-	outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB );
+	outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"new archetype.xml"), LL_APR_WB );
 	apr_file_t* file = outfile.getFileHandle();
 	if (!file)
 	{
@@ -7540,7 +7540,7 @@ void LLVOAvatar::dumpArchetypeXML( void* )
 	}
 	else
 	{
-		llinfos << "xmlfile write handle obtained : " << gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml") << llendl;
+		llinfos << "xmlfile write handle obtained : " << gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"new archetype.xml") << llendl;
 	}
 
 	apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" );
-- 
GitLab


From 2ed386e07b5c1bb7dd47a403548746e7416acd67 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 4 Apr 2012 09:17:58 -0400
Subject: [PATCH 907/933] STORM-1787 remove dead code that causes spurious
 build log error reports

---
 build.sh | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/build.sh b/build.sh
index c7c89fe3c2b..7c11308f0c8 100755
--- a/build.sh
+++ b/build.sh
@@ -132,10 +132,6 @@ if test -f scripts/update_version_files.py ; then
   end_section UpdateVer
 fi
 
-# Now retrieve the version for use in the version manager
-# First three parts only, $revision will be appended automatically.
-build_viewer_update_version_manager_version=`python scripts/get_version.py --viewer-version | sed 's/\.[0-9]*$//'`
-
 if [ -z "$AUTOBUILD" ]
 then
   export autobuild_dir="$here/../../../autobuild/bin/"
-- 
GitLab


From 0539de909951e94c9c22aac9ac94835793c7bf49 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 6 Apr 2012 14:36:58 -0400
Subject: [PATCH 908/933] STORM-1837: check for valid png header before
 attempting to decode

---
 indra/llimage/llimagepng.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp
index 8d493ecde0b..294f68b1220 100644
--- a/indra/llimage/llimagepng.cpp
+++ b/indra/llimage/llimagepng.cpp
@@ -60,6 +60,12 @@ BOOL LLImagePNG::updateData()
 
 	// Decode the PNG data and extract sizing information
 	LLPngWrapper pngWrapper;
+	if (!pngWrapper.isValidPng(getData()))
+	{
+		setLastError("LLImagePNG data does not have a valid PNG header!");
+		return FALSE;
+	}
+
 	LLPngWrapper::ImageInfo infop;
 	if (! pngWrapper.readPng(getData(), NULL, &infop))
 	{
@@ -90,6 +96,12 @@ BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time)
 
 	// Decode the PNG data into the raw image
 	LLPngWrapper pngWrapper;
+	if (!pngWrapper.isValidPng(getData()))
+	{
+		setLastError("LLImagePNG data does not have a valid PNG header!");
+		return FALSE;
+	}
+
 	if (! pngWrapper.readPng(getData(), raw_image))
 	{
 		setLastError(pngWrapper.getErrorMessage());
-- 
GitLab


From 4ff8067aa8f5117fa83e1a971b5bbc0c8fc033b2 Mon Sep 17 00:00:00 2001
From: Vaalith Jinn <none@none>
Date: Mon, 9 Apr 2012 17:44:27 +0300
Subject: [PATCH 909/933] STORM-64: Added toasts to display critical errors
 during update cycle.

---
 indra/newview/lllocalbitmaps.cpp               | 10 ++++++++++
 .../skins/default/xui/en/notifications.xml     | 18 ++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index b96fc062261..10c3b20f63d 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -59,6 +59,7 @@
 #include "llagentwearables.h"
 #include "lltexlayerparams.h"
 #include "llvovolume.h"
+#include "llnotificationsutil.h"
 
 /*=======================================*/
 /*  Formal declarations, constants, etc. */
@@ -234,6 +235,11 @@ bool LLLocalBitmap::updateSelf(bool first_update)
 								<< "Filename: " << mFilename << "\n"
 								<< "Disabling further update attempts for this file." << llendl;
 
+						LLSD notif_args;
+						notif_args["FNAME"] = mFilename;
+						notif_args["NRETRIES"] = LL_LOCAL_UPDATE_RETRIES;
+						LLNotificationsUtil::add("LocalBitmapsUpdateFailedFinal", notif_args);
+
 						mLinkStatus = LS_BROKEN;
 					}
 				}		
@@ -247,6 +253,10 @@ bool LLLocalBitmap::updateSelf(bool first_update)
 			        << "Filename: " << mFilename << "\n"
 				    << "Disabling further update attempts for this file." << llendl;
 
+			LLSD notif_args;
+			notif_args["FNAME"] = mFilename;
+			LLNotificationsUtil::add("LocalBitmapsUpdateFileNotFound", notif_args);
+
 			mLinkStatus = LS_BROKEN;
 		}
 	}
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index af75d493532..e9175e23906 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7696,4 +7696,22 @@ Otherwise, you can look at the Map and find places marked &quot;Infohub&quot;.
 You died and have been teleported to your home location.
   </global>
 
+  <notification
+   icon="alertmodal.tga"
+   name="LocalBitmapsUpdateFileNotFound"
+   persist="true"
+   type="notify">
+[FNAME] could not be updated because the file could no longer be found.
+Disabling future updates for this file.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LocalBitmapsUpdateFailedFinal"
+   persist="true"
+   type="notify">
+[FNAME] could not be opened or decoded for [NRETRIES] attempts, and is now considered broken.
+Disabling future updates for this file.
+  </notification>
+  
 </notifications>
-- 
GitLab


From 7e97368fe4486b060ca1fe000265d164b5ab9ccc Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 9 Apr 2012 16:43:26 -0700
Subject: [PATCH 910/933] FIX VWR-28730 JA terminology consistency fix

---
 .../ja/floater_inventory_item_properties.xml  |  6 +-
 .../xui/ja/floater_inventory_view_finder.xml  |  2 +-
 .../default/xui/ja/floater_model_wizard.xml   |  2 +-
 .../default/xui/ja/floater_my_inventory.xml   |  2 +-
 .../default/xui/ja/floater_object_weights.xml |  2 +-
 .../default/xui/ja/floater_openobject.xml     |  2 +-
 .../skins/default/xui/ja/floater_people.xml   |  2 +-
 .../xui/ja/floater_preview_texture.xml        |  2 +-
 .../skins/default/xui/ja/floater_snapshot.xml |  6 +-
 .../xui/ja/menu_inventory_gear_default.xml    |  2 +-
 .../xui/ja/menu_places_gear_folder.xml        |  4 +-
 .../xui/ja/menu_places_gear_landmark.xml      |  4 +-
 .../default/xui/ja/menu_url_inventory.xml     |  4 +-
 .../skins/default/xui/ja/menu_viewer.xml      | 12 ++--
 .../skins/default/xui/ja/notifications.xml    | 70 +++++++++----------
 .../xui/ja/panel_group_control_panel.xml      |  4 +-
 .../xui/ja/panel_group_info_sidetray.xml      |  4 +-
 .../default/xui/ja/panel_group_notices.xml    |  6 +-
 .../skins/default/xui/ja/panel_landmarks.xml  |  4 +-
 .../default/xui/ja/panel_main_inventory.xml   |  6 +-
 .../newview/skins/default/xui/ja/panel_me.xml |  4 +-
 .../default/xui/ja/panel_outbox_inventory.xml |  4 +-
 .../default/xui/ja/panel_outfit_edit.xml      |  4 +-
 .../xui/ja/panel_outfits_inventory.xml        |  4 +-
 .../skins/default/xui/ja/panel_people.xml     |  6 +-
 .../xui/ja/panel_snapshot_inventory.xml       |  6 +-
 .../default/xui/ja/panel_snapshot_options.xml |  4 +-
 .../skins/default/xui/ja/role_actions.xml     |  4 +-
 .../default/xui/ja/sidepanel_inventory.xml    |  4 +-
 .../default/xui/ja/sidepanel_item_info.xml    |  6 +-
 .../newview/skins/default/xui/ja/strings.xml  | 32 ++++-----
 .../skins/default/xui/ja/teleport_strings.xml |  4 +-
 32 files changed, 114 insertions(+), 114 deletions(-)

diff --git a/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml
index 725214086a5..c01c46211ec 100644
--- a/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml
+++ b/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="item properties" title="持ち物アイテムのプロパティ">
+<floater name="item properties" title="インベントリアイテムのプロパティ">
 	<floater.string name="unknown">
 		(不明)
 	</floater.string>
@@ -24,11 +24,11 @@
 	<text name="LabelCreatorTitle">
 		クリエーター
 	</text>
-	<button label="情報" label_selected="" name="BtnCreator"/>
+	<button label="プロフィール..." label_selected="" name="BtnCreator"/>
 	<text name="LabelOwnerTitle">
 		オーナー:
 	</text>
-	<button label="情報" label_selected="" name="BtnOwner"/>
+	<button label="プロフィール..." label_selected="" name="BtnOwner"/>
 	<text name="LabelAcquiredTitle">
 		入手日時:
 	</text>
diff --git a/indra/newview/skins/default/xui/ja/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/ja/floater_inventory_view_finder.xml
index 47d57da0310..af96edda79b 100644
--- a/indra/newview/skins/default/xui/ja/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/ja/floater_inventory_view_finder.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Inventory Finder" title="最近取得した持ち物アイテム">
+<floater name="Inventory Finder" title="インベントリ最近取得したアイテム">
 	<check_box label="アニメーション" name="check_animation"/>
 	<check_box label="コーリング・カード" name="check_calling_card"/>
 	<check_box label="服" name="check_clothing"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
index 270031a33ee..746bd8553c8 100644
--- a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml
@@ -137,7 +137,7 @@
 			モデルがアップロードされました。
 		</text>
 		<text name="inventory_text">
-			それは持ち物の「オブジェクト」フォルダにあります。
+			それはインベントリの「オブジェクト」フォルダにあります。
 		</text>
 		<text name="charged_fee">
 			あなたのアカウントに L$ [FEE] が請求されました。
diff --git a/indra/newview/skins/default/xui/ja/floater_my_inventory.xml b/indra/newview/skins/default/xui/ja/floater_my_inventory.xml
index c6a789b63b1..d708fc3decb 100644
--- a/indra/newview/skins/default/xui/ja/floater_my_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/floater_my_inventory.xml
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="floater_my_inventory" title="持ち物"/>
+<floater name="floater_my_inventory" title="インベントリ"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_object_weights.xml b/indra/newview/skins/default/xui/ja/floater_object_weights.xml
index 3bd9b6b069e..d727a268fb6 100644
--- a/indra/newview/skins/default/xui/ja/floater_object_weights.xml
+++ b/indra/newview/skins/default/xui/ja/floater_object_weights.xml
@@ -6,7 +6,7 @@
 	<text name="objects_label" value="オブジェクト"/>
 	<text name="prims" value="--"/>
 	<text name="prims_label" value="プリム"/>
-	<text name="weights_of_selected_text" value="選択済み項目のウエイト"/>
+	<text name="weights_of_selected_text" value="選択済みアイテムのウエイト"/>
 	<text name="download" value="--"/>
 	<text name="download_label" value="ダウンロード"/>
 	<text name="physics" value="--"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_openobject.xml b/indra/newview/skins/default/xui/ja/floater_openobject.xml
index bd1b650f985..af02ffedda1 100644
--- a/indra/newview/skins/default/xui/ja/floater_openobject.xml
+++ b/indra/newview/skins/default/xui/ja/floater_openobject.xml
@@ -3,6 +3,6 @@
 	<text name="object_name">
 		[DESC]:
 	</text>
-	<button label="持ち物にコピー" label_selected="持ち物にコピー" name="copy_to_inventory_button"/>
+	<button label="インベントリにコピー" label_selected="インベントリにコピー" name="copy_to_inventory_button"/>
 	<button label="コピーして装着" label_selected="コピーして装着" name="copy_and_wear_button"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_people.xml b/indra/newview/skins/default/xui/ja/floater_people.xml
index 08bee881034..b180658ab72 100644
--- a/indra/newview/skins/default/xui/ja/floater_people.xml
+++ b/indra/newview/skins/default/xui/ja/floater_people.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="floater_people" title="人">
 	<panel_container name="main_panel">
-		<panel label="グループ情報" name="panel_group_info_sidetray"/>
+		<panel label="グループプロフィール" name="panel_group_info_sidetray"/>
 		<panel label="ブロックされた住人とオブジェクト" name="panel_block_list_sidetray"/>
 	</panel_container>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_preview_texture.xml b/indra/newview/skins/default/xui/ja/floater_preview_texture.xml
index 6ea1d79cfcf..4617fd1d92c 100644
--- a/indra/newview/skins/default/xui/ja/floater_preview_texture.xml
+++ b/indra/newview/skins/default/xui/ja/floater_preview_texture.xml
@@ -4,7 +4,7 @@
 		テクスチャ: [NAME]
 	</floater.string>
 	<floater.string name="Copy">
-		持ち物にコピー
+		インベントリにコピー
 	</floater.string>
 	<text name="desc txt">
 		説明:
diff --git a/indra/newview/skins/default/xui/ja/floater_snapshot.xml b/indra/newview/skins/default/xui/ja/floater_snapshot.xml
index cf4732a68ef..f145a2e8b88 100644
--- a/indra/newview/skins/default/xui/ja/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/ja/floater_snapshot.xml
@@ -10,7 +10,7 @@
 		投稿
 	</string>
 	<string name="inventory_progress_str">
-		持ち物に保存
+		インベントリに保存
 	</string>
 	<string name="local_progress_str">
 		コンピュータに保存
@@ -22,7 +22,7 @@
 		メールが送信されました
 	</string>
 	<string name="inventory_succeeded_str">
-		持ち物に保存されました
+		インベントリに保存されました
 	</string>
 	<string name="local_succeeded_str">
 		コンピュータに保存されました
@@ -34,7 +34,7 @@
 		メールを送信できませんでした。
 	</string>
 	<string name="inventory_failed_str">
-		持ち物に保存できませんでした。
+		インベントリに保存できませんでした。
 	</string>
 	<string name="local_failed_str">
 		コンピュータに保存できませんでした。
diff --git a/indra/newview/skins/default/xui/ja/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/ja/menu_inventory_gear_default.xml
index 1f425df83c0..f38dbc71a8a 100644
--- a/indra/newview/skins/default/xui/ja/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/ja/menu_inventory_gear_default.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <toggleable_menu name="menu_gear_default">
-	<menu_item_call label="新しい持ち物ウィンドウ" name="new_window"/>
+	<menu_item_call label="新しいインベントリウィンドウ" name="new_window"/>
 	<menu_item_check label="名前で並べ替え" name="sort_by_name"/>
 	<menu_item_check label="新しい順に並べ替え" name="sort_by_recent"/>
 	<menu_item_check label="フォルダを常に名前順に並べる" name="sort_folders_by_name"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/ja/menu_places_gear_folder.xml
index e64f97fda54..c4552047227 100644
--- a/indra/newview/skins/default/xui/ja/menu_places_gear_folder.xml
+++ b/indra/newview/skins/default/xui/ja/menu_places_gear_folder.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <toggleable_menu name="menu_folder_gear">
 	<menu_item_call label="ランドマークを追加" name="add_landmark"/>
 	<menu_item_call label="フォルダを追加" name="add_folder"/>
-	<menu_item_call label="商品を復元" name="restore_item"/>
+	<menu_item_call label="アイテムを復元" name="restore_item"/>
 	<menu_item_call label="切り取り" name="cut"/>
 	<menu_item_call label="コピー" name="copy_folder"/>
 	<menu_item_call label="貼り付け" name="paste"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/ja/menu_places_gear_landmark.xml
index f416b5b1f66..579f2c2cbd1 100644
--- a/indra/newview/skins/default/xui/ja/menu_places_gear_landmark.xml
+++ b/indra/newview/skins/default/xui/ja/menu_places_gear_landmark.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <toggleable_menu name="menu_ladmark_gear">
 	<menu_item_call label="テレポート" name="teleport"/>
 	<menu_item_call label="もっと詳しく" name="more_info"/>
 	<menu_item_call label="地図に表示" name="show_on_map"/>
 	<menu_item_call label="ランドマークを追加" name="add_landmark"/>
 	<menu_item_call label="フォルダを追加" name="add_folder"/>
-	<menu_item_call label="商品を復元" name="restore_item"/>
+	<menu_item_call label="アイテムを復元" name="restore_item"/>
 	<menu_item_call label="切り取り" name="cut"/>
 	<menu_item_call label="ランドマークをコピー" name="copy_landmark"/>
 	<menu_item_call label="SLurl をコピー" name="copy_slurl"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_url_inventory.xml b/indra/newview/skins/default/xui/ja/menu_url_inventory.xml
index 7af2f9e2cd8..147ab44a1b1 100644
--- a/indra/newview/skins/default/xui/ja/menu_url_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/menu_url_inventory.xml
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <context_menu name="Url Popup">
-	<menu_item_call label="持ち物アイテムを表示" name="show_item"/>
+	<menu_item_call label="インベントリアイテムを表示" name="show_item"/>
 	<menu_item_call label="名前をクリップボードにコピー" name="url_copy_label"/>
 	<menu_item_call label="SLurl をクリップボードにコピー" name="url_copy"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 4430ec054c3..875d08491ca 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="ミー" name="Me">
 		<menu_item_call label="プロフィール..." name="Profile"/>
 		<menu_item_call label="容姿..." name="ChangeOutfit"/>
 		<menu_item_call label="アバターを選択..." name="Avatar Picker"/>
-		<menu_item_check label="持ち物..." name="Inventory"/>
-		<menu_item_call label="新しい持ち物ウィンドウ" name="NewInventoryWindow"/>
+		<menu_item_check label="インベントリ..." name="Inventory"/>
+		<menu_item_call label="新しいインベントリウィンドウ" name="NewInventoryWindow"/>
 		<menu_item_call label="場所..." name="Places"/>
 		<menu_item_call label="ピック..." name="Picks"/>
 		<menu_item_call label="カメラコントロール..." name="Camera Controls"/>
@@ -112,7 +112,7 @@
 			<menu_item_call label="買う" name="Menu Object Buy"/>
 			<menu_item_call label="取る" name="Menu Object Take"/>
 			<menu_item_call label="コピーを取る" name="Take Copy"/>
-			<menu_item_call label="「持ち物」に保存" name="Save Object Back to My Inventory"/>
+			<menu_item_call label="マイインベントリに保存" name="Save Object Back to My Inventory"/>
 			<menu_item_call label="オブジェクトの中身に保存" name="Save Object Back to Object Contents"/>
 			<menu_item_call label="オブジェクトを返却する" name="Return Object back to Owner"/>
 		</menu>
@@ -337,7 +337,7 @@
 			<menu_item_call label="メディアブラウザのテスト" name="Web Browser Test"/>
 			<menu_item_call label="Web コンテンツブラウザ" name="Web Content Browser"/>
 			<menu_item_call label="SelectMgr をダンプ" name="Dump SelectMgr"/>
-			<menu_item_call label="持ち物の出力" name="Dump Inventory"/>
+			<menu_item_call label="インベントリの出力" name="Dump Inventory"/>
 			<menu_item_call label="タイマーをダンプ" name="Dump Timers"/>
 			<menu_item_call label="フォーカスホールダーをダンプ" name="Dump Focus Holder"/>
 			<menu_item_call label="選択したオブジェクト情報をプリント" name="Print Selected Object Info"/>
@@ -391,7 +391,7 @@
 			<menu_item_call label="ローカルテクスチャをダンプ" name="Dump Local Textures"/>
 		</menu>
 		<menu_item_check label="HTTP Texture" name="HTTP Textures"/>
-		<menu_item_check label="HTTP 持ち物" name="HTTP Inventory"/>
+		<menu_item_check label="HTTP インベントリ" name="HTTP Inventory"/>
 		<menu_item_call label="圧縮画像" name="Compress Images"/>
 		<menu_item_check label="デバッグ用のミニダンプを出力する" name="Output Debug Minidump"/>
 		<menu_item_check label="次回の起動時にコンソールウィンドウを表示する" name="Console Window"/>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index c8e8dbb0f13..1219d0872b6 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <notifications>
 	<global name="skipnexttime">
 		今後は表示しない
@@ -264,7 +264,7 @@ L$ が不足しているのでこのグループに参加することができ
 		<usetemplate name="okcancelbuttons" notext="キャンセル" yestext="OK"/>
 	</notification>
 	<notification name="ReturnObjectsDeededToGroup">
-		この区画のグループ [NAME] 共有のすべてのオブジェクトを、以前の所有者の「持ち物」に戻そうとしています。
+		この区画のグループ [NAME] 共有のすべてのオブジェクトを、以前の所有者のインベントリに戻そうとしています。
 操作を続行しますか?
 
 *警告* これにより、
@@ -275,21 +275,21 @@ L$ が不足しているのでこのグループに参加することができ
 	<notification name="ReturnObjectsOwnedByUser">
 		この区画で、
 住人 [NAME] が所有する全てのオブジェクトを
-本人の「持ち物」に本当に返却してもよいですか?
+本人のインベントリに本当に返却してもよいですか?
 
 オブジェクト: [N]
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="ReturnObjectsOwnedBySelf">
 		この土地区画内にある、あなたが所有するすべてのオブジェクトを、
-あなたの「持ち物」に戻そうとしています。続けますか?
+あなたのインベントリに戻そうとしています。続けますか?
 
 オブジェクト: [N]
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="ReturnObjectsNotOwnedBySelf">
 		この土地区画内にある、あなた以外が所有するすべてのオブジェクトを、
-それぞれの所有者の「持ち物」に戻そうとしています。
+それぞれの所有者のインベントリに戻そうとしています。
 操作を続行しますか?
 グループに譲渡された「再販・プレゼント可」のオブジェクトは、以前の所有者に返却されます。
 
@@ -300,7 +300,7 @@ L$ が不足しているのでこのグループに参加することができ
 	</notification>
 	<notification name="ReturnObjectsNotOwnedByUser">
 		この土地区画内にある、
-[NAME]以外による所有のオブジェクトをすべてそれぞれの所有者の「持ち物」に返却しようとしています。
+[NAME]以外による所有のオブジェクトをすべてそれぞれの所有者のインベントリに返却しようとしています。
 操作を続行しますか?グループに譲渡された「再販・プレゼント可」のオブジェクトは、以前の所有者に返却されます。
 
 *警告* これにより、
@@ -464,14 +464,14 @@ L$ が不足しているのでこのグループに参加することができ
 		ジェスチャーの保存に失敗しました。少し待ってからもう一度試してください。
 	</notification>
 	<notification name="GestureSaveFailedObjectNotFound">
-		ジェスチャーの保存に失敗しました。オブジェクト、または関連するオブジェクト持ち物が見つかりません。
+		ジェスチャーの保存に失敗しました。オブジェクト、または関連するオブジェクトインベントリが見つかりません。
 オブジェクトが範囲内に存在しないか、または削除された可能性があります。
 	</notification>
 	<notification name="GestureSaveFailedReason">
 		次の理由で、ジェスチャーの保存時に問題が起こりました。 [REASON]。  後でもう一度試してください。
 	</notification>
 	<notification name="SaveNotecardFailObjectNotFound">
-		ノートカードの保存に失敗しました。オブジェクト、または関連するオブジェクト持ち物が見つかりません。
+		ノートカードの保存に失敗しました。オブジェクト、または関連するオブジェクトインベントリが見つかりません。
 オブジェクトが範囲内に存在しないか、または削除された可能性があります。
 	</notification>
 	<notification name="SaveNotecardFailReason">
@@ -535,11 +535,11 @@ L$ が不足しているのでこのグループに参加することができ
 		[REGION] では、地形の変更ができません。
 	</notification>
 	<notification name="CannotCopyWarning">
-		あなたには[ITEMS]というアイテムをコピーする許可がありません。他の住人に提供すると、そのアイテムはあなたの「持ち物」から削除されます。本当にこれらのアイテムを譲りますか?
+		あなたには[ITEMS]というアイテムをコピーする許可がありません。他の住人に提供すると、そのアイテムはあなたのインベントリから削除されます。本当にこれらのアイテムを譲りますか?
 		<usetemplate name="okcancelbuttons" notext="いいえ" yestext="はい"/>
 	</notification>
 	<notification name="CannotGiveItem">
-		持ち物のアイテムを渡せません。
+		インベントリのアイテムを渡せません。
 	</notification>
 	<notification name="TransactionCancelled">
 		取引がキャンセルされました。
@@ -552,7 +552,7 @@ L$ が不足しているのでこのグループに参加することができ
 	</notification>
 	<notification name="CannotCopyCountItems">
 		あなたは選択した [COUNT] 個のアイテムののコピーを許されていません。
-これらのアイテムはあなたの「持ち物」から失われます。
+これらのアイテムはあなたのインベントリから失われます。
 本当にアイテムを渡したいですか?
 		<usetemplate name="okcancelbuttons" notext="いいえ" yestext="はい"/>
 	</notification>
@@ -796,7 +796,7 @@ L$ が不足しているのでこのグループに参加することができ
 		テレポート目的地を見つけられません。目的地が一時的に利用できない状態か、すでに消滅している可能性があります。数分後にやり直してください。
 	</notification>
 	<notification name="no_inventory_host">
-		持ち物システムは現在利用できません。
+		インベントリシステムは現在利用できません。
 	</notification>
 	<notification name="CannotSetLandOwnerNothingSelected">
 		土地所有者設定ができません:
@@ -959,7 +959,7 @@ L$ は返金されません。
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmItemCopy">
-		このアイテムをあなたの持ち物にコピーしますか?
+		このアイテムをあなたのインベントリにコピーしますか?
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="コピー"/>
 	</notification>
 	<notification name="ResolutionSwitchFail">
@@ -1011,7 +1011,7 @@ L$ は返金されません。
 		</form>
 	</notification>
 	<notification label="着用物を保存" name="SaveWearableAs">
-		アイテムを別名で持ち物に保存:
+		アイテムを別名でインベントリに保存:
 		<form name="form">
 			<input name="message">
 				[DESC](新規)
@@ -1896,7 +1896,7 @@ Adult 専用リージョンに入るには、住人のアカウントが年齢
 	</notification>
 	<notification name="BuyCopy">
 		コピーを [OWNER] から L$ [PRICE] で購入しますか?
-購入したオブジェクトは、あなたの「持ち物」にコピーされます。
+購入したオブジェクトは、あなたのインベントリにコピーされます。
 可能な操作は、
 修正:[MODIFYPERM]、コピー:[COPYPERM]、
 再販・プレゼント:[RESELLPERM] です。
@@ -1904,7 +1904,7 @@ Adult 専用リージョンに入るには、住人のアカウントが年齢
 	</notification>
 	<notification name="BuyCopyNoOwner">
 		L$ [PRICE] でコピーを購入しますか?
-購入したオブジェクトは、あなたの「持ち物」にコピーされます。
+購入したオブジェクトは、あなたのインベントリにコピーされます。
 可能な操作は、
 修正:[MODIFYPERM]、コピー:[COPYPERM]、
 再販・プレゼント:[RESELLPERM] です。
@@ -1912,12 +1912,12 @@ Adult 専用リージョンに入るには、住人のアカウントが年齢
 	</notification>
 	<notification name="BuyContents">
 		中身を [OWNER] から L$ [PRICE] で購入しますか?
-購入した中身は、あなたの「持ち物」にコピーされます。
+購入した中身は、あなたのインベントリにコピーされます。
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="BuyContentsNoOwner">
 		L$ [PRICE] で中身を購入しますか?
-購入した中身は、あなたの「持ち物」にコピーされます。
+購入した中身は、あなたのインベントリにコピーされます。
 		<usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmPurchase">
@@ -1946,20 +1946,20 @@ Adult 専用リージョンに入るには、住人のアカウントが年齢
 		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="MoveInventoryFromObject">
-		「コピー不可」の持ち物アイテムを選択しました。
-これらのアイテムはコピーされないまま、あなたの「持ち物」に移動されます。
+		「コピー不可」のインベントリアイテムを選択しました。
+これらのアイテムはコピーされないまま、あなたのインベントリに移動されます。
 
 
 アイテムを動かしますか?
 		<usetemplate ignoretext="「コピー不可」のアイテムをオブジェクトから動かす前の警告" name="okcancelignore" notext="キャンセル" yestext="OK"/>
 	</notification>
 	<notification name="MoveInventoryFromScriptedObject">
-		「コピー不可」の持ち物アイテムを選択しました。
-これらのアイテムはコピーされずに、あなたの「持ち物」に移動されます。
-このオブジェクトはスクリプト付きなので、「持ち物」に移動させると
+		「コピー不可」のインベントリアイテムを選択しました。
+これらのアイテムはコピーされずに、あなたのインベントリに移動されます。
+このオブジェクトはスクリプト付きなので、インベントリに移動させると
 スクリプトに誤動作が起きる可能性があります。
 
-持ち物アイテムを移動しますか?
+インベントリアイテムを移動しますか?
 		<usetemplate ignoretext="スクリプト入りのオブジェクトを壊す恐れのある「コピー不可」のアイテムを動かす前の警告" name="okcancelignore" notext="キャンセル" yestext="OK"/>
 	</notification>
 	<notification name="ClickActionNotPayable">
@@ -2068,7 +2068,7 @@ Linden Lab
 	</notification>
 	<notification name="ConfirmEmptyTrash">
 		ごみ箱の中身をすべて削除しますか?
-		<usetemplate ignoretext="持ち物のごみ箱フォルダを空にする前の確認" name="okcancelignore" notext="キャンセル" yestext="OK"/>
+		<usetemplate ignoretext="インベントリのごみ箱フォルダを空にする前の確認" name="okcancelignore" notext="キャンセル" yestext="OK"/>
 	</notification>
 	<notification name="ConfirmClearBrowserCache">
 		トラベル、Web、検索の履歴をすべて削除しますか?
@@ -2252,7 +2252,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		親エステート間では IM を送信できません。
 	</notification>
 	<notification name="TransferInventoryAcrossParentEstates">
-		親エステート間で持ち物を移動することはできません。
+		親エステート間でインベントリを移動することはできません。
 	</notification>
 	<notification name="UnableToLoadNotecard">
 		ノートカードを読み込めません。あとで再度お試しください。
@@ -2304,7 +2304,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		[NAME] は、あなたが渡したアイテムを受け取りました。
 	</notification>
 	<notification name="InventoryDeclined">
-		[NAME] は、持ち物の提供を断りました。
+		[NAME] は、インベントリの提供を断りました。
 	</notification>
 	<notification name="ObjectMessage">
 		[NAME]: [MESSAGE]
@@ -2389,16 +2389,16 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		</form>
 	</notification>
 	<notification name="OwnedObjectsReturned">
-		選択した土地の区画上にあったあなたのオブジェクトは、すべてあなたの「持ち物」に返却されました。
+		選択した土地の区画上にあったあなたのオブジェクトは、すべてあなたのインベントリに返却されました。
 	</notification>
 	<notification name="OtherObjectsReturned">
-		[NAME] が所有する、選択した区画にあるオブジェクトは、所有者の持ち物に返却されました。
+		[NAME] が所有する、選択した区画にあるオブジェクトは、所有者のインベントリに返却されました。
 	</notification>
 	<notification name="OtherObjectsReturned2">
 		「 [NAME] 」という名前の住人が所有する、選択した区画上のオブジェクトは、本人に返却されました。
 	</notification>
 	<notification name="GroupObjectsReturned">
-		選択した区画上の、[GROUPNAME] というグループと共有していたオブジェクトは、それぞれの所有者の「持ち物」に返却されました。
+		選択した区画上の、[GROUPNAME] というグループと共有していたオブジェクトは、それぞれの所有者のインベントリに返却されました。
 譲渡されていた「再販・プレゼント可」のオブジェクトは、以前の所有者に返却されました。
 グループに譲渡されていた「再販・プレゼント不可」のオブジェクトは、削除されました。
 	</notification>
@@ -2617,7 +2617,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 	</notification>
 	<notification name="OfferCallingCard">
 		[NAME] がコーリングカードを渡そうとしています。
-あなたの持ち物にブックマークが追加され、この住人に素早く IM を送ることができます。
+あなたのインベントリにブックマークが追加され、この住人に素早く IM を送ることができます。
 		<form name="form">
 			<button name="Accept" text="受け入れる"/>
 			<button name="Decline" text="辞退"/>
@@ -2707,7 +2707,7 @@ M キーを押して変更します。
 	<notification name="FirstSandbox">
 		ここはサンドボックスエリアです。住人が制作を学ぶことができます。
 
-ここで制作されたものは時間が経つと削除されます。制作したアイテムを右クリックして「取る」を選び、持ち物に入れてお持ち帰りするのをお忘れなく。
+ここで制作されたものは時間が経つと削除されます。制作したアイテムを右クリックして「取る」を選び、インベントリに入れてお持ち帰りするのをお忘れなく。
 	</notification>
 	<notification name="MaxListSelectMessage">
 		このリストから [MAX_SELECT] 個までのアイテムを選択できます。
@@ -2728,7 +2728,7 @@ M キーを押して変更します。
 		[NAME] はお金を受け取り、自動的にブロックが解除されました。
 	</notification>
 	<notification name="AutoUnmuteByInventory">
-		[NAME] は持ち物を受け取り、自動的にブロックが解除されました。
+		[NAME] はインベントリを受け取り、自動的にブロックが解除されました。
 	</notification>
 	<notification name="VoiceInviteGroup">
 		[NAME] は [GROUP] のボイスチャットコールに参加しました。
@@ -3021,7 +3021,7 @@ M キーを押して変更します。
 		カメラの視点を変更するには、水平・垂直コントロールを使います。Escape を押すか、または歩行すると、視点がリセットされます。
 	</notification>
 	<notification label="インベントリ" name="HintInventory">
-		持ち物にはあなたのアイテムがすべて含まれます。新しく追加されたアイテムは「最新」タブに一覧表示されています。
+		インベントリにはあなたのアイテムがすべて含まれます。新しく追加されたアイテムは「最新」タブに一覧表示されています。
 	</notification>
 	<notification label="あなたのリンデンドル" name="HintLindenDollar">
 		これがあなたの L$ 残高です。リンデンドルを購入するには「L$ の購入」をクリックします。
@@ -3129,7 +3129,7 @@ M キーを押して変更します。
 		<usetemplate name="okcancelbuttons" notext="終了しない" yestext="終了"/>
 	</notification>
 	<notification label="" name="NoInventory">
-		持ち物の表示はアドバンスモードでのみ利用できます。ログアウトしてモードを変更しますか?
+		インベントリの表示はアドバンスモードでのみ利用できます。ログアウトしてモードを変更しますか?
 		<usetemplate name="okcancelbuttons" notext="終了しない" yestext="終了"/>
 	</notification>
 	<notification label="" name="NoAppearance">
diff --git a/indra/newview/skins/default/xui/ja/panel_group_control_panel.xml b/indra/newview/skins/default/xui/ja/panel_group_control_panel.xml
index f7f575206ab..49749732c96 100644
--- a/indra/newview/skins/default/xui/ja/panel_group_control_panel.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_control_panel.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="panel_im_control_panel">
 	<layout_stack name="vertical_stack">
 		<layout_panel name="group_info_btn_panel">
-			<button label="グループ情報" name="group_info_btn"/>
+			<button label="グループプロフィール" name="group_info_btn"/>
 		</layout_panel>
 		<layout_panel name="call_btn_panel">
 			<button label="グループコール" name="call_btn"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml
index 85406702bcc..7aa1aec6d0e 100644
--- a/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="グループ情報" name="GroupInfo">
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="グループインベントリ" name="GroupInfo">
 	<panel.string name="default_needs_apply_text">
 		保存していない変更があります
 	</panel.string>
diff --git a/indra/newview/skins/default/xui/ja/panel_group_notices.xml b/indra/newview/skins/default/xui/ja/panel_group_notices.xml
index 96e03829755..ddad6c1f9b0 100644
--- a/indra/newview/skins/default/xui/ja/panel_group_notices.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_notices.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="通知" name="notices_tab">
 	<panel.string name="help_text">
 		通知でメッセージを送ることができ、通知にアイテムを添付することができます。
@@ -39,10 +39,10 @@
 		<text name="string">
 			ここにアイテムをドラッグ&ドロップして添付してください:
 		</text>
-		<button label="持ち物" name="open_inventory" tool_tip="持ち物を開きます"/>
+		<button label="インベントリ" name="open_inventory" tool_tip="インベントリを開きます"/>
 		<button label="取り外す" label_selected="添付物を削除" name="remove_attachment" tool_tip="あなたの通知から添付されたアイテムを削除します"/>
 		<button label="送信" label_selected="送信" name="send_notice"/>
-		<group_drop_target name="drop_target" tool_tip="持ち物のアイテムをこのボックスにドラッグして、通知と一緒に送ります。 添付するには、そのアイテムのコピーと再販・プレゼントの権限があなたにある必要があります。"/>
+		<group_drop_target name="drop_target" tool_tip="インベントリのアイテムをこのボックスにドラッグして、通知と一緒に送ります。 添付するには、そのアイテムのコピーと再販・プレゼントの権限があなたにある必要があります。"/>
 	</panel>
 	<panel label="過去の通知を表示" name="panel_view_past_notice">
 		<text name="lbl">
diff --git a/indra/newview/skins/default/xui/ja/panel_landmarks.xml b/indra/newview/skins/default/xui/ja/panel_landmarks.xml
index e3b716c35bf..24d6ff23aed 100644
--- a/indra/newview/skins/default/xui/ja/panel_landmarks.xml
+++ b/indra/newview/skins/default/xui/ja/panel_landmarks.xml
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="Landmarks">
 	<accordion name="landmarks_accordion">
 		<accordion_tab name="tab_favorites" title="お気に入りバー"/>
 		<accordion_tab name="tab_landmarks" title="マイ ランドマーク"/>
-		<accordion_tab name="tab_inventory" title="持ち物"/>
+		<accordion_tab name="tab_inventory" title="インベントリ"/>
 		<accordion_tab name="tab_library" title="ライブラリ"/>
 	</accordion>
 	<panel name="bottom_panel">
diff --git a/indra/newview/skins/default/xui/ja/panel_main_inventory.xml b/indra/newview/skins/default/xui/ja/panel_main_inventory.xml
index ff968696b7b..f908262f4f0 100644
--- a/indra/newview/skins/default/xui/ja/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/panel_main_inventory.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="もの" name="main inventory panel">
 	<panel.string name="ItemcountFetching">
 		[ITEM_COUNT] 個のアイテムを取得中です... [FILTER]
@@ -9,9 +9,9 @@
 	<text name="ItemcountText">
 		アイテム:
 	</text>
-	<filter_editor label="持ち物をフィルター" name="inventory search editor"/>
+	<filter_editor label="インベントリをフィルター" name="inventory search editor"/>
 	<tab_container name="inventory filter tabs">
-		<inventory_panel label="持ち物" name="All Items"/>
+		<inventory_panel label="インベントリ" name="All Items"/>
 		<recent_inventory_panel label="最新" name="Recent Items"/>
 	</tab_container>
 	<layout_stack name="bottom_panel">
diff --git a/indra/newview/skins/default/xui/ja/panel_me.xml b/indra/newview/skins/default/xui/ja/panel_me.xml
index 896bbff0ee3..3df1ae80487 100644
--- a/indra/newview/skins/default/xui/ja/panel_me.xml
+++ b/indra/newview/skins/default/xui/ja/panel_me.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="マイ プロフィール" name="panel_me">
-	<panel label="マイ ピック" name="panel_picks"/>
+	<panel label="マイ-ピック" name="panel_picks"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml
index 47f570ab86a..1a142831134 100644
--- a/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<outbox_inventory_panel name="inventory_outbox" tool_tip="商品をここにドラッグアンドドロップすると、あなたの店頭に並びます"/>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="アイテムをここにドラッグアンドドロップすると、あなたの店頭に並びます"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_outfit_edit.xml b/indra/newview/skins/default/xui/ja/panel_outfit_edit.xml
index 68976602147..e89ce0c4793 100644
--- a/indra/newview/skins/default/xui/ja/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/ja/panel_outfit_edit.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <!-- Side tray Outfit Edit panel -->
 <panel label="アウトフットの編集" name="outfit_edit">
 	<string name="No Outfit" value="アウトフィットなし"/>
@@ -30,7 +30,7 @@
 					<button label="さらに追加..." name="show_add_wearables_btn" tool_tip="開く/閉じる"/>
 				</layout_panel>
 				<layout_panel name="filter_panel">
-					<filter_editor label="持ち物の着用物をフィルター" name="look_item_filter"/>
+					<filter_editor label="インベントリの着用物をフィルター" name="look_item_filter"/>
 				</layout_panel>
 			</layout_stack>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/ja/panel_outfits_inventory.xml
index 2a0647653de..93df0ba2bd4 100644
--- a/indra/newview/skins/default/xui/ja/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/panel_outfits_inventory.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="もの" name="Outfits">
 	<panel.string name="wear_outfit_tooltip">
 		選択したアウトフィットを着用する
 	</panel.string>
 	<panel.string name="wear_items_tooltip">
-		選択した商品を着用
+		選択したアイテムを着用
 	</panel.string>
 	<tab_container name="appearance_tabs">
 		<panel label="マイ アウトフィット" name="outfitslist_tab"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_people.xml b/indra/newview/skins/default/xui/ja/panel_people.xml
index 1c90f7327ee..88c31451b51 100644
--- a/indra/newview/skins/default/xui/ja/panel_people.xml
+++ b/indra/newview/skins/default/xui/ja/panel_people.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <!-- Side tray panel -->
 <panel label="人" name="people_panel">
 	<string name="no_recent_people" value="最近交流した人はいません。 一緒に何かする仲間をお探しですか? [secondlife:///app/search/people 検索] か [secondlife:///app/worldmap 世界地図] をお試しください。"/>
@@ -73,7 +73,7 @@
 				<button label="コール" name="call_btn" tool_tip="この住人にコールする"/>
 			</layout_panel>
 			<layout_panel name="share_btn_lp">
-				<button label="共有" name="share_btn" tool_tip="「持ち物」のアイテムを共有する"/>
+				<button label="共有" name="share_btn" tool_tip="インベントリのアイテムを共有する"/>
 			</layout_panel>
 			<layout_panel name="teleport_btn_lp">
 				<button label="テレポート" name="teleport_btn" tool_tip="テレポートを送ります"/>
@@ -81,7 +81,7 @@
 		</layout_stack>
 		<layout_stack name="bottom_bar_ls1">
 			<layout_panel name="group_info_btn_lp">
-				<button label="グループ情報" name="group_info_btn" tool_tip="グループ情報を表示します"/>
+				<button label="グループプロフィール" name="group_info_btn" tool_tip="グループプロフィールを表示します"/>
 			</layout_panel>
 			<layout_panel name="chat_btn_lp">
 				<button label="グループチャット" name="chat_btn" tool_tip="チャットを開始します"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
index 46f2b0a3f99..e496e6602b1 100644
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="panel_snapshot_inventory">
 	<text name="title">
-		「持ち物」に保存
+		インベントリに保存
 	</text>
 	<text name="hint_lbl">
-		画像を持ち物に保存するには L$[UPLOAD_COST] の費用がかかります。画像をテクスチャとして保存するには平方形式の 1 つを選択してください。
+		画像をインベントリに保存するには L$[UPLOAD_COST] の費用がかかります。画像をテクスチャとして保存するには平方形式の 1 つを選択してください。
 	</text>
 	<combo_box label="解像度" name="texture_size_combo">
 		<combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
index cd5b7590ad8..c3b1cd91e73 100644
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="panel_snapshot_options">
 	<button label="プロフィールフィードに投稿する" name="save_to_profile_btn"/>
 	<button label="メール" name="save_to_email_btn"/>
-	<button label="持ち物に保存(L$[Amount])" name="save_to_inventory_btn"/>
+	<button label="インベントリに保存(L$[Amount])" name="save_to_inventory_btn"/>
 	<button label="コンピューターに保存" name="save_to_computer_btn"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/role_actions.xml b/indra/newview/skins/default/xui/ja/role_actions.xml
index c53ad838f74..896ed556ae4 100644
--- a/indra/newview/skins/default/xui/ja/role_actions.xml
+++ b/indra/newview/skins/default/xui/ja/role_actions.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <role_actions>
 	<action_set description="これらの能力には、グループメンバーを追加、排除し、招待状なしに新メンバーの参加を認める権限が含まれます。" name="Membership">
 		<action description="このグループに人を招待" longdescription="「役割」セクションの「メンバー」タブ内にある「招待」ボタンを押して、このグループにメンバーを招待します。" name="member invite" value="1"/>
@@ -51,7 +51,7 @@
 		<action description="グループ所有オブジェクトの返却" longdescription="グループ所有の区画上のオブジェクトのうち、グループ所有のオブジェクトを返却するには、「土地情報」>「オブジェクト」タブを使います。" name="land return group owned" value="48"/>
 		<action description="グループに設定されているオブジェクトを返却" longdescription="グループ所有の区画上のオブジェクトのうち、グループに設定されているオブジェクトを返却するには、「土地情報」>「オブジェクト」タブを使います。" name="land return group set" value="33"/>
 		<action description="非グループオブジェクトの返却" longdescription="グループ所有の区画上のオブジェクトのうち、グループ以外のオブジェクトを返却するには、「土地情報」>「オブジェクト」タブを使います。" name="land return non group" value="34"/>
-		<action description="リンデン製の植物を使用して景観作成" longdescription="リンデン製の樹木、植物、草を植える、景観づくりの能力です。 これらの植物はあなたの持ち物内の「ライブラリ」 &gt; 「オブジェクト」フォルダにあります。「制作」メニューで作成することもできます。" name="land gardening" value="35"/>
+		<action description="リンデン製の植物を使用して景観作成" longdescription="リンデン製の樹木、植物、草を植える、景観づくりの能力です。 これらの植物はあなたのインベントリ内の「ライブラリ」 &gt; 「オブジェクト」フォルダにあります。「制作」メニューで作成することもできます。" name="land gardening" value="35"/>
 	</action_set>
 	<action_set description="これらの「能力」には、グループ所有のオブジェクトを譲渡、修正、販売する権限が含まれます。 変更は「制作ツール」 &gt; 「一般」タブで行います。 オブジェクトを右クリックして「編集」を開くと設定内容を確認できます。" name="Object Management">
 		<action description="グループにオブジェクトを譲渡" longdescription="「制作ツール」 &gt; 「一般」タブで、オブジェクトをグループに譲渡します。" name="object deed" value="36"/>
diff --git a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
index a450d9b3c35..fad4f20ed9b 100644
--- a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="もの" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
@@ -28,7 +28,7 @@
 					<button label="プロフィール" name="info_btn" tool_tip="オブジェクトのプロフィールを表示する"/>
 				</layout_panel>
 				<layout_panel name="share_btn_lp">
-					<button label="共有" name="share_btn" tool_tip="「持ち物」のアイテムを共有する"/>
+					<button label="共有" name="share_btn" tool_tip="インベントリのアイテムを共有する"/>
 				</layout_panel>
 				<layout_panel name="shop_btn_lp">
 					<button label="店" name="shop_btn" tool_tip="マーケットプレイスのサイトを開く"/>
diff --git a/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml b/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml
index d820994b590..6931e448b31 100644
--- a/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml
+++ b/indra/newview/skins/default/xui/ja/sidepanel_item_info.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="item properties" title="アイテムのプロフィール">
 	<panel.string name="unknown">
 		(不明)
@@ -16,13 +16,13 @@
 		[year,datetime,local] [mth,datetime,local] [day,datetime,local] [wkday,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local]
 	</panel.string>
 	<panel.string name="origin_inventory">
-		(持ち物)
+		(インベントリ)
 	</panel.string>
 	<panel.string name="origin_inworld">
 		(インワールド)
 	</panel.string>
 	<text name="title" value="アイテムのプロフィール"/>
-	<text name="origin" value="(持ち物)"/>
+	<text name="origin" value="(インベントリ)"/>
 	<scroll_container name="item_profile_scroll">
 		<panel label="" name="item_profile">
 			<text name="LabelItemNameTitle">
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index a1279510c77..633a7062da7 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <!-- This file contains strings that used to be hardcoded in the source.
      It is only for those strings which do not belong in a floater.
      For example, the strings used in avatar chat bubbles, and strings
@@ -346,7 +346,7 @@ support@secondlife.com にお問い合わせください。
 		これらオブジェクトの 1 つまたは複数は売り渡したり譲渡したりできないものです。
 	</string>
 	<string name="TooltipOutboxNotInInventory">
-		マーチャントアウトボックスでは、ご自分の持ち物からのアイテムしか受け入れることができません
+		マーチャントアウトボックスでは、ご自分のインベントリからのアイテムしか受け入れることができません
 	</string>
 	<string name="TooltipOutboxWorn">
 		着用しているアイテムをマーチャントアウトボックスに入れることはできません
@@ -1232,10 +1232,10 @@ support@secondlife.com にお問い合わせください。
 		ここにランドマークをドラッグしてお気に入りに追加します。
 	</string>
 	<string name="InventoryNoTexture">
-		「持ち物」内にこのテクスチャのコピーがありません
+		インベントリ内にこのテクスチャのコピーがありません
 	</string>
 	<string name="InventoryInboxNoItems">
-		プレミアムギフトなど、受け取る特定のアイテムはここに表示されます。その後、それらのアイテムを自分の持ち物の中にドラッグできます。
+		プレミアムギフトなど、受け取る特定のアイテムはここに表示されます。その後、それらのアイテムを自分のインベントリの中にドラッグできます。
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -1270,25 +1270,25 @@ support@secondlife.com にお問い合わせください。
 		エラーなし
 	</string>
 	<string name="Marketplace Error Not Merchant">
-		エラー:マーケットプレイスに商品を送る前に、あなた自身をマーチャント登録する必要があります(登録は無料です)。
+		エラー:マーケットプレイスにアイテムを送る前に、あなた自身をマーチャント登録する必要があります(登録は無料です)。
 	</string>
 	<string name="Marketplace Error Empty Folder">
 		エラー:このフォルダは空です。
 	</string>
 	<string name="Marketplace Error Unassociated Products">
-		エラー:あなたのマーチャントアカウントには、商品と無関係のアイテムが多すぎるため、このアイテムをアップロードできませんでした。このエラーを解消するには、マーケットプレイスのウェブサイトにログインし、商品に関係のないアイテムの数を減らしてください。
+		エラー:あなたのマーチャントアカウントには、商品に関連付けられていないアイテムが多すぎるため、このアイテムをアップロードできませんでした。このエラーを解消するには、マーケットプレイスの Web サイトにログインし、関連付けられていないアイテムの数を減らしてください。
 	</string>
 	<string name="Marketplace Error Object Limit">
-		エラー:この商品に含まれるオブジェクトが多すぎます。オブジェクトをいくつかボックスにまとめ、オブジェクト数を200以下に減らしてください。
+		エラー:このアイテムに含まれるオブジェクトが多すぎます。オブジェクトをいくつかボックスにまとめ、オブジェクト数を200以下に減らしてください。
 	</string>
 	<string name="Marketplace Error Folder Depth">
-		エラー:この商品はネスト入りフォルダの階層が多すぎます。ネスト入りフォルダを 3 階層以内にまとめ直してください。
+		エラー:このアイテムはネスト入りフォルダの階層が多すぎます。ネスト入りフォルダを 3 階層以内にまとめ直してください。
 	</string>
 	<string name="Marketplace Error Unsellable Item">
-		エラー:この項目をマーケットプレイスで販売することはできません。
+		エラー:このアイテムをマーケットプレイスで販売することはできません。
 	</string>
 	<string name="Marketplace Error Internal Import">
-		エラー:この商品に関して問題が発生しました。しばらくしてからお試しください。
+		エラー:このアイテムに関して問題が発生しました。しばらくしてからお試しください。
 	</string>
 	<string name="Open landmarks">
 		ランドマークを開く
@@ -1337,7 +1337,7 @@ support@secondlife.com にお問い合わせください。
 	<string name="No Filters" value="いいえ "/>
 	<string name="Since Logoff" value=" - ログオフ以来"/>
 	<string name="InvFolder My Inventory">
-		持ち物
+		インベントリ
 	</string>
 	<string name="InvFolder Library">
 		ライブラリ
@@ -1370,7 +1370,7 @@ support@secondlife.com にお問い合わせください。
 		新規フォルダ
 	</string>
 	<string name="InvFolder Inventory">
-		持ち物
+		インベントリ
 	</string>
 	<string name="InvFolder Uncompressed Images">
 		圧縮されていない画像
@@ -3952,10 +3952,10 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 		[AGENT_NAME] とコンファレンスする
 	</string>
 	<string name="inventory_item_offered-im">
-		持ち物アイテムを送りました
+		インベントリアイテムを送りました
 	</string>
 	<string name="share_alert">
-		持ち物からここにアイテムをドラッグします
+		インベントリからここにアイテムをドラッグします
 	</string>
 	<string name="no_session_message">
 		(IM セッションが存在しません)
@@ -4839,7 +4839,7 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 		ハウツー
 	</string>
 	<string name="Command_Inventory_Label">
-		持ち物
+		インベントリ
 	</string>
 	<string name="Command_Map_Label">
 		地図
@@ -4914,7 +4914,7 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 		一般的タスクの実行方法
 	</string>
 	<string name="Command_Inventory_Tooltip">
-		持ち物を表示・使用
+		インベントリを表示・使用
 	</string>
 	<string name="Command_Map_Tooltip">
 		世界地図
diff --git a/indra/newview/skins/default/xui/ja/teleport_strings.xml b/indra/newview/skins/default/xui/ja/teleport_strings.xml
index 6c69c7a2313..64f01f4030c 100644
--- a/indra/newview/skins/default/xui/ja/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/ja/teleport_strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <teleport_messages>
 	<message_set name="errors">
 		<message name="invalid_tport">
@@ -45,7 +45,7 @@
 			テレポートの目的地を見つけられません。目的地が一時的に利用できない状態か、またはすでに消滅している可能性があります。数分後にやり直してください。
 		</message>
 		<message name="no_inventory_host">
-			持ち物システムは現在利用できません。
+			インベントリシステムは現在利用できません。
 		</message>
 	</message_set>
 	<message_set name="progress">
-- 
GitLab


From 8d4c6771fdbea274eabc7a2e2606b3b77952cb4a Mon Sep 17 00:00:00 2001
From: Vaalith <none@none>
Date: Tue, 10 Apr 2012 09:28:47 -0400
Subject: [PATCH 911/933] storm-64: One more toast on failure to verify initial
 image, and changed a bool to enum

---
 indra/newview/lllocalbitmaps.cpp              | 21 ++++++++++++-------
 indra/newview/lllocalbitmaps.h                | 16 +++++++++-----
 .../skins/default/xui/en/notifications.xml    |  9 ++++++++
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 10c3b20f63d..459e52c4f4e 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -116,15 +116,15 @@ LLLocalBitmap::LLLocalBitmap(std::string filename)
 	}
 
 	/* next phase of unit creation is nearly the same as an update cycle.
-	   true means the unit's update is running for the first time so it will not check 
-	   for current usage nor will it attempt to replace the old, non existent image */
-	mValid = updateSelf(true);
+	   we're running updateSelf as a special case with the optional UT_FIRSTUSE
+	   which omits the parts associated with removing the outdated texture */
+	mValid = updateSelf(UT_FIRSTUSE);
 }
 
 LLLocalBitmap::~LLLocalBitmap()
 {
 	// replace IDs with defaults, if set to do so.
-	if(LL_LOCAL_REPLACE_ON_DEL)
+	if(LL_LOCAL_REPLACE_ON_DEL && mValid) // fix for STORM-1837
 	{
 		replaceIDs(mWorldID, IMG_DEFAULT);
 		LLLocalBitmapMgr::doRebake();
@@ -167,7 +167,7 @@ bool LLLocalBitmap::getValid()
 }
 
 /* update functions */
-bool LLLocalBitmap::updateSelf(bool first_update)
+bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
 {
 	bool updated = false;
 	
@@ -189,7 +189,7 @@ bool LLLocalBitmap::updateSelf(bool first_update)
 				{
 					// decode is successful, we can safely proceed.
 					LLUUID old_id = LLUUID::null;
-					if (!first_update && !mWorldID.isNull())
+					if (!(optional_firstupdate == UT_FIRSTUSE) && !mWorldID.isNull())
 					{
 						old_id = mWorldID;
 					}
@@ -205,7 +205,7 @@ bool LLLocalBitmap::updateSelf(bool first_update)
 
 					gTextureList.addImage(texture);
 			
-					if (!first_update)
+					if (!optional_firstupdate == UT_FIRSTUSE)
 					{
 						// seek out everything old_id uses and replace it with mWorldID
 						replaceIDs(old_id, mWorldID);
@@ -807,6 +807,13 @@ bool LLLocalBitmapMgr::addUnit()
 			}
 			else
 			{
+				llwarns << "Attempted to add invalid or unreadable image file, attempt cancelled.\n"
+					    << "Filename: " << filename << llendl;
+
+				LLSD notif_args;
+				notif_args["FNAME"] = filename;
+				LLNotificationsUtil::add("LocalBitmapsVerifyFail", notif_args);
+
 				delete unit;
 				unit = NULL;
 			}
diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h
index c6d05c17631..7a23c7ef6e3 100644
--- a/indra/newview/lllocalbitmaps.h
+++ b/indra/newview/lllocalbitmaps.h
@@ -39,7 +39,6 @@ class LLLocalBitmap
 	public: /* main */
 		LLLocalBitmap(std::string filename);
 		~LLLocalBitmap();
-		bool updateSelf(bool first_update = false);
 
 	public: /* accessors */
 		std::string	getFilename();
@@ -48,18 +47,25 @@ class LLLocalBitmap
 		LLUUID		getWorldID();
 		bool		getValid();
 
-	private: /* maintenance */
+	public: /* self update public section */
+		enum EUpdateType
+		{
+			UT_FIRSTUSE,
+			UT_REGUPDATE
+		};
+
+		bool updateSelf(EUpdateType = UT_REGUPDATE);
+
+	private: /* self update private section */
 		bool decodeBitmap(LLPointer<LLImageRaw> raw);
 		void replaceIDs(LLUUID old_id, LLUUID new_id);
-
-	private: /* id replacement */
 		std::vector<LLViewerObject*> prepUpdateObjects(LLUUID old_id);
 		void updateUserPrims(LLUUID old_id, LLUUID new_id);
 		void updateUserSculpts(LLUUID old_id, LLUUID new_id);
 		void updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableType::EType type);
 		LLVOAvatarDefines::ETextureIndex getTexIndex(LLWearableType::EType type, LLVOAvatarDefines::EBakedTextureIndex baked_texind);
 
-	private: /* enums */
+	private: /* private enums */
 		enum ELinkStatus
 		{
 			LS_ON,
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e9175e23906..9cad5b85861 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7713,5 +7713,14 @@ Disabling future updates for this file.
 [FNAME] could not be opened or decoded for [NRETRIES] attempts, and is now considered broken.
 Disabling future updates for this file.
   </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LocalBitmapsVerifyFail"
+   persist="true"
+   type="notify">
+Attempted to add an invalid or unreadable image file [FNAME] which could not be opened or decoded.
+Attempt cancelled.
+  </notification>
   
 </notifications>
-- 
GitLab


From 7ef7bbef65d8622668bc8a007766f25a70386d27 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 12 Apr 2012 23:09:32 +0300
Subject: [PATCH 912/933] MAINT-891 FIXED Disabled focus return from modal
 dialog after viewer logoff. Fixed boost trackable objects usage.

---
 indra/newview/llchiclet.cpp         | 14 +++++++-------
 indra/newview/llchiclet.h           |  4 ++++
 indra/newview/llimview.h            |  5 ++---
 indra/newview/lltoastalertpanel.cpp |  4 ++--
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index aabab0ccb99..a661808d1ff 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -1113,8 +1113,8 @@ LLChicletPanel::~LLChicletPanel()
 	}
 }
 
-void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
-	
+void LLChicletPanel::onMessageCountChanged(const LLSD& data)
+{
 	LLUUID session_id = data["session_id"].asUUID();
 	S32 unread = data["participant_unread"].asInteger();
 
@@ -1139,7 +1139,7 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
 	}
 }
 
-void object_chiclet_callback(const LLSD& data)
+void LLChicletPanel::objectChicletCallback(const LLSD& data)
 {
 	LLUUID notification_id = data["notification_id"];
 	bool new_message = data["new_message"];
@@ -1163,10 +1163,10 @@ void object_chiclet_callback(const LLSD& data)
 BOOL LLChicletPanel::postBuild()
 {
 	LLPanel::postBuild();
-	LLIMModel::instance().addNewMsgCallback(boost::bind(im_chiclet_callback, this, _1));
-	LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(im_chiclet_callback, this, _1));
-	LLScriptFloaterManager::getInstance()->addNewObjectCallback(boost::bind(object_chiclet_callback, _1));
-	LLScriptFloaterManager::getInstance()->addToggleObjectFloaterCallback(boost::bind(object_chiclet_callback, _1));
+	LLIMModel::instance().addNewMsgCallback(boost::bind(&LLChicletPanel::onMessageCountChanged, this, _1));
+	LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLChicletPanel::onMessageCountChanged, this, _1));
+	LLScriptFloaterManager::getInstance()->addNewObjectCallback(boost::bind(&LLChicletPanel::objectChicletCallback, this, _1));
+	LLScriptFloaterManager::getInstance()->addToggleObjectFloaterCallback(boost::bind(&LLChicletPanel::objectChicletCallback, this, _1));
 	LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet<LLChiclet>, this, _1));
 	LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1));
 
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 1f1069dcb49..19683492c23 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -1158,6 +1158,10 @@ class LLChicletPanel : public LLPanel
 	 */
 	void onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param);
 
+	void onMessageCountChanged(const LLSD& data);
+
+	void objectChicletCallback(const LLSD& data);
+
 	typedef std::vector<LLChiclet*> chiclet_list_t;
 
 	/**
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index f07a78e2f77..7c2cd03d970 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -153,7 +153,6 @@ class LLIMModel :  public LLSingleton<LLIMModel>
 	std::map<LLUUID, LLIMSession*> mId2SessionMap;
 
 	typedef boost::signals2::signal<void(const LLSD&)> session_signal_t;
-	typedef boost::function<void(const LLSD&)> session_callback_t;
 	session_signal_t mNewMsgSignal;
 	session_signal_t mNoUnreadMsgsSignal;
 	
@@ -174,8 +173,8 @@ class LLIMModel :  public LLSingleton<LLIMModel>
 	 */
 	void processSessionInitializedReply(const LLUUID& old_session_id, const LLUUID& new_session_id);
 
-	boost::signals2::connection addNewMsgCallback( session_callback_t cb ) { return mNewMsgSignal.connect(cb); }
-	boost::signals2::connection addNoUnreadMsgsCallback( session_callback_t cb ) { return mNoUnreadMsgsSignal.connect(cb); }
+	boost::signals2::connection addNewMsgCallback(const session_signal_t::slot_type& cb ) { return mNewMsgSignal.connect(cb); }
+	boost::signals2::connection addNoUnreadMsgsCallback(const session_signal_t::slot_type& cb ) { return mNoUnreadMsgsSignal.connect(cb); }
 
 	/**
 	 * Create new session object in a model
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index 9ba8431fdea..8fef2ed6d12 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -424,8 +424,8 @@ LLToastAlertPanel::~LLToastAlertPanel()
 			LLTransientFloaterMgr::GLOBAL, this);
 
 	// EXP-1822
-	// return focus to the previously focused view
-	if (mPreviouslyFocusedView.get())
+	// return focus to the previously focused view if the viewer is not exiting
+	if (mPreviouslyFocusedView.get() && !LLApp::isExiting())
 	{
 		mPreviouslyFocusedView.get()->setFocus(TRUE);
 	}
-- 
GitLab


From dd012cc375680c1907e16baa675d29d40ad4f43c Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 12 Apr 2012 23:09:47 +0300
Subject: [PATCH 913/933] CHUI-87 FIXED crash in handling notifications after
 viewer disconnect. Notification handlers now use LLHandles to screen
 channels.

---
 indra/newview/llimhandler.cpp                 | 12 +++++------
 indra/newview/llnearbychathandler.cpp         | 11 ++++++----
 indra/newview/llnotificationalerthandler.cpp  | 18 ++++++++---------
 indra/newview/llnotificationgrouphandler.cpp  | 16 ++++++++-------
 indra/newview/llnotificationhandler.h         |  4 ++--
 indra/newview/llnotificationhandlerutil.cpp   |  2 +-
 indra/newview/llnotificationofferhandler.cpp  | 19 +++++++++---------
 indra/newview/llnotificationscripthandler.cpp | 20 +++++++++----------
 indra/newview/llnotificationtiphandler.cpp    | 17 ++++++++--------
 indra/newview/llscreenchannel.h               |  3 +--
 10 files changed, 64 insertions(+), 58 deletions(-)

diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp
index cd71da73935..07d73c8c66f 100644
--- a/indra/newview/llimhandler.cpp
+++ b/indra/newview/llimhandler.cpp
@@ -42,7 +42,7 @@ LLIMHandler::LLIMHandler(e_notification_type type, const LLSD& id)
 	mType = type;
 
 	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
+	mChannel = LLChannelManager::getInstance()->createNotificationChannel()->getHandle();
 }
 
 //--------------------------------------------------------------------------
@@ -55,13 +55,13 @@ void LLIMHandler::initChannel()
 {
 	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); 
 	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
-	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+	mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
 }
 
 //--------------------------------------------------------------------------
 bool LLIMHandler::processNotification(const LLSD& notify)
 {
-	if(!mChannel)
+	if(mChannel.isDead())
 	{
 		return false;
 	}
@@ -72,7 +72,7 @@ bool LLIMHandler::processNotification(const LLSD& notify)
 		return false;
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -104,7 +104,7 @@ bool LLIMHandler::processNotification(const LLSD& notify)
 		p.panel = im_box;
 		p.can_be_stored = false;
 		p.on_delete_toast = boost::bind(&LLIMHandler::onDeleteToast, this, _1);
-		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 		if(channel)
 			channel->addToast(p);
 
@@ -113,7 +113,7 @@ bool LLIMHandler::processNotification(const LLSD& notify)
 	}
 	else if (notify["sigtype"].asString() == "delete")
 	{
-		mChannel->killToastByNotificationID(notification->getID());
+		mChannel.get()->killToastByNotificationID(notification->getID());
 	}
 	return false;
 }
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 240a7c7a35c..600fd395fb0 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -458,7 +458,9 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i
 
 	channel->setCreatePanelCallback(callback);
 
-	mChannel = LLChannelManager::getInstance()->addChannel(channel);
+	LLChannelManager::getInstance()->addChannel(channel);
+
+	mChannel = channel->getHandle();
 }
 
 LLNearbyChatHandler::~LLNearbyChatHandler()
@@ -558,11 +560,12 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
 		&& nearby_chat->isInVisibleChain() 
 		|| ( chat_msg.mSourceType == CHAT_SOURCE_AGENT
 			&& gSavedSettings.getBOOL("UseChatBubbles") )
-		|| !mChannel->getShowToasts() ) // to prevent toasts in Busy mode
+		|| mChannel.isDead()
+		|| !mChannel.get()->getShowToasts() ) // to prevent toasts in Busy mode
 		return;//no need in toast if chat is visible or if bubble chat is enabled
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -579,7 +582,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
 	}
 	*/
 
-	LLNearbyChatScreenChannel* channel = dynamic_cast<LLNearbyChatScreenChannel*>(mChannel);
+	LLNearbyChatScreenChannel* channel = dynamic_cast<LLNearbyChatScreenChannel*>(mChannel.get());
 
 	if(channel)
 	{
diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp
index cae7d02fedd..89fe7bb3c22 100644
--- a/indra/newview/llnotificationalerthandler.cpp
+++ b/indra/newview/llnotificationalerthandler.cpp
@@ -51,8 +51,8 @@ LLAlertHandler::LLAlertHandler(e_notification_type type, const LLSD& id) : mIsMo
 	p.channel_align = CA_CENTRE;
 
 	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->getChannel(p);
-	mChannel->setCanStoreToasts(false);
+	mChannel = LLChannelManager::getInstance()->getChannel(p)->getHandle();
+	mChannel.get()->setCanStoreToasts(false);
 }
 
 //--------------------------------------------------------------------------
@@ -64,13 +64,13 @@ LLAlertHandler::~LLAlertHandler()
 void LLAlertHandler::initChannel()
 {
 	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().getWidth() / 2;
-	mChannel->init(channel_right_bound, channel_right_bound);
+	mChannel.get()->init(channel_right_bound, channel_right_bound);
 }
 
 //--------------------------------------------------------------------------
 bool LLAlertHandler::processNotification(const LLSD& notify)
 {
-	if(!mChannel)
+	if(mChannel.isDead())
 	{
 		return false;
 	}
@@ -81,7 +81,7 @@ bool LLAlertHandler::processNotification(const LLSD& notify)
 		return false;
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -114,22 +114,22 @@ bool LLAlertHandler::processNotification(const LLSD& notify)
 		// Show alert in middle of progress view (during teleport) (EXT-1093)
 		LLProgressView* progress = gViewerWindow->getProgressView();
 		LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled();
-		mChannel->updatePositionAndSize(rc);
+		mChannel.get()->updatePositionAndSize(rc);
 
-		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 		if(channel)
 			channel->addToast(p);
 	}
 	else if (notify["sigtype"].asString() == "change")
 	{
 		LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
-		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 		if(channel)
 			channel->modifyToastByNotificationID(notification->getID(), (LLToastPanel*)alert_dialog);
 	}
 	else
 	{
-		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 		if(channel)
 			channel->killToastByNotificationID(notification->getID());
 	}
diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp
index 9b7fdaef82b..ad51389241c 100644
--- a/indra/newview/llnotificationgrouphandler.cpp
+++ b/indra/newview/llnotificationgrouphandler.cpp
@@ -42,10 +42,12 @@ LLGroupHandler::LLGroupHandler(e_notification_type type, const LLSD& id)
 	mType = type;
 
 	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+	LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
 	if(channel)
+	{
 		channel->setOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
+		mChannel = channel->getHandle();
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -58,13 +60,13 @@ void LLGroupHandler::initChannel()
 {
 	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); 
 	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
-	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+	mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
 }
 
 //--------------------------------------------------------------------------
 bool LLGroupHandler::processNotification(const LLSD& notify)
 {
-	if(!mChannel)
+	if(mChannel.isDead())
 	{
 		return false;
 	}
@@ -75,7 +77,7 @@ bool LLGroupHandler::processNotification(const LLSD& notify)
 		return false;
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -91,7 +93,7 @@ bool LLGroupHandler::processNotification(const LLSD& notify)
 		p.panel = notify_box;
 		p.on_delete_toast = boost::bind(&LLGroupHandler::onDeleteToast, this, _1);
 
-		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 		if(channel)
 			channel->addToast(p);
 
@@ -102,7 +104,7 @@ bool LLGroupHandler::processNotification(const LLSD& notify)
 	}
 	else if (notify["sigtype"].asString() == "delete")
 	{
-		mChannel->killToastByNotificationID(notification->getID());
+		mChannel.get()->killToastByNotificationID(notification->getID());
 	}
 	return false;
 }
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 23dbb6b047c..3569ad64479 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -103,8 +103,8 @@ class LLEventHandler
 	// at the moment, when a handlers creates a channel.
 	virtual void initChannel()=0;
 
-	LLScreenChannelBase*	mChannel;
-	e_notification_type		mType;
+	LLHandle<LLScreenChannelBase>	mChannel;
+	e_notification_type				mType;
 
 };
 
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 1b767e80d42..7c6287967af 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -64,7 +64,7 @@ LLSysHandler::LLSysHandler()
 
 void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif)
 {
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel *>(mChannel);
+	LLScreenChannel* channel = dynamic_cast<LLScreenChannel *>(mChannel.get());
 	if (channel == NULL)
 	{
 		return;
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 68fd65be0f9..1552ed3346c 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -45,12 +45,13 @@ LLOfferHandler::LLOfferHandler(e_notification_type type, const LLSD& id)
 	mType = type;
 
 	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-	mChannel->setControlHovering(true);
-
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+	LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
 	if(channel)
+	{
+		channel->setControlHovering(true);
 		channel->setOnRejectToastCallback(boost::bind(&LLOfferHandler::onRejectToast, this, _1));
+		mChannel = channel->getHandle();
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -63,13 +64,13 @@ void LLOfferHandler::initChannel()
 {
 	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin");
 	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
-	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+	mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
 }
 
 //--------------------------------------------------------------------------
 bool LLOfferHandler::processNotification(const LLSD& notify)
 {
-	if(!mChannel)
+	if(mChannel.isDead())
 	{
 		return false;
 	}
@@ -80,7 +81,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
 		return false;
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -134,7 +135,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
 				// we not save offer notifications to the syswell floater that should be added to the IM floater
 				p.can_be_stored = !add_notid_to_im;
 
-				LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+				LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 				if(channel)
 					channel->addToast(p);
 
@@ -175,7 +176,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
 			{
 				LLHandlerUtil::decIMMesageCounter(notification);
 			}
-			mChannel->killToastByNotificationID(notification->getID());
+			mChannel.get()->killToastByNotificationID(notification->getID());
 		}
 	}
 
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index bbb4d03768b..995915206bc 100644
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -47,13 +47,13 @@ LLScriptHandler::LLScriptHandler(e_notification_type type, const LLSD& id)
 	mType = type;
 
 	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-	mChannel->setControlHovering(true);
-	
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+	LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
 	if(channel)
+	{
+		channel->setControlHovering(true);
 		channel->setOnRejectToastCallback(boost::bind(&LLScriptHandler::onRejectToast, this, _1));
-
+		mChannel = channel->getHandle();
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -66,13 +66,13 @@ void LLScriptHandler::initChannel()
 {
 	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); 
 	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
-	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+	mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
 }
 
 //--------------------------------------------------------------------------
 bool LLScriptHandler::processNotification(const LLSD& notify)
 {
-	if(!mChannel)
+	if(mChannel.isDead())
 	{
 		return false;
 	}
@@ -83,7 +83,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
 		return false;
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -109,7 +109,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
 			p.panel = notify_box;	
 			p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1);
 
-			LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+			LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 			if(channel)
 			{
 				channel->addToast(p);
@@ -127,7 +127,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
 		}
 		else
 		{
-			mChannel->killToastByNotificationID(notification->getID());
+			mChannel.get()->killToastByNotificationID(notification->getID());
 		}
 	}
 	return false;
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index fb0891c4c5a..e397cfa046d 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -46,11 +46,12 @@ LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id)
 	mType = type;	
 
 	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+	LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
 	if(channel)
+	{
 		channel->setOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1));
+		mChannel = channel->getHandle();
+	}
 }
 
 //--------------------------------------------------------------------------
@@ -63,13 +64,13 @@ void LLTipHandler::initChannel()
 {
 	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); 
 	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
-	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+	mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
 }
 
 //--------------------------------------------------------------------------
 bool LLTipHandler::processNotification(const LLSD& notify)
 {
-	if(!mChannel)
+	if(mChannel.isDead())
 	{
 		return false;
 	}
@@ -80,7 +81,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
 		return false;	
 
 	// arrange a channel on a screen
-	if(!mChannel->getVisible())
+	if(!mChannel.get()->getVisible())
 	{
 		initChannel();
 	}
@@ -137,13 +138,13 @@ bool LLTipHandler::processNotification(const LLSD& notify)
 		
 		removeExclusiveNotifications(notification);
 
-		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 		if(channel)
 			channel->addToast(p);
 	}
 	else if (notify["sigtype"].asString() == "delete")
 	{
-		mChannel->killToastByNotificationID(notification->getID());
+		mChannel.get()->killToastByNotificationID(notification->getID());
 	}
 	return false;
 }
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index 695b6cd44d5..56a9cf8b4ba 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -117,7 +117,7 @@ class LLScreenChannelBase : public LLUICtrl
 	
 	// get ID of a channel
 	LLUUID	getChannelID() { return mID; }
-	LLHandle<LLScreenChannelBase> getHandle() { mRootHandle.bind(this); return mRootHandle; }
+	LLHandle<LLScreenChannelBase> getHandle() { return getDerivedHandle<LLScreenChannelBase>(); }
 
 protected:
 	void	updateRect();
@@ -130,7 +130,6 @@ class LLScreenChannelBase : public LLUICtrl
 	bool		mDisplayToastsAlways;
 	// controls whether a channel shows toasts or not
 	bool		mShowToasts;
-	LLRootHandle<LLScreenChannelBase> mRootHandle;
 	// 
 	EToastAlignment		mToastAlignment;
 	EChannelAlignment	mChannelAlignment;
-- 
GitLab


From 8d0c73dfd4a245ab02760a23255ef3c500ccac46 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Sat, 14 Apr 2012 00:54:59 +0300
Subject: [PATCH 914/933] Touched a file to fix the TC build.

---
 indra/llui/llnotifications.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 462d69be2e1..3df2efcac3a 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -690,7 +690,7 @@ typedef std::multimap<std::string, LLNotificationPtr> LLNotificationMap;
 // Abstract base class (interface) for a channel; also used for the master container.
 // This lets us arrange channels into a call hierarchy.
 
-// We maintain a heirarchy of notification channels; events are always started at the top
+// We maintain a hierarchy of notification channels; events are always started at the top
 // and propagated through the hierarchy only if they pass a filter.
 // Any channel can be created with a parent. A null parent (empty string) means it's
 // tied to the root of the tree (the LLNotifications class itself).
-- 
GitLab


From a56424d0781a07bbf74b9c6cdde5a488a3ba8329 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 13 Apr 2012 20:57:52 -0400
Subject: [PATCH 915/933] fix merge conflict in remove_item

---
 indra/newview/llinventoryfunctions.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 629fa53388b..94d1b197262 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -128,7 +128,7 @@ void remove_item(LLInventoryModel* model, const LLUUID& id)
 		if (trash_id.notNull())
 		{
 			// Finally, move the item to the trash
-			change_item_parent(model, item, trash_id, true);
+			model->changeItemParent(item, trash_id, true);
 		}
 	}
 }
-- 
GitLab


From 11bbd7e10e0f9a3c4848e0b19acf4e4bd286a02a Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Sat, 14 Apr 2012 08:19:07 -0400
Subject: [PATCH 916/933] gratuitous change to force new codeticket number

---
 BuildParams | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BuildParams b/BuildParams
index 1c39dd7cc75..d24666aff9a 100644
--- a/BuildParams
+++ b/BuildParams
@@ -35,6 +35,7 @@ viewer-development.build_debug_release_separately = true
 # Notifications - to configure email notices, add a setting like this:
 # <username>_<reponame>.email = <email-address>
 
+
 # =================================================================
 # Canonical viewer integration builds - Oz Linden
 # =================================================================
-- 
GitLab


From ee87fd975faf403707908cd3c7d37f8431df46ac Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Sat, 14 Apr 2012 22:23:24 -0400
Subject: [PATCH 917/933] DRTVWR-136: Remove redundant remove_(item|category)()
 functions. Incoming changes from two different project repos left
 viewer-development with LLInventoryModel::removeItem() and removeCategory()
 plus free functions remove_item() and remove_category() in
 llinventoryfunctions.cpp. remove_category() was actually the better
 implementation; migrated its body into LLInventoryModel::removeCategory().
 Clearly the previous state of affairs -- with LLInventoryModel::removeItem()
 plus a remove_category() free function in a very different source file --
 fooled two different developers into overlooking the other of the pair.
 Unfortunately we each added different "missing" functions, leaving us with a
 complete set of four. Fix existing references to remove_item() and
 remove_category() free functions.

---
 indra/newview/llfolderview.cpp         | 14 +-----
 indra/newview/llinventorybridge.cpp    |  2 +-
 indra/newview/llinventoryfunctions.cpp | 60 +-------------------------
 indra/newview/llinventoryfunctions.h   |  4 --
 indra/newview/llinventorymodel.cpp     | 43 ++++++++++++++----
 indra/newview/lloutfitslist.cpp        |  2 +-
 6 files changed, 38 insertions(+), 87 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index bad0d8cd8f5..1fa194ab191 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1059,19 +1059,7 @@ void LLFolderView::removeCutItems()
 		 iter != objects.end();
 		 ++iter)
 	{
-		const LLUUID& item_id = (*iter);
-		LLInventoryObject *obj = gInventory.getObject(item_id);
-		if (obj)
-		{
-			if (LLAssetType::AT_CATEGORY == obj->getType())
-			{
-				remove_category(&gInventory, item_id);
-			}
-			else
-			{
-				remove_item(&gInventory, item_id);
-			}
-		}
+		gInventory.removeObject(*iter);
 	}
 }
 
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index cae04ccb49c..b86c453d617 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2948,7 +2948,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
 	{
 		// move it to the trash
 		LLPreview::hide(mUUID);
-		remove_category(getInventoryModel(), mUUID);
+		getInventoryModel()->removeCategory(mUUID);
 		return TRUE;
 	}
 	return FALSE;
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 94d1b197262..ab5b0829156 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -108,64 +108,6 @@ void append_path(const LLUUID& id, std::string& path)
 	path.append(temp);
 }
 
-// Move the item to the trash. Works for folders and objects.
-// Caution: This method assumes that the item is removable!
-void remove_item(LLInventoryModel* model, const LLUUID& id)
-{
-	LLViewerInventoryItem* item = model->getItem(id);
-	if (!item)
-		return;
-	
-	if (item->getType() == LLAssetType::AT_CATEGORY)
-	{
-		// Call the general helper function to delete a folder
-		remove_category(model, id);
-	}
-	else
-	{
-		// Get the trash UUID
-		LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false);
-		if (trash_id.notNull())
-		{
-			// Finally, move the item to the trash
-			model->changeItemParent(item, trash_id, true);
-		}
-	}
-}
-
-void remove_category(LLInventoryModel* model, const LLUUID& cat_id)
-{
-	if (!model || !get_is_category_removable(model, cat_id))
-	{
-		return;
-	}
-
-	// Look for any gestures and deactivate them
-	LLInventoryModel::cat_array_t	descendent_categories;
-	LLInventoryModel::item_array_t	descendent_items;
-	gInventory.collectDescendents(cat_id, descendent_categories, descendent_items, FALSE);
-
-	for (LLInventoryModel::item_array_t::const_iterator iter = descendent_items.begin();
-		 iter != descendent_items.end();
-		 ++iter)
-	{
-		const LLViewerInventoryItem* item = (*iter);
-		const LLUUID& item_id = item->getUUID();
-		if (item->getType() == LLAssetType::AT_GESTURE
-			&& LLGestureMgr::instance().isGestureActive(item_id))
-		{
-			LLGestureMgr::instance().deactivateGesture(item_id);
-		}
-	}
-
-	LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
-	if (cat)
-	{
-		const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
-		model->changeCategoryParent(cat, trash_id, TRUE);
-	}
-}
-
 void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name)
 {
 	LLViewerInventoryCategory* cat;
@@ -610,7 +552,7 @@ void move_to_outbox_cb_action(const LLSD& payload)
 
 				if (cat_array->empty() && item_array->empty())
 				{
-					remove_category(&gInventory, parent);
+					gInventory.removeCategory(parent);
 				}
 
 				if (parent == top_level_folder)
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 535d831e477..5cf9c528b01 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -57,10 +57,6 @@ void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id);
 
 void show_item_original(const LLUUID& item_uuid);
 
-void remove_item(LLInventoryModel* model, const LLUUID& id);
-
-void remove_category(LLInventoryModel* model, const LLUUID& cat_id);
-
 void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
 
 void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 1ea4cb63f6d..85ecb133d07 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -47,6 +47,7 @@
 #include "llviewerregion.h"
 #include "llcallbacklist.h"
 #include "llvoavatarself.h"
+#include "llgesturemgr.h"
 #include <typeinfo>
 
 //#define DIFF_INVENTORY_FILES
@@ -3032,23 +3033,47 @@ void LLInventoryModel::removeItem(const LLUUID& item_id)
 	else
 	{
 		const LLUUID new_parent = findCategoryUUIDForType(LLFolderType::FT_TRASH);
-		LL_INFOS("Inventory") << "Moving to Trash (" << new_parent << "):" << LL_ENDL;
-		changeItemParent(item, new_parent, TRUE);
+		if (new_parent.notNull())
+		{
+			LL_INFOS("Inventory") << "Moving to Trash (" << new_parent << "):" << LL_ENDL;
+			changeItemParent(item, new_parent, TRUE);
+		}
 	}
 }
 
 void LLInventoryModel::removeCategory(const LLUUID& category_id)
 {
-	LLViewerInventoryCategory* cat = getCategory(category_id);
-	if (! cat)
+	if (! get_is_category_removable(this, category_id))
 	{
-		LL_WARNS("Inventory") << "couldn't find inventory folder " << category_id << LL_ENDL;
+		return;
 	}
-	else
+
+	// Look for any gestures and deactivate them
+	LLInventoryModel::cat_array_t	descendent_categories;
+	LLInventoryModel::item_array_t	descendent_items;
+	collectDescendents(category_id, descendent_categories, descendent_items, FALSE);
+
+	for (LLInventoryModel::item_array_t::const_iterator iter = descendent_items.begin();
+		 iter != descendent_items.end();
+		 ++iter)
 	{
-		const LLUUID new_parent = findCategoryUUIDForType(LLFolderType::FT_TRASH);
-		LL_INFOS("Inventory") << "Moving to Trash (" << new_parent << "):" << LL_ENDL;
-		changeCategoryParent(cat, new_parent, TRUE);
+		const LLViewerInventoryItem* item = (*iter);
+		const LLUUID& item_id = item->getUUID();
+		if (item->getType() == LLAssetType::AT_GESTURE
+			&& LLGestureMgr::instance().isGestureActive(item_id))
+		{
+			LLGestureMgr::instance().deactivateGesture(item_id);
+		}
+	}
+
+	LLViewerInventoryCategory* cat = getCategory(category_id);
+	if (cat)
+	{
+		const LLUUID trash_id = findCategoryUUIDForType(LLFolderType::FT_TRASH);
+		if (trash_id.notNull())
+		{
+			changeCategoryParent(cat, trash_id, TRUE);
+		}
 	}
 }
 
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 1dc4d796ab2..ef5ef2ddc82 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -640,7 +640,7 @@ void LLOutfitsList::onOutfitsRemovalConfirmation(const LLSD& notification, const
 
 	if (mSelectedOutfitUUID.notNull())
 	{
-		remove_category(&gInventory, mSelectedOutfitUUID);
+		gInventory.removeCategory(mSelectedOutfitUUID);
 	}
 }
 
-- 
GitLab


From 3ccda1f2855ae9e5b3f519236e9b4f233d542d1a Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Mon, 16 Apr 2012 14:29:32 -0700
Subject: [PATCH 918/933] MAINT-922 FIX Client side code to catch the
 SCRIPT_PERMISSION_TELEPORT request from similator and display a notification
 Reviewed by Simon

---
 indra/lscript/lscript_byteformat.h             | 2 ++
 indra/lscript/lscript_compile/indra.l          | 3 ++-
 indra/newview/app_settings/keywords.ini        | 1 +
 indra/newview/llviewermessage.cpp              | 6 ++++--
 indra/newview/skins/default/xui/en/strings.xml | 5 +++--
 5 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h
index 7dd21bb1ad4..a294def7341 100644
--- a/indra/lscript/lscript_byteformat.h
+++ b/indra/lscript/lscript_byteformat.h
@@ -529,6 +529,7 @@ typedef enum e_lscript_runtime_permissions
 	SCRIPT_PERMISSION_CHANGE_PERMISSIONS,
 	SCRIPT_PERMISSION_TRACK_CAMERA,
 	SCRIPT_PERMISSION_CONTROL_CAMERA,
+	SCRIPT_PERMISSION_TELEPORT,
 	SCRIPT_PERMISSION_EOF
 } LSCRIPTRunTimePermissions;
 
@@ -545,6 +546,7 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] =
 	(0x1 << 9),	//	SCRIPT_PERMISSION_CHANGE_PERMISSIONS
 	(0x1 << 10),//	SCRIPT_PERMISSION_TRACK_CAMERA
 	(0x1 << 11),//	SCRIPT_PERMISSION_CONTROL_CAMERA
+	(0x1 << 12),//	SCRIPT_PERMISSION_TELEPORT
 };
 
 // http_request string constants
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 4e103ae2ba4..96b7e57e978 100644
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -212,7 +212,8 @@ extern "C" { int yyerror(const char *fmt, ...); }
 "PERMISSION_CHANGE_JOINTS"		{ count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CHANGE_JOINTS]; return(INTEGER_CONSTANT); }
 "PERMISSION_CHANGE_PERMISSIONS"	{ count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CHANGE_PERMISSIONS]; return(INTEGER_CONSTANT); }
 "PERMISSION_TRACK_CAMERA"		{ count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRACK_CAMERA]; return(INTEGER_CONSTANT); }
-"PERMISSION_CONTROL_CAMERA"			{ count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CONTROL_CAMERA]; return(INTEGER_CONSTANT); }
+"PERMISSION_CONTROL_CAMERA"		{ count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CONTROL_CAMERA]; return(INTEGER_CONSTANT); }
+"PERMISSION_TELEPORT"			{ count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT]; return(INTEGER_CONSTANT); }
 
 "INVENTORY_TEXTURE"					{ count(); yylval.ival = LLAssetType::AT_TEXTURE; return(INTEGER_CONSTANT); }
 "INVENTORY_SOUND"					{ count(); yylval.ival = LLAssetType::AT_SOUND; return(INTEGER_CONSTANT); }
diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini
index 82b43432eb3..318b69438a7 100644
--- a/indra/newview/app_settings/keywords.ini
+++ b/indra/newview/app_settings/keywords.ini
@@ -91,6 +91,7 @@ PERMISSION_CHANGE_LINKS			Passed to llRequestPermissions library function to req
 # PERMISSION_CHANGE_PERMISSIONS Passed to llRequestPermissions library function to request permission to change permissions
 PERMISSION_TRACK_CAMERA			Passed to llRequestPermissions library function to request permission to track agent's camera
 PERMISSION_CONTROL_CAMERA		Passed to llRequestPermissions library function to request permission to change agent's camera
+PERMISSION_TELEPORT				Passed to llRequestPermissions library function to request permission to teleport agent
 
 DEBUG_CHANNEL		Chat channel reserved for debug and error messages from scripts
 PUBLIC_CHANNEL		Chat channel that broadcasts to all nearby users
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ae87e3da970..854e2bea526 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -156,7 +156,8 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] =
 		"AddAndRemoveJoints",
 		"ChangePermissions",
 		"TrackYourCamera",
-		"ControlYourCamera"
+		"ControlYourCamera",
+		"TeleportYourAgent"
 	};
 
 const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = 
@@ -171,7 +172,8 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] =
 	FALSE,	// AddAndRemoveJoints
 	FALSE,	// ChangePermissions
 	FALSE,	// TrackYourCamera,
-	FALSE	// ControlYourCamera
+	FALSE,	// ControlYourCamera
+	FALSE	// TeleportYourAgent
 };
 
 bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 97526526794..4ccec4838ac 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -403,8 +403,9 @@ Please try logging in again in a minute.</string>
 	<string name="AddAndRemoveJoints">Add and remove joints with other objects</string>
 	<string name="ChangePermissions">Change its permissions</string>
 	<string name="TrackYourCamera">Track your camera</string>
-	<string name="ControlYourCamera">Control your camera</string>
-	<string name="NotConnected">Not Connected</string>
+  <string name="ControlYourCamera">Control your camera</string>
+  <string name="TeleportYourAgent">Teleport you</string>
+  <string name="NotConnected">Not Connected</string>
 
 	<!-- Sim Access labels -->
 	<string name="SIM_ACCESS_PG">General</string>
-- 
GitLab


From e627a5f8ddb6803342e82274d20c2c49e918168c Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Mon, 16 Apr 2012 16:16:18 -0700
Subject: [PATCH 919/933] sync with viewer-development

---
 .../default/xui/en/floater_image_preview.xml  |   6 +-
 .../default/xui/en/floater_texture_ctrl.xml   | 192 ++++++++++++++----
 .../default/xui/en/floater_window_size.xml    |  60 ++++--
 .../skins/default/xui/en/notifications.xml    |  27 +++
 4 files changed, 221 insertions(+), 64 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml
index 86232de1a47..44d2c14cc8d 100644
--- a/indra/newview/skins/default/xui/en/floater_image_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml
@@ -2,7 +2,7 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- height="440"
+ height="460"
  layout="topleft"
  name="Image Preview"
  help_topic="image_preview"
@@ -108,7 +108,7 @@
     <text
      type="string"
      length="1"
-     bottom="225"
+     bottom="250"
      height="45"
      word_wrap="true"
      follows="top|left"
@@ -137,7 +137,7 @@ Try saving image as 24 bit Targa (.tga).
      layout="topleft"
      left="165"
      name="cancel_btn"
-     top="410"
+     top="430"
      width="125" />
     <button
      follows="bottom|left"
diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
index cad7d72ed7f..ffb8b842f0c 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
@@ -3,15 +3,17 @@
  legacy_header_height="18"
  can_minimize="false"
  can_resize="true"
- height="290"
+ height="330"
  layout="topleft"
- min_height="290"
+ min_height="330"
  min_width="410"
  name="texture picker"
  help_topic="texture_picker"
  title="PICK: TEXTURE"
  width="410">
-    <floater.string
+ 
+<!--  top static -->
+ <floater.string
      name="choose_picture">
         Click to choose a picture
     </floater.string>
@@ -19,6 +21,16 @@
      name="pick title">
         Pick:
     </floater.string>
+
+    <view
+     left="4"
+     top="20"
+     name="preview_widget"
+     height="165"
+     width="165"
+     follows="left|top"
+    />
+  
     <text
      type="string"
      length="1"
@@ -34,70 +46,94 @@
      width="163">
         Multiple textures
     </text>
+	
+	<!-- mode selector -->
+	   <radio_group
+     control_name="mode_selection"
+     height="20"
+     layout="topleft"
+     left="18"
+     top_pad="80"
+     name="mode_selection"
+     follows="left|top">
+        <radio_item
+         label="Inventory"
+         name="inventory"
+         top_delta="20" 
+         layout="topleft"
+         height="16" 
+         left="0" 
+         value="0"
+         width="80" />
+        <radio_item
+         label="Local"
+         left_pad="0"
+         layout="topleft"
+         top_delta="0" 
+         height="16" 
+         name="local"
+         value="1"
+         width="75" />
+    </radio_group>
+	<!-- -->
+	
     <text
      type="string"
      length="1"
      follows="left|top"
      height="14"
      layout="topleft"
-     left_delta="0"
+     left_delta="-12"
      name="unknown"
-     top_pad="80"
-     width="163">
+     top_pad="4"
+     width="">
         Size: [DIMENSIONS]
     </text>
+    
+<!--  middle: inventory mode -->
+
     <button
      enabled="false"
-     follows="left|bottom"
-     height="20"
+     follows="left|top"
+     height="18"
      label="Default"
      label_selected="Default"
      layout="topleft"
-     left_delta="0"
      name="Default"
-     top_pad="4"
-     width="80" />
+     width="73"
+	 left="94"
+     top="215"/>
     <button
+     follows="left|top"
+     height="20"
+     label="Blank"
+     label_selected="Blank"
+     layout="topleft"
+     left_delta="0"
+     name="Blank"
+     top_pad="5"
+     width="73" />
+     <button
      enabled="false"
-     follows="left|bottom"
+     follows="left|top"
      height="20"
      label="None"
      label_selected="None"
      layout="topleft"
-     left_pad="4"
+     left_delta="0"
      name="None"
-     top_delta="0"
-     width="80" />
-    <button
-     follows="left|bottom"
-     height="20"
-     label="Blank"
-     label_selected="Blank"
-     layout="topleft"
-     left="4"
-     name="Blank"
      top_pad="5"
-     width="80" />
-         <button
-     follows="left|bottom"
+     width="73" />
+    <button
+     follows="left|top"
      height="28"
      image_selected="eye_button_active.tga"
      image_unselected="eye_button_inactive.tga"
      layout="topleft"
-     left_pad="50"
-     top_delta="3"
+     left_delta="-80"
+     top_delta="-25"
      name="Pipette"
      width="28" />
-   <check_box
-     follows="left|bottom"
-     height="20"
-     initial_value="true"
-     label="Apply now"
-     layout="topleft"
-     left="4"
-     name="apply_immediate_check"
-     top="262"
-     width="120" />
     <filter_editor
      follows="left|top|right"
      height="23"
@@ -113,7 +149,7 @@
      bg_alpha_color="DkGray2"
      border="false"
      follows="all"
-     height="200"
+     height="233"
      layout="topleft"
      left_delta="0"
      name="inventory panel"
@@ -128,23 +164,89 @@
      top_pad="0"
      left_delta="-3"
      width="200" />
-         <button
-     follows="right|bottom"
+
+<!--  middle: local mode -->
+    <button
+     follows="left|top"
+     height="18"
+     label="Add"
+     label_selected="Add"
+     layout="topleft"
+     left="94"
+     top="215"
+     name="l_add_btn"
+     width="73"
+     visible="false"/>
+    <button
+     enabled="false"
+     follows="left|top"
+     height="20"
+     label="Remove"
+     label_selected="Remove"
+     layout="topleft"
+     left_delta="0"
+     name="l_rem_btn"
+     top_pad="5"
+     width="73"
+     visible="false"/>
+    <button
+     enabled="false"
+     follows="left|top"
+     height="20"
+     label="Upload"
+     label_selected="Upload"
+     layout="topleft"
+     left_delta="0"
+     name="l_upl_btn"
+     top_pad="5"
+     width="73"
+     visible="false"/>
+    <scroll_list
+     name="l_name_list"
+     left="170"
+     top="22"
+     width="235"
+     height="260"
+     follows="left|top|right|bottom"
+     column_padding="0"
+     can_resize="false"
+     draw_heading="true"
+     multi_select="true"
+     search_column="1"
+     visible="false">
+        <column name="unit_name" label="Name" dynamicwidth="true" />
+        <column name="unit_id_HIDDEN" label="ID" width="0" />
+    </scroll_list>
+     
+<!-- bottom static -->
+    <button
+     follows="bottom"
      height="20"
      label="OK"
      label_selected="OK"
      layout="topleft"
-     right="-120"
+     left="95"
+     top="-30"
      name="Select"
      width="100" />
     <button
-     follows="right|bottom"
+     follows="bottom"
      height="20"
      label="Cancel"
      label_selected="Cancel"
      layout="topleft"
-     right="-10"
-     left_pad="5"
+     left_delta="120"
+     top_delta="0"
      name="Cancel"
      width="100" />
+    <check_box
+     follows="left|bottom"
+     height="20"
+     initial_value="true"
+     label="Apply now"
+     layout="topleft"
+     left="6"
+     name="apply_immediate_check"
+     top_delta="0"
+     width="120" />
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_window_size.xml b/indra/newview/skins/default/xui/en/floater_window_size.xml
index 355d2577854..115fe413f3c 100644
--- a/indra/newview/skins/default/xui/en/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/en/floater_window_size.xml
@@ -28,22 +28,50 @@
      tool_tip="width x height"
      top_pad="5"
      width="179">
-        <combo_box.item
-         label="1000 x 700 (default)"
-         name="item0"
-         value="1000 x 700" />
-        <combo_box.item
-         label="1024 x 768"
-         name="item1"
-         value="1024 x 768" />
-        <combo_box.item
-         label="1280 x 720 (720p)"
-         name="item2"
-         value="1280 x 720" />
-        <combo_box.item
-         label="1920 x 1080 (1080p)"
-         name="item3"
-         value="1920 x 1080" />
+      <combo_box.item
+       label="1000 x 700 (default)"
+       name="item1"
+       value="1000 x 700" />
+      <combo_box.item
+       label="1024 x 768 (4:3 XGA)"
+       name="item2"
+       value="1024 x 768" />
+      <combo_box.item
+       label="1280 x 720 (16:9 HDTV)"
+       name="item3"
+       value="1280 x 720" />
+      <combo_box.item
+       label="1280 x 800 (5:8 WXGA)"
+       name="item4"
+       value="1280 x 800" />
+      <combo_box.item
+       label="1280 x 1024 (5:4 SXGA)"
+       name="item5"
+       value="1280 x 1024" />
+      <combo_box.item
+       label="1440 x 900 (8:5 WSXGA)"
+       name="item7"
+       value="1440 x 900" />
+      <combo_box.item
+       label="1600 x 900 (16:9 HD+)"
+       name="item8"
+       value="1600 x 900" />
+      <combo_box.item
+       label="1600 x 1200 (4:3 UXGA)"
+       name="item9"
+       value="1600 x 1200" />
+      <combo_box.item
+       label="1680 x 1050 (8:5 WSXGA+)"
+       name="item10"
+       value="1680 x 1050" />
+      <combo_box.item
+       label="1920 x 1080 (16:9 HDTV)"
+       name="item11"
+       value="1920 x 1080" />
+      <combo_box.item
+       label="1920 x 1200 (8:5 WUXGA)"
+       name="item12"
+       value="1920 x 1200" />
     </combo_box>
     <button
      follows="right|bottom"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 59dd17ea9d3..afc5b916e77 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7696,4 +7696,31 @@ Otherwise, you can look at the Map and find places marked &quot;Infohub&quot;.
 You died and have been teleported to your home location.
   </global>
 
+  <notification
+   icon="alertmodal.tga"
+   name="LocalBitmapsUpdateFileNotFound"
+   persist="true"
+   type="notify">
+[FNAME] could not be updated because the file could no longer be found.
+Disabling future updates for this file.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LocalBitmapsUpdateFailedFinal"
+   persist="true"
+   type="notify">
+[FNAME] could not be opened or decoded for [NRETRIES] attempts, and is now considered broken.
+Disabling future updates for this file.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LocalBitmapsVerifyFail"
+   persist="true"
+   type="notify">
+Attempted to add an invalid or unreadable image file [FNAME] which could not be opened or decoded.
+Attempt cancelled.
+  </notification>
+  
 </notifications>
-- 
GitLab


From c104c887c5c3d4e8c84b9d028bb4123701228551 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 17 Apr 2012 17:36:22 +0300
Subject: [PATCH 920/933] Mac build fix.

---
 indra/newview/llimview.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index c4ea8c0d313..a7c4618fa4e 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -171,8 +171,8 @@ void LLIMModel::setActiveSessionID(const LLUUID& session_id)
 
 LLIMModel::LLIMModel() 
 {
-	addNewMsgCallback(LLIMFloater::newIMCallback);
-	addNewMsgCallback(toast_callback);
+	addNewMsgCallback(boost::bind(&LLIMFloater::newIMCallback, _1));
+	addNewMsgCallback(boost::bind(&toast_callback, _1));
 }
 
 LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice)
-- 
GitLab


From ee1124e1c02b1a8be0cc8d2cbce1083dca3b40a2 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 17 Apr 2012 13:42:53 -0700
Subject: [PATCH 921/933] Added tag viewer-beta-candidate, 3.3.1-beta2,
 DRTVWR-139 for changeset 1dc545e44617

---
 .hgtags | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.hgtags b/.hgtags
index 261b3ef140f..6fa4900b026 100644
--- a/.hgtags
+++ b/.hgtags
@@ -279,3 +279,7 @@ d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
 5e8d2662f38a66eca6c591295f5880d47afc73f7 3.3.0-release
 dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
 3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
+3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
+1dc545e44617975da2a4a32fe303386c687a6ca1 viewer-beta-candidate
+1dc545e44617975da2a4a32fe303386c687a6ca1 3.3.1-beta2
+1dc545e44617975da2a4a32fe303386c687a6ca1 DRTVWR-139
-- 
GitLab


From d6569db3520f7e0ce2d93febb6f4e26b48c08a3d Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 24 Apr 2012 08:38:38 -0400
Subject: [PATCH 922/933] Added tag viewer-release-candidate, 3.3.1-release for
 changeset c623bbc854b6

---
 .hgtags | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.hgtags b/.hgtags
index 6fa4900b026..6edf9b03302 100644
--- a/.hgtags
+++ b/.hgtags
@@ -283,3 +283,6 @@ dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
 1dc545e44617975da2a4a32fe303386c687a6ca1 viewer-beta-candidate
 1dc545e44617975da2a4a32fe303386c687a6ca1 3.3.1-beta2
 1dc545e44617975da2a4a32fe303386c687a6ca1 DRTVWR-139
+5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
+c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate
+c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release
-- 
GitLab


From 1b832eaa4b5cbb9be2a3c92643ba62794931d1d2 Mon Sep 17 00:00:00 2001
From: Boroondas Gupte <hg@boroon.dasgupta.ch>
Date: Tue, 24 Apr 2012 11:24:11 -0400
Subject: [PATCH 923/933] OPEN-54: correct JsonCpp include path

---
 doc/contributions.txt        | 2 +-
 indra/cmake/JsonCpp.cmake    | 2 +-
 indra/newview/CMakeLists.txt | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 5a24c43d5a8..04edfb4bea1 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -234,7 +234,7 @@ Borg Capalini
 Boroondas Gupte
 	OPEN-29
 	OPEN-39
-	OPEN-39
+	OPEN-54
 	OPEN-99
 	SNOW-278
 	SNOW-503
diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake
index 499b00fb444..7ad73e56830 100644
--- a/indra/cmake/JsonCpp.cmake
+++ b/indra/cmake/JsonCpp.cmake
@@ -18,5 +18,5 @@ else (STANDALONE)
   elseif (LINUX)
     set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
   endif (WINDOWS)
-  set(JSONCPP_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
+  set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
 endif (STANDALONE)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 7e6ffb35c3e..9aaefa9c6ae 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -47,7 +47,7 @@ include(CMakeCopyIfDifferent)
 
 include_directories(
     ${DBUSGLIB_INCLUDE_DIRS}
-    ${JSONCPP_INCLUDE_DIRS}
+    ${JSONCPP_INCLUDE_DIR}
     ${GLOD_INCLUDE_DIR}
     ${LLAUDIO_INCLUDE_DIRS}
     ${LLCHARACTER_INCLUDE_DIRS}
-- 
GitLab


From 3d8d8b6deee4887600d4efdb7554e1c9dbdc4dc2 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 24 Apr 2012 11:40:57 -0700
Subject: [PATCH 924/933] sync with viewer-development

---
 indra/newview/skins/default/xui/en/strings.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 97526526794..4ccec4838ac 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -403,8 +403,9 @@ Please try logging in again in a minute.</string>
 	<string name="AddAndRemoveJoints">Add and remove joints with other objects</string>
 	<string name="ChangePermissions">Change its permissions</string>
 	<string name="TrackYourCamera">Track your camera</string>
-	<string name="ControlYourCamera">Control your camera</string>
-	<string name="NotConnected">Not Connected</string>
+  <string name="ControlYourCamera">Control your camera</string>
+  <string name="TeleportYourAgent">Teleport you</string>
+  <string name="NotConnected">Not Connected</string>
 
 	<!-- Sim Access labels -->
 	<string name="SIM_ACCESS_PG">General</string>
-- 
GitLab


From 080c9faf5e4129b17803f3abca12f9376ea5332a Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 24 Apr 2012 11:51:45 -0700
Subject: [PATCH 925/933] FIX INTL-96 Viewer translation for Set31

---
 .../xui/de/floater_animation_anim_preview.xml |  11 ++
 .../xui/de/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/de/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/de/floater_tools.xml    |  22 ++-
 .../default/xui/de/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/de/menu_inventory.xml   |   1 +
 .../skins/default/xui/de/menu_viewer.xml      |  10 +-
 .../skins/default/xui/de/notifications.xml    |  10 +-
 .../default/xui/de/panel_nearby_chat.xml      |   6 +-
 .../default/xui/de/sidepanel_inventory.xml    |   4 +-
 .../newview/skins/default/xui/de/strings.xml  |   8 +-
 .../xui/fr/floater_animation_anim_preview.xml |  11 ++
 .../xui/fr/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/fr/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/fr/floater_tools.xml    |  24 ++-
 .../default/xui/fr/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/fr/menu_inventory.xml   |   1 +
 .../skins/default/xui/fr/menu_viewer.xml      |  10 +-
 .../skins/default/xui/fr/notifications.xml    |  10 +-
 .../default/xui/fr/panel_nearby_chat.xml      |   6 +-
 .../default/xui/fr/sidepanel_inventory.xml    |   2 +-
 .../newview/skins/default/xui/fr/strings.xml  |   8 +-
 .../xui/it/floater_animation_anim_preview.xml |  11 ++
 .../xui/it/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/it/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/it/floater_tools.xml    |  22 ++-
 .../default/xui/it/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/it/menu_inventory.xml   |   1 +
 .../skins/default/xui/it/menu_viewer.xml      |  10 +-
 .../skins/default/xui/it/notifications.xml    |  10 +-
 .../default/xui/it/panel_nearby_chat.xml      |   6 +-
 .../default/xui/it/sidepanel_inventory.xml    |   2 +-
 .../newview/skins/default/xui/it/strings.xml  |   8 +-
 .../xui/ja/floater_animation_anim_preview.xml |  11 ++
 .../xui/ja/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/ja/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/ja/floater_tools.xml    |  22 ++-
 .../default/xui/ja/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/ja/menu_inventory.xml   |   1 +
 .../skins/default/xui/ja/menu_viewer.xml      |  12 +-
 .../skins/default/xui/ja/notifications.xml    |  12 +-
 .../default/xui/ja/panel_nearby_chat.xml      |   6 +-
 .../default/xui/ja/sidepanel_inventory.xml    |   4 +-
 .../newview/skins/default/xui/ja/strings.xml  |  10 +-
 .../xui/pt/floater_animation_anim_preview.xml |  11 ++
 .../xui/pt/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/pt/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/pt/floater_tools.xml    |  22 ++-
 .../default/xui/pt/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/pt/menu_inventory.xml   |   1 +
 .../skins/default/xui/pt/menu_viewer.xml      |  10 +-
 .../skins/default/xui/pt/notifications.xml    |  10 +-
 .../default/xui/pt/panel_nearby_chat.xml      |   6 +-
 .../default/xui/pt/sidepanel_inventory.xml    |   4 +-
 .../newview/skins/default/xui/pt/strings.xml  |   8 +-
 .../xui/ru/floater_animation_anim_preview.xml |  11 ++
 .../xui/ru/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/ru/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/ru/floater_tools.xml    |  22 ++-
 .../default/xui/ru/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/ru/menu_inventory.xml   |   1 +
 .../skins/default/xui/ru/menu_viewer.xml      |  10 +-
 .../skins/default/xui/ru/notifications.xml    |  10 +-
 .../default/xui/ru/panel_nearby_chat.xml      |   6 +-
 .../default/xui/ru/sidepanel_inventory.xml    |   2 +-
 .../newview/skins/default/xui/ru/strings.xml  |   8 +-
 .../xui/tr/floater_animation_anim_preview.xml |  11 ++
 .../xui/tr/floater_animation_bvh_preview.xml  | 186 ++++++++++++++++++
 .../xui/tr/floater_preview_animation.xml      |   4 +-
 .../floater_test_text_vertical_aligment.xml   |   2 +
 .../skins/default/xui/tr/floater_tools.xml    |  22 ++-
 .../default/xui/tr/floater_voice_effect.xml   |  23 ++-
 .../skins/default/xui/tr/menu_inventory.xml   |   1 +
 .../skins/default/xui/tr/menu_viewer.xml      |  10 +-
 .../skins/default/xui/tr/notifications.xml    |  10 +-
 .../default/xui/tr/panel_nearby_chat.xml      |   6 +-
 .../default/xui/tr/sidepanel_inventory.xml    |   2 +-
 .../newview/skins/default/xui/tr/strings.xml  |   8 +-
 84 files changed, 1911 insertions(+), 98 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/de/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/de/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/de/floater_test_text_vertical_aligment.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_test_text_vertical_aligment.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_test_text_vertical_aligment.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_test_text_vertical_aligment.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_test_text_vertical_aligment.xml
 create mode 100644 indra/newview/skins/default/xui/ru/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/ru/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/ru/floater_test_text_vertical_aligment.xml
 create mode 100644 indra/newview/skins/default/xui/tr/floater_animation_anim_preview.xml
 create mode 100644 indra/newview/skins/default/xui/tr/floater_animation_bvh_preview.xml
 create mode 100644 indra/newview/skins/default/xui/tr/floater_test_text_vertical_aligment.xml

diff --git a/indra/newview/skins/default/xui/de/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/de/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..3dc554b1202
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		Name:
+	</text>
+	<text name="description_label">
+		Beschreibung:
+	</text>
+	<button label="Hochladen (L$ [AMOUNT])" name="ok_btn"/>
+	<button label="Abbrechen" label_selected="Abbrechen" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/de/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..9a6f5e01669
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		Bewegung konnte nicht initialisiert werden
+	</floater.string>
+	<floater.string name="anim_too_long">
+		Animationsdatei ist [LENGTH] Sekunden lang.
+
+Maximal erlaubt sind [MAX_LENGTH] Sekunden.
+	</floater.string>
+	<floater.string name="failed_file_read">
+		Animationsdatei kann nicht gelesen werden.
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		OK
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		Vorzeitiges Dateiende.
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		Constraint-Definition kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		BVH-Datei kann nicht geöffnet werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		Ungültige HIERARCHY-Kopfzeile.
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		ROOT oder JOINT nicht gefunden.
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		JOINT-Name nicht erfasst.
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		OFFSET nicht gefunden.
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		CHANNELS nicht gefunden.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		Rotationsreihenfolge kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		Rotationsachse kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		MOTION nicht gefunden.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		Anzahl der Bilder kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		Bildzeit kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		Positionswerte können nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		Rotationswerte können nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		Transformationsdatei kann nicht geöffnet werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		Transformationskopfzeile kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		Transformationsnamen können nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		Ignorieren-Transformationswert kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		Relativer Transformationswert kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		Outname-Transformationswert kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		Transformationsmatrix kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Mergechild-Name kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Mergeparent-Name kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		Priority-Wert kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		Loop-Wert kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		EaseIn-Werte können nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		EaseOut-Werte können nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		Hand-Morph-Wert kann nicht erfasst werden.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		Emote-Name kann nicht gelesen werden.
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		Falscher Root-Joint-Name, „hip“ verwenden.
+	</floater.string>
+	<text name="name_label">
+		Name:
+	</text>
+	<text name="description_label">
+		Beschreibung:
+	</text>
+	<spinner label="Priorität" name="priority" tool_tip="Steuert, welche Animationen von dieser Animation überschrieben werden können"/>
+	<check_box label="Schleife" name="loop_check" tool_tip="Erzeugt eine Animationsschleife"/>
+	<spinner label="Ein (%)" name="loop_in_point" tool_tip="Anfang einer Animationsschleife festlegen"/>
+	<spinner label="Aus (%)" name="loop_out_point" tool_tip="Ende einer Animationsschleife festlegen"/>
+	<text name="hand_label">
+		Handhaltung
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="Steuert während der Animation die Bewegung der Hände">
+		<combo_box.item label="Dehnen" name="Spread"/>
+		<combo_box.item label="Entspannt" name="Relaxed"/>
+		<combo_box.item label="Beide zeigen" name="PointBoth"/>
+		<combo_box.item label="Faust" name="Fist"/>
+		<combo_box.item label="Links entspannt" name="RelaxedLeft"/>
+		<combo_box.item label="Nach links zeigen" name="PointLeft"/>
+		<combo_box.item label="Linke Faust" name="FistLeft"/>
+		<combo_box.item label="Rechts entspannt" name="RelaxedRight"/>
+		<combo_box.item label="Nach rechts zeigen" name="PointRight"/>
+		<combo_box.item label="Rechte Faust" name="FistRight"/>
+		<combo_box.item label="Rechts salutieren" name="SaluteRight"/>
+		<combo_box.item label="Tippen" name="Typing"/>
+		<combo_box.item label="Friedensgeste rechts" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		Ausdruck
+	</text>
+	<combo_box name="emote_combo" tool_tip="Steuert Gesichtsregungen während der Animation">
+		<item label="(Keine)" name="[None]" value=""/>
+		<item label="Aaaaah" name="Aaaaah" value="Aaaaah"/>
+		<item label="Ängstlich" name="Afraid" value="Ängstlich"/>
+		<item label="Verärgert" name="Angry" value="Verärgert"/>
+		<item label="Grinst" name="BigSmile" value="Grinst"/>
+		<item label="Gelangweilt" name="Bored" value="Gelangweilt"/>
+		<item label="Weinen" name="Cry" value="Weinen"/>
+		<item label="Verachtung" name="Disdain" value="Verachtung"/>
+		<item label="Verlegen" name="Embarrassed" value="Verlegen"/>
+		<item label="Stirnrunzeln" name="Frown" value="Stirnrunzeln"/>
+		<item label="Küssen" name="Kiss" value="Küssen"/>
+		<item label="Lachen" name="Laugh" value="Lachen"/>
+		<item label="Bäääh" name="Plllppt" value="Bäääh"/>
+		<item label="Angewidert" name="Repulsed" value="Angewidert"/>
+		<item label="Traurig" name="Sad" value="Traurig"/>
+		<item label="Achselzucken" name="Shrug" value="Achselzucken"/>
+		<item label="Lächeln" name="Smile" value="Lächeln"/>
+		<item label="Ãœberraschung" name="Surprise" value="Ãœberraschung"/>
+		<item label="Zwinkern" name="Wink" value="Zwinkern"/>
+		<item label="Sorgenvoll" name="Worry" value="Sorgenvoll"/>
+	</combo_box>
+	<text name="preview_label">
+		Vorschau während:
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="Hiermit können Sie das Verhalten Ihres Avatars testen, während Ihr Avatar normale Bewegungen ausführt.">
+		<item label="Stehen" name="Standing" value="Stehen"/>
+		<item label="Gehen" name="Walking" value="Gehen"/>
+		<item label="Sitzen" name="Sitting" value="Sitzen"/>
+		<item label="Fliegen" name="Flying" value="Fliegen"/>
+	</combo_box>
+	<spinner label="Einblenden (s)" name="ease_in_time" tool_tip="Einblendungszeit für Animationen (in Sekunden)"/>
+	<spinner label="Ausblenden (s)" name="ease_out_time" tool_tip="Ausblendungszeit für Animationen (in Sekunden)"/>
+	<button name="play_btn" tool_tip="Animation abspielen"/>
+	<button name="pause_btn" tool_tip="Animation unterbrechen"/>
+	<button name="stop_btn" tool_tip="Animation anhalten"/>
+	<text name="bad_animation_text">
+		Animationsdatei kann nicht gelesen werden.
+
+Wir empfehlen exportierte BVH-Dateien aus Poser 4.
+	</text>
+	<button label="Hochladen (L$ [AMOUNT])" name="ok_btn"/>
+	<button label="Abbrechen" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_preview_animation.xml b/indra/newview/skins/default/xui/de/floater_preview_animation.xml
index 3dcdb525557..2dd47a27ad8 100644
--- a/indra/newview/skins/default/xui/de/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/de/floater_preview_animation.xml
@@ -7,6 +7,6 @@
 		Beschreibung:
 	</text>
 	<line_editor left="108" name="desc" width="160"/>
-	<button label="Inworld abspielen" label_selected="Stopp" name="Anim play btn" tool_tip="Diese Animation so wiedergeben, dass andere sie sehen können." width="116"/>
-	<button label="Lokal abspielen" label_selected="Stopp" left="171" name="Anim audition btn" tool_tip="Diese Animation so wiedergeben, dass nur Sie sie sehen." width="116"/>
+	<button label="Inworld abspielen" label_selected="Stopp" name="Inworld" tool_tip="Diese Animation so wiedergeben, dass andere sie sehen können."/>
+	<button label="Lokal wiedergeben" label_selected="Stopp" name="Locally" tool_tip="Diese Animation so wiedergeben, dass nur Sie sie sehen."/>
 </floater>
diff --git a/indra/newview/skins/default/xui/de/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/de/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..506d2b013a2
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="TEST-FENSTER"/>
diff --git a/indra/newview/skins/default/xui/de/floater_tools.xml b/indra/newview/skins/default/xui/de/floater_tools.xml
index cf1d03f32d2..dee89b28e53 100644
--- a/indra/newview/skins/default/xui/de/floater_tools.xml
+++ b/indra/newview/skins/default/xui/de/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="BAU-WERKZEUGE" title="">
+	<floater.string name="grid_screen_text">
+		Bildschirm
+	</floater.string>
+	<floater.string name="grid_local_text">
+		Lokal
+	</floater.string>
+	<floater.string name="grid_world_text">
+		Welt
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		Referenz
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		Anhang
+	</floater.string>
 	<floater.string name="status_rotate">
 		An den farbigen Bändern ziehen, um das Objekt zu drehen
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="true" label="Texturen dehnen" name="checkbox stretch textures" top_pad="-5"/>
 	<check_box initial_value="true" label="Einrasten" name="checkbox snap to grid" top_pad="15"/>
-	<button label="Optionen..." label_selected="Optionen..." name="Options..." tool_tip="Mehr Raster-Optionen anzeigen"/>
+	<combo_box name="combobox grid mode" tool_tip="Wählen Sie das gewünschte Rasterlineal zum Positionieren des Objekts aus.">
+		<combo_box.item label="Welt" name="World"/>
+		<combo_box.item label="Lokal" name="Local"/>
+		<combo_box.item label="Referenz" name="Reference"/>
+	</combo_box>
+	<button label="" label_selected="Optionen..." name="Options..." tool_tip="Mehr Raster-Optionen anzeigen"/>
 	<button label="" label_selected="" name="ToolCube" tool_tip="Würfel"/>
 	<button label="" label_selected="" name="ToolPrism" tool_tip="Prisma"/>
 	<button label="" label_selected="" name="ToolPyramid" tool_tip="Pyramide"/>
diff --git a/indra/newview/skins/default/xui/de/floater_voice_effect.xml b/indra/newview/skins/default/xui/de/floater_voice_effect.xml
index 3dc0fc2322f..413a46525c5 100644
--- a/indra/newview/skins/default/xui/de/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/de/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		Dämon
 	</string>
+	<string name="effect_Female Elf">
+		Weibliche Elfe
+	</string>
 	<string name="effect_Flirty">
 		Kokett
 	</string>
 	<string name="effect_Foxy">
 		Attraktiv
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		Bonus_Halloween_2010
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		Rauchig
 	</string>
+	<string name="effect_Husky Whisper">
+		Rauchiges Flüstern
+	</string>
 	<string name="effect_Intercom">
 		Intercom
 	</string>
+	<string name="effect_Julia">
+		Julia
+	</string>
+	<string name="effect_Lo Lilt">
+		Leises Trällern
+	</string>
 	<string name="effect_Macho">
 		Macho
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		Mini
 	</string>
+	<string name="effect_Model">
+		Modell
+	</string>
 	<string name="effect_Nano">
 		Nano
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		Roxanne
 	</string>
+	<string name="effect_Rumble">
+		Rumpeln
+	</string>
 	<string name="effect_Sabrina">
 		Sabrina
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		Shorty
 	</string>
+	<string name="effect_Smaller">
+		Kleiner
+	</string>
 	<string name="effect_Sneaky">
 		Hinterhältig
 	</string>
diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml
index a82982f9863..39b3099336a 100644
--- a/indra/newview/skins/default/xui/de/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/de/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="Eigenschaften" name="Properties"/>
 	<menu_item_call label="Umbenennen" name="Rename"/>
 	<menu_item_call label="Asset-UUID kopieren" name="Copy Asset UUID"/>
+	<menu_item_call label="Ausschneiden" name="Cut"/>
 	<menu_item_call label="Kopieren" name="Copy"/>
 	<menu_item_call label="Einfügen" name="Paste"/>
 	<menu_item_call label="Als Link einfügen" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index a870a4c84d2..d011c7295cb 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -21,6 +21,7 @@
 			<menu_item_call label="Beschäftigt" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="L$ kaufen..." name="Buy and Sell L$"/>
+		<menu_item_call label="Händler-Outbox..." name="MerchantOutbox"/>
 		<menu_item_call label="Kontoübersicht..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=de"/>
 		</menu_item_call>
@@ -393,9 +394,16 @@
 		<menu_item_check label="HTTP-Texturen" name="HTTP Textures"/>
 		<menu_item_check label="HTTP-Inventar" name="HTTP Inventory"/>
 		<menu_item_call label="Bilder komprimieren" name="Compress Images"/>
+		<menu_item_call label="Visual Leak Detector aktivieren" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="Ausgabe Fehlerbeseitigung ausgeben" name="Output Debug Minidump"/>
 		<menu_item_check label="Bei nächster Ausführung Fenster öffnen" name="Console Window"/>
-		<menu label="Protokollierungsstufe festlegen" name="Set Logging Level"/>
+		<menu label="Protokollierungsstufe festlegen" name="Set Logging Level">
+			<menu_item_check label="Debug" name="Debug"/>
+			<menu_item_check label="Info" name="Info"/>
+			<menu_item_check label="Warnung" name="Warning"/>
+			<menu_item_check label="Fehler" name="Error"/>
+			<menu_item_check label="Keine" name="None"/>
+		</menu>
 		<menu_item_call label="Admin-Status anfordern" name="Request Admin Options"/>
 		<menu_item_call label="Admin-Status verlassen" name="Leave Admin Options"/>
 		<menu_item_check label="Admin-Menü anzeigen" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index b69bb197c8d..ac068fcd4ea 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -677,7 +677,7 @@ Erwartet wurde [VALIDS]
 		Ausgabedatei konnte nicht erstellt werden: [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		Der Mehrfach-Upload von Animationsdateien wird zurzeit von [APP_NAME] nicht unterstützt.
+		Der Bulk-Upload von BVH-Animationsdateien wird zurzeit von [APP_NAME] nicht unterstützt.
 	</notification>
 	<notification name="CannotUploadReason">
 		Datei [FILE] kann aus folgendem Grund nicht hochgeladen werden: [REASON]
@@ -2644,16 +2644,16 @@ Anfrage gestatten?
 		„&lt;nolink&gt;[TITLE]&lt;/nolink&gt;“ von [NAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Blockieren"/>
-			<button name="Ignore" text="Ignorieren"/>
+			<button name="Client_Side_Mute" text="Blockieren"/>
+			<button name="Client_Side_Ignore" text="Ignorieren"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		„&lt;nolink&gt;[TITLE]&lt;/nolink&gt;“ von [GROUPNAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Blockieren"/>
-			<button name="Ignore" text="Ignorieren"/>
+			<button name="Client_Side_Mute" text="Blockieren"/>
+			<button name="Client_Side_Ignore" text="Ignorieren"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/de/panel_nearby_chat.xml b/indra/newview/skins/default/xui/de/panel_nearby_chat.xml
index 2068c390243..07ad761791c 100644
--- a/indra/newview/skins/default/xui/de/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/de/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Chat übersetzen" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="Chat übersetzen" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
index 4fc397e7d27..18aad64f964 100644
--- a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
@@ -14,9 +14,9 @@
 					<text name="inbox_fresh_new_count">
 						[NUM] neu
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="Artikel zur Verwendung in Ihr Inventar ziehen">
 						<text name="inbox_inventory_placeholder">
-							Einkäufe auf dem Marktplatz werden hierher geliefert.
+							Einkäufe aus dem Marktplatz werden hierher geliefert.
 						</text>
 					</panel>
 				</panel>
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 44296f2619f..d917d33d12e 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -835,6 +835,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="anim_yes_head">
 		Ja
 	</string>
+	<string name="multiple_textures">
+		Mehrfach
+	</string>
 	<string name="texture_loading">
 		Wird geladen...
 	</string>
@@ -1235,7 +1238,7 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		Sie haben keine Kopie dieser Textur in Ihrem Inventar.
 	</string>
 	<string name="InventoryInboxNoItems">
-		Hier erscheinen bestimmte Artikel, die Sie erhalten, wie z. B. Premium-Geschenke. Sie können diese dann in Ihr Inventar ziehen.
+		Einkäufe aus dem Marktplatz erscheinen hier. Sie können diese dann zur Verwendung in Ihr Inventar ziehen.
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3921,6 +3924,9 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_
 	<string name="Saved_message">
 		(Gespeichert am [LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		Wenn Sie diese Meldung sehen, müssen Sie unter „Einstellungen“ &gt; „Privatsphäre“ die Option „Nur IMs und Anrufe von Freunden oder Gruppen durchstellen“ deaktivieren.
+	</string>
 	<string name="answered_call">
 		Ihr Anruf wurde entgegengenommen
 	</string>
diff --git a/indra/newview/skins/default/xui/fr/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/fr/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..e82518ce805
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		Nom :
+	</text>
+	<text name="description_label">
+		Description :
+	</text>
+	<button label="Charger ([AMOUNT] L$)" name="ok_btn"/>
+	<button label="Annuler" label_selected="Annuler" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..84c40b5987f
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		Échec de l&apos;initialisation du mouvement
+	</floater.string>
+	<floater.string name="anim_too_long">
+		La durée du fichier d&apos;animation est de [LENGTH] secondes.
+
+La limite maximale est de [MAX_LENGTH] secondes.
+	</floater.string>
+	<floater.string name="failed_file_read">
+		Impossible de lire le fichier d&apos;animation.
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		Ok
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		Fin prématurée du fichier.
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		Impossible de lire la définition des contraintes.
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		Impossible d&apos;ouvrir le fichier BVH.
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		En-tête HIERARCHY non valide.
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		Impossible de trouver ROOT ou JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		Impossible d&apos;obtenir le nom JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		Impossible de trouver OFFSET.
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		CHANNELS introuvables.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		Impossible d&apos;obtenir l&apos;ordre de rotation.
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		Impossible d&apos;obtenir l&apos;axe de rotation.
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		Impossible de trouver MOTION.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		Impossible d&apos;obtenir le nombre d&apos;images.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		Impossible d&apos;obtenir la durée des images.
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		Impossible d&apos;obtenir les valeurs de position.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		Impossible d&apos;obtenir les valeurs de rotation.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		Impossible d&apos;ouvrir le fichier de traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		Impossible de lire l&apos;en-tête de traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		Impossible de lire les noms de traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		Impossible de lire la valeur ignorant la traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		Impossible de lire la valeur relative de la traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		Impossible de lire la valeur outname de la traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		Impossible de lire la matrice de traduction.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Impossible d&apos;obtenir le nom mergechild.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Impossible d&apos;obtenir le nom mergeparent.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		Impossible d&apos;obtenir la valeur priority.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		Impossible d&apos;obtenir la valeur loop.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		Impossible d&apos;obtenir les valeurs easeIn.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		Impossible d&apos;obtenir les valeurs easeOut.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		Impossible d&apos;obtenir la valeur hand morph.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		Impossible de lire le nom emote.
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		Nom root joint incorrect ; utiliser &quot;hip&quot;.
+	</floater.string>
+	<text name="name_label">
+		Nom :
+	</text>
+	<text name="description_label">
+		Description :
+	</text>
+	<spinner label="Priorité" name="priority" tool_tip="Contrôle quelles autres animations peuvent être remplacées par cette animation."/>
+	<check_box label="Boucle" name="loop_check" tool_tip="Entraîne la lecture en boucle de cette animation."/>
+	<spinner label="Début (%)" name="loop_in_point" tool_tip="Définit le point de l&apos;animation auquel retourne la boucle."/>
+	<spinner label="Fin (%)" name="loop_out_point" tool_tip="Définit le point de l&apos;animation auquel se termine la boucle."/>
+	<text name="hand_label">
+		Pose des mains
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="Contrôle ce que font les mains pendant l&apos;animation.">
+		<combo_box.item label="Écartées" name="Spread"/>
+		<combo_box.item label="Détendues" name="Relaxed"/>
+		<combo_box.item label="Montrer du doigt (les deux)" name="PointBoth"/>
+		<combo_box.item label="Poing" name="Fist"/>
+		<combo_box.item label="Détendue (gauche)" name="RelaxedLeft"/>
+		<combo_box.item label="Montrer du doigt (gauche)" name="PointLeft"/>
+		<combo_box.item label="Poing (gauche)" name="FistLeft"/>
+		<combo_box.item label="Détendue (droite)" name="RelaxedRight"/>
+		<combo_box.item label="Montrer du doigt (droite)" name="PointRight"/>
+		<combo_box.item label="Poing (droite)" name="FistRight"/>
+		<combo_box.item label="Salut (droite)" name="SaluteRight"/>
+		<combo_box.item label="Clavier" name="Typing"/>
+		<combo_box.item label="Paix (droite)" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		Expression
+	</text>
+	<combo_box name="emote_combo" tool_tip="Contrôle ce que fait le visage pendant l&apos;animation.">
+		<item label="(Aucune)" name="[None]" value=""/>
+		<item label="Aaaaah" name="Aaaaah" value="Aaaaah"/>
+		<item label="Effrayé" name="Afraid" value="Effrayé"/>
+		<item label="En colère" name="Angry" value="En colère"/>
+		<item label="Grand sourire" name="BigSmile" value="Grand sourire"/>
+		<item label="Ennui" name="Bored" value="Ennui"/>
+		<item label="Pleurer" name="Cry" value="Pleurer"/>
+		<item label="Mépris" name="Disdain" value="Mépris"/>
+		<item label="Gêne" name="Embarrassed" value="Gêne"/>
+		<item label="Froncer les sourcils" name="Frown" value="Froncer les sourcils"/>
+		<item label="Embrasser" name="Kiss" value="Embrasser"/>
+		<item label="Rire" name="Laugh" value="Rire"/>
+		<item label="Tirer la langue" name="Plllppt" value="Tirer la langue"/>
+		<item label="Dégoût" name="Repulsed" value="Dégoût"/>
+		<item label="Triste" name="Sad" value="Triste"/>
+		<item label="Hausser les épaules" name="Shrug" value="Hausser les épaules"/>
+		<item label="Sourire" name="Smile" value="Sourire"/>
+		<item label="Surprise" name="Surprise" value="Surprise"/>
+		<item label="Clin d&apos;Å“il" name="Wink" value="Clin d&apos;Å“il"/>
+		<item label="Inquiétude" name="Worry" value="Inquiétude"/>
+	</combo_box>
+	<text name="preview_label">
+		Aperçu
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="Permet de tester le comportement de l&apos;animation lorsque votre avatar effectue certaines actions courantes.">
+		<item label="Debout" name="Standing" value="Debout"/>
+		<item label="En marche" name="Walking" value="En marche"/>
+		<item label="Assis" name="Sitting" value="Assis"/>
+		<item label="En vol" name="Flying" value="En vol"/>
+	</combo_box>
+	<spinner label="Transition début (s)" name="ease_in_time" tool_tip="Durée (en secondes) de l&apos;entrée en fondu de l&apos;animation."/>
+	<spinner label="Transition fin (s)" name="ease_out_time" tool_tip="Durée (en secondes) de la sortie en fondu de l&apos;animation."/>
+	<button name="play_btn" tool_tip="Lire l&apos;animation."/>
+	<button name="pause_btn" tool_tip="Suspendre l&apos;animation."/>
+	<button name="stop_btn" tool_tip="Arrêter la lecture de l&apos;animation."/>
+	<text name="bad_animation_text">
+		Impossible de lire le fichier d&apos;animation.
+
+Les fichiers BVH exportés depuis Poser 4 sont recommandés.
+	</text>
+	<button label="Charger ([AMOUNT] L$)" name="ok_btn"/>
+	<button label="Annuler" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_preview_animation.xml b/indra/newview/skins/default/xui/fr/floater_preview_animation.xml
index fdd2ac8beb6..f2cb1d5e70e 100644
--- a/indra/newview/skins/default/xui/fr/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/fr/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		Description :
 	</text>
-	<button label="Exécuter dans Second Life" label_selected="Stop" name="Anim play btn" tool_tip="Lire cette animation de façon à ce que les autres puissent la voir" width="131"/>
-	<button label="Exécuter localement" label_selected="Stop" left="160" name="Anim audition btn" tool_tip="Lire cette animation de façon à ce que vous soyez la seule personne à pouvoir la voir" width="120"/>
+	<button label="Exécuter dans Second Life" label_selected="Arrêter" name="Inworld" tool_tip="Lire cette animation de façon à ce que les autres la voient."/>
+	<button label="Exécuter localement" label_selected="Arrêter" name="Locally" tool_tip="Lire cette animation de façon à ce que vous soyez la seule personne à la voir."/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/fr/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..702170ef524
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="FLOATER TEST"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml
index af5678ff0e7..e21c6f4c08e 100644
--- a/indra/newview/skins/default/xui/fr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/fr/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="OUTILS POUR LA CONSTRUCTION" title="">
+	<floater.string name="grid_screen_text">
+		Écran
+	</floater.string>
+	<floater.string name="grid_local_text">
+		Local
+	</floater.string>
+	<floater.string name="grid_world_text">
+		Monde
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		Référence
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		Élément attaché
+	</floater.string>
 	<floater.string name="status_rotate">
 		Pour faire tourner l&apos;objet, faites glisser les bandes de couleur.
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="true" label="Étirer les textures" name="checkbox stretch textures"/>
 	<check_box initial_value="true" label="Fixer" name="checkbox snap to grid"/>
-	<button label="Options..." label_selected="Options..." name="Options..." tool_tip="Afficher d&apos;autres options de grille"/>
+	<combo_box name="combobox grid mode" tool_tip="Choisir le type d&apos;axe de grille pour le positionnement de l&apos;objet.">
+		<combo_box.item label="Monde" name="World"/>
+		<combo_box.item label="Local" name="Local"/>
+		<combo_box.item label="Référence" name="Reference"/>
+	</combo_box>
+	<button label="" label_selected="Options..." name="Options..." tool_tip="Afficher d&apos;autres options de grille"/>
 	<button label="" label_selected="" name="ToolCube" tool_tip="Cube"/>
 	<button label="" label_selected="" name="ToolPrism" tool_tip="Prisme droit"/>
 	<button label="" label_selected="" name="ToolPyramid" tool_tip="Pyramide"/>
@@ -106,7 +126,7 @@
 		Aucune sélection effectuée.
 	</text>
 	<text name="remaining_capacity">
-		[CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Plus d'infos]
+		[CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Plus d&apos;infos]
 	</text>
 	<tab_container name="Object Info Tabs">
 		<panel label="Général" name="General">
diff --git a/indra/newview/skins/default/xui/fr/floater_voice_effect.xml b/indra/newview/skins/default/xui/fr/floater_voice_effect.xml
index 92ee6ecf24f..671fb5c14db 100644
--- a/indra/newview/skins/default/xui/fr/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/fr/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		Démon
 	</string>
+	<string name="effect_Female Elf">
+		Femme elfe
+	</string>
 	<string name="effect_Flirty">
 		Flirt
 	</string>
 	<string name="effect_Foxy">
 		Séduction
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		Halloween_2010_Bonus
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		Rauque
 	</string>
+	<string name="effect_Husky Whisper">
+		Murmure rauque
+	</string>
 	<string name="effect_Intercom">
 		Interphone
 	</string>
+	<string name="effect_Julia">
+		Julia
+	</string>
+	<string name="effect_Lo Lilt">
+		Mélodieux
+	</string>
 	<string name="effect_Macho">
 		Macho
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		Mini
 	</string>
+	<string name="effect_Model">
+		Modèle
+	</string>
 	<string name="effect_Nano">
 		Nano
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		Roxanne
 	</string>
+	<string name="effect_Rumble">
+		Grondement
+	</string>
 	<string name="effect_Sabrina">
 		Sabrina
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		Petite voix
 	</string>
+	<string name="effect_Smaller">
+		Plus faible
+	</string>
 	<string name="effect_Sneaky">
 		Sournois
 	</string>
diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml
index 4abc74880f1..59dcff90755 100644
--- a/indra/newview/skins/default/xui/fr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="Propriétés" name="Properties"/>
 	<menu_item_call label="Renommer" name="Rename"/>
 	<menu_item_call label="Copier l&apos;UUID (identifiant universel unique)" name="Copy Asset UUID"/>
+	<menu_item_call label="Couper" name="Cut"/>
 	<menu_item_call label="Copier" name="Copy"/>
 	<menu_item_call label="Coller" name="Paste"/>
 	<menu_item_call label="Coller comme lien" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 3ea863131a7..3c3d4f5f694 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -21,6 +21,7 @@
 			<menu_item_call label="Occupé" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="Acheter des L$..." name="Buy and Sell L$"/>
+		<menu_item_call label="Boîte d&apos;envoi vendeur..." name="MerchantOutbox"/>
 		<menu_item_call label="Page d&apos;accueil du compte..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=fr"/>
 		</menu_item_call>
@@ -393,9 +394,16 @@
 		<menu_item_check label="Textures HTTP" name="HTTP Textures"/>
 		<menu_item_check label="Inventaire HTTP" name="HTTP Inventory"/>
 		<menu_item_call label="Compresser les images" name="Compress Images"/>
+		<menu_item_call label="Activer Visual Leak Detector" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="Output Debug Minidump" name="Output Debug Minidump"/>
 		<menu_item_check label="Console Window on next Run" name="Console Window"/>
-		<menu label="Définir le niveau de connexion" name="Set Logging Level"/>
+		<menu label="Définir le niveau de connexion" name="Set Logging Level">
+			<menu_item_check label="Débogage" name="Debug"/>
+			<menu_item_check label="Infos" name="Info"/>
+			<menu_item_check label="Avertissement" name="Warning"/>
+			<menu_item_check label="Erreur" name="Error"/>
+			<menu_item_check label="Aucun" name="None"/>
+		</menu>
 		<menu_item_call label="Demander le statut Admin" name="Request Admin Options"/>
 		<menu_item_call label="Quitter le statut Admin" name="Leave Admin Options"/>
 		<menu_item_check label="Afficher le menu Admin" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index f2dd02a495d..746a4b1d555 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -669,7 +669,7 @@ Assurez-vous que le fichier a l&apos;extension correcte.
 		Impossible de créer le fichier de sortie : [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		Actuellement, [APP_NAME] ne prend pas en charge le chargement de lots de fichiers d&apos;animation.
+		Actuellement, [APP_NAME] ne prend pas en charge le chargement par lot de fichiers d&apos;animation au format BVH.
 	</notification>
 	<notification name="CannotUploadReason">
 		Impossible de charger [FILE] suite au problème suivant : [REASON]
@@ -2630,16 +2630,16 @@ Accepter cette requête ?
 		&lt;nolink&gt;[TITLE]&lt;/nolink&gt; de [NAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Ignorer"/>
-			<button name="Ignore" text="Ignorer"/>
+			<button name="Client_Side_Mute" text="Bloquer"/>
+			<button name="Client_Side_Ignore" text="Ignorer"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		&lt;nolink&gt;[TITLE]&lt;/nolink&gt; de [GROUPNAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Ignorer"/>
-			<button name="Ignore" text="Ignorer"/>
+			<button name="Client_Side_Mute" text="Bloquer"/>
+			<button name="Client_Side_Ignore" text="Ignorer"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml b/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml
index 00bd6e81aed..b02e53269b0 100644
--- a/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Traduire le chat" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="Traduire le chat" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
index cdb15a632df..1b9c8326799 100644
--- a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
@@ -14,7 +14,7 @@
 					<text name="inbox_fresh_new_count">
 						[NUM] nouv.
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="Glisser-déposer des articles dans votre inventaire pour les utiliser.">
 						<text name="inbox_inventory_placeholder">
 							Ici seront livrés les achats effectués sur la Place du marché.
 						</text>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index a0c542d5249..3eebed450f6 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -835,6 +835,9 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="anim_yes_head">
 		Oui
 	</string>
+	<string name="multiple_textures">
+		Multiples
+	</string>
 	<string name="texture_loading">
 		Chargement...
 	</string>
@@ -1235,7 +1238,7 @@ Veuillez réessayer de vous connecter dans une minute.
 		Vous n&apos;avez pas de copie de cette texture dans votre inventaire
 	</string>
 	<string name="InventoryInboxNoItems">
-		Certains articles reçus, tels que les cadeaux Premium, s&apos;afficheront ici. Vous pourrez alors les faire glisser vers votre inventaire.
+		Les achats que vous avez effectués sur la Place du marché s&apos;affichent ici. Vous pouvez alors les faire glisser vers votre inventaire afin de les utiliser.
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3921,6 +3924,9 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 	<string name="Saved_message">
 		(Enregistrement : [LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		Pour afficher ce message, vous devez désactiver la case Seuls mes amis et groupes peuvent m&apos;appeler ou m&apos;envoyer un IM, sous Préférences/Confidentialité.
+	</string>
 	<string name="answered_call">
 		Votre appel a fait l&apos;objet d&apos;une réponse
 	</string>
diff --git a/indra/newview/skins/default/xui/it/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/it/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..a2bce001417
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		Nome:
+	</text>
+	<text name="description_label">
+		Descrizione:
+	</text>
+	<button label="Carica ([AMOUNT] L$)" name="ok_btn"/>
+	<button label="Annulla" label_selected="Annulla" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/it/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..a4319f2e77e
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		Movimento non inizializzato
+	</floater.string>
+	<floater.string name="anim_too_long">
+		La lunghezza del file di animazione è di [LENGTH] secondi.
+
+La lunghezza massima dell&apos;animazione è [MAX_LENGTH] secondi.
+	</floater.string>
+	<floater.string name="failed_file_read">
+		Impossibile leggere il file di animazione.
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		Ok
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		Fine prematura del file.
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		Impossibile leggere la definizione del vincolo.
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		Impossibile aprire il file BVH.
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		Intestazione HIERARCHY non valida.
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		Impossibile trovare la ROOT o JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		Impossibile trovare il nome JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		Impossibile trovare OFFSET.
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		Impossibile trovare CHANNELS.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		Impossibile ottenere un ordine di rotazione.
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		Rotazione dell&apos;asse non disponibile.
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		Impossibile trovare MOTION.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		Impossibile ottenere il numero dei frame.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		Impossibile ottenere il tempo del frame.
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		Impossibile ottenere i valori della posizione.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		Impossibile ottenere i valori di rotazione.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		Impossibile aprire il file di traduzione.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		Impossibile leggere l&apos;intestazione della traduzione.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		Impossibile leggere i nomi della traduzione.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		Impossibile leggere la traduzione, ignora il valore.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		Impossibile leggere la traduzione del valore relativo.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		Valore non trovato.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		Impossibile leggere la matrice di traduzione.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Impossibile trovare il nome mergechild.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Impossibile ottenere il nome mergeparent.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		Impossibile ottenere il valore di priorità.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		Impossibile ottenere il valore di ripetizione.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		Impossibile ottenere i valori easeIn.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		Cannot get ease Out values.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		Impossibile ottenere il valore morph della mano.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		Impossibile leggere il nome emote.
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		Nome non corretto del root joint, usa &quot;hip&quot;.
+	</floater.string>
+	<text name="name_label">
+		Nome:
+	</text>
+	<text name="description_label">
+		Descrizione:
+	</text>
+	<spinner label="Priorità" name="priority" tool_tip="Definisce quali altre animazioni possono essere sostituite da questa animazione"/>
+	<check_box label="Ripetizione" name="loop_check" tool_tip="Riproduce questa animazione in ripetizione"/>
+	<spinner label="Dentro(%)" name="loop_in_point" tool_tip="Imposta il punto sul quale ritorna l&apos;animazione"/>
+	<spinner label="Fuori(%)" name="loop_out_point" tool_tip="Imposta il punto sul quale termina l&apos;animazione"/>
+	<text name="hand_label">
+		Posa delle mani
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="Definisce ciò che fanno le mani durante l&apos;animazione">
+		<combo_box.item label="Estese" name="Spread"/>
+		<combo_box.item label="Rilassate" name="Relaxed"/>
+		<combo_box.item label="Indicano entrambe" name="PointBoth"/>
+		<combo_box.item label="Pugno" name="Fist"/>
+		<combo_box.item label="Sinistra rilassata" name="RelaxedLeft"/>
+		<combo_box.item label="Indica sinistra" name="PointLeft"/>
+		<combo_box.item label="Pugno con la sinistra" name="FistLeft"/>
+		<combo_box.item label="Destra rilassata" name="RelaxedRight"/>
+		<combo_box.item label="Indica destra" name="PointRight"/>
+		<combo_box.item label="Pugno destro" name="FistRight"/>
+		<combo_box.item label="Saluta a destra" name="SaluteRight"/>
+		<combo_box.item label="Battitura" name="Typing"/>
+		<combo_box.item label="Pace a destra" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		Espressione
+	</text>
+	<combo_box name="emote_combo" tool_tip="Definisce ciò che fa il viso durante l&apos;animazione">
+		<item label="(Nulla)" name="[None]" value=""/>
+		<item label="Aaaaah" name="Aaaaah" value="Aaaaah"/>
+		<item label="Spavento" name="Afraid" value="Spavento"/>
+		<item label="Arrabbiato" name="Angry" value="Arrabbiato"/>
+		<item label="Grande sorriso" name="BigSmile" value="Grande sorriso"/>
+		<item label="Annoiato" name="Bored" value="Annoiato"/>
+		<item label="Pianto" name="Cry" value="Pianto"/>
+		<item label="Disdegno" name="Disdain" value="Disdegno"/>
+		<item label="Imbarazzato" name="Embarrassed" value="Imbarazzato"/>
+		<item label="Accigliato" name="Frown" value="Accigliato"/>
+		<item label="Bacio" name="Kiss" value="Bacio"/>
+		<item label="Risata" name="Laugh" value="Risata"/>
+		<item label="Linguaccia" name="Plllppt" value="Linguaccia"/>
+		<item label="Repulsione" name="Repulsed" value="Repulsione"/>
+		<item label="Triste" name="Sad" value="Triste"/>
+		<item label="Scrollata di spalle" name="Shrug" value="Scrollata di spalle"/>
+		<item label="Sorriso" name="Smile" value="Sorriso"/>
+		<item label="Stupore" name="Surprise" value="Stupore"/>
+		<item label="Occhiolino" name="Wink" value="Occhiolino"/>
+		<item label="Preoccupato" name="Worry" value="Preoccupato"/>
+	</combo_box>
+	<text name="preview_label">
+		Anteprima mentre
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="Prova il comportamento dell&apos;animazione mentre l&apos;avatar esegue attività comuni.">
+		<item label="In piedi" name="Standing" value="In piedi"/>
+		<item label="Camminare" name="Walking" value="Camminare"/>
+		<item label="Seduto" name="Sitting" value="Seduto"/>
+		<item label="Volare" name="Flying" value="Volare"/>
+	</combo_box>
+	<spinner label="Transizione in ingresso (sec)" name="ease_in_time" tool_tip="Durata (in secondi) della fusione in entrata delle animazioni"/>
+	<spinner label="Transizione in uscita (sec)" name="ease_out_time" tool_tip="Durata (in secondi) della fusione in uscita delle animazioni"/>
+	<button name="play_btn" tool_tip="Riproduci la tua animazione"/>
+	<button name="pause_btn" tool_tip="Metti in pausa la tua animazione"/>
+	<button name="stop_btn" tool_tip="Interrompi la riproduzione dell&apos;animazione"/>
+	<text name="bad_animation_text">
+		Impossibile leggere il file di animazione.
+
+Consigliamo file BVH esportati da Poser 4.
+	</text>
+	<button label="Carica ([AMOUNT] L$)" name="ok_btn"/>
+	<button label="Annulla" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_preview_animation.xml b/indra/newview/skins/default/xui/it/floater_preview_animation.xml
index 73082c95268..ed609c70fa2 100644
--- a/indra/newview/skins/default/xui/it/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/it/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		Descrizione:
 	</text>
-	<button label="Riproduci in Second Life" label_selected="Ferma" left="20" name="Anim play btn" tool_tip="Riproduci questa animazione così che gli altri possano vederla" width="131"/>
-	<button label="Esegui localmente" label_selected="Ferma" left="162" name="Anim audition btn" tool_tip="Riproduci questa animazione così che solo tu possa vederla" width="125"/>
+	<button label="Riproduci in Second Life" label_selected="Ferma" name="Inworld" tool_tip="Riproduci questa animazione così che gli altri possano vederla"/>
+	<button label="Riproduci localmente" label_selected="Ferma" name="Locally" tool_tip="Riproduci questa animazione così che solo tu possa vederla"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/it/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/it/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..23da6f7588f
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="FINESTRA DI TEST"/>
diff --git a/indra/newview/skins/default/xui/it/floater_tools.xml b/indra/newview/skins/default/xui/it/floater_tools.xml
index 0d981e2424e..c963ac72e6a 100644
--- a/indra/newview/skins/default/xui/it/floater_tools.xml
+++ b/indra/newview/skins/default/xui/it/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="STRUMENTI PER COSTRUZIONE">
+	<floater.string name="grid_screen_text">
+		Schermo
+	</floater.string>
+	<floater.string name="grid_local_text">
+		Locale
+	</floater.string>
+	<floater.string name="grid_world_text">
+		Mondo
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		Riferimento
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		Allegato
+	</floater.string>
 	<floater.string name="status_rotate">
 		Sposta le fasce colorate per ruotare l&apos;oggetto
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="true" label="Ridimensiona le texture" name="checkbox stretch textures"/>
 	<check_box initial_value="true" label="Scatto" name="checkbox snap to grid"/>
-	<button label="Opzioni..." label_selected="Opzioni..." name="Options..." tool_tip="Vedi più opzioni della griglia"/>
+	<combo_box name="combobox grid mode" tool_tip="Scegli il tipo di righello per posizionare l&apos;oggetto">
+		<combo_box.item label="Mondo" name="World"/>
+		<combo_box.item label="Locale" name="Local"/>
+		<combo_box.item label="Riferimento" name="Reference"/>
+	</combo_box>
+	<button label="" label_selected="Opzioni..." name="Options..." tool_tip="Vedi più opzioni della griglia"/>
 	<button label="" label_selected="" name="ToolCube" tool_tip="Cubo"/>
 	<button label="" label_selected="" name="ToolPrism" tool_tip="Prisma"/>
 	<button label="" label_selected="" name="ToolPyramid" tool_tip="Piramide"/>
diff --git a/indra/newview/skins/default/xui/it/floater_voice_effect.xml b/indra/newview/skins/default/xui/it/floater_voice_effect.xml
index a0e49525ea6..c83b11f698a 100644
--- a/indra/newview/skins/default/xui/it/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/it/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		Demonio
 	</string>
+	<string name="effect_Female Elf">
+		Elfo donna
+	</string>
 	<string name="effect_Flirty">
 		Civettuolo
 	</string>
 	<string name="effect_Foxy">
 		Scaltro
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		Halloween_2010_Bonus
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		Fusto
 	</string>
+	<string name="effect_Husky Whisper">
+		Sospiro rauco
+	</string>
 	<string name="effect_Intercom">
 		Interfono
 	</string>
+	<string name="effect_Julia">
+		Julia
+	</string>
+	<string name="effect_Lo Lilt">
+		Inflessione bassa
+	</string>
 	<string name="effect_Macho">
 		Macho
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		Mini
 	</string>
+	<string name="effect_Model">
+		Modella
+	</string>
 	<string name="effect_Nano">
 		Nano
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		Rosanna
 	</string>
+	<string name="effect_Rumble">
+		Rombo
+	</string>
 	<string name="effect_Sabrina">
 		Sabrina
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		Bassotto
 	</string>
+	<string name="effect_Smaller">
+		Più piccolo
+	</string>
 	<string name="effect_Sneaky">
 		Vile
 	</string>
diff --git a/indra/newview/skins/default/xui/it/menu_inventory.xml b/indra/newview/skins/default/xui/it/menu_inventory.xml
index fc3a82a959f..4bf6be82fd8 100644
--- a/indra/newview/skins/default/xui/it/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/it/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="Proprietà" name="Properties"/>
 	<menu_item_call label="Rinomina" name="Rename"/>
 	<menu_item_call label="Copia UUID dell&apos;oggetto" name="Copy Asset UUID"/>
+	<menu_item_call label="Taglia" name="Cut"/>
 	<menu_item_call label="Copia" name="Copy"/>
 	<menu_item_call label="Incolla" name="Paste"/>
 	<menu_item_call label="Incolla come link" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index dee1634a1b9..99b7e3c4e6b 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -21,6 +21,7 @@
 			<menu_item_call label="Non disponibile" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="Acquista L$..." name="Buy and Sell L$"/>
+		<menu_item_call label="Casella venditore in uscita..." name="MerchantOutbox"/>
 		<menu_item_call label="Dashboard dell&apos;account..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=it"/>
 		</menu_item_call>
@@ -334,8 +335,15 @@
 		</menu>
 		<menu_item_check label="Texture HTTP" name="HTTP Textures"/>
 		<menu_item_check label="Inventario HTTP" name="HTTP Inventory"/>
+		<menu_item_call label="Attiva Visual Leak Detector" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="Finestra Console al prossimo lancio" name="Console Window"/>
-		<menu label="Imposta livello di registrazione" name="Set Logging Level"/>
+		<menu label="Imposta livello di registrazione" name="Set Logging Level">
+			<menu_item_check label="Debug" name="Debug"/>
+			<menu_item_check label="Informazioni" name="Info"/>
+			<menu_item_check label="Attenzione" name="Warning"/>
+			<menu_item_check label="Errore" name="Error"/>
+			<menu_item_check label="Nessuno" name="None"/>
+		</menu>
 		<menu_item_call label="Richiedi diritti Admin" name="Request Admin Options"/>
 		<menu_item_call label="Lascia stato Admin" name="Leave Admin Options"/>
 		<menu_item_check label="Mostra menu Admin" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index 24e8fd6274e..0e6fee60d16 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -668,7 +668,7 @@ Attese [VALIDS]
 		Impossibile creare il file in uscita: [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		[APP_NAME] non supporta ancora il caricamento in blocco di file di animazione.
+		[APP_NAME] non supporta ancora il caricamento in blocco di file di animazione in formato BVH.
 	</notification>
 	<notification name="CannotUploadReason">
 		Impossibile importare il file [FILE] a causa del seguente motivo: [REASON]
@@ -2632,16 +2632,16 @@ Concedi questa richiesta?
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; di [NAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Blocca"/>
-			<button name="Ignore" text="Ignora"/>
+			<button name="Client_Side_Mute" text="Blocca"/>
+			<button name="Client_Side_Ignore" text="Ignora"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; di [GROUPNAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Blocca"/>
-			<button name="Ignore" text="Ignora"/>
+			<button name="Client_Side_Mute" text="Blocca"/>
+			<button name="Client_Side_Ignore" text="Ignora"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/it/panel_nearby_chat.xml b/indra/newview/skins/default/xui/it/panel_nearby_chat.xml
index 1b529e2737c..d46a15c7356 100644
--- a/indra/newview/skins/default/xui/it/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/it/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Traduci chat" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="Traduci chat" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
index f5c00f432b5..5ac0961bd75 100644
--- a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
@@ -14,7 +14,7 @@
 					<text name="inbox_fresh_new_count">
 						[NUM] nuovi
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="Trascina gli elementi nell&apos;inventario per usarli">
 						<text name="inbox_inventory_placeholder">
 							Gli acquisti dal mercato verranno consegnati qui.
 						</text>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 29bfab5f0d7..8529fadd7de 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -829,6 +829,9 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="anim_yes_head">
 		Si
 	</string>
+	<string name="multiple_textures">
+		Multiple
+	</string>
 	<string name="texture_loading">
 		Caricamento in corso...
 	</string>
@@ -1226,7 +1229,7 @@ Prova ad accedere nuovamente tra un minuto.
 		Non hai una copia di questa texture nel tuo inventario
 	</string>
 	<string name="InventoryInboxNoItems">
-		Alcuni elementi che riceverai, come ad esempio gli omaggi per l&apos;abbonamento Premium, verranno mostrati qui.  Potrai quindi trascinarli nel tuo inventario.
+		Gli acquissti dal mercato verranno mostrati qui. Potrai quindi trascinarli nel tuo inventario per usarli.
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3843,6 +3846,9 @@ Se il messaggio persiste, contatta [SUPPORT_SITE].
 	<string name="Saved_message">
 		(Salvato [LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		Per vedere questo messaggio, devi deselezionare &apos;Solo amici e gruppi possono chiamarmi o mandarmi IM&apos; in Preferenze/Privacy.
+	</string>
 	<string name="answered_call">
 		Risposto alla chiamata
 	</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/ja/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..2bada303ae0
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		名前:
+	</text>
+	<text name="description_label">
+		説明:
+	</text>
+	<button label="アップロード(L$[AMOUNT])" name="ok_btn"/>
+	<button label="取り消し" label_selected="取り消し" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/ja/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..f74bab35989
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		動きを初期化できませんでした
+	</floater.string>
+	<floater.string name="anim_too_long">
+		アニメーションファイルの長さは [LENGTH] 秒です。
+
+アニメーションの最大長は [MAX_LENGTH] 秒です。
+	</floater.string>
+	<floater.string name="failed_file_read">
+		アニメーションファイルを読み取れません。
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		Ok
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		ファイルの終端が不完全です。
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		制約定義を読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		BVH ファイルを開けません。
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		HIERARCHY ヘッダーが無効です。
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		ROOT または JOINT が見つかりません。
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		JOINT 名を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		OFFSET が見つかりません。
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		CHANNELS が見つかりません。
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		回転順序を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		回転軸を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		MOTION が見つかりません。
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		フレーム数を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		フレーム時間を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		位置の値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		回転値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		変換ファイルを開けません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		変換ヘッダーを読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		変換名を読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		変換無視値を読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		変換相対値を読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		変換 outname 値を読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		変換行列を読み取れません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Mergechild 名を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Mergeparent 名を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		priority 値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		loop 値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		easeln 値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		easeOut 値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		Hand morph 値を取得できません。
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		emote 名を読みとれません。
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		ルートジョイント名が不正です。「hip」を使用してください。
+	</floater.string>
+	<text name="name_label">
+		名前:
+	</text>
+	<text name="description_label">
+		説明:
+	</text>
+	<spinner label="優先度" name="priority" tool_tip="このアニメーションでどのアニメーションを上書きできるかを決めます"/>
+	<check_box label="ループ" name="loop_check" tool_tip="このアニメーションをループ再生にします"/>
+	<spinner label="イン(%)" name="loop_in_point" tool_tip="アニメーションのループ復帰点を設定します"/>
+	<spinner label="アウト(%)" name="loop_out_point" tool_tip="アニメーションのループ終了点を設定します"/>
+	<text name="hand_label">
+		手のポーズ
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="アニメーション再生中の手の動きを決めます">
+		<combo_box.item label="広げる" name="Spread"/>
+		<combo_box.item label="リラックス" name="Relaxed"/>
+		<combo_box.item label="指を指す・両手" name="PointBoth"/>
+		<combo_box.item label="拳" name="Fist"/>
+		<combo_box.item label="リラックス・左" name="RelaxedLeft"/>
+		<combo_box.item label="指を指す・左" name="PointLeft"/>
+		<combo_box.item label="拳を上げる・左" name="FistLeft"/>
+		<combo_box.item label="リラックス・右" name="RelaxedRight"/>
+		<combo_box.item label="指を指す・右" name="PointRight"/>
+		<combo_box.item label="拳を上げる・右" name="FistRight"/>
+		<combo_box.item label="敬礼・右" name="SaluteRight"/>
+		<combo_box.item label="タイピング" name="Typing"/>
+		<combo_box.item label="ピース・右" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		表情
+	</text>
+	<combo_box name="emote_combo" tool_tip="アニメーション再生中の顔の表情を決めます">
+		<item label="(なし)" name="[None]" value=""/>
+		<item label="アーーーーー" name="Aaaaah" value="アーーーーー"/>
+		<item label="恐れる" name="Afraid" value="恐れる"/>
+		<item label="怒る" name="Angry" value="怒る"/>
+		<item label="満面の笑み" name="BigSmile" value="満面の笑み"/>
+		<item label="退屈" name="Bored" value="退屈"/>
+		<item label="泣く" name="Cry" value="泣く"/>
+		<item label="軽蔑" name="Disdain" value="軽蔑"/>
+		<item label="恥ずかしがる" name="Embarrassed" value="恥ずかしがる"/>
+		<item label="しかめっ面" name="Frown" value="しかめっ面"/>
+		<item label="キス" name="Kiss" value="キス"/>
+		<item label="笑う" name="Laugh" value="笑う"/>
+		<item label="むかつく" name="Plllppt" value="むかつく"/>
+		<item label="嫌悪感" name="Repulsed" value="嫌悪感"/>
+		<item label="悲しい" name="Sad" value="悲しい"/>
+		<item label="肩をすくめる" name="Shrug" value="肩をすくめる"/>
+		<item label="微笑む" name="Smile" value="微笑む"/>
+		<item label="驚く" name="Surprise" value="驚く"/>
+		<item label="ウィンク" name="Wink" value="ウィンク"/>
+		<item label="心配する" name="Worry" value="心配する"/>
+	</combo_box>
+	<text name="preview_label">
+		プレビュー中の動作
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="これを使用して、アバターが一般的なアクションを実行している間にアニメーションの動作をテストします。">
+		<item label="立つ" name="Standing" value="立つ"/>
+		<item label="歩く" name="Walking" value="歩く"/>
+		<item label="座る" name="Sitting" value="座る"/>
+		<item label="飛ぶ" name="Flying" value="飛ぶ"/>
+	</combo_box>
+	<spinner label="イーズイン(秒)" name="ease_in_time" tool_tip="アニメーションのブレンドイン時間(秒)"/>
+	<spinner label="イーズアウト(秒)" name="ease_out_time" tool_tip="アニメーションのブレンドアウト時間(秒)"/>
+	<button name="play_btn" tool_tip="アニメーションを再生する"/>
+	<button name="pause_btn" tool_tip="アニメーションを一時停止する"/>
+	<button name="stop_btn" tool_tip="アニメーションの再生を停止する"/>
+	<text name="bad_animation_text">
+		アニメーションファイルを読み取れません。
+
+Poser 4 からエクスポートした BVH ファイルをお勧めします。
+	</text>
+	<button label="アップロード(L$[AMOUNT])" name="ok_btn"/>
+	<button label="取り消し" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_preview_animation.xml b/indra/newview/skins/default/xui/ja/floater_preview_animation.xml
index 4fc59e16d33..a3042f66ea3 100644
--- a/indra/newview/skins/default/xui/ja/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/ja/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		説明:
 	</text>
-	<button label="インワールドで再生" label_selected="停止" name="Anim play btn" tool_tip="他人にも見えるように再生します"/>
-	<button label="ローカル再生" label_selected="停止" name="Anim audition btn" tool_tip="自分だけが見えるように再生します"/>
+	<button label="インワールドで再生" label_selected="停止" name="Inworld" tool_tip="他人に見えるように再生"/>
+	<button label="ローカル再生" label_selected="停止" name="Locally" tool_tip="自分だけが見えるように再生"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/ja/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..40fd8e9f93f
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="テスト用ウィンドウ"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml
index 8eddf55a44b..2d12a5e56a4 100644
--- a/indra/newview/skins/default/xui/ja/floater_tools.xml
+++ b/indra/newview/skins/default/xui/ja/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="制作ツール" title="">
+	<floater.string name="grid_screen_text">
+		画面
+	</floater.string>
+	<floater.string name="grid_local_text">
+		ローカル
+	</floater.string>
+	<floater.string name="grid_world_text">
+		世界
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		リファレンス
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		アタッチメント
+	</floater.string>
 	<floater.string name="status_rotate">
 		色の付いたバンドをドラッグしてオブジェクトを回転
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="true" label="テクスチャを引き延ばす" name="checkbox stretch textures"/>
 	<check_box initial_value="true" label="スナップ" name="checkbox snap to grid"/>
-	<button label="オプション..." label_selected="オプション" name="Options..." tool_tip="グリッドオプションを表示します"/>
+	<combo_box name="combobox grid mode" tool_tip="オブジェクトの配置に使うグリッドルーラの種類を選択">
+		<combo_box.item label="世界" name="World"/>
+		<combo_box.item label="ローカル" name="Local"/>
+		<combo_box.item label="リファレンス" name="Reference"/>
+	</combo_box>
+	<button label="" label_selected="オプション" name="Options..." tool_tip="グリッドオプションを表示します"/>
 	<button label="" label_selected="" name="ToolCube" tool_tip="キューブ"/>
 	<button label="" label_selected="" name="ToolPrism" tool_tip="プリズム"/>
 	<button label="" label_selected="" name="ToolPyramid" tool_tip="ピラミッド"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_voice_effect.xml b/indra/newview/skins/default/xui/ja/floater_voice_effect.xml
index 801b7a9db09..ee675e143b0 100644
--- a/indra/newview/skins/default/xui/ja/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/ja/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		デーモン
 	</string>
+	<string name="effect_Female Elf">
+		女性のエルフ
+	</string>
 	<string name="effect_Flirty">
 		気のありそうな
 	</string>
 	<string name="effect_Foxy">
 		魅惑的
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		ハロウィン_2010_ボーナス
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		ハスキー
 	</string>
+	<string name="effect_Husky Whisper">
+		スモーキーウィスパー
+	</string>
 	<string name="effect_Intercom">
 		インターホン
 	</string>
+	<string name="effect_Julia">
+		ジュリア
+	</string>
+	<string name="effect_Lo Lilt">
+		軽快
+	</string>
 	<string name="effect_Macho">
 		マッチョ
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		ミニ
 	</string>
+	<string name="effect_Model">
+		モデル
+	</string>
 	<string name="effect_Nano">
 		ナノ
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		ロクサン
 	</string>
+	<string name="effect_Rumble">
+		ランブル
+	</string>
 	<string name="effect_Sabrina">
 		サブリナ
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		チビ
 	</string>
+	<string name="effect_Smaller">
+		小さめ
+	</string>
 	<string name="effect_Sneaky">
 		コソコソ
 	</string>
diff --git a/indra/newview/skins/default/xui/ja/menu_inventory.xml b/indra/newview/skins/default/xui/ja/menu_inventory.xml
index a59f5659c45..d1893a0fc86 100644
--- a/indra/newview/skins/default/xui/ja/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="プロパティ" name="Properties"/>
 	<menu_item_call label="名前を変更する" name="Rename"/>
 	<menu_item_call label="UUID をコピーする" name="Copy Asset UUID"/>
+	<menu_item_call label="カット" name="Cut"/>
 	<menu_item_call label="コピー" name="Copy"/>
 	<menu_item_call label="貼り付け" name="Paste"/>
 	<menu_item_call label="リンクを貼り付ける" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 875d08491ca..8496dfb1dbf 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <menu_bar name="Main Menu">
 	<menu label="ミー" name="Me">
 		<menu_item_call label="プロフィール..." name="Profile"/>
@@ -21,6 +21,7 @@
 			<menu_item_call label="取り込み中" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="L$ の購入..." name="Buy and Sell L$"/>
+		<menu_item_call label="マーチャントアウトボックス..." name="MerchantOutbox"/>
 		<menu_item_call label="マイアカウント..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=ja"/>
 		</menu_item_call>
@@ -393,9 +394,16 @@
 		<menu_item_check label="HTTP Texture" name="HTTP Textures"/>
 		<menu_item_check label="HTTP インベントリ" name="HTTP Inventory"/>
 		<menu_item_call label="圧縮画像" name="Compress Images"/>
+		<menu_item_call label="Visual Leak Detector を有効にする" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="デバッグ用のミニダンプを出力する" name="Output Debug Minidump"/>
 		<menu_item_check label="次回の起動時にコンソールウィンドウを表示する" name="Console Window"/>
-		<menu label="ログレベルを設定" name="Set Logging Level"/>
+		<menu label="ログレベルを設定" name="Set Logging Level">
+			<menu_item_check label="デバッグ" name="Debug"/>
+			<menu_item_check label="情報" name="Info"/>
+			<menu_item_check label="警告" name="Warning"/>
+			<menu_item_check label="エラー" name="Error"/>
+			<menu_item_check label="なし" name="None"/>
+		</menu>
 		<menu_item_call label="管理者ステータスの呼び出し" name="Request Admin Options"/>
 		<menu_item_call label="管理者ステータス解除" name="Leave Admin Options"/>
 		<menu_item_check label="管理者メニューを表示する" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 1219d0872b6..54031ccf124 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <notifications>
 	<global name="skipnexttime">
 		今後は表示しない
@@ -693,7 +693,7 @@ L$ が不足しているのでこのグループに参加することができ
 		出力ファイルを作成できません: [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		現在 [APP_NAME] では、アニメーションの一括アップロードはサポートされていません。
+		現在 [APP_NAME] では、BVH 形式のアニメーションファイルの一括アップロードはサポートされていません。
 	</notification>
 	<notification name="CannotUploadReason">
 		次の理由で、「 [FILE] 」をアップロードできません: [REASON]
@@ -2679,16 +2679,16 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		[NAME] の「&lt;nolink&gt;[TITLE]&lt;/nolink&gt;」
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="ブロック"/>
-			<button name="Ignore" text="無視する"/>
+			<button name="Client_Side_Mute" text="ブロック"/>
+			<button name="Client_Side_Ignore" text="無視"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		[GROUPNAME] の「&lt;nolink&gt;[TITLE]&lt;/nolink&gt;」
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="ブロック"/>
-			<button name="Ignore" text="無視する"/>
+			<button name="Client_Side_Mute" text="ブロック"/>
+			<button name="Client_Side_Ignore" text="無視"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml b/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml
index aca055bb438..4048b48d3a5 100644
--- a/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="チャットを翻訳" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="チャットを翻訳" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
index fad4f20ed9b..51d6d48f90a 100644
--- a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="もの" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
@@ -14,7 +14,7 @@
 					<text name="inbox_fresh_new_count">
 						[NUM] 個の新アイテム
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="アイテムを使用するには、そのアイテムをインベントリにドラッグアンドドロップ">
 						<text name="inbox_inventory_placeholder">
 							マーケットプレイスから購入した商品はここに配達されます。
 						</text>
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index 633a7062da7..680ef608909 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <!-- This file contains strings that used to be hardcoded in the source.
      It is only for those strings which do not belong in a floater.
      For example, the strings used in avatar chat bubbles, and strings
@@ -835,6 +835,9 @@ support@secondlife.com にお問い合わせください。
 	<string name="anim_yes_head">
 		頷く
 	</string>
+	<string name="multiple_textures">
+		複数
+	</string>
 	<string name="texture_loading">
 		ローディング...
 	</string>
@@ -1235,7 +1238,7 @@ support@secondlife.com にお問い合わせください。
 		インベントリ内にこのテクスチャのコピーがありません
 	</string>
 	<string name="InventoryInboxNoItems">
-		プレミアムギフトなど、受け取る特定のアイテムはここに表示されます。その後、それらのアイテムを自分のインベントリの中にドラッグできます。
+		マーケットプレイスで購入した商品はここに表示されます。その後、アイテムをインベントリにドラッグすれば、それらのアイテムを使用できます。
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3921,6 +3924,9 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="Saved_message">
 		(保存日時:[LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		このメッセージを表示するには、「環境設定」の「プライバシー」で「フレンドとグループ以外からはコールと IM を受信しない」チェックボックスをオフにします。
+	</string>
 	<string name="answered_call">
 		相手がコールを受けました
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/pt/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..05326d85948
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		Nome:
+	</text>
+	<text name="description_label">
+		Descrição:
+	</text>
+	<button label="Envio (L$[AMOUNT])" name="ok_btn"/>
+	<button label="Cancelar" label_selected="Cancelar" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/pt/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..5cae581045e
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		Falha ao iniciar animação
+	</floater.string>
+	<floater.string name="anim_too_long">
+		O arquivo de animação possui [LENGTH] segundos de duração.
+
+A duração máxima da animação é de [MAX_LENGTH] segundos.
+	</floater.string>
+	<floater.string name="failed_file_read">
+		Não foi possível ler o arquivo de animação.
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		Ok
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		Fim de arquivo prematuro.
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		Impossível ler definição constraint.
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		Impossível abrir arquivo BVH.
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		Invalid HIERARCHY header.
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		RAIZ ou JUNTA não encontrados.
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		Impossível obter nome JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		Impossível localizar OFFSET.
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		Impossível localizar CHANNELS.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		Impossível obter ordem de rotação.
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		Impossível obter eixo de rotação.
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		Impossível localizar MOTION.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		Impossível determinar número de quadros.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		Impossível determinar tempo dos quadros.
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		Impossível definir posicionamento.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		Impossível definir valores da rotação.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		Impossível abrir arquivo de tradução.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		Impossível ler cabeçalho de tradução.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		Impossível ler nomes traduzidos.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		Impossível obter valor traduzido a ignorar.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		Impossível obter valor traduzido relativo.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		Impossível obter valor traduzido.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		Impossível ler matriz de tradução.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Impossível obter nome mergechild.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Impossível obter nome mergeparent.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		Impossível obter valor prioritário.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		Impossível obter valor do loop.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		Impossível obter valor easeIn.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		Impossível obter valor easeOut.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		Impossível obter valor de morph da mão.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		Impossível ler nome do emote.
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		Nome da junta incorreto, use &quot;quadril&quot;.
+	</floater.string>
+	<text name="name_label">
+		Nome:
+	</text>
+	<text name="description_label">
+		Descrição:
+	</text>
+	<spinner label="Prioridade" name="priority" tool_tip="Controla quais animações podem ser interrompidas por esta animação"/>
+	<check_box label="Loop" name="loop_check" tool_tip="Executa esta animação sem parar"/>
+	<spinner label="Dentro(%)" name="loop_in_point" tool_tip="Define o ponto em que a animação em loop reinicia"/>
+	<spinner label="Fora(%)" name="loop_out_point" tool_tip="Define o ponto em que a animação em loop acaba"/>
+	<text name="hand_label">
+		Pose das mãos
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="Controla os gestos das mãos durante a animação">
+		<combo_box.item label="Abrir" name="Spread"/>
+		<combo_box.item label="Relaxado" name="Relaxed"/>
+		<combo_box.item label="Apontar ambas" name="PointBoth"/>
+		<combo_box.item label="Punho" name="Fist"/>
+		<combo_box.item label="E relaxada" name="RelaxedLeft"/>
+		<combo_box.item label="Apontar E" name="PointLeft"/>
+		<combo_box.item label="Punho E" name="FistLeft"/>
+		<combo_box.item label="D relaxada" name="RelaxedRight"/>
+		<combo_box.item label="Apontar D" name="PointRight"/>
+		<combo_box.item label="Punho D" name="FistRight"/>
+		<combo_box.item label="Saudação D" name="SaluteRight"/>
+		<combo_box.item label="Escrevendo" name="Typing"/>
+		<combo_box.item label="Paz D" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		Expressão
+	</text>
+	<combo_box name="emote_combo" tool_tip="Controla as expressões faciais durante a animação">
+		<item label="(nenhum)" name="[None]" value=""/>
+		<item label="Aaaaah" name="Aaaaah" value="Aaaaah"/>
+		<item label="Com medo" name="Afraid" value="Com medo"/>
+		<item label="Bravo" name="Angry" value="Bravo"/>
+		<item label="Sorriso contagiante" name="BigSmile" value="Sorriso contagiante"/>
+		<item label="À toa" name="Bored" value="À toa"/>
+		<item label="Chorar" name="Cry" value="Chorar"/>
+		<item label="Desdenho" name="Disdain" value="Desdenho"/>
+		<item label="Com vergonha" name="Embarrassed" value="Com vergonha"/>
+		<item label="Franzir testa" name="Frown" value="Franzir testa"/>
+		<item label="Beijo" name="Kiss" value="Beijo"/>
+		<item label="Rir" name="Laugh" value="Rir"/>
+		<item label="Mostrar a língua" name="Plllppt" value="Mostrar a língua"/>
+		<item label="Asco" name="Repulsed" value="Asco"/>
+		<item label="Triste" name="Sad" value="Triste"/>
+		<item label="Encolher os ombros" name="Shrug" value="Encolher os ombros"/>
+		<item label="Sorriso" name="Smile" value="Sorriso"/>
+		<item label="Surpresa" name="Surprise" value="Surpresa"/>
+		<item label="Piscar" name="Wink" value="Piscar"/>
+		<item label="Preocupado" name="Worry" value="Preocupado"/>
+	</combo_box>
+	<text name="preview_label">
+		Visualizar enquanto
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="Use para testar o comportamento de sua animação enquanto seu avatar executa ações comuns.">
+		<item label="Em pé" name="Standing" value="Em pé"/>
+		<item label="Andar" name="Walking" value="Andar"/>
+		<item label="Sentado" name="Sitting" value="Sentado"/>
+		<item label="Voar" name="Flying" value="Voar"/>
+	</combo_box>
+	<spinner label="Aproximação (seg)" name="ease_in_time" tool_tip="Tempo (em segundos) da transição inicial da animação"/>
+	<spinner label="Afastamento (seg)" name="ease_out_time" tool_tip="Tempo (em segundos) da transição de saída da animação"/>
+	<button name="play_btn" tool_tip="Executar animação"/>
+	<button name="pause_btn" tool_tip="Pausar a animação"/>
+	<button name="stop_btn" tool_tip="Interromper a execução da animação"/>
+	<text name="bad_animation_text">
+		Não foi possível ler o arquivo de animação.
+
+Recomendamos que os arquivos BVH sejam exportados do Poser 4.
+	</text>
+	<button label="Envio (L$[AMOUNT])" name="ok_btn"/>
+	<button label="Cancelar" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_preview_animation.xml b/indra/newview/skins/default/xui/pt/floater_preview_animation.xml
index b650b7945c3..19474d80996 100644
--- a/indra/newview/skins/default/xui/pt/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/pt/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		Descrição:
 	</text>
-	<button label="Tocar inworld" label_selected="Parar" name="Anim play btn" tool_tip="Tocar essa animação de forma que outros possam ver" width="131"/>
-	<button label="Executar localmente" label_selected="Parar" left="162" name="Anim audition btn" tool_tip="Tocar essa animação de forma que apenas você possa ver" width="120"/>
+	<button label="Tocar inworld" label_selected="Parar" name="Inworld" tool_tip="Executar essa animação de forma que outros possam ver"/>
+	<button label="Tocar localmente" label_selected="Parar" name="Locally" tool_tip="Executar animação de forma que apenas você possa ver"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/pt/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..dd282bf1fce
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="JANELA DE TESTE"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_tools.xml b/indra/newview/skins/default/xui/pt/floater_tools.xml
index f35f31f5f7e..4b318336021 100644
--- a/indra/newview/skins/default/xui/pt/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pt/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="BUILD TOOLS" title="">
+	<floater.string name="grid_screen_text">
+		Tela
+	</floater.string>
+	<floater.string name="grid_local_text">
+		Local
+	</floater.string>
+	<floater.string name="grid_world_text">
+		Mundo
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		Referência
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		Anexo
+	</floater.string>
 	<floater.string name="status_rotate">
 		Arrastar as faixas coloridas para girar o objeto
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="true" label="Esticar texturas" name="checkbox stretch textures"/>
 	<check_box initial_value="true" label="Ajustar" name="checkbox snap to grid"/>
-	<button label="Opções..." label_selected="Opções..." name="Options..." tool_tip="Mais opções de grade"/>
+	<combo_box name="combobox grid mode" tool_tip="Selecione o tipo de régua da grade onde o objeto será colocado">
+		<combo_box.item label="Mundo" name="World"/>
+		<combo_box.item label="Local" name="Local"/>
+		<combo_box.item label="Referência" name="Reference"/>
+	</combo_box>
+	<button label="" label_selected="Opções..." name="Options..." tool_tip="Mais opções de grade"/>
 	<button label="" label_selected="" name="ToolCube" tool_tip="Cubo"/>
 	<button label="" label_selected="" name="ToolPrism" tool_tip="Prisma"/>
 	<button label="" label_selected="" name="ToolPyramid" tool_tip="Pirâmide"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_voice_effect.xml b/indra/newview/skins/default/xui/pt/floater_voice_effect.xml
index 4f01600d9fc..b29ca3d699f 100644
--- a/indra/newview/skins/default/xui/pt/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/pt/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		Demônio
 	</string>
+	<string name="effect_Female Elf">
+		Elfa
+	</string>
 	<string name="effect_Flirty">
 		Paquerador
 	</string>
 	<string name="effect_Foxy">
 		Sensual
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		Bônus_Halloween_2010
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		Rouco
 	</string>
+	<string name="effect_Husky Whisper">
+		Sussurro rouco
+	</string>
 	<string name="effect_Intercom">
 		Interfone
 	</string>
+	<string name="effect_Julia">
+		Julia
+	</string>
+	<string name="effect_Lo Lilt">
+		Cantarolado baixo
+	</string>
 	<string name="effect_Macho">
 		Macho
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		Mini
 	</string>
+	<string name="effect_Model">
+		Modelo
+	</string>
 	<string name="effect_Nano">
 		Nano
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		Roxanne
 	</string>
+	<string name="effect_Rumble">
+		Ronco
+	</string>
 	<string name="effect_Sabrina">
 		Sabrina
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		Baixinho
 	</string>
+	<string name="effect_Smaller">
+		Menor
+	</string>
 	<string name="effect_Sneaky">
 		Sorrateiro
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/menu_inventory.xml b/indra/newview/skins/default/xui/pt/menu_inventory.xml
index 24a2f713fdf..09e1fbf72ea 100644
--- a/indra/newview/skins/default/xui/pt/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="Propriedades" name="Properties"/>
 	<menu_item_call label="Renomear" name="Rename"/>
 	<menu_item_call label="Copiar item UUID" name="Copy Asset UUID"/>
+	<menu_item_call label="Cortar" name="Cut"/>
 	<menu_item_call label="Copiar" name="Copy"/>
 	<menu_item_call label="Colar" name="Paste"/>
 	<menu_item_call label="Colar como link" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index 8960ffec813..d7d5d59a332 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -21,6 +21,7 @@
 			<menu_item_call label="Ocupado" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="Comprar L$..." name="Buy and Sell L$"/>
+		<menu_item_call label="Caixa de saída do lojista..." name="MerchantOutbox"/>
 		<menu_item_call label="Painel da conta..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=pt"/>
 		</menu_item_call>
@@ -334,8 +335,15 @@
 		</menu>
 		<menu_item_check label="Texturas HTTP" name="HTTP Textures"/>
 		<menu_item_check label="Inventário HTTP" name="HTTP Inventory"/>
+		<menu_item_call label="Habilitar Visual Leak Detector" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="Console Window on next Run" name="Console Window"/>
-		<menu label="Configurar nível de registro em log" name="Set Logging Level"/>
+		<menu label="Configurar nível de registro em log" name="Set Logging Level">
+			<menu_item_check label="Depurar" name="Debug"/>
+			<menu_item_check label="Info" name="Info"/>
+			<menu_item_check label="Aviso" name="Warning"/>
+			<menu_item_check label="Error" name="Error"/>
+			<menu_item_check label="Nenhum" name="None"/>
+		</menu>
 		<menu_item_call label="Request Admin Status" name="Request Admin Options"/>
 		<menu_item_call label="Sair do modo admin" name="Leave Admin Options"/>
 		<menu_item_check label="Mostrar menu admin" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 20d59aa0f85..3b39c0f92cb 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -664,7 +664,7 @@ Esperada [VALIDS]
 		Incapaz de criar arquivo de saída: [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		O [APP_NAME] ainda não faz o upload de vários arquivos de animação de uma vez.
+		O [APP_NAME] ainda não faz o upload de vários arquivos de animação no formato BVH de uma vez.
 	</notification>
 	<notification name="CannotUploadReason">
 		Incapaz de carregar [FILE] devido ao seguinte motivo: [REASON]
@@ -2612,16 +2612,16 @@ Deseja aceitar?
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [NAME]
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Bloquear"/>
-			<button name="Ignore" text="Ignorar"/>
+			<button name="Client_Side_Mute" text="Bloquear"/>
+			<button name="Client_Side_Ignore" text="Ignorar"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [GROUPNAME]&apos;
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Bloquear"/>
-			<button name="Ignore" text="Ignorar"/>
+			<button name="Client_Side_Mute" text="Bloquear"/>
+			<button name="Client_Side_Ignore" text="Ignorar"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml b/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml
index 15470dc94a1..6828d41deeb 100644
--- a/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Traduzir bate-papo" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="Traduzir bate-papo" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
index 72baf3a5c34..7908ea5f3a4 100644
--- a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
@@ -14,9 +14,9 @@
 					<text name="inbox_fresh_new_count">
 						[NUM] novo(s)
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="Arraste e solte itens para o seu inventário para usá-los">
 						<text name="inbox_inventory_placeholder">
-							Compras do marketplace serão entregues aqui.
+							As compras do marketplace serão entregues aqui.
 						</text>
 					</panel>
 				</panel>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 7fb3b3e6ee5..342a52356b9 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -784,6 +784,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
 	<string name="anim_yes_head">
 		Sim
 	</string>
+	<string name="multiple_textures">
+		Múltiplo
+	</string>
 	<string name="texture_loading">
 		Carregando...
 	</string>
@@ -1181,7 +1184,7 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
 		Você não possui uma cópia desta textura no seu inventário
 	</string>
 	<string name="InventoryInboxNoItems">
-		Alguns itens recebidos, como os brindes premium, aparecerão aqui.  Você pode arrastá-los para o seu inventário.
+		Suas compras do Marketplace aparecerão aqui. Depois, você poderá arrastá-las para seu inventário para usá-las.
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3797,6 +3800,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 	<string name="Saved_message">
 		(Salvo em [LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		Para visualizar esta mensagem, você deve desmarcar &quot;Apenas amigos e grupos podem me ligar ou enviar MIs&quot; em Preferências/Privacidade.
+	</string>
 	<string name="answered_call">
 		Ligação atendida
 	</string>
diff --git a/indra/newview/skins/default/xui/ru/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/ru/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..711afc27172
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		Название:
+	</text>
+	<text name="description_label">
+		Описание:
+	</text>
+	<button label="Передать (L$[AMOUNT])" name="ok_btn"/>
+	<button label="Отмена" label_selected="Отмена" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/ru/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..8ad9d8657a1
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		Невозможно инициализировать движение
+	</floater.string>
+	<floater.string name="anim_too_long">
+		Длина файла анимации: [LENGTH] с.
+
+Максимальная длина анимации: [MAX_LENGTH] с.
+	</floater.string>
+	<floater.string name="failed_file_read">
+		Невозможно прочитать файл анимации.
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		ОК
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		Преждевременный конец файла.
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		Не могу прочитать определение ограничений.
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		Не удалось открыть BVH-файл.
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		Неправильный заголовок HIERARCHY.
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		Не удалось найти ROOT или JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		Не удалось получить имя JOINT.
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		Не удалось найти OFFSET.
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		Не удалось найти CHANNELS.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		Не удалось получить порядок вращения.
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		Не удалось получить оси вращения.
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		Не удалось найти MOTION.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		Не удалось получить количество кадров.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		Не удалось получить время кадра.
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		Не удалось получить значения position.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		Не удалось получить значения rotation.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		Не удалось открыть файл перевода.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		Не удалось прочитать заголовок перевода.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		Не удалось прочитать имена перевода.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		Не удалось прочитать значение перевода ignore.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		Не удалось прочитать значение перевода relative.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		Не удалось прочитать значение перевода outname.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		Не удалось прочитать матрицу перевода.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Не удалось получить имя mergechild.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Не удалось получить имя mergeparent.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		Не удалось получить значение priority.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		Не удалось получить значение loop.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		Не удалось получить значения easeIn.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		Не удалось получить значения easeOut.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		Не удалось получить значение hand morph.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		Не удалось прочитать имя emote.
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		Неверное имя корневого соединения, должно быть «hip».
+	</floater.string>
+	<text name="name_label">
+		Название:
+	</text>
+	<text name="description_label">
+		Описание:
+	</text>
+	<spinner label="Приоритет" name="priority" tool_tip="Управляет тем, как другие анимации могут перекрываться этой"/>
+	<check_box label="Цикл" name="loop_check" tool_tip="Делает анимацию зацикленной"/>
+	<spinner label="Начало(%)" name="loop_in_point" tool_tip="Устанавливает точку возврата цикла"/>
+	<spinner label="Конец(%)" name="loop_out_point" tool_tip="Устанавливает точку конца цикла"/>
+	<text name="hand_label">
+		Положение пальцев
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="Контролирует положение пальцев во время анимации">
+		<combo_box.item label="Разведены" name="Spread"/>
+		<combo_box.item label="Расслаблены" name="Relaxed"/>
+		<combo_box.item label="Указывают" name="PointBoth"/>
+		<combo_box.item label="Сжаты в кулак" name="Fist"/>
+		<combo_box.item label="Левые расслаблены" name="RelaxedLeft"/>
+		<combo_box.item label="Левые указывают" name="PointLeft"/>
+		<combo_box.item label="Левые в кулак" name="FistLeft"/>
+		<combo_box.item label="Правые расслаблены" name="RelaxedRight"/>
+		<combo_box.item label="Правые указывают" name="PointRight"/>
+		<combo_box.item label="Правые в кулак" name="FistRight"/>
+		<combo_box.item label="Правые в приветствии" name="SaluteRight"/>
+		<combo_box.item label="Печатают" name="Typing"/>
+		<combo_box.item label="Правые «V»" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		Выражение лица
+	</text>
+	<combo_box name="emote_combo" tool_tip="Контролирует выражение лица во время анимации">
+		<item label="(нет)" name="[None]" value=""/>
+		<item label="Ааааах" name="Aaaaah" value="Ааааах"/>
+		<item label="Боится" name="Afraid" value="Боится"/>
+		<item label="Злится" name="Angry" value="Злится"/>
+		<item label="Широко улыбается" name="BigSmile" value="Широко улыбается"/>
+		<item label="Скучает" name="Bored" value="Скучает"/>
+		<item label="Плачет" name="Cry" value="Плачет"/>
+		<item label="Презирает" name="Disdain" value="Презирает"/>
+		<item label="Смущается" name="Embarrassed" value="Смущается"/>
+		<item label="Хмурится" name="Frown" value="Хмурится"/>
+		<item label="Целует" name="Kiss" value="Целует"/>
+		<item label="Смеется" name="Laugh" value="Смеется"/>
+		<item label="Дразнится" name="Plllppt" value="Дразнится"/>
+		<item label="Не соглашается" name="Repulsed" value="Не соглашается"/>
+		<item label="Грустит" name="Sad" value="Грустит"/>
+		<item label="Не понимает" name="Shrug" value="Не понимает"/>
+		<item label="Улыбается" name="Smile" value="Улыбается"/>
+		<item label="Удивляется" name="Surprise" value="Удивляется"/>
+		<item label="Подмигивает" name="Wink" value="Подмигивает"/>
+		<item label="Беспокоится" name="Worry" value="Беспокоится"/>
+	</combo_box>
+	<text name="preview_label">
+		Просмотр во время
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="Просмотр вашей анимации во время выполнения аватаром действий.">
+		<item label="Стояние" name="Standing" value="Стояние"/>
+		<item label="Ходьба" name="Walking" value="Ходьба"/>
+		<item label="Сидение" name="Sitting" value="Сидение"/>
+		<item label="Полет" name="Flying" value="Полет"/>
+	</combo_box>
+	<spinner label="Вход (сек.)" name="ease_in_time" tool_tip="Количество времени (в секундах) для входа в стартовое положение"/>
+	<spinner label="Выход (сек.)" name="ease_out_time" tool_tip="Количество времени (в секундах) для выхода из анимации"/>
+	<button name="play_btn" tool_tip="Проиграть анимацию"/>
+	<button name="pause_btn" tool_tip="Приостановить анимацию"/>
+	<button name="stop_btn" tool_tip="Остановить проигрывание анимации"/>
+	<text name="bad_animation_text">
+		Невозможно прочитать файл анимации.
+
+Рекомендуется использовать BVH-файлы, экспортированные из Poser 4.
+	</text>
+	<button label="Передать (L$[AMOUNT])" name="ok_btn"/>
+	<button label="Отмена" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_preview_animation.xml b/indra/newview/skins/default/xui/ru/floater_preview_animation.xml
index a1fabedb85f..22c6bc59015 100644
--- a/indra/newview/skins/default/xui/ru/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/ru/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		Описание:
 	</text>
-	<button label="Проиграть для всех" label_selected="Стоп" name="Anim play btn" tool_tip="Проигрывание этой анимации могут видеть другие участники"/>
-	<button label="Проиграть для себя" label_selected="Стоп" name="Anim audition btn" tool_tip="Проигрывание этой анимации можете видеть только вы"/>
+	<button label="Проиграть для всех" label_selected="Стоп" name="Inworld" tool_tip="Проигрывание этой анимации могут видеть другие участники"/>
+	<button label="Проиграть для себя" label_selected="Стоп" name="Locally" tool_tip="Проигрывание этой анимации можете видеть только вы"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/ru/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..d0bd86160e6
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="ТЕСТИРОВАТЬ ОКНО"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_tools.xml b/indra/newview/skins/default/xui/ru/floater_tools.xml
index eb9083f7fc8..3d7d1198f08 100644
--- a/indra/newview/skins/default/xui/ru/floater_tools.xml
+++ b/indra/newview/skins/default/xui/ru/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="ИНСТРУМЕНТЫ ДЛЯ СТРОИТЕЛЬСТВА">
+	<floater.string name="grid_screen_text">
+		Экран
+	</floater.string>
+	<floater.string name="grid_local_text">
+		Локальная
+	</floater.string>
+	<floater.string name="grid_world_text">
+		Мировая
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		Точка отсчета
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		Присоединение
+	</floater.string>
 	<floater.string name="status_rotate">
 		Перетягивайте цветные полосы для вращения объекта
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="истина" label="Растягивать текстуры" name="checkbox stretch textures"/>
 	<check_box initial_value="истина" label="Привязка" name="checkbox snap to grid"/>
-	<button label="Параметры..." name="Options..." tool_tip="Дополнительные параметры сетки"/>
+	<combo_box name="combobox grid mode" tool_tip="Выберите тип линейки сетки для размещения объекта">
+		<combo_box.item label="Мировая" name="World"/>
+		<combo_box.item label="Локальная" name="Local"/>
+		<combo_box.item label="Точка отсчета" name="Reference"/>
+	</combo_box>
+	<button label="" name="Options..." tool_tip="Дополнительные параметры сетки"/>
 	<button name="ToolCube" tool_tip="Куб"/>
 	<button name="ToolPrism" tool_tip="Призма"/>
 	<button name="ToolPyramid" tool_tip="Пирамида"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_voice_effect.xml b/indra/newview/skins/default/xui/ru/floater_voice_effect.xml
index d4bf615fe45..1eb8a94d7a7 100644
--- a/indra/newview/skins/default/xui/ru/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/ru/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		Demon
 	</string>
+	<string name="effect_Female Elf">
+		Фея
+	</string>
 	<string name="effect_Flirty">
 		Flirty
 	</string>
 	<string name="effect_Foxy">
 		Foxy
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		Бонус_за_Хэллоуин_2010
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		Husky
 	</string>
+	<string name="effect_Husky Whisper">
+		Хриплый шепот
+	</string>
 	<string name="effect_Intercom">
 		Внутренняя связь
 	</string>
+	<string name="effect_Julia">
+		Julia
+	</string>
+	<string name="effect_Lo Lilt">
+		Напев
+	</string>
 	<string name="effect_Macho">
 		Macho
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		Mini
 	</string>
+	<string name="effect_Model">
+		Модель
+	</string>
 	<string name="effect_Nano">
 		Nano
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		Roxanne
 	</string>
+	<string name="effect_Rumble">
+		Урчание
+	</string>
 	<string name="effect_Sabrina">
 		Sabrina
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		Shorty
 	</string>
+	<string name="effect_Smaller">
+		Меньше
+	</string>
 	<string name="effect_Sneaky">
 		Sneaky
 	</string>
diff --git a/indra/newview/skins/default/xui/ru/menu_inventory.xml b/indra/newview/skins/default/xui/ru/menu_inventory.xml
index df5e5329a3e..49f7281b4eb 100644
--- a/indra/newview/skins/default/xui/ru/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="Свойства" name="Properties"/>
 	<menu_item_call label="Переименовать" name="Rename"/>
 	<menu_item_call label="Копировать UUID актива" name="Copy Asset UUID"/>
+	<menu_item_call label="Вырезать" name="Cut"/>
 	<menu_item_call label="Копировать" name="Copy"/>
 	<menu_item_call label="Вставить" name="Paste"/>
 	<menu_item_call label="Вставить как ссылку" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml
index 7698614751e..0699314d971 100644
--- a/indra/newview/skins/default/xui/ru/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml
@@ -21,6 +21,7 @@
 			<menu_item_call label="Не беспокоить" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="Купить L$..." name="Buy and Sell L$"/>
+		<menu_item_call label="Торговые исходящие..." name="MerchantOutbox"/>
 		<menu_item_call label="Информационная панель аккаунта..." name="Manage My Account"/>
 		<menu_item_call label="Настройки..." name="Preferences"/>
 		<menu_item_call label="Кнопки панели инструментов..." name="Toolbars"/>
@@ -391,9 +392,16 @@
 		<menu_item_check label="Текстуры HTTP" name="HTTP Textures"/>
 		<menu_item_check label="Инвентарь HTTP" name="HTTP Inventory"/>
 		<menu_item_call label="Сжатие изображений" name="Compress Images"/>
+		<menu_item_call label="Включить Visual Leak Detector" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="Вывод минидампа при отладке" name="Output Debug Minidump"/>
 		<menu_item_check label="Окно консоли при следующем запуске" name="Console Window"/>
-		<menu label="Уровень журнала" name="Set Logging Level"/>
+		<menu label="Уровень журнала" name="Set Logging Level">
+			<menu_item_check label="Отладка" name="Debug"/>
+			<menu_item_check label="Информация" name="Info"/>
+			<menu_item_check label="Предупреждение" name="Warning"/>
+			<menu_item_check label="Ошибка" name="Error"/>
+			<menu_item_check label="Нет" name="None"/>
+		</menu>
 		<menu_item_call label="Запрос статуса администратора" name="Request Admin Options"/>
 		<menu_item_call label="Выход из статуса администратора" name="Leave Admin Options"/>
 		<menu_item_check label="Показать меню администратора" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index 1854d43e0a7..b4692385d18 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -670,7 +670,7 @@
 		Невозможно создать выходной файл: [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		[APP_NAME] пока не поддерживает массовую передачу файлов анимации.
+		[APP_NAME] пока не поддерживает массовую передачу файлов анимации формата BVH.
 	</notification>
 	<notification name="CannotUploadReason">
 		Невозможно передать [FILE] по следующей причине: [REASON]
@@ -2630,16 +2630,16 @@ http://secondlife.com/download.
 		[NAME] – «&lt;nolink&gt;[TITLE]&lt;/nolink&gt;»
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Блокировать"/>
-			<button name="Ignore" text="Игнорировать"/>
+			<button name="Client_Side_Mute" text="Заблокировать"/>
+			<button name="Client_Side_Ignore" text="Игнорировать"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		[GROUPNAME] – «&lt;nolink&gt;[TITLE]&lt;/nolink&gt;»
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Блокировать"/>
-			<button name="Ignore" text="Игнорировать"/>
+			<button name="Client_Side_Mute" text="Заблокировать"/>
+			<button name="Client_Side_Ignore" text="Игнорировать"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml b/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml
index 8e3aac38d2d..a8fdfde1c4b 100644
--- a/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Переводить чат" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="Переводить чат" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
index b3d3ed9aad5..c106c2de794 100644
--- a/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
@@ -14,7 +14,7 @@
 					<text name="inbox_fresh_new_count">
 						Новых: [NUM]
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="Перетащите вещи в ваш инвентарь для их использования">
 						<text name="inbox_inventory_placeholder">
 							Покупки из торгового центра будут доставлены сюда.
 						</text>
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 4240514621d..8dbc4f092d0 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -832,6 +832,9 @@ support@secondlife.com.
 	<string name="anim_yes_head">
 		Согласие
 	</string>
+	<string name="multiple_textures">
+		Несколько
+	</string>
 	<string name="texture_loading">
 		Загрузка...
 	</string>
@@ -1232,7 +1235,7 @@ support@secondlife.com.
 		В вашем инвентаре нет копии этой текстуры
 	</string>
 	<string name="InventoryInboxNoItems">
-		Здесь будут появляться полученные вами предметы, например подарки.  Их можно будет перетащить в ваш инвентарь.
+		Здесь будут показаны ваши покупки из торгового центра. Их можно будет перетащить в ваш инвентарь для использования.
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3915,6 +3918,9 @@ support@secondlife.com.
 	<string name="Saved_message">
 		(Сохранено [LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		Для просмотра этого сообщения снимите флажок «Только друзья и группы могут звонить мне и отправлять IM» в окне «Настройки/Приватность».
+	</string>
 	<string name="answered_call">
 		На ваш звонок ответили
 	</string>
diff --git a/indra/newview/skins/default/xui/tr/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/tr/floater_animation_anim_preview.xml
new file mode 100644
index 00000000000..a63e1e107e4
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_animation_anim_preview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Anim Preview" title="ANIMATION.ANIM">
+	<text name="name_label">
+		Ad:
+	</text>
+	<text name="description_label">
+		Açıklama:
+	</text>
+	<button label="Karşıya Yükle (L$[AMOUNT])" name="ok_btn"/>
+	<button label="Ä°ptal" label_selected="Ä°ptal" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/tr/floater_animation_bvh_preview.xml
new file mode 100644
index 00000000000..f8800c674d0
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_animation_bvh_preview.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Animation Preview">
+	<floater.string name="failed_to_initialize">
+		Hareket başlatılamadı
+	</floater.string>
+	<floater.string name="anim_too_long">
+		Animasyon dosyası [LENGTH] saniye uzunluğunda.
+
+Maksimum animasyon uzunluÄŸu [LENGTH] saniye.
+	</floater.string>
+	<floater.string name="failed_file_read">
+		Animasyon dosyası okunamadı.
+
+[STATUS]
+	</floater.string>
+	<floater.string name="E_ST_OK">
+		Tamam
+	</floater.string>
+	<floater.string name="E_ST_EOF">
+		Dosyanın zamanından önce sonu.
+	</floater.string>
+	<floater.string name="E_ST_NO_CONSTRAINT">
+		Kısıtlama tanımı okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_FILE">
+		BVH dosyası açılamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_HIER">
+		Geçersiz HİYERARŞİ üst bilgisi.
+	</floater.string>
+	<floater.string name="E_ST_NO_JOINT">
+		KÖK veya EKLEM bulunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_NAME">
+		EKLEM adı alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_OFFSET">
+		OFSET bulunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_CHANNELS">
+		KANALLAR bulunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROTATION">
+		Döndürme sırası alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_AXIS">
+		Döndürme ekseni alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_MOTION">
+		HAREKET bulunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAMES">
+		kARE SAYISI alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_FRAME_TIME">
+		Kare zamanı alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_POS">
+		Konum değerleri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_ROT">
+		Döndürme değerleri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_FILE">
+		Çeviri dosyası açılamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HEADER">
+		Çeviri üst bilgisi okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_NAME">
+		Çeviri adları okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_IGNORE">
+		Çeviri yoksay değeri okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_RELATIVE">
+		Çeviri nisbi değeri okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_OUTNAME">
+		Çeviri çıkış adı değeri okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MATRIX">
+		Çeviri matrisi okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGECHILD">
+		Birleştirme alt birim adı alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_MERGEPARENT">
+		Birleştirme üst birim adı alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_PRIORITY">
+		Öncelik değerleri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_LOOP">
+		Döngü (tekrar) değerleri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEIN">
+		Easln (Yavaş Başlangıç) değerleri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EASEOUT">
+		EaseOut (Yavaş Bitiş) değerleri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_HAND">
+		El şekillendirme değeri alınamadı.
+	</floater.string>
+	<floater.string name="E_ST_NO_XLT_EMOTE">
+		Duygu ifadesi adı okunamadı.
+	</floater.string>
+	<floater.string name="E_ST_BAD_ROOT">
+		Yanlış kök eklem adı, &quot;kalça&quot; kullanın
+	</floater.string>
+	<text name="name_label">
+		Ad:
+	</text>
+	<text name="description_label">
+		Açıklama:
+	</text>
+	<spinner label="Öncelik" name="priority" tool_tip="Bu animasyonun diğer animasyonları geçersiz kılabileceği kontrolleri"/>
+	<check_box label="Döngü" name="loop_check" tool_tip="Bu animasyonun döngülenmesini (tekrarlanmasını) sağlar"/>
+	<spinner label="İç (%)" name="loop_in_point" tool_tip="Döngünün döndüğü animasyon noktasını belirler"/>
+	<spinner label="Dış (%)" name="loop_out_point" tool_tip="Animasyonda döngünün bittiği noktayı belirler"/>
+	<text name="hand_label">
+		El DuruÅŸu
+	</text>
+	<combo_box name="hand_pose_combo" tool_tip="Ellerin animasyon sırasında neler yaptığını kontrol eder">
+		<combo_box.item label="Yayılım" name="Spread"/>
+		<combo_box.item label="Rahat" name="Relaxed"/>
+		<combo_box.item label="Her Ä°kisi de Ä°ÅŸaret Ediyor" name="PointBoth"/>
+		<combo_box.item label="Yumruk" name="Fist"/>
+		<combo_box.item label="Sol Rahat" name="RelaxedLeft"/>
+		<combo_box.item label="Sol Ä°ÅŸaret Ediyor" name="PointLeft"/>
+		<combo_box.item label="Sol Yumruk" name="FistLeft"/>
+		<combo_box.item label="SaÄŸ Rahat" name="RelaxedRight"/>
+		<combo_box.item label="SaÄŸ Ä°ÅŸaret Ediyor" name="PointRight"/>
+		<combo_box.item label="SaÄŸ Yumruk" name="FistRight"/>
+		<combo_box.item label="Sağı Selamlıyor" name="SaluteRight"/>
+		<combo_box.item label="Yazı Yazıyor" name="Typing"/>
+		<combo_box.item label="Sağ Barış" name="PeaceRight"/>
+	</combo_box>
+	<text name="emote_label">
+		Ä°fade
+	</text>
+	<combo_box name="emote_combo" tool_tip="Yüzün animasyon sırasındaki ifadesini kontrol eder">
+		<item label="(Hiçbiri)" name="[None]" value=""/>
+		<item label="Aaaaah" name="Aaaaah" value="Aaaaah"/>
+		<item label="KorkmuÅŸ" name="Afraid" value="KorkmuÅŸ"/>
+		<item label="Kızgın" name="Angry" value="Kızgın"/>
+		<item label="Yaygın Gülümseyiş" name="BigSmile" value="Yaygın Gülümseyiş"/>
+		<item label="Canı Sıkılmış" name="Bored" value="Canı Sıkılmış"/>
+		<item label="AÄŸlama" name="Cry" value="AÄŸlama"/>
+		<item label="Dudak Bükme" name="Disdain" value="Dudak Bükme"/>
+		<item label="Utanmış" name="Embarrassed" value="Utanmış"/>
+		<item label="Kaş Çatma" name="Frown" value="Kaş Çatma"/>
+		<item label="Öpücük" name="Kiss" value="Öpücük"/>
+		<item label="Gülme" name="Laugh" value="Gülme"/>
+		<item label="Kahkaha" name="Plllppt" value="Kahkaha"/>
+		<item label="TiksinmiÅŸ" name="Repulsed" value="TiksinmiÅŸ"/>
+		<item label="Üzgün" name="Sad" value="Üzgün"/>
+		<item label="Omuz Silkme" name="Shrug" value="Omuz Silkme"/>
+		<item label="Gülümseme" name="Smile" value="Gülümseme"/>
+		<item label="Sürpriz" name="Surprise" value="Sürpriz"/>
+		<item label="Göz Kırpma" name="Wink" value="Göz Kırpma"/>
+		<item label="EndiÅŸelenme" name="Worry" value="EndiÅŸelenme"/>
+	</combo_box>
+	<text name="preview_label">
+		Şu sırada önizle
+	</text>
+	<combo_box name="preview_base_anim" tool_tip="Animasyon davranışınızı avatarınız genel hareketleri yaparken test etmek için bunu kullanın.">
+		<item label="Ayakta Duruyor" name="Standing" value="Ayakta Duruyor"/>
+		<item label="Yürüyor" name="Walking" value="Yürüyor"/>
+		<item label="Oturuyor" name="Sitting" value="Oturuyor"/>
+		<item label="Uçuyor" name="Flying" value="Uçuyor"/>
+	</combo_box>
+	<spinner label="Yavaş Başlangıç (saniye)" name="ease_in_time" tool_tip="Animasyonun kaynaştığı süre (saniye olarak)"/>
+	<spinner label="Yavaş Bitiş (saniye)" name="ease_out_time" tool_tip="Animasyonun ayrıştığı süre (saniye olarak)"/>
+	<button name="play_btn" tool_tip="Animasyonunu oynat"/>
+	<button name="pause_btn" tool_tip="Animasyonunu duraklat"/>
+	<button name="stop_btn" tool_tip="Animasyo oynatmayı durdur"/>
+	<text name="bad_animation_text">
+		Animasyon dosyası okunamadı.
+
+Poser 4&apos;ten aktarılan BHV dosyalarını tavsiye ederiz.
+	</text>
+	<button label="Karşıya Yükle (L$[AMOUNT])" name="ok_btn"/>
+	<button label="Ä°ptal" name="cancel_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_preview_animation.xml b/indra/newview/skins/default/xui/tr/floater_preview_animation.xml
index 1c526c75f9b..23b48483337 100644
--- a/indra/newview/skins/default/xui/tr/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/tr/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		Açıklama:
 	</text>
-	<button label="SL Dünyasında Oynat" label_selected="Durdur" name="Anim play btn" tool_tip="Bu animasyonu başkaları görebilecek şekilde oynatın"/>
-	<button label="Yerel Olarak Oynat" label_selected="Durdur" name="Anim audition btn" tool_tip="Bu animasyonu sadece kendinizin görebileceği şekilde oynatın"/>
+	<button label="SL Dünyasında Oynat" label_selected="Durdur" name="Inworld" tool_tip="Bu animasyonu başkaları görebilecek şekilde oynatın"/>
+	<button label="Yerel Olarak Oynat" label_selected="Durdur" name="Locally" tool_tip="Bu animasyonu sadece kendinizin görebileceği şekilde oynatın"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_test_text_vertical_aligment.xml b/indra/newview/skins/default/xui/tr/floater_test_text_vertical_aligment.xml
new file mode 100644
index 00000000000..fcb7d87287f
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_test_text_vertical_aligment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Test Floater" title="TEST PENCERESÄ°"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_tools.xml b/indra/newview/skins/default/xui/tr/floater_tools.xml
index d4ee9995dda..b0c59ced424 100644
--- a/indra/newview/skins/default/xui/tr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/tr/floater_tools.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="toolbox floater" short_title="İNŞA ET ARAÇLARI">
+	<floater.string name="grid_screen_text">
+		Ekran
+	</floater.string>
+	<floater.string name="grid_local_text">
+		Yerel
+	</floater.string>
+	<floater.string name="grid_world_text">
+		Dünya
+	</floater.string>
+	<floater.string name="grid_reference_text">
+		Referans
+	</floater.string>
+	<floater.string name="grid_attachment_text">
+		Aksesuar
+	</floater.string>
 	<floater.string name="status_rotate">
 		Nesneyi döndürmek için renkli bantları sürükleyin
 	</floater.string>
@@ -63,7 +78,12 @@
 	</text>
 	<check_box initial_value="true" label="Dokuları Uzat" name="checkbox stretch textures"/>
 	<check_box initial_value="true" label="Yasla" name="checkbox snap to grid"/>
-	<button label="Seçenekler..." name="Options..." tool_tip="İlave ağ seçeneklerine bak"/>
+	<combo_box name="combobox grid mode" tool_tip="Nesneyi konumlandırmak için ağ cetvelini seçin">
+		<combo_box.item label="Dünya" name="World"/>
+		<combo_box.item label="Yerel" name="Local"/>
+		<combo_box.item label="Referans" name="Reference"/>
+	</combo_box>
+	<button label="" name="Options..." tool_tip="İlave ağ seçeneklerine bak"/>
 	<button name="ToolCube" tool_tip="Küp"/>
 	<button name="ToolPrism" tool_tip="Prizma"/>
 	<button name="ToolPyramid" tool_tip="Piramit"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_voice_effect.xml b/indra/newview/skins/default/xui/tr/floater_voice_effect.xml
index a10da39a69e..3534a3fe906 100644
--- a/indra/newview/skins/default/xui/tr/floater_voice_effect.xml
+++ b/indra/newview/skins/default/xui/tr/floater_voice_effect.xml
@@ -42,13 +42,16 @@
 	<string name="effect_Demon">
 		Ä°blis
 	</string>
+	<string name="effect_Female Elf">
+		DiÅŸi Cin
+	</string>
 	<string name="effect_Flirty">
 		Cilveli
 	</string>
 	<string name="effect_Foxy">
 		Alımlı
 	</string>
-	<string name="effect_Halloween_2010_Bonus">
+	<string name="effect_Halloween 2010 Bonus">
 		Halloween_2010_Bonus
 	</string>
 	<string name="effect_Helium">
@@ -57,9 +60,18 @@
 	<string name="effect_Husky">
 		Güçlü
 	</string>
+	<string name="effect_Husky Whisper">
+		Boğuk Fısıltı
+	</string>
 	<string name="effect_Intercom">
 		Ä°nterkom
 	</string>
+	<string name="effect_Julia">
+		Julia
+	</string>
+	<string name="effect_Lo Lilt">
+		Yavaş Mırıltı
+	</string>
 	<string name="effect_Macho">
 		Maço
 	</string>
@@ -69,6 +81,9 @@
 	<string name="effect_Mini">
 		Mini
 	</string>
+	<string name="effect_Model">
+		Model
+	</string>
 	<string name="effect_Nano">
 		Nano
 	</string>
@@ -90,6 +105,9 @@
 	<string name="effect_Roxanne">
 		Roxanne
 	</string>
+	<string name="effect_Rumble">
+		Gurultu
+	</string>
 	<string name="effect_Sabrina">
 		Sabrina
 	</string>
@@ -102,6 +120,9 @@
 	<string name="effect_Shorty">
 		Bücür
 	</string>
+	<string name="effect_Smaller">
+		Daha Küçük
+	</string>
 	<string name="effect_Sneaky">
 		Sinsi
 	</string>
diff --git a/indra/newview/skins/default/xui/tr/menu_inventory.xml b/indra/newview/skins/default/xui/tr/menu_inventory.xml
index 6aaaab9c79f..170cdebd24c 100644
--- a/indra/newview/skins/default/xui/tr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/menu_inventory.xml
@@ -59,6 +59,7 @@
 	<menu_item_call label="Özellikler" name="Properties"/>
 	<menu_item_call label="Yeniden Adlandır" name="Rename"/>
 	<menu_item_call label="Varlık UUID&apos;sini Kopyala" name="Copy Asset UUID"/>
+	<menu_item_call label="Kes" name="Cut"/>
 	<menu_item_call label="Kopyala" name="Copy"/>
 	<menu_item_call label="Yapıştır" name="Paste"/>
 	<menu_item_call label="Bağlantı Olarak Yapıştır" name="Paste As Link"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index d24757bb799..d7b20bac4b4 100644
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -21,6 +21,7 @@
 			<menu_item_call label="MeÅŸgul" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="L$ Satın Al..." name="Buy and Sell L$"/>
+		<menu_item_call label="Satıcı Giden Kutusu..." name="MerchantOutbox"/>
 		<menu_item_call label="Hesap kontrol paneli..." name="Manage My Account"/>
 		<menu_item_call label="Tercihler..." name="Preferences"/>
 		<menu_item_call label="Araç çubuğu düğmeleri..." name="Toolbars"/>
@@ -391,9 +392,16 @@
 		<menu_item_check label="HTTP Dokuları" name="HTTP Textures"/>
 		<menu_item_check label="HTTP Envanteri" name="HTTP Inventory"/>
 		<menu_item_call label="Görüntüleri Sıkıştır" name="Compress Images"/>
+		<menu_item_call label="Visual Leak Detector&apos;ı Etkinleştir" name="Enable Visual Leak Detector"/>
 		<menu_item_check label="Mini Döküm Dosyası Hata Ayıklama Çıktısı" name="Output Debug Minidump"/>
 		<menu_item_check label="Sonraki Çalışmada Konsol Penceresi" name="Console Window"/>
-		<menu label="Günlük Tutma Seviyesini Seç" name="Set Logging Level"/>
+		<menu label="Günlük Tutma Seviyesini Seç" name="Set Logging Level">
+			<menu_item_check label="Hata ayıkla" name="Debug"/>
+			<menu_item_check label="Bilgi" name="Info"/>
+			<menu_item_check label="Uyarı" name="Warning"/>
+			<menu_item_check label="Hata" name="Error"/>
+			<menu_item_check label="Hiçbiri" name="None"/>
+		</menu>
 		<menu_item_call label="Yönetici Durumu Talep Et" name="Request Admin Options"/>
 		<menu_item_call label="Yönetici Durumundan Ayrıl" name="Leave Admin Options"/>
 		<menu_item_check label="Yönetici Menüsünü Göster" name="View Admin Options"/>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index 719dbb8781a..6681cdac7af 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -670,7 +670,7 @@ Beklenen [VALIDS]
 		Çıkış dosyası oluşturulamıyor: [FILE]
 	</notification>
 	<notification name="DoNotSupportBulkAnimationUpload">
-		[APP_NAME] şu an için animasyon dosyalarının toplu olarak karşıya yüklenmesini desteklemiyor.
+		[APP_NAME] şu an için BVH formatında animasyon dosyalarının toplu olarak yüklenmesini desteklemiyor.
 	</notification>
 	<notification name="CannotUploadReason">
 		Aşağıdaki nedenden dolayı [FILE] dosyası karşıya yüklenemedi: [REASON]
@@ -2630,16 +2630,16 @@ Talep kabul edilsin mi?
 		[NAME] adlı kişiye ait &apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos;
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Engelle"/>
-			<button name="Ignore" text="Yok say"/>
+			<button name="Client_Side_Mute" text="Engelle"/>
+			<button name="Client_Side_Ignore" text="Yok say"/>
 		</form>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		[GROUPNAME] grubuna ait &apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos;
 [MESSAGE]
 		<form name="form">
-			<button name="Mute" text="Engelle"/>
-			<button name="Ignore" text="Yok say"/>
+			<button name="Client_Side_Mute" text="Engelle"/>
+			<button name="Client_Side_Ignore" text="Yok say"/>
 		</form>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
diff --git a/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml b/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml
index c405105e007..d238388b0ee 100644
--- a/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml
+++ b/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml
@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="nearby_chat">
-	<check_box label="Sohbeti çevir" name="translate_chat_checkbox"/>
+	<layout_stack name="stack">
+		<layout_panel name="translate_chat_checkbox_lp">
+			<check_box label="Sohbeti çevir" name="translate_chat_checkbox"/>
+		</layout_panel>
+	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
index f801cc5968b..938b5a76d83 100644
--- a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
@@ -14,7 +14,7 @@
 					<text name="inbox_fresh_new_count">
 						[NUM] yeni
 					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+					<panel name="inbox_inventory_placeholder_panel" tool_tip="Öğeleri kullanmak için bunları sürükleyin ve envanterinize bırakın">
 						<text name="inbox_inventory_placeholder">
 							Pazaryerinden satın alınan öğeler buraya teslim edilir.
 						</text>
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index 199fa06d4fc..2a4e2c20a7e 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -832,6 +832,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 	<string name="anim_yes_head">
 		Evet
 	</string>
+	<string name="multiple_textures">
+		Birden Çok
+	</string>
 	<string name="texture_loading">
 		Yükleniyor...
 	</string>
@@ -1232,7 +1235,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		Envanterinizde bu dokunun kopyası yok
 	</string>
 	<string name="InventoryInboxNoItems">
-		Özel hediyeler gibi aldığınız belirli öğeler burada görünecektir.  Daha sonra bunları envanterinize sürükleyebilirsiniz.
+		Pazaryerinda satın aldıklarınız burada görünecektir. Bunları kullanmak için envanterinize sürükleyebilirsiniz.
 	</string>
 	<string name="MarketplaceURL">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
@@ -3918,6 +3921,9 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
 	<string name="Saved_message">
 		(Kaydedildi [LONG_TIMESTAMP])
 	</string>
+	<string name="IM_unblock_only_groups_friends">
+		Bu mesajı görmek için Tercihler/Gizlilik&apos;de &apos;Sadece arkadaşlar ve gruplar beni arasın veya Aİ göndersin&apos; seçeneğinin işaretini kaldırmalısınız.
+	</string>
 	<string name="answered_call">
 		Aramanız yanıtlandı
 	</string>
-- 
GitLab


From 92ae8c8472b1efb961dd9b0bb8473425d8b703e4 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 25 Apr 2012 16:45:24 -0400
Subject: [PATCH 926/933] WOLF-318: change default verbosity of some unit tests
 to keep them out of the logs when passing WOLF-363: (partial) correct
 ordering of cleaning build dir vs running           'autobuild install'

---
 build.sh                            | 14 ++++++++++----
 indra/llmessage/tests/testrunner.py |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/build.sh b/build.sh
index 7c11308f0c8..8ca3208087f 100755
--- a/build.sh
+++ b/build.sh
@@ -173,9 +173,6 @@ eval "$("$AUTOBUILD" source_environment)"
 env|sort
 
 
-# Install packages.
-"$AUTOBUILD" install --skip-license-check
-
 # Now run the build
 succeeded=true
 build_processes=
@@ -191,10 +188,19 @@ do
   begin_section "Do$variant"
   build_dir=`build_dir_$arch $variant`
   build_dir_stubs="$build_dir/win_setup/$variant"
+
+  begin_section "PreClean"
   rm -rf "$build_dir"
+  end_section "PreClean"
+
   mkdir -p "$build_dir"
   mkdir -p "$build_dir/tmp"
-  #export TMP="$build_dir/tmp"
+
+  # Install packages.
+  begin_section "AutobuildInstall" 
+  "$AUTOBUILD" install --verbose --skip-license-check
+  end_section "AutobuildInstall" 
+
   if pre_build "$variant" "$build_dir" >> "$build_log" 2>&1
   then
     if $build_link_parallel
diff --git a/indra/llmessage/tests/testrunner.py b/indra/llmessage/tests/testrunner.py
index f2c841532a9..5b9beb359b8 100644
--- a/indra/llmessage/tests/testrunner.py
+++ b/indra/llmessage/tests/testrunner.py
@@ -35,7 +35,7 @@
 import errno
 import socket
 
-VERBOSE = os.environ.get("INTEGRATION_TEST_VERBOSE", "1") # default to verbose
+VERBOSE = os.environ.get("INTEGRATION_TEST_VERBOSE", "0") # default to quiet
 # Support usage such as INTEGRATION_TEST_VERBOSE=off -- distressing to user if
 # that construct actually turns on verbosity...
 VERBOSE = not re.match(r"(0|off|false|quiet)$", VERBOSE, re.IGNORECASE)
-- 
GitLab


From b18d21486a6391b5b6ed089d5337044503a5c610 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 25 Apr 2012 17:17:08 -0400
Subject: [PATCH 927/933] Try to suppress spurious Mac ld warnings
 (lib/release/Release dir). Mindful that some autobuild packages populate only
 packages/lib/release (rather than packages/lib/debug), Linking.cmake always
 appends packages/lib/release to CMake's link_directories() directive. But
 since CMake always appends CMAKE_BUILD_TYPE to those directories, we end up
 with a phantom packages/lib/release/Release directory on the search path.
 This would be harmless except that the Mac's 'ld' command produces a warning.
 These warnings quickly make TC's "Important Messages" output useless. Try
 appending packages/lib/release only when the build type isn't already
 Release.

---
 indra/cmake/Linking.cmake | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index c5f9e2c5791..47f944f9a5d 100644
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -13,7 +13,7 @@ elseif (LINUX)
   set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin)
 elseif (DARWIN)
   set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
-  set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs/\$(CONFIGURATION)")
+  set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs")
 endif (WINDOWS)
 
 # Autobuild packages must provide 'release' versions of libraries, but may provide versions for
@@ -33,7 +33,14 @@ else(WINDOWS OR DARWIN)
   set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
 endif(WINDOWS OR DARWIN)
 
-list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
+if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+  # When we're building something other than Release, append the
+  # packages/lib/release directory to deal with autobuild packages that don't
+  # provide (e.g.) lib/debug libraries.
+  list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
+  message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}, extending AUTOBUILD_LIBS_INSTALL_DIRS")
+endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+message(STATUS "For ${CMAKE_BUILD_TYPE}, AUTOBUILD_LIBS_INSTALL_DIRS: ${AUTOBUILD_LIBS_INSTALL_DIRS}")
 link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
 
 if (LINUX)
-- 
GitLab


From 784ec584013eff80ab31d10370c14e2d954cea51 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 26 Apr 2012 00:40:42 +0300
Subject: [PATCH 928/933] MAINT-813 FIXED crash when trying to access the
 region info after viewer disconnect. Added checks for LLViewerRegion pointer
 in LLViewerObject being invalid.

---
 indra/newview/llviewerobject.cpp | 16 +++++++++++++---
 indra/newview/llworld.cpp        | 32 ++++++++++++++++++++------------
 indra/newview/llworld.h          |  5 +++++
 3 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index e590f29a9a3..cd300accb7f 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -877,6 +877,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 	LLMemType mt(LLMemType::MTYPE_OBJECT);
 	U32 retval = 0x0;
 	
+	// If region is removed from the list it is also deleted.
+	if (!LLWorld::instance().isRegionListed(mRegionp))
+	{
+		llwarns << "Updating object in an invalid region" << llendl;
+		return retval;
+	}
+
 	// Coordinates of objects on simulators are region-local.
 	U64 region_handle;
 	mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
@@ -3478,7 +3485,8 @@ LLNameValue *LLViewerObject::getNVPair(const std::string& name) const
 
 void LLViewerObject::updatePositionCaches() const
 {
-	if(mRegionp)
+	// If region is removed from the list it is also deleted.
+	if(mRegionp && LLWorld::instance().isRegionListed(mRegionp))
 	{
 		if (!isRoot())
 		{
@@ -3495,7 +3503,8 @@ void LLViewerObject::updatePositionCaches() const
 
 const LLVector3d LLViewerObject::getPositionGlobal() const
 {	
-	if(mRegionp)
+	// If region is removed from the list it is also deleted.
+	if(mRegionp && LLWorld::instance().isRegionListed(mRegionp))
 	{
 		LLVector3d position_global = mRegionp->getPosGlobalFromRegion(getPositionRegion());
 
@@ -3514,7 +3523,8 @@ const LLVector3d LLViewerObject::getPositionGlobal() const
 
 const LLVector3 &LLViewerObject::getPositionAgent() const
 {
-	if (mRegionp)
+	// If region is removed from the list it is also deleted.
+	if(mRegionp && LLWorld::instance().isRegionListed(mRegionp))
 	{
 		if (mDrawable.notNull() && (!mDrawable->isRoot() && getParent()))
 		{
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index fbd8b3ada39..3d971e738e3 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1188,20 +1188,23 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 		iter != LLCharacter::sInstances.end(); ++iter)
 	{
 		LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
-		LLVector3d pos_global = pVOAvatar->getPositionGlobal();
-		LLUUID uuid = pVOAvatar->getID();
-		if( !pVOAvatar->isDead()
-			&& !pVOAvatar->isSelf()
-			&& !uuid.isNull() &&
-			dist_vec_squared(pos_global, relative_to) <= radius_squared)
+
+		if (!pVOAvatar->isDead() && !pVOAvatar->isSelf())
 		{
-			if(positions != NULL)
-			{
-				positions->push_back(pos_global);
-			}
-			if(avatar_ids !=NULL)
+			LLVector3d pos_global = pVOAvatar->getPositionGlobal();
+			LLUUID uuid = pVOAvatar->getID();
+
+			if (!uuid.isNull()
+				&& dist_vec_squared(pos_global, relative_to) <= radius_squared)
 			{
-				avatar_ids->push_back(uuid);
+				if(positions != NULL)
+				{
+					positions->push_back(pos_global);
+				}
+				if(avatar_ids !=NULL)
+				{
+					avatar_ids->push_back(uuid);
+				}
 			}
 		}
 	}
@@ -1232,6 +1235,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
 	}
 }
 
+bool LLWorld::isRegionListed(const LLViewerRegion* region) const
+{
+	region_list_t::const_iterator it = find(mRegionList.begin(), mRegionList.end(), region);
+	return it != mRegionList.end();
+}
 
 LLHTTPRegistration<LLEstablishAgentCommunication>
 	gHTTPRegistrationEstablishAgentCommunication(
diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h
index d8ab4bc5080..f350009d100 100644
--- a/indra/newview/llworld.h
+++ b/indra/newview/llworld.h
@@ -157,6 +157,11 @@ class LLWorld : public LLSingleton<LLWorld>
 		std::vector<LLVector3d>* positions = NULL, 
 		const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const;
 
+	// Returns 'true' if the region is in mRegionList,
+	// 'false' if the region has been removed due to region change
+	// or if the circuit to this simulator had been lost.
+	bool isRegionListed(const LLViewerRegion* region) const;
+
 private:
 	region_list_t	mActiveRegionList;
 	region_list_t	mRegionList;
-- 
GitLab


From 93c68c7c12f2a0d19e94bae833554139f78914e9 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 18 May 2012 21:03:45 -0700
Subject: [PATCH 929/933] MAINT-959 FIX [PUBLIC]Trouble resizing tabbed
 floaters don't auto position other floater when it is hosted

---
 indra/llui/llfloater.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index a8a3a1f906c..8ca1e685a96 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -3307,8 +3307,11 @@ void LLFloater::stackWith(LLFloater& other)
 	
 	setShape(next_rect);
 
-	other.mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP;
-	other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
+	if (!other.getHost())
+	{
+		other.mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP;
+		other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
+	}
 }
 
 void LLFloater::applyRelativePosition()
-- 
GitLab


From a254d0e9b0af8e6f37fedafa6147b20d5659784f Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 22 May 2012 05:37:35 -0400
Subject: [PATCH 930/933] Added tag 3.3.2-beta1 for changeset d29a260119f8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f0cd9f07361..dfcc0edda9e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -292,3 +292,4 @@ b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
 5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
 c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate
 c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release
+d29a260119f8d5a5d168e25fed0c7ea6b3f40161 3.3.2-beta1
-- 
GitLab


From dd0094ada48af0a7596eba218ddc5f43197e4823 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 22 May 2012 05:39:57 -0400
Subject: [PATCH 931/933] Added tag 3.3.2-beta2 for changeset 675668bd24d3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index dfcc0edda9e..28e4438abf6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -293,3 +293,4 @@ b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start
 c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate
 c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release
 d29a260119f8d5a5d168e25fed0c7ea6b3f40161 3.3.2-beta1
+675668bd24d3bea570814f71762a2a806f7e1b8d 3.3.2-beta2
-- 
GitLab


From b2b446aed7f7f32151bc152ba25d44253ebf864f Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 24 May 2012 10:01:24 -0400
Subject: [PATCH 932/933] Added tag viewer-release-candidate, 3.3.2-release for
 changeset 675668bd24d3

---
 .hgtags | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.hgtags b/.hgtags
index 28e4438abf6..4f3f55ad943 100644
--- a/.hgtags
+++ b/.hgtags
@@ -294,3 +294,6 @@ c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate
 c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release
 d29a260119f8d5a5d168e25fed0c7ea6b3f40161 3.3.2-beta1
 675668bd24d3bea570814f71762a2a806f7e1b8d 3.3.2-beta2
+c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate
+675668bd24d3bea570814f71762a2a806f7e1b8d viewer-release-candidate
+675668bd24d3bea570814f71762a2a806f7e1b8d 3.3.2-release
-- 
GitLab


From a519e34f02b4b2663fe082ba9ad12f1b423669cb Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 28 May 2012 09:23:24 -0400
Subject: [PATCH 933/933] inconsequential change to force new ticket number

---
 BuildParams | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/BuildParams b/BuildParams
index d24666aff9a..cff51a286b0 100644
--- a/BuildParams
+++ b/BuildParams
@@ -138,19 +138,6 @@ oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
 oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
 oz_viewer-beta-review.email = oz@lindenlab.com
 
-oz_project-1.build_debug_release_separately = true
-oz_project-1.codeticket_add_context = false
-oz_project-1.email = oz@lindenlab.com
-oz_project-2.build_debug_release_separately = true
-oz_project-2.codeticket_add_context = false
-oz_project-2.email = oz@lindenlab.com
-oz_project-3.build_debug_release_separately = true
-oz_project-3.codeticket_add_context = false
-oz_project-3.email = oz@lindenlab.com
-oz_project-4.build_debug_release_separately = true
-oz_project-4.codeticket_add_context = false
-oz_project-4.email = oz@lindenlab.com
-
 # =================================================================
 # asset delivery 2010 projects
 # =================================================================
-- 
GitLab